Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
uryga
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
37 ms
·
301.
▲
by
uryga
7y ago
rust has `dyn FooTrait`, which lets you do dynamic diapatch, similarly to `FooInterface x = foo();` in e.g. java. even Haskell has a way of doing this via existential types like `(forall a. FooTypeclass a => a)`. both of these predominan
302.
▲
by
uryga
7y ago
yeah, i figured it out eventually. since you seem knowledgeable about K, would you mind taking a look at my second comment in this thread (about inverting permutations) and seeing if it makes sense? thanks!
303.
▲
by
uryga
7y ago
one cool explanation i found is that grading a permutation list effectively gives you its inverse: xs = "cab" <xs = [1,2,0] = { 0 → 1 1 → 2 2 → 0 } <<xs = [2,0,1] = { 0 → 2 1 → 0
304.
▲
by
uryga
7y ago
what is `<<` ("ordinal") supposed to be doing? i understand how `<` works, but how is it useful to apply it a second time? the closest i got to finding some pattern is this: >>> xs '34210' >&
305.
▲
by
uryga
7y ago
yeah, that side of the (in)equation was pretty obvious, i was mostly interested in the `{...}` one. i admit that a bytecode listing probably isn't the best exposition, i just like digging into VM stuff :)
306.
▲
by
uryga
7y ago
actually, only dict(d1, **d2) has that problem. it works fine if you unpack into a dict literal: >>> d1 = {1: 'a'} >>> d2 = {2: 'b'} >>> {**d1, **d2} {1: 'a', 2: 
307.
▲
by
uryga
7y ago
how on earth is this gatekeeping? GP said nothing like "imperative programming isn't true programming and deserves to be looked down upon" or w/e, they just expressed a personal preference for FP. ("I hope functiona
308.
▲
by
uryga
7y ago
could you explain "analytics are the dual of forms" a bit? sounds intriguing!
309.
▲
by
uryga
7y ago
whoops, that last code block was supposed to have rm = (an-2•an-1•an) instead of the commas.
310.
▲
by
uryga
7y ago
that's beautiful! thank you for the link
311.
▲
by
uryga
7y ago
it's not exactly order independence, it's associativity: (a • b) • c == a • (b • c) i.e. "no matter where you put the parentheses, it'll give the same result". this DOESN'T mean that a • b == b • a
312.
▲
by
uryga
7y ago
it's never really been a problem for me, i just select the block and tab or shift+tab it as needed. honestly i'd be doing the same in C or whatever braces-based language
313.
▲
by
uryga
7y ago
what python issues do you have in mind? the linguistic gotchas i can name off the top of my head are: - the way mutable default arguments are handled - the weird behavior of closures referencing loop variables - leaking variables out of if&
314.
▲
by
uryga
7y ago
> I wonder if any of these have four or more simple characters jammed into one. yup! https://en.m.wikipedia.org/wiki/Radical_(Chinese_characters) > For example, the radical 女 appears on the left side in the char
315.
▲
by
uryga
7y ago
> I don't know how I'd pick just one! picking one up to unique isomorphism should be good enough ;)
316.
▲
by
uryga
7y ago
> geometric algebra just has division do you have a good reference for this? i've looked into GA bit but don't remember seeing anything like this. e.g. what would dividing a bivector by a vector mean?
317.
▲
by
uryga
7y ago
clicked the link expecting a rant about Adobe, but it looks "Garbage" is just how someone rated PS's performance under Wine...
318.
▲
by
uryga
7y ago
(edit: clarity) i couldn't really find any docs about it either, but compiler.scm is pretty readable and has an instruction listing – their arguments aren't documented explicitly, but you can infer most of it from the code for `
319.
▲
by
uryga
7y ago
k (well, some version of it) has something along those lines: > [the] `:` in `|:` is used to force the verb `|` to be interpreted as a monad, as by default ambiguities are resolved in favour of dyads. http://www.math.bas.bg&
320.
▲
by
uryga
7y ago
> [Java 8 and C++11 lambdas] are essentially syntax sugar for an ad-hoc function that's what a lambda is pretty much anywhere, FP or not :) > [in FP] you're supposed to be doing absolutely everything with lambdas even additi
321.
▲
by
uryga
7y ago
...which, btw, is equivalent to Maybe/Either – they're tagged unions, i.e. pairs (tag, content). Maybe<T> is isomorphic* to { has_value: bool, val: T|nil } * well, this representation is a bit too permissive, si
322.
▲
by
uryga
7y ago
in principle you could always write one-liners like this with lambdas or list comprehensions by translating let x = <val> in <expr> into this: (lambda x: <expr>)(<val>) (as the lambda calculus does) or
323.
▲
by
uryga
7y ago
not gp, but wouldn't that "don't show again" checkbox they mentioned fix this problem?
324.
▲
by
uryga
7y ago
maybe there should be two keybindings for mousing-over and clicking, i'd say hovering is relatively rare in comparison
325.
▲
by
uryga
7y ago
when a permissions popup appears, click "More details" -> "Change when these notifications appear", then take the slider down one step, to "Notify me [...] (do not dim my desktop)". that's on Windows 10
326.
▲
by
uryga
7y ago
my english is fine, thanks. my point was: splicing the expansion of "DUI" into a sentence will often make it ungrammatical, but that doesn't matter, because the acronym functions as a separate thing. analogously, expanding &q
327.
▲
by
uryga
7y ago
> Does mypy have type guards? not yet, maybe in the future. might be possible to emulate some use cases with Literal Types. tracking issue: https://github.com/python/mypy/issues/5206
328.
▲
by
uryga
7y ago
hm. "An APL" sounds fine to me! i'd say that, grammatically, "APL" (and other acronyms) become independent from their expansions. e.g. would you say that expressions like "the FBI's policy" or "m
329.
▲
by
uryga
7y ago
i always pronounced it as "see-out", since i figured the "c" refers to, well, C. seems in line with cout's docs which mention "the standard C output stream `stdout`"
330.
▲
by
uryga
7y ago
> If you ever experience a new auditory environment like a factory floor or hospital, you will keep hearing sounds from that environment for a few days if exposed to white noise. i've also experienced this when a song got stuck in m
More ›