HNHacker News
TopNewBestAskShowJobs

ptrwis

91 karma · joined October 2, 2019

submissionscomments
ptrwis··on Pg_GraphQL: A GraphQL Extension for PostgreSQL
Am I correct in saying that for read queries, you essentially translate the GraphQL query into nested jsonb_agg calls?
ptrwis··on Angular 13
It is best to check the number of job offers for each framework. Angular and React are the most popular, much less for Vue and almost none for Svelte.
ptrwis··on PostgreSQL 14
When did you last use pgadmin4? It recently went through a big changes, in my opinion it's the best client for PostgreSQL.
ptrwis··on Serving Netflix Video at 400Gb/s on FreeBSD [pdf]
https://windows-internals.com/i-o-rings-when-one-i-o-operati...

https://docs.microsoft.com/en-us/windows/win32/api/ioringapi...

ptrwis··on PostgreSQL 15: default permissions for everyone is now restricted to db owner
In example pgcrypto extension has a lot of functions, if you have more stored functions it might be worth to install pgcrypto in dedicated schema.
ptrwis··on Problems with Oracle SQL
Exactly, Oracle should be chosen when business logic is written in sql/plsql
ptrwis··on Crystal 1.1.0
Look at their improvement (2x) in HTTP/RPS after moving to io_uring. It's not there yet though

https://github.com/crystal-lang/crystal/issues/10740

ptrwis··on Zig, Skia, Clojure, Geometry and the Japanese TV Show: ICFP Contest 2021
Yes, but look at the example in the blog post of this thread- "stat" depends on "file", "file" depends on "path". You can call defer in any order in your code, the language syntactically doesn't enforce you to call defer right after resource acquisition. "try-with-resources" in Java (or "using" in c#) will always call "finalizers" in order opposite to how resources where created. Following the syntax I inveted above, for someone used to Java it would be easier to read than to think how defers are called:

  try std.fmt.allocPrint(allocator, "problems/{}", .{ id }) |path| : allocator.free(path) {
    try std.fs.cwd().openFile(path, .{}) |file| : file.close() {
      try file.stat() |stat| {
        try allocator.alloc(u8, stat.size) |contents| : allocator.free(contents) {
          // do something with 'contents'
        }
      }
    }
  }
In Zig you can write this, and mess everything up:

  const path = try std.fmt.allocPrint(allocator, "problems/{}", .{ id });
  var file = try std.fs.cwd().openFile(path, .{});
  const stat = try file.stat();
  var contents = try allocator.alloc(u8, stat.size);
  defer allocator.free(contents);
  defer file.close();
  defer allocator.free(path);
ptrwis··on Zig, Skia, Clojure, Geometry and the Japanese TV Show: ICFP Contest 2021
With defer it's developer's responsibility to free resources in right order, when one depends on another. Maybe something like this in Zig would be better:

  try std.fs.cwd().openFile(path, .{}) |file| : file.close()
  {
    // ... code ...
    // file.close() is called at the end
  }
ptrwis··on Generating JSON Directly from Postgres
I did the approach with nesting jsonb_agg queries, it worked for me but was a bit hacky and sometimes complex. I hoped for Graph Query Language (the one supposed to be part of SQL standard) to make it easier to retrieve structred json from flat tables, but it doesn't look ready yet.
ptrwis··on Google is killing the .apk format and it's a bad thing
I thought that maybe at least PWA apps could be bundled this way, but I can't find anything about it
ptrwis··on A few thoughts on Fuchsia security
Security was not the goal for software-isolated processes, but performance and getting rid of task-switches. Who knows, maybe this is what MS recently described as "next windows" (naive hope).
ptrwis··on Scala 3.0
With "Expr" it should be possible to built an ORM similar to Entity Framework, it allows to write elegant queries thanks to Expression Trees in C#.
ptrwis··on Surface Laptop 4
I don't like keyboard layout- lack of full-sized arrow keys and column of Home/PgUp/PgDn/End buttons on the right.
ptrwis··on The database servers powering Let's Encrypt
Let's say they maxed out their former storage capacity of 24x3.8[TB]. For these 235millions of websites as they claim it's around 400kB per website.
ptrwis··on Why can't I write code inside my browser?
Stackblitz is great
ptrwis··on Diem – A rebrand of Facebook’s Libra
My general impression after reading between the lines over last years about Libra is they are targeting in-app micropayments and more like a competition to something like Paysafecard.
ptrwis··on PostgREST: REST API for any Postgres database
How much effort of human mind is being lost to solve these ORM or JS frameworks problems. Programmers community is fighting with problems which at first should not even exist. With good tools we shouldn't even bother about them
ptrwis··on Raspberry Pi as a local server for self hosting applications
May I ask what fs did you use? Maybe F2FS would extend the life of the flash memory
ptrwis··on One word in PostgreSQL unlocked a 9x performance improvement
> A much bigger problem is #2. We need the result of the insert to know if a row was inserted or not.

You can write a trigger on insert and make second insert there, or enclose first insert into CTE and then make second insert selecting from the first one

ptrwis··on PostgreSQL is the worlds’ best database
pgAdmin4 is not that bad, I'm using it every day
ptrwis··on RFC: Adopt a modern JavaScript framework for use with MediaWiki
I dislike both. Most readable template syntax for me is PHP's "alternative syntax for control structures" (the one with colons instead of braces and closing keywords).
ptrwis··on Game Boy Advance “Hello World” Using Zig
For wrapping behaviour you need to add % symbol, like a+%b is wrapping addition.
ptrwis··on C-for-all: Extending C with modern safety and productivity features
You can use syntax of the form vec1.add(vec2), which is still better than add(vec1, vec2)
ptrwis··on Turning PostgreSQL into a queue serving 10k jobs per second (2013)
I would love to see now PostgreSQL going more into improving developer's expierience. Job queues, job scheduler, packages.
← PreviousPage 3 of 3