HNHacker News
TopNewBestAskShowJobs

pherq

188 karma · joined February 1, 2014

submissionscomments
pherq··on One year later
That's well within what they were making in donations per month prior to using Patreon, though. They already had the support, they just added another interface.
pherq··on New MacBook Pro Is Not a Laptop for Developers Anymore
No, it's just a property of ASCII that (ctrl [) = (0x9f & 0x5b) = 0x1b = esc.
pherq··on Why Theresa May’s secret speech really does matter
When asked to choose between immigration control and single market access, more people wanted to retain single market at the cost of immigration controls than the converse.

Source: http://www.independent.co.uk/news/uk/politics/dont-control-e...

pherq··on Tiny Lisp Computer
Scheme fits the common definition of a functional language, even if it's not pure in the same way as Haskell. Especially since idiomatic Scheme uses pure functions and recursion (as opposed to idiomatic CL which is a lot more imperative).
pherq··on Pokémon Go Is Teaching Americans the Metric System
A mile is no longer anything resembling 1000 paces, given that a standard imperial pace is 5 feet, rather than 5'3" and some change.

Besides, it takes about 10 minutes of walking to go a kilometer. You don't count paces, do you?

pherq··on Pokémon Go Is Teaching Americans the Metric System
It's slightly more confusing for young people over here -- we mostly deal in metric, but we still do have pints of beer (from the tap -- the bottles are 330 or 500 ml), miles, and we measure ourselves in feet, inches, and stone (although you do run in to people who use cm & kg, so that varies a bit)
pherq··on Spanish authorities raid Google offices over tax
It's part of an old joke (crops up in Yes Minister, may go back further): in Germany, everything is prohibited except that which is allowed; in the UK, everything is allowed except that which is prohibited; in Russia, everything is prohibited including that which is allowed, while in Italy everything is allowed especially that which is prohibited.
pherq··on Spanish authorities raid Google offices over tax
This entire (sub)thread was started about how companies shouldn't be the ones blamed because legislators make it sweet for them to do so, why should the legislators bought by the companies foot all of the blame?
pherq··on The Web We Want
HN works fine without javascript. The only change is that voting requires a page load. Most sites (especially ones that are basically just a bunch of text with junk around it) work fine without javascript, and it's easy to turn on for sites I want it on, so I have it turned off by default for sites I haven't visited, and if that causes them to just give a big expanse of blankness I usually leave.
pherq··on Ask HN: What's the best tool you used to use that doesn't exist anymore?
My fairly current ASUS notebook has that keyboard design, and I think it's fairly standard for their current 13" keyboards, at least.
pherq··on On the (Small) Number of Atoms in the Universe
Assuming you consider the dimensions/axes/whatever of the 2d space to be indexed by reals (which is conventional), then yes one can construct a bijection:

    - normalise x and y coordinates in the shape into the interval (0, 1)
    - interleave the bits of the normalised x and y coordinates
This gives a single real value in the interval (0, 1), which exists and is unique for every point in the space (so it is an injection), and it covers every real number in that interval (so it is a surjection).

This gives you a bijection between points in (a) 2-dimensional space and a segment of the real line (which, in turn, has a bijection with the whole real line if you want to specify that).

Once again, cardinality in set theory is based on injections and bijections. If there is an injection from X into Y, then Y is at least as big as X. If there is a bijection between them (i.e. injections in both directions), then they are the same size.

(Also, bijections are inherently bidirectional.)

pherq··on On the (Small) Number of Atoms in the Universe
The existence of a bijection between two sets is what "same size" means in set theory. Yes, there are non-prime integers, but you can establish a bijection between the two, so their cardinalities are equal (both have a cardinality of aleph zero).

The reals, on the other hand, cannot be placed in a bijection with the natural numbers, and there are therefore "more" reals than naturals (i.e. there is an injection from the naturals to the reals, but not from the reals to the naturals -- any function from reals to naturals must have some pair x ≠ y with f(x) = f(y)).

pherq··on The apt command: Combining apt-get and apt-cache and adds a progress bar (2014)
It also usually seems to be slower to start (at least in my experience) -- I tend to not like to use it except for resolving broken packages (since it's the nicest way to do that).
pherq··on The apt command: Combining apt-get and apt-cache and adds a progress bar (2014)
apt-get source works fine without super-user privileges, so it isn't just that some have to be run as root.
pherq··on Curl vs. Wget
On Debian these days, they provide an executable named apt that does all the common stuff in one place (install, search, list (mimicks dpkg), remove, show, etc.).
pherq··on Evidence that fish have feelings
Speaking as one, I don't avoid meat because I oppose in all cases the killing of animals for human consumption. I'm a pescetarian because I think the environmental impact of industrial agriculture, both in emissions and in land and water use, is unnecessarily large. Similarly, I try to mostly avoid milk for the most part, which a lot of vegetarians who wouldn't touch fish don't seem to have any objection to...
pherq··on The Evolution of a Haskell Programmer (2001)
With a decent compiler (I think GHC is up to the job, but I've not checked), stream fusion should ensure that the intermediate list never actually exists.
pherq··on The strange life of Q-tips, the most bizarre thing people buy
They're covered early on in Bad Science, the short answer is that they do nothing except put you at risk of burns from wax, etc. You can test this fairly easily by putting one above a dusty surface and noting that it wont disturbe the dust beneath it.
pherq··on Florida Court Deliberates Manual Recount Problems with Touchscreen Voting
Even without networking, you can usually break anonymity of electronic voting machines through Van Eck phreaking. This probably wont allow you to alter the votes, though.
pherq··on Show HN: Download any song without knowing its name
That has nothing to do with the bitrate -- the fact that you're getting a different unit on your 192 should be in an indication (bits or bits/frame, as opposed to kilobits/second).

CDs store audio as 16 bit samples, with 44100 samples per second. This gives a bitrate of 16 bits * 44100 Hz = 705600 bits/second (705.6 Kbps). This is per channel, so the total bitrate of the format is 1411.2 kbps, as stated (modulo rounding) by the GP.

EDIT: in fact, the article you link specifically says (a couple sections further down) that the bitrate is 1411.2 kbps.

pherq··on The Internet of Criminal Things
Better off in every way except for the whole choking in smog because you've essentially abolished emission regulations.
pherq··on How much of your audience is fake?
The link is http://www.gizmodo.co.uk/2015/09/ashley-madison-code-shows-m... (which doesn't exactly paint Ashley Madison in glowing terms, despite the number of bots being lower than originally thought).

While quite a lot more women used the service then the analyst initially thought, it is still true that AM did a lot to encourage men to pay them based on contact with fake accounts, and it apparently worked: http://www.gizmodo.co.uk/2015/09/one-chart-that-shows-how-mu...

pherq··on What happened to the noble art of the manly cry?
Just because you mention testosterone doesn't make your explanation scientific. Given that the article in question brings up that men not crying is a relatively recent thing, and seems to be largely cultural, assuming that it must be caused by testosterone (rather than just socialisation) seems unwarranted (and, given that it disagrees with observation, unscientific).
pherq··on Why is Smalltalk Dead?
The similarities between Ruby and Smalltalk basically consist of them sharing the notion that everything is an object, every operation is (or, in the case of Ruby, can be) a message sent to an object. Ruby has some control structures like if, while, etc. that Smalltalk didn't, however it's got the basics (blocks, methods, classes) that allow you to directly translate Smalltalk code into Ruby (it has things like if_true, if_false, etc. that were how you did conditionals in Smalltalk, even if the idiom would be to use the special if form).

Python doesn't quite fit as well, since it doesn't have arbitrary anonymous code blocks (lambdas are a bit limited), and classes aren't as open once they've been created (I think?).

The big difference is that Ruby is a language that runs on regular machines, calling out to C routines to interact with an external OS, whereas Smalltalk is an integrated language and OS that run together (similar to lisp on the lisp machines).

pherq··on The Unique Weapons of Ancient Japan
Assuming the sword attributed to him is actually a war sword (not a ceremonial one), and noting that he was apparently superhumanly strong and large...

As for the disappearance, I think it had more to do with improving firearms making heavy armoured shock troops impractical, and armies becoming much larger things mostly composed of musketeers with relatively limited training (rather than the smaller armies of very well trained professionals like landsknechtes). The pike disappears fairly soon after, when infantry switch to using bayonets to ward off cavalry.

pherq··on The Unique Weapons of Ancient Japan
Zweihanders/montantes/whatever you wish to call them were extremely effective and not nearly as heavy as you might think. In general, even the largest swords didn't weigh much more than about three kilograms (and thus were lighter than rifles and some polearms), and the hands were far enough apart that you had enough leverage to move quickly. If you poke around on youtube for people sparring with such weapons you'll see that they're as quick as most other swords (and have an advantage in reach).

On the article itself, while it's a nice list, it perpetuates some myths about the weapons in question (e.g. that katana was in someway superior to western swords -- high quality specimens on either side would probably be pretty closely matched), and has some fairly glaring admissions (e.g. the yari (Japanese spear) which was one of the most common weapons among footsoldiers for a good deal of Japan's history).

pherq··on What is PL research and how is it useful?
null IS a type which means "undefined/error to use this."

It causes runtime errors, rather than compile time ones. It also can move the place an error is detected to elsewhere (since passing null around and sticking it places works fine, right up until you try and use the value you expect), which can be a bit of a pain to trace back.

In the particular context of Java, null solves some of the problems of the language, like what happens when a constructor invokes a derived method which reaches up and accesses a not-yet-initialized variable in the superclass. I do think some of these problems could be solved in a different way, but it's not completely straightforward.

Disallowing method calls before all variables have been initialised in the constructor seems like a relatively simple mostly-fix. For any non-final values, it'd work fine to just set them to some explicit dummy value, and final variables should probably be explicitly assigned anyway. (I can't think of many cases where having computation implicitly operate on undefined values is a good thing...)

Also, to adwn: thanks -- I figured Rust probably did something like that, but haven't really played with it much and hadn't bothered to go check.

pherq··on What is PL research and how is it useful?
There's nothing stopping a compiler from implementing Option<T> as a possibly-null reference when T is a pointer type, which would give you the same efficiency as having nulls in the language while making unchecked usage easy to catch at compile time. (I don't know if any languages do this currently, but there's no reason it couldn't be done. It does turn Option into a special built-in type, but it's universal enough for that to be a decent idea.)

And it's not clear that variables should have values before assignment, beyond "undefined"/"error to use this" -- explicitly initialising a variable to some sentinel value is clearer and safer than relying on the default value being something in particular.

pherq··on How to name things in programming
Assuming basic knowledge of Haskell, there's not much between them (one function definition that takes all of two lines).

Both of them clearly show what the function is doing in an operational sense, but neither give any high-level indication of what the whole thing is for. They don't say whether this is part of the computation of a hash function, or a format conversion, or what have you -- that takes documentation and proper naming. These just tell you a way of turning one random list into another.

pherq··on How to name things in programming

   pairwise .
   reverse . map (+1) .
   flatten . replicate 2 .
   map (*3) $
   input
With all the functions being pretty standard (pairwise is my own name for subdivideListEtc, but it seems like a terse name that still explains what the operation is). Every fragment in this composition is smaller than the names you supplied, and all but one of them are standard Prelude functions that should be considered basic knowledge in Haskell. In addition, since the standard functions have parameters passed as values (rather than being part of the name like multiplyAllElementsByThree), this approach is easier to tinker with if one value was wrong (1 change, rather than 3 (name of function at definition, at use, and value in function definition)).
← PreviousPage 2 of 3Next →