HNHacker News
TopNewBestAskShowJobs

ralph

1,089 karma · joined March 1, 2007

Ralph Corderoy, https://plus.google.com/#115649437518703495227/about

C, Unix system and shell, Python, X Windows, ARM, ...

submissionscomments
ralph··on The $36 soda: Overdrafting in America
I think the UK is now like Canada; payments to the card issuer must now be offset against the dearest loan first.
ralph··on Google now tells you your IP when you ask it in search
Do you know of

    date -d @1262307721
ralph··on Google now tells you your IP when you ask it in search
True, but the OP asked explicitly for it and no one else seemed to answer that question.
ralph··on Google now tells you your IP when you ask it in search
One way:

    wget -Ufoo -qO- 'http://www.google.com/search?q=ip' |
    sed -n '/.*Your public IP address is [^0-9]*\([0-9.]*\).*/{s//\1/p;q;}'
ralph··on What is your favourite C programming trick?
Not a favourite, but one that isn't here so far...

!!foo to map 0→0 and everything else to 1. Always interesting to see if the compiler produces the best machine code for it.

ralph··on What is your favourite C programming trick?
Any pointers as to how to make this Ubuntu 10.10's malloc(3) never return NULL when asked for >0 bytes but instead abort?
ralph··on What is your favourite C programming trick?
Note, malloc(3) can return NULL if asked for zero bytes. calloc(3) similarly.
ralph··on What is your favourite C programming trick?
To avoid the duplication, with risk of mismatch, and to make it one less thing for the reader to check, I have

    #define NEW(a) ((a) = emalloc(sizeof(*(a)))) 
    NEW(foo);
Similarly with NEW0() and ecalloc(). Yes, the macro uses the parameter more than once, and yes it's another macro for the reader to grasp, but it's a simple one and NEW() is used so widely it's soon learnt.
ralph··on Unusual official Posterous blog post
Thanks John.
ralph··on Unusual official Posterous blog post
Rubbish. It was emailed to me by Posterous as I subscribe to the blog, so to lots of others too I'd have thought. I searched Twitter and found many tweets about the hack; the cat's already out of the bag. The View count on the article shows many have read it but I agree further constraint would be worthwhile. I attempted to contact them, it failed due to their error, and the method wouldn't have been urgent enough anyway. Knowing of their connection to news.yc I came here to raise the issue with a crowd that would be sympathetic and would likely know of a means of direct contact.

Though by all means up-vote my post. ;-)

ralph··on Unusual official Posterous blog post
I considered doing that, e.g. log into a gmail account, but help@ is unlikely to wake them up or alert them quickly, unfortunately. Could really do with a personal call to someone that works there.
ralph··on Unusual official Posterous blog post
I've tried to email help@posterous.com to ensure they know. Got an immediate SPF bounce.

"help@posterous.uservoice.com rejected a message that claimed an envelope sender address of ralph@[elided].

"help@posterous.uservoice.com received a message from getfile.posterous.com (184.106.20.101) that claimed an envelope sender address of ralph@[elided].

"However, the domain [elided] has declared using SPF that it does not send mail through getfile.posterous.com (184.106.20.101). That is why the message was rejected."

I'm happy with my SPF definitions; looks like an internal posterous problem. Can someone who knows the posterous mob give them a bell; they may appreciate the wake-up. :-) Thanks.

ralph··on Raspberry Pi demos $25 PC running 1080p video, promises CD-quality audio
It's not a question of money. They are a UK charity and their 50 alpha boards are out amongst those who can provide the most benefit to the project.

Get in line behind the rest of us. :-)

ralph··on Lessons learned from bountying bugs
I think I'm the bounty hunter that got $10 and $50 for two similar bugs. cperciva's summary is accurate in my case. WRT feeling respected, it wasn't an explicit need for me but implicitly it helps a lot that his replies had a few lines of explanation when it was a "no, not a bug" or a borderline decision on how big a bounty. Just as it would if I'd had made the report to a non-bounty FLOSS project.
ralph··on Peter Norvig on a 45-year-old article about a checkers-playing program
http://norvig.com/sciam/sciam.html preserves the indentation.
ralph··on What does $1265 of bugs look like?
I came across a comment on the CSS in the HTML of the site offering a bounty for the fix, realised I didn't know the answer, and pointed it out to a LUG friend of mine who I thought would. He did and got the sole $5 bounty. :-)
ralph··on What does $1265 of bugs look like?
I've spent a while looking for tarsnap bugs; to date I count 86 email threads with Colin to report my findings. There are a couple of things I think are pretty good about the scheme Colin has devised.

Unlike some other bounty schemes, there are small bounties available. One can look for ages without finding a $50 bounty, so long that boredom would probably set in and the hunt would be abandoned. But coming across the odd $1 or $5 bounty keeps interest going at small cost to Colin and still improves the overall source quality. It's almost like a bit of a game, a treasure hunt, where small pickings on route keep one's hopes up of rich pickings down the road. A game that can be set down and picked up later as time allows.

Secondly, Colin was very fair in judging the bounty to be awarded. It soon became apparent that I could trust his judgement; whenever I thought a bug was undervalued another would come along that might be overvalued. On mentioning this to him, it turns out it was sometimes deliberate; he'd be wavering and thought it fair to even out which side of the boundary the bug fell.

As for the OCD, I boggle a bit at some of those style bugs and don't think they were all me! :-) I do recall sending in some trivial thing suggesting it wasn't bountiful but perhaps should be fixed anyway; Colin generously still gave a dollar. I thought it worth reporting even without expecting a bounty because I think anything that interrupts the flow of the reader, causes them to pause, irked at a possessive "its" misspelt as "it's", detracts from the odds of them spotting something more serious.

Overall, a well crafted and executed bounty scheme. In some ways I'm surprised other companies don't do something similar, even if it was with closed source under an NDA. If the feedback is prompt then the bounty hunter can decide to stop if the bounties aren't awarded fairly enough in his opinion, or the company can cancel, perhaps having shelled out their budget or unhappy with the quality of the bugs, without the hunter having wasted much time since the last bounty.

ralph··on If PHP Were British
Programming languages created in England use "colour", e.g. BBC BASIC.

http://www.bbcbasic.co.uk/bbcbasic/manual/bbckey1.html#colou...

Yes, BBC as in British Broadcasting Corporation.

ralph··on Chmod -x chmod
GNU Parallel isn't needed to avoid this, using find's -print0 and xargs's -0 would suffice. The advert is unwarranted.
ralph··on Google URL shortener available to the public
What standard says <http://news.ycombinator.com/>? The appendix of http://www.ietf.org/rfc/rfc1738.txt says <URL:http://news.ycombinator.com/>.
ralph··on Why you should learn at least a little bit of Awk
This can be simplified. :-)

    awk 1
ralph··on What different sorting algorithms sound like
Why does the bubble sort continue to the end of the array on every pass, when it could stop one earlier each time?
ralph··on How to Write an Operating System
As well as being Unix backwards, it's also a recursive acronym; Xinu is not Unix.
ralph··on Strangest language feature
Base 26 or 36? Is 'a' 0 or 10? Does 's' overflow to the next column, like 09 in octal?
ralph··on Ask HN: Sorting massive text files?
You're correct. Perhaps the up-voters were thinking it must just be better to report the piping. Which it is, but that doesn't make the comment valid.
ralph··on Ask HN: Sorting massive text files?
GNU sort has a --compress-program option that can help if you're really tight on scratch space, e.g. lzop(1). The -T option or TMPDIR environment variable lets you state a filesystem with more free space can be used instead.
ralph··on Ask HN: Sorting massive text files?
If you're going to process this file a lot, and it's straightforward text, then consider compressing it with lzop(1). lzop's fast as compressing, and very fast at decompressing, and the overhead of having to decompress on every read through may well be much less than the time saved by waiting for disk.

    lzop -9v $file
    lzop -dc $file.lzo | sort ...
You shouldn't use cat(1) if you don't need to. You're removing the ability of wc(1) to do faster things than read(2) from a pipe, e.g. mmap(2) the file, which is probably what cat is doing.

Similarly don't use uniq(1) if sort's -u option will suffice as you're forcing 35GB of data to be written down a pipe to uniq(1) when it's quite possible that `sort -u' would produce 100MB or so.

ralph··on Ask HN: Sorting massive text files?
What do you and the original poster hope to achieve by

    ...| sort -g | uniq | sort -g
The second sort is doing nothing. And sort can do uniq, saving time and I/O.

    $ (seq 10; seq 5) | shuf | sort -gu | fmt
    1 2 3 4 5 6 7 8 9 10
    $
ralph··on Dear people-who-run-Twitter, whom to follow, whom
You test with "he" versus "him" in the reply to the question, not by replacing "who/whom" in the question itself. So the answer to "whom to follow" is "follow him", not "follow he".
ralph··on Dear people-who-run-Twitter, whom to follow, whom
Maybe Twitter should consider changing to "Whom to follow" as the quirkiness would stand out to those unfamiliar with "whom". May help partially offset the slight staidness.
← PreviousPage 12 of 26Next →