The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

[Programming] Kafkaesque rabbits in the queue at the pub

ecco the dolphinecco the dolphin Registered User regular
This is the PA programming thread, home to programmers everywhere. Here we talk about cats, ponies, synergised high-efficiency software cloud platforms, and occasionally programming.
padevnet.png

PADev.net is a project started up by this thread to support PA developers. A discussion about shared hosting turns into an idea to have hosting and a community to support those working on hobby programs and web services and what not.

Some things require a dedicated VPS but the bar of entry isn't that low. The cost is not extravagant but the know-how required to manage one is daunting for many. PAdev.net provides a share of hosting and support, a $5 monthly fee nets you a shell account on the hub server and the expertise of your peers.

Community members looking to help out can request an account for the website, where all members can create and maintain guides and share project updates. There is no cost to have a community account, just contact an administrator. Also available are you@padev.net email accounts or forwarders.

Current administrators: @Infidel

Languages
  • Python - One of the most popular scripting languages around, Python is the go-to language for...just about everything, actually. Its high scalability and widespread support through third-party libraries make it useful for many applications, from simple five-minute jobs to complex Web servers. Python can also be embedded or bound into lower-level languages such as C, letting you write performance-critical code as well as providing access to libraries written for those languages.
  • Ruby - Another popular scripting language, Ruby is best known as the basis for Ruby on Rails, a framework for Web development that competes with its Python equivalent, Django. While not quite as famous as the juggernaut that is Python, Ruby is nonetheless prolific - modern versions of RPG Maker use it as their scripting language, for instance. And, of course, it can be embedded into other applications, much like Python.
  • Lua - Yet another scripting language. Lua is built on two principles: simplicity and minimalism. Designed with embedding in mind, Lua's overhead is tiny (it can be counted in hundreds of kilobytes at most) and the language itself only provides a handful of constructs...until you master the black arts of tables and metatables. Those who have done so claim to have seen the face of God; these claims are as yet unsubstantiated. What we do know, however is that in recent years Lua has garnered much attention thanks to LuaJIT, a project that provides not only a just-in-time compiler for Lua (granting a massive speed boost - almost C-like performance, in fact), but also an FFI (foreign function interface) library, allowing Lua scripts to directly call C functions without the hassle of writing boilerplate C bindings.
  • C and C++ - The Ones Who Came Before. C and C++ are old, clunky, archaic...and the most popular languages in existence. C was conceived in an era when memory was limited and programs were generally written in non-portable assembly languages. The underlying concept (which persists to this day) was that a compiler would take C code, turn it into assembly, and then turn that into an executable or library. Thus, programmers now only had to port most of the codebase instead of all of it! (the situation has improved considerably since then, of course - these days, only the really low-level stuff has a tough time being cross-platform). C++ came some time later, and shook things up significantly with the concepts of classes and generics. Modern C++ also includes the Standard Template Library, or STL, which provides all sorts of useful functionality to make life almost painless. These days most people will learn something simpler like Python before these guys, but make no mistake - everything from your operating system to your favourite video games to your microwave can trace its roots back to one of the two.
  • C# - The poster boy for Microsoft's .NET Framework, C# is a JIT-compiled language modelled after C++, but without any of the associated pain. Though initially developed as a robust alternative for Windows development, Microsoft makes the specifications available at no cost, which has led to other implementations popping up - the most well-known being the cross-platform Mono. The main draw of C# is its ease of use: with a ridiculous number of APIs available by default and the ability to call into native code, you'll have a tough time finding something higher-level that you can't do in C#. The fact that Visual Studio, one of the best IDEs around, also supports C#, is just icing on the cake.
  • Android - Directly responsible for bringing this OP into the 21st century, Android is a pseudo-operating system framework which runs on top of Linux. Android is primarily written in Java, though it also combines elements of C, C++ and sometimes even Python, and is designed for mobile devices. The Android application framework represents an almost entirely event-driven paradigm written primarily in Java which heavily utilises usage of background services, model-view-controller, and sub-classing as a method of changing behaviour of standard pieces. Also, it runs on your phone!
  • Java - :rotate:
  • PHP - :rotate:

(Credit: Original OP here)

Previous thread here.

Do you write software? Or just want to talk/bring up some software development related stuff? We are here!

And lurking.

And judging. Quietly. =P

Penny Arcade Developers at PADev.net.
ecco the dolphin on
«134567100

Posts

  • DelmainDelmain Registered User regular
    ecco you're killin me

    I was several hours without a programming thread

  • ecco the dolphinecco the dolphin Registered User regular
    Look

    I had a crying baby in one arm and my mobile phone in the other

    I can only do so much man

    Penny Arcade Developers at PADev.net.
  • KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    So it was better than dealing directly with the clients.

  • TofystedethTofystedeth Registered User regular
    Ahava phone posts all the time at all hours of the morning while dealing with baby.

    I actually really enjoy it because it means we hear from her more frequently and deciphering the autocorrected typos is a very entertaining puzzle.

    steam_sig.png
  • EvigilantEvigilant VARegistered User regular
    Ugh, so I'm hungover. I drank way too much with the client last night.

    In other news, I'm now Dev lead on my project so I get minions now.

    XBL\PSN\Steam\Origin: Evigilant
  • bowenbowen Sup? Registered User regular
    btw, whoever that was that gave the Anonymous types for C# and Json, I love you so much.

    I think it was @Echo

    Not having to do models and all that shit for something that's just interfacing with PHP is great.

    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
  • SpawnbrokerSpawnbroker Registered User regular
    Hey guys, I have a question. Spawnbroker is only going to be at your business for another 3.5 days, do you:
    A) Have him document features that he built
    B) Hand off projects he was working on to his coworkers, or
    C) Give him a project with vastly underestimated hours and hope he gets it done before he leaves?

    If you answered C, congratulations, you could be a CTO!

    Steam: Spawnbroker
  • bowenbowen Sup? Registered User regular
    3 hours to build a facebook clone, You can do it!

    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
  • gavindelgavindel The reason all your software is brokenRegistered User regular
    Hey guys, I have a question. Spawnbroker is only going to be at your business for another 3.5 days, do you:
    A) Have him document features that he built
    B) Hand off projects he was working on to his coworkers, or
    C) Give him a project with vastly underestimated hours and hope he gets it done before he leaves?

    If you answered C, congratulations, you could be a CTO!

    They know you will fail, and afterwards they can blame the guy who left for the failure rather than budget correctly.

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • Alistair HuttonAlistair Hutton Dr EdinburghRegistered User regular
    Dear people who make command line tools. Could you at the very least detect if you are running on windows and not punt out Unix terminal control codes for colours.

    I'm not asking you to put in the windows ones instead, just not to fuck up my output with unreadable gibberish.

    If npm can work this out then I'm sure you can to.

    I have a thoughtful and infrequently updated blog about games http://whatithinkaboutwhenithinkaboutgames.wordpress.com/

    I made a game, it has penguins in it. It's pay what you like on Gumroad.

    Currently Ebaying Nothing at all but I might do in the future.
  • bowenbowen Sup? Registered User regular
    colors are dumb anyways

    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
  • EchoEcho ski-bap ba-dapModerator, Administrator admin
    This date picker React component I need to add some stuff to has a TON of spaghetti code to validate manual input of a date, ie typing it in the input field the date picker is attached to instead of using the date picker.

    Going to check if we really need to support manual input. If not, I'll just scrap the whole component and rewrite it in a saner way.

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    No matter what, it will break someone's workflow: https://xkcd.com/1172/

  • bowenbowen Sup? Registered User regular
    well that's horrible

    who uses emacs

    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
  • zeenyzeeny Registered User regular
    *cough cough*
    *stab stab*

  • a5ehrena5ehren AtlantaRegistered User regular
    Wireshark on both monitors is a really good way to look busy.

  • KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    Oh lord.

    Nothing like finding a bug and then realizing that it's one of those bugs that the customer can never know that the bug existed.

  • templewulftemplewulf The Team Chump USARegistered User regular
    Oh lord.

    Nothing like finding a bug and then realizing that it's one of those bugs that the customer can never know that the bug existed.

    I liked being asked to make some minor text field changes on a payment form, only to discover that we were storing literally everything in an unencrypted database.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • NaphtaliNaphtali Hazy + Flow SeaRegistered User regular
    Oh lord.

    Nothing like finding a bug and then realizing that it's one of those bugs that the customer can never know that the bug existed.

    No.

    Even better is someone making this announcement on a conference call that the customer is sitting in on.

    Steam | Nintendo ID: Naphtali | Wish List
  • MvrckMvrck Dwarven MountainhomeRegistered User regular
    Even better: Going to change the IP on a copier and noticing it is routing the "Scan to email" function through an unsecured outside email server. And it's primarily used for doctors scanning patient information.

  • AntoshkaAntoshka Miauen Oil Change LazarusRegistered User regular
    Mvrck wrote: »
    Even better: Going to change the IP on a copier and noticing it is routing the "Scan to email" function through an unsecured outside email server. And it's primarily used for doctors scanning patient information.

    Of course it is, no copier made actually supports a secured email server, and no one who uses a copiers scan to email function could set on up to redirect internally.

    n57PM0C.jpg
  • Mai-KeroMai-Kero Registered User regular
    So I've now got a work-from-home IT job and I want to put my time that I was using on a 1-2 hour commute into learning some programming languages. Ideally, I'll be going back to school in the fall so I can finally finish a bachelors. I took a semester of computer science a few years ago, and got into C++ a little bit. Any advice on where I should start? I'm hoping that I can gain some knowledge that might allow me to take some freelance jobs on Upwork or something similar so I can cover some up front costs for school.

  • ecco the dolphinecco the dolphin Registered User regular
    Mai-Kero wrote: »
    So I've now got a work-from-home IT job and I want to put my time that I was using on a 1-2 hour commute into learning some programming languages. Ideally, I'll be going back to school in the fall so I can finally finish a bachelors. I took a semester of computer science a few years ago, and got into C++ a little bit. Any advice on where I should start? I'm hoping that I can gain some knowledge that might allow me to take some freelance jobs on Upwork or something similar so I can cover some up front costs for school.

    Depends on which area of development you aim to go in.

    Personally, I like C#, but if you're aiming to do web dev, then Javascript/Typescript and its libraries are key.

    If you're going embedded development, then C/C++ are still important.

    Penny Arcade Developers at PADev.net.
  • EchoEcho ski-bap ba-dapModerator, Administrator admin
    edited June 2016
    After staring in horror at this span tag with some 360 characters of logic to build the CSS class string inside of it...
    <span className={'group-link ' + (state.selectedItemKey===null && state.selectedGroupKey===this.props.group.Key ? 'item-selected-link':'item-not-selected-link' )+ (this.props.group.Deleted===true ? " deleted":"" ) } onClick={this.props.group.CanEdit == true ?this.selectGroup:(this.props.group.CanCollapse == true ? this.toggleItemVisibility:null)} >
    

    ...I immediately lost 2d20 SAN and then googled up classnames that does it way better.
    var Button = React.createClass({
      // ...
      render () {
        var btnClass = classNames({
          'btn': true,
          'btn-pressed': this.state.isPressed,
          'btn-over': !this.state.isPressed && this.state.isHovered
        });
        return <button className={btnClass}>{this.props.label}</button>;
      }
    });
    

    Echo on
  • EchoEcho ski-bap ba-dapModerator, Administrator admin
  • EchoEcho ski-bap ba-dapModerator, Administrator admin
    edited June 2016
    Okay, another one of those javascript things I'm not quite at an understanding with yet.
    var testTargetClass = 'test-target-itemname-' + item.Name.replace(/ /g, '');
    
    var linkClass = classNames({
      'item-link-text': true,
      'item-sortable-item': true,
      'item-selected-link': isItemSelected,
      'item-not-selected-link': !isItemSelected,
      testTargetClass: true
    });
    

    This gives me a CSS class called "testTargetClass", but I want to evaluate its name to the value of testTargetClass. How do? Can I even do that inside an object?

    edit: aha, classNames lets me tack it on as a truthy argument.
    var linkClass = classNames({
      'item-link-text': true,
      'item-sortable-item': true,
      'item-selected-link': isItemSelected,
      'item-not-selected-link': !isItemSelected,
    }, testTargetClass);
    

    Echo on
  • SpawnbrokerSpawnbroker Registered User regular
    I am torn on just how honest I should be in this exit interview. Do I tell them that the reason I started looking for a job is personality conflicts between me and the CTO? Or do I give vague statements like "trust your developers when they tell you something is unsustainable."

    Steam: Spawnbroker
  • bowenbowen Sup? Registered User regular
    I am torn on just how honest I should be in this exit interview. Do I tell them that the reason I started looking for a job is personality conflicts between me and the CTO? Or do I give vague statements like "trust your developers when they tell you something is unsustainable."

    Who's the interview with?

    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
  • SpawnbrokerSpawnbroker Registered User regular
    bowen wrote: »
    I am torn on just how honest I should be in this exit interview. Do I tell them that the reason I started looking for a job is personality conflicts between me and the CTO? Or do I give vague statements like "trust your developers when they tell you something is unsustainable."

    Who's the interview with?

    HR lady. But this is a 20 person company and everyone works in the same office.

    Steam: Spawnbroker
  • NaphtaliNaphtali Hazy + Flow SeaRegistered User regular
    bowen wrote: »
    I am torn on just how honest I should be in this exit interview. Do I tell them that the reason I started looking for a job is personality conflicts between me and the CTO? Or do I give vague statements like "trust your developers when they tell you something is unsustainable."

    Who's the interview with?

    HR lady. But this is a 20 person company and everyone works in the same office.

    Tough call. Do you think you're ever going to have to work with this company again and/or worried about them as a reference? Being vague might be best, you could also possibly go a "I felt like my opinions and expertise were not being valued or my concerns about process addressed" route.

    Steam | Nintendo ID: Naphtali | Wish List
  • KolosusKolosus Registered User regular
    I think you give honest feedback without burning any bridges. Don't name names but make sure you point out culture problems.

  • DelmainDelmain Registered User regular
    Yeah, if you don't foresee needing to be re-employed with them, I'd at least say that you felt that you weren't being listened to.

  • Grape ApeGrape Ape Registered User regular
    Never realize how close the 'e' and 'r' keys are until I mistype 'crontab -e'...

  • MvrckMvrck Dwarven MountainhomeRegistered User regular
    edited June 2016
    So does anyone have experience implementing complex search functions?

    Working on a project for matching researchers and research projects, and I already know what they want is going to hammer this DB. The project calls for the users to be able to search for projects using different attributes. Each project has one or more location, department, focus, need, and category, stored in relational tables. They need to be able to search for any, or for all the submitted values. For matters of not having the server die from all the joins, should I just be breaking this up into multiple queries and then build an array of matching projects, and then get the project details?

    Edit: This is in MySQL, and I don't have access to InnoDB for foreign keys.

    Mvrck on
  • InfidelInfidel Heretic Registered User regular
    Echo wrote: »
    Okay, another one of those javascript things I'm not quite at an understanding with yet.
    var testTargetClass = 'test-target-itemname-' + item.Name.replace(/ /g, '');
    
    var linkClass = classNames({
      'item-link-text': true,
      'item-sortable-item': true,
      'item-selected-link': isItemSelected,
      'item-not-selected-link': !isItemSelected,
      testTargetClass: true
    });
    

    This gives me a CSS class called "testTargetClass", but I want to evaluate its name to the value of testTargetClass. How do? Can I even do that inside an object?

    edit: aha, classNames lets me tack it on as a truthy argument.
    var linkClass = classNames({
      'item-link-text': true,
      'item-sortable-item': true,
      'item-selected-link': isItemSelected,
      'item-not-selected-link': !isItemSelected,
    }, testTargetClass);
    

    Oh man, good thing you finally found classnames! :razz:

    You have the correct method at the end there, but to answer the "how do I set prop names via variable" you do this:
    var somePropName = 'myCustomProp'
    var object = {
      propName: 'value',
      'special-chars': true,
      [somePropName]: 'custom value'
    }
    

    OrokosPA.png
  • EchoEcho ski-bap ba-dapModerator, Administrator admin
    Infidel wrote: »
    Oh man, good thing you finally found classnames! :razz:

    And there was much high-fiving at the office after I posted it in the Slack channel.

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Quick! Do these print different things?
    function foo() { return typeof null === "undefined"; }
    for(var i=0; i<10000; ++i) console.log(foo())
    
    for(var i=0; i<10000; ++i) console.log(typeof null === "undefined")
    

  • bowenbowen Sup? Registered User regular
    edited June 2016
    that's a weird bug

    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
  • NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    Better yet, do that for loop with let instead of var. Itll return true half the time and false the other half.

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • InfidelInfidel Heretic Registered User regular
    bowen wrote: »
    that's a weird bug

    Optimization bugs are wonderful beasts!

    OrokosPA.png
This discussion has been closed.