HNHacker News
TopNewBestAskShowJobs

bajsejohannes

2,552 karma · joined August 20, 2008

submissionscomments
bajsejohannes··on Arena allocator tips and tricks
> Typically arena lifetime is the whole program

Some other good cases for arenas are rendering of a frame in a video game and handling of a http request. The memory is contained within that context and short lived.

bajsejohannes··on I'm all-in on server-side SQLite (2022)
> I can’t see any valid reason not to use Postgres at the back end

I'm using sqlite in production for a backend service. There are plenty of downsides, but to focus on the positives:

- I can run all tests in a database in memory. It's incredibly fast to "spin up" and I can use a separate database per test

- Related, I find that I write more tests against the database instead of mocking a database, which cuts down on time writing tests.

- I don't need to start a database to run the backend

- I can have snapshots of the databases in a single files for various scenarios

All in all, the development process feels a lot faster. When something takes a millisecond instead of seconds, you do things differently.

bajsejohannes··on Show HN: Tome, aka Tom's Editor – a new command-line text editor
I haven't read about hecto (yet), but I can thoroughly recommend the one about kilo, which is linked in the first paragraph of that article http://antirez.com/news/108 . Or even just reading the C code. It's achieving a lot with few lines and no dependencies (outside of the OS, that is)
bajsejohannes··on NFTs Are – Finally – Worthless
I would expect him to be scrutinized to a larger degree had the money come from cryptocurrencies. Both sending and receiving banks have money laundry protection schemes.
bajsejohannes··on Rp2040 runs unmodified PalmOS 5.2.8
Yep, it's that project.

FWIW, you can replace twitter.com with nitter.net to see it (depending on why you don't want to visit twitter)

https://nitter.net/dmitrygr/status/1704350983877198013#m

bajsejohannes··on Nanosecond timestamp collisions are common
Do you have any sources for this? My googling skills are failing me. I'm surprised early x86 (which I assume you're including) were aware of security issues with accurate clocks; I certainly wasn't until this millennium :D I would rather guess observed clock jitter would be explained by interrupts or some such. Not saying you're wrong, I'd just like to learn more.
bajsejohannes··on Awk Technical Notes
I read a different book, written by the creators of AWK themselves. But the experience was much the same. You can read it in one sitting.

Or, rather, you can read the two first chapter easily in one sitting. Chapter one gives a brief overview and examples. Chapter two describes the whole language, every function and every variable! The rest of the book is just more examples. I really love this style!

bajsejohannes··on We ran a phone check at a Y Combinator event in SF
The app can show a QR-code for inspection purposes. The police officer will scan this to verify a valid license. At no point do they touch the phone.
bajsejohannes··on We ran a phone check at a Y Combinator event in SF
I've been wallet free for some years now. Even the driver's license has become an app here in Norway (optional, you still get the physical one).

The big downside is that my wallet and everything in it can run out of battery. That's not very redundant. Suddenly I won't be able to pay, identify, call, etc.

bajsejohannes··on Ask HN: Tools to learn music theory?
I wonder why the for-teacher version uses chords to establish the tonic, and the other uses just a note. I find the latter much easier (but probably only because that's what I've practiced). I assume there's great benefit in being proficient in both.
bajsejohannes··on Ask HN: Tools to learn music theory?
I'm curious; why would you recommend the Nashville Number System over Roman Numerals (https://en.wikipedia.org/wiki/Roman_numeral_analysis)? Seems like the latter is much more widely used. Maybe I'm in a different bubble than you...
bajsejohannes··on Ask HN: Tools to learn music theory?
Nice. I built something similar. Apart from mine being much less polished, I also didn't include the keyboard; just the name of the chord. That way I could practice the chord shapes that I had learned (or look them up if I forgot).

With the keyboard there, I feel like I'm practicing copying that, instead of learning the chords. Especially with the timer ticking. I'd be curious to hear about your reasons for putting it there. Possibly your goal is very different from mine.

bajsejohannes··on Ask HN: Tools to learn music theory?
I made my own tools, which has been both fun and useful. I haven't put too much work in making them easy to use for others, but maybe they can help? The two that are polished enough to at least share are:

https://johanneshoff.com/sheet/ is for getting faster at recognizing note values in sheet music. I used this for about five minutes a day for some time and it really improved my reading. A musician friend of mine said it had limited use, since notes are always in context, and here it's just random notes. I think this is a good start, though, but the journey from there is probably some other tool.

https://johanneshoff.com/intervals/ to practice intervals. For this one I recommend a MIDI-keyboard and the 'meander' mode. Start out with just a few intervals and take it from there. I found it absolutely crucial to pick some songs that represent the interval. See for instance https://www.youtube.com/watch?v=PhDIm_2qS5s

bajsejohannes··on ThumbHash: A better compact image placeholder hash
Yep. Here's a good description of the issue, with examples that will show if the browser is the problem: https://magnushoff.com/articles/jpeg-orientation/
bajsejohannes··on Siliwiz – A Semiconductor Simulator
Tutorial at https://docs.google.com/document/d/1H3jA7guvXT7toEvUObOQ1viQ...
bajsejohannes··on Over the past 21 months I’ve written a code editor from the ground up
+1 for kilo. Another great approach is just to read the source code itself. It's only a thousand lines and it's well commented. https://github.com/antirez/kilo/blob/master/kilo.c
bajsejohannes··on Ask HN: What's the best lecture series you've seen?
Ben Eater building an 8-bit computer. https://www.youtube.com/playlist?list=PLowKtXNTBypGqImE405J2...

This series teaches you so much about how a computer works from the ground up. Although I had already learned that you can build a CPU with only NAND-gates, this is what really made it click. It's also densely packed with facts and techniques (debugging, using an oscilloscope, ...). It's quite refreshing compared to other youtube content where every little fact needs a ten minute video.

bajsejohannes··on Small-Scale Automation
I mostly use Makefiles to remember what I've written. It makes it quite easy to see what actions I found useful when working on some project months or years ago. Even if it's just calling out to scripts, it's nice to have in a central place.
bajsejohannes··on Modulo of negative numbers (2011)
But 13 is also equivalent to -2 and 1, mod 3. Why are you doing the modulo operation in the first place?

From a mathematical standpoint, I've never seen a use for returning -2 here. I want something unique for the group, so I can ask e.g. `x mod 3 == y mod 3` and have it work regardless of whether x or/and y are negative.

bajsejohannes··on Learning Verilog and FPGA
I think the answer is that it depends on what exactly you're optimizing for and what the workload is. I no expert either, but some of my predictions would be: DSPs and FPGAs will be great at compute per watt. FPGAs will have the highest initial cost. GPUs might beat FPGAs on floating point performance.
bajsejohannes··on Learning Verilog and FPGA
Yep. I'm using the iCE40HX FPGA on an open "source" Olimex Board [1] and my toolchain is all free and open source tools: yosys, arachne-pnr (which is replaced by nextpnr, but I haven't upgraded yet), flashrom, iceprogduino, iverilog.

[1] https://www.olimex.com/wiki/ICE40HX1K-EVB

bajsejohannes··on Learning Verilog and FPGA
Verilog does make it fantastically easy to create bugs! It feels like very early C versions that are way too lenient. The biggest bang-for-the-buck you can get here is adding "`default_nettype none" at the top of every file, which makes undeclared identifiers an error. I believe this is SystemVerilog, though, and I agree that's what you should learn.
bajsejohannes··on Vim: ZZ and zz: Do you know the difference?
I had the exact same experience, but if I pictured pressing them in my mind's eye, I realized what they did.

It reminds me of some bilingual kids I know that can understand their dad's language perfectly, but they have a really hard time speaking it (since they always reply in their mom's language). You only learn what you practice.

bajsejohannes··on Bob CD
Every person who should be aware of CI/CD needs to learn it at some point.
bajsejohannes··on TinyTapeout: Get your design on an actual ASIC
I'm not the author, and honestly know very little about ASICs. But apparently enough to get a design onto this tapeout! :D

If q3k's answer wasn't sufficient, maybe you can find more answers in the github repo that builds everything? https://github.com/mattvenn/wokwi-verilog-gds-test

Otherwise, there's a discord where the author (Matt) very active: https://discord.gg/rPK2nSjxy8

bajsejohannes··on TinyTapeout: Get your design on an actual ASIC
For anyone who wants to dip their toe in integrated circuits (ASIC), this project provides a way to get a tiny (~200 gate) project onto a physical chip. You can do the whole thing in the browser. Deadline for submission is September 1st.
bajsejohannes··on Ask HN: Can I see your cheatsheet?
My extremely short shell cheatsheet for things I do rarely enough to forget each time:

    Process substitution:
        bash: diff <(echo hello) <(echo world)
        fish: diff (echo hello | psub) (echo world | psub)
    
    Rsync directories:
        rsync -a -v --dry-run other:dir/ dir/
        Syncs the contents of dir (`/` needed)
    
    Script exit handler:
    bash:
        function finish {
          # exit handling code
        }
        trap finish EXIT # EXIT is special and works on normal exit as well as interrupts
bajsejohannes··on Ask HN: What is your Kubernetes nightmare?
I did not know that. Thanks for explaining.
bajsejohannes··on Forebruary is a wall calendar that you do not need to replace every year (2013)
Alternatively, we could switch do Decimal Time to have the same calendar every year (except for some adjustment for the last day of the year) https://en.wikipedia.org/wiki/Decimal_time
bajsejohannes··on Forebruary is a wall calendar that you do not need to replace every year (2013)
You could put that on the frame, though.
← PreviousPage 2 of 17Next →