HNHacker News
TopNewBestAskShowJobs

kbouck

525 karma · joined March 13, 2012

submissionscomments
kbouck··on Show HN: Free AI-based music demixing in the browser
this already exists in the djay app (paid add-on feature). even runs on a smartphone! performs about the same as the app this thread is about.
kbouck··on Show HN: Free AI-based music demixing in the browser
Would love to see something like this auto-mix song transitions in playlists to be more DJ-like.
kbouck··on Will boiling water ruin green tea?
not easy to convert accurately in your head, but google does unit conversion right in the search bar:

  "200 f to c"
and macOS spotlight you can go even shorter:

  "200 f"
kbouck··on We are living in a golden age of electric cargo bikes
'Urban Arrow' cargo bikes seem popular in Amsterdam (with piles of kids being the typical cargo). They seem to be available in Australia too.
kbouck··on Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON
It generally means an sequence/array of flat json objects, each key represents a column name, and the value representing the row value for that column. Nested json can also be "flattened".

> "... ordering of key-value pairs"

order of appearance of key-value pairs in input does not matter.

> "... if row #100 introduces a new key-value pair"

this is sparse data. miller handles this with the "unsparsify" verb:

    $ cat in.json
    { "a": 1, "b": 2 }
    { "a": 3, "b": 4 }
    { "a": 5, "b": 6, "c": 7 }
without unsparsify:

    $ cat in.json | mlr --j2p cat
    a b
    1 2
    3 4

    a b c
    5 6 7
with unsparsify:

    $ cat in.json | mlr --j2p unsparsify then cat
    a b c
    1 2 -
    3 4 -
    5 6 7
unsparsify can also set default values:

    $ cat in.json | mlr --j2p unsparsify --fill-with 0 then cat
    a b c
    1 2 0
    3 4 0
    5 6 7
> "... What if the value for a key is an array?"

Array value treatment seems to depend on output format. for output types that can represent arrays, they are preserved:

    $ cat in-array.json
    { "a": [0,1,2], "b": [5,6,7] }
    { "a": [3,4,5], "b": [8,9,0] }

    $ cat in-array.json | mlr --jsonl cat
    {"a": [0, 1, 2], "b": [5, 6, 7]}
    {"a": [3, 4, 5], "b": [8, 9, 0]}
for formats like csv/fixed-width, arrays are flattened into columns, one for each array element:

    $ cat in-array.json | mlr --j2p cat
    a.1 a.2 a.3 b.1 b.2 b.3
    0   1   2   5   6   7
    3   4   5   8   9   0
flatten separator can also be set:

    $ cat in-array.json | mlr --j2p --flatsep _ cat
    a_1 a_2 a_3 b_1 b_2 b_3
    0   1   2   5   6   7
    3   4   5   8   9   0
kbouck··on Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON
and miller also has a powerful (and intuitive imo.) dsl should you need to go beyond what the simple command line switches offer.

so, it remains simple and concise for the easy problems, yet can scale up to address the trickier ones as well.

i've used csvkit, sqlite, jq, etc. miller is my favorite tool for data-fu (with sqlite being a close 2nd)

kbouck··on Miller: Like Awk, sed, cut, join, and sort for CSV, TSV, and tabular JSON
you could shorten to:

$ mlr -N --csv head -n 20 pp-2002.csv

-N is a shortcut for --implicit-csv-header and --headerless-csv-output

kbouck··on Tell HN: Microsoft's captcha is pretty hard
seems almost like playing dobble

https://en.m.wikipedia.org/wiki/Dobble

kbouck··on Design the next iPhone
... or inadvertently turn off your phone while intending to take a picture
kbouck··on The mitochondrial NAD+ transporter SLC25A51 is a fasting-induced gene
> David Attia

Did you mean Peter Attia?

kbouck··on The British Library Has a Vulgar Dictionary – You Can Learn a Lot from Slang
No discussion on swearing dictionaries is complete without mentioning "Roger's Profanisaurus":

https://a.co/d/bbKKHME

https://en.m.wikipedia.org/wiki/Roger%27s_Profanisaurus

kbouck··on Project Naptha
... and on iphone/ipad

https://support.apple.com/en-us/HT212630

kbouck··on Ask HN: How can I get data on watt-hours power use per day from my MacBook?
if plugged in and at 100% at the start of the measurement, wouldn't a simple kill-a-watt give a decent per-day measurement?

if you are looking to get the measurement data in the computer, then this isn't for you...

kbouck··on Ask HN: Can I see your cheatsheet?
For those with larger collections (I'm up to ~350 individual sheets), I'm interested to know you access (find/read/edit) the cheatsheets. My way:

(Mac Desktop): I use xbar [0] with a custom script to create a menubar nested dropdown of all of my cheatsheets. Selecting opens in typora [0] for reading/editing markdown.

(CLI): I use cheat [0] which consumes the same markdown cheatsheet content

    [0]: https://xbarapp.com
    [1]: https://typora.io
    [2]: https://github.com/cheat/cheat
kbouck··on ‘Anti-hunger’ molecule forms after exercise, scientists discover
(Anecdata): The past few years I've oscillated between periods of consistent exercise and then periods of inactivity and I definitely notice a pattern wrt hunger.

recent periods:

1. a period of months of inactivity.

2. a period of multiple months of morning exercise (running soon after waking, before any food)

3. a period of multiple months of inactivity

4. a period of multiple months of running again

The pattern I experience is clear: during the periods of exercise, after morning running, I don't feel any need/urge to eat breakfast. Easily skippable.

During periods of inactivity, my body craves breakfast. Not skippable without significant willpower.

kbouck··on One-liner for running queries against CSV files with SQLite
> sqlite3 :memory: -cmd '.mode csv' ...

csv mode can also be set with a switch:

    sqlite3 :memory: -csv
kbouck··on We are removing the option to create new subscriptions
> "Having to think about paying a bill every month"

Others can correct me, but I believe each payment just adds a month of time to your balance. So a number of months can be added at once.

kbouck··on Ask HN: What game do you wish existed?
a game like overcooked except where the players are parents (or babysitters) taking care of too many toddlers that are needy and bent on finding everything dirty or dangerous in the room.
kbouck··on Why isn’t there a decent file format for tabular data?
this doesn't directly address the ease-of-editing concern, but if you have csv (or tsv) and want ascii (0x1f, 0x1e) or unicode(U+241F, U+241E) separated (or vice versa), 'miller' [0] is a command line tool that supports converting among these formats with these one-liners:

    mlr --icsv --oasv cat input.csv  # csv to asv
    mlr --iasv --ocsv cat input.asv  # asv to csv
[0] https://miller.readthedocs.io/en/latest/

[1] https://miller.readthedocs.io/en/latest/file-formats/#csvtsv...

kbouck··on tcpcp - passing TCP connections between hosts (2005)
IBM was doing something like this in their software load balancer ~1996. The technique was used in the large sporting events websites of the day (olympics, wimbledon, ...)

went something like this:

- a routing node (a kernel extension) would receive packets and forward them (verbatim, same src & dest IP) to a backend worker

- backend worker was configured for same IP, which meant: a) arp had to be disabled to avoid conflict, or b) the loopback interface had to be aliased to same IP (using loopback avoids arp conflict and worker still happy to accept the packet and respond)

- response then goes back directly from worker to original source, which was a good approach for scaling web traffic back then, small http requests going through routing node, large responses going back direct from worker to source.

more details:

https://patents.google.com/patent/EP0838931A2/en

kbouck··on Navi- an interactive cheatsheet tool for the command line
also look at cheat. combines community maintained and custom cheat sheets configured as simple text files.

https://github.com/cheat/cheat

kbouck··on Toy Traceroute with Ping
There's a traceroute+ping utility called mtr

https://www.bitwizard.nl/mtr/

kbouck··on Show HN: Jless, a command-line JSON viewer
thanks for plaintextsports too!

don't know what's going on inside of espn but their web experience (mobile or not) is just terrible - and i don't bother with the app. was really looking for something like how simple yahoo sports was back in the day, and plaintextsports seems to be it.

kbouck··on A submarine made from IKEA jar and legos
The YouTube channel linked to here (Brick Experiment Channel) is just great.

From making submarines, to bending steel axles, to making drones, to climbing walls, to lifting heavy loads, all with legos.

Highly recommended if you're into legos or even if you just like getting answers to "can lego do X?"

kbouck··on EspDeck: Home Assistant Macro Pad
I was going to suggest that the resistors could be skipped in favor of internal pull-ups, but that is already covered in the "gen 2 plans" section.
kbouck··on Lego has changed since we were kids (2014)
i always felt that it should be possible to use a raspberry pi or arduino as the controller. with some tinkering i was able to generate IR signals that were accepted by the power functions receivers. and the power functions extension cable seems like a great way to propagate an i2c bus.

there are some pi cases with lego pin-sized holes to help interface the two.

kbouck··on Lego has changed since we were kids (2014)
> "the pile"

it's essential to organize them otherwise locating the piece of interest becomes too frustrating and time consuming. we use a stack of tool boxes from the hardware store to organize ours.

kbouck··on USB Type-C finally shows up in power tools
maybe something like this?

https://eclecti.cc/hardware/tiny-usb-type-c-adjustable-power...

kbouck··on RegExr: Learn, Build and Test Regex
Ultimate Plumber https://github.com/akavel/up

HN discussion: https://news.ycombinator.com/item?id=26644110

kbouck··on The Birth of Rusty N Edie's BBS
the post advertises hosting 15GB which puts it somewhere around mid-1992 based on the progression seen in the splash screen history [0]

[0] https://defacto2.net/g/rusty-n-edies-bbs

← PreviousPage 3 of 7Next →