HNHacker News
TopNewBestAskShowJobs

adrianratnapala

3,270 karma · joined March 14, 2016

submissionscomments
adrianratnapala··on XXH3 – a new speed-optimized hash algorithm
Yes, although even here, small is not that very small:

> The main focus is about short keys of random lengths, with a distribution of length roughly in the 20-30 bytes area, featuring occasional outliers, both tiny and large.

I have been playing around trying to write interpreters and compilers for a hobby, and though I haven't taken stats, but I suspect that in source code, identifiers half that length are more than twice as common.

It make me wonder if compilers are better of using old-school byte-by-byte hashes rather than new ones optmised for parallelism. (Then again, the hash function probably makes no real difference to speed once in a real-world compiler that does optimisation).

adrianratnapala··on XXH3 – a new speed-optimized hash algorithm
So it took me a while to find the actual algorithm. As far as I can tell it is here:

https://github.com/Cyan4973/xxHash/blob/dev/xxh3.h

Is there a description of the algorithm, the C-source is not only highly optimised, it is also highly #ifdefed to take care of various scenarios. So the file is not optimised for readability.

adrianratnapala··on A world of hurt after GoDaddy, Apple, and Google misissue 1M certificates
Thank yous all for teaching me about Brown M&Ms.

https://www.snopes.com/fact-check/brown-out/

adrianratnapala··on Introduction to Memory Management (2018)
What needs filling in? It didn't have a heap. It's not like you really need one.
adrianratnapala··on Introduction to Memory Management (2018)
Probably the resource is older than 2018, and is taking aim shared_ptr (or maybe even auto_ptr?) rather than unique_ptr.
adrianratnapala··on Oldschool planar graphics and why they were a good idea
I am surprised the reasons for planes being to fit in odd bit sizes. Although I suppose that is a reason.

Planes are a nice abstraction, because they allow you to use the concept of a raster surface for all kinds of things. These things might be bits of colour, but they might be metadata in an image analysis program, or a masks in a graphics editing program, z-buffers for 3-d graphics, or really anything.

(Admittedly, I am talking about an abstract concept of "plane", whereas the original article is presumably talking about the concrete behaviour of hardware.)

adrianratnapala··on Model Explainability is The Next Data Science Superpower
So if I am understanding this story, some people found a correlation and mistook it for causation. An obvious no-no, albeit a easy trap to fall into. That's assuming what you were looking for was a handle on how you could get more or less of whatever it was you wanted.

But if you just wanted a diagnostic, then the data is telling you that the nitrogen content is (in practice) such a diagnostic. Depending on what you already knew, that might or might not be interesting or useful, but it is hardly nonsense.

adrianratnapala··on Model Explainability is The Next Data Science Superpower
Is this step one in re-inventing principle component analysis?
adrianratnapala··on How Anna Delvey Tricked New York’s Party People (2018)
> Take out the intelligence and skill, and you get Anna Delvey and Holmes.

You still need to add mendacity.

If Musk, Gates etc. had been less lucky, would they have turned to lie to try and manufacture luck? They probably did a little bit -- would they do it at a criminal level?

Some might have; it's a thing that some people do. But it is unfair on them to assume that they would have.

adrianratnapala··on Notepad++ drops code signing for its releases
This is true, but "worked" does mean it was secure by whatever we standard we consider good today.

That might be because we (at least on sites like this) are being overzealous about security. Or it might mean that in the modern environment, security is more of the concerns than in the halcyon days of MS-DOS.

adrianratnapala··on Firefox to add Tor Browser anti-fingerprinting technique called letterboxing
> Apps need it to determine where to place elements

Annoying apps which control the layout in JS instead of letting the browser do it will need it.

adrianratnapala··on On Tolstoy's “War and Peace”
Even this can be pretending to pretend.

That is, the censor is some bored middle-class beaurocrat rather than a true believer. So all you need is to give the him plausible deniability so he can turn around to his bosses and say "Hey, he redacted the name, how was I to know he was talking about your mother."

adrianratnapala··on HIV Is Reported Cured in a Second Patient
> For those stuck in the United States, the FDA will let you get Ocrelizumab, which is basically Rituximab tweaked enough so that Genentech could get patent protection for it.

So Rituximab was never approved by the FDA? I assume it too had once been under patent, and its manufacturer would have tried to get it approved.

adrianratnapala··on Ask HN: What made you change your mind about a programming language/paradigm?
That's exactly the path to hell.

You start using `shared_ptr` because you are too confused about the code to know which of the two "contexts" is supposed to own the thing. So shared_ptr (might) fix your memory freeing problem, but it maintains (and sometimes worsens) the problems caused by having two different contexts that might or might not be alive at any given time.

With two different threads however, such problems are often unremoveable, which is why shared_ptr is the right solution mitigation.

adrianratnapala··on Debian Buster will only be 54% reproducible, while we could be at 90%
You are probably talking about different kinds of representations.

hathawsh meant representation in the sense of memory layout and other low-level details of how application state is encoded. You seem to be talking about the programmer-visible abstractions built out of that layer. Behaviour at that level has to be predictable in order to "maintain correctness", but predictability at the lower level is mostly a help maintaining for the correctness of malware.

adrianratnapala··on Ask HN: What made you change your mind about a programming language/paradigm?
I don't miss, `shared_ptr`. It is a disaster for anything other sharing a thing between threads (in which case, it is a way of managing the disaster you already have).

Now `unique_ptr` is worth missing. And destructors are good too -- you couldn't have unique_ptr without them. But in it's own way, C has both: its just you just have to remember to call the destructor yourself, every single time.

adrianratnapala··on GNU Octave 5.1.0
> My experience with this is that it is not the necessarily the language that makes it too complex

It's not that the language makes the project complex. It's that the projects are by a bit more complex than the language is cut out for.

> but the lack of training in proper software development...

Assuming training scientists etc. in proper software development is a good use of their time (it might be); then MATLAB is a blocker because it makes it hard/ugly to implement "proper" techniques.

Again Python fits the bill here, because its a pretty good language for novices to hack around naively in, while scaling smoothly to projects 5-10 times more complex. So that the naïf has some headroom.

adrianratnapala··on Middle School Misfortunes Then and Now, One Teacher’s Take
> If the policy is that the student doesn't get the phone back at all, ...

That policy is commonly called stealing -- though it probably has a more specific label under law.

Schools traditionally have been implement civil-asset forfeiture for small stuff because people rarely kick up a fuss, and the schools can quietly hand things back when they do.

But if they start taking away people's smartphones there will be push-back.

adrianratnapala··on GNU Octave 5.1.0
I used Octave in Uni when my assignments had to be done in (commercial) MATLAB. I could get most of the code working at home, and then port. Matlab compatibility was the key benefit, even though the MATLAB language is a bit stupid.

And that was before numerical python existed. Now, MATLAB compatibility is about the only reason to use Octave. But a better idea is to get out of the MATLABiverse altogether.

As for reasons to use Matlab:

Matlab comes with XYZ toolkit: This isactually a good reason if you know that XYZ toolkit is your core business. In general though, the Python ecosystem is far bigger that Matlab's one.

Easy for scientist: Trap. Every MATLAB using scientist I know ends up with a code base that is too complex (~1000-5000 lines of code) for the language, but is perfect for Python. (Exactly like how programmers start projects with Python that then grow too big for that language).

Admittedly falling into the trap once might be cheaper than learning Python, assuming you never need to program anything again in your life.

Vector/matrix math: Numpy has all the same vector/matrix stuff including a class which does matrix-multiply under that '* ' operator like MATLAB. But that tMatlabhat operator is a trap: '.* ' is far more common in MATLAB code and accidentally using '* ' is a common bug. This is effortlessly avoided in Numpy standard classes.

adrianratnapala··on U.S. Supreme Court Puts Limits on Police Power to Seize Private Property
The state did prove that Timbs and committed the crime he was being fined for, the question at hand is whether the state can take away his car.

One reason might have been if it was the proceeds of drug-dealing. But that reason is not relevant since he could prove otherwise (let alone whether the burden of proof is/should be on him).

The other reason is simpler: States can fine people for stuff, but (according to the USSC) the fine can't be excessive.

adrianratnapala··on A faster, more efficient cryptocurrency
> Bitcoin doesn’t use energy, bitcoin is energy

Or a little more precisely a bitcoin is a provable record that a significant quantity of free energy was once turned into heat. So it does use energy, in the creation and once it is created, that energy is wasted unless the created also needed to heat something.

adrianratnapala··on We Must Revive Gopherspace (2017)
I started using the Internet at a time when HTTP traffic already exceeded Gopher+FTP traffic, but not by orders of magnitude.

I'd start nearly any session with Gopher, and it would end in either some web pages or an FTP server. Gopher was the go-to because it was organised unlike the rat's nest of links you had to deal with on the web.

This wasn't really fixed until the advent of big centralised search engines (and even then, the early ones weren't worth damn).

adrianratnapala··on Reddit Protests and China’s Control of American Culture
It would be a useful test-case. The rationale behind Citizens United type cases is that citizen's free speech rights can be exercised via corporations. But a foreign-owned corporation is a different kettle of fish.

It's a bit silly for people to keep railing on Citizens United in particular. That was a group of people made a movie knocking a particular politician. The 1st amendment gives them the right to do this and also to organise themselves to do this. But officials tried to stop them because the law limited such activity by organisations.

But there will be lots of real-world cases where the corporation is not a political ginger group. There, the free speech (and free assembly) case becomes much weaker. A fully foreign owned corporation being the most clear case.

adrianratnapala··on Two Large Chinese Borrowers Miss Bond Payments, Sources Say
No it they don't, because they make different predictions about incentives. Allowing the business to operate in bankruptcy cam, under certain conditions, give managers to incentives to drive the business into bankruptcy.

For better or for worse, that makes the incentives different from alternative systems.

adrianratnapala··on CPU Clocks and Clock Interrupts, and Their Effects on Schedulers (2015)
> Then, for the realtime program to run correctly, it would involve as well an understanding of all other processes/programs that are running at potentially the same time

Yes, and the best way to understand things is to keep them simple.

For example you can haveone real time thread which gets absolute priority and meets hard deadlines while everything else runs whenever the OS can find time for it. Then your only two rules are (1) don't let the real-time thread starve the others completely, and (2) don't rely on timing from anything except the real-time thread.

> OSs allow you to execute SW which will run with no interruption, as long as no other SW having the same or higher level of priority interferes?

Yep. Any OS meeting that definition is real-time. Probably you could get away with a looser definition, but getting it right would be a rabbit-hole.

adrianratnapala··on CPU Clocks and Clock Interrupts, and Their Effects on Schedulers (2015)
OSes and applications that get called real-time vary a lot.

But yes, when it is meant rigorously, you can definitely schedule a thing to run on exactly at particular times, preempting whatever lower priority thing was running before.

In my last embedded project that meant we had thing that got called every 64 microseconds -- and it was our job to ensure it finished in time for the next tick and also left enough CPU for all the other threads.

adrianratnapala··on California will not complete $77B high-speed rail project: governor
It seems like the opposite.

The Brexit vote question was: "Should the United Kingdom remain a member of the European Union or Leave the European Union".

For better or for worse, UK is set to leave the EU, and nothing extra will happen. In other words the question exactly matched the reality -- largely because of rather than in spite of its brevity.

Californian referenda are infamous for containing long confusing texts and for including spending promises. It is precisely by pretending to spell out the details that they fail to match the reality.

adrianratnapala··on PostgreSQL used fsync incorrectly for 20 years
When I call write(), it is typically already inside a bigger loop. If the system can't write my whole buffer right now, then I am happy to get the CPU back so I can do more work before trying again (and now I might have more data for it too).
adrianratnapala··on PKI for busy people
If you want to keep things simple, then surely it is better to keep silent than to say things that are wrong.
adrianratnapala··on Virtio-fs: shared file system for virtual machines
Is the use-case here really related to that of block storage?

I imagine a given pool of blocks is reserved for one of VM at a time. I wouldn't want to share the storage live between two VMs unless it was being accessed by some application specifically designed to hit a shared block store.

The point of something like virtio-fs would be to allow multiple VMs to share a file tree. It is a compromise between bind mounds (which are simpler, but only work for containers) and network filesystems (which work remotely, but are less efficient and well behaved).

← PreviousPage 4 of 34Next →