HNHacker News
TopNewBestAskShowJobs

csl

833 karma · joined July 19, 2008

submissionscomments
csl··on Why Every Movie Looks Sort of Orange and Blue
I remember that the book "The Neverending Story" also employed a similar scheme: Red and green ink was used to distinguish between the book's two worlds.

See, for example, https://greaterthanknowledge.wordpress.com/2010/03/01/an-ins...

The book was published in 1979. It would be fun to hear of similar techniques used even earlier.

csl··on The Emularity
If anyone is interested, I just wrote a simple guide on how to get your own DOS programs up and running with em-dosbox: https://csl.name/post/em-dosbox/

Em-dosbox and emscripten are really amazing projects. An emulator is cross-compiled to JavaScript, which is then JITed in your browser's js VM. It's not only amazing that it works, but also that it runs pretty well (compared to native dosbox, it's only a little bit slower on some programs).

csl··on When you have to wake up earlier than usual
I had huge problems falling asleep for several years (10 years or so). Then I stopped reading in bed, avoided coffee after five and started to consistently go to bed before midnight. Now I regularly fall asleep within 20 minutes or sooner.

I'm just saying that for some people, you may want to first try out the general tips from sleep experts. Do that seriously for a good while (I think it took me several months). Then you can try more advanced stuff.

csl··on Std::string half of all allocations in the Chrome browser process
I guess the underlying problem is that C++ doesn't have a standardized ABI. So you get things like QStrings, etc.
csl··on Std::string half of all allocations in the Chrome browser process
It always depends on your needs.

Before you start avoiding std::string, note that the article said that one of the problems was that they went from std::string to C-strings and then allocated a new std::string. This often happens when you use both kind of strings in your code. The takeaway is to stick either to C strings or use std::strings with reference passing, dropping down to c_str() when needed.

csl··on Std::string half of all allocations in the Chrome browser process
The interface and behavior of std::string is standardized.

Library writers are free to implement it in any way that honors the standard. However, sometimes the requirements may lead to less than optimal implementations, I believe.

So as long as Chrome uses std::string for internal use only, there shouldn't be any problems. Using them across ABI boundaries, however, is another story.

csl··on Partial Evaluation and Immutable Servers
Well, the idea here is that with libraries in pure source form, a partial evaluator could be able to specialize and shrink down the program automatically, as you describe. So you'd get the best of both worlds.

I'm not aware of any systems that actually do this on a global level, but I have a feeling I may be surprised if I start looking around.

csl··on Every person with a Wikipedia article in a frequency graph by birth year
It would be interesting to plot the PageRank score of each person's page as well, showing their significance. I would expect a long tailed graph (as we filter only the very significant persons the farther back we go in time; less notable ones gradually pass into oblivion).
csl··on How Swift could potentially be faster than Objective-C
> I remember the days when C was just yet another systems programming language deemed too slow for any serious work.

I've heard that remark several times. Which languages were faster than C back then, except assembly? Fortran? Algol? BCPL?

csl··on Don't use assembly unless you're an expert
and then runs the function 1000 more times, measuring each run independently and reporting the average runtime at the end.

When it comes to measuring the performance of code like this, averaging run times is not the way to do it.

To remove the noise caused by context switching, just run the code many times and report the single fastest run you get. This should be the value closest to running the code on an OS without preemption (i.e. you want to measure how fast the code runs on the bare metal without interruption).

Even Facebook's Folly library [0] changed their benchmarking code from using statistics to just providing the fastest run. As the comments say:

    // Current state of the art: get the minimum. After some
    // experimentation, it seems taking the minimum is the best.
    
    return *min_element(begin, end);
This is explained in the docs [1]:

Benchmark timings are not a regular random variable that fluctuates around an average. Instead, the real time we're looking for is one to which there's a variety of additive noise (i.e. there is no noise that could actually shorten the benchmark time below its real value). In theory, taking an infinite amount of samples and keeping the minimum is the actual time that needs measuring.

[0]: https://github.com/facebook/folly/blob/master/folly/Benchmar...

[1]: https://github.com/facebook/folly/blob/master/folly/docs/Ben...

csl··on Learn C and build your own Lisp
I also did a scan of the book; it seems pretty good!

However, if you're serious about learning C then I strongly recommend getting the K&R book [0]. It's short and quickly gets down to business --- the first chapter alone gives you a condensed but working overview of the language as a whole.

Even experienced C programmers seem to keep the book around as it's good as a reference as well.

I strongly recommend people to learn C. It's a small, beautiful and very powerful language and the lingua franca for language ABIs. In fact, many popular dynamic languages are implemented in C (Python, Ruby, Lua and countless others).

Your time will be well spent!

[0]: http://en.wikipedia.org/wiki/The_C_Programming_Language

csl··on Inside the Billion-Dollar Hacker Club
As an aside, do anyone here still use IRC regularly? It seems some open source projects have permanent channels, but I don't know how active these are.

Haven't really used IRC since the mid-90s, but perhaps it's a good way to connect to other developers? Is there a representative YC channel?

csl··on Dogs are sensitive to small variations of the Earth's magnetic field
I wouldn't be so quick to call BS. They state in the abstract that it's not limited to dogs:

Several mammalian species spontaneously align their body axis with respect to the Earth's magnetic field (MF) lines in diverse behavioral contexts.

You can read more at https://en.wikipedia.org/wiki/Magnetoception --- though, this is not without issues:

The largest issue affecting verification of an animal magnetic sense is that despite more than 40 years of work on magnetoception there has yet to be an identification of a sensory receptor.

I remember having read about this effect in homing pigeons, and the Wikipedia article also mentions that:

These results suggest that magnetite located in the beak of pigeons may be responsible for magnetoreception via trigeminal mediation. However, it has not been shown that the magnetite located in the beak of pigeons is capable of responding to a magnetic field with the Earth’s strength. Therefore the receptor responsible for magnetosensitivity in homing pigeons has not been cemented.

Without being an expert, it seems to me to be worthwhile research.

csl··on Final draft of R7RS – small Scheme standard
Here's my hobbyist, incomplete implementation: https://github.com/cslarsen/mickey-scheme

There is also the much more robust Chibi Scheme that implements all of R7RS.

csl··on Major arcs for Goldbach's theorem
Can anyone in the know give an opinion on the claimed proof? I see Wikipedia has already been updated:

  Considerable work has been done on the weak Goldbach conjecture
  culminating in a 2013 claimed proof by Harald Helfgott.
Taken from http://en.wikipedia.org/wiki/Goldbachs_conjecture#Rigorous_r...

For the casual reader, there is a great novel by Apostolos Doxiadis based around Goldbach's conjecture: http://en.wikipedia.org/wiki/Uncle_Petros_and_Goldbach%27s_C...

(Doxiadis's "Logicomix" is also recommended)

csl··on Job hunting experience (and few advices)
No idea, but you can start here: http://www.norway.org/studywork/work/work/
csl··on Job hunting experience (and few advices)
I'm talking about occupational pensions, which I believe is in addition to the one given by state. I'd be happy to hear any comments on this.

The 40-hour work week is the norm --- it most definitely is not a lie. Of course, some high-end jobs, e.g., in finance, will naturally require more but usually pays more as well.

I can't comment on living expenses. If you come from the Bay Area, you'll probably find them low in most of Norway. I don't think taxes are particularly high, when comparing your whole economy. E.g., you don't need extra medical insurance, you don't need to save for your children's college tuition, etc. I pay around 30-40% on a decent pay.

But --- yes, it's not all bliss. But given the situation in large parts of Europe, Norway's strong economy and low unemployment, I'd recommend people to take a look.

csl··on Job hunting experience (and few advices)
For anyone willing to relocate, Norway is desperate for engineers and developers. Everybody gets 25 days vacation, near-free medical services, insurance and pension covered by employer, 40-hour working week being the norm, etc.
csl··on If I Made Another Monkey Island...
It's interesting that Ron Gilbert originally wanted to base SCUMM on Lisp: http://www.pagetable.com/?p=614

Of the few SCUMM script examples I've seen, I can't seem to understand what Gilbert means when he says: "It did things Lua could never dream of." The ability to control a C64 from a UNIX box? That actually sounds a lot like Naughty Dog's GOAL: https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp

csl··on A non-mathematical explanation of one way functions
If you liked this, you should really read the Wikipedia article on one-way functions, https://en.wikipedia.org/wiki/One_way_function

Some tidbits:

* "The existence of such one-way functions is still an open conjecture. In fact, their existence would prove that the complexity classes P and NP are not equal"

* "It is not sufficient to make a function 'lossy' (not one-to-one) to have a one-way function."

* "The existence of a one-way function implies the existence of many other useful concepts, including: [PRNGs, MACs, etc.]"

csl··on Chicken Scheme
One thing is the relatively large number of packages available for Chicken, especially for C libraries on UNIX. Therefore many use Chicken for systems and desktop programming on UNIX.

A list of packages (called "eggs") is available at http://wiki.call-cc.org/chicken-projects/egg-index-4.html

(Disclaimer: I don't know much about Gambit, and cannot comment on their respective implementation capabilities.)

csl··on Design Books Every Hacker Should Read
I've long wanted a good book that covers design principles in a way similar to how one would introduce a student to calculus, but for graphical design, layout and their interplay with typography.

Most books I've found so far are merely coffee table books: Pages of very nice illustrations, but weak on explaining the theory and principles of applying it to, e.g., a book, poster or website.

Does anybody know of such books? What do serious students of graphic design read? Is the book "Universal principles of design" a good fit?

csl··on Two Star Programming
Reminds me of the very funny description of a Three Star Programmer over at http://c2.com/cgi/wiki?ThreeStarProgrammer

EDIT: I see it's also linked in the article.

csl··on Two Billion Pixel Photo of Mount Everest (can you find the climbers?)
What kind of equipment was used to take this photo? It's pretty amazing!
csl··on Aaron Sorkin: Steve Jobs biopic to be in three acts, all in real time.
Agreed. My main worry is that he will artificially cram too much in those three, real time events.
csl··on Aaron Sorkin: Steve Jobs biopic to be in three acts, all in real time.
Aaron Sorkin is, no doubt, a genius himself. But this sounds more like a stage play rather than something that would work as a movie.
csl··on The island where people forget to die
Dan Buettner also held a presentation at TED in 2009 called "How to live to be 100+":

http://www.ted.com/talks/dan_buettner_how_to_live_to_be_100....

csl··on Dwm.vim : Tiled Window Management for Vim
I use iTerm2 on OS X with window splitting, with focus that follows mouse. Here is an example using several vim processes:

http://i.imgur.com/Xsh8f.png

Of course, you lose the ability to use vim copy buffers between the processes, but it works well and I like the look of it.

csl··on Show HN: Choose Photo. Make Ascii
A friendly note: The official homepage is at http://csl.sublevel3.org/jp2a/
csl··on I analyzed the chords to 1300 popular songs for patterns. This is what I found.
On a related note (corniest pun of the day), the Australian musical comedy act Axis of Awesome made a song called Four Chords Song, which is basically a 47-song medley all using the same chord progression.

http://en.wikipedia.org/wiki/The_Axis_of_Awesome#Four_Chords...

They've said that the chords are used by some of the most well known songs in the world, and their performance demonstrates this nicely, as in this clip:

http://www.youtube.com/watch?v=oOlDewpCfZQ

The above link is the official video; but they explain their reasoning better in this live performance:

http://www.youtube.com/watch?v=Z0IUdjMcEmo

← PreviousPage 4 of 6Next →