HNHacker News
TopNewBestAskShowJobs

pyentropy

834 karma · joined May 18, 2019

submissionscomments
pyentropy··on Aaron Swartz Rememberance Day This Monday
I don't think it's attitude or philosophy. His death cannot just be attributed to his character, it's a complex issue.

The prosecution put a huge toll on him and he talks in his blog about his problems with mood and ulcerative colitis and his emotional and sensory issues.

http://www.newyorker.com/magazine/2013/03/11/requiem-for-a-d...

pyentropy··on Goodbye CSS Modules, Hello TailwindCSS
I honestly thought Tailwind is a sarcastic project mocking bad css class names until I found the Windi.css fork which has now inspired Tailwind JIT and it 'clicked'.

Writing class="<md:content-center sans font-normal hover:font-semibold pt-[7px]" and having a media query for phones, proper flexbox centering, font face and weight stuff autogenerated without copy pasting and googling snippets is amazing.

And you can reuse the same thing in any project without setting up imports and build steps and being constrained to a specific component framework. No selector specificity/namespace conflicts, just pure WYSIWYG.

pyentropy··on Printf(“%s %s”, dependency, injection)
Haven't touched Java 8+ in a bit, but I remember Function2, Function3, Function4<P,Q,R,S> etc when referring to a closure. Streams used a ton of specializations like ToDoubleBiFunction<P, Q> meaning (P p, Q q) -> double.

I wonder if such contracts are are solved now like in other languages with typed function references/pointers - C++/Go/etc (syntactic sugar is enough, doesn't have to be variadic generics). I remember 'var' was introduced so I suppose that worked if the closure type could be inferred.

pyentropy··on We've been lied to: JavaScript is fast
No, most of them require some interaction like a click or there's a dialog requesting access.

Here's a Web Bluetooth example: https://googlechrome.github.io/samples/web-bluetooth/device-...

pyentropy··on We've been lied to: JavaScript is fast
Electron apps are memory heavy and slow at interaction because Chromium loads a ton of rendering and Web API code into memory, and interactions triggered by keyboard/mouse/touch input go through layers of non native handlers so that event listeners behave uniformly across devices. It's all part of a complex rendering loop, and whether an element has a fixed position during scroll can affect memory and performance by hundreds of times compared to those 2x js-vs-native you mention.

Oh, and the Web API has has stuff you wouldn't expect like USB, Bluetooth, MIDI, vibration, TPM etc.

pyentropy··on Faster Python with Guido van Rossum
> They seem to invest a lot in JavaScript which is not what I’d call a performant language

JavaScript (V8 at least) is extremely performant, near native code performance. Considering how dynamic it is, it's not an easy feat but Google, Apple and Mozilla work a lot on it.

Here's a benchmark where JS is 50x faster than Python: https://github.com/kostya/benchmarks

Note that PyPy does much better.

pyentropy··on Things Go needs more than generics
The spec very clearly settles the issue:

1. A struct is a sequence of named elements, called fields, each of which has a name and a type.

    // An empty struct.
    struct {}

    // A struct with 6 fields.
    struct {
      x, y int
      u float32
      _ float32  // padding
      A *[]int
      F func()
    }
2. A type declaration binds an identifier, the type name, to a type.

The new type is called a defined type. It is different from any other type, including the type it is created from.

    type TreeNode struct {
       left, right *TreeNode
       value *Comparable
    }
--

type X struct {} is simply a type named X, of underlying type struct{} which (I'm refering to the struct here) cannot have a name - because it is an ordered sequence [(name, type), (name2, type2), ...], not a product type (X, [...]).

I don't know why you bring methods to this, as if methods are somehow connected to structs. In your reflection example: Name() returns:

(1) the name of a defined type (2) the empty string for all other cases

It is designed for all types, and is of no particular meaning to the struct type, more than it is to int64 or float64. Would you say "ints have names"? You can create a type with a name and/or methods having such underlying types too.

I don't wanna nitpick in any case - my point was structs are not an exception like OP mentions. The brace syntax is a composite literal, and maps, arrays, slices all use it. The latter just don't use it for creating zero valued objects, because they are dynamic and are nil valued.

Both declaring a value without a specific value (var john struct{} or var john X) or a literal (struct{}{} and X{}), seem concise to me. Unless we bring inference to the table:

    map[string]struct{age int}{"A": {15}, "B": {18}}
pyentropy··on Things Go needs more than generics
> In particular, there is no shortcut for the zero value for a struct value (not a pointer) — you have to specify the struct name followed by an empty set of braces

There's no such thing as a struct name. Structs are unnamed. The only way to have a zero valued struct... is, obviously, to instantiate it with its members as zero values. Exactly what struct{members}{} is.

`type X struct { age int }` just makes X refer to a particular type of a struct, but this also works:

var john = struct { age int } { 16 }

pyentropy··on The Martians of Budapest
> we don't share locus of genes that can be used to easily identify us as such

I'm one of the biggest critics when it comes to genetic reductionism, evopsych, etc and I know it's a touchy subject especially considering the terrible events that happened in WW2, and so on, but this is trivial to disprove.

https://en.wikipedia.org/wiki/Medical_genetics_of_Jews

> Due to their historical endogamy over the centuries, today's 10 million Ashkenazi Jews can trace their ancestry to members of a population of only 350 individuals who lived about 600–800 years ago

"Endogamy" meaning marrying (and having offspring) within a small isolationist group.

pyentropy··on Turing Oversold?
The average person has no clue what theoretical computer science is.

But science fields do need marketing. All children have heroes they look up to. Putting focus on Turing's achievements is merely creating a pop star figure in the mainstream, which I think is a good thing: a smart dude works on a problem that saves World War 2 and now powers your phone and your TikTok app. Once you are actually interested in the field you can work out the nuances and the falsehoods in that claim.

Evaluating earlier work in some field throughout history always leads to a complex graph of achievements, but you cannot put that graph in the name of an annual prize. Do we change "Turing Award" to "Frege-Cantor-Godel-Church-Turing"?

pyentropy··on Probability theory does not extend logic
The chicken develops a theory where "new day => new food" is a law, even though the reality is more nuanced. No matter the # of observations of the feeding event, there isn't enough information to make a law about its causality.

I have no idea what the chicken should do however :) Escape the farm and hope that Kate Middleton saves her?

pyentropy··on Probability theory does not extend logic
I'm still skimming through the article on my mobile, so I haven't read it all, but I think "the problem of induction" by Hume is the core of the dilemma.

Russel on the problem: The farmers' chicks get fed every day since birth. They infer that since tomorrow is a new day, food will be brought tomorrow. And that reasoning is indeed true: every time they wake up there's soy beans... Until one day the farmer wrings their necks.

pyentropy··on OpenMoji: Open-source emojis
Does Unicode provide an implementation/image of the spec?

I think each vendor has to make the design on their own.

pyentropy··on Improving the Hacker News Ranking Algorithm
Have you tested the behaviour of your algorithm on pagination and dynamics of link position over a day?

I assume the good thing about the snowball effect is that "making it to the frontpage" gives you guaranteed and pronounced exposure over a day or two - even though it's not maximizing the number of good links shown.

pyentropy··on MarkMonitor left 60k domains for the taking
No, S3 buckets named after hostnames are served when said hostname is pointing to S3 servers .

Bob owns bob.com and sets CNAME bob.com.us-east-1.amazonaws.com. Eve creates the bucket and can now serve any static content she wants.

pyentropy··on Google is killing the .apk format and it's a bad thing
The article doesn't say that sideloading will stop working, it's just that Play Store will completely switch to the format. This has to do more with the exponentially growing storage req of apps more than anything. Average user is gonna benefit a lot, especially since Bundles have a 150MB upper limit.

Android cannot afford being a walled garden like Apple and I don't see them limiting installations. As long as they get users into putting data into Google services, they'll let both OEMs and users customize anything in the platform.

pyentropy··on GitHub Copilot as open source code laundering?
That's what I wanted to ask, where do we draw the line of copyright when it comes to inputs of generative ML?

It's perfectly fine for me to develop programming skills by reading any code regardless of the license. When a corp snatches an employee from competitors, they get to keep their skills even if they signed an NDA and can't talk about what they worked on. On the other hand there's the no-compete agreement, where you can't. Good luck making a no-compete agreement with a neural network.

Even if someone feeds stolen or illegal data as an input dataset to gain advantage in ML, how do we even prove it if we're only given the trained model and it generalizes well?

pyentropy··on How to Think about Pleasure
VTA plays an important role in a number of processes, including [1]

- motivational salience ("want")

- associative learning (if a neutral/novel experience is paired with "painful" or "enjoyable" innate instinct, it elicits a response on its own: money or your favourite sports team winning)

- positively-valenced emotions ("happy", "content") emotions)

- orgasm

[1] https://en.wikipedia.org/wiki/Ventral_tegmental_area

Via the mesolimbic pathway, from VTA dopamine is signalled to the NAcc, which also has similar functions: processing of motivation, aversion, reward (i.e., incentive salience, pleasure, and positive reinforcement), and reinforcement learning.

As of October 2017, hedonic hotspots have been identified in subcompartments within the nucleus accumbens shell, ventral pallidum, parabrachial nucleus, orbitofrontal cortex (OFC), and insular cortex.

Microinjections of opioids, endocannabinoids, and orexin are capable of enhancing liking in these hotspots. [2]

https://en.wikipedia.org/wiki/Reward_system#Pleasure_centers

The second Wikipedia link explains the difference between primary and extrinsic reward, "wanting" vs "liking", anhedonia vs aversive salience, and the known information about addiction and neuroanatomy so far.

pyentropy··on The “self-made” myth: Why hard work isn’t enough to reach the top
The concept of "laziness" is bulls*t to me - humans have an innate drive to survive, learn & be curious about surroundings, plan and gather resources.

The only way to halt that is by experiencing something out of your control: bad parenting & trauma, burn-out, depression, ADHD. If someone wants to fix their "laziness" they gotta get help for those.

pyentropy··on What's Inside the EU Green Pass QR Code?
Alphanumeric mode (which is 45 symbols: [A-Z0-9] and nine special symbols) is the only QR mode that's reliably supported among all scanner library implementations (latin1 is part of the extended mode, Unicode & raw binary get detected with implementation-dependent heuristics).

The encoding is great, actually: 4n bytes will get encoded into 6n alnums (base45 symbols) which are 3n * 11 = 33n QR-bits. A loss of just 3% (33/32 - 1). This works because [ alnum1 alnum2 ] by spec must get packed into [ 11 bits ] in the QR message bitstream.

Wrote an explanation here: https://news.ycombinator.com/item?id=27592936

pyentropy··on What's Inside the EU Green Pass QR Code?
4 bytes get converted to 6 alnums and those gets packed into 3 * 11 = 33 "qr-bits" <=> [33/32 - 1] ~ 3% loss.
pyentropy··on What's Inside the EU Green Pass QR Code?
Regarding binary and QR: seems like the state of QR scanners is a cruel joke. There are multiple specs, of which only ISO 18004:2006 survived.

It says:

A QR code contains a mode indicator, character count and the bitstream encoding the characters. Modes are:

- numeric: 10 bits are used for [0-9]{3}

- alphanumeric: 11 bits are used for [0-9A-Z$%+-./:]{2}

- 8 bit Kana/JIS X 0201: (8 bits are used for every Japanese character)

- Kanji

- mixed mode (switching between multiple character sets in one stream)

- extended channel mode (ECI) - latin1, cyrillic, etc

https://www.swisseduc.ch/informatik/theoretische_informatik/...

Note that the document mentions that stuff like 'font size' is not specified in QR (?), while saying nothing about basic questions like 'what about non-printable characters'.

Then it got it got superseeded by 18004:2015. When a person asked on StackOverflow what's going on, the answer by the author of the most popular QR library (zxing) says "There is one (not obsolete) ISO spec for QR codes, ISO 18004:2006. Most of what you observe is just lack of compliance." - https://stackoverflow.com/questions/18699739/tools-for-qr-co...

Looking at other questions ("how do I store utf8"), it seems like scanners do some heuristics (scanning for BOM, valid unicode codepoints, etc), not even slightly conforming to the modes: https://stackoverflow.com/questions/51516612/choosing-a-char...

---

So, you can do base64 with ECI latin1, and risk the scanner performing some heuristic... or you can just take the alphanumeric route with 45 options (26 letters: [A-Z], 10 digits: [0-9] + 9 special characters), which is compact in terms of QR representation (not in terms of modern 8-64 bit words in memory!) and call it a day: https://tools.ietf.org/pdf/draft-faltstrom-base45-06.pdf

pyentropy··on Amazon suspends popular electronics manufacturer for buying reviews
What stops a company from buying fake reviews for their competitors listings?

Every time I read about businesses getting banned on FAANG listings due to SEO tricks, I get extremely concerned about the other side: how easy it is for a third party to get someone innocent banned.

pyentropy··on How I Learned Symmetric-Key Cryptanalysis
Just xor-ing a secret key that's as long as a message is guaranteed to be 100% safe, given that you don't reuse the key.

You can take a look at Shannon's perfect secrecy theorem and one time pads. Symmetric encryption is easy, safe and fast, but requires a pre-shared secret between the participants. And that's not an easy requirement: it can't be done over a public channel (because it can be intercepted), the secret should be very random (so that it can't be guessed), and we want forward secrecy (if someone manages to intercept and understand one secret message, it we don't want them to know everything discussed before).

Asymmetric crypto and dozens of other schemes are used to fix those shared secret issues, so that symmetric crypto can be used, since it's so good and fast! In fact, symmetric crypto is so good that even the most dangerous futuristic quantum computer for cracking RSA codes wouldn't be able to do anything.

pyentropy··on Machine Learning Deserves Better Than This
I've taken a look at a handful of CNN based models for COVID diagnosis via chest scans and I believe they are pure noise.

The convolutional layers often get activated nowhere near the actual chest, and they do not seem to grasp the anatomy in scans. The reason is, they were trained as pure "covid-not covid" detectors. Unless you have billions of real scans I don't think that's a good idea, which is why such models need some kind of an organ feature extractor first. Even trained humans suck at this task, and it's not because they miss details.

pyentropy··on Rust on the Frontend and Backend
Rust is a language whose selling point is safety so I don't see unsafe code appearing often no matter its popularity.

I do agree that it is divisive, but sometimes it also feels like humbleness of research programming languages (esp. Haskell) designers is a bit faked, which can have the opposite effect and scare beginners. The most popular languages, who beginners love, tend to have a history of being designed to be practical, not well designed or researched.

I have a tiny bit of Rust experience, and honestly if someone taught me Rust as a first programming language, I'd get so frustrated and insecure. Don't get me wrong, it's a beautiful language and the online book is great -- but it has a great barrier to entry and most people would get frustrated. Meanwhile, people following JS tutorials will already feel dopamine hit from getting their own programs running on screen and will be motivated to continue their journey.

pyentropy··on Rust on the Frontend and Backend
The wording may be harsh, but the idea is roughly correct. Learning Rust and fighting the borrow checker requires CS fundamentals knowledge.

However, that doesn't mean the person can write concise code or have good soft skills, or be a good hire.

pyentropy··on Show HN: CS Weapons – Counter-Strike weapon data comparison app
It's cool that you market it as material design and sharable and having a fancy stack... but all I care is whether I get useful info about CS:GO. The ugliest maps programmed for training are more useful imho.

The charts don't help me learn anything about the data more than the table, and the stats like RPM or deploy milliseconds mean nothing to me. If you ask CS players how they learn timing, it's usually mouse tapping a rhythm from some song.

The key takeaway is that you need creative ways to actually help me understand which weapon to pick in which situation.

pyentropy··on Content-aware image resizing in JavaScript
Worked well with the "Pale Blue Dot" by Voyager regardless of which sub-region containing the dot I uploaded.

Then, when uploading the Solar System, it managed to capture each planet and its label without distorting them while only removing the space in-between... except for Saturn's rings which became wobbly :)

Architecture pictures tends to perform horrible because they contain so many straight lines and perspective cues. Faces are too stretched regardless of aspect ratio.

pyentropy··on State Partitioning
If the SSO system is legacy and must use cookies, then to request access for cookies you need to call requestStorageAccess() in a frame hosted on the origin, which will open a prompt asking the user to allow such cookie access.
← PreviousPage 3 of 4Next →