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/
Options

My Little [Programming] Thread: Debugging is Magic

194959698100

Posts

  • Options
    IncindiumIncindium Registered User regular
    edited September 2014
    a5ehren wrote: »
    Someone is agitating for time zone support on our box. Noooooooooooooooooooooooooooooooo

    Timezone stuff is the worst. Implementing it across the board and correctly was such a pain. Store everything as UTC in database and then apply timezone conversions on any datetime going out or coming in with a user preference setting what timezone they want to display things in/ convert inputs from.

    Stuff like last week, last month, last year filtering you have to make your DB sprocs take Start and End Date parameters and convert in code so that those values are correct for the specific user's timezone.

    Incindium on
    steam_sig.png
    Nintendo ID: Incindium
    PSN: IncindiumX
  • Options
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    was given the all clear by the business to not use .NET systems for future minor web work because deploying .NET onto company infrastructure is a red tape nightmare. the cornucopia of the web is open to me. i'm cold and frightened.

  • Options
    bowenbowen How you doin'? Registered User regular
    Sounds like a job for PHP!

    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
    KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    bowen wrote: »
    Sounds like a job for PHP!

    I think you mean CGI::Application.

  • Options
    ecco the dolphinecco the dolphin Registered User regular
    edited September 2014
    Ethea wrote: »
    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.

    Oh, if this is reference my original post, then I was using the term "project" in the Visual Studio sense.

    So we have the whole solution, and I tend to put the unit tests as their own "project" (i.e. they have their own executable which verifies individual components/logical groups of components)

    They're still in the same repo, just in a separate subdirectory.

    Unfortunately, there are at least two levels of WTFness that I was too busy frothing at my mouth about to type in that post:

    1.) The unit test define macro were part of the main app and enabled by default in a .h file (as opposed to, say, a command line option), so by checking out the source tree and building, you'd get a build of the main app that tried to run unit tests.
    2.) They weren't actually unit tests. No actual verification was being done at all, other than maybe "well, it doesn't crash when I run it".

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    bowen wrote: »
    Sounds like a job for PHP!

    I think you mean CGI::Application Java.

    Penny Arcade Developers at PADev.net.
  • Options
    a5ehrena5ehren AtlantaRegistered User regular
    Incindium wrote: »
    a5ehren wrote: »
    Someone is agitating for time zone support on our box. Noooooooooooooooooooooooooooooooo

    Timezone stuff is the worst. Implementing it across the board and correctly was such a pain. Store everything as UTC in database and then apply timezone conversions on any datetime going out or coming in with a user preference setting what timezone they want to display things in/ convert inputs from.

    Stuff like last week, last month, last year filtering you have to make your DB sprocs take Start and End Date parameters and convert in code so that those values are correct for the specific user's timezone.

    Yeah. I think my manager told him to fuck off, but I'm not looking forward to it coming up again. Especially considering what we do, having all the boxes be on UTC makes our lives a lot easier.

  • Options
    Lux782Lux782 Registered User regular
    Does anyone have experience installing packages for python? I have been spending the last hour trying to install things like numpy, scipy, h5py, and what not. I have not been successful. Its quite disheartening really. It makes me appreciate how awesome NuGet is.

    I have tried Anaconda, WinPython, installing by downloading the source. I just can't get it to work. Any advice would be amazing.

  • Options
    mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    On Linux at least, you can use pip to grab and install packages... might be able to use on Windows too? (I have no clue, I don't use windows for dev)

  • Options
    crimsoncoyotecrimsoncoyote Registered User regular
    It's been a few months since I installed Python packages on Windows, but I don't remember it being that difficult. I'm pretty sure there was some pip-thing involved

  • Options
    EtheaEthea Registered User regular
    Why didn't Anaconda work? Trying to build numpy,scipy and h5py from source on windows is a world of pain you don't want to deal with.

    Other than Anaconda you could try pythonxy

  • Options
    Lux782Lux782 Registered User regular
    I installed anaconda, tried import numpy and I am told numpy cannot be found. Do I have to muck with PATH stuff? For how easy some things are in python thus far I find dealing with dependencies to be a bit frustrating. I have been reading that people recommend using virtualenv to make different environments to work in. I don't quite understand the logic behind it all. This is the first time I will be working with python in any meaningful way. I have used ironpython to add scripting to my .NET applications however I have never tried writing a python application. My initial thought was a module was like a project reference however that notion appears to be completely wrong.

    From what I have read of virtualenv it seems the idea is to create a new python environment for each project. Then with an IDE like PyCharm you can swap between environments and keep them clean. After a bit more messing around I found http://www.lfd.uci.edu/~gohlke/pythonlibs/ and after installing one of those pre-build numpy modules I could import it however I think I would have prefered to have it installed in the virtual environment I created. Does anyone have any experience working with virtualenv or have a link to a good tutorial on setting up a python development environment? I have found the simple (think python101) tutorials however finding a good one that explains environments, modules, and what not been easy. It's not the programming part that is difficult.

  • Options
    Jimmy KingJimmy King Registered User regular
    pip should also work on windows. I think you will have to fuck around with paths. You'll also occasionally run into a lib that truly does not work on windows (I think they're fairly rare). I'm not sure how well libs which need to compile C or C++ code are going to work out, those may be a real nightmare to get working.

    Virtualenv is the way to go with Python. I have no experience getting it working on Windows, though. I installed Python on Windows once or twice, but have done nothing with it. Basically anything you read about Python and any tools you use will more or less assume you're on on Linux or osx. Looking at the virtualenv docs, it looks like you'll just install on windows with pip as you normally would, then read the bits about windows under http://virtualenv.readthedocs.org/en/latest/virtualenv.html#activate-script. Once you activate a virtualenv, you just use pip to install packages as usual.

  • Options
    EndEnd Registered User regular
    edited September 2014
    the last time I did serious python on windows, I remember using exe installers for scipy and numpy, but that was before pip was a thing

    I've heard people swear by conda, but I've never used it

    End on
    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpg
  • Options
    AnteCantelopeAnteCantelope Registered User regular
    Virtualenv is pretty much required if you're doing serious python work. Each of your project's dependencies will need to be installed, and if you aren't using virtualenvs they're installed into the system python. Then, if two different projects require different versions of the same package, you're in trouble. Much better to install your dependencies in virtualenvs specific to that project.

    Pip is definitely the best and easiest way to do it on Linux, I have no idea on Windows. I worked in Linux, and only briefly touched python in Windows, so I can't really help with that specifically. What I do know, though, is that numpy and scipy were harder to install than regular packages. I don't remember the specific problems I had, but it took extra time and effort to get them going. It might be worth trying to get virtualenv and pip working with a simpler package before dealing with them. Unless they've changed in the last year.

  • Options
    KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    I don't know if this would work for you, but Enthought Canopy has all the scipy and jumpy/ATLAS stuff rolled up.

    https://store.enthought.com/

  • Options
    EtheaEthea Registered User regular
    I am pretty sure pip tries to compile packages that have C/C++ dependencies on windows. Which is going to be the real problem as numpy, scioy, hdf5, etc have a fairly complex dependency set that generally needs some tweaking to perform ( blas, lapack, mpi, etc )

  • Options
    EndEnd Registered User regular
    edited September 2014
    Ethea wrote: »
    I am pretty sure pip tries to compile packages that have C/C++ dependencies on windows. Which is going to be the real problem as numpy, scioy, hdf5, etc have a fairly complex dependency set that generally needs some tweaking to perform ( blas, lapack, mpi, etc )

    pip is supposed to be able to use precompiled eggs or whls if pypi has them (numpy has some whls, but only for OS X). I'm not sure if pip needs the wheel package to understand them, hopefully not.

    (the name wheels come cheese wheels, because pypi is also known as the cheese shop, because monty python. You can also think of it as a snake eating its own tail.)

    End on
    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpg
  • Options
    EtheaEthea Registered User regular
    I just downloaded anaconda on a clean windows machine and had no problem import numpy. See http://imgur.com/a/zoA6i

    Just make sure you use the anaconda prompt.

  • Options
    TofystedethTofystedeth Registered User regular
    urahonky wrote: »
    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.
    There's always the job thread in SE++ for general complaining/discussion.

    steam_sig.png
  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    I don't know why I'm so nervous about venturing into SE++.

  • Options
    bowenbowen How you doin'? Registered User regular
    The job thread is pretty tame.

    It's the chat/joke threads that are a bear.

    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
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    the job thread is for all intents and purposes a chat thread

  • Options
    bowenbowen How you doin'? Registered User regular
    Don't judge 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
  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    edited September 2014
    All SE++ threads are, to varying degrees, chat threads.

    admanb on
  • Options
    mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    It is kind of the overall rule of that subforum, yea. I don't mind it too much.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Welp, at least one day out of this week I actually got something done.

    Is it bad that I'm looking forward to my procedure on Monday so I have a day off?

  • Options
    mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    Today is going to be a good day, I'm doing a upgrade of the OS and software on the prototype machine which means:

    a ) no one is going to fucking bother me for the whole day
    b ) I get to listen to music all day because of (a)
    c ) people will bother me less to do shit for them because it brings the software to standard deployment so people will know what to do with it

  • Options
    Mr_RoseMr_Rose 83 Blue Ridge Protects the Holy Registered User regular
    urahonky wrote: »
    Is it bad that I'm looking forward to my procedure on Monday so I have a day off?

    Yes?
    No, wait, I mean
    Yes!

    ...because dragons are AWESOME! That's why.
    Nintendo Network ID: AzraelRose
    DropBox invite link - get 500MB extra free.
  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Mr_Rose wrote: »
    urahonky wrote: »
    Is it bad that I'm looking forward to my procedure on Monday so I have a day off?

    Yes?
    No, wait, I mean
    Yes!

    It was a trick question! The answer is fizzbuzz!

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Wow, actionscript doesn't have method/function overloading huh?

  • Options
    bowenbowen How you doin'? Registered User regular
    urahonky wrote: »
    Wow, actionscript doesn't have method/function overloading huh?

    This is the most infuriating thing about some languages.

    I understand you want to protect me from shooting myself in the foot. But a good person practices good gun discipline to begin with.

    If I shoot myself in the foot, honest, I won't hold you responsible.

    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
    bowenbowen How you doin'? Registered User regular
    Geth appreciates trigger discipline.

    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
    What are they protecting themselves from? The developer being confused as to which method/function gets called?

    I now have to do the "if(object is Number)" in the method. I feel like that's more annoying than having two separate methods.

  • Options
    bowenbowen How you doin'? Registered User regular
    Getting phone calls from an angry dev that one event fired over another because most ever human I've worked with is basically functionally a moron.

    I'm just angry lately, ignore my manic episodes.

    Sick of having to add features because people don't want to hit two buttons to verify something.

    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
    mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    Today is going to be a good day, I'm doing a upgrade of the OS and software on the prototype machine which means:

    a ) no one is going to fucking bother me for the whole day
    b ) I get to listen to music all day because of (a)
    c ) people will bother me less to do shit for them because it brings the software to standard deployment so people will know what to do with it

    Nope, should have known, people always find a way. In this case there's someone who has no idea how to install the software, who is for some reason installing software, and who is for some reason coming to me for all his problems. /tableflip

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Today is going to be a good day, I'm doing a upgrade of the OS and software on the prototype machine which means:

    a ) no one is going to fucking bother me for the whole day
    b ) I get to listen to music all day because of (a)
    c ) people will bother me less to do shit for them because it brings the software to standard deployment so people will know what to do with it

    Nope, should have known, people always find a way. In this case there's someone who has no idea how to install the software, who is for some reason installing software, and who is for some reason coming to me for all his problems. /tableflip

    Holy shit that's annoying.

  • Options
    KambingKambing Registered User regular
    edited September 2014
    urahonky wrote: »
    What are they protecting themselves from? The developer being confused as to which method/function gets called?

    I now have to do the "if(object is Number)" in the method. I feel like that's more annoying than having two separate methods.

    It's a semi-contentious language design decision, e.g., see this blog post from Gilad Bracha:

    http://gbracha.blogspot.com/2009/09/systemic-overload.html

    I don't necessarily endorse as radical of a view as his. But static overloading has clear issues in the presence of fancy language features, e.g., implicit conversions in Scala or C++.

    Kambing on
    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • Options
    bowenbowen How you doin'? Registered User regular
    edited September 2014
    Boy was that pretentious.

    "This is dangerous because... my really niche examples break it!"

    Yes it saves me from having to invent names. Deal with it motherfucker. Nothing is worse than a project full of "DoThing1(),DoThing2()" not even dealing with a few gotchas with overloading.

    And random hate on constructors is always fun.

    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
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    I find operator/function overloading in C++ is quite handy when you're doing template meta-programming.

    In a few other cases, it's also pretty neat and just makes life easier, e.g.
    auto varValue = m_DataVector[3];
    using std::to_string;
    std::string message = to_string( varValue ); // Don't need to really care what varValue was
    

    It might have been std::to_string, or decltype( varValue ) might have been a custom type, so we might be using ecco::to_string( tCustom ) instead.

    Who knows?

    But then, I tend to use Visual Studio, so Intellisense (or the debugger) will usually be able to tell me exactly which overload I'm calling.

    I guess it says something that external tools are used to make use of a language feature, but then, I'm okay with that. We've been using external tools in C/C++ land for ages (lint, valgrind, etc) to catch bugs - why not use external tools (Resharper, Intellisense etc) to help write code?

    Penny Arcade Developers at PADev.net.
This discussion has been closed.