188 karma · joined February 1, 2014
Source: http://www.independent.co.uk/news/uk/politics/dont-control-e...
Besides, it takes about 10 minutes of walking to go a kilometer. You don't count paces, do you?
- 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.)
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)).
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.
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...
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).
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.
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).
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.
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.
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.
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)).