HNHacker News
TopNewBestAskShowJobs

lnyng

321 karma · joined October 5, 2017

submissionscomments
lnyng··on A Rust API Inspired by Python, Powered by Serde
Interesting post. We wrote this “below” utility [1] that monitor system metrics similar to atop. We want the ability to collect all metrics into a single object, pass it around and visualize it elsewhere. Naturally we need some way to query into fields or even nested-struct fields. For example, to get the file cache usage of a particular process, we need to go through sample->processes->pid->memory->file cache. To do it ergonomically and also type-safely, we end up using proc macro to generate enums that represent field paths of the structs and then use them to query values of non-struct (leaf) fields. I always wonder if there are simpler ways or existing proc macro derives to safe us the efforts. Maybe I do need to look into serde internals for some inspirations.

[1] https://github.com/facebookincubator/below/blob/main/below/b...

lnyng··on I made a game you can play without anyone knowing (no visuals/sound)
Additional suggestions:

- increase tolerance to slightly off taps, and gradually increase the number of ticks (not sure you already do this but right now it’s too hard win many times in a row)

- tik of the day mode. A long tick that challenges people who can win it in fewest trials

lnyng··on I made a game you can play without anyone knowing (no visuals/sound)
Bought and played for a while, 83 attempts with 12 corrects and max 2 corrects in a row. It s a very difficult game without visual and sound to aid figuring out the exact rhythm, and the game seems very strict about how much you can be off.

Suggestions: - have an option to add 4 constant interval tiks at the beginning to help setup the base rhythm - hold down the small white dot to return to menu so you can see progress without exiting - have a way to visualize a rhythm similar to the example or skip it (maybe two finger hold?) if you are stuck - some rhythms feel to have slightly uneven tempo. Is the duration of the tick taken into consideration when generating the tempo?

Interesting game overall. Well done

lnyng··on Toothpaste Null-Terminator
Many years ago I learned from some Japanese TV show that you can use centrifugal force to get the very last bit of toothpaste out of the tube even if you can’t squeeze out any more. Something similar to this: https://m.youtube.com/watch?v=u-4MKefJqbc
lnyng··on Fiber optic drone control beats any RF jammer
What if deploy some high altitude balloons as base stations.
lnyng··on I built an ROV to solve missing person cases
One of the best articles I have read for years. It's easy to underestimate how difficult it is to make things "just work" in the first trial. I really envy the author's ability to plan for known and unknown situations. Marvelous job!
lnyng··on Linux ate my RAM (2009)
We published this paper "TMO: Transparent Memory Offloading in Datacenters" last year which covers some Linux memory management mechanisms that may be quite useful for providing reasonable estimations to application memory usage.

We observed that the real memory footprint for applications depends on many factors: file access pattern, disk IO speed (especially if swap is enabled), ssd vs hdd, application latency sensitivity, etc. Instead of coming up with some overly complicated heuristic, we use the Linux kernel provided memory.pressure [0] metric via cgroup v2. It measures the amount of time spent waiting for memory (page fault etc). Then by slowly reclaiming memory from the application until its memory pressure hits some target (say 0.1%), we can claim that the steady state usage is the actual memory footprint.

This may not be useful for PC but could be very useful for data center to track memory regression, and also to harvest disk swap without concerning too much about the cliff effect when the host runs out of memory and suddenly kernel pushes everything to swap space.

[0] https://facebookmicrosites.github.io/cgroup2/docs/pressure-m...

lnyng··on Inky Impression 5.7“ – Colour e-ink display for Raspberry Pi
Very nice! I would like to diy this into a picture frame. Wonder where would be a good place to find/make frame and casing that fit it?
lnyng··on Attacking Titan M with Only One Byte
For a moment I thought this is something related to the anime
lnyng··on Type-checked keypaths in Rust
I created something similar for our project “below” (https://github.com/facebookincubator/below/blob/main/below/b...).

The program collects system resource metrics into a data structure and we need to display the fields with different styles and formats. In order to decouple the data structure from rendering, Queriable (Keyable) and FieldId (combine KeyPath + mirror struct into enum) are used. I will definitely like to checkout the KeyPath implementation as it seems more general.

lnyng··on Show HN: Tetris, but silly
Is it possible to make use of gravity sensor on phones?
lnyng··on ArtFrame: E-paper wireless artwork for your living room
I was recently searching for wedding gift for my photographer friend and found this. There does not seem to exist many other e-paper art frames and this one looks decent. It also has some open source software (https://github.com/framelabs-eu), but the firmware seems closed-source.
lnyng··on ArtFrame: E-paper wireless artwork for your living room
But that requires a wire that goes from the outlet all the way to the charge pad though, right? I think the main goal is to have no visible wire when it's on the wall. On the other hand 7k image changes before going out of battery seems quite a lot. Just not sure if that's a representative number.
lnyng··on Sinking 1K NYC subway cars in the Atlantic to create a reef didn’t go as planned
This reminds me of Splatoon 2’s deep sea metro. Can’t help laughing lol
lnyng··on How Microsoft reduced Windows 11 update size by 40%
> Not regress install time.

They seems to achieve size reduction by transmitting only the forward upgrade patches, and let the machine generate the downgrade patches during the upgrade. How do they manage to keep install time the same while this definitely uses more resources (cpu, io)?

lnyng··on China has forbidden under-18s from playing games for more than three hours/week
I believe this all comes down to enforcement, which is grey in the first place. It also matters if the game got (maliciously) reported to enforcement agents.
lnyng··on China has forbidden under-18s from playing games for more than three hours/week
I wonder if the journey article author didn’t think online game differs much with general games.
lnyng··on China has forbidden under-18s from playing games for more than three hours/week
Original notice from the government: https://web.archive.org/web/20210830120201/http://www.nppa.g...

Google translation of the first entry:

> Strictly limit the time for providing online game services to minors. Since the implementation of this notice, all online game companies can only provide minors with one-hour online game services from 20 to 21:00 on Friday, Saturday, Sunday and legal holidays. At other times, it is not allowed to provide online game services to minors in any form.

lnyng··on Show HN: Website changes design each time you blink
I almost feel that the camera is blinking with this guy.
lnyng··on Ghidra: A software reverse engineering suite of tools developed by the NSA
This strange looking name remind me of Ghoti: https://en.m.wikipedia.org/wiki/Ghoti
lnyng··on China Blocks Didi from App Stores Days After Mega U.S. IPO
There is rumors that Didi is punished for transfer large amount of user data to US government. One of their Vice President denied it.
lnyng··on Lego Ideas Typewriter
Opening this link with my Firefox iOS 34 crashes the browser reliably. Anyone else seeing this issue?
lnyng··on The Supreme Court overturns Oracle's copyright win over Google
[Duplicate] https://news.ycombinator.com/item?id=26699106
lnyng··on How America's Cup boats fly (2017)
Video on a more recent design: https://www.youtube.com/watch?v=VQUl_hf6yo8
lnyng··on Mouse found atop a 22,000-foot volcano, breaking world record
No joke my first thought reading the title was that some researcher left his laptop equipment over there.
lnyng··on God be with you till we meet again (1918)
Bowel seems to originate from old French “Bouel,” which I guess are related?
lnyng··on Enabling developers and organizations to use differential privacy
Maybe because the privacy policy is “differential”?
lnyng··on IEEE forced to ban Huawei employees from peer-reviewing papers
Source from IEEE. Read the attachments about the policy details.

http://www.ieee802.org/secmail/msg23427.html

lnyng··on Vim Anti-Patterns (2012)
For the advice towards ESC key, anyone uses ctrl+c for quitting insert mode? I didn't know about the ctrl+[ combo works too.
lnyng··on YUML – Easy Embeddable Diagrams
Not exactly for the same purpose, but anyone knows about Graphviz [1]? Super expressive and you can visualize online in viz.js [2].

[1] https://www.graphviz.org/ [2] http://viz-js.com/

Page 1 of 2Next →