Readit News logoReadit News
lgas commented on An Implementation of J (1992)   jsoftware.com/ioj/ioj.htm... · Posted by u/ofalkaed
elisbce · 15 hours ago
The more I see these languages that have neither power nor readability, the more I appreciate C.
lgas · 13 hours ago
I think almost everyone is with you on readability, but I think it would be hard to make the case that it lacks power.
lgas commented on If a Meta AI model can read a brain-wide signal, why wouldn't the brain?   1393.xyz/writing/if-a-met... · Posted by u/rdgthree
ggm · 14 hours ago
lgas · 14 hours ago
I'm not 100% sure I'd call that a hallucination, but it's close enough and interesting enough that I'm happy to stand corrected.
lgas commented on If a Meta AI model can read a brain-wide signal, why wouldn't the brain?   1393.xyz/writing/if-a-met... · Posted by u/rdgthree
furyofantares · 14 hours ago
Loss of consciousness seems equally unlikely.
lgas · 14 hours ago
True, though an easier mistake to make, I imagine.
lgas commented on If a Meta AI model can read a brain-wide signal, why wouldn't the brain?   1393.xyz/writing/if-a-met... · Posted by u/rdgthree
ggm · 15 hours ago
I believe in dead salmon, they do.
lgas · 15 hours ago
They cause hallucinations in dead salmon? I find that hard to believe.
lgas commented on Using Python for Scripting   hypirion.com/musings/use-... · Posted by u/birdculture
kstrauser · a day ago
You can always set shell=True and pass in an entire command line as a string, but… don’t do that. It seems really nice until the first time you get the shell escaping wrong, and then it’s something you tend never to do again.

For example,

  subprocess.run(“rm -rf ~/ some file”, shell=True)
and

  subprocess.run([“rm”, “-rf”,  “~/ some file”])
have significant different behavior.

lgas · 19 hours ago
What is the difference in behavior? They both look like they would delete the user's home directory. I assume the latter would try to delete a directory literally named with a tilde instead?
lgas commented on Using Python for Scripting   hypirion.com/musings/use-... · Posted by u/birdculture
mubou2 · 6 days ago
How do you handle packages? I want scripts to a be a single file with a shebang, not a repo with a requirements.txt that I need to run in a venv. To me, this is the biggest blocker to using Python for any non-trivial scripting (which is precisely the kind where I wouldn't want to use bash), but I'd like to know how others deal with it.

C# scripts let you reference packages in a comment at the top of the file, for example:

https://devblogs.microsoft.com/dotnet/announcing-dotnet-run-...

lgas · 20 hours ago
I don't have much need of this personally, but I was playing around with an example from earlier in the thread and ended up with this:

    #!/usr/bin/env -S uv run --with sh --script
    from sh import ifconfig
    print(ifconfig("en0"))
which is a pretty nice experience assuming you already have `uv` in the target environment.

lgas commented on PGlite – Embeddable Postgres   pglite.dev/... · Posted by u/dsego
guardian5x · 10 days ago
What is the advantage of using something like this instead of the IndexedDB Browser Feature
lgas · 10 days ago
You get all the features of postgres.
lgas commented on Hypothesis: Property-Based Testing for Python   hypothesis.readthedocs.io... · Posted by u/lwhsiao
eru · a month ago
And Hypothesis is miles ahead of QuickCheck in how it handles shrinking! Not only does it shrink automatically, it has no problem preserving invariants from generation in your shrinking; like only prime numbers or only strings that begin with a vowel etc.
lgas · a month ago
QuickCheck also shrinks automatically and preserves invariants though?
lgas commented on Hypothesis: Property-Based Testing for Python   hypothesis.readthedocs.io... · Posted by u/lwhsiao
wongarsu · a month ago
Imho it's just not a great example. A better example would be testing the invariants of the function. "For any list of numbers, my_sort does not throw an exception" is trivial to test. "For any list of numbers, in the list returned by my_sort the item at index n is smaller than the item at index n+1" would be another test. Those two probably capture the full specification of my_sort, and you don't need a sort function to test either. In a real-world example you would more likely be testing just some subset of the specification, those things that are easy to assert
lgas · a month ago
Always returning the empty list meets your spec.
lgas commented on How the cochlea computes (2024)   dissonances.blog/p/the-ea... · Posted by u/izhak
edbaskerville · a month ago
To summarize: the ear does not do a Fourier transform, but it does do a time-localized frequency-domain transform akin to wavelets (specifically, intermediate between wavelet and Gabor transforms). It does this because the sounds processed by the ear are often localized in time.

The article also describes a theory that human speech evolved to occupy an unoccupied space in frequency vs. envelope duration space. It makes no explicit connection between that fact and the type of transform the ear does—but one would suspect that the specific characteristics of the human cochlea might be tuned to human speech while still being able to process environmental and animal sounds sufficiently well.

A more complicated hypothesis off the top of my head: the location of human speech in frequency/envelope is a tradeoff between (1) occupying an unfilled niche in sound space; (2) optimal information density taking brain processing speed into account; and (3) evolutionary constraints on physiology of sound production and hearing.

lgas · a month ago
> It does this because the sounds processed by the ear are often localized in time.

What would it mean for a sound to not be localized in time?

u/lgas

KarmaCake day1863March 11, 2008
About
I like bacon.
View Original