Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

Raybarg

@Raybarg
About
Posts
30
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Seriously?
    R Raybarg

    Richard MacCutchan wrote:

    -knowledge on how to make variables -knows how to make different loops

    I was ~12 years old and using my brothers C64 whenever he was not at home for some time to somehow discover what variables and loops are. When finally understanding those fundamentals, my mind was blown in front of the vastness of possibilities they offer. I am sure I muttered the words aloud at the time, with my helium-voice; "the possibilities are limitless!" Rest of my life has been just a case of exploring the limitless possibilities of my childhood discovery. Learning of other things has been merely a byproduct. In my life I've been trough few different levels of education in which there has been programming classes, in which the reoccurring phenomenon was "some" other students succeeding with good grades trough them without achieving/unlocking the mind-awe experience of "truly" understanding the possibilities offered by use of variables.

    The Lounge tutorial java beta-testing question

  • Table join performance - the saga continues...
    R Raybarg

    Primary Key GUID!! What an awesome idea. Wouldnt that result with forced full table scan on all type of queries?

    The Lounge learning python database com sysadmin

  • Contrary to popular belief....
    R Raybarg

    Dont value yourself a good person based on that quiz. Most of the points given are maybe reflected as "good" in one society (I think someone pointed this out too in the comments). Most did not have fitting answer at all, like communicating with the other people. That Quiz makes it seem like our lives are based on making all our decisions in our own head and not talk about how we feel and rely on others help in solving some differences. Number 9 really appalled me; "Your friend asks you to sponsor her for a charity marathon but your rent is due and your paycheck is late. Do you:" You have option to Not communicate, tell her you will do it later and hope she will forget it (insinuating an intention of not doing it, thus this is a lie)... This is NOT the lowest point answer... somehow lieing is better for a good person than being HONEST, like explaining her you dont believe in charity because hardly any money makes it to the cause. The other two options are to pay some (youre broke and you must still get even more broke, because someone just HAPPENS to have a charity marathon.. what does that even mean, "charity marathon"...). Second highest scoring option is to get in trouble with your land lord because you couldnt pay your rent "But, there was this charity..." come on! The worst answer is the best answer in my interpretation because its being honest (I must assume that is not telling a lie since the answer in the quiz is stating you say that, without more detail like in the first answer). Now, being honest about that, she could correct your false impression (if it is false) by providing more accurate information and your ideals might change. THEN you could go on being HONEST about the fact youre so goddamn tight on your money, and surely she would understand. If you believe in charity, but your situation is tight on money, you would then honestly explain this and Surely she would understand. She is into charity work, isnt she? Aint them supposed to be the kind of ppl who understand human life which can be hard at times. Where is option for this?!

    The Lounge html com career

  • With all these touch screen devices...
    R Raybarg

    ...they should implement new touch method; Faceplant. When its too much for a facepalm that you just smash your face at it, it would immediately run a sophisticated application which would find out the reason of the daily horror youre facing and type properly aggravated post with delicate use of profanities as a reply to whichever forum or system it is. It would evolve humankind greatly forward in quick fashion, and leave all normal display users jealous of those touch screen device users.

    The Weird and The Wonderful

  • The definition of distractable
    R Raybarg

    But it would be less optimized, integers integers!!

    The Lounge c++ architecture question

  • More mining from our deep seam of WTF's
    R Raybarg

    Thanks for clarification. I was in false impression that "VB" would be also referring to VB.NET but now I see VB.NET is just another compiler for .Net framework and is far from same thing as VB. Then there is VBA which I often confuse with too. Although VBA is something I have to use sometimes when some Excel-crazy person begs me do something within excel which seems only possible with VBA, then I get to tackle some hundred-sheet workbook with thousands character long cell functions.

    The Weird and The Wonderful ruby css database json

  • More mining from our deep seam of WTF's
    R Raybarg

    Could this sentence be one of those which could be my last: "Whats wrong with VB6?"

    The Weird and The Wonderful ruby css database json

  • Why you get nightmares of COBOL
    R Raybarg

    Thats just awesome! I remember year 2000 turn programming horrors so vividly, not that we had much leftovers that could have broken, but everyone who were not programmers were so afraid the world will turn upside down and their wristwatches will explode if theyre wearing them when year changes... I bet for COBOL programmers it was thousand times more horror.

    The Soapbox question sysadmin help

  • As Keyword, conversion of derived class to base class type
    R Raybarg

    Does it matter why I want to? My app is using .dll's which are returning class arrays. My previous problem was that the application was completed and working well when it was required to use custom data in a way I found "good" solution to change my application to use derived class from the class type returned from the .dll layer, it just worked as long as I did not need to use same class array objects as parameters in .dll layer method calls.

    C# question tutorial

  • As Keyword, conversion of derived class to base class type
    R Raybarg

    Here is example code I made for this question:

    using System;
    namespace TestingAs
    {
    class baseClass
    {
    public string foo
    {
    get;
    set;
    }
    }
    class derivedClass : baseClass
    {
    public string bar
    {
    get;
    set;
    }
    }

    class Program
    {
        static void Main(string\[\] args)
        {
            derivedClass derived = new derivedClass();
            baseClass b = derived as baseClass;
            Console.WriteLine("type is {0}", b.GetType());
            Console.ReadLine();
        }
    }
    

    }

    I also tried just casting baseclass b = (baseClass)derived; which gives the same result: type is TestingAs.derivedClass Why b is not type of baseClass? How would I "convert" my derived class into base class type? Thank you in advance!

    C# question tutorial

  • We have the technology to build the world's first bionic er..Duck.
    R Raybarg

    Is that duck SMILING?!

    The Lounge html css announcement

  • DOS prompt
    R Raybarg

    It wasnt many months of PC usage when I already managed to Ctrl+Alt+Del using only my right hand because most of the time my left hand was occupied in holding phone (wired phone, you know those old clunky ones wih rolling number interface instead of buttons, hehe). Those days take me into what I am about to babble about, which is (surprisingly) not offtopic. I was already been a SysOp for some time when OS/2 Warp was introduced and we made the decision to move into using it in our BBS. I cant even remember what its prompt was called, was it "OS/2 Prompt"? Still I allways thought of it as "DOS prompt"... but nowadays (as I dont treasure badges of honors) I just refer to those as "prompt" or "console"... depends on how I feel. (usually using "console" is to annoy some other people who seem to fail in understanding my meaning because they want to argue about the word used which ultimately reveals they actually did understand what I meant in saying "No you cant call prompt a console".) Some users who dont know computers so well refer to it as "that black box" which is allways kind of cute, thinking "prompt = blackbox" :)

    The Lounge sales

  • How long does it take to boot up?
    R Raybarg

    Piece of history I just recalled after reading this article about Bloatware[^] What I recalled was that loooong time ago around the time of DOS version which came with the option to make multiple config.sys and autoexec.bat sections having a boot-up menu to select which to use. On my computer there was like 10 options with all those EMS/XMS drivers, different HMA drivers/resident programs and their loading orders. Back then it felt so geeky to know a mouse driver devours 32kb memory on load but as resident only takes 4kb, so it has to load first because after that there might not be enough memory to load and you end up with unused HMA as it is loaded in system memory. I used to have scanner and tape driver (for backup) which had their own huge drivers, ofcourse I allways had to reboot in order to use them as their drivers were never loaded in "normal" boot options - they were so SLOW to load. Most of the boot options were there to distribute needs to boot as fast as possible and slow ones were for specific task. Rebooting was not a pain in the ass since I remember using stopwatch to time them and it was within some "seconds" for the fastest ones. Sometimes I wish I would have so much power over todays operating systems so that I could boot up for "browser only" option. Or for any specific task an option that only loads the necessary components... I would love to dig into some "system.conf" files with text editor and modify these. Thinking about gaming, wouldnt it be fancy to run a "sandbox" option with the gfx/sound drivers and without internet connection to dedicate full system provess for only one instance that's a game. Well, that starts to sound like "good old amiga and their own operating system per game way". Or maybe I have just become dull and dont know how to tweak windows or linux that way. (still, using sysinternals autoruns app I can see windows loads those dozens and dozens drivers I dont have the faintest clue about!). Duh!

    The Lounge com game-dev linux performance tutorial

  • Posters read google news and post to CP
    R Raybarg

    I have to agree. Most of the links I see these days without any thought to it gets easily ignored. Sometimes link to odd domain name gets ignored because I already feel like its slow and has loading errors or such. Less and less links are interesting. Things like "funny pic", "breaking news", "good vid"... theyre... "same same but different"?

    The Lounge csharp com tools question announcement

  • Windows 7 x86
    R Raybarg

    Dunno if this is offtopic, but to note: At Assembly'09 there was Microsoft sponsored competition to run 7 in "crappiest" system possible. http://www.assembly.org/summer09/compos/sponsored-unofficial/microsoft_competitions_2009?set_language=en[^] I couldnt find link to results, maybe theyre released in Web after the party. Also I cannot remember exactly the system specs but I think it was 130mhz P2 with (this I remember right) 8 megabytes memory.

    The Lounge sysadmin windows-admin question announcement

  • Exception use instead of validation
    R Raybarg

    Hi again, more questions. In my project I have this service layer I am using, to simplify it could be like this:

    ServiceClient myService = new ServiceClient();
    SomeDataType[] result = myService.GetSomeData(...arguments...);
    myService.Close();

    It's 3rd party layer and lacks proper documentation so I played around with this. With some arguments the result is null. I already have my application use these results in grids and with CurrencyManager and BindingContext. The design is assuming that these results from service methods should never be null (but what if they are). So I decided to do "helper" class which will contain all those service calls and throw exception if data is not valid instead of checking if the data is valid outside.

            ServiceClient myService = new ServiceClient();
            SomeDataType\[\] result;
    
            try
            {
                result = myService.GetSomeData();
    
                if (result == null)
                {
                    throw new ArgumentNullException("result", "Service method GetSomeData() returned null.");
                }
            }
            finally
            {
                myService.Close();
            }
            return result;
    

    Because the service raises no exception in the testing case I had it return null, it just returned null, though it has to be a case of an exception because it never shouldnt. So would this be the "proper" way to make sure I get the exception when I think the underlying layer (service) should have raised it?

    C# design testing beta-testing question

  • I dont feel like going back to work...
    R Raybarg

    Is it an coincidence that a case of beer has 24 bottles in it and day has 24 hours in it? "No."

    The Lounge php visual-studio com collaboration beta-testing

  • Your First Computer...
    R Raybarg

    My first computer before C64 was the one and only completely finnish designed and manufactured computer Telmac TMC-600. http://www.hobbylabs.org/telmac.htm[^] Exactly like in the picture with red background. Few years ago I asked my mother for the chances that they might still have that computer because I didnt take it with me when I first time moved out. Well, no chances :( Edit: Another link in finnish museum which has this computer model: http://www.pelikonepeijoonit.net/cgi-bin/page.cgi?pkpcode=telmac[^]

    modified on Wednesday, July 29, 2009 1:24 PM

    The Lounge com

  • OOP approach, static method
    R Raybarg

    Since I got 2 replies already saying its "weird" to have static method like that, I changed it. Now instead of simply calling TheDocument.Print(...); I first have to create instance oobject of it;

            TheDocument doc = new TheDocument(TheList);
            doc.Print();
    

    And I already feel more confident that this is more "proper". Atleast with this approach I can in the future derive from IDisposable interface if I ever need, and this approach more easily yields to using. I guess. For the sake of making it more readable to "end user of the class" should I consider using a property for "the list", like .WhateverThisListIs = TheList?

    C# question csharp css hardware data-structures

  • OOP approach, static method
    R Raybarg

    Cutting right into my host of questions, here is a crackdown of my class:

    class TheDocument
    {
        private TheData\[\] \_list;
    
        public TheDocument(TheData\[\] list)
        {
            \_list = list;
        }
    
        public static void Print(TheData\[\] list)
        {
            TheDocument d = new TheDocument(list);
            PrintDocument pd = new PrintDocument();
            pd.PrintPage += new PrintPageEventHandler(d.PrintPage);
            pd.Print();
        }
    
        private void PrintPage(object sender, PrintPageEventArgs ev)
        {
            // Printing code...
        }
    }
    

    Explaining above code, I came to decide that I need no multiple instances of this document-printing class so I made static Print() method which will initialize the instance and does the trick. So from my application I can just call TheDocument.Print(...); and nothing else. The question is, I couldnt find a way to pass around TheData[] array in other way than either trough constructor or after construction setting it to the instance of an object. This is where all my questions start to roam and I find myself a bit off track; This static method is instance of the calling instance? So within new TheDocument instance I have no access to it without reference? All the printing stuff is merely serving as an example. My real world solution will inherit from more robust printing class and only contain the code for a specific type of document. I know theres plenty of 3rd party solutions for document designing and using them to print, but I will have host of different types of "simple list" kind of documents to print and decided to take this brute approach. Coming from VB and C(embedded) programming all this OOP and fancy C# stuff are so overwhelming ;) Feels like I need proper OOP course or something since I dont even know if there is a term to call class with static method which will make instance of the class itself in it. Or if the whole class is static, is there a name for it instead of saying "static class". Another question about OOP I would ask is if I have alot of variables or properties in one object and define new object in it, what is the best way of accessing those variables or properties. Handing out reference to "parent" object kind of makes that approach less encapsulated?

    C# question csharp css hardware data-structures
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups