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

[Programming] Thread: Fixed last bug in 5 month thread

1798082848599

Posts

  • Options
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    what's the industry standard say about organizing C++ source files liberally into folders?

    I'm getting to the point in my project where I have almost 100 different classes and I'd like to start organizing them

    In Xcode it just makes fake folders so you dont have to start changing include paths.. wondering if this is commonly done in C++

  • Options
    htmhtm Registered User regular
    edited July 2015
    Jasconius wrote: »
    what's the industry standard say about organizing C++ source files liberally into folders?

    I'm getting to the point in my project where I have almost 100 different classes and I'd like to start organizing them

    In Xcode it just makes fake folders so you dont have to start changing include paths.. wondering if this is commonly done in C++

    I just dump all mine into a "Source" folder that lives as a peer to my Xcode project. If you're going to be using any of the current generation of hipster editors (SublimeText, VS Code, Atom, etc.), you might want put some subfolders in your Source folder. Those sorts of editors tend to have a built-in file browser rather than a containing project file, so the only organization they'll show is from the file system.

    htm on
  • Options
    gavindelgavindel The reason all your software is brokenRegistered User regular
    Rend wrote: »
    hippofant wrote: »
    So... I managed to get my work to fund my trip to DEFCON. Parties and hacking and crazy shit under the guise of "cyber security conference".

    ...I guess I should prepare a secure laptop.

    Maybe you should just bring a one-time pad.

    How about this touch compatible notebook with write-once note taking software?

    Stylus not included, not encrypted against physical access, impossible to hack via network.

    There is a well proven optical wavelength attack that allows an attacker to piggy back on legitimate access.

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • Options
    gavindelgavindel The reason all your software is brokenRegistered User regular
    One of my friends showed me this new Steam game:

    http://store.steampowered.com/app/370360/

    Me: "So its assembly?"
    Him: "Except you have some registers blocked and you have to solve the puzzles using limited instructions and limited lines."
    Me: "So its shitty assembly?"

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    Jasconius wrote: »
    what's the industry standard say about organizing C++ source files liberally into folders?

    I'm getting to the point in my project where I have almost 100 different classes and I'd like to start organizing them

    In Xcode it just makes fake folders so you dont have to start changing include paths.. wondering if this is commonly done in C++

    I tend to prefer organising then into folders combined with CMake organising the include paths so that the directory structure is sort of like a namespace to the file itself.

    So:
    #include "support/buffers/memory.h"
    #include "thirdparty/xyz/abc.h"
    #include "drivers/serial/usb.h"
    

    This is because I tend to try to share the exact same code between multiple projects, and I find that it's much easier to do so when each set of projects is in its own directory.

    If you're doing a small project, then this is probably overkill and not necessary, but if you start doing a large project, I highly recommend doing something similar, if only just to avoid filename collisions - especially if you're using third party libraries, sometimes they'll name a file something innocuous (but reasonable!) like "buffers.h". You'll need some way of separating that out.
    gavindel wrote: »
    One of my friends showed me this new Steam game:

    http://store.steampowered.com/app/370360/

    Me: "So its assembly?"
    Him: "Except you have some registers blocked and you have to solve the puzzles using limited instructions and limited lines."
    Me: "So its shitty assembly?"

    Hahahaha, yes, sorta. It's from the same creators as Spacechem and Infinifactory.

    Penny Arcade Developers at PADev.net.
  • Options
    TofystedethTofystedeth Registered User regular
    Jasconius wrote: »
    what's the industry standard say about organizing C++ source files liberally into folders?

    I'm getting to the point in my project where I have almost 100 different classes and I'd like to start organizing them

    In Xcode it just makes fake folders so you dont have to start changing include paths.. wondering if this is commonly done in C++

    I tend to prefer organising then into folders combined with CMake organising the include paths so that the directory structure is sort of like a namespace to the file itself.

    So:
    #include "support/buffers/memory.h"
    #include "thirdparty/xyz/abc.h"
    #include "drivers/serial/usb.h"
    

    This is because I tend to try to share the exact same code between multiple projects, and I find that it's much easier to do so when each set of projects is in its own directory.

    If you're doing a small project, then this is probably overkill and not necessary, but if you start doing a large project, I highly recommend doing something similar, if only just to avoid filename collisions - especially if you're using third party libraries, sometimes they'll name a file something innocuous (but reasonable!) like "buffers.h". You'll need some way of separating that out.
    gavindel wrote: »
    One of my friends showed me this new Steam game:

    http://store.steampowered.com/app/370360/

    Me: "So its assembly?"
    Him: "Except you have some registers blocked and you have to solve the puzzles using limited instructions and limited lines."
    Me: "So its shitty assembly?"

    Hahahaha, yes, sorta. It's from the same creators as Spacechem and Infinifactory.

    Also The Codex of Alchemical Engineering (Flash game you can find on Kongregate, precursor to SpaceChem) and KOHCTPYKTOP: Engineer of the People (also available on Kong, integrated circuit design.)
    Dude just makes super nerdy games.

    steam_sig.png
  • Options
    templewulftemplewulf The Team Chump USARegistered User regular
    Is there a good primer for modern deployment techniques? Specifically, I'm rocking Rails on Vagrant, I don't mind catching up on docker, and I want to deploy to a droplet on digital ocean.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • Options
    templewulftemplewulf The Team Chump USARegistered User regular
    templewulf wrote: »
    Is there a good primer for modern deployment techniques? Specifically, I'm rocking Rails on Vagrant, I don't mind catching up on docker, and I want to deploy to a droplet on digital ocean.

    I should specify that I'm currently using https://github.com/capistrano-plugins/capistrano-unicorn-nginx, but I can't deny how complicated it is to understand the constellation of apps and config files for new developers. Plus, something about storing environment information inside the project always rubs me the wrong way.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    Oh god no

    Priority inversion

    Why are these interrupts executing so much code?

    And relying on interactions from other lower priority interrupts?!

    The same interrupts that have been blocked from executing, because a higher priority interrupt is in progress?!!?

    *sob*

    It's like

    I dunno

    I just don't know any more

    This is I just wha urgghzhabhurbglablghlaaaa

    Penny Arcade Developers at PADev.net.
  • Options
    zeenyzeeny Registered User regular
    templewulf wrote: »
    templewulf wrote: »
    Is there a good primer for modern deployment techniques? Specifically, I'm rocking Rails on Vagrant, I don't mind catching up on docker, and I want to deploy to a droplet on digital ocean.

    I should specify that I'm currently using https://github.com/capistrano-plugins/capistrano-unicorn-nginx, but I can't deny how complicated it is to understand the constellation of apps and config files for new developers. Plus, something about storing environment information inside the project always rubs me the wrong way.

    I'd gladly help you with that, but what are you currently doing exactly CI(Jenkins?), CD, heroku-like workflow, something else...? You mentioned deployment and then you mention developers, so I'm a bit unsure if you want the Repo to Production part or actual devops with environment?
    A setup built around docker can go from a simple haproxy in front of containers to a lot of extra tools regarding monitoring, service discovery, etc.

  • Options
    CampyCampy Registered User regular
    edited July 2015
    So... I managed to get my work to fund my trip to DEFCON. Parties and hacking and crazy shit under the guise of "cyber security conference".

    ...I guess I should prepare a secure laptop.

    And phone.

    Edit: If you meet a brit called Ben (Harrison)-Smith there. Tell him Campy says hi!

    Campy on
  • Options
    bowenbowen How you doin'? Registered User regular
    Oh god no

    Priority inversion

    Why are these interrupts executing so much code?

    And relying on interactions from other lower priority interrupts?!

    The same interrupts that have been blocked from executing, because a higher priority interrupt is in progress?!!?

    *sob*

    It's like

    I dunno

    I just don't know any more

    This is I just wha urgghzhabhurbglablghlaaaa

    Man.

    How did their product actually work?

    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
    EvigilantEvigilant VARegistered User regular
    bowen wrote: »
    Oh god no

    Priority inversion

    Why are these interrupts executing so much code?

    And relying on interactions from other lower priority interrupts?!

    The same interrupts that have been blocked from executing, because a higher priority interrupt is in progress?!!?

    *sob*

    It's like

    I dunno

    I just don't know any more

    This is I just wha urgghzhabhurbglablghlaaaa

    Man.

    How did their product actually work?

    That's not a bug, that's a feature.

    XBL\PSN\Steam\Origin: Evigilant
  • Options
    InfidelInfidel Heretic Registered User regular
    PAdev stuff:

    Thanks everyone that is still supporting PAdev! January and July are difficult months because many renewals are up then and it wasn't looking certain that we'd have enough still around to keep the lights on, but I think we're still okay.

    Anyone that is looking for a hobby / proof-of-concept dedicated host, PAdev is a shared Linode VPS that we all chip in for and that I administer on behalf of everyone. $5 / mo gets you an account and to-date we have been able to setup and accommodate every tech stack requested!

    OrokosPA.png
  • Options
    gavindelgavindel The reason all your software is brokenRegistered User regular
    Sitting through new employee orientation a week late. I like the part where I get actual employee benefits. Tech is so cushy it's ridiculous compared to my old jobs.

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • Options
    bowenbowen How you doin'? Registered User regular
    I still kinda feel bad that I had to depart from pa-dev!

    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
    You didn't have to!

    You could totally spare the $5. :hydra:

    Also, noticed a couple expirations are still pending, so maybe not quite there yet.

    OrokosPA.png
  • Options
    DelmainDelmain Registered User regular
    Do you want me to like, offset my renewal date or something? So it's not Jan/July and is like, Apr/Oct instead?

  • Options
    InfidelInfidel Heretic Registered User regular
    Delmain wrote: »
    Do you want me to like, offset my renewal date or something? So it's not Jan/July and is like, Apr/Oct instead?

    Naw, you're not one I sweat about. ;)

    OrokosPA.png
  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    God it feels like the tablet has like a 3 second delay when we tap anything, but everything I do makes no difference at all. I have done:
    React.initializeTouchEvents(true);
    
    var injectTapEventPlugin = require("react-tap-event-plugin");
    injectTapEventPlugin();
    

    I made all of my buttons have onTouchTap instead of onClick... All of them still have the delay. What am I missing here?

  • Options
    bowenbowen How you doin'? Registered User regular
    Well.

    It's a web interface right? If the server that's serving it is bogged down or a piece of shit, you can definitely have a 3+ second delay.

    Plus javascript is fucking terrible, so itself could be a 1+ second delay.

    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
    bowen wrote: »
    Well.

    It's a web interface right? If the server that's serving it is bogged down or a piece of shit, you can definitely have a 3+ second delay.

    Plus javascript is fucking terrible, so itself could be a 1+ second delay.

    Clicking has no delay and moving around the page has no delay. It's just clicking buttons.

  • Options
    InfidelInfidel Heretic Registered User regular
    edited July 2015
    Infidel on
    OrokosPA.png
  • Options
    DisruptedCapitalistDisruptedCapitalist I swear! Registered User regular
    edited July 2015
    Yeah, I had that situation where a server had to query an off-site SQL server before it could give its response so every click was getting delayed anywhere from 2 to 7 seconds. It was horrible. Ended up just caching all possible results at pageload to avoid the lag.

    DisruptedCapitalist on
    "Simple, real stupidity beats artificial intelligence every time." -Mustrum Ridcully in Terry Pratchett's Hogfather p. 142 (HarperPrism 1996)
  • Options
    bowenbowen How you doin'? Registered User regular
    urahonky wrote: »
    bowen wrote: »
    Well.

    It's a web interface right? If the server that's serving it is bogged down or a piece of shit, you can definitely have a 3+ second delay.

    Plus javascript is fucking terrible, so itself could be a 1+ second delay.

    Clicking has no delay and moving around the page has no delay. It's just clicking buttons.

    What does the button click do?

    As infidel's link said, this is a problem known to Javascript/"responsive apps".

    None of that other stuff would cause a delay, because you're not necessarily firing an event. If your event actually does something other than modify the internals of the page, there's going to be a noticeable delay because javascript.

    TBH, if you need speed, you should be using an actual compiled/local app anyways. Just make calls to a RESTful service and call it a day and save your sanity instead of trying to patch bugs with how websites work on mobile devices.

    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
    templewulftemplewulf The Team Chump USARegistered User regular
    zeeny wrote: »
    templewulf wrote: »
    templewulf wrote: »
    Is there a good primer for modern deployment techniques? Specifically, I'm rocking Rails on Vagrant, I don't mind catching up on docker, and I want to deploy to a droplet on digital ocean.

    I should specify that I'm currently using https://github.com/capistrano-plugins/capistrano-unicorn-nginx, but I can't deny how complicated it is to understand the constellation of apps and config files for new developers. Plus, something about storing environment information inside the project always rubs me the wrong way.

    I'd gladly help you with that, but what are you currently doing exactly CI(Jenkins?), CD, heroku-like workflow, something else...? You mentioned deployment and then you mention developers, so I'm a bit unsure if you want the Repo to Production part or actual devops with environment?
    A setup built around docker can go from a simple haproxy in front of containers to a lot of extra tools regarding monitoring, service discovery, etc.

    I'm open to more or less anything, since I'm in the process of establishing workflows and best practices.

    I'll clarify what we're doing now. We're a tiny team, so I'm lead developer / sysadmin / impostor devops guy. Currently we just (git) merge to master, and someone (usually falling to me, but not always) does a `cap production deploy`. That goes up to our digital ocean droplet. There are also a couple of proof of concept projects that go up to heroku, but that's not all that important.

    The main thing is that I enjoy the reproducibility I get from vagrant boxes and how that onboards developers super fast. I would love to be able to have a clean, isolated environment in staging and production in the same way. My first guess is that I should tinker with containerization (read: docker), but I'm only really familiar with it in theory.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • Options
    zeenyzeeny Registered User regular
    edited July 2015
    templewulf wrote: »
    zeeny wrote: »
    templewulf wrote: »
    templewulf wrote: »
    Is there a good primer for modern deployment techniques? Specifically, I'm rocking Rails on Vagrant, I don't mind catching up on docker, and I want to deploy to a droplet on digital ocean.

    I should specify that I'm currently using https://github.com/capistrano-plugins/capistrano-unicorn-nginx, but I can't deny how complicated it is to understand the constellation of apps and config files for new developers. Plus, something about storing environment information inside the project always rubs me the wrong way.

    I'd gladly help you with that, but what are you currently doing exactly CI(Jenkins?), CD, heroku-like workflow, something else...? You mentioned deployment and then you mention developers, so I'm a bit unsure if you want the Repo to Production part or actual devops with environment?
    A setup built around docker can go from a simple haproxy in front of containers to a lot of extra tools regarding monitoring, service discovery, etc.

    I'm open to more or less anything, since I'm in the process of establishing workflows and best practices.

    I'll clarify what we're doing now. We're a tiny team, so I'm lead developer / sysadmin / impostor devops guy. Currently we just (git) merge to master, and someone (usually falling to me, but not always) does a `cap production deploy`. That goes up to our digital ocean droplet. There are also a couple of proof of concept projects that go up to heroku, but that's not all that important.

    The main thing is that I enjoy the reproducibility I get from vagrant boxes and how that onboards developers super fast. I would love to be able to have a clean, isolated environment in staging and production in the same way. My first guess is that I should tinker with containerization (read: docker), but I'm only really familiar with it in theory.

    Well, docker is still "new" in as much as people are still at a point where they are sharing workflows and saying "hey, that works fine for us" or "fuck, this really didn't do it.". I can describe our current environment in great detail, but I think that at this point it will be a bit too much like an info dump. I suggest you take a look at setting up a development environment with docker-compose(there are a lot of dockerized ruby images out there and at docker meetups usually Ruby is very well represented, so google should be a help). From a devenv to production, there aren't too many steps. If you are going to use a single node, it may be as simple as setting up Haproxy in front of the docker containers and then building directly on host via Jenkins->SSH(how do you test right now?).
    If you need more scalability or a cluster, then it becomes a fair bit more complicated, you'll need a private registry, service discovery etc.

    tl;dr: Read a bit on what docker/docker image is, then play around with docker compose and feel free to shoot questions in here.

    Personally I find docker quiet nice as a building block for applications.

    zeeny on
  • Options
    templewulftemplewulf The Team Chump USARegistered User regular
    zeeny wrote: »
    templewulf wrote: »
    zeeny wrote: »
    templewulf wrote: »
    templewulf wrote: »
    Is there a good primer for modern deployment techniques? Specifically, I'm rocking Rails on Vagrant, I don't mind catching up on docker, and I want to deploy to a droplet on digital ocean.

    I should specify that I'm currently using https://github.com/capistrano-plugins/capistrano-unicorn-nginx, but I can't deny how complicated it is to understand the constellation of apps and config files for new developers. Plus, something about storing environment information inside the project always rubs me the wrong way.

    I'd gladly help you with that, but what are you currently doing exactly CI(Jenkins?), CD, heroku-like workflow, something else...? You mentioned deployment and then you mention developers, so I'm a bit unsure if you want the Repo to Production part or actual devops with environment?
    A setup built around docker can go from a simple haproxy in front of containers to a lot of extra tools regarding monitoring, service discovery, etc.

    I'm open to more or less anything, since I'm in the process of establishing workflows and best practices.

    I'll clarify what we're doing now. We're a tiny team, so I'm lead developer / sysadmin / impostor devops guy. Currently we just (git) merge to master, and someone (usually falling to me, but not always) does a `cap production deploy`. That goes up to our digital ocean droplet. There are also a couple of proof of concept projects that go up to heroku, but that's not all that important.

    The main thing is that I enjoy the reproducibility I get from vagrant boxes and how that onboards developers super fast. I would love to be able to have a clean, isolated environment in staging and production in the same way. My first guess is that I should tinker with containerization (read: docker), but I'm only really familiar with it in theory.

    Well, docker is still "new" in as much as people are still at a point where they are sharing workflows and saying "hey, that works fine for us" or "fuck, this really didn't do it.". I can describe our current environment in great detail, but I think that at this point it will be a bit too much like an info dump. I suggest you take a look at setting up a development environment with docker-compose(there are a lot of dockerized ruby images out there and at docker meetups usually Ruby is very well represented, so google should be a help). From a devenv to production, there aren't too many steps. If you are going to use a single node, it may be as simple as setting up Haproxy in front of the docker containers and then building directly on host via Jenkins->SSH(how do you test right now?).
    If you need more scalability or a cluster, then it becomes a fair bit more complicated, you'll need a private registry, service discovery etc.

    tl;dr: Read a bit on what docker/docker image is, then play around with docker compose and feel free to shoot questions in here.

    Personally I find docker quiet nice as a building block for applications.

    For the foreseeable future, we'll be running a single server and scaling up the droplet as our needs increase. So it's definitely going to be a case of multiple apps on a single VPS. As for testing, we really are a micro shop, and I haven't given CI much thought compared to actually getting development going. Right now, I can just trust each developer individually to run specs before merging.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • Options
    AntinumericAntinumeric Registered User regular
    edited July 2015
    So my raytracer project is back up and running. Rather than everything being one big c file I've split it up into a BMP writer and a raytracer that you request the next ray from. Also its in C++ but I'm only using C. Next I plan to add reflections.
    fosIJB3.png
    3UsDOlj.png

    I'm thinking after that I should get it running in a Windows window, then investigate using CUDA to make it faster.

    Antinumeric on
    In this moment, I am euphoric. Not because of any phony god’s blessing. But because, I am enlightened by my intelligence.
  • Options
    gavindelgavindel The reason all your software is brokenRegistered User regular
    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • Options
    NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    urahonky wrote: »
    God it feels like the tablet has like a 3 second delay when we tap anything, but everything I do makes no difference at all. I have done:
    React.initializeTouchEvents(true);
    
    var injectTapEventPlugin = require("react-tap-event-plugin");
    injectTapEventPlugin();
    

    I made all of my buttons have onTouchTap instead of onClick... All of them still have the delay. What am I missing here?

    are you using the PureRender Mixin for react?

    could be that whatever state you are changing with button click is actually changing state throughout the app without you knowing it, even if the props are identical. with PureRenderMixin, it makes sure ShouldComponentUpdate only fires when necessary.

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • Options
    bowenbowen How you doin'? Registered User regular
    So my raytracer project is back up and running. Rather than everything being one big c file I've split it up into a BMP writer and a raytracer that you request the next ray from. Also its in C++ but I'm only using C. Next I plan to add reflections.
    fosIJB3.png
    3UsDOlj.png

    I'm thinking after that I should get it running in a Windows window, then investigate using CUDA to make it faster.

    I remember one of my friends who was going to Polytechnique in Montreal hijacked a whole bunch of lab computers and popped SSH on it, then he dispatched batches of stuff for them to render for ray tracing. I think he could ray trace a scene in 2-3 minutes.

    It was pretty amazing.

    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
    ... API was given to me.

    All in PDFs.

    Fucking fuck.

    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
    LD50LD50 Registered User regular
    Let's hope it's all non OCR scans of printouts of the documentation.

  • Options
    electricitylikesmeelectricitylikesme Registered User regular
    bowen wrote: »
    ... API was given to me.

    All in PDFs.

    Fucking fuck.

    No jury will convict.

  • Options
    TofystedethTofystedeth Registered User regular
    LD50 wrote: »
    Let's hope it's all non OCR scans cell-phone photos of printouts of the documentation.

    steam_sig.png
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    LD50 wrote: »
    Let's hope it's all non OCR scans cell-phone photos of printouts of the documentation in random orientations.

  • Options
    bowenbowen How you doin'? Registered User regular
    I hate you all btw

    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
    RendRend Registered User regular
    Phyphor wrote: »
    LD50 wrote: »
    Let's hope it's all non OCR scans cell-phone photos of printouts of the documentation in random orientations inexplicably stretched to fit into arbitrary dimensions.

  • Options
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    typescript is the best thing that has ever happened to me

This discussion has been closed.