Live data from Hacker News

Viewing profile — h4l

h4l

HN member
Joined
Wed, Sep 07, 2016, 9:50 PM UTC
HN karma
179
Public activity
48 items

About h4l

No profile information was provided.

Recent public activity

  1. comment
    Comment #42154193

    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…

  2. comment
    Comment #41896958

    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…

  3. comment
    Comment #41645340

    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…

  4. comment
    Comment #41638964

    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…

  5. comment
    Comment #41638545

    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 implementatio…

  6. story
    Show HN: V8serialize – Read/write V8-serialized JavaScript values from Python

    v8serialize is a Python library that reads and writes V8's value serialization format[1][2], which is how V8 moves JS values between contexts when using postMessage(value), storing…

  7. comment
    Comment #41454996

    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 modifie…

  8. comment
    Comment #40890801

    Awesome, thanks for packaging it!

  9. comment
    Comment #40872433

    > 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 …

  10. comment
    Comment #40872358

    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…

  11. comment
    Comment #40869223

    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[]@ Alte…

  12. comment
    Comment #40868923

    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 …

  13. comment
    Comment #40868818

    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 '…

  14. comment
    Comment #40868766

    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,…

  15. comment
    Comment #40868707

    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 lates…

  16. comment
    Comment #40868661

    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…

  17. comment
    Comment #40867920

    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":"Wor…

  18. comment
    Comment #40867795

    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/mai…

  19. comment
    Comment #40867514

    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: $…

  20. comment
    Comment #40867166

    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…

  21. comment
    Comment #40866834

    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 thi…

  22. comment
    Comment #40866689

    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 t…

  23. comment
  24. comment
    Comment #40866092

    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.…

  25. story
    Show HN: Jb / json.bash – Command-line tool (and bash library) that creates JSON

    jb is a UNIX tool that creates JSON, for shell scripts or interactive use. Its "one thing" is to get shell-native data (environment variables, files, program output) to somewhere e…