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/

[Programming] Thread: Fixed last bug in 5 month thread

145791099

Posts

  • ecco the dolphinecco the dolphin Registered User regular
    urahonky wrote: »
    Looks like we're either going to induce or break her water and go from there. As long as no one rebases we should be good! I'll post more in the days to come.

    Alright thread, you heard the man.

    No one rebase their projects in the mean time.

    If your boss asks you why, redirect them to me.

    Penny Arcade Developers at PADev.net.
  • hippofanthippofant ティンク Registered User regular
    MNC Dover wrote: »
    Phyphor wrote: »
    As with any programming problem, try to break it up.

    You're asked to find the number of days difference between two dates, so first of all, try calculating the number of days from 0 that a given date has.

    Breaking that up, you would calculate all the days for previous years, then add all the days for previous months, then the days for the current month

    The wife asked me to write out how I'd to it in a real-world scenario before creating any code. After doing so, I'm then supposed to transpose that into code.

    I know that I'll need to create a leapYearCheck procedure, which I did like so:
    def leapYearCheck(year1):
        if year1 == 0:
            return False
        if year1 % 4 == 0:
            if year1 % 100 == 0:
                if year1 % 400 == 0:
                    return True
                else:
                    return False
            return True 
        return False
    

    Now I've got a True/False check ready for the procedure calculating days. So I'm trying to wrap my head around making an efficient way to store the days in each month. My first thought was creating 12 variables, one for each month, and assigning them the proper day count. This is messy and a nightmare.

    Looking at your code, I can see that there's an easier way of getting the answer with lists and for loops, but I don't know how they work yet and I'm trying to solve this without using stuff that hasn't been introduced yet. :(

    Ahhh! The cascades! Whyy?!
    def leapYearCheck(year):
        return year % 4 == 0 and not (year % 100 == 0 and year % 400 != 0)
    

    Also, changed the parameter to year, cuz there's only 1 :P

  • MNC DoverMNC Dover Full-time Voice Actor Kirkland, WARegistered User regular
    hippofant wrote: »
    MNC Dover wrote: »
    Phyphor wrote: »
    As with any programming problem, try to break it up.

    You're asked to find the number of days difference between two dates, so first of all, try calculating the number of days from 0 that a given date has.

    Breaking that up, you would calculate all the days for previous years, then add all the days for previous months, then the days for the current month

    The wife asked me to write out how I'd to it in a real-world scenario before creating any code. After doing so, I'm then supposed to transpose that into code.

    I know that I'll need to create a leapYearCheck procedure, which I did like so:
    def leapYearCheck(year1):
        if year1 == 0:
            return False
        if year1 % 4 == 0:
            if year1 % 100 == 0:
                if year1 % 400 == 0:
                    return True
                else:
                    return False
            return True 
        return False
    

    Now I've got a True/False check ready for the procedure calculating days. So I'm trying to wrap my head around making an efficient way to store the days in each month. My first thought was creating 12 variables, one for each month, and assigning them the proper day count. This is messy and a nightmare.

    Looking at your code, I can see that there's an easier way of getting the answer with lists and for loops, but I don't know how they work yet and I'm trying to solve this without using stuff that hasn't been introduced yet. :(

    Ahhh! The cascades! Whyy?!
    def leapYearCheck(year):
        return year % 4 == 0 and not (year % 100 == 0 and year % 400 != 0)
    

    Also, changed the parameter to year, cuz there's only 1 :P

    I'm cascading because I didn't know about this "and not" thingy. :)

    This is probably the most challenging part of asking established coders for help; you're all so hardwired to certain aspects you forget that I gotta learn the inefficient and ugly code first so I can handle the better stuff later on.

    Need a voice actor? Hire me at bengrayVO.com
    Legends of Runeterra: MNCdover #moc
    Switch ID: MNC Dover SW-1154-3107-1051
    Steam ID
    Twitch Page
  • ecco the dolphinecco the dolphin Registered User regular
    Guys

    I think... I may have muttered that I wanted to stab something out loud at work.

    People are giving me odd glances now, and asking if I'm stable.

    I'M OKAY.

    Penny Arcade Developers at PADev.net.
  • ASimPersonASimPerson Cold... and hard.Registered User regular
    I was going to hit "Agree", but then I noticed Geth auto-agreed your post and decided that was better.

  • bowenbowen How you doin'? Registered User regular
    Guys

    I think... I may have muttered that I wanted to stab something out loud at work.

    People are giving me odd glances now, and asking if I'm stable.

    I'M OKAY.

    Yes my child, let the stab flow through you.

    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
  • Jimmy KingJimmy King Registered User regular
    bowen wrote: »
    Guys

    I think... I may have muttered that I wanted to stab something out loud at work.

    People are giving me odd glances now, and asking if I'm stable.

    I'M OKAY.

    Yes my child, let the stab flow through you.

    That sounds unsafe.

  • EtheaEthea Registered User regular
    ASimPerson wrote: »
    Ethea wrote: »
    On a side note I am going to be at GTC all week. So if anybody is in the San Jose area we should grab a drink :)

    @Ethea what's up

    A long flight combined with very little sleep. If you are in the area/gtc shoot me a PM and we can try to meet up.

  • crimsoncoyotecrimsoncoyote Registered User regular
    Woo, finally requested my VMWare Fusion license. Time to give it a whirl

  • MvrckMvrck Dwarven MountainhomeRegistered User regular
    edited March 2015
    Bowen, knife please.

    So, in this web app, I'm using jQuery's animate(scrollTop); to push the user to various places on the page based off events. We have some long lists that slide open to show details you can edit. If you edit one, it refreshes the list, scrolls to that item and reopens it to give a consistent experience. Works great. On other areas, if you submit a form, it pops up a success or error message at the top of the page, and then scrolls to it.
                    if (data.success) {
                        jQuery('#loading').hide();
                        jQuery("#listBlock").empty();
                        var scrollToMe = jQuery('#main');
                        jQuery('html,body').animate({scrollTop: scrollToMe.offset().top-50}, 'fast');
                        jQuery("messageBlock").empty();
                        jQuery("#messageBlock").append("<div class='successMessage'><div class='message'>Your " +
                            "evaluation has been submitted.  You will now be redirect back to your home page.</div></div>");
                        setTimeout(function() {
                            window.location.href = "../";
                        }, 1000);
                    } else {
                        jQuery('#loading').hide();
                        var scrollToMe = jQuery('#main');
                        jQuery('html,body').animate({scrollTop: scrollToMe.offset().top-50}, 'fast');
                        jQuery("#messageBlock").empty();
                        jQuery("#messageBlock").append("<div class='errorMessage'><div class='message'>" + data.errormessage + "</div></div>");
                    }
    

    On success it scrolls fine. On Error, nothing happens. Except in IE, because of course in this one case IE would be working properly. I am using the animate thing in literally dozens of other places in this app, and it works fine in all of them. What the hell is going wrong on this page?

    Mvrck on
  • bowenbowen How you doin'? Registered User regular
    One of those messageBlocks is missing the #, might be an issue with IE parsing it "correctly".

    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
  • MvrckMvrck Dwarven MountainhomeRegistered User regular
    Sadly fixing that doesn't change anything. I am so utterly confused by this.

  • ecco the dolphinecco the dolphin Registered User regular
    My god

    I am going to stab some fruit

    A dev just tried to get my approval to cast away const and modify the memory passed in via const pointer.

    Penny Arcade Developers at PADev.net.
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    Const is really more of a guideline than rule.

  • DelmainDelmain Registered User regular
    Can confirm, const is basically just something to be worked around as a mental exercise.

  • ecco the dolphinecco the dolphin Registered User regular
    I WILL STAB YOU ALL

    Penny Arcade Developers at PADev.net.
  • InfidelInfidel Heretic Registered User regular
    I WILL STAB MYSELF

    Changed your pointer, wasn't declared const.

    OrokosPA.png
  • ecco the dolphinecco the dolphin Registered User regular
    Infidel wrote: »
    I WILL STAB MYSELF

    Changed your pointer, wasn't declared const.

    YOU HAVE TURNED ME EMO

    You glorious bastard

    Penny Arcade Developers at PADev.net.
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Infidel wrote: »
    I WILL STAB MYSELF

    Changed your pointer, wasn't declared const.

    YOU HAVE TURNED ME EMO

    You glorious bastard

    Look I could just make the members mutable instead if you want!

  • ecco the dolphinecco the dolphin Registered User regular
    edited March 2015
    Phyphor wrote: »
    Infidel wrote: »
    I WILL STAB MYSELF

    Changed your pointer, wasn't declared const.

    YOU HAVE TURNED ME EMO

    You glorious bastard

    Look I could just make the members mutable instead if you want!

    I don't think the other dev knows that keyword, thank god.

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • hippofanthippofant ティンク Registered User regular
    Guys

    I think... I may have muttered that I wanted to stab something out loud at work.

    People are giving me odd glances now, and asking if I'm stable.

    I'M OKAY.

    Sysadmin's gonna find that you post here. Then men in white suits..

  • ecco the dolphinecco the dolphin Registered User regular
    hippofant wrote: »
    Guys

    I think... I may have muttered that I wanted to stab something out loud at work.

    People are giving me odd glances now, and asking if I'm stable.

    I'M OKAY.

    Sysadmin's gonna find that you post here. Then men in white suits..

    bwaaAhHAhahahahahahaAHHHAahahahasssssszaaaha

    stay calm leaving this place stay calm staycalm stalm missing letters are yca or cya if rearranged yes ciao cya later alligator in a while crocodile

    Penny Arcade Developers at PADev.net.
  • crimsoncoyotecrimsoncoyote Registered User regular
    He's broken for realsies. Hopefully he finds a new job soon

  • InfidelInfidel Heretic Registered User regular
    Did you try restarting him?

    OrokosPA.png
  • LD50LD50 Registered User regular
    How many times was he restarted?

  • ecco the dolphinecco the dolphin Registered User regular
    Well, we had one attempt here.
    Infidel wrote: »

    Changed your pointer, wasn't declared const.

    Penny Arcade Developers at PADev.net.
  • ASimPersonASimPerson Cold... and hard.Registered User regular
    Hey @Ethea it was cool hanging out last night. Good luck with that presentation!

    But yeah, any of the rest of y'all ever find yourselves in San Jose, let me know.

  • KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    Phyphor wrote: »
    Infidel wrote: »
    I WILL STAB MYSELF

    Changed your pointer, wasn't declared const.

    YOU HAVE TURNED ME EMO

    You glorious bastard

    Look I could just make the members mutable instead if you want!

    No. I believe the proper thing to do here is declare all the pointers as const pointers to volatile variables. Then you get the best of both worlds.

  • bowenbowen How you doin'? Registered User regular
    CONST ALL THE THINGS

    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
  • TofystedethTofystedeth Registered User regular
    edited March 2015
    So another Oracle DB question.
    I'm working on a report in our WebIntelligence environment involving BMI percentile. In current code version of our EHR the BMI percentile is supposed to be stored in the database instead of just calculated on the fly, but while I can find the clinical event code corresponding to it, I can't actually find any instances of it, so I'm guessing ours hasn't been configured that way. Because it's pediatric BMI the percentile varies widely depending on sex and age, so there's not a hard and fast rule. I did find a couple of tables from the CDC that I can use to look it up, but not really sure how to embed it it in my query. We don't have any direct control over the database and can't make any permanent tables, so I'm guessing I need to do some kind of Select Into temp table thing, but I'm pretty new to actually using SQL and haven't done much along those lines. It's like, 200ish rows because the age is represented in months.
    edit: Looks like this
    Age (in months) | 95th Percentile BMI Value (Females) | 95th Percentile BMI Value (Males)
    24	19.10624	19.33801
    24.5	19.05824	19.2789
    25.5	18.96595	19.16466
    

    Tofystedeth on
    steam_sig.png
  • bowenbowen How you doin'? Registered User regular
    Ah growth charts.

    The worst part of healthcare EHRs.

    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
    ASimPerson wrote: »
    Hey @Ethea it was cool hanging out last night. Good luck with that presentation!

    But yeah, any of the rest of y'all ever find yourselves in San Jose, let me know.

    I had a great time, and I fully endorse @ASimPerson. Luckily my co-presenter is feeling better so everything should go well.

  • TofystedethTofystedeth Registered User regular
    bowen wrote: »
    Ah growth charts.

    The worst part of healthcare EHRs.

    Every part is the worst part.

    steam_sig.png
  • bowenbowen How you doin'? Registered User regular
    bowen wrote: »
    Ah growth charts.

    The worst part of healthcare EHRs.

    Every part is the worst part.

    ... I'll allow it.

    You guys doing certification too?

    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
  • TofystedethTofystedeth Registered User regular
    We have so many things going on. I know we hit one of our Meaningful Use deadlines a month or so ago because I was one of the people doing a bunch of lookups of things with screenshots to show that we could pull X information if we wanted to.
    There's also this Accountable Care Organization thing that I'm supposed to start working on in April that I haven't been told much about other that I'm going to be the guy for it. I've got like, a full week of meetings 2nd week in April to find out what the heck I'm supposed to be doing.

    steam_sig.png
  • crimsoncoyotecrimsoncoyote Registered User regular
    So our backlog is pretty thin right now, which means I can basically pick up whatever I want.

    Our next bit of work will be for support of a "new" filesystem.
    Any ideas on where I can start with that? I've read through the spec, but a better (and more practical) understanding would help a bunch I think.

    Bonus points if I can work on my C++ at the same time.

    EX: I've started looking into B+Trees, since I know the filesystem (and others) uses them, but is there a better approach?

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Wait are you implementing a filesystem?

  • bowenbowen How you doin'? Registered User regular
    So our backlog is pretty thin right now, which means I can basically pick up whatever I want.

    Our next bit of work will be for support of a "new" filesystem.
    Any ideas on where I can start with that? I've read through the spec, but a better (and more practical) understanding would help a bunch I think.

    Bonus points if I can work on my C++ at the same time.

    EX: I've started looking into B+Trees, since I know the filesystem (and others) uses them, but is there a better approach?

    Are we talking about like an actual system file system or something that your program can use internally for file storage?

    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
  • crimsoncoyotecrimsoncoyote Registered User regular
    Phyphor wrote: »
    Wait are you implementing a filesystem?
    No.
    And yes, an actual filesystem.

    Basically, we will be working on expanding support to include a filesystem we do not currently support.

    Hmm. I might need to take a step back here and look into how we deal with other filesystems first.
    I don't really know too much about filesystems yet, unfortunately

  • bowenbowen How you doin'? Registered User regular
    http://kukuruku.co/hub/nix/writing-a-file-system-in-linux-kernel

    That might get you started at the least.

    This is something you set a team of 5+ up for a few years to accomplish too.

    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
This discussion has been closed.