Options

My Little [Programming] Thread: Debugging is Magic

194959799100

Posts

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    I absolutely fucking hate GUI work. It's so fucking tedious.

    Using FlexSpy I can set verticalAlign of an element to Middle and it works BEAUTIFULLY, but I cannot change it anywhere in the code. No matter the number of "this.setStyles" I set I cannot get to this one single fucking element and I don't understand it.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    override protected function createChildren():void{
    			super.createChildren();
    			this.setStyle("verticalAlign","middle"); 
    			var f:FileReference = new FileReference();
    			f.save("createChildren","createChildren.txt");
    		}
    		
    		public function MyClass(){
    			init();
    			var f:FileReference = new FileReference();
    			f.save("createChildren","constructor.txt");			
    		}
    		
    		public function init():void{
    			var f:FileReference = new FileReference();
    			f.save("createChildren","init.txt");
    		}
    

    None of these are getting called at all.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Oh this is cool:
    Hi Folks,
    Is there any way to prevent the resizing of the columns of the scorecard component at run time? I've made sure they all reference formulas and have made the rows non selectable but I've now noticed that you can resize the columns at run time, which seems very odd.
    How can this be prevented?
    Thanks,
    Jeanne
    To answer the original question, you can prevent resizing of the columns by adding a button on top of your headers and removing the background and label. This does change the mouse pointer into a handm, but it removes the resize action.

    How is that even remotely acceptable?

  • Options
    bowenbowen How you doin'? Registered User regular
    It's basically

    "Fuck you, who cares if someone resizes it? If it bothers you, don't resize the columns and use it as is."

    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
  • Options
    El SkidEl Skid The frozen white northRegistered User regular
    It's the new fad that's sweeping the nation: Un-useability!

  • Options
    ecco the dolphinecco the dolphin Registered User regular
    edited September 2014
    Bowen

    Lend me your stabbing knife

    In fact

    Tell me who your supplier is

    I'm going to need a crate of them

    There is some serious crap code here

    and I'm tempted to burn it to the ground


    Example: This micro-optimisation (slightly anonymised)

    We have a struct that is sent over the network which has an 8-byte human readable field that can be used to identify what the struct is. Think of it as an ID field. So if you've got your favourite network snooper open (for diagnostics or otherwise), you'll be able to tell what's flying over the wire at a glance.

    In the code, the ID has been encoded into a uint64_t, instead of being left as a human readable string.

    From what I can see, this is so that basically you can now use a switch statement to compare the 8 byte field.

    I am going to refactor this so that the appropriate handlers register the ID string that they're interested in and they get called back, instead of having a dedicated switch {} decoder which needs to be extended for every message that gets added.

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • Options
    bowenbowen How you doin'? Registered User regular
    Seems like you'd just want to do that right before the switch, eh?

    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
  • Options
    RendRend Registered User regular
    Bowen

    Lend me your stabbing knife

    In fact

    Tell me who your supplier is

    I'm going to need a crate of them

    There is some serious crap code here

    and I'm tempted to burn it to the ground


    Example: This micro-optimisation (slightly anonymised)

    We have a struct that is sent over the network which has an 8-byte human readable field that can be used to identify what the struct is. Think of it as an ID field. So if you've got your favourite network snooper open (for diagnostics or otherwise), you'll be able to tell what's flying over the wire at a glance.

    In the code, the ID has been encoded into a uint64_t, instead of being left as a human readable string.

    From what I can see, this is so that basically, you can now use a switch statement to compare the 8 byte field.

    Makes sense to me.

    There's no way to read data as any format other than the one it was originally written in after all. Human readable and machine readable are mutually exclusive in all cases.

  • Options
    ecco the dolphinecco the dolphin Registered User regular
    edited September 2014
    bowen wrote: »
    Seems like you'd just want to do that right before the switch, eh?

    You could do that, or you could do the slightly most extensible:
    messageDecoder.registerHandler( "MSG1_XYZ", &handler1 );
    messageDecoder.registerHandler( "MSG2_ABC", &handler2 );
    messageDecoder.registerHandler( "MSG3_DEF", &handler3 );
    

    So that new handlers can just register their string ID and callback, without needing to modify the message decoder (which does other things such as length and some field verification).

    Edit: Okay

    Just needing to vent

    Because crap code increases my blood pressure dramatically because it's just causing problems for everyone else and my god this is making my eyes bleed - indentation is not even consistent and why are some identifiers which are not macros all capitalised and whhhhyyyyyyyyy!?

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • Options
    bowenbowen How you doin'? Registered User regular
    Yeah that'd be way better. Event handlers are the best kind of system if you've got them.

    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
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    Also helps the dependency tree somewhat

    If you end up decoding everything inside the initial message decoder like so:
    switch( message.ID )
    {
    case cID_MSG1:
        msg1handler.handler( message ); // tMessageDecoder now depends on tMsg1handler
        break;
    case cID_MSG2:
        msg2handler.handler( message ); // tMessageDecoder now depends on tMsg2handler
        break;
    case cID_MSG3:
        msg3handler.handler( message ); // tMessageDecoder now depends on tMsg3handler
        break;
    }
    

    then you end up with tMessageDecoder dependent on every single message handler that you've got decoding which is silly and does not scale.

    The dependency tree for that class looks something silly like:
    tMessageDecoder ---> tMsg1Handler
      +----------------> tMsg2Handler
      +----------------> tMsg3Handler
      ...
      +----------------> tMsgNHandler
    

    I much prefer it the other way around, because why should the message decoder have to know anything about the internals of the message when that's the responsibility of the message handler?

    Okay

    Calming down

    Need to create a jira, put all that in there

    Make it sound nice and non-hostile

    Penny Arcade Developers at PADev.net.
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    edited September 2014
    URHGHHHHHHHHGHHGHGHGHGHG

    IF YOU'RE GOING TO COPY AND PASTE CODE AND THEN MODIFY IT THEN UPDATE THE COMMENTS AS WELL

    OH MY GOD I AM GOING TO STAB

    Edit:

    WHY ARE YOU EVEN COPYING/PASTING IN THE FIRST PLACE?!!!!?!?!?!?!

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    Because otherwise they'd have to retype all that. Duh.

  • Options
    ecco the dolphinecco the dolphin Registered User regular
    URGHHGHHGHHG

    And this function in the threaded class doesn't even pass the "what if two threads called you one after another" test, let alone the "what if two threads called you simultaneously" test.

    I mean seriously

    This is just

    RUDHJISFDSFJSDF

    STAB

    Penny Arcade Developers at PADev.net.
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    edited September 2014
    NO

    YOU DO NOT #define YOUR UNIT TESTS IN LIKE THIS

    Unit tests are a project apart, not a #define option that you turn on in the main project.

    DSFJXDFXZFJ#J(JIEJIROJERISJIDSFJIDSF

    STAB

    Edit:

    Fuck it

    Burning it to the ground

    Too many WTFs to fix

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    YOU ARE NOT HELPING GETH

    Oh my god

    He's reinvented the logging subsystem, but badly

    Penny Arcade Developers at PADev.net.
  • Options
    mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    Reinvented logging systems are the worst.

    I say this as someone who has written two, is about to change one to use (r)syslog, and has to maintain all of them.

  • Options
    an_altan_alt Registered User regular
    I needed new business cards for an upcoming convention. Nothing worth creating a post about, except that I went from being a Senior Software Engineer to Vice President, Development.

    My pay and responsibilities are unchanged. However, according to my next resume, I'm a totally more important person.

    Seriously though, does VP, Dev carry much more weight than SSE? Should I be moving code down my resume and talk up project management?

    Pony wrote:
    I think that the internet has been for years on the path to creating what is essentially an electronic Necronomicon: A collection of blasphemous unrealities so perverse that to even glimpse at its contents, if but for a moment, is to irrevocably forfeit a portion of your sanity.
    Xbox - PearlBlueS0ul, Steam
    If you ever need to talk to someone, feel free to message me. Yes, that includes you.
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    an_alt wrote: »
    I needed new business cards for an upcoming convention. Nothing worth creating a post about, except that I went from being a Senior Software Engineer to Vice President, Development.

    My pay and responsibilities are unchanged. However, according to my next resume, I'm a totally more important person.

    Seriously though, does VP, Dev carry much more weight than SSE? Should I be moving code down my resume and talk up project management?

    Yah, pretty much.

    As VP, you're emphasising your management roles/responsibilities, as opposed to your code monkey roles/responsibilities.

    You're a manager now, Harry!

    Penny Arcade Developers at PADev.net.
  • Options
    KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    Are VPs even allowed in this thread? I mean, he's one of them now.

    :)

  • Options
    DehumanizedDehumanized Registered User regular
    yep, turn in your badge and gun

  • Options
    zerzhulzerzhul Registered User, Moderator mod
    maybe it's a loose cannon situation?

  • Options
    bowenbowen How you doin'? Registered User regular
    NO

    YOU DO NOT #define YOUR UNIT TESTS IN LIKE THIS

    Unit tests are a project apart, not a #define option that you turn on in the main project.

    DSFJXDFXZFJ#J(JIEJIROJERISJIDSFJIDSF

    STAB

    Edit:

    Fuck it

    Burning it to the ground

    Too many WTFs to fix

    This sounds like you need to find a new employee more than anything.

    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
  • Options
    EtheaEthea Registered User regular
    NO

    YOU DO NOT #define YOUR UNIT TESTS IN LIKE THIS

    Unit tests are a project apart, not a #define option that you turn on in the main project.

    Interesting concept. We keep all of our tests in the main project, but most be in standalone implementation files. We than use build control flags to decide if we want to enable the tests. Personally the upside for this is that it becomes easier to keep the source and tests synchronized even with a heavy topic branch based workflow.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Slightly non-programming related. I'm going to be getting a esophagogastroduodenoscopy on Monday. I didn't realize that was a word until it happened.

    I say it's slightly non-programming related because technically I got whatever I got while at this job while programming..

    That's stretching isn't it? Also it's relieving to see someone else complain about their job in this thread.

  • Options
    HounHoun Registered User regular
    urahonky wrote: »
    Slightly non-programming related. I'm going to be getting a esophagogastroduodenoscopy on Monday. I didn't realize that was a word until it happened.

    I say it's slightly non-programming related because technically I got whatever I got while at this job while programming..

    That's stretching isn't it? Also it's relieving to see someone else complain about their job in this thread.

    You could have just said "this job is giving me ulcers".

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Houn wrote: »
    urahonky wrote: »
    Slightly non-programming related. I'm going to be getting a esophagogastroduodenoscopy on Monday. I didn't realize that was a word until it happened.

    I say it's slightly non-programming related because technically I got whatever I got while at this job while programming..

    That's stretching isn't it? Also it's relieving to see someone else complain about their job in this thread.

    You could have just said "this job is giving me ulcers".

    But where's the fun in that?? (the procedure is to check if I do have ulcers)

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Also I'm quite enjoying the HELL out of C#. But it could be because I'm using Visual Studio Express and it's just so clean in comparison to Eclipse.

  • Options
    bowenbowen How you doin'? Registered User regular
    c# is 45 parts visual studio, and 55 parts a better language than java.

    If you replace visual studio with monodevelop, you're okay but it's just not the same. Still better than Java and Eclipse.

    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
  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    Technically stress doesn't give anyone ulcers. They're a bacterial infection as much as anything else you'd take antibiotics for.

    Stress will, of course, weaken your immune system. But that hardly seems relevant.

  • Options
    bowenbowen How you doin'? Registered User regular
    Stress ulcers are typically in different areas than normal peptic ulcers, so there's clinical significance to the difference between them too.

    Also chronic use of NSAIDs can cause them. So if you have migraines you're at a higher risk to begin with.

    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
  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    bowen wrote: »
    Stress ulcers are typically in different areas than normal peptic ulcers, so there's clinical significance to the difference between them too.

    Also chronic use of NSAIDs can cause them. So if you have migraines you're at a higher risk to begin with.

    Very interesting.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    admanb wrote: »
    Technically stress doesn't give anyone ulcers. They're a bacterial infection as much as anything else you'd take antibiotics for.

    Stress will, of course, weaken your immune system. But that hardly seems relevant.

    Well it's the air quality of this place. With the mold spores + people not washing their hands at all, I'm willing to bet I got something. It can't be a coincidence that this happened right around the time the basement on base got flooded and everyone moved back to the main office.

  • Options
    Jimmy KingJimmy King Registered User regular
    edited September 2014
    lol. I just got a bug in one of our apps assigned to me with a description of "Changing gender causes odd changes"
    urahonky wrote: »
    Slightly non-programming related. I'm going to be getting a esophagogastroduodenoscopy on Monday. I didn't realize that was a word until it happened.

    I say it's slightly non-programming related because technically I got whatever I got while at this job while programming..

    That's stretching isn't it? Also it's relieving to see someone else complain about their job in this thread.

    Hey, I complain sometimes. I've just been trying to keep it in check lately because I feel like I complain about too much stuff too often (not just work, just life in general) and there really are a lot of good parts of this job as well. I also work on some cool stuff and may actually want to mention names/show off on occasion and I don't want to have that come up in a web search and be tracked back to me complaining about my job every other page.

    Jimmy King on
  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Jimmy King wrote: »
    lol. I just got a bug in one of our apps assigned to me with a description of "Changing gender causes odd changes"
    urahonky wrote: »
    Slightly non-programming related. I'm going to be getting a esophagogastroduodenoscopy on Monday. I didn't realize that was a word until it happened.

    I say it's slightly non-programming related because technically I got whatever I got while at this job while programming..

    That's stretching isn't it? Also it's relieving to see someone else complain about their job in this thread.

    Hey, I complain sometimes. I've just been trying to keep it in check lately because I feel like I complain about too much stuff too often and there really are a lot of good parts of this job as well. I also work on some cool stuff and may actually want to mention names/show off on occasion and I don't want to have that come up in a web search and be tracked back to me complaining about my job every other page.

    Re: Gender, hey you never know!

    Re: Rest, Yeah I worried about that but at this point it's probably too late for me. I have no venting place anymore (I stopped doing it on Facebook) so otherwise I would go home and drink myself stupid if I didn't have this thread.

  • Options
    Jimmy KingJimmy King Registered User regular
    lol, I forgot that bit about the change gender was even in there. I started to type that like 2 days ago and then got sidetracked.

  • Options
    mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    I have clearly not done my job well enough when I'm the only person in the company who knows how to operate the new system. To the point where I get sidetracked every time someone uses the damn thing.

    In my defense, it's a goddamn prototype, and I was planning on doing an upgrade soon which would allow people to use it without me (it makes it more like our current systems, which people know how to use).

  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Ethea wrote: »
    NO

    YOU DO NOT #define YOUR UNIT TESTS IN LIKE THIS

    Unit tests are a project apart, not a #define option that you turn on in the main project.

    Interesting concept. We keep all of our tests in the main project, but most be in standalone implementation files. We than use build control flags to decide if we want to enable the tests. Personally the upside for this is that it becomes easier to keep the source and tests synchronized even with a heavy topic branch based workflow.

    I will do that sometimes, but only with C interfaces and I don't want to expose the internals directly, but need to use them in the tests

  • Options
    a5ehrena5ehren AtlantaRegistered User regular
    Someone is agitating for time zone support on our box. Noooooooooooooooooooooooooooooooo

  • Options
    EtheaEthea Registered User regular
    Phyphor wrote: »
    Ethea wrote: »
    NO

    YOU DO NOT #define YOUR UNIT TESTS IN LIKE THIS

    Unit tests are a project apart, not a #define option that you turn on in the main project.

    Interesting concept. We keep all of our tests in the main project, but most be in standalone implementation files. We than use build control flags to decide if we want to enable the tests. Personally the upside for this is that it becomes easier to keep the source and tests synchronized even with a heavy topic branch based workflow.

    I will do that sometimes, but only with C interfaces and I don't want to expose the internals directly, but need to use them in the tests

    It might be because I have only ever worked one way, but placing my tests in a separate repository than the code boggles my mind. The software process around validating that branches use the correct test repository branch must be annoying.

This discussion has been closed.