As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
We're funding a new Acquisitions Incorporated series on Kickstarter right now! Check it out at https://www.kickstarter.com/projects/pennyarcade/acquisitions-incorporated-the-series-2

YA[Programming]T :: Interview? That's an MVC thing, right?

17879818384100

Posts

  • Monkey Ball WarriorMonkey Ball Warrior A collection of mediocre hats Seattle, WARegistered User regular
    edited August 2012
    I got lucky. I had a professor recommend me to another professor, who hooked me up with an internship, that went well and that I liked, so when they offered me a job paying more than I was expecting I took it.

    I managed to completely skip the "looking for a job" part. Which is fine by me, for now.

    Monkey Ball Warrior on
    "I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Working on my first "Metro style" (Windows Store) app in VS 2012. The XAML makes sense to me as a WPF guy, but some of it is a bit obtuse. Like the live tile system is odd. You basically can't do "real time" live tiles without using some special cloud service that Microsoft has to approve you for. The rest of us seem to be on 15 minute timers...unless I missed something fundamental in the docs.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • MortalToasterMortalToaster Registered User regular
    jaziek wrote: »
    Infidel wrote: »
    Are you looking at being at PAX Dev this year?

    I'll be there, if anyone will be there too then let me know.

    As for salary, MT, as always comes up the biggest factor is location (cost of living). Whereabouts are you expecting to land work, and what is your experience going to be? I take it you're finishing up school atm?

    late reply here, but i graduated with a BS in CS in 2008 (well rounded, had some practical experience - not as mathy as it seems like some of you had), got an MBA, and am currently doing radar engineering work for the next year or so while i pay off student loans. i've done some freelance work since i graduated, but effectively my experience level is comparable to that of a new grad. i'm well aware location is a big factor in pay, but i'm looking at San Fran, NYC, Boston, or Seattle for my next adventure.

    When you were graduating, how did you go about looking for jobs?

    It seems to me like as a new graduate I'll basically be screwed in terms of what jobs I'm actually qualified for.

    i was in ROTC for the air force, so i commissioned and went active after i graduated. i kind of fell into my current job as a guy was retiring the same time i was getting out, so they offered me the position.

  • bowenbowen How you doin'? Registered User regular
    GnomeTank wrote: »
    Working on my first "Metro style" (Windows Store) app in VS 2012. The XAML makes sense to me as a WPF guy, but some of it is a bit obtuse. Like the live tile system is odd. You basically can't do "real time" live tiles without using some special cloud service that Microsoft has to approve you for. The rest of us seem to be on 15 minute timers...unless I missed something fundamental in the docs.

    This is all gibberish to me.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • urahonkyurahonky Registered User regular
    struct ide_tp_ops {
    	void	(*exec_command)(struct hwif_s *, u8);
    	u8	(*read_status)(struct hwif_s *);
    	u8	(*read_altstatus)(struct hwif_s *);
    	void	(*write_devctl)(struct hwif_s *, u8);
    
    	void	(*dev_select)(ide_drive_t *);
    	void	(*tf_load)(ide_drive_t *, struct ide_taskfile *, u8);
    	void	(*tf_read)(ide_drive_t *, struct ide_taskfile *, u8);
    
    	void	(*input_data)(ide_drive_t *, struct ide_cmd *,
    			      void *, unsigned int);
    	void	(*output_data)(ide_drive_t *, struct ide_cmd *,
    			       void *, unsigned int);
    };
    

    Could anyone explain what this is actually doing? This is in a .h file for one of the ide drivers. This line:
    void	(*exec_command)(struct hwif_s *, u8);
    

    Does this mean I can do something like: ide_tp_ops->exec_command? And then that calls the hwif_s struct?

  • EtheaEthea Registered User regular
    urahonky wrote: »
    struct ide_tp_ops {
    	void	(*exec_command)(struct hwif_s *, u8);
    	u8	(*read_status)(struct hwif_s *);
    	u8	(*read_altstatus)(struct hwif_s *);
    	void	(*write_devctl)(struct hwif_s *, u8);
    
    	void	(*dev_select)(ide_drive_t *);
    	void	(*tf_load)(ide_drive_t *, struct ide_taskfile *, u8);
    	void	(*tf_read)(ide_drive_t *, struct ide_taskfile *, u8);
    
    	void	(*input_data)(ide_drive_t *, struct ide_cmd *,
    			      void *, unsigned int);
    	void	(*output_data)(ide_drive_t *, struct ide_cmd *,
    			       void *, unsigned int);
    };
    

    Could anyone explain what this is actually doing? This is in a .h file for one of the ide drivers. This line:
    void	(*exec_command)(struct hwif_s *, u8);
    

    Does this mean I can do something like: ide_tp_ops->exec_command? And then that calls the hwif_s struct?


    Yeap, looks like a struct of function pointers to me.

  • urahonkyurahonky Registered User regular
    Sorry, I was just a bit confused about the use of structs. But it looks like I'm getting the hang of them.

  • EtheaEthea Registered User regular
    structs are a structured collection of primitive types given unique labels, each member of the struct can be considered to be public in OO models.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    The joy of structs is when you realize they are just blocks of sequential, packed, memory, and that the labels you access them with are really just semantic. Knowing type sizes, you can get the exact same information by simply "reading" the memory.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    GnomeTank wrote: »
    The joy of structs is when you realize they are just blocks of sequential*, packed**, memory, and that the labels you access them with are really just semantic. Knowing type sizes, you can get the exact same information by simply "reading" the memory.

    * Sometimes padded
    ** Sometimes not quite as packed as you might expect!

  • bowenbowen How you doin'? Registered User regular
    Ah yes, I remember working on a program that saved it's states and data right from structs. And then we were scratching our heads, after moving from visual studio 6 to mingw (whatever version) why that data wasn't imported properly. Turns out padding was an issue.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    	struct s {
    		unsigned char a[16];
    		unsigned short b;
    		unsigned short c;
    	}
    

    GCC will apparently lay that out as
    16 bytes of a
    2 bytes of b
    2 bytes padding
    2 bytes of c
    2 bytes padding
    as I learned trying to interface with MSVC which has no padding or alignment bytes

  • bowenbowen How you doin'? Registered User regular
    edited August 2012
    Yeah. We had to 0 pad when moving to gcc/mingw.

    To keep compatibility anyways.

    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • EtheaEthea Registered User regular
    GnomeTank wrote: »
    The joy of structs is when you realize they are just blocks of sequential, packed, memory, and that the labels you access them with are really just semantic. Knowing type sizes, you can get the exact same information by simply "reading" the memory.

    You can also abuse these rules to build a quasi object oriented model by specify your parent struct as the first item in your struct. Next up after that is a manual vtable and you are cooking with bad objects in C.

  • zeenyzeeny Registered User regular
    Ethea wrote: »
    GnomeTank wrote: »
    The joy of structs is when you realize they are just blocks of sequential, packed, memory, and that the labels you access them with are really just semantic. Knowing type sizes, you can get the exact same information by simply "reading" the memory.

    You can also abuse these rules to build a quasi object oriented model by specify your parent struct as the first item in your struct. Next up after that is a manual vtable and you are cooking with bad objects in C.

    Manually keeping track of the vtable? WHERE DO I SIGN UP?

  • EtheaEthea Registered User regular
    zeeny wrote: »
    Ethea wrote: »
    GnomeTank wrote: »
    The joy of structs is when you realize they are just blocks of sequential, packed, memory, and that the labels you access them with are really just semantic. Knowing type sizes, you can get the exact same information by simply "reading" the memory.

    You can also abuse these rules to build a quasi object oriented model by specify your parent struct as the first item in your struct. Next up after that is a manual vtable and you are cooking with bad objects in C.

    Manually keeping track of the vtable? WHERE DO I SIGN UP?

    http://stackoverflow.com/questions/415452/object-orientation-in-c
    http://stackoverflow.com/questions/8194250/polymorphism-in-c

  • zeenyzeeny Registered User regular
    Ethea wrote: »
    zeeny wrote: »
    Ethea wrote: »
    GnomeTank wrote: »
    The joy of structs is when you realize they are just blocks of sequential, packed, memory, and that the labels you access them with are really just semantic. Knowing type sizes, you can get the exact same information by simply "reading" the memory.

    You can also abuse these rules to build a quasi object oriented model by specify your parent struct as the first item in your struct. Next up after that is a manual vtable and you are cooking with bad objects in C.

    Manually keeping track of the vtable? WHERE DO I SIGN UP?

    http://stackoverflow.com/questions/415452/object-orientation-in-c
    http://stackoverflow.com/questions/8194250/polymorphism-in-c

    I've done it. At the time it made a university professor very, very disappointed.

  • bowenbowen How you doin'? Registered User regular
    That is essentially how C++ does it, isn't it?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    It is. It's not standard specified though, C++ compilers are sort of free to do whatever they want in their ABI. There are a few rules around keeping backwards compatibility with C, but the fact that nearly every C++ compiler does the exact same thing when dealing with the vptr is a coincidence of it likely being the best way anyone has come up with yet.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • zeenyzeeny Registered User regular
    GnomeTank wrote: »
    It is. It's not standard specified though, C++ compilers are sort of free to do whatever they want in their ABI. There are a few rules around keeping backwards compatibility with C, but the fact that nearly every C++ compiler does the exact same thing when dealing with the vptr is a coincidence of it likely being the best way anyone has come up with yet.

    Mmmmm, I remember debugging vtable management in several C++ compilers and going "Wtf, wait no. FUCK NO." at virtual pointer locations and sizes, but again, this was years and eons ago.

  • bowenbowen How you doin'? Registered User regular
    I'd really like to get proper reflection for loaded executable code in C/C++ though.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • InfidelInfidel Heretic Registered User regular
    When I was first learning C++, I didn't get why virtual was required and worked in exactly the weird way it did.

    When I thought about how things are probably implemented, it started to click.

    Fuck doing that myself, C++ is a good thing over that.

    Function tables for state machine / microcode in C? Sure.

    Framing up my own "classes" in C? Fuck that.

    OrokosPA.png
  • zeenyzeeny Registered User regular
    Infidel wrote: »
    When I was first learning C++, I didn't get why virtual was required and worked in exactly the weird way it did.

    When I thought about how things are probably implemented, it started to click.

    Fuck doing that myself, C++ is a good thing over that.

    Function tables for state machine / microcode in C? Sure.

    Framing up my own "classes" in C? Fuck that.

    My story was a class assignment formulated as a classic OOP exercise that was limited to C. There wasn't an actual point behind the limitation. A simple case of "Because I said so."(which probably meant "Because, fuck, I don't want to read shitty student C++ code, I'd rather you don't think and write a zillion functions in their separate header files, fuck it."). BUT WHAT DID THAT PROF KNOW THAT I WAS A REBEL BABY? ;o/

  • zeenyzeeny Registered User regular
    bowen wrote: »
    I'd really like to get proper reflection for loaded executable code in C/C++ though.

    I have an important message about reflection: Fuck reflection and fuck people who use it everywhere. Put them in the same cell with the regex crowd AND LOCK THAT DOOR.
    Bowen, if you are one of those, I'll make bowen cut you.

  • bowenbowen How you doin'? Registered User regular
    I'd just like proper polymorphism across multiple projects without copying the code into my new project, to be honest.

    Doesn't bother me that much. Fuck regex though.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • InfidelInfidel Heretic Registered User regular
    I'll do something like use reflection for serializing of objects for databases automagically and shit.

    And it works great, until someone else comes along and tries to work with things but doesn't understand it and breaks the database schema completely. :rotate:

    I don't bother with that much anymore...

    OrokosPA.png
  • urahonkyurahonky Registered User regular
    Alright I'm still stuck... When I type "lspci -v" into terminal I see lots of information. Specifically I see our HDDs and they specifically say which kernel driver is loaded for that device. When I type lsmod I don't see any of those drivers in there. is there some other way to see the actual kernel drivers?

  • Monkey Ball WarriorMonkey Ball Warrior A collection of mediocre hats Seattle, WARegistered User regular
    Doesn't lsmod only show the modules that are loaded, as opposed to the drivers in use that are baked into the kernel?

    "I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
  • ASimPersonASimPerson Cold... and hard.Registered User regular
    Phyphor wrote: »
    	struct s {
    		unsigned char a[16];
    		unsigned short b;
    		unsigned short c;
    	}
    

    GCC will apparently lay that out as
    16 bytes of a
    2 bytes of b
    2 bytes padding
    2 bytes of c
    2 bytes padding
    as I learned trying to interface with MSVC which has no padding or alignment bytes

    Wait, you're saying the MS compiler doesn't align structs?

    I know alignment doesn't matter as much on x86 (as opposed to most of the platforms we ship, which is a wonderfully confusing way to crash the box) but I still thought it was good to align things for performance?

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    ASimPerson wrote: »
    Phyphor wrote: »
    	struct s {
    		unsigned char a[16];
    		unsigned short b;
    		unsigned short c;
    	}
    

    GCC will apparently lay that out as
    16 bytes of a
    2 bytes of b
    2 bytes padding
    2 bytes of c
    2 bytes padding
    as I learned trying to interface with MSVC which has no padding or alignment bytes

    Wait, you're saying the MS compiler doesn't align structs?

    I know alignment doesn't matter as much on x86 (as opposed to most of the platforms we ship, which is a wonderfully confusing way to crash the box) but I still thought it was good to align things for performance?

    No, it does, but that structure doesn't need any because the shorts are 2 byte aligned to begin with

  • agoajagoaj Top Tier One FearRegistered User regular
    What about C unions? Are they padded and optimized as well?

    ujav5b9gwj1s.png
  • GrobianGrobian What's on sale? Pliers!Registered User regular
    Unions would only be padded at the end, right, so what would it matter?

    PoGo friend code: 7835 1672 4968
  • khainkhain Registered User regular
    Phyphor wrote: »
    ASimPerson wrote: »
    Phyphor wrote: »
    	struct s {
    		unsigned char a[16];
    		unsigned short b;
    		unsigned short c;
    	}
    

    GCC will apparently lay that out as
    16 bytes of a
    2 bytes of b
    2 bytes padding
    2 bytes of c
    2 bytes padding
    as I learned trying to interface with MSVC which has no padding or alignment bytes

    Wait, you're saying the MS compiler doesn't align structs?

    I know alignment doesn't matter as much on x86 (as opposed to most of the platforms we ship, which is a wonderfully confusing way to crash the box) but I still thought it was good to align things for performance?

    No, it does, but that structure doesn't need any because the shorts are 2 byte aligned to begin with

    The ISO C standard requires that structures are aligned to the lowest common multiple of the alignments of all members of the struct unless packed is specified.

    I would expect unions to just be treated as the largest data type in the union.

  • urahonkyurahonky Registered User regular
    edited August 2012
    Doesn't lsmod only show the modules that are loaded, as opposed to the drivers in use that are baked into the kernel?

    Yeah that's what it seems like. But I also see:
    00:1f.2 RAID bus controller: Intel Corporation 82801 SATA Controller [RAID mode] (rev 04)
    	Subsystem: Dell Device 047e
    	Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 41
    	I/O ports at 4090 [size=8]
    	I/O ports at 4080 [size=4]
    	I/O ports at 4070 [size=8]
    	I/O ports at 4060 [size=4]
    	I/O ports at 4020 [size=32]
    	Memory at e1540000 (32-bit, non-prefetchable) [size=2K]
    	Capabilities: <access denied>
    	Kernel driver in use: ahci
    

    It says Kernel driver in use: ahci, but I do not see that in the module listing. And when I google "how to see kernel drivers" everything that loads up says "how to see kernel drivers (modules)"

    urahonky on
  • urahonkyurahonky Registered User regular
    So we went ahead and advertised ourselves as an Intel HDD... And sure enough we got a kernel driver assigned to it by Linux.

  • KambingKambing Registered User regular
    khain wrote: »
    Phyphor wrote: »
    ASimPerson wrote: »
    Phyphor wrote: »
    	struct s {
    		unsigned char a[16];
    		unsigned short b;
    		unsigned short c;
    	}
    

    GCC will apparently lay that out as
    16 bytes of a
    2 bytes of b
    2 bytes padding
    2 bytes of c
    2 bytes padding
    as I learned trying to interface with MSVC which has no padding or alignment bytes

    Wait, you're saying the MS compiler doesn't align structs?

    I know alignment doesn't matter as much on x86 (as opposed to most of the platforms we ship, which is a wonderfully confusing way to crash the box) but I still thought it was good to align things for performance?

    No, it does, but that structure doesn't need any because the shorts are 2 byte aligned to begin with

    The ISO C standard requires that structures are aligned to the lowest common multiple of the alignments of all members of the struct unless packed is specified.

    I would expect unions to just be treated as the largest data type in the union.

    This is what happens as it's the only reasonable thing that can come to pass: figure out each possible data layout given a union, factoring in padding and alignment. The size of the overall union is the largest such data layout that is possible.

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • bowenbowen How you doin'? Registered User regular
    Anyone know how to expose the OpenOffice (LibreOffice specifically) com objects for use by other apps? I can't seem to get it to pick up anything and LibreOffice is installed and running. Is there an additional step in the procedure to get the com objects registered? Trying to use spell/grammar check in FoxPro.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • bowenbowen How you doin'? Registered User regular
    com.sun.star.linguistic2

    That's what I'm looking to tie into, I need spell check and grammar check and we're using MSOffice at the moment but I'm trying to break away from components that don't work in TerminalServices without paying my salary in licensing costs.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • urahonkyurahonky Registered User regular
    And I compiled the Ubuntu Linux kernel and am running on it now. Feels good man.

  • urahonkyurahonky Registered User regular
    Okay when writing bash scripts how do I embed my sudo passwords into them? I'd like to be able to compile the linux kernel without typing anything.

This discussion has been closed.