HNHacker News
TopNewBestAskShowJobs

cremno

2,647 karma · joined March 24, 2012

submissionscomments
cremno··on Reverse engineering the binary data format for Star Wars: Yoda Stories
I guess the two tiles are really unused, aren't they? If they are, that's great stuff for the The Cutting Room Floor wiki (http://tcrf.net)! Don't get lost on there as it's somewhat like TV Tropes.
cremno··on The Forgotten Female Programmers Who Created Modern Tech
That's kinda funny of you mentioning the “high-profile guy”, because he wrote the following post not long ago, which mentions some lesser known women in tech than this article does:

http://www.reddit.com/r/linux/comments/2hoffe/weev_stop_bash...

cremno··on The Forgotten Female Programmers Who Created Modern Tech
Why do Ada Lovelace or Grace Hopper count as forgotten?
cremno··on How fast is fscanf?
In my opinion that's bad C/C++ code: it's C/C++ code, two `while (!feof(fd))` loops, compiled without enabled diagnostics, and an inferior parser with at least one possible integer overflow (in ConsumeInteger()).

If it works without problems for your data, good for you, but for general purpose it isn't nearly a replacement as fscanf() or strtod() (hopefully) work correctly and don't have weird limitations like 300 / -300 as max / min base 10 exponent. Parsing floating point numbers is not easy.

cremno··on Where the Printf Rubber Meets the Road (2010)
The Plan 9 C compilers have #pragma varargck (argpos|type|flag):

http://plan9.bell-labs.com/sys/doc/compiler.html (3.8)

cremno··on Modernized time.h for ISO C (1998)
Also, some proposed conversion specifiers are part of C99: %z and %l / %L as %Z.
cremno··on Modernized time.h for ISO C (1998)
`struct xtime` and `xtime_get` were added in C11 as `struct timespec` and `timespec_get`:

http://port70.net/~nsz/c/c11/n1570.html#7.27.1p3

http://port70.net/~nsz/c/c11/n1570.html#7.27.2.5

There are some differences though. Not only the name and types differ. But also `timespec_get` is only required to support `TIME_UTC` and the specification is not as detailed.

cremno··on Writing a Simple Garbage Collector in C
It isn't portable. jmp_buf should be treated as opaque data type (just like FILE or va_list), even if it isn't. Also, its content can be encrypted (glibc does pointer mangling).
cremno··on We have C++14
>it wasn't in Visual Studio last I checked

The upcoming version has it.

cremno··on How Far Do Your Cats Roam?
The BBC has an article about tracking cats (from 2013), although the animation could have been better.

http://www.bbc.com/news/science-environment-22567526 (animation)

http://www.bbc.com/news/science-environment-22821639 (actual article)

The accompanying documentation can be found on YouTube: https://www.youtube.com/watch?v=JPthfv1XL_w

cremno··on The Descent to C
>by casting an integer to a pointer type That's implementation-defined. The opposite too except if the result can't be represented in the integer type.

>by taking an existing pointer to one type and casting it so that it becomes a pointer to an entirely different type. It isn't that easy, but it's well-defined as long as both pointers are compatible and identically qualified.

cremno··on GCC Receives ACM’s 2014 Programming Languages Software Award
I wouldn't use “robust” here. Just look at the errors types and the examples (below the table).

Yes, there are some features that Clang doesn't implement at the moment or never will (GCC has some really bizarre extensions and is sometimes less strict), but there is also a great amount caused by bad code.

I can't come up with a better alternative, though.

cremno··on Nope.c – A web framework with a tiny footprint
There is also https://kore.io/.
cremno··on Intermediate C Programming Notes
I've noticed the first sentence is very weird and doesn't make much sense. Also that isn't just a small mistake. But I can't edit my post anymore. I'm sorry.

I originally wanted to write more and point out some other important things. For example, “long long” never gets mentioned! This is not a good book to learn C. I believe it could be an adequate (or even good) one to train already existent C skills, but it isn't even that at the moment.

Okay, it isn't a final version. We have to wait until next year for that, but LCTHW gets too much positive attention for being just another less-than-mediocre tutorial book on the Internet.

cremno··on Intermediate C Programming Notes
Besides being a terrible book, it also contains many small mistakes. My favorite one is checking the return value of memcpy() for non-NULL.

http://c.learncodethehardway.org/book/ex44.html

cremno··on Named parameters in C
Yes, designated initializers were added in ISO C99 and since Visual Studio 2013 they are also supported by MSVC.

But the code is neither ISO C99 nor C11. It uses a GNU C extension called “statement expressions”, which is not supported by MSVC.

Also, its preprocessor has quite a few problems. I think after removing statement exprs and running the code through a different PP, MSVC will compile it.

Of course, one could just simply use MinGW or Clang instead.

cremno··on The Great C Runtime Refactoring
That's actually common practice. Look at other libc implementations.

Even the original implementation did that:

http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/libc...

http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/libc...

cremno··on Ruby 2.1 Released
See “Branching Schema”: https://www.ruby-lang.org/en/news/2013/12/21/semantic-versio...
cremno··on How The Post covered the ‘grand social experiment’ of the Internet in 1988
>The idea for pre-increment (++x) and post-increment (x++) operators in C came from PDP-11 assembler language.

He's wrong.

>Thompson went a step further by inventing the ++ and -- operators, which increment or decrement; their prefix or postfix position determines whether the alteration occurs before or after noting the value of the operand. They were not in the earliest versions of B, but appeared along the way. People often guess that they were created to use the auto-increment and auto-decrement address modes provided by the DEC PDP-11 on which C and Unix first became popular. This is historically impossible, since there was no PDP-11 when B was developed. The PDP-7, however, did have a few `auto-increment' memory cells, with the property that an indirect memory reference through them incremented the cell. This feature probably suggested such operators to Thompson; the generalization to make them both prefix and postfix was his own. Indeed, the auto-increment cells were not used directly in implementation of the operators, and a stronger motivation for the innovation was probably his observation that the translation of ++x was smaller than that of x=x+1.

Source: http://cm.bell-labs.com/cm/cs/who/dmr/chist.html

cremno··on Oddities in x86 Assembly
WinDbg
cremno··on Ruby hacking guide
A better translation of chapter 11: http://whitequark.org/blog/2013/04/01/ruby-hacking-guide-ch-...
cremno··on Why Ruby rocks
You might want to participate in https://bugs.ruby-lang.org/issues/8564
cremno··on _why's site is updated
GhostPCL: http://www.ghostscript.com/download/gpcldnld.html
cremno··on Matz on Ruby 2.0 at Heroku's Waza
Slides: https://speakerdeck.com/yukihiro_matz/ruby-2-dot-0-en
cremno··on C11, yo
>they are not interested in supporting more of ISO C

>* For C++11 conformance, we're interested in implementing the C99 Standard Library

Source: https://connect.microsoft.com/VisualStudio/feedback/details/...

cremno··on Ruby 2.0.0-preview2 released
Ruby supports this too but it will be removed in the future (3.0). The preview doesn't show a warning but 2.0 will.

Source: https://bugs.ruby-lang.org/issues/6265

Btw, PRI_LL_PREFIX is defined in Ruby's config.h.

cremno··on Ruby vs. Python - A n00b's perspective (part 5)
>Having to write out IO::SEEK_SET in Ruby really bothers me

You don't have to. The 2nd argument is optional and defaults to IO::SEEK_SET. (Source: http://www.ruby-doc.org/core-1.9.3/IO.html#method-i-seek)

cremno··on Favicons in the retina age
This site is about IE8. This one is about IE9 on Win7: http://msdn.microsoft.com/en-us/library/ie/gg491740%28v=vs.8...

The optimal sizes are the same as the author's but 24x24 px. is missing in the recommended size list.

The site links to a blog entry about Pinned Sites in Win8. You can re-use the 144x144 px. PNG for a pinned site.

cremno··on Display C sources in chrome
There are extensions that open such files. These extensions do mainly syntax highlighting like: https://chrome.google.com/webstore/detail/cgjalgdhmbpaacnnej... https://chrome.google.com/webstore/detail/epmaefhielclhlnmjo... (offers some more features but does not work when AdBlock is enabled)

So opening instead of downloading is possible by using an extension. Perhaps an extension already exists which does that without any other features.

← PreviousPage 7 of 7