HNHacker News
TopNewBestAskShowJobs

jansommer

556 karma · joined July 16, 2020

https://ja.nsommer.dk
submissionscomments
jansommer··on Apple stuck the Mac mini power button on the bottom
"You're holding the Mac Mini wrong. Just flip it!"
jansommer··on HTML Form Validation is underused
Html form validation is great. There's just one gigantic catch:

It doesn't work in Firefox for Android.

https://bugzilla.mozilla.org/show_bug.cgi?id=1510450

jansommer··on NewPipe on Linux, Using Android_translation_layer
Great news! I'm fiddling way too much with a Surface Go 2, and a translation layer for Android is perfect when all you have is a touchscreen, very little ram, an incredibly slow eMMC, and a battery that'll last 8 hours if you're lucky.

Especially because there aren't many Linux apps that are touch friendly. Everything kirigami/touch friendly apps in KDE is very much work in progress and are barely good enough for daily usage. Electron apps are no-go because they don't work with a virtual keyboard. Flutter apps are useless because they don't support high dpi on Linux. Gnome has bad support for fractional scaling, issues in some menus for touchscreens, and the space for fonts in the launcher doesn't scale making them display as "Firef..." on a high dpi. I am running Debian Bookworm by the way.

So I wasn't happy to see that android_translation_layer uses Gtk, but I think scaling is improved in Gtk4. Looking forward to try it out either way.

jansommer··on Self-Documenting Code
> The first change I would make is to use named constants instead of cryptic error codes.

But he keeps the cryptic error codes that will go into the logs, or in the frontend where the developer will have to look up the error code. Don't map an error name to u105, just return the actual string: "userValidationFailed".

jansommer··on Self-Documenting Code
It's a good point, especially because different return types is well supported in TS.

I made the same in plpgsql recently and opted for returning an implicit union of UserSession | Error, by returning UserSession in the signature and raising errors in the function. The alternative was to return json where you'd have to look at the body of the function to figure out what it returns (when successful), as opposed to the signature.

I'm not sure if I'm striking the right balance. Yes, the signature is "self-documenting" - until you hit an error!

jansommer··on Multi-tenant SAML in an afternoon
> Last but not least, cost. I’ll just come out and say it: IMHO, what most vendors charge for being IdP is outrageous. Charging by MAU in an IdP? Really? We all know that the marginal cost for me to have a user in your system is essentially 0. You really gonna charge me 10 cents a month for a row in your database?

I've been looking into adding OAuth2/OIDC IdP integrations to an app I'm making. The pricing for most auth-as-a-service is indeed outrageous, and I don't need (or want) JWT. oauth4webapi [1] fits the bill here, is free and certified. Took less than an afternoon to have sign in with Google and another IdP. There's obviously more work to be done, but it's not rocket science.

Don't know if there's an equivalent for SAML. But I've certainly considered going into the auth SaaS business a few times. Seems like there's good money to be made.

[1] https://github.com/panva/oauth4webapi (TypeScript)

jansommer··on Show HN: Parse your Postgres queries into a fully-typed AST in TypeScript
This is extremely cool. Well done! If I was able to use this with node-postgres without schema management, but views and plpgsql, I'd finally have what I always wanted for pg <-> ts.

I think this library is going to set a new standard for db integration!

jansommer··on Show HN: JAQT – JavaScript Queries and Transformations
I don't know if RxJS has run out of fashion, but that would give you observable js using map/filter/reduce etc.
jansommer··on Show HN: JAQT – JavaScript Queries and Transformations
Wouldn't the query for your example just be

data.filter(d => d.friends.includes("John")).map(d => ({name: d.name+" "+d.lastName}))

Maybe I'm missing the bigger picture, but that doesn't seem so bad

jansommer··on Apple Approves iDOS Emulator
You could consider zram and get 50%+ more ram by compressing it. I use it on a 4gb ram surface go 2 and it works wonders. Not even noticing it in games like Divinity: Original Sin that requires at least 4gb.
jansommer··on “Something has gone seriously wrong,” dual-boot systems warn after MS update
It would work great if NVIDIA, AMD and Intel made high end consumer GPU's that could be shared between host and guest. So far we can only share Intel iGPU's - at least on paper, because I haven't managed to make it work.

... Or hack NVIDIA gpu's and potentially brick your 2000$ card...

jansommer··on “Something has gone seriously wrong,” dual-boot systems warn after MS update
Wouldn't rely on SB 100% but I think Shim + UKI is Good Enough for most consumers...
jansommer··on “Something has gone seriously wrong,” dual-boot systems warn after MS update
Lots of hate on Microsoft for doing this, but SBAT was made exactly for this reason: To deny boot loaders with known vulnerabilities to boot an operating system that might not be the one you think.

Might as well disable secure boot if that's not a concern, or make sure the boot loader is up to date if dual booting Windows 11. I can't imagine new machines shipping without SB.

jansommer··on Pixel smartphones delivered with secret but inactive remote maintenance
Yes, TPM is just one way to access your disk. The only reason to use it is in my opinion to not have to enter a super long password on every boot. An extra key if your mobo fails is the way to go. Or if you can't boot after an update, and you don't sign your recovery OS with the same key.
jansommer··on Pixel smartphones delivered with secret but inactive remote maintenance
What are some of the unsolved issues? Just curious
jansommer··on No more boot loader: Please use the kernel instead
Not that I would want to dual boot on my 64 gb surface go 2, but if I did, I'd need a bootloader with a menu, because there isn't one in the bios.
jansommer··on U++ – Cross-Platform App Development Framework
Has it had an impact on your productivity? Are developers shipping faster, same pace as before or slower? Would be super interesting to know if legal has increased productivity through bureaucracy, or how much a decrease in say 20% is costing the company - which is something that probably could be a fast track back to Qt.

Sorry if I'm coming off as a salesman here!

jansommer··on U++ – Cross-Platform App Development Framework
Out of curiosity, why did you make the switch? Licensing?
jansommer··on Infrastructure as code is not the answer (2022)
Yes, and usually you can make rules that prevent databases from being deleted again from IaC.
jansommer··on Ask HN: What Are You Working On? (April 2024)
Just stopped working on a basic multiplayer quiz, because the project got me a bit too absorbed.

The frontend is in TypeScript (swc compiler) using web components and no libs. Experience has been good so far.

The quiz is specified in xml that maps one-to-one with the web components, and backed by an xsd. Shell scripts written in C for cross-platform support (as simple as `#!/usr/bin/tcc -run` at the top and chmod +x in Linux (if you ignore the fact that x-platform C is hard, since you've only got libc)).

The backend is in C, compiled with tcc and using wsServer for websockets, protobuf for a binary wire protocol and sqlite for managing game state (enabling the server to crash and continue after restart). Can be compiled on Windows with a win32 pthread layer I extracted from mingw (for tiny c compiler ofcourse).

Which is also why I had to stop myself: My own projects tend to get out of hand with way too many interesting side quests.

jansommer··on Queues Aren't the Right Abstraction
Spot on. This is what Durable Functions does on Azure and it's brilliant for implementing complicated business processes and handling multiple events in one flow, in a resilient way where the logic is easy to follow.

One catch is that you're going to have to version your code if your workflows/orchestrations run for days, or if there's no windows without running workflows. And there's no built-in support for this, so expect to duplicate your entire workflow for new versions, so the old one can run to the end with the old code.

jansommer··on Showmax has displaced Netflix in Africa
Sounds like a lot of Marc Cherry's tv shows (Desperate Housewives, Devious Maids, Why Women Kill). That kind of stuff is excellent tv! Too bad it's not big business in the west.
jansommer··on German developer guilty of 'hacking' for exposing hardcoded credentials in app
I think a lot of issues are never reported because of stuff like this. We hear about white hat hackers getting sued all the time. And in the end it'll hurt us all because crooks don't care, and will use these found-but-undisclosed security holes to their advantage. Then, when they threaten the company to either pay or get a public dump of their wide-open database, management refuses and gets a slap on their wrist by the government once it's released - and customers receive a "sorry, we got hacked"-mail between a bunch of highly personalized phishing mails.
jansommer··on AsmBB – a lightweight web forum engine written in assembly language
I think you're right, but I'm mostly interested in the cloud offerings. It's super hard to convince anyone to roll your own unikernel infrastructure
jansommer··on Teach Yourself Programming in Ten Years (1998)
That's another thing I like about ChatGPT. It doesnt judge my compiler ;)

... Which is Tiny C Compiler

jansommer··on Teach Yourself Programming in Ten Years (1998)
Can't use any of that, because they all use complex.h (not supported by my compiler) and I have an interleaved array of complex numbers where 0 = real, 1 = imag, 2 = real, 3 = imag etc.

Dear ProbablyRealPersonGPT, please provide the necessary code in C with a short explanation

jansommer··on Teach Yourself Programming in Ten Years (1998)
Yes, Google isn't so good nowadays, or my problems have become sufficiently advanced to not be a quick search away.

What might save us from ChatGPT enshittification are the freely available LLM's. Probably won't be long before we can have a code companion running locally. It's probably already here

jansommer··on Teach Yourself Programming in Ten Years (1998)
ChatGPT has been a blessing for learning C. How do you calculate the conjugate for a complex double when the compiler doesn't support complex numbers? ChatGPT will give you the correct answer together with math examples. One example out of many. Then I verify the result by looking at other people's code - and now I know what to look for.

I wouldn't use Copilot. I've noticed how it distracts people in screen recordings. They pause to see if what is proposed makes sense, and it usually doesn't. Distractions are the last thing I need.

jansommer··on AsmBB – a lightweight web forum engine written in assembly language
Yes please! Still waiting for unikernels to actually become a thing. Looks so promising, but Unikraft has yet to launch their cloud offering and NanoVM is 7$ per unikernel, which, compared to an always on shared Hetzner vCPU for ~4$ (knowing those two are not exactly the same) is kind of pricey... Would expect them to be cheaper or at least cost the same
jansommer··on AsmBB – a lightweight web forum engine written in assembly language
Processing time is insanely fast according to the footer. But the time it takes to transfer the document to Denmark is 500 - 1000ms. Seems like a CDN is better than performant code in this case... Still an impressive feat.
← PreviousPage 2 of 7Next →