back
user profile
AlexeyBrin
11,535karma·1,345submissions·January 25, 2013
recent activity (1,345 total)
comment
Think at this as an exercise in programming. You don't write a game of Snake to make THE game of Snake. You write it to learn something and hone your skills (same way as someone taking a Math c…
comment
Yes, but you can't use flexible array members with a void array. So you will need to have a specialized structure for every data type (or use some macro system to generate these). It is an excell…
comment
> you can use C++ with templates and not only have much cleaner code, but also avoid forcing the compiler to inline every single call to array_push_back Actually, you really, really, really want to…
comment
Correct, this is a bug. calloc will better mimic the way C++ std::vector works.
comment
See this comment https://news.ycombinator.com/item?id=13346432 . At this point creating a function like: array_push_back(int nr_arguments, ...);
that will replace the origina…
comment
Not without some serious modifications, see line 6 of the macro: data_type *pp = arr->data;\
this is expanded to something like (when data_type is double): double *pp = arr->data;…
comment
Probably, if you use memcpy and store the size of the data type as an extra parameter in the containing struct.
comment
This mimics C++ vector, e.g.: vector<int> vec(5);
vec.push_back(11);
vec.push_back(12);
Now you have in vec : 0, 0, 0, 0, 0, 11, 12
But your suggestion is better from …
comment
> meanwhile, everyone's phone here runs gnu/linux but completely out of reach.
everyone bought a computer from an advertising (google) or fashion (apple) company that only runs in kiosk m…
comment
As a member of the commons I'm not sure if I should feel insulted or amused by your condescending tone. I eat meat because I like it and I don't try to impose my view of the world to other…
comment
GCC and Clang are 100% C++14 compatible, not sure about MSVC but I think it is close to 100% compatibility.
comment
America needs and can afford to do both - better education and a space program.
comment
Except that as of C11 variable length arrays (VLAs) are optional. So with a fully standard compliant C11 compiler your code could potentially fail. While the old way of using arrays of arrays will wor…
comment
It was the other way around, Chez Scheme was released as open source, Apache license, after Cisco bought it.
comment
Search for Windows Task Schedule, there is a graphical tool that lets you define repeating tasks and a CLI option with the AT command. You can also do it from PowerShell by writing a cmdlet.
comment
> You can still program in C 89 or FORTRAN 77 or COBOL 74 (and no doubt there is somebody still supporting compilers and runtimes for those), but they are all obsolete standards. The situation with…
comment
You can buy Pico-8 separately if you want, it works on Windows, Mac, Linux, Raspberry Pi and of course Pocketchip.
comment
You could check yourself http://www.apple.com/us-hed/shop/buy-mac/macbook-pro/13-inch there is indeed a $200 discount for the high end 15" version. The low en…
comment
Last time I checked the educational discount was around $100 for a $2K+ laptop. Here is the relevant link http://www.apple.com/us-hed/shop/buy-mac/macbook-pro/13-in…
comment
The author provides the book as a free to download pdf at http://icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf …
comment
The same author is working in Cocos2d-x and Cocos2d-iPhone
That was in the past, AFAIK Ricardo works only on Cocos2d-x now. Cocos2d-iPhone is community driven now.