HNHacker News
TopNewBestAskShowJobs

jansommer

556 karma · joined July 16, 2020

https://ja.nsommer.dk
submissionscomments
jansommer··on Libwebsockets: pure C library for http, websockets, MQTT
Not a Java developer, but why not use an existing Java library for this? Don't know if they're using C or something else behind the scenes, but a quick Google search brings up a few.
jansommer··on Open source liability is coming
Would like to see some actual cases where this was an issue. If a plane goes down due to bugs in open source software, could Airbus just say it wasn't their fault? Can't imagine that. Or if you got hacked and customer's data exposed because of the log4j-bug, could you just say it was because of that library, case closed? That would be interesting to find out, but it sounds insane to me if you can just point at something that explicitly has no liability, that you chose to use in commercial software, and not be liable yourself.
jansommer··on Learn Modern C++
Excellent, now let 7thaccount discover that. I suggest he or she starts with C.
jansommer··on Learn Modern C++
Instead of going straight to the fix, like GC or RC, try and deal with it manually first. Try working in a language without templates/generics, figure out what that solves. And how does pointers work? You could figure it out in C++ for sure, but try C without all the cruft. It's a simple, lovely language on the surface. Use it to learn and move on to something else if you need to.
jansommer··on Learn Modern C++
Well that's where the parent to my comment already is and still struggling with low level languages.
jansommer··on Learn Modern C++
I would start with C, then take it from there. Makes you think about memory management and pointers, and the language doesn't change much. C++ and Rust is a lot easier to process now that I know C, though they don't get prettier. Use ChatGPT for learning - it's good at writing and explaining C.
jansommer··on TuneNN: A transformer-based network model for pitch detection
Ha! I've translated your YIN code actually! Your autocorrelation is pretty cool - GPL versions all use an additional FFT. Have been struggling with your PYIN implementation because the beta distribution is copied from the GPL PYIN source, and the paper just references its source code for that part, and as you also found out, it's not a real beta distribution. I asked one of the PYIN authors (Dixon) if he were willing to change the license and he forwarded my mail a week ago - haven't heard back. Then there's the absolute_threshold function that is the same as in the PYIN source where it says "using Jorgen Six'es loop construct". This "loop construct" doesn't have a license, because he doesn't answer the issues about that in his TarsosDSP library, and I'm not sure if I should bother him about a few lines of code. I'm assuming it's a coincidence and that's just a normal way to find the absolute threshold. I really don't want to point fingers here, I'm being paranoid because I try to make sure I don't publish something that can put people in trouble...

So I have been staring at your code for many hours, and the YIN-implementation works well. The PYIN on the other hand.. well I necro posted a while ago in one of your pull requests I think ;)

jansommer··on TuneNN: A transformer-based network model for pitch detection
I think I have to look at the code when using other people's MIT licensed code... If they have used something that's GPL or used someone else's code that turns out to be GPL, then it becomes my problem when translating it. And I'm not smart enough to just follow a paper
jansommer··on TuneNN: A transformer-based network model for pitch detection
I need non-GPL libraries as a reference. The problem with YIN and especially PYIN is that the MIT-code I've found sometimes looks a bit too similar to earlier code in GPL. Rewriting that into the same but in different code is fairly hard. Here I'm assuming that translating eg. GPL Python or C++ into C would mean the license is retained
jansommer··on TuneNN: A transformer-based network model for pitch detection
Sounds like you know a thing or two about pitch detection... I've been working on a C implementation of YIN and PYIN (a real GPL minefield for someone wanting to provide the end result as MIT/public domain!), and am wondering if it's a good choice for real time, cpu-bound speech pitch detection, or if there's better ways. May I ask what your thoughts are on this?
jansommer··on Show HN: SQL Polyglot
Wonder if you could put all those databases in a Linux image and boot it using v86 [0], eliminating the need for a server.

[0] https://github.com/copy/v86

jansommer··on Deleting 50k Lines of Code in 3 Days
I think projects in C would be a good contender here.
jansommer··on Building Node.js applications without dependencies
You might as well assume (c) whenever you use a library provided free of charge. Be prepared to either fix the bugs yourself or make sure there are alternatives you can use as a replacement. Even if the author is responsive now, there's no guarantee you'll get help once your code is in production a few months later. The library might even be archived at that point.

Lets say you've used FFTS, the Fastest Fourier Transform in the South [0]. Performance is spectacular, but now it's no longer supported and you find a bug. The code is impressive: Thousands of lines of code that dynamically generate SIMD instructions. But it's impossible to understand. You have chosen a library you cannot repair yourself. This is fine when there's alternatives, and there are for FFTs, and they are easy to swap out. If you can't easily swap out one library with another, you better make sure that you can repair it yourself.

And I hope people don't harass or "harass" library authors into merging pull requests...

[0] https://github.com/anthonix/ffts

jansommer··on Show HN: A pure C89 implementation of Go channels, with blocking selects
No. That syntax is not supported. Try a VLA and see how it goes. Then try a complex number or read the docs: "The compiler doesn't directly support a complex or _Complex keyword" - https://learn.microsoft.com/en-us/cpp/c-runtime-library/comp...
jansommer··on Show HN: A pure C89 implementation of Go channels, with blocking selects
MSVC lacks some C99 features like variable length arrays and complex numbers. There's always a work around, but wouldn't want to use that compiler for C unless I had to.

Going for C89 for a truly portable project is probably fine.

jansommer··on Swedish Tesla strike goes international as Norwegian and Danish unions join in
This was a thing in Denmark probably 20 years ago, now it's no longer legal to demand union membership for employees. But there was one incident 4 years ago where union members at Kastrup Airport tried to bully a coworker to join them. They even went on strikes three times because of this, with zero effect. Can't tell if the bullying is widespread though.

https://www.dr.dk/nyheder/penge/3fer-bag-trusler-og-boelleme...

jansommer··on Android and RISC-V: What you need to know to be ready
We have MitID for banks and government sites in Denmark. Sometimes you also use it to authenticate purchases. You can get a small device that you use for authentication if you don't own or want to use a smartphone. It seems odd that Sweden forces everyone with a bank account to also own a smartphone. Especially when many elderly people don't have one.
jansommer··on I Hate NestJS
I like the part on tests. No need for dependency injection when you can just override/spyOn the functions. Most people in the .NET world uses DI, causing a lot of smaller classes where code is dubiously grouped. And my god, all the interfaces where every use of that could just as well be the class version. But we have to use DI, because (1) people look at you like you're insane if you tell them you don't like it. And (2), we also don't want to pay for commercial software like JustMock (not affiliated) or VS Enterprise (also not affiliated), that supports mocking static methods. I think that in lack of a free, maintained and widespread library for this, C# ends up with the mess the author describes. It's a shame, because there's nothing wrong with the language itself.

Because of (1) it's a struggle to convince anyone to buy (2). And would be silly to expect someone to provide it for free.

jansommer··on Pixel 8 Pro
Yes! This is a steep increase in price since Pixel 7. Googles upgrades are not going to happen for 7 years on Px7, but hopefully GrapheneOS gives my phone a few extra years.
jansommer··on Writing a debugger from scratch: Breakpoints
I wrote this: https://ja.nsommer.dk/articles/x86-debugger-for-windows-and-...

It's a debugger for Windows (and Wine), like the one in the article, written in C. It uses software breakpoints (infinite breakpoints)

jansommer··on EU tells Apple to open everything up to its rivals
We can sideload on Android, but those apps are all on the Play Store, which actually gives them more tracking capabilities, because it's hard to block stuff using Play API's
jansommer··on Seeking help to preserve WWII database on Windows 98
Buildroot is a good tool to build a custom Linux. Wine is available as a package.
jansommer··on A world where people pay for software
> Pay to download or for other services: Not worth it; users can find the software somewhere else and they don't need your other services.

If users can find the software elsewhere, then it must be cheaper or better if they don't want to use yours. If this is about pirating, then it's just a matter of time before they buy, unless the ransom for decrypting their personal files bankrupts them.

Please, no more subscriptions.

jansommer··on Open source code with profanity in comments is statistically better
I sometimes feel like swearing in the comments or commit messages, which can be the first thought coming to mind, and spend a few resources on writing in a kinder way.

Perhaps I could use this as an excuse for not reaching a deadline...

jansommer··on Amazon cancels my account after exposing account lockout for “racist doorbell” [video]
Didn't get that vibe at all. He seems to be very direct and to the point.
jansommer··on Sennheiser HD 555 to HD 595 Mod
That checks out for consumer vs business pc's/laptops shipping Windows
jansommer··on Do any startups still use WordPress after 20 years?
Couldn't one set the path of cookies to be for your app? Then a malicious plugin shouldn't be able to read your apps cookies, since they won't be sent to Wordpress
jansommer··on Almost 200k Job Cuts in Tech Pushes New Grads to Wall Street
https://archive.md/BzNgh
jansommer··on How Somali workers in the US are fighting Amazon’s surveillance machine
Call it what you want, if a developer knowingly writes software that causes people to pee in bottles at work then that person is garbage, period.
jansommer··on How Somali workers in the US are fighting Amazon’s surveillance machine
What kind of developer is writing the sort of software that enables Amazon to do this? I can't help but feel these people are total garbage. We have so many opportunities. There's no excuse for writing software that tortures people the way they do at Amazon. Even if the developers didn't know that was the purpose for the software - then quit, stop maintaining it once you figure it out.

If you make this software for Amazon, then I hope you'll end up on the floor in the warehouse yourself. You deserve it.

← PreviousPage 3 of 7Next →