HNHacker News
TopNewBestAskShowJobs

petalmind

544 karma · joined November 28, 2020

https://databasedesignbook.com/
submissionscomments
petalmind··on Cursor 0day: When Full Disclosure Becomes the Only Protection Left
> to just copy a bash command from a website and run it (sometimes with sudo! O.o ) to install software.

how is that different from the good old days of

    wget ftp://ftp.something.org/software-2.10.tar.gz
    tar zxfv 
    ./configure
    make
    sudo make install

?
petalmind··on Anthropic's model naming, extrapolated
Claude Epitaph
petalmind··on 5NF and Database Design
I think I understand this "Cartesian product" reasoning behind 4NF/5NF, I just find it irrelevant I guess.

Cartesian product is explained in Kent: case (3) in https://www.bkent.net/Doc/simple5.htm#label4.1 ("A "cross-product" form, where for each employee, there must be a record for every possible pairing of one of his skills with one of his languages")

I do not explicitly mention this Cartesian product even tho it is present in both posts ("sports / languages" in 4NF, and "brands / flavours" in 5NF).

> it demonstrates [one of] the precise problem[s] the normal form sets out to solve: a combinatorial explosion of rows.

I just don't understand this wording of "a combinatorial explosion of rows" — what's so dramatic here? I don't need four iterations of algebra-dense papers to explain this concept, I think it's pretty simple frankly.

And my implicit argument is, I guess, exactly that you could design tables that handle both problems without invoking 4NF and 5NF — people are doing that all the time.

petalmind··on 5NF and Database Design
Thank you, your take on the evolution from spreadsheets to proper databases is englightening.
petalmind··on 5NF and Database Design
Could you share an example of writing stule that you enjoy?
petalmind··on 5NF and Database Design
> Might it be a consequence of lack of disk space in those early decades

A plausible explanation of "normalization as a process" was actually found in https://www.cargocultcode.com/normalization-is-not-a-process... ("So where did it begin?").

I hope someday to find some technical report of migrating to the relational database, from around that time.

petalmind··on 5NF and Database Design
I have so many questions about that. Should that normal form basically replace 5NF for the purposes of teaching?

Why do they hate us and do not provide any illustrative real-life example without using algebraic notation? Is it even possible?

I just want to see a CREATE TABLE statement, and some illustrative SELECT statements. The standard examples always give just the dataset, but dataset examples are often ambiguous.

> (in its joins)

Do you understand what are "its" joins? What is even "it" here.

I'm super frustrated. This paper is 14 years old.

petalmind··on 5NF and Database Design
Imperative mood "normalize" assumes that you had something not-normalized before you received that instruction. It's not useful when your table design strategy is already normalization-preserving, such as the most basic textbook strategy (a table per anchor, a column per attribute or 1:N link, a 2-column table per M:N link).

And this is basically the main point of my critique of 4NF and 5NF. They both traditionally present an unexplained table that is supposed to be normalized. But it's not clear where does this original structure come from. Why are its own authors not aware about the (arguably, quite simple) concept of normalization?

It's like saying that to in order to implement an algorithm you have to remove bugs from its original implementation — where does this implementation come from?

The other side of this coin is that lots of real-world design have a lot of denormalized representations that are often reasonably-well engineered.

Because of that if you, as a novice, look at a typical production schema, and you have this "thou shalt normalize" instruction, you'll be confused.

This is my big teaching pet peeve.

petalmind··on 5NF and Database Design
Yeah, no NULL is ever equal to any other NULL, so they are basically unique.
petalmind··on 5NF and Database Design
> Someone, somewhere writing down a list and that list being blessed with the imprimatur of Academic Approval (TM)

One problem is that normal forms are underspecified even by the academy.

E.g., Millist W. Vincent "A corrected 5NF definition for relational database design" (1997) (!) shows that the traditional definition of 5NF was deficient. 5NF was introduced in 1979 (I was one year old then).

2NF and 3NF should basically be merged into BCNF, if I understand correctly, and treated like a general case (as per Darwen).

Also, the numeric sequence is not very useful because there are at least four non-numeric forms (https://andreipall.github.io/sql/database-normalization/).

Also, personally I think that 6NF should be foundational, but that's a separate matter.

petalmind··on 5NF and Database Design
Frankly I don't think that overcounting is solved by normalizing, because it's easy to write an overcounting SQL query over perfectly normalized data.

I tried to explain the real cause of overcounting in my "Modern Guide to SQL JOINs":

https://kb.databasedesignbook.com/posts/sql-joins/#understan...

petalmind··on 5NF and Database Design
One day I hope to write about denormalization, explained explicitly via JOINs.
petalmind··on Rubysyn: Clarifying Ruby's Syntax and Semantics
Do you know if Redex could be a tool that would be useful in my situation?

Claude suggests it, but I need to learn a lot of Redex to understand how to apply it.

I have a general understanding of what operational semantics is. Or maybe, are there any Redex implementations for common programming languages? \lambda_v is a bit too abstract.

petalmind··on Rubysyn: Clarifying Ruby's Syntax and Semantics
You reimplement `while` in terms of `loop`, but do you know that `loop` is also a method :)
petalmind··on Rubysyn: Clarifying Ruby's Syntax and Semantics
Even Ruby `parser` gem uses S-expressions in their documentation: https://github.com/whitequark/parser/blob/master/doc/AST_FOR...
petalmind··on Rubysyn: Clarifying Ruby's Syntax and Semantics
> on the 'reflection' level, where most languages have specific keywords that cannot be used 'first class' with the rest of the language.

In Ruby this is also the other way around, and it's one of my pet peeves.

`Kernel#callcc` looks like a method (arguably, of a special class), yet it's impossible to re-implement directly in the language, as far as I can tell.

Same with `raise`, I keep forgetting that it's not a keyword even.

petalmind··on Rubysyn: Clarifying Ruby's Syntax and Semantics
Yeah, I was also going to say that conflating trivial syntax and "supremely easy to learn" is a very weak flex.

The first Smalltalk-80 book you randomly find is 560 pages.

Also, there is a weird bargaining with "but not block temporaries" and "not an instance variable". Why not? Half of the postcard is basically empty. Also, "except primitives" — how many primitives are there?

petalmind··on Rubysyn: Clarifying Ruby's Syntax and Semantics
> Ruby has syntax sugar, no need to remove the funny parts.

This is just an intermediate representation, it's not meant to be used directly (even though you can do that, of course).

petalmind··on Rubysyn: Clarifying Ruby's Syntax and Semantics
> Lisp? Then I would use Lisp...

Lisp has completely different runtime semantics. Even the lexical scope in Ruby is extremely peculiar. One of the hard parts of writing this document was to remove the intuitive influence of Lisp because it just doesn't make sense for Ruby.

petalmind··on The largest number representable in 64 bits
Question: but how many different numbers can you fit in 64 bits using your encoding (sorry I understand the general approach but I have no idea how that fast hierarchy works). I guess it's still 2^64 different numbers?

So basically you have a very low density of representable numbers (2^64 / w218), I wonder how quickly it grows as you use more and more 1-bits, and is there even a correlation between the bit pattern and the corresponding number value?

petalmind··on Our investigation into the suspicious pressure on Archive.today
Fantastic. Each case is basically an SCP object.
petalmind··on Validating your ideas on strangers (2017)
"The Mom Test" book seems to be about this exactly: https://www.momtestbook.com/
petalmind··on SQL Anti-Patterns
> Overusing DISTINCT to “Fix” Duplicates

I wrote a small tutorial (~9000 words in two parts) on how to design complicated queries so that they don't need DISTINCT and are basically correct by construction.

https://kb.databasedesignbook.com/posts/systematic-design-of...

petalmind··on Thoughts on (Amazonian) leadership
The secret sauce to Amazon's success is an obsessive compulsive focus on money.
petalmind··on Quarkdown: A modern Markdown-based typesetting system
What is "non-Unicode" text exactly?
petalmind··on The Atomic Airplane
Here are some scans from a 1957 Soviet book on nuclear aircraft:

https://xplanes.tumblr.com/post/30938386375/from-the-cover-o...

https://xplanes.tumblr.com/post/30941448265/from-nuclear-pow...

https://xplanes.tumblr.com/post/30944519719/from-nuclear-pow...

https://xplanes.tumblr.com/post/30947450568/from-nuclear-pow...

https://xplanes.tumblr.com/post/30952419021/from-nuclear-pow...

petalmind··on Money lessons without money: The financial literacy fallacy
“What [schools are] bad at is teaching people to win in adversarial environments. And they're also bad at the meta-game of reminding someone that knowing the basic mechanics of some process does not make them an expert, but does make them a mark. Said differently: if you know which hands win in poker, thinking that this means you know how to play the game makes you a mark, not an expert.”

https://capitalgains.thediff.co/p/teachingfinance

“And it's hard for a teacher to end a class by telling students that they got an A+ in financial literacy and are now equipped to get ripped off in entirely new ways by an entirely different set of adversaries. But it's also impossible to create a repeatable standardized test that accurately simulates such an adversarial environment, because any time everyone gets the same correct answer, that answer would need to become wrong.”

petalmind··on Donald Knuth's 2024 Christmas Lecture: Strong and Weak Components [video]
Funny that Nicolas Cage comes up in this context. Here is a trivia snippet from https://www.imdb.com/title/tt23468450/trivia/:

> During an interview, Osgood Perkins recalled a story from production where he learned Nicolas Cage has a particular skill that he says no other actor possesses: the ability to recognize how high or low he is able to speak without messing up the audio. According to Perkins: "The sound guy came over to me one day...(he) comes up to me a couple of days into Nic being on set and he's like 'Oz, I've never seen anything like it. When Nic is mic'd, I'm watching the dials, when Nic goes big, he goes right to the line. Anything more, a decibel or two over that, and it would be hard to use. Then he goes down, he goes soft and his whispering and he's barely talking, he goes right to the line. Anything past that line, you wouldn't be able to use it. He knows where the lines are. It's the craziest thing I've ever seen in my life'."

Maybe Cage can contribute to the sound design problem actually.

petalmind··on Historically, 4NF explanations are needlessly confusing
Yes, absolutely, just present it in "historical misunderstandings" section.

My only concern is that it is presented as if it was something natural to begin with.

petalmind··on Historically, 4NF explanations are needlessly confusing
> The fact that there are situations when implementing referential integrity is difficult does not mean you shouldn’t do it at all.

> Referential integrity is specified at the logical level and does not dictate any particular implementation. OTOH violating 1NF makes it impossible to even specify RI constraints.

Now we're bargaining. If referential integrity does not dictate any particular implementation, then having an application-level RI and no database-level constrains should also be acceptable. Yet this is not a common FK enthusiasts position.

We just had a discussion of DSQL where a lot of people were saying things like "no FKs thus no real database". Well, I dunno.

Page 1 of 3Next →