Recent submissions

Comment · 9 years ago
Dead link
Comment · 11 years ago
Comment · 12 years ago
My ISP is seemingly blocking that site. I can access it from my DO VPS, though.
Comment · 12 years ago
NB a tuple of one item only requires a trailing comma, and a tuple of zero items is represented as ()
Comment · 12 years ago
I don't mean to be pedantic, but a list (I am assuming df is a list) requires an int.

(That sentence I wrote about using hashable types need not apply, sorry!)

If you ran that code, you would get this error:

    TypeError: list indices must be integers, not list
Comment · 12 years ago

    alist = [foo(word) for word in words if word.startswith('a')]
    alist = map(foo, filter(lambda word: word.startswith('a'), words))
Which reads better?
Comment · 12 years ago
Afaik Apple's switching power supplies support the specifications you described (for example, see Mac Mini's tech specs https://www.apple.com/mac-mini/specs.html -- 50-60Hz 100-240v AC).

Not to mention Apple sells region-specialized units just like every other major computer retailer.

Comment · 12 years ago
Anybody have a link to the document? It's behind a paywall?
Comment · 12 years ago
Any internet website can be attacked this same way.
Comment · 12 years ago
>Your Python code is just wrong.

Could you elaborate? I want to understand how to fix it.

EDIT: I really want to know what is wrong with my code. It works. Is it a stylistic concern?

    $ dd bs=1m count=10 if=/dev/random of=randomdata
    10+0 records in
    10+0 records out
    10485760 bytes transferred in 0.878533 secs (11935535 bytes/sec)
    $ python stdin_to_stdout.py < randomdata | cmp - randomdata
    $ echo $?
    0
EDIT2: I think I know how you came to the conclusion my code is wrong. Perhaps next time you should read the __entire__ post. Thank you.
Comment · 12 years ago
That mangles binary data.

    $ printf 'binarydata'|awk '{ print }'|hexdump -C
    00000000  62 69 6e 61 72 79 64 61  74 61 0a                 |binarydata.|
    0000000b
Comment · 12 years ago
Comment · 12 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton