u/dchem - 93 Archived Voat Posts in v/programming
u/dchem
  • home
  • search

u/dchem

42 posts · 51 comments · 93 total

Active in: v/programming (93)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Intro to Linkers in Linux
11 0 comments 03 Jul 2017 21:30 u/dchem (..) in v/programming
[c++] Writing a Really, Really Fast JSON Parser Chad Austin
1 0 comments 29 May 2017 04:37 u/dchem (..) in v/programming
Build your own Lisp with Python
5 0 comments 26 May 2017 02:40 u/dchem (..) in v/programming
[pdf] The Night Watch - James Mickens (2013-11)
1 0 comments 25 May 2017 04:54 u/dchem (..) in v/programming
Comment on: How do you usually read programming books?

I buy ebooks, and then buy paper copy if I really like the book.

0 25 May 2017 03:47 u/dchem in v/programming
NoSQL Data Modeling Techniques
1 0 comments 10 Mar 2017 21:00 u/dchem (..) in v/programming
Comment on: Unit testing: Why it is a bad idea.

Unit testing is important because it describes how a function or class should work. Outside participants to the project could first look at the test, and from observability perspective determine what it's supposed to do.

Unless you can go through the rigorous exercise of proving out that your code works with linear logic, it's hard for someone to claim that something will work out of box when they ship it.

Test coverage as a number means nothing, that I agree, and often programmers don't know the difference between unit tests and integration tests. Often unit tests are not valuable when the developer writes something that isn't really testing the functionality from input output perspective. Side effects are hard to test when dependencies increase for a given unit.

LOC isn't the objective for writing code. Source isn't made any more complex by adding unit tests - if it is, then the programmer is doing something wrong by injecting test specific stuff into prod code.

Reusability isn't the principal claim that unit test advocates are making. The claim is that extensive tests reduce two things:

  1. Incorrect assumptions about the code itself
  2. Regression errors due to new feature deployment

Different point being made here is about what constitutes elegance, and that is outside of the scope of debate about unit tests.

0 04 Mar 2017 01:59 u/dchem in v/programming
Comment on: Fred Heath - The Nim programming language - Bristech 2016

Nim is really nifty. For those who aren't familiar, Nim is a systems development language, much in the same way Go is intended to be. Nim isn't trying to solve the same class of problems that Rust is trying to solve. Basically if you have any experience with trying to develop something like a webapp or a backend application in c, you'll realize that you can get mired in re-implementing a lot of stuff.

What's Nim for? First of all it has concurrent programming support built into standard api. Think of how Go makes concurrent programming easier to approach. Nim is similar in that sense.

Garbage Collector? Nim has a garbage collector. That alone is a turn off for a lot of people gathering around Rust. But use of garbage collector is optional for Nim.

Compiling to c? Nim dev team has a long term plans for compiling directly into binary. I think compiling to c is a good first step, and it allows no-nonsense portable development.

One thing I don't like about is the syntax, it seems like it's heavily influenced by Python. Other than that, there is a lot to like about the language.

1 04 Mar 2017 01:49 u/dchem in v/programming
How Does DNS Work? (DNS and BIND, 4th Edition)
3 0 comments 03 Nov 2016 21:32 u/dchem (..) in v/programming
The Architecture of Open Source Applications: LLVM
3 0 comments 31 Oct 2016 22:32 u/dchem (..) in v/programming
Comment on: seriot.ch - Parsing JSON is a Minefield

You know the funny thing is that I've been posting mostly useful stuff, and each of those posts has been downvoted exactly twice.

0 28 Oct 2016 22:28 u/dchem in v/programming
Comment on: [c] How to Get Fired Using Switch Statements & Statement Expressions

Also, waiting for that obligatory 2 downvotes. :)

1 28 Oct 2016 22:27 u/dchem in v/programming
[c] How to Get Fired Using Switch Statements & Statement Expressions
3 2 comments 28 Oct 2016 22:26 u/dchem (..) in v/programming
seriot.ch - Parsing JSON is a Minefield
0 2 comments 26 Oct 2016 21:04 u/dchem (..) in v/programming
Comment on: Composing Financial Contracts - Functional Way

Hmm weird, it's definitely programming related, yet downvoted.

0 20 Oct 2016 22:02 u/dchem in v/programming
Composing Financial Contracts - Functional Way
1 0 comments 19 Oct 2016 01:18 u/dchem (..) in v/programming
Comment on: I just spent 12h in Delphi trying to fix fatal bug. At the end I had to check almost line per line until I removed a '\' character from a string.

BURN IT ALL DOWN

0 21 Sep 2016 02:30 u/dchem in v/programming
Red and Green Callbacks - Erlang - Joe Armstrong
1 0 comments 20 Sep 2016 19:49 u/dchem (..) in v/programming
Heavy Metal and Natural Language Processing - Part 1
5 0 comments 04 Jul 2016 13:24 u/dchem (..) in v/programming
Comment on: Policheck - Remove the term "whitelist"

Policheck lol, can't make this stuff up.

0 16 Jun 2016 23:35 u/dchem in v/programming
Regular Expression Matching Can Be Simple And Fast
1 1 comment 13 Jun 2016 10:53 u/dchem (..) in v/programming
In search of the perfect URL validation regex
14 2 comments 04 Jun 2016 04:36 u/dchem (..) in v/programming
Comment on: Emoticons - sounds instead of emojis?

This post has nothing to do with programming... Can we at least try to stay on topic? Maybe this is better served under /v/technology ?

0 03 Mar 2016 21:35 u/dchem in v/programming
[c] On the Brokenness of File Locking
1 0 comments 03 Mar 2016 14:57 u/dchem (..) in v/programming
Comment on: On pushing back against the SJW encroachment on the F# community

Typical. Gives you 24 hours and just merges it. Not even github was this asinine.

3 01 Mar 2016 01:39 u/dchem in v/programming
Comment on: HOW TO: Move from github to BitBucket. I just moved 4 private repositories and it took me 10 minutes.

If I remember correctly this was the time when StrongLoop was on the fence about whether to back IO.js or not. Eventually StrongLoop decided enough was enough (with Joyent calling Ben to be fired, the guy who wrote 28% of libuv, over a pronoun)

I'm glad Joyent got their asses whooped and had to submit to Node.js Foundation deal. Fuck them.

3 25 Feb 2016 10:45 u/dchem in v/programming
Comment on: I realize this might be an obvious question, but is anyone else annoyed by how programming has transformed from an understanding of concepts into blatant marketing speak?

Having programmed Node.js applications for cloud, Node.js addons for another application, and just plain old POSIX C programs for embedded devices, I can tell you that Node.js does a lot of things right, and I have so much more appreciation for standard API that Node.js provides now that I've coded in C and had to re-implement some of those functionalities.

Node.js does allow a lot of higher level abstractions to be installed and used relatively painlessly, and the accolades it get isn't just from the HR people - originally they are from the frustrated devs who switched to Node.js and found out that it's super effective at going from 0 to 1.

HR people eventually saw the productivity and figured, if Joe Hacker can pump out functional code with Node.js, why not every Tom, Dick, and Harry? That's why it's now over-hyped.

So, please don't be too hard on Node.js. It's not the framework that's bad, it's the un-enlightened people who think Node.js is the panacea for all development woes.

0 24 Feb 2016 22:30 u/dchem in v/programming
Comment on: Custom compression for huge data sets

Is the data something that can be put into a table?

If so, have you looked into columnar database called fastbit?

It uses bitmap indexing and word-aligned hybrid compression to have a good space-performance trade-off.

0 22 Feb 2016 20:31 u/dchem in v/programming
How Browsers Work: Behind the scenes of modern web browsers - HTML5 Rocks
9 0 comments 14 Feb 2016 02:32 u/dchem (..) in v/programming
[Embedded linux] Learning the Basics of Buildroot - Thomas Petazzoni
1 0 comments 11 Feb 2016 23:57 u/dchem (..) in v/programming
Comment on: The Ruby Programming Language community is now under siege by SJW entryists and the trojan horse Code of Conduct

There's some hope yet!

Besides that, I don't want to live in the community where a member can possibly be casted out forcefully. It's not nice. It should be resolved by law enforcement, if needed. Thus banning is out of question (for me at least).

Matz.

0 01 Feb 2016 11:29 u/dchem in v/programming
Comment on: The Ruby Programming Language community is now under siege by SJW entryists and the trojan horse Code of Conduct

Good bye Ruby.

0 01 Feb 2016 11:17 u/dchem in v/programming
Comment on: An anonymous response to dangerous FOSS Codes of Conduct
  • Don't contribute to FOSS projects with CoC.
  • Self-host your own repo.
  • Brush and floss your teeth.
2 25 Jan 2016 21:53 u/dchem in v/programming
Comment on: Coroutines in C

Yep. Right after this he goes on to say that.

0 09 Jan 2016 01:20 u/dchem in v/programming
Coroutines in C
4 3 comments 09 Jan 2016 01:00 u/dchem (..) in v/programming
Comment on: Linux glibc >= 2.10 (RHEL 6) malloc may show excessive virtual memory usage (Kevin Grigorenko's IBM WebSphere SWAT Blog)

Yes it does.

0 07 Jan 2016 17:39 u/dchem in v/programming
Comment on: Linux glibc >= 2.10 (RHEL 6) malloc may show excessive virtual memory usage (Kevin Grigorenko's IBM WebSphere SWAT Blog)

I don't think they were blaming glibc. They were telling you about java because that's how they found out about this. Anything that uses glibc (like hadoop) is affected by it and can be really annoying. This is usually benign, except when programmers try to use the knobs given and those knobs are undocumented (M_ARENA_MAX for one isn't even in the man page for mallopt)

Excessive virtual memory allocation can be a problem because the allocated memory (which is really virtual address space, so should be relatively safe) can cause application to quit out if there are any ulimit() or setrlimit() kind of things within the process in question.

Multithreaded applications in particular are heavily affected by this, and can cause heartaches if the programmer using glibc >= 2.10 isn't aware of it.

Here's a background info for those interested: https://sourceware.org/bugzilla/show_bug.cgi?id=11261

1 07 Jan 2016 02:19 u/dchem in v/programming
Comment on: Linux glibc >= 2.10 (RHEL 6) malloc may show excessive virtual memory usage (Kevin Grigorenko's IBM WebSphere SWAT Blog)

Beware.

0 06 Jan 2016 22:42 u/dchem in v/programming
Linux glibc >= 2.10 (RHEL 6) malloc may show excessive virtual memory usage (Kevin Grigorenko's IBM WebSphere SWAT Blog)
8 6 comments 06 Jan 2016 22:41 u/dchem (..) in v/programming
Understanding glibc malloc
2 0 comments 05 Jan 2016 03:52 u/dchem (..) in v/programming
libmill - Go-style concurrency in C
2 0 comments 30 Dec 2015 20:05 u/dchem (..) in v/programming
Comment on: An Impromptu Interview about Sovereign Software Development

He goes over it in the latter half of the article. He mentions first one to come up with a working prototype for a given project should be the crown, because he is most intimately aware of the architecture and the initial implementation difficulties.

Also N different kingdom isn't the right analogy. The article states vassals who chose to be part of the project and owns a smaller piece of the overall project. If there is enough contention (primarily due to poor organization forms like undemocratic socialism), the article suggests, that there will be fundamental schism and malcontent participants either 1) form their own project 2) continue to disrupt the project with unproductive squabble.

The proponent of the Sovereign Software Development model tells us that successful software development projects all follow this natural order.

Personally I think bryanedds is right. Linux core development is a great example of what is being described.

0 30 Dec 2015 19:55 u/dchem in v/programming
Data alignment: Straighten up and fly right
2 0 comments 26 Dec 2015 06:15 u/dchem (..) in v/programming
The Architecture of Open Source Applications (Volume 2): GDB
1 0 comments 18 Dec 2015 23:18 u/dchem (..) in v/programming
Beginner's Guide to Linkers
18 0 comments 17 Dec 2015 00:31 u/dchem (..) in v/programming
Comment on: Let's Encrypt NOW In Public Beta - How To Get A Valid SSL Certificate Absolutely Free

Just understand that the SSL certificate is for 3 months. Make sure you have cronjob that run it every two months or so.

0 13 Dec 2015 10:06 u/dchem in v/programming
"Distributed, Eventually Consistent Computations" by Christopher Meiklejohn
2 0 comments 13 Dec 2015 10:04 u/dchem (..) in v/programming
Comment on: [c] ACCU :: char* p vs char *p

For what it's worth, I use char *p since it seems to make more sense to me personally.

1 04 Dec 2015 04:50 u/dchem in v/programming
[c] ACCU :: char* p vs char *p
6 2 comments 04 Dec 2015 00:52 u/dchem (..) in v/programming
Comment on: These Are the Highest-Paying Programming Languages (do you agree?)

Article title says "Programming Languages"

2 02 Nov 2015 03:14 u/dchem in v/programming
Comment on: These Are the Highest-Paying Programming Languages (do you agree?)

I am commenting on the "best case" scenario diagram at the bottom, where the author suggests that if you have +20 years experience with C++, and you work in US, you can get "princely" salary of $95000. Author doesn't seem to realize that there is a fierce competition for talent, and someone with +20 years experience would command a lot higher salary.

In other words... try $160-180k.

2 02 Nov 2015 03:12 u/dchem in v/programming
Comment on: golang code of conduct proposal

Sorry gophers, your language is being taken over by zealots.

6 02 Nov 2015 03:10 u/dchem in v/programming
Comment on: These Are the Highest-Paying Programming Languages (do you agree?)

Also, if you tried to recruit C++ expert with 20+ years of experience and try to offer them $95000 they will spit on your face.

4 02 Nov 2015 01:43 u/dchem in v/programming
Comment on: These Are the Highest-Paying Programming Languages (do you agree?)

AWS is not a language.

12 02 Nov 2015 01:41 u/dchem in v/programming
[C] POSIX Threads Programming Tutorial
5 0 comments 26 Oct 2015 22:28 u/dchem (..) in v/programming
Contrasting Enterprise Node.js Frameworks: Hapi vs. Kraken vs. Sails.js vs. Loopback
4 0 comments 15 Oct 2015 02:02 u/dchem (..) in v/programming
[Jenkins] Jenkins: How to Switch to SSL/ HTTPS mode
4 0 comments 12 Sep 2015 11:09 u/dchem (..) in v/programming
[pdf] Elm: Concurrent FRP for Functional GUIs - 2012 - Thesis by Evan Czaplicki
2 0 comments 12 Sep 2015 00:17 u/dchem (..) in v/programming
[git] A Git Horror Story: Repository Integrity With Signed Commits
12 0 comments 10 Sep 2015 10:00 u/dchem (..) in v/programming
How do JavaScript closures work under the hood - [Dmitry Frank]
5 1 comment 07 Sep 2015 09:18 u/dchem (..) in v/programming
Comment on: I hope one day I'll live in a country where I have freedom to write any code I like without fearing.

I hope he gets a job in Apple so he can come over to US. ;_;

1 22 Aug 2015 22:08 u/dchem in v/programming
[long doc] ØMQ - The Guide - aka "I'm gonna teach you some distributed networking pattern"
4 0 comments 14 Aug 2015 22:01 u/dchem (..) in v/programming
[tools] The Text Triumvirate - zsh, vim, & tmux
12 2 comments 13 Aug 2015 03:00 u/dchem (..) in v/programming
[JS] Numerical Computing in JavaScript [Meetup 2014-04-15]
1 0 comments 12 Aug 2015 03:45 u/dchem (..) in v/programming
Comment on: [git & jenkins] How to setup Gitblit and integrate it with Jenkins CI to build your projects as you push them to repo

Plus, the dev for Gitblit sounds like he knows what he's doing. GitMinute interview with GitBlit dev, James Moger

0 04 Aug 2015 12:08 u/dchem in v/programming
[git & jenkins] How to setup Gitblit and integrate it with Jenkins CI to build your projects as you push them to repo
11 1 comment 03 Aug 2015 21:57 u/dchem (self.programming) in v/programming
Comment on: What are some programming jargon everyone should be aware of?

It's not. It's just a way to schedule an application to run at a specific time from a linux service (background process) called cron. Useful when you don't want a thing to run constantly, but just want a batch job to be done. For an example, running a shell script that collects and puts some log files together into a folder at 7 am in the morning or something like that.

0 03 Aug 2015 19:45 u/dchem in v/programming
Comment on: [git] How to make pull request if you don't use github.

Yep. I moved away and I am now self-hosting.

2 03 Aug 2015 00:33 u/dchem in v/programming
Comment on: Employed programmers of Voat what's the best examples of coding challenges that you'll typically face during an interview.

Here are some that I got just in last year:

  1. Make a relationship graph similar to LinkedIn. Write a code to get how close person B is to person A from that graph. (15 min to half hour) Follow up: What are some of the things you should worry about when traversing?

  2. You have a large logs of different events. Given that it has a column of time, IP address, description, and event type, write a code that checks for three sequential events from a same IP address. (15 min to half hour) Follow up: How would you improve the logging system to allow for easier classification of "sequential events?"

  3. Given a set of substitution cipher text, write a code to decrypt it in language of your choice. (Gives you an hour to do this with a laptop)

  4. For an April Fools joke, you are to design and code a password login front-end that takes in a password that is case insensitive and lets users login for a case sensitive user password. Assume there is no API call limit for login. (One hour, white board)

Generally I noticed a lot of recent interview questions that I got is regarding graph and tree traversal. There are some recursion questions as well.

0 01 Aug 2015 23:50 u/dchem in v/programming
Functional Reactive Programming - "Controlling Time and Space: understanding the many formulations of FRP" by Evan Czaplicki
1 0 comments 01 Aug 2015 23:35 u/dchem (..) in v/programming
[git] How to make pull request if you don't use github.
26 2 comments 31 Jul 2015 19:51 u/dchem (self.programming) in v/programming
Comment on: Why the Open Code of Conduct Isnt for Me

Code of conduct is used by sites like github and others to push an agenda while making it 'acceptable' for general populace who for the most part has become so fixated on social justice that they fail to see free speech component of the issue. Code of conduct is a solution to problem that does not exist. It's also a blunt tool to silence and bully people.

What made hacker / programming community great is its relentless drive to make things better. Sometimes it means telling stupid people that they are stupid, or saying that stupid idea is stupid. This also means that you have a rowdy culture (which I rather prefer) which some labeled 'bro' culture. I think there is a distinction to be made here, 'bro' culture is very different from 'hacker' culture.

Hacker / programming community also has what's called natural order. Someone who contributes a lot to the project, which hundreds may benefit from, should be listened to. Have you seen House MD? While it gives no one the right to be jerks, I think immense contribution they make should afford them some leeway in dealing with the counter-productive or actions unrelated to benefit of the coding project. SJWs in general decided to jump in on the fray, using the highground they achieved on the platform field (e.g. github.com). What they are wrong about is that they believe SJWing is what made coding communities like github great. It's not. None of the coders posted their code thinking it will make everyone safe and sound from offense. They coded and pushed code because it's their passion.

SJWs are conflating the economic success of San Francisco to their dogma - it's wrong. Their whole stinking edifice will come crumbling down when people realize this is a load of crap.

1 29 Jul 2015 20:34 u/dchem in v/programming
Comment on: What are some programming jargon everyone should be aware of?

In no particular organized manner:

  • kludge - Not the most correct way to do something, but it works.
  • backtick - the thing below tilde
  • grep - find a text pattern in a body of text
  • cron - A cronjob is something that can be scheduled to perform at given time or interval. You specify this in crontab.
  • userspace - Also known as userland, as opposed to kernel. Kernel interacts with drivers, handles IO with CPU and memory, schedules system critical tasks, and so on. Userspace handles all the application resources, calls and so on. Userland interacts with kernel for hardware IO, interaction with filesystems, etc.
  • map - a relationship between key and value. e.g. A map of A to B, A->B
  • API - application programming interface, which often provides easy input output relationship in, but not to be used interchangeably with...
  • SDK - software development kit, which is a collection of code and examples for developing with particular set of, but not to be used interchangeably with....
  • Framework - which is basically a pre-structured way of programming. Sometimes providing a lot of...
  • Libraries - which is a set of useful code that is included into the executable or into another library of codes.
  • RESTful - something that has representational state transfer quality. Client need not know the structure of API to make REST requests. Simply put, using simple verbs like GET, PUT, DELETE, POST to say what needs to be done and passing parameters either as part of the request or as a payload in text and JSON.
  • JSON - javascript object notation. A simple way to group information with curly braces.
1 27 Jul 2015 19:25 u/dchem in v/programming
Comment on: Github is adopting a code of conduct

gitlab too is infested, unfortunately.

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md

https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md

1 22 Jul 2015 21:21 u/dchem in v/programming
Comment on: Github is adopting a code of conduct

Urgh

2 22 Jul 2015 07:42 u/dchem in v/programming
Comment on: The Architecture of Open Source Applications

Very helpful thanks!

1 21 Jul 2015 07:47 u/dchem in v/programming
Comment on: [Node.js] how to write node programs with streams - substack

Makes sense to go Apache 2 if you plan on making sure that patent grant isn't an issue, but Apache 2 turns me off because of verbosity. If it's a big, important project, Apache 2 might be worth looking into, but for most of the stuff I'm working on I went with MIT because it's approachable by laypeople (non-lawyers) - aka developers.

0 21 Jul 2015 03:09 u/dchem in v/programming
Comment on: [Node.js] how to write node programs with streams - substack

Why Apache 2 though?

0 19 Jul 2015 03:17 u/dchem in v/programming
[Node.js] how to write node programs with streams - substack
14 6 comments 17 Jul 2015 01:40 u/dchem (..) in v/programming
Comment on: What programming language changed your outlook on creating software?

Javascript. Now I enjoy programming.

1 15 Jul 2015 06:16 u/dchem in v/programming
Comment on: The Rust Code of Conduct contains this

I'm being perfectly rational. Using projects that derives its value from toxic original is giving tacit agreement that such toxic original is in the right. It'd be like if I bought a ticket to a movie when all of its cast and staff advertises the fact on some TV interview that they donate to a cause that seeks to destroy my freedom.

There are a lot of great projects and languages out there, and you don't have to deal with Rust team's crap. You have freedom of choice. Move on. Let them rot.

2 27 Jun 2015 17:00 u/dchem in v/programming
Comment on: The Rust Code of Conduct contains this
  1. Don't code on Rust.
  2. Don't use projects that use Rust.
17 26 Jun 2015 16:47 u/dchem in v/programming
Comment on: [Google R&D] Inceptionism: Going Deeper into Neural Networks

Images from the blog that looks like cross between surrealist paintings, HR Giger, and Cyriak from Youtube.

0 19 Jun 2015 22:48 u/dchem in v/programming
[Google R&D] Inceptionism: Going Deeper into Neural Networks
1 1 comment 19 Jun 2015 22:46 u/dchem (..) in v/programming
Comment on: [lisp] I heard you like lisp

https://github.com/zick/ZickStandardLisp

A Lisp evaluator in Lisp.

0 19 Jun 2015 20:39 u/dchem in v/programming
Comment on: What is code?

It's really scatterbrained.

0 18 Jun 2015 23:37 u/dchem in v/programming
Comment on: Node.js wrapper for voat API

Version 1.0.0

npm install voatapi

0 18 Jun 2015 22:52 u/dchem in v/programming
Node.js wrapper for voat API
1 1 comment 18 Jun 2015 22:51 u/dchem (..) in v/programming
Comment on: How to I improve my real world programming skills?

Pick a project you want to get done in few different time periods:

  • Short - A day or two
  • Medium - A week or so
  • Long - Month or more

Then start setting time aside for programming a little everyday to finish up a project to the point you'd consider 1.0. Move on to next project, and come back and improve the past projects as needed. Make sure you are writing the code with intent to be read and understood by someone else. Make sure you are committing them to github or other places where you are subject to public scrutiny.

C# and PHP is a fine starting point, if you are already familiar with it. I would also suggest experimenting with a few more scripting languages, like Perl. Python is a perennial favorite and you can't go wrong with it.

Picking up a functional language and experimenting with it will give you broader exposure than your run of the mill programmers. Just like you can't be a Wine critic drinking only one kind, software engineers should also try to extend their reach beyond the comfort zone.

Learning about concurrency, parallel computing, and asynchrony will put you way ahead of the curve. Web programming in general deals a lot with asynchronous event handling, so javascript is a good lead in for that. Learning the nuances of concurrency in different programming languages and frameworks also help, for an example, Node.js's approach to concurrency is very very different than Go's.

Learning about Linux fundamentals will help immensely. In particular, learning about UNIX philosophy, what kind of tools are available in Linux environment, and in general being comfortable with things like sed, bash, etc. I would recommend a book titled "How Linux Works: What Every Superuser Should Know" by Brian Ward.

I hope this helped. Best of luck.

2 17 Jun 2015 00:24 u/dchem in v/programming
[lisp] I heard you like lisp
3 4 comments 17 Jun 2015 00:09 u/dchem (..) in v/programming
Comment on: Time to go mobile.

Native App: Get Android Studio kit from here

Hybrid Webapp: PhoneGap or AppGyver

0 16 Jun 2015 23:50 u/dchem in v/programming
Comment on: What can help me transition from intermediate web OOP to game OOP

First, get yourself a good C++ book. I'd recommend something like Effective Modern C++.

Next, get yourself started with Visual Studio for an IDE and SFML for video/audio/thread library. I know a lot of game programmers poopoo the idea, but SFML is a decent way to learn the basic architecture of C++ game without having to go from grounds up.

Basic architecture is to run worker threads to update graphics, another worker thread to run the sound, and another to loop the game and so on. SFML gives you some thread management capability, so you have that going for you.

Here's an example code:

#include "GameEngine.h"
int main(int argc, char* argv[])
{
    GameEngine game;
    game.start();
    return 0;
}

The GameEngine will have implementaion like this:

void GameEngine::start(void) {
    this->loadSettings();
    int width = 0;
    int height = 0;
    this->mGameSettings.getResolution(width, height);
    this->mWindow.create(sf::VideoMode(1920,1200,32), "Game Title");
    this->mWindow.setPosition(sf::Vector2i(0,0));
    this->mWindow.setSize(sf::Vector2u(width,height));
    m_gameState = InitLoading;
    while(!isExiting()) {
        this->playGame();
    }
    this->mWindow.close();
}
bool GameEngine::isExiting() {
    if (m_gameState == AppState::Exiting)
        return true;
    else
        return false;
}
void GameEngine::playGame() {
    sf::Event currentEvent;
    while (mWindow.pollEvent(currentEvent)) {
        switch (m_gameState) {
        case AppState::InitLoading:
            {
                AssetManager assetMgr(this->mGraphicAssets, 
                    this->mSoundAssets);
                sf::Thread loaderThread(&AssetManager::loadAssets,&assetMgr);
                LoadingScreen initLoading(this->mWindow, assetMgr, this->m_gameState);
                loaderThread.launch();
                initLoading.run();
                break;
            }
        case AppState::AtMainMenu:
            {
                MainMenuScreen mainMenu(this->mWindow, this->mGraphicAssets, this->mSoundAssets, this->m_gameState);
                mainMenu.run();
                break;
            }
        case AppState::sp_challenge:
            {
                SpChallenge spChallenge(this->mWindow, this->mGraphicAssets, this->mSoundAssets, this->m_gameState);
                spChallenge.run();
                break;
            }
        default:
            break;
        }
        if (currentEvent.type == sf::Event::Closed || m_gameState == AppState::Exiting)
            mWindow.close();
    }
}
void GameEngine::loadSettings() {
    this->mGameSettings.readFromCfg();
    this->mGameSettings.setResolution(1200, 
        VideoSettings::AspectRatio::SixteenToTen, 32);
}

and you'd need somesort of application loop control:

AppLoop.h

#pragma once
#include "GameEngine.h"
#include "AppCommon.h"
#include <list>
class AppLoop
{
public:
    AppLoop(sf::RenderWindow& appWindow, AppState& appState);
    virtual ~AppLoop(void);
    void run(void);
    virtual void doInit(void) {};
    virtual void handleEvents(sf::Event sfEvent);
    virtual void update(void) {};
    virtual void draw(void);
    virtual void doOverlay(void) {};
// helper methods
    bool isReadyToExit(void) const;
    void setReadyToExit(void);
    float getElapsedTime(void) const;
protected:
    // reference to app
    sf::RenderWindow& mAppWindow;
    AppState&   mr_appState; 
    // draw loop draws this
    std::list<std::reference_wrapper<sf::Sprite>> mDrawSpriteList;
    std::list<std::reference_wrapper<sf::Text>> mDrawTextList;
private:
    bool        mIsReadyToExit;
    void        getAppLoopElapsedTime();
    sf::Clock   mElapsedClock;
    float       mElapsedTime;   
};

You can then inherit AppLoop in various game modes.

Enjoy.

2 10 Jun 2015 03:54 u/dchem in v/programming
Comment on: Whats the best language for this?

I'd recommend looking into something like Rule 30 cellular automata. Coding this should be super easy in any language. Python would be a good start, as it's easy to pick up. Though it would still be called pseudo-random generator.

0 23 May 2015 07:41 u/dchem in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.