Club PA 2.0 has arrived! If you'd like to access some extra PA content and help support the forums, check it out at patreon.com/ClubPA
The image size limit has been raised to 1mb! Anything larger than that should be linked to. This is a HARD limit, please do not abuse it.
Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!

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

1457910100

Posts

  • ASimPersonASimPerson Cold... ... and hard.Registered User regular
    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

    redoctober2.png
    SE++ Forum Battle Archive | PDT is not PST | DRUNKSTUCK: A Homestuck recap
  • urahonkyurahonky Registered User regular
    At the hospital right now. Wife is having some major contractions. Is this when everything gets pushed into master? We'll see!

    KambingTofystedethecco the dolphinadmanbgavindelmightyjongyoTraceMNC DoverdjmitchellaJimmy KingcrimsoncoyoteCreamstoutironsizideEvigilantNaphtalian_alt
  • gavindelgavindel The reason all your software is brokenRegistered User regular
    urahonky wrote: »
    At the hospital right now. Wife is having some major contractions. Is this when everything gets pushed into master? We'll see!

    Remember: 90% of the cost of code is maintenance.


    ecco the dolphinurahonky
  • TraceTrace GNU Terry Pratchett; GNU Gus; GNU Carrie Fisher; GNU Adam We Registered User regular
    urahonky wrote: »
    At the hospital right now. Wife is having some major contractions. Is this when everything gets pushed into master? We'll see!

    for what it's worth

    NARS just put together this a few moments ago.
    <(&,{D},{A},{D})-->Word>.
    

    Probably completely random chance.


    Right?

    ecco the dolphinurahonkyironsizidePolaritie
  • urahonkyurahonky Registered User regular
    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.

    ecco the dolphincrimsoncoyote
  • 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.
    urahonkyDelmainASimPersonMNC DoverMvrck
  • 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 Game Designer/Stay-at-home Dad Seattle, 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.

    Twitch Page
    Hearthstone: mncdover#1994
    Nintendo Network ID: MNC.Dover
    3DS: 1934-0659-5183
    Steam ID
  • 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.
    GethStarfuckDelmainbowenMvrckadmanbPolaritie
  • 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.

    redoctober2.png
    SE++ Forum Battle Archive | PDT is not PST | DRUNKSTUCK: A Homestuck recap
    ecco the dolphinEvigilant
  • 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.

    Ladies.
    ecco the dolphin
  • 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.

    iTunesIsEvilTofystedethLD50Evigilant
  • 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 Registered 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
    PwH4Ipj.jpg
    bowen
  • bowenbowen How you doin'? Registered User regular
    One of those messageBlocks is missing the #, might be an issue with IE parsing it "correctly".

    Ladies.
  • MvrckMvrck Registered User regular
    Sadly fixing that doesn't change anything. I am so utterly confused by this.

    PwH4Ipj.jpg
  • KamiroKamiro Registered User regular
    It's cause this line:
    You will now be redirect back to your home page
    is not grammatically correct.

    Could data.errormessage not be evaluating correctly in other browsers?

  • 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 the bored genie Seattle, WARegistered User regular
    Const is really more of a guideline than rule.

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

    syndalis wrote: »
    Apple is a terrible company.
  • 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
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
    ecco the dolphinDelmainmightyjongyoEvigilantiTunesIsEvilMvrckironsizide
  • 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!

    Magic Box
    Academician Prokhor "Phyphor" Zakharov, Chief Scientist of China, Provost of the University of Planet - SE++ Megagame
  • 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.
    Geth
  • 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
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • 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.

    redoctober2.png
    SE++ Forum Battle Archive | PDT is not PST | DRUNKSTUCK: A Homestuck recap
    crimsoncoyoteEthea
  • KakodaimonosKakodaimonos Registered 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

    Ladies.
  • TofystedethTofystedeth veni, veneri, vamoosi 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.

    Ladies.
    Tofystedeth
  • 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.

    ASimPerson
  • TofystedethTofystedeth veni, veneri, vamoosi Registered User regular
    bowen wrote: »
    Ah growth charts.

    The worst part of healthcare EHRs.

    Every part is the worst part.

    steam_sig.png
    bowen
  • 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?

    Ladies.
1457910100
This discussion has been closed.