Better HN
topnewbestaskshowjobs
Log inSign up

nitros

134 karma · joined Mar 6, 2017 (9y ago) · 35 submissions

Submissions

comment 2mo ago · link · parent

The size of the type name isn't correlative, but the nesting depth of types roughly corresponds with how many function bodies are going to be generated. In the GUI library, the HStack/VStack types are type-parameterized by their children, which results in a new copy of the layout function for each combination of children types.

comment 2mo ago · link · parent

A large part of this project was my personal learning. Ultimately I didn't improve the functionality of the device by a large margin; instead I learned a lot about how these devices are built. If I'd let Claude write replacent firmware it would've all been for naught.

comment 2mo ago · link · parent

This is definitely something to be aware of. Installing this firmware definitely invalidates the StVO (though I can always flash the original firmware back). Personally I am morally sound with replacing the firmware of the display unit as the critical functionality is still handled by the motor controller (for example, the brake lever sensors are wired to the motor controller directly, and the display must report the throttle position constantly to not trigger a shutdown); the display unit would need to contain intentionally malicious code to cause problems.

comment 2mo ago · link · parent

With a SWD probe on the cracked open display initially, and this was necessary while I was still writing/porting the peripheral drivers. Once the firmware was stable (and after I'd asserted that it wasn't possible to accidentally brick the scooter) I moved to testing on the real scooter where the only feedback is if things work or not.

comment 2mo ago · link · parent

Yep, this is the case. Nine frames are transmitted with the first frame containing a sequence number and the first five bytes, followed by seven frames containing just data, and a final frame containing the last three bytes of data, and a two byte CRC.

comment 2mo ago · link · parent

Heya, I tried using slint first, but slint needs even more flash, and an allocator on top. Just adding slint (with an empty UI) exhausted my binary size limit.

7.

Reverse engineering my E-Scooter and rewriting it in Rust(bensimms.moe ↗)

2 points · by nitros · 2mo ago · discuss

comment 3mo ago · link · parent

I find I've not read HN as much over the last two years due to this. I think I see one interesting article a day at most now.

comment 3mo ago · link · parent

I've used https://aisler.net/en (based in Aachen) plenty of times. I like their quality and I was able to pull off some stupidly toleranced layouts. (This is as a hobbyist building some one-off circuit boards). I haven't used their assembly service.

comment 3mo ago · link · parent

FYI: Aisler is the PCB manufacturer and assembler (based in Aachen iirc). LibrePCB is CAD software.

comment 4mo ago · link · parent

> But it turns out there's all sorts of delightful data structures that you can only express with unsafe in Rust. Intrusive doubly linked lists are the coolest thing ever.

I don't mean this to be a gotcha, but I think it's important to say that we can have these in rust too! The only difference is that the first thing we have to talk about is you the user can go about using an intrusive collection correctly. I love the cordyceps crate for this. If you want to be able to use your type as a linked list node, you must implement a Linked trait, the documentation of which clearly explains how to use it safely: https://docs.rs/cordyceps/latest/cordyceps/trait.Linked.html

comment 4mo ago · link · parent

I really enjoy using Rel8 (https://rel8.readthedocs.io/), so much so that I reimplemented it in Rust (https://github.com/simmsb/rust-rel8).

For me I find it's an excellent step up from a plain SQL query builder (with an API such as `select(Foo).join(bar)`) as it lets me both effortlessly perform projections (one can write `(\e -> (e.foo, e.bar) <$> someQuery` to take a query producing rows of `E` and turn it into rows of 2-tuples built from two projected fields.

I wrote a bit about my Rust rewrite here: https://bensimms.moe/postgres-lateral-makes-quite-a-good-dsl...

13.

Postgres's lateral joins allow for quite the good eDSL(bensimms.moe ↗)

93 points · by nitros · 7mo ago · 24 comments

comment 7mo ago · link · parent

This entire paper smells of LLM, I'm sure even the most distinguished academic would refrain from using notation to prove that the SIP status cannot change during operation.

comment 7mo ago · link · parent

I'm suspicious of this prediction given the curl project's experiences...

comment 8mo ago · link · parent

Months if the firmware properly sleeps.

comment 8mo ago · link · parent

I don't see much motivation for fixing that when I can purchase a nrf52xx Bluetooth Beacon on aliexpress for €4 and flash it with firmware that pretends to be 50 different airtags, rotating every 10 minutes, and therefore bypassing all tracker detections.

comment 8mo ago · link · parent

It's probably less damaging to recommend abusing Xanax than recommending using a LLM.

comment 8mo ago · link · parent

Klopilot: Klo ~ Toilet Vibrierkot: Kot ~ Faeces

comment 9mo ago · link · parent

How exactly does distilling a censored model produce an uncensored model?

comment 1y ago · link · parent

This is like saying Haskell doesn't have immutability because it has the state monad, or that rust doesn't because you can shadow with let.

Data is immutable and thats much more important than whether local variables can be modified imo.

comment 1y ago · link · parent

It's also becoming possible to have transparent rigid PCBs as of quite recently: https://www.pcbway.com/blog/News/Transparent_Rigid_PCBs_Laun...

Naturally it does mean you can't have a ground pour, so the PCB needs to be designed to look nice with it.

comment 1y ago · link · parent

Also might be interesting to read about: https://embassy.dev/

comment 1y ago · link · parent

The following should fix that:

  defaults write org.gnu.Emacs NSAutoFillHeuristicControllerEnabled "NO"

comment 1y ago · link · parent

Eh, Emacs isn't really a system where broken behaviour goes unnoticed. It either works as you expect or something isn't working correctly.

comment 1y ago · link · parent

Nope, but it's not so different to irregular plural forms or verbs in english.

Afaik: At some point in the history of the language there would(?) have been rules for these nouns, but not today.

comment 2y ago · link · parent

bracket [1] is easy to use and ensures that the cleanup operation runs, the Control.Exception module is also well documented [2]

[1]: https://hackage.haskell.org/package/base-4.20.0.1/docs/Contr...

[2]: https://hackage.haskell.org/package/base-4.20.0.1/docs/Contr...

comment 3y ago · link · parent

The low base clock is likely RF certification related

comment 4y ago · link · parent

https://stallman.org/articles/on-hacking.html

comment 4y ago · link · parent

For maximum 'performance' you can do it in-kernel with eBPF :^) https://github.com/simmsb/traceroute-spoof
12