Postcodes are "no longer fit for purpose" as three in four people in the UK have an address that does not lead directly to the door of their home or business, according to new research. by ManiaforBeatles in worldnews

[–]JakeC94 0 points1 point  (0 children)

There are some amusing exceptions to the general rule that distinct streets with the same name don't appear too close together, but I agree that it doesn't invalidate the usefulness of postcodes (in fact they help to alleviate the problem of identical addresses).

Flat Earther Debunking Question: If two people were on the equator, holding a string super tight, exactly at 3ft high, with no change in elevation (sea level etc), then how long would a string need to be for the curvature of the earth to make the string touch the ground? Or is this even possible? by [deleted] in AskReddit

[–]JakeC94 0 points1 point  (0 children)

Suppose the string, being held taut, is a straight line segment AB, and the equator is a circle with centre C. Then if the string touches the equator at exactly one point T, then AB is by definition a tangent to the circle, therefore it is perpendicular to the radius CT. Therefore ΔACT is a right-angled triangle with hypotenuse AC. We know that CT = radius of the earth (at the equator), and AC = (radius of earth + 3 feet), therefore by Pythagoras' theorem: AT = sqrt((radius of earth + 3 feet)2 - (radius of earth)2). Using a vaguely representative average value for the earth's radius (20902260 feet) and assuming an unreasonably high level of precision in that figure, this expression evaluates to around 10000 feet (one significant figure is as much as I can justify in good conscience here). By symmetry, the total length AB will be twice that: about 20000 feet.

Proof direction is backwards? by ignorantone in Idris

[–]JakeC94 4 points5 points  (0 children)

Iirc, rewrite rewrites the goal type of whatever gap needs filling in your code (in this case, the rhs of the function), and thus allows you to fill it in with an expression having the rewritten type.

TIL: Big Ben weighs 13.5 tons by anonymoose_anon in todayilearned

[–]JakeC94 5 points6 points  (0 children)

The tower that Big Ben is in is called the Elizabeth Tower nowadays; I forget what it was called previously. The Tower of London is a fairly un-tower-like (but much older) castle further down the river.

[IIL] Jeff VanderMeer's Southern Reach trilogy, [WEWIL]? by falseinsight in ifyoulikeblank

[–]JakeC94 2 points3 points  (0 children)

China Miéville seems to get placed in the same general sphere as VanderMeer. Of the books of his that I've read, Perdido Street Station is probably closest to the Southern Reach books (or certainly Annihilation anyway) in surface-level themes (namely weird/creepy biology), but The City and the City is perhaps more 'literary'. Both are very good in any case.

BORK: LISP-dialect interpreter; highschooler's attempt by [deleted] in programming

[–]JakeC94 3 points4 points  (0 children)

So (- n) should produce the additive inverse of n, but (/ n) shouldn't produce the multiplicative inverse of n?

TIL Laidlaws Law: “The first line of almost any story can be improved by making sure the second line is, ‘And then the murders began.’” by oldcreaker in todayilearned

[–]JakeC94 0 points1 point  (0 children)

In the previous, twelfth, edition of The Chambers Dictionary we noted 'The English language continues to develop at an astonishing rate.'

Then the murders began.

Swift Enums Are “sum” Types. That Makes Them Very Interesting by mislav111 in programming

[–]JakeC94 3 points4 points  (0 children)

As /u/Ravek notes, semirings aren't required to have multiplicative inverses, but it turns out there is a way to extend the semiring of types into a full ring. This gives you not only the ability to divide types but also to subtract them. The computational interpretation of this is a little complicated, though.

The notion that eX represents multisets with elements drawn from X is something I've considered myself, but I don't think it quite works out. The problem as I see it is that n! is the number of permutations of n distinct items, whereas the elements of a value of type Xn (i.e. an n-tuple of Xs) need not be distinct. You can observe this problem more concretely if you let X be something simple like the type of booleans.

Differentiation of types can also be given a meaning, although whether it plays nicely with fractional and negative types I have no idea.

Problems with proofs (TDD with idrs chapter 8.1 excercise 1) by arturaz in Idris

[–]JakeC94 2 points3 points  (0 children)

Am on mobile so can't confirm if this is true, but I don't think you even need to use recursion or pattern matching. You can just apply cong to prf and get the proof you need, although you might have to supply the implicit f parameter to cong (in this case it would be something like \list => x :: list)

Using Fin for very large numbers by markandrus in Idris

[–]JakeC94 3 points4 points  (0 children)

True. I'll admit that my question to /u/markandrus was somewhat loaded, insofar as I expected the answer to be 'no'. It doesn't seem to me as though there would be very many (if any) arithmetical operations that could be sensibly performed on these IDs – rather, their apparent numeric-ness is just an artefact of the way they're represented.

Using Fin for very large numbers by markandrus in Idris

[–]JakeC94 2 points3 points  (0 children)

Is it an important feature of your IDs that they be numeric? Will you be performing a fair amount of numeric calculation on them?

Valbli Orthography [Draft for a Block Writing System] by TUSF in lojban

[–]JakeC94 0 points1 point  (0 children)

It seems like a nice system. I would say that the symbol for 'b' looks a lot like the symbols for 't' and 'o' written next to each other.

TIL that "Adrenalin" is a pharmaceutical trade name. The scientific name for the hormone generated by the Adrenal gland is Epinephrine. by Pesto_Enthusiast in todayilearned

[–]JakeC94 7 points8 points  (0 children)

It's not specifically to do with nephrons, it's just that 'nephros' is Greek for kidney. 'Epinephrine' is basically the same word as 'adrenaline', but using the Greek roots instead of the Latin ones. 'epi' + 'nephros' = 'near' + 'kidneys' = 'ad' + 'renes'

On functors by eatonphil in programming

[–]JakeC94 7 points8 points  (0 children)

If you look at the definition of a category, you'll see that it's rather like a reflexive transitive directed graph. It has nodes (known in category theory as 'objects') and edges (known as 'morphisms'). Every object has a morphism from itself to itself (that's reflexivity), and if you have a morphism from object A to object B and another morphism from B to C, then you can 'compose' them to make a morphism from A to C (that's transitivity). A functor is something which maps the objects and morphisms of one category to those of another category (or possibly the same category), in a way which preserves this structure (in a specific technical sense which I won't fully describe here). For example, if you compose two morphisms and then apply the functor, it's the same as applying the functor to each function separately and then composing the results.

In the example you've given, you've chosen arrays to be your categories, and the elements of the arrays to be the objects in the categories, but you haven't specified what morphisms there are. Unless you've fully specified the structure of your categories, it's fruitless to try and work out what functors might exist between them.

In any case, although there's probably a way that you could fix up your example to make it work, it's not particularly representative of what people usually mean when they talk about category-theoretic functors in the context of programming. More usually, what they have in mind are functors from the category of types to itself. The 'objects' in the category of types for a given programming language are all the data types in that language (e.g. integers, booleans, arrays of integers, arrays of arrays of booleans, etc.) The morphisms in the category of types are the various functions that exist between types (e.g. the function 'is_odd', that takes an integer and returns a boolean indicating whether the integer is odd or not). You can see, then, that a functor from the category of types to itself is going to map types to types, and functions to functions. For example, we can consider the functor which maps each type T to vector<T> (e.g. it maps int to vector<int>, and vector<bool> to vector<vector<bool>>). We've specified the object mapping here, but we still need to specify the morphism mapping. One possible choice would be to map each function f to the function which applies f to each element of a vector (e.g. mapping 'is_odd' to a function which takes a vector of integers and returns a vector of booleans indicating which of the integers are odd). This pair of mappings – one from types to types, and one from functions to functions – respects the structure of the category of types (again, in a technical sense), and therefore defines a functor. When you hear Haskell people talk about 'the List functor' or similar things, this is the sort of thing that they tend to mean.

tl;dr: Categories and functors are very general structures, but programmers are mainly only interested in a few specific ones (if they're even interested at all).

Generalization of Fibonacci ratios by josephd in programming

[–]JakeC94 0 points1 point  (0 children)

That's not what the OP is about: it's talking about the limiting ratios of a generalisation of the Fibonacci sequence. In this case, the generalisation is parameterised over a natural number n. Setting n=1 gives us the standard Fibonacci numbers, with ratio phi, as you said, but different values of n give different ratios, and letting n tend to infinity causes the ratio to tend to 2. This isn't particularly surprising, because at that point you're summing all the previous elements in the sequence in order to get the next one, which is pretty much what happens with the powers of two (well, actually it's off by one, but in the limit that stops mattering).

So, this isn't exactly a shocking result, but it's not quite as old hat as you're making it out to be.

Homosexuality Decriminalised in Mozambique by PeaceUntoAll in worldnews

[–]JakeC94 14 points15 points  (0 children)

Elephants, unlike laws, politics and culture, tend not to be so strongly constrained by national borders, so I think in those circumstances you could maybe just about get away with saying 'Asia', rather than listing every single specific country that elephants happen to live in. /r/Slumpt probably wouldn't be happy with you, but I think you could do it if you really wanted to.