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

PA Programming Thread: Arguing, Cursing, and Recursing

1666769717287

Posts

  • jackaljackal Fuck Yes. That is an orderly anal warehouse. Registered User regular
    Nightslyr wrote:
    jackal wrote:
    My company has "upgraded" an internal app. One of the main things they changed is they added frames. They ADDED frames in the year of our lord 2011. They used names for everything where they used have used ids, and all types of javascripty abominations. The worst javascripty thing they did is instead of rendering html on the server side they rendered inline javascript on the server side which concats strings to renders html on the client side.

    I'm never done any webdev professionally so I was wondering if anyone could weigh in on the frames thing. I'm not sure if it is a big deal or if I'm just sperging out needlessly. It seems like it should be a big deal because HTML5 deprecated frames.

    Frames are an abomination, and have been considered real bad practice for years. If you're talking a straight up, normal frameset (not iframes), they've been considered bad for a decade or so. Iframes are still in use in places, but grudgingly so. I haven't seen iframes used in quality professional sites in 3-5 years.

    Even with HTML 4/XHTML 1.1, there's no real need for frames. Not with modern ajax techniques.

    Aren't frames deprecated in HTML5?

    Yes. That was one of the things that initially made my head start to explode. HTML5 just starts to get traction, and they release a website with pointless frames.

  • Jimmy KingJimmy King Registered User regular
    jonxp wrote:
    Jimmy King wrote:
    jonxp wrote:
    Jimmy King wrote:
    You guys and your enjoyable jobs and good working conditions.

    It's one of the things I like about being a Ruby dev. :-)
    I think I've seen fewer Ruby dev jobs than even Perl locally.

    Here in the Atlanta area, there are way more Ruby jobs than devs. Every month at our Ruby User's Group, we have five or six job opening announcements (and usually no "seeking a job" announcements). In fact, I even saw a Birmingham company offering a $10K signing bonus plus all moving expenses paid. But...you know...you'd be in Alabama.
    Python is getting to be that way locally, which is why I've been working with it. It's not quite there yet, though.

  • bowenbowen How you doin'? Registered User regular
    edited August 2011
    I am surprised python and ruby are that large. My area is focusing on .NET just because the turnaround time for .NET developed apps compared to unmanaged C++ is huge. Java is still really popular around here.

    But they're not paying devs near enough, average pay wage around here for programmers is $40-50,000 for someone who knows what they're doing. Good luck to them I guess.

    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
  • Jimmy KingJimmy King Registered User regular
    Oh, Python isn't huge here yet, it's just growing. .Net is by far the biggest, followed by Java. But there's way more competition from people who have been working with those specific things for a billion years, most corporate-desired Java skills are a giant hassle to build on your own because it's just too big and clunky for personal projects, and they are some of the worst about the "we want a million years experience with these specific things and we mean it" bs because of the huge pool of potential employees.

    Python is still small, but it's growning. More and more companies are wanting it, little by little, and bitching about not being able to find local talent. They just seem to have that .net and java hiring mindset still for some reason, I think because all of them I've talked to were either large corps. or start ups that are being started by ex-upper management from those large corps.

  • bowenbowen How you doin'? Registered User regular
    I've come to realize the difference in experience and actually knowing what you're doing. Anyone can work with a company for 8 years and have experience. But someone who knows what they're doing is priceless because they can do the same amount as that 8 year person in half the time.

    Also why I ignore companies that put "Oh I want 10 years of experience, a bachelors, and you get no benefits!" because lol really? Sure there are tons of us out there but that's not going to get anyone.

    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
  • EndEnd Registered User regular
    python has had some pretty crazy growth in the last couple of years

    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpgsteam~tinythumb.png
  • jonxpjonxp [E] PC Security Registered User regular
    It doesn't hurt that Google is really big into Python.

    Every time you write parallel fifths, Bach kills a kitten.
    3DS Friend Code: 2707-1614-5576
    PAX Prime 2014 Buttoneering!
  • StarfuckStarfuck Registered User, ClubPA regular
    I end up doing a lot of Python. I do GIS (I'm really an anlyst) and Python is huge in that field for automation, especially using numpy and some R for analysis. On the backend, the GIS server stuff is mainly .NET although they do support Java which I'll use for some stuff. .NET is also how most of the desktop extensions are built. Then on the web end they have a Flex API that is where I do most of my work, but also a Javascript API that I use for a couple of apps.

    What I'm saying is, if you talk to any GIS developer, they'll tell there is a reason we drink so damn much.

    jackfaces
    "If you're going to play tiddly winks, play it with man hole covers."
    - John McCallum
  • Joe KJoe K Registered User regular
    jonxp wrote:
    It doesn't hurt that Google is really big into Python.

    it hurts that the Android VM uses java. why couldnt they have used something sane like python?

  • jackaljackal Fuck Yes. That is an orderly anal warehouse. Registered User regular
    Joe K wrote:
    jonxp wrote:
    It doesn't hurt that Google is really big into Python.

    it hurts that the Android VM uses java. why couldnt they have used something sane like python?

    speed.

  • Joe KJoe K Registered User regular
    jackal wrote:
    Joe K wrote:
    jonxp wrote:
    It doesn't hurt that Google is really big into Python.

    it hurts that the Android VM uses java. why couldnt they have used something sane like python?

    speed.

    Yes, using the base VMs, Java is faster than Python. But Google isn't using the Base Java VM (and is getting sued by Oracle for said changes), and I'm sure that they would be using a highly optimized version of the python VM to make the differences negligible, and the python programs would be compiled to byte code and run from there, and you could get nearly the same performance. Probably...

    I think that the real reason is that there are more Java people out there than Python, so Google went after the Developers, Developers, Developers and what they know already, instead of using a more efficient language (efficiency being defined by producing more functionality with less coding time).

    It will be interesting what the Oracle suit will bring. It will either lead to a Gava implementation, or a wholesale switch. The issue is that while the full-blown BIG JVM is "free", the stripped down, suitable for embedded devices requires a license. Google did the strip down on their own, and Oracle is suing them over it.

  • jackaljackal Fuck Yes. That is an orderly anal warehouse. Registered User regular
    All things being equal dynamic languages will never be as fast as static languages. The work that dynamic languages have to do at runtime is strictly greater than static languages. With that said, there are a lot of potential apps that don't need the extra speed and supporting both Java and Python seems like a no brainer.

  • bowenbowen How you doin'? Registered User regular
    I'd have loved to see them pick up mono. That would've been amazingly weird and awesome all at the same time.

    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:
    I'd have loved to see them pick up mono. That would've been amazingly weird and awesome all at the same time.
    I have no idea how well this works - http://android.xamarin.com/

  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    jackal wrote:
    Joe K wrote:
    jonxp wrote:
    It doesn't hurt that Google is really big into Python.

    it hurts that the Android VM uses java. why couldnt they have used something sane like python?

    speed.

    That would be an excuse for a company other than Google. These days everyone (for example, Google) is writing compilers that turn messy dynamic code into fast static code.

  • jackaljackal Fuck Yes. That is an orderly anal warehouse. Registered User regular
    Dynamic code can't be turned into static code. That's the whole point of it being dynamic. If it were possible it would just be "static with a really good type system."

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited August 2011
    No, it can, at least partially. A good JIT compiler will analyze the types and use that to optimize the fast-path. There will still be type checks but they will be more of "Is everything as expected? Yes, jump to direct machine code. No, go back to VM"

    Also, it can be possible to determine the types of local variables based on referenced parameters / globals. If you just use parameters / upvalues in your function, then checking if a compiled version can be used can be pretty quick

    Phyphor on
  • jonxpjonxp [E] PC Security Registered User regular
    edited August 2011
    Joe K wrote:
    jonxp wrote:
    It doesn't hurt that Google is really big into Python.

    it hurts that the Android VM uses java. why couldnt they have used something sane like python?

    Memory. Dynamic languages use TONS of memory. A mobile device is severely resource constrained and has no swap space.

    EDIT: And this is partially why Android doesn't use the real Java VM, but instead one that optimizes for memory usage and fast deallocation.

    jonxp on
    Every time you write parallel fifths, Bach kills a kitten.
    3DS Friend Code: 2707-1614-5576
    PAX Prime 2014 Buttoneering!
  • bowenbowen How you doin'? Registered User regular
    As far as I was aware there are a few relatively naive AOT compilers out there. I think mono even comes with one. I think there's one from GCC as well for Java specifically.

    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
  • NightslyrNightslyr Registered User regular
    Nightslyr wrote:
    Man, I'm just full of questions lately...

    Is there a C#/.NET/IIS 7.5 equivalent of a cron job? I'm starting a new project, and trying to decide if I want to do it in PHP or ASP.NET MVC. One of the requirements is consuming incoming RSS feeds at regular intervals (say, every 30 minutes), and using that to update just about everything.

    Or you could simply make your project a Service, set up a timer thread that fires off the RSS poll & data update routines. I think that would be easier than trying to link an outside exe or script that's kicked off from Task Scheduler into IIS. Especially if you're using data in IIS like the ORM.

    Hmm...I've never done threaded anything, to my knowledge. Sounds better than creating a standalone exe, though. Any tips/links on how to do this?

    PSN/XBL/Nintendo/Origin/Steam: Nightslyr 3DS: 1607-1682-2948
    Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
  • bowenbowen How you doin'? Registered User regular
    Do you have a full version of Visual studio or one of the free ones @Nightslyr?

    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
  • NightslyrNightslyr Registered User regular
    bowen wrote:
    Do you have a full version of Visual studio or one of the free ones @Nightslyr?

    Full version. VS 2010 Professional, free via Website Spark.

    PSN/XBL/Nintendo/Origin/Steam: Nightslyr 3DS: 1607-1682-2948
    Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
  • bowenbowen How you doin'? Registered User regular
    edited August 2011
    There should be a project option under C# to do services. That's pretty much all you need to do. Other than understanding how they work. (what gets called when and how)

    Threading is pretty straightforward in .NET but I can give you examples if you need.

    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
  • NightslyrNightslyr Registered User regular
    Examples/tuts would be great. The only threading I've ever attempted was way back in college, in my assembly/C course, which I failed. Twice.

    PSN/XBL/Nintendo/Origin/Steam: Nightslyr 3DS: 1607-1682-2948
    Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
  • bowenbowen How you doin'? Registered User regular
    edited August 2011
    http://msdn.microsoft.com/en-us/library/aa645740(v=vs.71).aspx

    Though I'm a fan of mutex threading, it's what I use in my Net library and has worked fine for me for about a year.
    public class Program
    {
      private TimeSpan interval;
    
      public static void main()
      {
        interval = new TimeSpan(0,0,5); //5 seconds
        Thread myThread = new Thread(new ThreadStart(Program.processThread));
        myThread.Start();
      }
    
      private static void processThread()
      {
        while(true)
        {
          //do some stuff here
          //maybe use lock(object) to invoke a mutex on shared data
    
          //sleep
          System.Thread.Thread.Sleep(interval);
        }
      }
    }
    
    

    Be cautious, your thread will still run unless you clean it up properly. Debugger has the handy "stop" ability but if you aren't prepared it may run wild if you build a release candidate and there'll be no way to stop it easily.

    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
  • jackaljackal Fuck Yes. That is an orderly anal warehouse. Registered User regular
    Nightslyr wrote:
    bowen wrote:
    Do you have a full version of Visual studio or one of the free ones @Nightslyr?

    Full version. VS 2010 Professional, free via Website Spark.

    How did I not know about this!

  • bowenbowen How you doin'? Registered User regular
    jackal wrote:
    Nightslyr wrote:
    bowen wrote:
    Do you have a full version of Visual studio or one of the free ones @Nightslyr?

    Full version. VS 2010 Professional, free via Website Spark.

    How did I not know about this!

    Me either, what the hell Microsoft.

    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
  • IncindiumIncindium Registered User regular
    You could just create a scheduled task in windows that calls a standalone exe at the intervals you want (probably the easiest option) or go the service that uses a timer route like Kakodaimonos mentioned. We've used both methods successfully.

    Where are you storing the data the you going to be grabbing at specific intervals?

    steam_sig.png
    Nintendo ID: Incindium
    PSN: IncindiumX
  • IncindiumIncindium Registered User regular
    edited August 2011
    Here's an example how you'd actually do it with a service and a timer I found googling quickly.

    http://en.csharp-online.net/Creating_a_.NET_Windows_Service%E2%80%94The_Timer_Approach

    Services are setup a little bit differently than a basic multi-threading program like bowen posted as you need to implement ways to start and stop them. It's pretty easy though by just creating a Timer with a callback that you call in the OnStart method of the service.

    Incindium on
    steam_sig.png
    Nintendo ID: Incindium
    PSN: IncindiumX
  • NightslyrNightslyr Registered User regular
    Incindium wrote:
    You could just create a scheduled task in windows that calls a standalone exe at the intervals you want (probably the easiest option) or go the service that uses a timer route like Kakodaimonos mentioned. We've used both methods successfully.

    Where are you storing the data the you going to be grabbing at specific intervals?

    Database.

    Here's a more complete description of what I'm going to be doing:

    My client wants to create a sports site dedicated to New England sports. In order to do that, he wants me to use the RSS feeds of various local publications in order to provide the site's content. He's in the process of squaring away the data feeds themselves in order to avoid copyright issues (he's apparently in discussions with existing aggregators in an attempt to avoid copyright issues... I dunno if it works like that, but, hey, I'm just the developer). I need to be able to store these articles as he wants people to be able to comment on them.

    I need to be able to poll the source(s) at a fairly regular interval in order to account for breaking news and scores. I'm not sure if there's a better way to do it than simply running the feed consumer every 30 minutes or so.

    Unfortunately, I just got an email with him saying he wants to do it in PHP, so it looks like I'm going to have to go down the cron job route, unless anyone has a better, more responsive idea.

    PSN/XBL/Nintendo/Origin/Steam: Nightslyr 3DS: 1607-1682-2948
    Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
  • bowenbowen How you doin'? Registered User regular
    edited August 2011
    Incindium wrote:
    Here's an example how you'd actually do it with a service and a timer I found googling quickly.

    http://en.csharp-online.net/Creating_a_.NET_Windows_Service%E2%80%94The_Timer_Approach

    Services are setup a little bit differently than a basic multi-threading program like bowen posted as you need to implement ways to start and stop them. It's pretty easy though by just creating a Timer with a callback that you call in the OnStart method of the service.

    Ah you can start and stop a thread really easy. I'd avoid timers, they're more for GUI based multitasking.

    That boolean value? All you've got to do is make it editable. Next time it goes through the loop, your thread will exit. So the Service.OnStop (or whatever) can just do "running = false;" and your thread will exit gracefully instead of you trying to interrupt it. Start it back up again? running = true, thread.Start(); again. Most people rarely, if ever, need all that joining and stopping features that some threading libraries give. Assuming the thread isn't deadlocked, anyways.

    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
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    I feel like I've asked this question before, but what is the good and proper C++ editor for *NIX?

    Xcode just doesn't feel quite right with it.

  • bowenbowen How you doin'? Registered User regular
    Eclipse or Code::Blocks. The Qt one isn't bad either.

    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
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    hahaha eclipse


    I guess my beef with Xcode is that every time I open it, it just sticks Cocoa in a corner of the room, staring at me and shaking its head in disapproval.

    I am so comfortable with Objective-C that I am constantly tempted to backslide into it.

  • Joe KJoe K Registered User regular
    Jasconius wrote:
    I feel like I've asked this question before, but what is the good and proper C++ editor for *NIX?

    Xcode just doesn't feel quite right with it.

    vi .

    ok.... that's only somewhat joke. i understand that some people like to use GUI editors and stuff.... you crazy kids.

    "kate" is a very nice minimalist graphical editor, has great regex support, and code highlighting and recognition. It's very powerful, and I've seen KDE core team members use this as their main dev env. I think it's kindof the vi of code editors. :-)

    If you want bells and whistles, use QT creator, and if your doing C++ on linux, check out QT as a toolkit. It will make your life much easier, even if you just use QTCore, it gains you things like sensible containers (QObject), that have nice foreach iterators, and free() when it goes out of scope as well as a nice graphical widget set, to sensible string functions, and networking functions. it's almost as flexible as python and a helluva lot faster. It will change the way you look at C++.

  • EtheaEthea Registered User regular
    Joe K wrote:
    Jasconius wrote:
    I feel like I've asked this question before, but what is the good and proper C++ editor for *NIX?

    Xcode just doesn't feel quite right with it.

    vi .

    ok.... that's only somewhat joke. i understand that some people like to use GUI editors and stuff.... you crazy kids.

    "kate" is a very nice minimalist graphical editor, has great regex support, and code highlighting and recognition. It's very powerful, and I've seen KDE core team members use this as their main dev env. I think it's kindof the vi of code editors. :-)

    If you want bells and whistles, use QT creator, and if your doing C++ on linux, check out QT as a toolkit. It will make your life much easier, even if you just use QTCore, it gains you things like sensible containers (QObject), that have nice foreach iterators, and free() when it goes out of scope as well as a nice graphical widget set, to sensible string functions, and networking functions. it's almost as flexible as python and a helluva lot faster. It will change the way you look at C++.

    So this. So all this!

  • KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    bowen wrote:
    Incindium wrote:
    Here's an example how you'd actually do it with a service and a timer I found googling quickly.

    http://en.csharp-online.net/Creating_a_.NET_Windows_Service%E2%80%94The_Timer_Approach

    Services are setup a little bit differently than a basic multi-threading program like bowen posted as you need to implement ways to start and stop them. It's pretty easy though by just creating a Timer with a callback that you call in the OnStart method of the service.

    Ah you can start and stop a thread really easy. I'd avoid timers, they're more for GUI based multitasking.

    That boolean value? All you've got to do is make it editable. Next time it goes through the loop, your thread will exit. So the Service.OnStop (or whatever) can just do "running = false;" and your thread will exit gracefully instead of you trying to interrupt it. Start it back up again? running = true, thread.Start(); again. Most people rarely, if ever, need all that joining and stopping features that some threading libraries give. Assuming the thread isn't deadlocked, anyways.

    I'd actually recommend you do a timer in this. You probably want a poll and fork architecture. Your timer thread will fire on a relatively standard interval, you collect the data, fire off a temporary database udpate thread, do the work and and the database thread exits when it's done and your timer thread goes back to sleep until the callback is fired again.

  • an_altan_alt Registered User regular
    Nightslyr wrote:
    bowen wrote:
    Do you have a full version of Visual studio or one of the free ones @Nightslyr?

    Full version. VS 2010 Professional, free via Website Spark.

    Awsome. Thank you very much, Nightslyr.

    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.
  • Jimmy KingJimmy King Registered User regular
    Got my Scala OAuth lib more or less working. It's not complete, there's a lot of stuff someone "might" want to do that it doesn't currently support, but it works to authorize apps for both Twitter and Yahoo and works for both POST and GET requests to the main Twitter API. So I'd say it works for probably what probably 95% of the world would do with it.

  • LindenLinden Registered User regular
    Why, hello there complex.h. You are my new best friend.
    On which note: Mathematica's default scaling values for the Fourier transform are interesting. I shall have to restructure to take account of these. Anyone had experience with implementing FFT? (I'm thinking Cooley-Tukey, but I'm open to suggestions)

    And yes, writing it is justified. This is for practice.

This discussion has been closed.