graup
Joined 14 years ago
Joined 14 years 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!)
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.
Socials: - x.com/graycoding - linkedin.com/in/paulgrau/
---