HNHacker News
TopNewBestAskShowJobs

branko_d

2,241 karma · joined May 2, 2017

submissionscomments
branko_d··on Oracle engineers caused five days software outage at U.S. hospitals
Haven’t worked with Oracle in over a decade, but SQL Server’s tooling is actually quite decent in that regard. You can attach the Visual Studio debugger to a T-SQL stored procedure, set breakpoints, step, inspect variables etc. There are rough edges, but it’s good enough to be useful.

Automated tests of T-SQL stored procedures are also possible. There are couple of ways you could do that, but in our case we just write “unit” tests in C# which call the procedures. This integrates nicely into Visual Studio’s Test Explorer, is debuggable etc. You can even step through a C# test, and then just “step into” T-SQL being called from there!

There are valid reasons for not putting business logic into stored procedures, but “not being a proper language” is probably not one of them, at least in the case of T-SQL. Then again, there are also reasons for using stored procedures. Everything is a tradeoff…

branko_d··on Oracle engineers caused five days software outage at U.S. hospitals
Under SQL Server’s SNAPSHOT transaction isolation level, writers don’t block readers. We use it in production with good results.

While the internal implementation details differ from Oracle, the end result seems quite similar in practice.

branko_d··on Virginia passes law to enforce maximum vehicle speeds for repeat speeders
> It's not about cars but speeding in cars.

That's like saying "it's not about guns but killing by guns".

If we could only identify those pesky people that will kill with their guns before they do it, we could solve our problem! Just as if we could separate out only the drivers that will crash before they actually do it.

Alas, while you can probably speed many times without serious consequences, shooting someone without serious consequences is far rarer! This means we at least have a chance to catch the repeated speeders before they do irreparable harm, but we rarely have the same luxury with shooters.

branko_d··on Virginia passes law to enforce maximum vehicle speeds for repeat speeders
Gun deaths: 46,000 Car deaths: 40,901

Gun utility: small Car utility: large

(data from CDC and NHTSA for 2023)

branko_d··on Circuit breaker triggered in Japan for stock futures trading
> I'd guess Ukraine falls within months at most

That's a bad guess. Ukraine has destroyed ~4000 Russian main battle tanks, a 3rd of the Black Sea fleet and many more thousands of pieces of equipment so far. They have proven how effective they can be defending their country. US cutting their support would be a big blow, no doubt, but Ukrainians can stay in this fight for a long, long time just with the EU support.

branko_d··on A university president makes a case against cowardice
> Everything we have, everything we're permitted to do, is at the pleasure and permission of our governments.

Wrong! The people are ultimately responsible for reigning-in their governments and are the ultimate source of any rules or rights that the governments end up enforcing.

If you think that the ultimate authority is with the government, then you have justified every authoritarian regime out there.

branko_d··on BYD sales soar as Tesla continues to struggle in Europe
> Chinese no-names

Sorry, but that's just short sighted. Did you actually sit in a Chinese car, or at least seen any with your own eyes? I can tell you that ZEEKR, Changan, Exeed, Li Auto, BYD, Jac and others are well known and well respected in certain markets. In our harsh and cold climate, Chinese brands don't seem to be any less reliable than the Japanese, Korean and European brands that were historically used here.

branko_d··on Show HN: Nue – Apps lighter than a React button
We built a document management system as React SPA which is very performant.

Key: when user clicks on something, this causes 0 to 1 HTTP requests.

We didn’t do lazy loading or caching either.

branko_d··on Show HN: Nue – Apps lighter than a React button
What is truly remarkable about it is that it’s just JavaScript (after some transpilation), which means you can easily use JavaScript’s control structures. Conditional rendering has never been so easy!
branko_d··on Show HN: Nue – Apps lighter than a React button
> Also, React is a nightmare.

I think React is a “nightmare” in similar way that JavaScript is a ”nightmare” - it certainly can be, if you abuse it, and it makes it a little too easy to do so.

However, you can take “just the good parts” and ignore the rest. For me, that means using React as a rendering library and managing state almost entirely outside of it.

branko_d··on Show HN: Nue – Apps lighter than a React button
> Networks are fast.

Well, it depends on what you mean by “fast”: bandwidth or latency? While the bandwidth has improved enormously over the years, latency… not so much. And it never will due to the simple fact that the speed of light is limited.

Most of the slowness seems to come about by treating latency as something that doesn’t matter (because the testing is done on a local, low-latency network) or will improve radically over time because bandwidth did (which it will not).

Unfortunately, React wants to be both a rendering library and also manage state by tying it to the component lifetime, which encourages cascaded fetching - exactly the kind of workload that is sensitive to latency.

branko_d··on U.S. national-security leaders included me in a group chat
> Signal on Android uses your phone PIN, for some insane reason.

The reason is simple: 95% of people would just set-up the same PIN anyway.

In unrelated news: Password reuse is rampant: nearly half of observed user logins are compromised

https://blog.cloudflare.com/password-reuse-rampant-half-user...

branko_d··on Numbering should start at zero (1982)
0-based indexing aligns better with how memory actually works, and is therefore more performant, all things being equal.

Assuming `a` is the address of the beginning of the array, the 0-based indexing on the left is equivalent to the memory access on the right (I'm using C syntax here):

  a[0] == *(a + 0)
  a[1] == *(a + 1)
  a[2] == *(a + 2)
  ...
  a[i] == *(a + i)
For 1-based indexing:

  a[1] == *(a + 1 - 1)
  a[2] == *(a + 2 - 1)
  a[3] == *(a + 3 - 1)
  ...
  a[i] == *(a + i - 1)
This extra "-1" costs some performance (through it can be optimized-away in some cases).
branko_d··on Zlib-rs is faster than C
Hydrogen sulfide is highly toxic (it's comparable to carbon monoxide). I doubt anyone in their right mind would put it intentionally in a place where it could leak around humans.

But it can occur naturally in natural gas.

branko_d··on Intel appoints Lip-Bu Tan as its CEO
> Together, we will work hard to restore Intel’s position as a world-class products company, establish ourselves as a world-class foundry and delight our customers like never before.

Sounds like he wants design and foundry to stay together.

branko_d··on Intel appoints Lip-Bu Tan as its CEO
> Some of the biggest EDA tools come from companies that use them for a reason (NX by Siemens, CATIA by Dassault, ...).

What do you mean? NX and CATIA are mechanical CAD systems, not EDA tools.

branko_d··on Intel appoints Lip-Bu Tan as its CEO
> These passive custodian investor companies just vote along with the board's recommendation

I know that's true, but I'm wondering - why? Why wouldn't they just withhold their vote and let the remaining (active) investors make decisions?

branko_d··on I've been using Claude Code for a couple of days
> I ask for narration

That's a mistake. There are plenty of people who are not good multitaskers and cannot effectively think AND talk at the same time, myself included.

IMHO, for programming, monotaskers tend to do better than multitaskers.

branko_d··on I've been using Claude Code for a couple of days
I have the same experience.

Where AI shines for me is as a form of a semantic search engine or even a tutor of sorts. I can ask for the information that I need in a relatively complex way, and more often than not it will give me a decent summary and a list of "directions" to follow-up on. If anything, it'll give me proper technical terms, that I can feed into a traditional search engine for more info. But that's never the end of my investigation and I always try to confirm the information that it gives me by consulting other sources.

branko_d··on TSMC expected to announce $100B investment in U.S.
> Can't build chips

True, but that's true for every country, even Taiwan. If ASML (Dutch company), Applied Materials, LAM Research, KLA, Synopsys, Cadence (US companies), Tokyo Electron, Shin-Etcu (Japan) and literally hundreds of other companies didn't cooperate, TSMC couldn't function either. BTW, that's why China can never "take over" TSMC - they can just make it defunct when all these other companies stop doing business with it after the invasion.

Basically, the planet is making chips, not any individual country.

> can't make ships,

I suggest you look-up the Jones Act and its unintended consequences.

And then think why American voters never consider this kind of stuff when voting.

> can't make furniture, can't make clothes,

Fair enough, though this is more a matter of what is economically viable vs. what is possible. There are economic losers, sure. But there are big winners too, most notably in the "tech" industry. It's incumbent on the US to smooth-out the transition for their own citizens, instead of allowing special interests and monopolies to run amok and incumbents to Gerrymander themselves into office.

Ultimately, American voters allowed this to happen, and when they saw the results, they fell for a demagogue.

> can't make enough weapons to supply Ukraine, let alone for any real war.

I hope you are not suggesting Russo-Ukrainian war is "not real". This is almost WW2-level stuff. I suggest you take a look at the photographic evidence of vehicle losses, keeping in mind that the actual losses are likely higher:

Attack On Europe: Documenting Russian Equipment Losses During The Russian Invasion Of Ukraine (main battle tanks: 3786, total: 20577) https://www.oryxspioenkop.com/2022/02/attack-on-europe-docum...

Attack On Europe: Documenting Ukrainian Equipment Losses During The Russian Invasion Of Ukraine (main battle tanks: 1092, total: 7965) https://www.oryxspioenkop.com/2022/02/attack-on-europe-docum...

branko_d··on TSMC expected to announce $100B investment in U.S.
This assumes USA was taken advantage of by globalization, which is not actually the case - USA benefitted disproportionally from it. USA's GDP growth is substantially based on the consumers (~70% compared to ~50% in the EU and other comparable countries), and that wouldn't have been possible if they could only consume what was produced in the USA.

But there were losers, mainly in manufacturing, and USA didn't assist them in the right way, allowed unprecedented levels of political corruption, allowed unhealthy levels of wealth inequality, allowed housing crisis, allowed obesity and health crisis etc...

Most of the USA's wounds are self-inflicted, but any good demagogue would not pass the opportunity to blame somebody else for it.

branko_d··on History of CAD
I remember working with SDRC I-DEAS API in the early 2000s - it was well documented and "clean looking" compared to something like PTC's Pro/TOOLKIT. Interestingly, it was also CORBA-based, and it worked quite well over LAN.
branko_d··on When imperfect systems are good: Bluesky's lossy timelines
> afford to pay tremendous sums for being wrong

Or they can just haul you forcefully from the flight you paid for:

https://en.wikipedia.org/wiki/2017_United_Express_passenger_...

branko_d··on Speed matters (2021)
On the other hand, some of the biggest performance wins come from the architectural choices, and those are often done before most of the code is written.
branko_d··on Basketball has evolved into a game of calculated decision-making
I agree. As someone who watched Magic, Bird and MJ in their prime, I think the modern basketball is at much higher level of both skill and athleticism. The level of "4D chess" going on is incredible and very enjoyable to watch!

I do not like the bullying aspect of it though. Offensive players are ramming straight into defenders, shoving the them mid-jump to get a rebound etc.

branko_d··on Composable SQL
From the article:

> What you hope happens is that Postgres will recursively inline every view, merge them all together into a gigaquery, and shuffle the predicates up and down to maximally optimize the query. That was the conceit. And of course that never happens.

The author seems to be describing a Progress-specific problem. Oracle, SQL Server (and probably other "enterprise" databases as well) are pretty good at inlining views and then optimizing the whole resulting gigaquery as if the views were not there in the first place.

> The central problem is that views have to be written for the general case, and then you filter on the view’s output. Views can’t take parameters.

SQL Server supports inline table-valued functions, which are exactly that - parametrized and inlinable views.

Unfortunately, they are not as composable as they could be. For example, a function returning table and a function accepting the same type of a table as input cannot be directly composed - you'd first need to store the first function's result in a temporary table or table variable. But despite the limitations, functions are extremely useful for constructing complex queries which reuse logic.

branko_d··on Composable SQL
I don't understand what you are trying to say about foreign keys. Are you advocating moving FKs from database to application?

If yes, you are opening yourself up to race conditions that will only become visible in concurrent environment. I had a distinct misfortune of working with an ERP system based on Oracle which didn't use database-level FKs. Predictably, their customers would occasionally complain about "dangling" data, which, to my knowledge, has never been properly resolved.

branko_d··on SQL nulls are weird
NULLs are weird because they are basically two different types under the same name. The 3-value logic type is useful for representing "missing" foreign keys, but 2-value logic type is arguably more useful when searching/sorting/aggregating.

I think we would have been better-off by treating FKs (and maybe outer JOINs) as a special case, and using 2-value logic everywhere else.

branko_d··on Databases in 2024: A Year in Review
I wish Microsoft paid more attention to T-SQL though. It’s an atrociously primitive language in some ways. There is no “record” or “struct” type of any kind, table-valued functions are not composable, an error in one line may throw an exception or just continue execution to the next line depending on whether TRY..CATCH exists at some higher level… to name just a few grievances of many I accumulated over the years.

It can work well performance-wise and security-wise, but programming it can be quite a pain, and I feel that’s unnecessarily so, considering what resources Microsoft has at their disposal.

branko_d··on Missiles are now the biggest killer of airline passengers
Yeah, it was a good choice. Aktau is surrounded by hundreds of kilometers of a really flat half-desert. Had they been able to land at even remotely correct orientation, they could have landed almost anywhere in that general area and would have likely been fine.
← PreviousPage 4 of 13Next →