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

PA Programming Thread: Arguing, Cursing, and Recursing

1818283848587»

Posts

  • Options
    an_altan_alt Registered User regular
    I was getting pretty worried about future job prospects a few years ago when I was working entirely in an end-of-life language. Fortunately, after all the trouble another developer had jamming old code into IIS, they let me decide to do all of our back end webservices in Java on Tomcat. I hadn't used Java since I was in school and things had changed a lot, but it was such a breath of fresh air using a proper, modern language. At least something that was built around OOP instead of tacking it on after the fact. It worked great for everything we needed it to do, but I've been getting the feeling that Java solved the problems from when it was created, but everything since has been tacked on with a whole bunch of overlapping frameworks and suites.

    I've never played with C#, so I've been trying to find an excuse to pick that up, but no luck there.

    My experience with Python is a few chapters of the online tutorial, a few Euler projects, and a little utility I wrote a year or so ago. I don't think anyone gets to know a language until they've done a major project with it, so it will be learning Python pretty much from scratch when I get to start on [next project] later this year.

    For those of you who have worked with Python and Django, what's your favourite IDE? Got anything better than Eclipse with PyDev? Are there some good places to learn about them aside from their respective websites? Any big starter tips? Good blogs to follow, etc?

    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
    Jimmy KingJimmy King Registered User regular
    I feel sorry for you if Java and Tomcat are a breath of fresh air. I did one website that ran on Tomcat just to get a feel for j2ee and Tomcat is the biggest pain in the ass ever.

    You'll like Python, I think. Django is great (most of the time). Python feels very much like a more modern Perl. As to IDE, I do all of my Python dev in emacs and sometimes vim. I have no real preference between the two, I just already know how to set emacs to do my tabs and syntax highlighting and everything how I want and I don't in vim and haven't looked.

    http://www.saltycrane.com/blog/ comes up when I'm googling for Django or Python help quite frequently.
    http://djangobook.com was pretty good, but it's a bit out of date now, which can cause problems sometimes.

    I'll post a few more if I remember, I may have some good tabs open on my computer at home from research I was doing last night for unit testing in Django.

  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    Now that I've gotten the hang of them I'm really starting to like lambas in c#

    Stuff like:
    CustomerIDList.AddRange(TransferData.Orders.Where(x => !CustomerIDList.Contains(x.CustomerID)).Select(x => x.CustomerID));
    

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    DehumanizedDehumanized Registered User regular
    yes, lambda expresions are great

    sure do love me some c#

  • Options
    jonxpjonxp [E] PC Security Registered User regular
    One of these days I need to do a bigger project in Python than what I've done so far. There's *got* to be a reason why so many people like it better than Ruby, I just haven't figured it out yet.

    Every time you write parallel fifths, Bach kills a kitten.
    3DS Friend Code: 2707-1614-5576
    PAX Prime 2014 Buttoneering!
  • Options
    Jimmy KingJimmy King Registered User regular
    my only complaint with Ruby as far as actually writing code in it, from what little I've done, is that I feel like I'm writing vb with type "end" at the end of blocks and it seems like there was some other minor thing like that.

    I'm also just insulted by the creator's attitude. From things I've read and his (I think it was him) comments in the Seven Languages book, his attitude seemed to be "Sure, Ruby runs slower than most other languages including directly competing high level languages. But your project is probably going to be a failure anyway and performance won't matter, so don't worry about it and just use Ruby so that you can write the code as fast as possible." While that's true, I'd prefer to be treated like I might manage to do it right.

  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    yes, lambda expresions are great

    sure do love me some c#

    I'm trying to do as much work as possible on this project so I can hold off on my massive pickBASIC one :)

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    an_altan_alt Registered User regular
    Thanks for the tips, Jimmy.

    Yes, Java was a breath of fresh air compared to VFP which is where the old d-base stuff wound up. It's cool to treat database tables like primary types, but everything is something that was added to the language at a later date. It also suffers from that VB-esqe attitude where you're given a language, IDE, and tools with the expectation that you'd never want to do anything outside of that. Of course, if you work in anything for long enough, the language itself fades away and you just see the structure and business rules. Then again, I might feel differently if I actually dealt with UI.

    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
    jonxpjonxp [E] PC Security Registered User regular
    edited September 2011
    Jimmy King wrote:
    my only complaint with Ruby as far as actually writing code in it, from what little I've done, is that I feel like I'm writing vb with type "end" at the end of blocks and it seems like there was some other minor thing like that.

    I'm also just insulted by the creator's attitude. From things I've read and his (I think it was him) comments in the Seven Languages book, his attitude seemed to be "Sure, Ruby runs slower than most other languages including directly competing high level languages. But your project is probably going to be a failure anyway and performance won't matter, so don't worry about it and just use Ruby so that you can write the code as fast as possible." While that's true, I'd prefer to be treated like I might manage to do it right.

    Huh, that doesn't sound like Matz...maybe you're referring to DHH, the creator of Rails? Also, since 1.9.2, Ruby is comparable in speed with Python (but not the new JIT version, of course).

    EDIT: Nope, from what I can find Matz is the guy who was interviewed in the book. Oh well...the "fail fast" ideal is pretty prevalent in the startup community these days, so it's not *that* odd of a thing to say. That's why I thought it was DHH, he's a big proponent of getting your idea out there quickly to see if it's even possible, and failing quickly before you've wasted too much time and energy.

    jonxp on
    Every time you write parallel fifths, Bach kills a kitten.
    3DS Friend Code: 2707-1614-5576
    PAX Prime 2014 Buttoneering!
  • Options
    Jimmy KingJimmy King Registered User regular
    Yeah, from what I understand Ruby has seen huge increases in performance in the last couple of years and actually isn't bad now. If had need for another interpreted language or thought there was a better job in my near future if I were to do a bit of work with it, I would. I liked some of the features it had when I played with it.

  • Options
    Jimmy KingJimmy King Registered User regular
    @an_alt here's another decent blog for Django stuff - http://techblog.ironfroggy.com/. It's not all django all the time, but it has some good info. This blog is what pointed me in the right direction for writing unit tests for custom template tags.

  • Options
    jonxpjonxp [E] PC Security Registered User regular
    edited September 2011
    Yeah, speaking of jobs, I don't know if there are any of you guys are in, or looking to move to, the Atlanta area, but there are a LOT of openings around here if you know Ruby. I mean, seriously, every month there are 3-5 companies announcing that they're still looking for more developers at our user's group.

    Even my company is trying to fill an additional spot. The main problem everyone is having is finding enough Ruby devs to meet demand. So it's a job seeker's market out here. So...you know...if you like doing web dev (not just frontend stuff, but the fun backend problems too), you know Ruby, and you can't seem to find a job you're happy with where you are, I'd suggest giving Atlanta a try.

    jonxp on
    Every time you write parallel fifths, Bach kills a kitten.
    3DS Friend Code: 2707-1614-5576
    PAX Prime 2014 Buttoneering!
  • Options
    CantidoCantido Registered User regular
    I have forgotten how to solve recursions. Can anyone help me fill in the gaps on these two?

    The first is backwards substitution. I worked it out a little....:
    T(n) = T(n-1) + n
    T(n) = T(n-2) + (n-1) + n
    T(n) = T(n-3) + (n-2) + (n-1) + n

    I forgot how to write out the answer. My instincts say to write something like T(k) = T(n-k) + k but that doesn't seem right.

    The second is Mathematical Induction. And, oh irony, the only examples I have don't have any recursion inside it.
    T(n) = T(n/2) + 1 and T(1) = 1

    Base case is obviously T(1) = 1 all over again, but I wrote my Inductive Hypothesis like this:
    T(n-1) = T(n-1/2) + 1

    And I don't know how to continue, if that's even right.

    3DS Friendcode 5413-1311-3767
  • Options
    CantidoCantido Registered User regular
    I have forgotten how to solve recursions. Can anyone help me fill in the gaps on these two?

    The first is backwards substitution. I worked it out a little....:
    T(n) = T(n-1) + n
    T(n) = T(n-2) + (n-1) + n
    T(n) = T(n-3) + (n-2) + (n-1) + n

    I forgot how to write out the answer. My instincts say to write something like T(k) = T(n-k) + k but that doesn't seem right.

    The second is Mathematical Induction. And, oh irony, the only examples I have don't have any recursion inside it.
    T(n) = T(n/2) + 1 and T(1) = 1

    Base case is obviously T(1) = 1 all over again, but I wrote my Inductive Hypothesis like this:
    T(n-1) = T(n-1/2) + 1

    And I don't know how to continue, if that's even right.

    3DS Friendcode 5413-1311-3767
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    Heh.

    Obviously, I left myself a TODO inside the code when I left on Friday night.

    Just did a full rebuild:
    1>.\xyz.cpp(#number) : error C2504: 'tAnInterfaceWhichRegistersItselfWithTheSystemAndOrdersPizza' : base class undefined
    

    Oh yes. Of course.

    Penny Arcade Developers at PADev.net.
  • Options
    agoajagoaj Top Tier One FearRegistered User regular
    Trying to create '%string%' in sprintf
    so I put in '%%%s%%' but it doesn't work right. The output string is
    'string
    What am I missing here?

    ujav5b9gwj1s.png
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    edited September 2011
    Trippple post!

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    edited September 2011
    No, double post.

    And I lost the original post.

    Darn it.

    Lemme try and recreate it:

    printf( "%%%s%%", "Hello!" );

    produces

    %Hello!% for me

    Don't suppose you accidentally did something like

    sprintf( pBuffer, "%%%s%%", pString );
    printf( pBuffer );

    instead of

    printf( "%s", pBuffer );

    ?

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • Options
    agoajagoaj Top Tier One FearRegistered User regular
    Yeah, I'm printing the buffer loaded from sprintf, why would that give a different result?

    ujav5b9gwj1s.png
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Because the buffer gets re-interpreted for more escape sequences

  • Options
    agoajagoaj Top Tier One FearRegistered User regular
    Ooooooooooooooooooh

    ujav5b9gwj1s.png
  • Options
    ASimPersonASimPerson Cold... and hard.Registered User regular
    You should probably also use snprintf() and make sure the string is null terminated when you're done.

  • Options
    bowenbowen How you doin'? Registered User regular
    jonxp wrote:
    Yeah, speaking of jobs, I don't know if there are any of you guys are in, or looking to move to, the Atlanta area, but there are a LOT of openings around here if you know Ruby. I mean, seriously, every month there are 3-5 companies announcing that they're still looking for more developers at our user's group.

    Even my company is trying to fill an additional spot. The main problem everyone is having is finding enough Ruby devs to meet demand. So it's a job seeker's market out here. So...you know...if you like doing web dev (not just frontend stuff, but the fun backend problems too), you know Ruby, and you can't seem to find a job you're happy with where you are, I'd suggest giving Atlanta a try.

    I'm learning Ruby as we speak. But no way in shit do I want to move to Atlanta. I'd actually rather stay up here in Syracuse... as shitty as that is.

    Also fuck while on the topic website dev, why the fuck do people always want me, the programmer, to do visual layouts. Seriously what the fuck is wrong with some people? Sure I can program up someone's PSD or whatever once they export it to HTML but fuuuuck that noise.

    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
    The AnonymousThe Anonymous Uh, uh, uhhhhhh... Uh, uh.Registered User regular
    Today I discovered conversion operators in C#.

    I feel as though I have become a dark god, a master of chaos. :twisted:

  • Options
    zeenyzeeny Registered User regular
    bowen wrote:
    Also fuck while on the topic website dev, why the fuck do people always want me, the programmer, to do visual layouts. Seriously what the fuck is wrong with some people?

    You have stumbled on incredibly cheap employers that believe that design is free and have decided not to employ or contract designers? Because there is no other explanation. Making a developer design outside of DOM manipulation or functionality is a complete waste of resources.
    Sure I can program up someone's PSD or whatever once they export it to HTML but fuuuuck that noise.

    You lost me here. If you get the actual design and have to link it with the code, assuming your project is following MVC or a similar convention, then yeah it's pretty much your job. If it was designed well, plugging in the design is a couple of hours at most.

  • Options
    bowenbowen How you doin'? Registered User regular
    Hmm, seems like conversion operators are just a fancy way to overload = because you can't overload = in C#.

    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
    zeeny wrote:
    bowen wrote:
    Also fuck while on the topic website dev, why the fuck do people always want me, the programmer, to do visual layouts. Seriously what the fuck is wrong with some people?

    You have stumbled on incredibly cheap employers that believe that design is free and have decided not to employ or contract designers? Because there is no other explanation. Making a developer design outside of DOM manipulation or functionality is a complete waste of resources.
    Sure I can program up someone's PSD or whatever once they export it to HTML but fuuuuck that noise.

    You lost me here. If you get the actual design and have to link it with the code, assuming your project is following MVC or a similar convention, then yeah it's pretty much your job. If it was designed well, plugging in the design is a couple of hours at most.

    Nah meaning yeah that's the job I could do. You're right, a few hours to get the basic of backend functionality in it.

    It's the ones that want me to do the designing too that piss me the fuck off. Now I'm not bad, but seriously, a developer making you a website will be the most basic thing. So to piss them off I deliver something like this: http://cmdshiftdesign.com/ilovesmekitty/

    I remember one of the sites I made for managing radius users and logins and all that (which was actually my test before I got the job) it was strictly black on white, the most utilitarian of interfaces.

    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
    zeenyzeeny Registered User regular
    edited September 2011
    uuuuuh, triplepost ? !!?

    zeeny on
  • Options
    zeenyzeeny Registered User regular
    Guys, for some reason(caching or whatever) old threads with a lot of posts load really, really slow(20+ seconds) on PA's nginx.
    Really think somebody should just start a new programming thread(like it was done with the book thread in D&D).

  • Options
    bowenbowen How you doin'? Registered User regular
    That seems obtuse.

    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
    InfidelInfidel Heretic Registered User regular
    New thread that will hopefully not be slow ass.

    OrokosPA.png
  • Options
    an_altan_alt Registered User regular
    I whipped up an internal utility a few months ago for importing XML documents into software that our company makes. On a grey screen, It has three buttons - one to pick the input file, one to pick the destination, and one to do the import. There are friendly, verbose messages for success and different types of failure.

    After being in use for about two months, I was asked by our tech support manager to produce documentation for it. He was unable to tell me which of the three buttons needed further clarification.

    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
    Jimmy KingJimmy King Registered User regular
    Yeah, I was messing around the other day and noticed that only long ass threads like ours seemed to be taking forever to load... and really only if you try to access the later pages. Loading the first few pages of this thread (or any of the other large threads) is relatively quick. It's like something is happening per post up to the latest post that gets displayed, even for posts that are prior but not currently being displayed or maybe querying for every post and hitting something that's not indexed. I can't imagine that's what really is going on, but it's what it seems like.

  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    edited September 2011
    blah

    Weretaco on
    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    edited September 2011
    blah

    Weretaco on
    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    TomantaTomanta Registered User regular
    Jimmy King wrote:
    Yeah, I was messing around the other day and noticed that only long ass threads like ours seemed to be taking forever to load... and really only if you try to access the later pages. Loading the first few pages of this thread (or any of the other large threads) is relatively quick. It's like something is happening per post up to the latest post that gets displayed, even for posts that are prior but not currently being displayed or maybe querying for every post and hitting something that's not indexed. I can't imagine that's what really is going on, but it's what it seems like.

    I believe it is only the really long, pre-forum change threads that take forever.

This discussion has been closed.