Readit News logoReadit News
gloria_mundi commented on Show HN: Outperforming VByte for Large Integers Using Phi-Encoding   github.com/DOSAYGO-Resear... · Posted by u/keepamovin
ForOldHack · a year ago
After you read about Ramanujan...

https://web.williams.edu/Mathematics/sjmiller/public_html/ma...

To be honest, I have a degree in math, and struggle to understand the extreme difficulty in assessing the density of primes.

gloria_mundi · a year ago
I haven't read all of that, but the problem at hand seems significantly less complicated.

We're mapping the numbers from 1 to 1000 to distinct numbers up to 8258, and the README claims that we should expect 2.1% of the resulting numbers to be prime. I see no reason for this claim, and as I understand it, the 2.1% comes from pi(1000) / 8258, which seems like nonsense to me.

gloria_mundi commented on Show HN: Outperforming VByte for Large Integers Using Phi-Encoding   github.com/DOSAYGO-Resear... · Posted by u/keepamovin
gloria_mundi · a year ago
I'm not sure I understand the prime density thing. Of the numbers up to 8258, about 12.5% are prime. Accounting for the fact that about a quarter of these primes ends in 101, i.e. cannot occur, I would expect about 10.7% = 12.5% * (3/4) / (7/8), which is fairly close to the observed 9.4%.

The 2.1% in the README seems to be the density of primes < 1000 among numbers up to 8258. That's not what was counted.

gloria_mundi commented on Functional languages should be so much better at mutation than they are   cohost.org/prophet/post/7... · Posted by u/injuly
dullcrisp · a year ago
I might have this wrong but I think if you want state and exceptions you probably want StateT (ExceptT e m a). The alternative would be to have state or exceptions, i.e. when you have an exception you no longer have state (which might be a legitimate type in some cases).
gloria_mundi · a year ago
Remember that transformers are "inside-out", i.e. `StateT (ExceptT e m) a` is isomorphic to `m (Except e (State a))`. If we want to keep state if an exception occurs, you need a `m (State (Except e a))` which is `ExceptT e (StateT m) a`.
gloria_mundi commented on Functional languages should be so much better at mutation than they are   cohost.org/prophet/post/7... · Posted by u/injuly
tome · a year ago
I'm not convinced about the dismissal of option 2. I agree ST is clunky but not for the reasons given. It's clunky because it's impossible to mix with other effects. What if I want ST and exceptions, for example, and I want the presence of both to be tracked in the type signature? ST can't do that. But my effect system, Bluefin, can. In fact it can mix not only state references and exceptions, but arbitrary other effects such as streams and IO.

* https://hackage.haskell.org/package/bluefin-0.0.2.0/docs/Blu...

* https://hackage.haskell.org/package/bluefin-0.0.6.0/docs/Blu...

gloria_mundi · a year ago
Isn't mixing of effects exactly what monad transformers are for? AFAICT you want an `ExceptT e ST` for some exception type `e`.

https://hackage.haskell.org/package/mtl-2.3.1/docs/Control-M...

gloria_mundi commented on Amber: Programming language compiled to Bash   amber-lang.com/... · Posted by u/weaksauce
cvrajeesh · a year ago
Is this a transpiler or compiler?
gloria_mundi · a year ago
Both, since a transpiler is a type of compiler.
gloria_mundi commented on Solving the minimum cut problem for undirected graphs   research.google/blog/solv... · Posted by u/Anon84
eutectic · a year ago
Also, the problem is to find a global min-cut, which requires all-pairs max flow.
gloria_mundi · a year ago
Not actually all-pairs max flow, you can fix the source and consider all possible sinks. In the AoC problem we also know that the min-cut is 3, so we can abort the flow algorithm as soon as we have found a 4-flow.
gloria_mundi commented on Show HN: Purl – A Simple Tool for Text Processing   github.com/catatsuy/purl... · Posted by u/catatsuy
hwbunny · a year ago
Question: can it preserve original colors and also highlight the given word? Like when you do an "apt search whatever | grep another", and it is formatted in a nice way, but grep just eats the colors...
gloria_mundi · a year ago
grep doesn't eat the colours, apt detects that it is not outputting to a TTY and suppresses the colours. Try `printf 'a \e[36mb\e[0m c\n' | grep a`, the colour is preserved just fine.

Some tools have an option to force coloured output regardless, e.g. GCC's `-fdiagnostics-color` or grep's own `--colour=always`, but apt doesn't seem to have anything like that.

In theory one could have a command in the style of nohup or stdbuf which sets up a PTY to trick the command into outputting colours. So one could run `fakepty apt search whatever | grep another` ...

gloria_mundi commented on British Placename Mapper   placenames.rtwilson.com/... · Posted by u/bookofjoe
gloria_mundi · a year ago
Recently came across something similar for Germany, although less versatile: https://dfiuhsfdfiu.neocities.org/
gloria_mundi commented on British Placename Mapper   placenames.rtwilson.com/... · Posted by u/bookofjoe
brnt · a year ago
Now I must know: how do Germans pronounce stracciatella?
gloria_mundi · a year ago
Some switch around the "s" and "sh" sounds, so it is pronounced roughly like "shtratsiatella". "st" at the beginning of a word is pronounced as "sht" in German.
gloria_mundi commented on Decimal Time   en.wikipedia.org/wiki/Dec... · Posted by u/danboarder
Lvl999Noob · 2 years ago
Iirc, there actually is one. 13 months, all with the same number of days plus one special day that is out of all months plus leap day every four years like usual (again, out of any single month)
gloria_mundi · 2 years ago

u/gloria_mundi

KarmaCake day36September 12, 2022View Original