graup

Joined 14 years ago

Karma
200
Submissions
90
Member since
Jul 17
meet.hn/city/59.4372155,24.7453688/Tallinn

Socials: - x.com/graycoding - linkedin.com/in/paulgrau/

---

View on Hacker News

Recent submissions

Comment · 5 months ago
Thanks, no idea how my Chrome copied the wrong URL. Something weird with Medium. Hopefully a mod can correct the URL
Comment · 8 months ago
Ten years ago, I did some experiments building an "input lag measurement device" for touch screen devices with an Arduino. https://github.com/graup/feedback-delay-measurement The research was related to QoE in cloud gaming. At that time, some Android devices had insane lag (125 ms+), whereas Apple devices were already consistently around 30ms. I assume this isn't a problem anymore nowadays.
Comment · 9 months ago
Last time I checked (a few years ago), it was cheaper to send letters and small packages from South Korea to Germany than from Germany to Germany. The delay was also not that big (maybe 1-2 weeks instead of 3-5 days). I already envisioned an arbitrage business for this: a simple page where people upload their non-urgent letters as PDFs, and I just print and mail them from Korea.
Comment · 1 year ago
Was hoping this was about WebAssembly/WASM. You used to be able to import rust directly into your JS with Parcel, but sadly that feature was dropped in Parcel 2. Is there a simple pipeline for compiling and typesafe binding of Rust-WASM?
Comment · 1 year ago
Blurry for me too, Chrome on Mac OS on a non-retina external display.
Comment · 1 year ago

    {'name__contains':"k", "age__lt":20}
Kind of tangential to this package, but I've always loved this filter query syntax. Does it have a name?

I first encountered it in Django ORM, and then in DRF, which has them as URL query params. I have recently built a parser for this in Javascript to use it on the frontend. Does anyone know any JS libraries that make working with this easy? I'm thinking parsing and offering some kind of database-agnostic marshaling API. (If not, I might have to open-source my own code!)

Comment · 2 years ago
I also think about this regularly. I'm with the author regarding the metrics (time efficient, healthy, skill component).

But still, I find strength training extremely boring and going to the gym annoying. I tried a few times but it never clicked for me – what am I missing?

Does anyone have other ideas for incorporating exercise into my daily routine? I enjoy a bit of walking, cycling, and doing 5-10 minute mobility exercises, but is that enough? Maybe I could find one or two strength exercises I can do quickly without getting boring or too difficult, ideally without any gear.

Comment · 2 years ago
Comment · 3 years ago
I really like Go channels, and I was looking for something like this in JS.

One of the earlier implementations is this one, albeit not maintained anymore: https://github.com/NodeGuy/channel I think I prefer its more concise API, e.g. for select (https://github.com/NodeGuy/channel/blob/main/API.md#examples). ts-chan's API looks a bit too verbose to my taste.

Here's an example from ts-chan:

  import {recv, Chan, Select} from 'ts-chan';

  const ch1 = new Chan<number>();
  const ch2 = new Chan<string>();

  void sendsToCh1ThenEventuallyClosesIt();
  void sendsToCh2();

  const select = new Select([recv(ch1), recv(ch2)]);
  for (let running = true; running;) {
    const i = await select.wait();
    switch (i) {
    case 0: {
      const v = select.recv(select.cases[i]);
      if (v.done) {
        running = false;
        break;
      }
      console.log(`rounded value: ${Math.round(v.value)}`);
      break;
    }
    case 1: {
      const v = select.recv(select.cases[i]);
      if (v.done) {
        throw new Error('ch2 unexpectedly closed');
      }
      console.log(`uppercase string value: ${v.value.toUpperCase()}`);
      break;
    }
    default:
      throw new Error('unreachable');
    }
  }

I would consider rewriting the API to something like this:

  import { receive, Channel, select } from 'ts-chan';

  const ch1 = new Channel<number>();
  const ch2 = new Channel<string>();

  void sendsToCh1ThenEventuallyClosesIt();
  void sendsToCh2();

  for (let running = true; running;) {
   switch(await select([receive(ch1), receive(ch2)])) {
      case ch1: {
        if (ch1.done) {
          running = false;
          break;
        }
        console.log(`rounded value: ${Math.round(ch1.value)}`);
      }
      case ch2: {
        if (ch1.done) {
          throw new Error('ch2 unexpectedly closed');
        }
        console.log(`uppercase string value: ${ch2.value.toUpperCase()}`);
        break;
      }
    }
  }
Comment · 3 years ago
This is cool! Note that this problem is fairly specific to Berlin (and probably some other places in Germany). I just moved to Heidelberg, and this city offers registration appointments both via video chat as well as in-person, with slots available next day.
Comment · 3 years ago
TIL. This actually solves my main need for custom scrollbars.

Now the only remaining use case is when designers don't design components around default scrollbars. Sometimes the default one just looks too big compared to the size of the component. But this can be solved with design (don't cram stuff into small fixed boxes that then need to be scrollable).

Comment · 3 years ago
Hard to see a real-world use for this but reading the code and docs is pretty interesting. The code taught me some cool tricks. Good job!

Some of the binding API is a bit weird, like that object with `deps` (State-derived properties). Maybe providing a function for this would be more ergonomic.

Comment · 3 years ago
Comment · 3 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton