HNHacker News
TopNewBestAskShowJobs

vietjtnguyen

84 karma · joined October 13, 2016

submissionscomments
vietjtnguyen··on Sguaba: Hard-to-misuse rigid body transforms for engineers
I've done something similar at $WORK for a small project in C++, and I found it extremely helpful in building trust in calculations. Once you do something like this it feels almost insane to do it the typical way where all the calculations are basically manually inlined. Working on robotic systems you're nearly guaranteed to run into a convention mismatch that causes a bug and strong typing it helps eliminate most classes of these bugs (except when you have dynamic frames, but then you can use a dynamic frame tree registry). I need to see if I can open source it.

Just using strong typing to separate the notion of a "position" (looks like it's Cooordinate in sguaba's parlance) from a "vector" alone saves a lot of headaches in making illegal operations like adding two positions.

vietjtnguyen··on A USB Interface to the "Mother of All Demos" Keyset
Custom mechanical keyboard firmware like QMK [1] and ZMK [2] support custom chords called "combos". Basically if the combo's set of keys is hit (within some timeout which defaults to 50 ms) then a specific keycode is sent. You then get a fun game of identifying low probability combos and mapping then to useful keycodes. You also start realizing there's some prime real estate to take advantage of. Two-key combos require some thought cause bigrams can be surprisingly common. Three-key combos are basically open though.

In migrating from the ZSA Voyager to a 36-key keyboard (Chocofi) I've relied on combos as I don't like overloading keys with tap-versus-hold behavior as I can never get the timing down. For example my left index, middle, and ring finger mashed down on the home row (resting position) is escape in my current layout (Colemak mod DK which means keys R, S, and T). It's three fingers but hardly any extra effort. I've managed to do away with a symbol layer and have been quite happy with the result. If anyone is curious here is my "36-key training layout" for the ZSA Voyager [3] and my current Chocofi layout [4].

1: https://docs.qmk.fm/features/combo

2: https://zmk.dev/docs/keymaps/combos

3: https://configure.zsa.io/voyager/layouts/d7L0v/latest/0

4: https://github.com/vietjtnguyen/zmk-chocofi/blob/main/config...

vietjtnguyen··on NotebookLM's automatically generated podcasts are surprisingly effective
One of my favorite ChatGPT uses is voice chat during long drives as a pseudo, albeit interactive, podcast to learn about various technical topics at the edge of my knowledge base. This podcast generation is pretty amazing, but hopefully they make the "competency level" of the hosts tunable. One thing I love is being able to guide ChatGPT to the technical level I'm looking for. Maybe I'm just bad at finding podcasts, but only Signals and Threads [1] really has that interesting depth.

[1]: https://signalsandthreads.com/

vietjtnguyen··on Rerun: Visualize Multimodal Data over Time
Really excited to see Rerun get fleshed out as time goes on. I've used it at $WORK in spare time to visualize multi-agent telemetry and event information for remote operated robotic systems.

To me the most useful feature was actually just the timeline view. Being able to see all of the events and telemetry updates from all agents and correlate them to some line plots was already a huge help. I think Rerun should actually make the timeline view just another "view" [0] so that I can have additional timeline views with specific filters. Seeing the discrete pips in the timeline for different events and channel updates is really helpful.

Also we already have infrastructure to log and for live telemetry streaming so we don't integrate with the SDK directly in the deployed software and instead just have an adaptation layer to take logs or live data and push it through the Rerun SDK. I generally feel it's better to separate the data generation and logging from the data visualization, though I could understand directly integrating the SDK as a fast solution if the infrastructure is not already there. I hope the use case as the data offload/logging for a system doesn't become a focus sink for the Rerun team.

That said, I do appreciate the simplicity of the Rerun SDK API design. At first I wanted to try Foxglove but it seems pretty tied to the supported formats (which we weren't outputting for heritage reasons) and my eyes glazed over when I saw how much work (I perceived) it would take to integrate with their custom websocket interface. This was all spare time exploration so I basically dropped it once I saw how much code there was in the example [1].

[0]: https://rerun.io/docs/reference/types/views

[1]: https://github.com/foxglove/ws-protocol/tree/main/python/src...

vietjtnguyen··on NASA Uses RISC-V Vector Spec to Soup Up Space Computers
Dual-redundant gets you error detection without correction whereas triple-redundant with majority voting can get you error detection with correction in the case that one fails. The error detection with dual-redundancy only works if one fails. If both fail and both fail in the same way you won't be able to detect it, but you basically accept the risk that it's an improbable event. The "correction" in the dual-redundant case is typically reset into some known state rather than trying to correct and continue operation.
vietjtnguyen··on NASA puts jet propulsion lab on blast over Psyche mission failures
> If the overall lack of experienced technical personnel were such an issue, why are the project failures on the software side, with zero issues reported on the mechanical side?

Slide 38 explicitly lists staffing challenges in GNC (guidance, navigation, and control), FSW (flight software), avionics, and systems engineer.

Slide 41 also talks about external factors: "...this has required the experienced cadre to be spread thin... the rise of the commercial space industry in recent years has resulted in competition for experienced personnel, particularly in the systems engineering, GNC, and FSW areas."

vietjtnguyen··on NASA puts jet propulsion lab on blast over Psyche mission failures
Hard to put much blame on her I think. She only joined JPL this year. Psyche was selected back in 2017.
vietjtnguyen··on Leap: Neovim’s Answer to the Mouse
I was in the same boat. What made me switch is Leap supports jumping across panes/windows.
vietjtnguyen··on City Generator
For anyone looking for more depth for their TTRPG games I highly suggest exploring https://eigengrausgenerator.com/. It will lazily generate beautiful, varied details on a town, it's locations, it's buildings, it's denizens, their relations, provide story hooks, and more. Like a good game master it gives just enough surface detail to maintain the immersion, but will generate more detail as you (or your players) interact with whatever catches your (their) fancy.
vietjtnguyen··on Git 2.33
Cool to see feedgnuplot (https://github.com/dkogan/feedgnuplot) in the wild here: https://i1.wp.com/user-images.githubusercontent.com/443245/1...
vietjtnguyen··on Feedgnuplot – plotting standard input in the shell
I use https://github.com/dkogan/vnlog/ and feedgnuplot for $WORK and it strikes a wonderful balance of simplicity and effectiveness for both quick data exploration and shell scripted data analysis and report generation.

What took me a bit to grok at the start was how feedgnuplot's different flags change how it assigns semantic meaning to different data columns. So by default the first column is simply treated as data (y) while the implicit row index becomes the x axis. If you add --domain the first column becomes your domain (x) and the second column your data (y) allowing you to create a scatter plot. If you have multiple curves you can add --dataid with --domain which makes the first column x, the second column the id of the curve that point belongs to, and the third column the data itself (y). You can throw in more dimensions of visualization by mapping columns to colors, point size, or 3d.

Typing it out it sounds more complicated than it really is. Combined with vnlog to easily select columns and filter rows it becomes a really powerful command line tool set.

vietjtnguyen··on Ask HN: What data visualization tools do you use?
Outputting vnlog, using those tools to filter, and then plotting using feedgnuplot have covered most of my visualization needs.

https://github.com/dkogan/vnlog

https://github.com/dkogan/feedgnuplot

vietjtnguyen··on Perseverance Rover lands on Mars [video]
Sure. I meant it more in the sense that there are some launch costs associated with the Mars Helicopter because it consumes mass budget.

As to the SpaceX point. Yes, I think SpaceX is more efficient with their money than NASA, but this will boil down to a discussion of counterfactuals and degrees of "wastefulness". Was NASA wasteful? What does it mean to be wasteful? What's the threshold? What would it cost SpaceX to build the Mars Helicopter? Can we really compare a launch vehicle versus a tech demo of a rotorcraft operating on another planet? Would that $80M be better spent just funding SpaceX? I don't know. I just don't think it's fair to simply say "If it was made with off-the-shelf parts then it's a testament to how wasteful NASA has become". The engineering has to happen. Could NASA have been more efficient with it? Probably. Was it wasteful? I don't think so.

vietjtnguyen··on Perseverance Rover lands on Mars [video]
They can't exactly procure a bunch of parts and then call it a day. Lots of the cost is tied to the verification and validation. Then there's the system design, requirements engineering, trade studies, system integration, engineering models, simulation, software, environmental testing, launch costs, ground command and data systems, interfacing with the rover, etc. Paying engineers to do all that is what makes it so expensive.
vietjtnguyen··on Show HN: A modern documentation tool for C++ and a replacement for Doxygen
I'm surprised there isn't cross-linking amongst types? If the function listing is `Foo bar(const Baz& x) const` I'd expect `Foo` and `Baz` to be links to those type definitions.
vietjtnguyen··on Throw away code
If you haven't, you should explore domain-driven design (DDD). It's an explicit idea in that framework that a problem needs a "ubiquitous language" and an identified "bounded context" where the said language is valid.

Like you, when approaching a new problem I like to nail down the terms we are discussing, literally scaffolding classes and types (in C++) as the problem is being discussed. It drives the adoption of unambiguous terms. Then as solutions are discussed the "ubiquitous language" helps clearly identify the interactions between types.

vietjtnguyen··on Linux Productivity Tools (2019) [pdf]
feedgnuplot [1] is wonderful for quick visualizations of data from the shell. Also great for decoupling visualization from CLI programs.

[1]: https://github.com/dkogan/feedgnuplot

vietjtnguyen··on When did I run that command? Update your Bash prompt with the command start time
I just write all my commands to a log. It's saved me a number of times.

https://spin.atomicobject.com/2016/05/28/log-bash-history/

vietjtnguyen··on Show HN: Screen – screen sharing for remote work, by the cofounder of Screenhero
I guess I should have qualified my post, I did look at Screen (OP) and it definitely does more than just sharing a terminal. It also just reminded me of something I've done before (Screen -> screen -> tmux -> gotty, the mind is so good at connections) which I thought was apropos and worth sharing.
vietjtnguyen··on Show HN: Screen – screen sharing for remote work, by the cofounder of Screenhero
Something I've done before to share a screen with coworkers is to work in tmux and start a web tty service like gotty (https://github.com/yudai/gotty). After you resolve the standard network issues (port visibility and whatnot) you just need to configure it with `tmux attach` as the starting command. tmux already supports shared sessions if multiple terminals attach to the same session, the session window size simply shrinks to the minimum of all clients. If you've established trust then you can use --permit-write with gotty to actually work in the same terminal. Hop into a voice chat and you've got pair programming.
vietjtnguyen··on OMG: Our Machinery Guidebook
Quick typo under OMG-CODEORG-2:

    #pragma once

    #ifdef __cpluspus // <-- should be __cplusplus
    extern "C" {
    #endif

    #include "api_types.h"

    // ...

    #ifdef __cplusplus
    }
    #endif

Can't say I'm a fan of OMG-CODEORG-3, however, it sounds like compilation time is a key metric for them.. I prefer a John Lakos style "physical components" set up which emulates a type-as-module inclusion style. At least OMG-CODEORG-3 clearly states that include order becomes important as a result.
vietjtnguyen··on Ask HN: Have you ever inherited a codebase nobody on the team could understand?
This is like the second law of thermodynamics applied to code.
vietjtnguyen··on OOP Is Dead, Long Live OOP
I guess I meant to ask what they mean by dependency injection. A bare version is just passing dependencies as arguments and I can't imagine what is so egregious about that. Maybe they mean something more complicated?
vietjtnguyen··on OOP Is Dead, Long Live OOP
What do you mean by DI? I find DI is an overloaded term.
vietjtnguyen··on An Interesting Pattern in the Prime Numbers: Parallax Compression
Using your frames here's the sequence as N goes from 2 to 90 with a stride of 2: https://streamable.com/l7r96
vietjtnguyen··on Minideb – A small image based on Debian designed for use in containers
So it becomes a matter of whether or not you can achieve good coverage of your execution paths to account for all possible filesystem touches? Further invocations of "cde" with respect to the same "cde-package" folder will actually append to the "cde-root" file system copy so if you could manage to canvas your program's execution paths then the resulting file tree copy should be sufficient?
vietjtnguyen··on Minideb – A small image based on Debian designed for use in containers
I don't really work in this domain so maybe I'm missing something. If the goal is to essentially get the bare minimum needed to run a program into a Docker image why not develop your program in your desired environment and then use something like CDE [1] to copy (or obtain a list of) all the files touched in the desired invocation of the program. That copy or list can then be put into a tarball and imported with "docker import". Philip Guo even writes about this possible use [2].

Here's a silly example:

  cde python -c "import numpy as np; print(np.random.randn(3, 3).tolist())"
  pushd cde-package/cde-root/; tar cavf ../../cde-image.tar *; popd
  docker import cde-image.tar $USER:python-randn33
  docker run $USER:python-randn33 python -c "import numpy as np; print(np.random.randn(3, 3).tolist())"
  docker run -t -i $USER:python-randn33 python
If you look at the resulting "cde-image.tar" you'll find it to be quite bare. Mines had only 387 entries (files and folders).

[1]: http://www.pgbovine.net/cde.html

[2]: http://pgbovine.net/automatically-create-docker-images.htm

vietjtnguyen··on Objects designed to explore the universe are now challenges for spaceflight
The lame answer is "it depends", but you might find this chart enlightening: http://www.heavens-above.com/IssHeight.aspx
vietjtnguyen··on Recommendations about coding in C++
He does say "usually" so it doesn't seem like that strong of a statement.
vietjtnguyen··on Timing the time it takes to parse time
For your point about Python string concatenation, I believe that's what io.StringIO is for (https://docs.python.org/3/library/io.html#io.StringIO).