HNHacker News
TopNewBestAskShowJobs

teo_zero

1,544 karma · joined August 14, 2022

submissionscomments
teo_zero··on Show HN: A terminal spreadsheet editor with Vim keybindings
The equal operator should work on strings, too. It would allow formulas like IF(A1=C3,A2,0)
teo_zero··on Show HN: A terminal spreadsheet editor with Vim keybindings
> Vim doesn't have an obvious idiom for "drag," so I'm leaning toward a visual-selection + fill-from-anchor key (Y is a candidate)

Better I or A, to mimick vim's multiple insert after a block selection.

teo_zero··on Using coding assistance tools to revive projects you never were going to finish
In fact it was one of the suggested tools. But installing a whole new application, and having it running in the background all the time listening for evey keypress, just to do its unique job once in a while... well, that's what I was referring to when I mentioned "over-complicated solutions".

Of course if you already have AutoHotKey running for other reasons, it fits perfectly.

teo_zero··on Using coding assistance tools to revive projects you never were going to finish
> things I really wish existed.

Just last week I was looking for a way to move all the windows from one screen to another in a go. After evaluating many clumsy or over-complicated existing solutions, I asked copilot to write a C program to do it. It had to be minimal and not depend on any runtime framework. A few loops later I had what I wanted without installing third-party tools!

teo_zero··on MNT Reform is an open hardware laptop, designed and assembled in Germany
Well said! Those Europeans with their tariffs, and their stupid motto "make Europe great again"!

Oh wait...

teo_zero··on A Periodic Map of Cheese
Neither is ricotta, actually.
teo_zero··on 4-bit floating point FP4
When you have so few bits, does it really make sense to invent a meaning for the bit positions? Just use an index into a "palette" of pre-determined numbers.

As a bonus, any operation can be replaced with a lookup into a nxn table.

teo_zero··on A simplified model of Fil-C
Could anyone understand what this sentence means?

> Upon freeing an unreachable AllocationRecord, call filc_free on it.

I think the intention was to say: before freeing an unreachable AR, free the memory pointed to by its visible_bytes and invisible_bytes fields.

teo_zero··on We gave an AI a 3 year retail lease and asked it to make a profit
A form of self-fulfilling prophecy?
teo_zero··on I made a terminal pager
In fact it's not. The name itself mimicks cat, not less. It's a filter that adds annotations to its input, such as syntax highlighting, git diffs and special-char coloring.

Personally I can't find any use for bat: I'm a devote user of vim for editing, and it already does all of this, so why not using it to view files as well? It's satisfying to have the same interface, colors and shortcuts whether you're editing or viewing!

teo_zero··on A communist Apple II and fourteen years of not knowing what you're testing
The current AI approach to technology is masterfully described as

> to build something enormous, declare it transformative, and hope nobody asks what it actually computes.

And the corollary:

> [such] approach requires billions of dollars and produces systems that cannot explain themselves.

teo_zero··on Not all elementary functions can be expressed with exp-minus-log
I feel that saying that EML can't generate all the elementary functions because it can't express the solution of the quintic is like saying that NAND gates can't be the basis of modern computing because they can't be used to solve Turing's halting problem.
teo_zero··on A new spam policy for “back button hijacking”
> If you don't manage the history properly in your SPA, pressing the back button could take the user out of the app entirely.

Yes. And that should be the default behavior: browser buttons should take you through the browser's history. If you keep a in-app state and want the user to navigate through it, you should provide in-app buttons.

Nobody complains that the browser's close button quits the browser instead of the app it's showing, or that the computer's power button shuts down the whole OS and not only the program in the foreground.

Users must be educated. If they have learned that left means "back" and right means "forward", that a star (sometimes a heart) means "remember this for me", and that an underlined checkmark means "download", then understanding the concept of encapsulation shouldn't be too much for them.

teo_zero··on Simplest Hash Functions
Sorry, I've read and reread TFA but the concept still evades me. Is it that, since it's easier for a hash function to have higher entropy in the higher bits than in the lower ones, it would be more logical for hash tables to discard the lower bits and keep the higher ones?
teo_zero··on Simplest Hash Functions
While I generally like to reinvent the wheel, for hash functions I strongly recommend to use a proved good one. Djb2 by the venerable Daniel Bernstein satisfies all the requirements of TFA.

  h = 5381
  while still has data:
    h = h * 33 + next_byte()
  return h
PS of course if you think the multiplication is overkill, consider that it is nothing more than a shift and an addition.
teo_zero··on Show HN: I built a Cargo-like build tool for C/C++
So, do you see now the assumptions baked in your argument?

> when you need to support larger deployments

> shipping

> passing it off to someone else

teo_zero··on Ubuntu now requires more RAM than Windows 11
> Canonical isn’t making 6GB memory a hard requirement for Ubuntu 26.04. It will still install on machines that fall below the minimum requirement, but users will have to deal with slower performance.

I think we have quite different definition of "minimum requirement", then.

teo_zero··on Breaking Enigma with Index of Coincidence on a Commodore 64
I think the author is too quick to dismiss the impact of the plugboard.

> IC attacks only the rotor settings [...] Once you’ve found the right rotors and positions, you can solve the plugboard separately using frequency analysis.

So two steps: first solve for rotor settings with IC analysis, then solve the plugboard.

But IC analysis can't find the solution, just propose a lot of candidates among which a human can spot the correct one by looking for intelligible German text. And how can you spot intelligible German text if some letters are swapped by the plugboard?

teo_zero··on Which European countries have the best salaries after taxes?
The choice of countries seems arbitrary. I thought the list was limited to EU nations, but Iceland and Norway are there. Then I thought it was EFTA countries, but Switzerland is missing. Then noted Belgium is also missing... I give up!
teo_zero··on IPv6 address, as a sentence you can remember
Saying that IPv4 is ok because we have NAT and CGNAT is like saying that spam is not a problem because we have spam filters everywhere.
teo_zero··on Shipment of KitKat bars stolen en route from Italy to Poland
I can't help wondering how the 413,793 bars were stacked.

413,793 is 3×3×23×1999.

teo_zero··on C++26: A User-Friednly assert() macro
> it is legal to optimize out any code paths that rely on this, even if they occur earlier in program order.

I don't think this is true. The compiler cannot remove or reorder instructions that have a visible effect.

  if (p == 0)
    printf("Ready?\n");
  *p++;
The printf() can't be omitted.
teo_zero··on ‘Energy independence feels practical’: Europeans building mini solar farms
Why would power flowing out of my house into the grid be a theft?
teo_zero··on LG's new 1Hz display is the secret behind a new laptop's battery life
> Last I checked

I checked 10 seconds ago. The only models I can order in my country with linux are Pro Max and a Precision workstation.

If I pretend to be located in the US, an XPS 13 from 2024 becomes available at 200$ more than the Windows variant, and no OLED option.

What a weird marketing strategy from Dell...

teo_zero··on Shell Tricks That Make Life Easier (and Save Your Sanity)
Pressing up, Ctrl-A and typing "sudo " adds the command to history, too. What's the difference?
teo_zero··on Side-Effectful Expressions in C (2023)
> Also, you can use a comma with += and -=

In the modified C advocated by the author, assignments (including ++ -- += etc.) are not expressions. So no comma, no.

teo_zero··on Side-Effectful Expressions in C (2023)
It might sound easy to fix just a little detail that disturbs you and keep the rest as it is, but it's rarely feasible.

If we ban side effects from expressions, we must change the "for" syntax too, because the third "argument" currently is an expression. It should be a statement instead. Let's see...

  for (int i=0; i<n; ++i) // old
  for (int i=0; i<n; i+=1;) // new
What about the typical 2-variable loop?

  for (int i=0,j=n; i<j; ++i,--j) // old
  for (int i=0,j=n; i<j; {i+=1;j-=1;}) // maybe?
Or we simply forbid all this and force the increment and decrement in the body:

  for (int i=0,j=n; i<j; ;) {
    ...
    i+=1;
    j-=1;
  }
This is throwing the baby out with the bathwater!

And finally, if the third argument is a statement, would a break or continue be accepted there as well? A nested for? Sure, these are examples of abusing the syntax, but so is using x and ++x in the same expression.

My conclusion is that some constructs are so powerful that they can both simplify our code and make it unreadable. The choice how to use them is ours.

teo_zero··on No Semicolons Needed
+1 on the convenience of a "mask" operator that perform the and-not. It's an operation that's used more often than others which do have the privilege of having their own symbol, like xor.
teo_zero··on No Semicolons Needed
It's very subjective, and I don't want to say that semicolons are good or bad, indentation is good or bad, etc.

But I think a language should decide whether white space is significant or not. If it's not, don't add exceptions!

Operators changing meaning when surrounded by spaces in otherwise context-free languages are an abomination!

teo_zero··on Wayland set the Linux Desktop back by 10 years?
> this perpetual debate over which is the best only tricks me into believing that whichever distro I'd choose, it will be the wrong one.

What a bizarre conclusion to draw! Why don't you believe that whichever distro you choose, it will be way better than what you have now?

← PreviousPage 6 of 31Next →