HNHacker News
TopNewBestAskShowJobs

puika

170 karma · joined September 7, 2021

submissionscomments
puika··on Windows 11 is so broken that even Microsoft can’t fix it
I cherish the days when Windows 10 was meant to be the last version of Windows. Still hope they brush Windows 12 under the carpet and turn 180 degrees, nothing good can come out of that one. Although maybe Windows 11 becomes the new 8, unceremoniously forgotten.
puika··on GPT detectors are biased against non-native English writers
Easily solved with an AI to detect cats wearing chickens costumes.
puika··on Writing Python like it's Rust
I have limited development experience but I would say this is taking shared libraries into consideration, where you want your public API as comprehensible and failproof as possible. Now put yourself in the shoes of the library user in both scenarios, you will clearly see which code is more prone to errors. The code presented in the article looks like something I'd feel comfortable working with.

It is also more convenient for your own private libraries, but makes not so much of a difference for one-off scripts you maintain alone (unless you are also the type that forgets what you were even doing in that script a few months from now, in which case you could benefit like me). It's about lowering cognitive overhead and chance of development errors in the long run if everything is nicely abstracted.

puika··on In PostgreSQL, powerful Full Text Search is available out of the box
Yes, and if it falls short you can also use the RUM extension if you don't mind the extra index size (can install via package manager or maybe you db provider like supabase has it available)
puika··on DeepDoctection: Document extraction and analysis using deep learning models
Last I checked I saw a grocery bill example using https://github.com/mindee/doctr and was fairly accurate. Bear in mind that was last year, hopefully it got even better or there are other libraries
puika··on Amazon CodeWhisperer, Free for Individual Use, Is Now Generally Available
Maybe I'm missing something, but isn't it supposed to output multiline suggestions as in the example for everyone? I can't find any option in vscode and just get line by line results (any supported language).
puika··on I don’t want a new phone, but I’m probably buying one
When it comes to phones, I tend to stick to lower-mid range ones that I know allow custom ROMs and have a certain community behind it and somewhat well supported. For instance I am running Android 12 on a 2016 ZUK Z2 shipped with 7, and if we ignore battery life and decreased performance it's still like having a new phone now. Same thing for my Redmi note 7 with Android 13. I cannot say the same for my iPad Air 2 from 2015, stuck on iOS 12 since I don't even know when, and can barely use it for anything apart from youtube and (supported) websites.
puika··on Ask HN: Small scripts, hacks and automations you're proud of?
Another interesting trick is to have a capslock layer (or any other "useless" key you may have, but capslock is much easier to reach obviously) with something like:

    ; ahk v1 code
    CapsLock::
      KeyWait, CapsLock
      If (A_PriorKey="CapsLock")
        SetCapsLockState, % GetKeyState("CapsLock","T") ? "Off" : "On"
    Return
    #If, GetKeyState("CapsLock", "P") 
      u:: ; convert selection to code in markdown by pressing CapsLock+u
        SendRaw, ````
        SendInput {Left}
      Return
      ; ...
    #If

I also find myself with way too many obscure Mouse button {1|2}, Ctrl, Alt, Capslock, F{1|12}, etc. incantations I never remember and end up opening the script to search them. I thought about adding pie menus based on context but never got to it. Would you mind sharing a minimal example of your right click menu? Sounds much simpler and accessible. The keyboard hook à la vscode chords also seems pretty useful, will definitely implement that
puika··on Prisma laying off 28% staff
I defaulted to Prisma for edge apps I'm experimenting with (supabase db). Given it's not possible to connect via TCP to a database and I'm stuck with JS/TS for the edge, I opted for Prisma's data proxy and henceforth Prisma.

Using the ORM means I'm tied to this mess of an abstraction, migrations and scripts that require so many workarounds and experimentation to make it worthwhile when your app is not a simple CRUD or you want performance optimizations without ending up writing your own queries yet again. The generated TS API is the only pleasant feature, but doing things the Prisma way I noticed my app is now tied to this ecosystem and its quirks and I dread it. Being unable to check generated queries' SQL beforehand is also a huge issue that is not getting solved any time soon from what I've gathered on their github.

You could also use Prisma as a SQL client and leverage their data proxy, without needing to use the ORM and execute SQL migrations and queries directly, which is what I intend to do from now on. Please do let me know if there are any other generic alternatives database-wise (for "the edge"), I miss raw [Postgre]SQL. Supabase's client is the closest I can think of and it also generates types from your db, but it's obviously not a generic solution.

Lastly, one particular thing that disgusts me (I believe it's not on Prisma but due to how the edge works) is that you cannot use a local database for development. Perhaps ngrok will work, but then you'd need to constantly update your data proxy project settings manually - I need to experiment more on that.

puika··on The best Go framework: no framework?
Is broken streaming a thing? A quick search shows some issues with gin's own gzip middleware. Don't know if that's also the case behind a proxy with gzip middleware and gin's disabled. Looking at the newest code I also noticed you can exclude paths from gin's gzip middleware, if a proxy is not an option.
puika··on OpenAPI Generator allows generation of API client libraries from OpenAPI Specs
I was very excited about this project when I first encountered it as it seemed to be the best centralized community-driven way to generate code for multiple languages and supporting v3.

The more time I spent with it the more disappointed I became. The reason why you are forced to write Java and write your own generator alongside the rest of the project is unclear to me. Extending the mustache templates is a pain (and handlebars experimental). Every little change you want to make requires you to change the library itself. Most generators I looked at (TS clients, Go clients and servers, Python clients) generated dubious code and project structures for actual usage.

My current approach to deal with all of this e.g. in Go server generation is to output to some temp directory and have (long) post generation scripts parse the current and generated AST to (1) restructure to my liking, (2) merge changes where appropriate (the generator would overwrite your code otherwise) and (3) generate helper files with Go templates, which are actually pleasant to use. (2) is necessary if you don't want to have generated maps all over the place to access the handler for this route, the middleware for this other one, etc. You won't have to edit generated files, but good luck figuring out what's going on. As long as you clearly state what methods can be edited and which ones are always replaced with the generator output you should be fine with (2).

You may be thinking:

> why do all of this instead of writing your own generator?

to which I answer: Touché.

puika··on Postgres full-text search: A search engine in a database (2021)
Mandatory mention of the RUM extension (https://github.com/postgrespro/rum) if this caught your eye. Lots of tutorials and conference presentations out there showcasing the advantages in terms of ranking, timestamps...
← PreviousPage 2 of 2