Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
h4l
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
h4l
2y ago
That model still works for streaming. You have a central source stream only to the distributed edge locations, then have clients only stream from their local edge location. Even if one region is overwhelmed, the rest can still work. Load on
2.
▲
by
h4l
2y ago
Humans have a massive capacity to vary energy use. Highly trained endurance athletes like professional road cyclists and triathletes can average 3x or more the typical daily energy expenditure of a non-athlete on a long term basis. The idea
3.
▲
by
h4l
2y ago
I'm really happy to see this, I love using the ipython console and notebooks, and while the deno repl was ok, it's not as good. I wonder if Deno can be used with https://quarto.org/ now?
4.
▲
by
h4l
2y ago
I'd be interested in knowing more about your API use. Are you using the official 3rd party API or one of their internal APIs used by their own web front-end? It's a good idea for a project like this. One bit of feedback is that it
5.
▲
by
h4l
2y ago
Thanks! That's right, it's pure Python. It's certainly a lot slower than C or Rust, but I've not done any benchmarking to get a good sense. I believe Deno have a Rust implementation which they use, so in principle a Pyth
6.
▲
Show HN: V8serialize – Read/write V8-serialized JavaScript values from Python
(github.com)
3 points
by
h4l
2y ago
|
2 comments
7.
▲
by
h4l
2y ago
MappingProxyType is another handy one. It wraps a regular dict/Mapping to create a read-only live view of the underlying dict. You can use it to expose a dict that can't be modified, but doesn't need copying. https:/&#x
8.
▲
by
h4l
2y ago
Awesome, thanks for packaging it!
9.
▲
by
h4l
2y ago
> Is this tool not an additional dependency? It is, but if you already have bash, adding another shell script isn't much of a jump. e.g. I'd feel OK about committing jb to another repo for use from a .envrc file to set up an en
10.
▲
by
h4l
2y ago
jc has many parsers for the specific output format of various programs, it can automatically create a JSON object structure using its knowledge of each format. jb doesn't have high-level knowledge of other formats, it can read from com
11.
▲
by
h4l
2y ago
That is pretty cool, and I wish such features were common in regular UNIX shells. For good measure, this is how you might do the same with jb: $ jb Hello=world array:number[]@<(seq 10) object:json@<(date=$(date -Iseconds) jb @da
12.
▲
by
h4l
2y ago
Two main situations I think. The first is just interactive use in any shell to encode ad-hoc JSON. If you have a next-gen shell which can handle structured data directly, then you probably don't need it. Second is situations where you&
13.
▲
by
h4l
2y ago
Good question! Yep, jb exits with non-zero: $ jb size:number=oops; echo $? json.encode_number(): not all inputs are numbers: 'oops' json(): Could not encode the value of argument 'size:number=oops' as a &#x
14.
▲
by
h4l
2y ago
How did you guess my password?!?! This is just the kind of use case I had in mind. Something I've considered is publishing a mini version with only the json.encode_string function, as that's enough to create an array of JSON-encod
15.
▲
by
h4l
2y ago
There is, the earliest version I've tested with is 4.4.19, but ideally a 5.x version. 3 certainly won't work I'm afraid. If you use homebrew on Mac it's a good way to get the latest bash.
16.
▲
by
h4l
2y ago
Thank you, that's high praise! I learnt a lot about bash writing this, but I've also not looked at the code in a few months, and it's already starting to look quite intimidating! I definitely like the idea of a goland/ru
17.
▲
by
h4l
2y ago
Powershell has the upper hand here! Still, bash can try to keep up using json.bash. :) $ source json.bash $ declare -A greeting=([Hello]=World) $ json ...@greeting:{} {"Hello":"World"} ... is splatti
18.
▲
by
h4l
2y ago
If it helps, there's a little example of using the bash API with bash variables/arrays, should give you an idea of how it could be to use: https://github.com/h4l/json.bash/blob/main/examples
19.
▲
by
h4l
2y ago
Thanks for giving it a try and your feedback. I agree, the array splitting is a bit fiddly. It is actually possible to pass JSON directly, you use the :json type on the argument: $ jb dependencies:json='["Bash","Gr
20.
▲
by
h4l
2y ago
I did find it quite satisfying to coerce bash into doing this while maintaining decent performance. I definitely came to appreciate some aspects of bash more from this, but it's so easy to shoot yourself in the foot! If I started from
21.
▲
by
h4l
2y ago
Glad to hear, this was something I wanted to make reliable, ergonomic and intuitive. I figured a lot of languages use `: type` to declare types. The same using jo would be like this, which I find harder to type and remember: jo -- -s id
22.
▲
by
h4l
2y ago
It's nice to have compact single-file dependencies like this! I like the look of your assertions (checking out, err & status). I definitely found myself writing my own assertions to get understandable errors.
23.
▲
by
h4l
2y ago
Thanks!
24.
▲
by
h4l
2y ago
As well as anyone's general thoughts/experiences, I'd appreciate opinions on the error handling mechanism jb uses to detect errors in upstream jb processes that jb is reading from. Normally, detecting errors on the other end
25.
▲
Show HN: Jb / json.bash – Command-line tool (and bash library) that creates JSON
(github.com)
183 points
by
h4l
2y ago
|
52 comments
26.
▲
by
h4l
3y ago
In the UK our native squirrels are red, but they're almost extinct because North American grey squirrels out-compete them.
27.
▲
by
h4l
3y ago
You've probably accumulated a lot of relevant html knowledge which will help you. I presume you have some css-related projects/tasks in mind that you'd like to be able to tackle yourself. I would pick one of those and jump in
28.
▲
by
h4l
3y ago
I would probably start by opening the browser dev tools on web pages and use inspect element to see how an element in the page has been made to look the way it is. You can edit properties to see what effect they have when changed. The domai
29.
▲
by
h4l
3y ago
I can imagine it's very hard if you don't know how to use browser dev tools to see the style properties being applied to elements.
30.
▲
by
h4l
3y ago
Looks like a handy resource you're building here, thanks for this. FYI the category link right under the title links to a different category to the link below, and the first link only contains one post.
More ›