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

My Little [Programming] Thread: Debugging is Magic

17879818384100

Posts

  • DisruptedCapitalistDisruptedCapitalist I swear! Registered User regular
    So who was it that recently said he was doing a cross platform project in Java and C++?

    Or was that C#?

  • bowenbowen How you doin'? Registered User regular
    Not ringing a bell 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
  • RendRend Registered User regular
    edited August 2014
    So who was it that recently said he was doing a cross platform project in Java and C++?

    Or was that C#?

    That would be me! And C#. This time.

    Speaking of, I just COMPLETED phase one of my prototype, which is reaaaaaally awesome. I think I am going to use this achievement as an excuse to go home and sleep. I've had a sinus headache for like the whole week now. -_-

    Rend on
    DisruptedCapitalistgavindelInfidelMahnmutMNC DoverEvigilant
  • gavindelgavindel The reason all your software is brokenRegistered User regular
    Left this on my whiteboard in black, red and blue for the team, since I'm leaving:

    "Interns are like VAMPIRES. Though we may FALL, before you know it we RISE AGAIN hungry for MORE"

    Angels, innovations, and the hubris of tiny things: my book now free on Royal Road! Seraphim
    ecco the dolphin
  • NightslyrNightslyr Registered User regular
    PHP :rotate: moment of the day:

    fputcsv() dies sliently when you pass in an array that contains null values. Not only does it die, your entire code dies. And, it's not mentioned in the docs anywhere. And, yes, it dies silently even when error reporting is explicitly turned on.

    PSN/XBL/Nintendo/Origin/Steam: Nightslyr 3DS: 1607-1682-2948
    Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
    gavindelMahnmut
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Its probably dereferencing that null

    EndNightslyr
  • Mr_RoseMr_Rose 83 Blue Ridge Protects the Holy Registered User regular
    Huh. For some reason I now want to resurrect Mainframe Entertainment and reboot (heh) ReBoot only instead of being inside a gamer's machine they're all trapped in the nightmare realm of a Virtual Machine compiling buggy code…

    ...because dragons are AWESOME! That's why.
    Nintendo Network ID: AzraelRose
    DropBox invite link - get 500MB extra free.
    bowenEvigilant
  • ASimPersonASimPerson Cold... and hard.Registered User regular
    Yeah, earlier this week I got caught in the special hell of dealing with classes across .so boundaries.

    After about 4 hours of trying various things to fix it, I wondered why I decided I really needed to wrap otherwise decent C code in a class instead of just calling it directly.

    ecco the dolphin
  • EndEnd Registered User regular
    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpgsteam~tinythumb.png
    SmasherLD50admanbVegemyteASimPersonEvigilantDisruptedCapitalistan_alt
  • DyasAlureDyasAlure SeattleRegistered User regular
    so this talk about c++ books. I bought the required one for my class. I opened it, like 3 times? That was worth the money....

    I take Java this fall, but it is still just intro class. I think I will be board again.

    My%20Steam.png?psid=1My%20Twitch%20-%20Mass%20Effect.png?psid=1=1My%20Youtube.png?psid=1
  • Jimmy KingJimmy King Registered User regular
    @DyasAlure‌ yeah, that's why I went the amazon rental route this time. The book doesn't cover anything I don't know aside from syntax stuff I'll have forgotten and would just google and stuff like that. I just can't justify blowing $100-$150 on it even if I didn't own a much older edition already. $25 to rent from amazon, though. I'm doing the same with my linear algebra book this semester as well. Saving a ton of money that way.

  • ASimPersonASimPerson Cold... and hard.Registered User regular
    End wrote: »

    Maybe he should have used "man 3 abs" to get the specific section of the manual he needed.

  • MNC DoverMNC Dover Full-time Voice Actor Kirkland, WARegistered User regular
    At my pre-wedding family gathering last night, my sister-in-law gave me and my fiance these:

    10600582_10204481675987898_3180919250699734240_n.jpg?oh=1abe8f84cbecb5d2a51bf7ba07a99813&oe=54610E4D&__gda__=1417062450_7ef2189dcff52b85aafb9c6826c508a1

    I thought you'd all appreciate them. My fiance is a software developer and said they were basically the best hats she'd ever seen. :)

    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 dolphinmightyjongyoCampyadmanbTofystedethan_altMvrck
  • undergroundmonorailundergroundmonorail single-track subway Registered User regular
    I mean, the hats are okay, but they're on one line with no braces...
    those are awesome hats

    Pokémon X | 3DS Friend Code: 0490-4897-7688
    Friend Safari: Fighting - Machoke, Pancham, Riolu | In game name: Jessica
    Official Weather Gym Leader of the G+T Pokémon League. @me to try for the Climate Badge!
    PeewiEchoan_alt
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    i am within one more red bull of completing my software lighting engine with SDL2

    it's not a proper ray trace, but it is a high resolution light mapping system which appears to Not Be Slow

    it's actually working right now, but all of the positioning is out of whack. will take an afternoon of coordinate-foo to straighten it out, and also some math to get the dithering right

    ecco the dolphinLD50
  • TofystedethTofystedeth Registered User regular
    I posted this in the job thread, but I applied for an Application Development Analyst position at my current job yesterday. I should hear soon about it, since the email sent announcing the open position said they were looking to fill it quickly.
    So, looking for some blessings of honky to be upon me etc.

    steam_sig.png
    LD50ecco the dolphinSporkAndrewEvigilant
  • EchoEcho ski-bap ba-dapModerator mod
    php-the-good-parts.jpg

    admanbMahnmutMr_RoseLD50InfidelSporkAndrewTofystedethzerzhulDelmainVegemyteMNC DoverEvigilantDisruptedCapitalistGnomeTankMvrck
  • MahnmutMahnmut Registered User regular
    3. Laravel wants you to be happy. Even though you're not.

    Steam/LoL: Jericho89
    SporkAndrew
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    95% with my lighting engine. It works for soft radial point lighting of any size and color, but not if the lights overlap. I'm generating an independent light map for each light source, but it's pretty clear at this point that I'll have to write an algorithm that generates one big global light map.

    That's concerning because that will be quite slow. I need to think about this over some pizza.

    ecco the dolphinMahnmut
  • InfidelInfidel Heretic Registered User regular
    Oh god, these appointment letters are much more complicated to build than expected.

    Because the specs think the application is tied to a particular appointment but it's actually a booking ID which can be multiple appointments and it never specifies which one triggered the letter...

    Working on reports on the weekend! :^:

    OrokosPA.png
    Mahnmut
  • ecco the dolphinecco the dolphin Registered User regular
    Lessons (re)learned on Friday:

    * Devices tend to work better if you bring them out of reset
    * I/O pins controlling reset lines tend to work better if you tell them that they're outputs
    Infidel wrote: »
    Oh god, these appointment letters are much more complicated to build than expected.

    Because the specs think the application is tied to a particular appointment but it's actually a booking ID which can be multiple appointments and it never specifies which one triggered the letter...

    Working on reports on the weekend! :^:

    Boo-urns! Have a weekend!!

    The only reason I'm at work right now is because it's Monday here. You don't live here, so go have a weekend! =P

    Penny Arcade Developers at PADev.net.
    ASimPersona5ehren
  • InfidelInfidel Heretic Registered User regular
    I just went on a date break! :P

    OrokosPA.png
    ecco the dolphin
  • ASimPersonASimPerson Cold... and hard.Registered User regular
    Echo wrote: »
    php-the-good-parts.jpg

    That's way more charitable than this version:
    http://phpthegoodparts.tumblr.com/

  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    global light map complete. blending code still needs work, and it's still slow, but not bad on underpowered hardware... things looking positive

    except for the fact it's 9:40 on sunday and I won't be able to work on it again for days

    ecco the dolphinMahnmutDisruptedCapitalist
  • EvigilantEvigilant VARegistered User regular
    As someone whom is forced to work in classic ASP for one of our legacy apps, I would readily take PHP. I would drop everything in order to get PHP onto the system rather than toil through classic ASP anymore. I work in .NET the most; so I wish ASP was available in the .NET framework.



    Oh, wait.

    XBL\PSN\Steam\Origin: Evigilant
  • Jimmy KingJimmy King Registered User regular
    Got require.js doing r.js optimizations on a django project this weekend using django-require. I'm curious, is there a good way to ensure json data which is dumped into the template at page load is available to my *-main.js?

    Right now I am using a require(blah blah) inline instead of *-main.js files so that I can load the requirements and then after they are loaded init my knockout viewmodels with data, etc. I'd like to use a *-main.js because then I could use django-require's template tags and use hashed js filenames for easier cache busting. I'm not thrilled with either of my solutions I've come up with which are:

    1) dump the json into the template THEN do the requirejs stuff so that my json is available to the scripts it loads. I don't like this because then these scripts are making use of magic data which has no obvious source.
    2) don't dump the data into the template at all. This seems dumb on a lot of these pages. I'm doing a sort of hybrid thing at the moment - single django view per page, but knockout bindings. Rather than having an http request to load the empty page and then an immediate second http request off to my REST endpoint to get data, I'm just serializing the data and dumping it into the template on views where that makes sense to save on an extra pointless request. I could obviously stop doing that and just make the second request. It's not like my toy project is doing enough traffic where it matters.

  • electricitylikesmeelectricitylikesme Registered User regular
    Urgh, regex's on the command line are infuriating. I can never get sed to match things properly. grep is better behaved.

    Apothe0sis
  • urahonkyurahonky Registered User regular
    Just had a demo to show off our new Enterprise stuff. We made a HUGE update that would allow us to deploy an update to our service/client code and have it automatically pull it on all of the clients. Basically enabling functionality for everything in on swoop without having to touch the applications that our Enterprise capability is implemented in.

    During the demo we had something disabled, then we re-enabled it and sent it out for deployment. Once it was redeployed then we had to clear the browser's cache and reload the application to see the new functionality.

    Once that happened the people we were presenting to were hung up on the whole "clearing cache" thing that they didn't even realize that the application remained the same and our capability had been updated. We are literally showing them that we can save them millions of dollars in new workplans... And they wanted to make sure their clients didn't have to clear their cache every time they exported.

    I mean... Jesus.

  • CampyCampy Registered User regular
    Certain people (generally those in management positions) always feel the need to complain/comment about something when reviewing work. It makes them feel like they're doing something worthwhile.

    iTunesIsEvil
  • iTunesIsEviliTunesIsEvil Cornfield? Cornfield.Registered User regular
    Campy wrote: »
    Certain people (generally those in management positions) always feel the need to complain/comment about something when reviewing work. It makes them feel like they're doing something worthwhile.

    They also tend to be "can't see the forest for the trees" kind of people. They get hung up on this one thing that someone in their department will not stop harping on, and it stops them from seeing anything else.

    bowen
  • urahonkyurahonky Registered User regular
    But we explained to them that the ONLY time they'll need to do this one thing is if there's a brand new release of the capability. Then we went off on some sort of tangent about how the presenter was using FireFox to clear his cache and they don't know how to do that in IE and if we could write an FAQ on how to clear it for all browsers.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    I dunno, I've done a lot of classic ASP and PHP, and in almost every case i'd rather do classic ASP using server side JavaScript (because fuck VBScript). It's still an archaic shitty piece of technology, but it's fundamentally WAY more sane than PHP, which is the bane of the universes existence.

    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
  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited August 2014
    urahonky wrote: »
    But we explained to them that the ONLY time they'll need to do this one thing is if there's a brand new release of the capability. Then we went off on some sort of tangent about how the presenter was using FireFox to clear his cache and they don't know how to do that in IE and if we could write an FAQ on how to clear it for all browsers.

    Just set meta no-cache on everything, and then wait for them to complain that it seems like the pages load slow.

    GnomeTank on
    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
    bowenurahonkyEvigilantSporkAndrewMvrck
  • MahnmutMahnmut Registered User regular
    Setting up new environment for (hopefully) production: In which I do something wrong, wait a reaaaaaaaally long time, break something else, wait again.... :(

    Steam/LoL: Jericho89
  • urahonkyurahonky Registered User regular
    Man I love solving number problems.

    This color thing was really getting to me until I wrote down all of the number and started thinking about them programmatically.

    32 -> 13 -> 19

    How do these numbers relate, why is it 32 first then 13 then 19?

    Found out that there were 19 empty values in the data array. So that means it was technically:

    32 -> 32

    For each of the dataArrays. So in order to get the colors I had to grab the first color, skip (number of blanks + number of categories), then grab another color... Repeat until the number of colors in the array = numCats * numSers. I'm ashamed at how long it took me to find this pattern but there it was. In broad daylight.

    ecco the dolphin
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    lighting engine logic is complete. it does almost everything i want it to do. the one thing it's not great at is intelligently dealing with light "intensity". So a colored light gets washed out by a white light in a way that seems unrealistic.

    I will fault myself for not having completely physically realistic lighting my first time out

    I'm on to the optimization phase. 60FPS on Intel GPU already achieved in Release... working on 30+ in debug, seems probable

    gonna record a video once I've finished optimizing and put some more pretty lights in my map code

    LD50Mahnmutecco the dolphinan_alt
  • CokebotleCokebotle 穴掘りの 電車内Registered User regular
    I'm back in university doing some Image Processing classes, and I'm trying to remember how pointers work (I never fully understood them, to be honest).

    If there's code like so:
    #define FILTER_EXTENT 4
    #define FILTER_DIM (2*FILTER_EXTENT+1)
    #define FILTER_TAPS (FILTER_DIM*FILTER_DIM)
    
    float filter_buf[FILTER_TAPS];
    float *mirror_psf = filter_buf+(FILTER_DIM*FILTER_EXTENT)+FILTER_EXTENT;
    

    'mirror_psf' is a pointer to a memory location. So it's assigning the value at the memory location 'mirror_psf' to be the right side of the equal sign, correct? Or is it doing some memory trickery?

    But if 'filter_buf' is an array of size 'FILTER_TAPS', adding integer values like that shouldn't do anything, right?

    工事中
  • InfidelInfidel Heretic Registered User regular
    That is pointer arithmetic.

    filter_buf is really just a pointer. It works the same as float *filter_buf, the difference between that and the array declaration is that (a) you allocate some space, FILTER_TAPS # of floats worth and (b) you can't change where filter_buf points to, it's locked in to that memory you allocated.

    So when you say pointer + integer, you start doing pointer arithmetic, and it takes the base pointer and moves it around however much is necessary. When you have a float pointer, ptr + X means move over X floats, or in other words add sizeof(float) * X to the memory address.

    You allocate space for a 9x9 array (81 elements, but it is intended to be treated as two-dimensional). The very next line does just that, with the standard base + Y*rowlen + X method.
    index 0 -> XXXXXXXXX <- index 8
               XXXXXXXXX <- index 17
               XXXXXXXXX
               XXXXXXXXX
               XXXXXXXXX
               XXXXXXXXX
               XXXXXXXXX
               XXXXXXXXX
               XXXXXXXXX <- index 80
    

    To get the right index number, with X going right from 0 to 8 and Y going down from 0 to 8, you would calculate X + 9Y. The dead center would be (4,4) which is 4 + 36 = 40 (and of course right in between 0 and 80...).

    Take a look at the pointer assignment statement again.

    OrokosPA.png
    Mahnmut
  • CampyCampy Registered User regular
    Pointers are one of those strange learning beasts. At least for myself they baffled me for a good while, but once they clicked I can't even comprehend how I didn't understand them in the first place.

    On the subject of pointers a had a fun bug which I hit just yesterday. The problem was mixing up pointers and increment/decrement operators. To be more precise the order of operations when using both in the same statement. Take the terrible C code snippet below:
    int num;
    int *numPointer;
    
    
    num = 1 ;
    numPointer = &num ;
    
    *numPointer++
    
    printf( "%d", num ) ;
    

    You might expect (as I did) that the code would print out num as 2. However the ++ operator has precedence over the pointer dereferencer *. Cue some seriously wacky intermittent problems later on in the code >_<.

    Me no code so good.

  • SaerisSaeris Borb Enthusiast flapflapflapflapRegistered User regular
    Alas, another victim of ++! If only they would follow the righteous path of += 1.

    borb_sig.png
    Polaritie
This discussion has been closed.