Leave these fields empty (spam trap):
You can leave this blank to post anonymously, or you can create a Tripcode by using the format Name#Password
[i]Italic Text[/i]
[b]Bold Text[/b]
[spoiler]Spoiler Text[/spoiler]
>Highlight/Quote Text
[pre]Preformatted & Monospace Text[/pre]
[super]Superset Text[/super]
[sub]Subset Text[/sub]
1. Numbered lists become ordered lists
* Bulleted lists become unordered lists


Object serialization in C++

View Thread Reply
- Sun, 02 Oct 2016 00:42:54 EST CUa5MQaI No.36217
File: 1475383374511.png -(7997B / 7.81KB, 634x396) Thumbnail displayed, click image for full size. Object serialization in C++
So I'm writing a tile-based platformer game with SDL. I just wrote a level editor, but the only thing missing is save functionality. I'm pretty new to serialization, the only time I've done it in the past was in a roguelike game I wrote in Python ages ago that used a YAML serialization library, and I've never done it in C++. Everyone says to use Boost, but I'm running Codeblocks on Windows and trying to compile it for that has been nothing but trouble, and all the information I've found on how to do it is out of date. Is there another decent library for serialization, preferably one that has pre-compiled builds available?
2 posts omitted. Click View Thread to read.
Angus Hiblingstone - Mon, 03 Oct 2016 11:40:38 EST 9QSfnS0r No.36224 Reply
Don't use codeblocks, if you want a decent open source c++ IDE get
qt creator
You don't have to use qt with it and are perfectly fine if you're just using SDL.

But honestly if you don't own a premium IDE package doing a full project in C++ is a pain. Why not make the game loop/engine in C++ and use Ctypes and python for the high level stuff. Even more so persisting and serializing data would make much more sense to be done in python.
Nathaniel Pedgechadging - Sat, 08 Oct 2016 04:11:24 EST 4AC8OQBZ No.36236 Reply
OP you should use Visual Studio now that you can get a free version of it that doesn't have all of the features stripped out. It's what most other people use to build large projects on Windows.
Shitting Bidgeridge - Sat, 08 Oct 2016 07:42:00 EST OheqWBBY No.36237 Reply

Oh, and don't forget to setup a CI environment, because that's also a must in large projects.

Xamarin app design

View Thread Reply
- Tue, 04 Oct 2016 17:38:21 EST ZvbVja19 No.36226
File: 1475617101731.jpg -(40442B / 39.49KB, 450x287) Thumbnail displayed, click image for full size. Xamarin app design
Hello, I've got a project as a paid job. It is basic Android app. I do it in Xamarin. I have no experience with Xamarin whatsoever, but I really need money so I take any jobs. Can you, guys, please help me out with some advice before I start doing it more deeply?

What's it used for?
10+- people in clubs scanning QR codes, that are uploaded to some internet storage in real time under their ID. Purpose is to determine how many QR codes were scanned in each club during the night.

-QR code scanes
code is compared to the list of possible codes and list of existing codes. Which means, code must match the list of possible codes and cannot be scanned more than once.
-code is then sent to some internet storage under curren ID

This is it. Of course I downloaded components for scanning QR codes, some uploader etc.. But I would like to ask some questions on best design possible used for this app.

Log in - Since there is only a certain number of accounts and we don't need any high security. (I higly doubt that some club bouncer would disassemble the app to do some scam) Is it enough and even the best way to authenticate via local database of users? Even so local that the login-password combos would be stored in code?

Now user is logged in and can start scanning.
Scan is successful -
  1. It needs to look up in some file, whether the code is valid. What way should I store the file? As JSON? XML? plain text?
  2. It needs to look up in some file, whether the code hasn't been scanned yet.

Is it wise idea to make some local storage of scanned codes and whenever it is possible (being online) to send it to the internet storage?

What is the best way to again to store already scanned codes? Again JSON XML?

And finally, what is the best way to send the data to the net storage? Should I send the whole file and replace it every time new scan is scanned?

I would be able, of course, to implement these things in some way or another to provide the functioning needed. This way, however, I would learn nothing, since I doubt I would use good/recommended/standard techniquies to do such basic work.

I will appriciate all the help :) Thank you very much for even reading the post :)
Basil Honeyham - Wed, 05 Oct 2016 14:10:35 EST 9QSfnS0r No.36227 Reply
>Hello, I've got a project as a paid job. It is basic Android app. I do it in Xamarin. I have no experience with Xamarin whatsoever,


Also the whole point of qr codes is to just have a short string of numbers, you "upload" the strings using a simple http request and the string url encoded to some endpoint. You store the string using SQL(ite).
The backend then replies with a 201 (created) message if you got an empty result to a simple query and a 409 (conflict) if it's already there.

Again, I'm baffled how you managed to convince somebody to pay you with that little knowledge.
Basil Honeyham - Wed, 05 Oct 2016 14:29:46 EST 9QSfnS0r No.36228 Reply
Also storing anything local doesn't make sense, you have to connect to a sort of service either way to know if the code has been scanned.

Codes can be just a random number stored in a table, but it might turn out that doing it the right way is just as easy (or easier) using
json web tokens
for instance.

I still can't fathom how somebody would pay somebody that clueless for an app that would basically replace 4-6 people's labor, worth 5 figures in reality.
George Nickleworth - Fri, 07 Oct 2016 15:39:03 EST xLz8+Ihk No.36235 Reply
And I wonder why there is so much shit software around...

KC Game Jam #01

View Thread Reply
- Thu, 06 Oct 2016 04:14:58 EST s5NLs05u No.36230
File: 1475741698202.gif -(2085974B / 1.99MB, 320x200) Thumbnail displayed, click image for full size. KC Game Jam #01
To: Amateur Gamedevs of 420chan
For: Training purpose

  • Develop the core gameplay of a game of Snake (aka. Nibbler, Blockade, ...).
  • The code should be in only one file
  • You should do it today.
  • Post the source ITT and at least a screenshot or a webm.
  • Rate others work and get your work rated
1 posts and 1 images omitted. Click View Thread to read.
Barnaby Hummerfick - Thu, 06 Oct 2016 07:11:00 EST hemOjN9f No.36232 Reply
1475752260394.png -(618980B / 604.47KB, 757x833) Thumbnail displayed, click image for full size.
Sidney Worthingbanks - Fri, 07 Oct 2016 11:15:56 EST LQVV02XK No.36234 Reply
Level height and width
A vector for the pellet
The lenght of the snake
An array of vectors for the snake

Read user input
Check if snake eating pellet
If eaten spawn new pellet and increase size of snake
Move the snake forward
Check if collision with itself or borders to end game

Draw snake, pellets and borders
GOTO Read user input

Looking to learn more.

View Thread Reply
- Sat, 03 Sep 2016 14:28:27 EST iP/biX2m No.36100
File: 1472927307091.jpg -(100601B / 98.24KB, 763x427) Thumbnail displayed, click image for full size. Looking to learn more.
I am a beginner when it comes to programming. I am familiar with python and some front end but I wanted to learn something I considered obscure. I wanted to Learn LISP. I come here to ask for any suggestions on where or what I should start learning next?

Pic related.
15 posts and 4 images omitted. Click View Thread to read.
John Givinghall - Sat, 24 Sep 2016 21:02:14 EST 9QSfnS0r No.36199 Reply
Yeah that's cool and all, but as I see there is really only documentation for how to use javascript native libraries. Documentation on other targets seems lacking or even missing ( in case of java ).
I guess if you are doing pretty basic stuff in the backend so you can only use haxe libraries and your own code is fine.
But then I can't imagine the community for haxe is large enough to provide that.

All in all I don't see a benefit to the traditional workflow where you write the frontend and backend code yourself besides not requiring any premium ide package.
Hannah Lightham - Sun, 25 Sep 2016 15:28:44 EST RufML0b0 No.36200 Reply
>Documentation on other targets seems lacking or even missing
Anyone can write a backend for Haxe, so some aren't as well documented. I've never found the documentation or support to be lacking thou, and I just crawl through source code if something isn't documented.

>I guess if you are doing pretty basic stuff in the backend so you can only use haxe libraries and your own code is fine
Not sure why you would assume that. I don't know how many libraries you normally use in a project, but I generally write most of my server code. The built in Java libraries are generally all I need.

>I don't see a benefit to the traditional workflow
Faster development? Macros? Pattern matching? Dynamic types and high order functions? Haxe has many improvements on its targets.

>besides not requiring any premium ide package
I'd avoid any language that needs an IDE. I rolled my own Emacs mode for haxe.
Jarvis Debberridge - Sun, 25 Sep 2016 20:27:27 EST 9QSfnS0r No.36201 Reply
I try to avoid any software development library that doesn't provide a complete official documentation.
That said I see there is a MVC web framework for haxe which I would look into if it had documentation beyond the autogenerated API docs. http://ufront.net/

If you think software development is anything but 80% reading documentation and 20% writing code you are delusional imho.

GCC diagnostics are great, but they are not enough

View Thread Reply
- Thu, 01 Sep 2016 08:05:00 EST 1Cry0o0J No.36092
File: 1472731500014.png -(224154B / 218.90KB, 604x540) Thumbnail displayed, click image for full size. GCC diagnostics are great, but they are not enough
Bugs found in GCC with the help of PVS-Studio: http://www.viva64.com/en/b/0425/
2 posts omitted. Click View Thread to read.
Isabella Dundlebot - Tue, 20 Sep 2016 18:57:40 EST CUeO0MBJ No.36185 Reply
  1. This post is advertisement.
  2. -Wall isn't enough anyway. I recently found out about -Wconversion, which is not covered by -Wall. Go read: http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
  3. PVS-Studio costs money (it even has licensing plans, yo!), GCC doesn't, and I'm only a hobbyist, probably like most posters here.
Isabella Dundlebot - Tue, 20 Sep 2016 19:02:18 EST CUeO0MBJ No.36186 Reply
Maybe pitting GCC vs PVS-Studio would be a good idea, anyway:
Let GCC try to find issues in PVS-Studio; then let PVS-Studio try to find issues in GCC.
Charles Pocklock - Tue, 20 Sep 2016 19:08:06 EST 4Qqv0Ibg No.36187 Reply
You just bumped an ad to point out that it's an ad. Great job. nb


View Thread Reply
- Sat, 23 Jul 2016 08:05:47 EST rK/rO6pk No.35894
File: 1469275547373.jpg -(106208B / 103.72KB, 1200x1628) Thumbnail displayed, click image for full size. Advice
I'm getting a small review done off my site (not very big or successful). It's made of angularJS, C# Web API and MS SQL Server (not very trendy). I'm being asked what the stack is.

Is it:

A: Bad for security reasons to tell them this.
B: Bad rep to admit it (since the cool kids don't use microsoft)

Thanks for any advice, really struggling with this one.
6 posts omitted. Click View Thread to read.
Charles Sanningbanks - Wed, 31 Aug 2016 14:22:59 EST mX05OzHB No.36088 Reply
Man I dont know.
Augustus Hennerfield - Wed, 14 Sep 2016 14:35:16 EST pJbbrFEH No.36150 Reply
1473878116090.jpg -(14563B / 14.22KB, 304x425) Thumbnail displayed, click image for full size.
Reported this stupid fucking idiot for shitting up OPs thread and no actions from staff.
I'm beginning to think bru is a troll mod.
pic related, it's bru / justin
Cedric Mushwudge - Thu, 15 Sep 2016 17:41:28 EST h666BHp6 No.36156 Reply
Don't hold out on us Bru are you going to get training with that lovely lady?

government computer programs

View Thread Reply
- Thu, 25 Aug 2016 13:38:53 EST xTilwW1W No.36059
File: 1472146733963.jpg -(410120B / 400.51KB, 1422x800) Thumbnail displayed, click image for full size. government computer programs
do you think computer programs could be created to run certain areas of the government?
3 posts omitted. Click View Thread to read.
Albert Hebblestet - Sat, 27 Aug 2016 14:28:42 EST e7bTcYy7 No.36072 Reply
Absolutely. The tax code is clearly the biggest one begging to be turned into simple code. But a lot of middle man administration can replaced with code with no problem.
I'm hoping for a day when instead of voting on laws we vote on pull requests.
Ernest Pillybetch - Sat, 03 Sep 2016 15:49:28 EST jqcg4eTQ No.36104 Reply
Isn't there a movie coming out where these faggy 18 yo seniors get a mobile game that has them do life threatening shit for points?
Simon Gonkinworth - Sun, 11 Sep 2016 22:31:14 EST RcamD32+ No.36134 Reply
1473647474160.jpg -(45029B / 43.97KB, 274x406) Thumbnail displayed, click image for full size.
this might interest you

I'm bored. Should I learn SQL?

View Thread Reply
- Sat, 13 Aug 2016 14:28:00 EST Z4pGy3+m No.35991
File: 1471112880939.jpg -(50114B / 48.94KB, 348x541) Thumbnail displayed, click image for full size. I'm bored. Should I learn SQL?
Hey guys,

I've never looked much into SQL, probably because I always heard it's easy which made me think it would bore me pretty quickly.

Yet it appears to be a must-known language so now might be the time for me to finally dwell into it.

Should I go for it, should I use MySQL? If not, what would you recommend?

I'm pretty clueless about that, even after a few Google searches.

23 posts and 1 images omitted. Click View Thread to read.
Nell Guttinglirk - Thu, 25 Aug 2016 16:24:44 EST LO1w4lnU No.36060 Reply
What about higher order relationships like many-to-many-to-one?
Oliver Hippergold - Sat, 27 Aug 2016 20:22:51 EST 9QSfnS0r No.36075 Reply
They can be expressed with a many to many and a one to many I guess.
Are you actively trying to make my brain hurt?

Anyway is there such a thing like an ominous high level database language? Like LDAP but fast? hmm...
Jenny Smalllock - Sun, 28 Aug 2016 15:16:13 EST LO1w4lnU No.36080 Reply
Decomposing an n-ary relationship into binary relationships require us to introduce n-1 surrogate keys and 2n-2 foreign key constraints. That's just nuts, why would you want to do that?

I'm just checking if you get the relational model. In the RM, relationships map to columns in tables, so an n-ary relationship is represented by a table with n components.

I have no idea how LDAP works, but check out Andl for a recently developed database language.

Java Sucks

View Thread Reply
- Sun, 10 Apr 2016 20:14:48 EST W/zS63TD No.35461
File: 1460333688209.jpg -(23367B / 22.82KB, 320x299) Thumbnail displayed, click image for full size. Java Sucks
Hey, so why would you have an Interface that has an Abstract class as a subclass which then has a normal Class as a subclass of that?
The arrows look like:
Interface <-- Abstract <-- Class

Like, what exactly would the program be gaining by making it so hard to understand like this?
31 posts and 5 images omitted. Click View Thread to read.
James Snodbanks - Mon, 08 Aug 2016 10:18:11 EST vIbiteGg No.35975 Reply
I tend to use Go's embeds in other languages. Compose an instance of the derived class and inherit from it then just forward the necessary methods from the composed class. Feels more like actual building blocks than complicated type trees.
Hannah Senningdidge - Mon, 22 Aug 2016 20:51:31 EST e7bTcYy7 No.36048 Reply
At that point you just declare a bunch of type aliases for relevant functions instead of instead of classes.
type FoodUnpacker = FoodBox => FoodIngredients
type FoodCooker = FoodIngredients => CookedFood

Or in java
class FoodUnpacker extends Function<FoodBox, FoodIngredients> {}
class FoodCooker extends Function<FoodIngredients, CookedFood> {}

Fairly legible and nimble there IMO.
Hannah Senningdidge - Mon, 22 Aug 2016 23:05:46 EST e7bTcYy7 No.36052 Reply
sorry, those java classes should be interfaces and may need to forward some members or whatever.

Software Design

View Thread Reply
- Fri, 15 Jul 2016 21:14:09 EST F+scHBch No.35856
File: 1468631649935.jpg -(63471B / 61.98KB, 883x273) Thumbnail displayed, click image for full size. Software Design
You know how you download some source, and you have all these directories and header files and class files and this overwhelming complex system of files?

Well my school has taught me how to write short programs that consist of one file, but I want to start building a program and the problem is that I don't know where to begin as far as the design and architecture.

I have a vague idea of design patterns and general OO concepts, but I just don't know where to put what to start out. Is it possible that I could write out a whole function, only to have to re-write it when because I had to changed some other part of the overall design, you know?

So what do you guys recommend? How do you go about designing software?
It's a small CLI program, take inputs, work with files, do operations, print results, etc.
15 posts omitted. Click View Thread to read.
Betsy Summlemidge - Fri, 12 Aug 2016 03:14:16 EST Iq5puP1g No.35983 Reply

Let's consider a car as an analogy. A car is a quite complex machine that relies on many different components working in harmony together to function. If any one of the critical components of a car, say the breaks, or the transmission, or the differential, does out the whole car doesn't work. Each one of these components is quite complex on it's own, and probably consists of sever complex sub components. Each component is going to have it's own puzzles and quirks to figure out. You need to be able to focus on a component in isolation or else it will be nearly impossible to tell what's going wrong when you test the whole program. You need to be able to test and revise a given part of your machine/program to the point that you can more or less rely on it. Then you can fit it into the bigger machine and only consider how it fits in, not whether it's acting strangely. Now, of course, probably no code is absolutely perfect, and some of the more frustrating parts of programming is when something you assume is rock solid is fucking up in some non-obvious way, like a library you're depending on. But by unit testing we make coding manageable. Also, you're going to be working in groups. By unit testing you can present something to the wider team they feel confident they can use. Otherwise it's highly likely you'll be wasting people's time with you buggy code.
Eliza Drupperstut - Fri, 12 Aug 2016 16:07:14 EST VAZu238H No.35987 Reply
>the hard coded menu is getting big and hard to maintain
So populate it dynamically.
However, it sounds like something is fucked with you design. Why is there is big ass menu?

The trendy fucks here will tell you it's wrong, but have your commands/menu items inherit from a base class that registers itself with a list that gets build at runtime. Or have a command factory.
James Turveyman - Tue, 16 Aug 2016 10:08:05 EST vIbiteGg No.36010 Reply
I was using scala code. T => R is a function that takes an argument of type T and returns type R. In Java 8 there is the java.util.function package and in that the equivalent classes would be Function<T, R>. There are many classes but they are all specific cases of Function<T, R> or Function<T1, T2, R>.

So in Java it would look something like this
Map<String, Function<Config, Result>> option_map =  new Map<String, Function<Config, Result>>;
option_map.put("Run", (Config c) -> someObject.run(c));
// add more options

then in your main function you could have something like:
Config config  =  //current state;
while (!config.doQuit) {
String user_input = //get user input
Result result = option_map.get(user_input).apply(c)

It actually might not be a bad idea to have Result be a boolean that tells if you should quit or not.

I need some help

View Thread Reply
- Sat, 13 Aug 2016 14:45:03 EST tXYxcME5 No.35992
File: 1471113903604.png -(453805B / 443.17KB, 2000x2000) Thumbnail displayed, click image for full size. I need some help
Guys, I've literally tried everything and nothing works, maybe my level is basic but I really want to finish this project, the real problem is:

Exception in thread "AWT-EventQueue-0" org.hibernate.TransactionException: nested transactions not supported

So my save button can't send the data to mysql :s
Ebenezer Femmerfog - Sat, 13 Aug 2016 14:56:34 EST PWhM8zCd No.35993 Reply
Don't create a new session if an old session is open.
Shit Feddlehood - Sat, 13 Aug 2016 15:10:47 EST VAZu238H No.35996 Reply
I forgot 420 still mangles ampersands, just copy paste the link or expand thread then click it.

web chat advise needed

View Thread Reply
- Mon, 08 Aug 2016 15:46:15 EST sNSHZCqU No.35978
File: 1470685575726.jpg -(114048B / 111.38KB, 603x604) Thumbnail displayed, click image for full size. web chat advise needed
Hey guys, I need you help pretty much!

I need to find a free (preferably) web chat, preferably the one that can be integrated to standard LAMP server, with certain features:

there have to be chat rooms;
there have to be moderators/admins;
moderators/admins should be able to change users' avatars;
users should not be able to change their avatars;
moderators/admins should have invisible mode (optional).

Was trying to google this features, but without success. Hope some experienced good sir will help me with this. Thanks!
Archie Crungermetch - Mon, 08 Aug 2016 19:18:38 EST lPgjzyrL No.35979 Reply

I googled "php mysql chat" and this was the fifth result. Not sure about avatars but it seems to meet all of your other criteria.

You could also use WordPress and a chat room plugin (there are dozens).

Why does lisp use parantheses?

View Thread Reply
- Sat, 30 Jul 2016 20:59:33 EST vKYETtkX No.35930
File: 1469926773087.png -(52944B / 51.70KB, 1136x640) Thumbnail displayed, click image for full size. Why does lisp use parantheses?
I thought the whole point of prefix (polish) notation was to avoid them.
3 posts and 1 images omitted. Click View Thread to read.
Sophie Dartbanks - Sun, 31 Jul 2016 10:50:27 EST WLOo3E7i No.35934 Reply
How is your syntax going to work?
Are you going to use white space, like Python, or are you going to go full polish notation
As Lisp uses s-expressions, where only the atoms are polish notation
Fuck Gobblebury - Mon, 01 Aug 2016 14:57:00 EST VAZu238H No.35936 Reply
LISP syntax directly represents incomprehensible gibberish
William Worthingway - Tue, 02 Aug 2016 11:41:08 EST 9QSfnS0r No.35943 Reply
Take a look at factor

It's basically what you get if you write a forth to do everything that a lisp does.
It still uses parenthesis where it makes sense, like for literal arrays and such, but otherwise relies on RPN wherever possible.

As already mentioned forth really only uses rpn, but you end up with stack juggling for most applications.

Phone Interviews

View Thread Reply
- Thu, 30 Jun 2016 15:06:54 EST W/zS63TD No.35795
File: 1467313614568.png -(238398B / 232.81KB, 259x318) Thumbnail displayed, click image for full size. Phone Interviews
Well I just failed miserably on a phone interview, but I'm curious as to why HR would ask the question
>what is your favorite programming language and why?
(thats not the question I failed lol)
7 posts and 1 images omitted. Click View Thread to read.
Albert Lightforth - Fri, 29 Jul 2016 07:54:37 EST ebCYLs2f No.35925 Reply
Why choose PHP over Python?
Cyril Huppershit - Fri, 29 Jul 2016 14:36:50 EST 2rmkrydG No.35927 Reply
>not using Node.js

Report Post
Please be descriptive with report notes,
this helps staff resolve issues quicker.