HNHacker News
TopNewBestAskShowJobs

jcsalterego

4,272 karma · joined April 27, 2009

submissionscomments
jcsalterego··on Duck duck go!
But, not Hacker News, so I'm flagging.
jcsalterego··on [dead]
What's a good unbiased plain English explanation for HR 3950?
jcsalterego··on Please review my web-based Emacs color theme generator
Which versions of Emacs will the generated configs work under? (Emacs vs XEmacs, etc?)

Thanks!

jcsalterego··on Tell HN : Wordpress.com exploit
Just curious, how long did you wait for a response before doing the whole full disclosure thing? :-\
jcsalterego··on What I Learned at SXSWi 2010
There's an Economist special feature on data which has other interesting facts about data generation:

http://www.economist.com/specialreports/displayStory.cfm?sto...

jcsalterego··on [dead]
Judging from the quality of the site, I parsed that as an overlooked typo of "patience."
jcsalterego··on Algorithms course material
To wit, I also had Jeff for algorithms a couple years ago and he is indeed a dedicated and passionate teacher. But thank you for your support, fellow HNers!
jcsalterego··on Algorithms course material
+1
jcsalterego··on How to be passionate (when you open your mouth)
There's a joke in the title somewhere.
jcsalterego··on Indie+Relief: App Purchases Today (1/20) = Donations to Haiti
Surprised this wasn't on HN earlier, or hopefully this isn't a dupe.
jcsalterego··on Don't give money [that's restricted] to Haiti
For me, MSF's draw has always been their great accountability, much lower overhead and coverage that extends beyond those 50/100/200-year natural disasters.
jcsalterego··on Amazon cloud accused of network slowdown
Go Cloudkick!
jcsalterego··on 768-bit RSA, now officially not enough
http://mathfail.com/2010/01/the-232-digit-number-rsa-768-has... has a good summary as well.
jcsalterego··on I am the Coin (Puzzle consisting of 20,000 custom minted coins)
The answer is in the script.
jcsalterego··on [dead]
Aren't we better than imgur.com on HN's front page? :/
jcsalterego··on Ask HN: How do you organize your code on your machine?
~/gh/ is where I throw all my GitHub clones.

~/svn/ is where I throw my SVN checkouts (sometimes google code stuff, but mainly just python trunk until it gets fully hg'd)

~/scratch/ is where I create subdirectories for my quick-and-dirty scripts, or if I need to `cat` something somewhere real quickly.

jcsalterego··on --All You Zombies--
A while back I read Michio Kaku's _Hyperspace_, which makes mention of this short story but not by name. Thanks!
jcsalterego··on The Capacitor Plague
That is some impressive variable-width ASCII art, I must say.
jcsalterego··on Microsoft Investigating Questions over MSN China joint venture’s Juku feature
Courtesy of jf: http://hackerne.ws/item?id=996118
jcsalterego··on Funding Clojure 2010
I am looking forward to seeing FC reach Clojure-donation-profitable :)
jcsalterego··on Funding Clojure 2010
No pressure, Flightcaster!
jcsalterego··on Zsh: The last shell you will ever need
@bashtips is pretty excellent as well.
jcsalterego··on MySQL Connector/Python
Go Team Python!
jcsalterego··on Computer scientists successfully boot one million Linux kernels as VMs
And none of their wifi drivers work.
jcsalterego··on Make Frontpage of Slashdot, Reddit, Hacker News == Google Disables AdSense
I'm curious to know why, on that page, there are three vertical AdSense banners.
jcsalterego··on Multi-Line Lambdas in Python Using the With Statement
Speaking of Sinatra and Python, have you seen http://github.com/breily/juno?
jcsalterego··on Zed Shaw on SF vs NYC
Why is this on HN's front page? :(
jcsalterego··on Music to Hack to: Nintendo Mixtape
Sorry, these tracks got nothin on "Weezer - The 8-bit Album."

http://www.ptesquad.com/more/pte018.html

jcsalterego··on My Engineyard Contest Odyssey
Unfortunately, I have no empirical data or to support that hard-coding in a payload has an advantage over a dynamic allocation. As an aside, the Python dictionary (hash table for you rubyists/perlfaces) works this way, as it over-resizes to allow growth, unless you specify its maximum size (__slots__ I think?)

My hope and understanding are that the compiler's static analysis skills will best align the given data, whereas something like malloc() would try to allocate on the heap as best it can with the open possibility of other data needing to be on the heap as well.

The point I was driving at, and what I tried to do, was to hard-code in as many known variables as possible such that the compiler could do its thing and try to be as efficient as it could with the given data. This includes the word list, the list of lengths, the target hash -- none of which has to be done by hand, but rather a higher-level script called before compilation.

Good times.

jcsalterego··on My Engineyard Contest Odyssey
Looking at the C code, here are a few suggestions:

- __builtin_popcount() and __builtin_popcountll() are great gcc builtins which perform bit population counts, useful for hamming distances (after the XOR operation, of course). [1]

- avoid scanf(), which is costly. My approach was to generate a header file with the char * words[] array, and also a int words_len[] with, you guessed it, the pre-computed lengths. Then go for the memcpy() route and you're in a much better position.

- speaking of memcpy, gcc provides one that should be optimal in most cases, but for really short words, it might be easiest to write your own. I came across a good article on it [2] but this is what I ended up using:

  void
  c_memcpy (char * dst, char * src, size_t len)
  {
    __builtin_prefetch(dst, 1, 3);
    while (len--) {
      *dst++ = *src++;
    }  
  }
[1] http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Other-Builtins.h...

[2] http://www.embedded.com/columns/technicalinsights/19205567

← PreviousPage 6 of 7Next →