Thanks, no idea how my Chrome copied the wrong URL. Something weird with Medium. Hopefully a mod can correct the URL
HN user
graup
meet.hn/city/59.4372155,24.7453688/Tallinn
Socials: - x.com/graycoding - linkedin.com/in/paulgrau/
---
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.
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.
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?
Blurry for me too, Chrome on Mac OS on a non-retina external display.
{'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!)
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.
Pretty neat! I appreciate the time that went into making the graph render nicely.
I was recently having fun with Reactflow myself. It took a bit of time to figure out custom nodes and edges. I found that ELK 'layered' (with some tweaking of settings) produces very nice layouts, but of course, we can't use its edge routing in real time if we want to allow users to move nodes around. Thanks for pointing me to @tisoap/react-flow-smart-edge ! I also came up with a similar `wasManuallyMoved` logic. https://github.com/3rd/tsdiagram/blob/66b186e85bf176e47128d0...
Reactflow's docs have a decent example for using ELK but I wish it went into a bit more detail regarding these choices.
For tweaking ELK settings, this online editor is also super valuable: https://rtsys.informatik.uni-kiel.de/elklive/elkgraph.html?c...
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;
}
}
}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.
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).
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.
Also, for users that have any of the CJK languages as their default browser language, Chrome enforces a minimum font size of 10 (or 12?) pixel, so anything smaller should be avoided anyway if you care about rendering similarly for all viewers. https://bugs.chromium.org/p/chromium/issues/detail?id=36429
I also see myself as a software engineer first but with a keen interest on these topics. I found a good place calling myself UX Engineer; basically frontend engineering with close ties to design and product teams.
Maybe get more into HCI research? It's basically computer science + psychology. I actually used self-determination theory for a research project back when I was doing my CS master: https://dl.acm.org/doi/10.1145/3274329
HCI research also extends nicely into UX research. You could look for UX Researcher roles, but that'd be non-engineering. That's why I like "UX Engineer" as a title for people like us.
I think randomized queues are pretty fair. You give everyone who arrives within a certain time the same chance. This wouldn't be too hard to implement as a system either.
Say ticket sales open at 2pm. From 1:45pm, everyone who gets to the site gets assigned a random queue number. Then from 2pm, users are given access to the ordering system in the order of their queue number. We can even limit throughput with that (e.g. let in n users per minute).
Ticket sites in South Korea already implement queueing systems to control server load. When sales open at 2pm, everyone refreshes the page at exactly that time, but the request is put in a waiting queue. This can be considered randomized in a way (the time someone refreshes the page is somewhat random), but I'd like to see the concept of "advance queue building time" added to that to reduce the stress of "I have to refresh the page exactly at the right moment." Give me a few minutes to get to the queue.
Why use relative units? ... because today there are different assistive technologies so that users can modify the base styles of an application web among those the font size, using this type of relative units ensures that the elements are displayed correctly on all devices.
I'm not convinced by this. Afaik all browsers support font size increasing/decreasing even if you don't specify your sizes in em/rem.
Relative sizes can be useful for developers/designers when targeting different screen sizes, see also units like `vw` and `vh`. But that's not UX (user experience), just DX (developer experience).
Last week, KakaoTalk (the main messenger used in Korea) was down FOR A WHOLE DAY because of a fire in their (1!) data center. Let's see how long it takes WhatsApp to get back online.
chore. noun. a routine task, especially a household one.
What's emotionally charged about this? It seems neutral to me.
If anyone needs a typed JS version of Python's range, I prepared this code to be a 1:1 match with the Python API. It also uses generators: https://github.com/graup/pythonic-ts/blob/main/src/iterators...
The general ideas are fine, but the examples are pretty outdated. For modern SPA, CSS naming has become largely obsolete. A lot of the JS code shows the principles it is supposed to well but sadly includes other cruft.
Here's a guide I would recommend instead: https://github.com/labs42io/clean-code-typescript
I think you made the same mistake that I made when I first read it. The question isn't "what contains more wine?" but "compare the amount of water in A to the amount of wine in B."
Step 1: A with 10 L wine; B with 10 L water
Step 2: A with 9 L wine; B with 11 L liquid (10 L water and 1 L wine => 10/11 water, 1/11 wine)
Step 3: A with 10/11 * 1/11 = 10/11^2 L water; B with 1/11 * 10/11 = 10/11^2 L wine.
10 / 11*2 water in A ~ 10 / 11^2 wine in B.
Sometimes I wish these articles would include "in the US" in the title. "Is College in the US Worth It? A Return on Investment Analysis"
In South Korea, pretty much all elevators have this enabled. Pressing a floor button a second time cancels the request. It's pretty useful (if not abused).
What I meant was that at least CSS blurs in Chrome don't have that "dark" effect that you get from poor color management. https://twitter.com/graycoding/status/1411679670001569793
This turned out to be more interesting than I thought. Gradients and blurs are common in UI design. The Figma app actually does blurs wrong, while Chrome/CSS renders them correctly. This is good to know.
Do you have a link to the original Tagesschau clip featuring the Gwangju footage? I could only find one from a day or two before, featuring only footage from Seoul.
Wait – I also don't have stereoscopic vision, do you have any details or sources for those magical glasses with prisms?
There are a few "Tetris is life" essays out there. One I enjoyed: https://zachsnyderproductions.medium.com/8-life-lessons-ive-...
Thanks, the test was very refreshing. I really like the simplicity. As an anecdote, my result came out very close to the one from 16personalities.
To save you a click to the dedicated website, this is all there is to it:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="">
<title>Minimal base.html</title>
</head>
</html>