200 karma · joined July 17, 2012
Socials: - x.com/graycoding - linkedin.com/in/paulgrau/
---
{'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!)
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.
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...
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;
}
}
}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).
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.
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.
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.
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).
What's emotionally charged about this? It seems neutral to me.
Here's a guide I would recommend instead: https://github.com/labs42io/clean-code-typescript
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.
<!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>