HNHacker News
TopNewBestAskShowJobs

zgs

135 karma · joined May 29, 2020

submissionscomments
zgs··on “WarOnFakes” satellite image claims debunked
Personally, I have little doubt that there is misinformation coming from both sides. My local media is only demonising one side of the conflict which makes for a good narrative but seems unlikely. This definitely doesn't make either side innocent, nor does it mean that one side is solely responsible for all of the war crimes.

I absolutely do not condone what is happening, I believe that we'll need 15-20 years before the truth starts coming out. Plus a lot more time after that to even have a chance of seeing what really happened.

zgs··on rand() may call malloc()
Remove malloc from your libc and catch this entire family of problems at link time.
zgs··on The SHA-256 Project: learn how hash functions work by implementing one yourself
and brokenness :)
zgs··on The SHA-256 Project: learn how hash functions work by implementing one yourself
The skills needed to write good crypto are different to those needed to use it. There is some overlap of course, but less than is implicated here.

Probably the best advice for using crypto is to use algorithms for what they were intended. Which will require some reading and the materials aren't as accessible as they ought to be.

zgs··on Ask HN: What It the Main Difference Between HTTP and SSH?
They are completely different and are meant for very different things...
zgs··on NATO estimates up to 40k Russian troops have been captured, injured or killed
NATO has a vested interest in increasing the number of casualties. Russia has a vested interest in decreasing the number of casualties.

We will only know the truth years after the event (if ever).

zgs··on Gas pumps happen to be about as insecure as your typical router
I used to work for a company that made VPN routers for one of the largest pump producers. I wasn't aware of any vulnerabilities in our part of the solution. Which doesn't mean there weren't any of course.

Still there is a lot more there than a VPN router. Lots of software and likely plenty of bugs.

zgs··on [dead]
He a delusional media whore.

He'd need to buy the Ukraine before he could offer it up as a prize. This isn't going to happen

I'd give him maybe sixty to ninety seconds against Putin before he was dead -- you don't get a 6th dan in Judo without lots of skill.

zgs··on Buffet – An All-inclusive Buffer for C
The first thing that stuck me was distinguishing the `SSO' part of the union from the rest. It requires the `ssolen' field to align to the later `type' field which isn't guaranteed.

There might also be issues with the `data' field if padding gets introduced.

Having the `type' field (as a uint8_t or char) first would solve this but loses some bits of storage. The other option would be making the type an array of char and bit bashing everything (and memcpy(2) multibyte fields since unaligned accesses aren't universal).

zgs··on Buffet – An All-inclusive Buffer for C
The implementation isn't endian friendly :(
zgs··on Buffet – An All-inclusive Buffer for C
I remember seeing a paper that concluded the expansion should not be more than the golden ratio (ϕ = 1.618033988749). Given how widespread the golden ratio, I'd hypothesise that it's probably optimal.

The first three fractions approximating ϕ are: 3/2, 8/5 and 21/13. The first two are quick and easy to compute.

zgs··on Wordle is pretty damn smart in many subtle ways
Wordle is a spam engine. The game isn't that difficult -- it's been solved by several folks and it can always be won. The "share" button is the spam engine.

If you play to enjoy it and don't press "share", well done. If you press "share", be ready to burn in the level of hell reserved for spammers.

Fortunately, the NYT will screw this up and try to monetise it which will destroy its popularity in a short time.

zgs··on Dutch antitrust authority fines Apple for fifth time
Until the fine is based on percentage of revenue or something that hurts the company, it will be ignored.

Trivial amounts like this are irrelevant to a company as large as Apple. They are just a cost of doing business.

zgs··on Computers Built to Last
The HP 35 calculator was introduced in 1972. The early models aren't quite fifty years old yet, but will be later this year. Many (most?) of these still work just fine from the mains adaptor or once you replace the batteries.
zgs··on Implementing RSA in Python from Scratch
Do *not* implement your own cryptography. There are a lot of nuances.

This is a very dangerous article. The basic RSA algorithm is quite simple to implement, although the most difficult part isn't done in this article -- multi-precision multiplication is the difficult part in my experience.

However, using this implementation cryptographically is very bad. A cryptographically good implementation needs to consider a lot more than just the basic algorithm. Is the implementation constant time? Does it including blinding? How is it padded? These are just the basics, they are plenty more subtleties. Then people want it fast.

RSA should not be used to encrypt plaintext. Simplistically: symmetric cryptographic algorithms are first used and then RSA is used to encrypt the key.

zgs··on Ask HN: Many became preppers in 2021 are You ready to become a Stacker in 2022?
After society collapses, how much will silver be worth? It's not useful for a lot apart from decoration. Food, clean water sources, construction metals, tools, etc will be far more useful.
zgs··on Ask HN: What is your open source dream job?
The one I've got I suspect :)
zgs··on Ask HN: Did you find something to use your Raspberry Pi 400 for?
Video conferencing.
zgs··on Ergonomics of the Symbolics Lisp Machine (2014)
No mention of Smalltalk that did something quite similar a little earlier.
zgs··on Signed integers are asymmetrical
Nothing to see here, move along.

2's complement is negative biassed. 1's complement (unmentioned in the article) is zero biassed.

Neither surprise me.

Seriously, who cares? Very few of us. I'm one but this isn't a problem for almost everyone else.

zgs··on Code quality: a concern for businesses, bottom lines, and empathetic programmers
Over the years I've worked in many different places both small and huge -- only two considered code quality as even remotely important. One being an open source project and the other was very heavily involved in open source.

All commercial code of any reasonable size that I've seen has been dreadful. Complex interdependencies, little regard for consistency and way too much legacy laying around to surprise the programmers.

I no longer believe that any closed source code can be expected to execute properly.

zgs··on Generating relocatable code for ARM processors
I solved this problem in a more general way for no-MMU uClinux on the m68k/ColdFire processors back in the early 2Ks.
zgs··on C++ is faster and safer than Rust (2020)
Assembly is faster and safer than rust. Rust is a fad it will fad.
zgs··on Ask HN: What's the best (most secure) cloud data storage service?
Encrypt at your end using modern strong algorithms, then it doesn't matter when the data are stolen.

The data will be stolen, that's guaranteed.

zgs··on Ask HN: Can you picture things in your mind?
I couldn't see it. I could describe a dog.
zgs··on Are there flaws in some ARM64 instructions?
A difference between the fused instruction and the two separate ones is expected. The fused instruction is designed to avoid a rounding step between the multiplication and add.

The article makes no mention if the fused instruction is producing incorrect results or just different results. That is the critical question.

zgs··on Probation Period: A Blessing or a Curse for Programmers?
I've never had any objection to a probation period. However, I'd never enter one that was asymmetric or with reduced pay.
zgs··on The most copied StackOverflow snippet of all time is flawed (2019)
The proposed solution is crazy. Logarithms are extremely expensive to compute. No way is this code more efficient than the loop it "replaced".

That there then are numeric stability issues and a pretty gross fudge factor is used to fix them worsens the situation. I would have a quiet word with any programmer I worked with that came up with this "solution".

zgs··on Write a C program that outputs a large number: A contest from 2001 [video]
Seriously, a waste of time_t:

#include <time.h>

#include <stdio.h>

int main(int argc, char *argv[]) {

    while (time(NULL) > 0)

        putchar('9');

    putchar('\n');

 

    return 0;

}
zgs··on Doom: An irrational number that is finite and conditionally constant
Irrational numbers cannot be finite almost by definition.
← PreviousPage 4 of 5Next →