Be a Supporter!

Programming Regs Lounge

  • 494,860 Views
  • 16,819 Replies
New Topic Respond to this Topic
Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to Programming Regs Lounge 2014-02-04 20:17:41 Reply

At 2/4/14 01:53 PM, Dean wrote: Hey guys. Been a while since I last posted in here.

Nice to see another regular 'round these parts. :)

At 2/4/14 01:53 PM, Dean wrote: Since I last posted I was offered 3 different jobs: Analyst Programmer, Applications Support Analyst and IT Support Assistant. I went with the IT support role, for a few reasons. Mostly because I've always been unsure if programming 40 hours a week is something I could cope with and I'm still convinced that I wouldn't enjoy it.

Programming full-time can be pretty rough, that's for damn sure. I've pretty much always hated PHP, but at my last job I had to write it full-time and that made me absolutely loathe PHP, and dislike web development in general. All of my hobby projects now have little to nothing to do with web development as a result.

At 2/4/14 01:53 PM, Dean wrote: Web development is something I want to get back into too. A while back I was working on a website that me and a few other people thought would be useful but I ended up feeling like I bit off more than I could chew and struggled to remain motivated. I still don't have any ideas what I want to work on in relation to web development but hopefully I'll come up with some ideas.

Not to discourage you from doing web dev stuff, though. :)

Anyway, on to what I've been up to. A few posts up I described a server I am working on, and as of a few minutes ago I got the implementation of the WebSocket handshake protocol working.

Given that this is C++ it was rather tricky, and required a fair amount of reading and tinkering (as usual). Since C++, or the STL, has no way of splitting a string by delimiter I had to write a function to do that for me, as well as another function to use that to split the arguments of an HTTP request into a map. The source for those two functions is here. I still need to do some more thorough testing with them, and see if I can optimise them, but so far they work just fine.

The real trouble came with hashing the WebSocket key with SHA1, and base64 encoding the result of that. I ultimately had to use code written by other people, which I found on StackOverflow, to get that to work. The Boost libraries for SHA1 and base64 are very complex, so I need to do even more reading before I can hope to write my own functions for that (or optimise the ones that I found). The source for the two functions is here, which can be used to encode the WebSocket key with this tiny function. I ended up sticking all that into a utility header (i.e. just a header that will contain utility functions) of which the source code is here.

All that allows me to very easily parse an HTTP request into a class (source here) and encode the WebSocket key. Using my server code that I posted above, with some slight tweaks to make it work with HTTP, this is all the code required to allow a WebSocket connection.

Like before this is still just a proof of concept, which is why I'm building the response in such a cumbersome manner (among other things).

I also figure that there's no harm in explaining why I'm making all of this. I'm going to be using this server, and the JavaScript client outlined in this post, to create a web-based online hacking simulation game. It's a game inspired by Slavehack, Uplink and Hacker Evolution. I'm making the game web-based simply for the accessibility that it offers. Pretty much everything is going to be powered by WebSockets to allow for push-style updates and notifications, something that Slavehack is lacking. It will be much closer to Uplink and Hacker Evolution in style, but unlike those games it will be entirely multiplayer. I have no idea what I'm going to call it, but it has the working title "Trojan Bit".

Now that my server is progressing nicely it won't be long until I'll have something that is actually usable in web browsers. I still need to implement my protocol for sending/receiving messages over WebSocket, but that won't be very difficult considering I already have an implementation written in Python, so it's just a matter of translating the language.

Once I get my VPS setup, and all the required development tools installed on it, I'll have something up and running that people can actually use/test. For now everything is just running on my home computer, so I can't really leave a server running.

thetechnation
thetechnation
  • Member since: Apr. 24, 2013
  • Offline.
Forum Stats
Member
Level 03
Programmer
Response to Programming Regs Lounge 2014-02-08 21:22:49 Reply

At 2/3/14 04:42 PM, Diki wrote: I see your LOLCODE hello world and raise you Brainfuck's:



I know how it works (for the most part) and I still can't wrap my head around that syntax.

Bad Code bad lol

coln
coln
  • Member since: Aug. 1, 2011
  • Offline.
Forum Stats
Member
Level 01
Musician
Response to Programming Regs Lounge 2014-02-17 21:32:49 Reply

Just learned that pixel is short for "picture element!" How did I never know this? Learn something every day


BBS Signature
Antilogical
Antilogical
  • Member since: Aug. 28, 2013
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to Programming Regs Lounge 2014-02-18 10:02:55 Reply

Slightly relevant: there's something that amuses me about the word 'texel'. Not sure what.

coln
coln
  • Member since: Aug. 1, 2011
  • Offline.
Forum Stats
Member
Level 01
Musician
Response to Programming Regs Lounge 2014-03-07 00:23:25 Reply

Hard drive failure...never a fun thing. But always a good excuse to get more storage!


BBS Signature
NinoGrounds
NinoGrounds
  • Member since: Nov. 28, 2005
  • Offline.
Forum Stats
Member
Level 20
Programmer
Response to Programming Regs Lounge 2014-03-16 04:08:35 Reply

Hello guys. I just wanted to drop by and say hi basically :P
I've been playing a game SWTOR on a professional level in the last 2 years (well, not on pro level for 2 years, but I've been obsessed with it for 2 years), thats why I am not active here anymore.
aI've been doing some sites, for some money here and there, nothing big tho. I am working on a small project now for me at the moment, if I manage to finish it, I'll post the link here.

That's all folks

kiwi-kiwi
kiwi-kiwi
  • Member since: Mar. 6, 2009
  • Offline.
Forum Stats
Member
Level 09
Programmer
Response to Programming Regs Lounge 2014-05-18 11:25:13 Reply

It's been a while since I've posted here, a lot of things have happened since last time, but right now I have found some time to work on some older projects of mine. Currently I'm making an option and GUI system for a game called snake fight, it's a remake of the first game I submitted to newgrounds that I've done in C++ using Qt.
Right now I have managed to get it working on all major pc platforms and Android, I'm pretty sure it works on iOS as well, but I haven't tried yet. The game adapts to the resolution of the platform it runs on, so hopefully I can support as many devices as possible.

Here's a demo video of the game in action: https://www.youtube.com/watch?v=Hh2Yl6hliqY , will post more as I progress.
Let me know if you want a build, I'd be happy to send one to anyone.

Shakyjake
Shakyjake
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 22
Programmer
Response to Programming Regs Lounge 2014-05-20 09:49:41 Reply

At 2/8/14 04:39 PM, Captain-Slugworth wrote: bloody hell, that's a tricky one.

I've got to check it out sometime :3

At 2/3/14 04:42 PM, Diki wrote: I see your LOLCODE hello world and raise you Brainfuck's:

To continue the metaphor, I'm going all-in.

Welcome to HodorScript

Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to Programming Regs Lounge 2014-07-13 10:59:39 Reply

I made a thing!

I've been working on a CLI program that binds input from XInput-enabled devices (such as Xbox 360 controllers) to keyboard and mouse macros. Basically it's an alternative to Xpadder, which I find to be unintuitive, barely customisable, and overpriced. I am, of course, using my EasyXInput framework to handle the XInput side of things. I might add support for non-XInput-enabled devices at some point.

I'll probably add a GUI to it eventually but that's not a priority right now (plus I hate coding GUIs). The program is current in a proof-of-concept phase, so it's not actually what this post is about. I've just finished a large chunk of the API that will be used for the CLI portion of the program (i.e. the API that converts text commands to functions). After playing around with different designs, this is what I've decided on:

#include "cli.hpp"

bool alive = true;

void cmd_echo(cli::util::String name, cli::util::StringVectorP data) {
    std::cout << cli::util::Join(data) << std::endl;
}

void cmd_quit(cli::util::String name, cli::util::StringVectorP data) {
    alive = false;
}

int main(int argc, char** argv) {
    cli::cmd::Add("echo", cmd_echo);
    cli::cmd::Add("quit", cmd_quit);

    while (alive) {
        if (cli::cmd::Call(cli::util::GetInput()) == cli::cmd::error) {
            std::cout << "Unknown command: " << cli::cmd::GetPreviousInputArgsP()->at(0) << std::endl;
        }
    }
}

All that does is allow you to type out "echo hello world", which will output the text after the echo command, and shutdown the program with the quit command. The cli::util::StringVectorP parameter is just a pointer to a vector of strings, which represent the arguments given to the command (delimited by a space, by default), which is why the echo command has to join them back into a string.

A more comprehensive example can be found here, which has more commands, such as the ability to define variables which can have their values output using echo.

I'm striving for something that is intuitive and very easy to use, and I think I've done that.

The API is still in its infancy and is missing a lot of features (all features I've shown here are finished), so I won't be posting the source code just yet, but when it's finished (or near finished) I'll be throwing it onto GitHub.

That's all for now. When I finish the program that I'm making this API for, which has the working title XtoKey, I'll also be throwing it onto GitHub and releasing it for free.

coln
coln
  • Member since: Aug. 1, 2011
  • Offline.
Forum Stats
Member
Level 01
Musician
Response to Programming Regs Lounge 2014-07-13 18:56:10 Reply

At 7/13/14 10:59 AM, Diki wrote: I made a thing!

Genuinely curious: why? What is the use of turning XInput into keyboard/mouse macros and essentially controlling a computer, I assume?


BBS Signature
Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to Programming Regs Lounge 2014-07-14 03:56:46 Reply

At 7/13/14 06:56 PM, coln wrote:
At 7/13/14 10:59 AM, Diki wrote: I made a thing!
Genuinely curious: why? What is the use of turning XInput into keyboard/mouse macros and essentially controlling a computer, I assume?

Lots of games that are controlled primarily with a keyboard don't have gamepad support or simply never can have gamepad support (such as Flash and HTML5 games). Having the gamepad simulate mouse and keyboard input allows you to use it for pretty much anything.

Simulating mouse movement isn't super accurate, so it's not that great for games that require a mouse (e.g. shooters), but I sometimes like using the gamepad in place of my mouse while just browsing around as I can use it pretty much from anywhere in my room (i.e. not be forced to be sitting directly in front of my computer).

kiwi-kiwi
kiwi-kiwi
  • Member since: Mar. 6, 2009
  • Offline.
Forum Stats
Member
Level 09
Programmer
Response to Programming Regs Lounge 2014-07-14 14:17:12 Reply

It's been a while, and development has been slow but steady. Now the game has evolved into something more complex. I managed to implement all the customizations and the android version has several new control schemes, you can now use buttons and the accelerometer. Now all that remains for a beta is a proper tutorial.

Here's a few screenshots that showcase the menu, customizations and gameplay: firstsecondthird.

gonzored1
gonzored1
  • Member since: Sep. 27, 2011
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Programming Regs Lounge 2014-07-14 22:32:46 Reply

Is anyone here a programmer interested in helping make a game?

Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to Programming Regs Lounge 2014-07-14 23:51:01 Reply

At 7/14/14 10:32 PM, gonzored1 wrote: Is anyone here a programmer interested in helping make a game?

You'll be more likely to find help if you give more information in the thread you posted.

Generally speaking, most people won't work for free, so if you're offering compensation you should mention that. It would also be a good idea to give some information regarding what style of game it is (single-player, multi-player, 2D, 3D, shooter, RPG, et cetera) so people will know how much work will be involved. One of the most important things is to explain what your role in project will be so people can know that they won't be doing everything on their own.

I personally cannot help you (I'm not a game developer) but doing what I described will certainly make it more likely that you will find someone, but there is no guarantee.

coln
coln
  • Member since: Aug. 1, 2011
  • Offline.
Forum Stats
Member
Level 01
Musician
Response to Programming Regs Lounge 2014-09-06 11:33:42 Reply

Ahhhh! I've been writing in Python so long that when I go back to C (or any other language), I forget to type semi-colons! Oh the pains....


BBS Signature
WoogieNoogie
WoogieNoogie
  • Member since: Jun. 26, 2005
  • Offline.
Forum Stats
Member
Level 15
Programmer
Response to Programming Regs Lounge 2014-09-06 11:52:07 Reply

I enjoy semicolons and braces. One of the projects I work on is in Coffeescript, and it annoys the hell out of me.

coln
coln
  • Member since: Aug. 1, 2011
  • Offline.
Forum Stats
Member
Level 01
Musician
Response to Programming Regs Lounge 2014-09-06 21:45:05 Reply

At 9/6/14 11:52 AM, WoogieNoogie wrote: I enjoy semicolons and braces. One of the projects I work on is in Coffeescript, and it annoys the hell out of me.

Don't get me wrong, I like them too. I have just created a habit of not using them since I've been on a Python kick recently. I haven't played with Coffeescript yet though. What is the purpose of it (genuinely asking)?


BBS Signature
WoogieNoogie
WoogieNoogie
  • Member since: Jun. 26, 2005
  • Offline.
Forum Stats
Member
Level 15
Programmer
Response to Programming Regs Lounge 2014-09-06 22:22:03 Reply

At 9/6/14 09:45 PM, coln wrote: What is the purpose of it (genuinely asking)?

It actually just compiles down to Javascript, so the point of it is to speed up writing code. The time it takes me to basically remember the correct syntax of...no syntax...kinda slows me down. The writing part is pretty quick, but if I have to go back through and debug code, especially someone else's, it gets a little hard.

I'm sure if I were to switch to 100% using it, it would work better, but if I were to switch how I write Javascript, I would just go to Dart.

coln
coln
  • Member since: Aug. 1, 2011
  • Offline.
Forum Stats
Member
Level 01
Musician
Response to Programming Regs Lounge 2014-09-15 18:13:25 Reply

Anyone familiar with cluster computing or slave/master computing? I have a few old computers lying around (they aren't too terribly powerful) and I wanted to get some use out of them. I've been looking around and the best solution I've come up with so far is Synergy, but that's just a KM switch, so they're still 3 separate computers working independently.

I don't necessarily need to do heaving computations on it, but I would like to combine their efforts to turn 3 crappy computers into 1 decent 3-core computer. I know from research that this is quite difficult with such a small scale and not really worth it unless I want to render video or figure out genetic folding.

Any thoughts?


BBS Signature
Hopje
Hopje
  • Member since: Dec. 17, 2007
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Programming Regs Lounge 2014-09-18 13:21:23 Reply

At 5/20/14 09:49 AM, Shakyjake wrote:
At 2/8/14 04:39 PM, Captain-Slugworth wrote:
To continue the metaphor, I'm going all-in.

Welcome to HodorScript

If you still want to be able to create something with the silliness of the above languages: ArnoldC http://lhartikk.github.io/ArnoldC/

Urp, smilies are broken for me :'(


Hops...Bops...Nops...Sops...

BBS Signature