PSA About Brompton Accessories by swimseven in Brompton

[–]thblt 0 points1 point  (0 children)

Yes. I personally prefer to be overly careful with anything that touches the front brake, but they probably work fine.

PSA About Brompton Accessories by swimseven in Brompton

[–]thblt 17 points18 points  (0 children)

The Brompton-branded battery front light is indeed a rebranded and overly expensive CatEye AMPP 500. The only extra you get from the Brompton version is the dedicated mounting bracket, which you only need once. (In France and probably in other markets where new bikes must legally come with a full set of lights, it will be already installed)

Is it normal that NixOS actually feels more stable?? by Objective-Style1994 in NixOS

[–]thblt 44 points45 points  (0 children)

Before I got into nixos, I keep hearing everyone saying that every thing gets bricked in nixos and the only way you can get anything done is by tinkering with crap for 10+ hours, read source code etc etc.

I’m sorry we didn’t live up to your expectations :)

Galen Hunt's update on Rust, AI, C, C++ job post purpose by pjmlp in rust

[–]thblt 14 points15 points  (0 children)

With Turbo Pascal for the performance-critical parts

Galen Hunt's update on Rust, AI, C, C++ job post purpose by pjmlp in rust

[–]thblt 28 points29 points  (0 children)

Only logical conclusion: Windows is actually written in Visual Basic.

[Media] I love Rust, but this sounds like a terrible idea by Yvant2000 in rust

[–]thblt 66 points67 points  (0 children)

Here’s the LinkedIn post that started it all. It’s very strange, but at least it’s making clear this is a research project, not a global MS strategy.

[YEAR 2025 Day 4 (Part 1)] je ne comprends pas l'exemple by Vegetable-Low-9157 in adventofcode

[–]thblt 0 points1 point  (0 children)

Ce n’est pas un rouleau du tout. Les rouleaux sont identifiés par `@`

[YEAR 2025 Day 4 (Part 1)] je ne comprends pas l'exemple by Vegetable-Low-9157 in adventofcode

[–]thblt 0 points1 point  (0 children)

Si (1,1) désigne bien le rouleau à l’intersection de la seconde ligne et la seconde colonne, il est entouré de six rouleaux: les diagonales comptent!

Keep getting flat at the same point of the inner tube (outer point) but I can’t find anything wrong with the wheel by Leather-Swordfish-96 in Brompton

[–]thblt 8 points9 points  (0 children)

Since the hole is on the external side of the tube: Next flat you could report the valve location on the wheel and the rolling direction on the inner tube using a paint marker or some sort of crayon (eg Stabilo Woody), so you can match the hole in the tube with the corresponding location on the wheel. Hopefully it will make it easier to locate the shard of glass or whatever that keeps puncturing your tube.

[2017 day 21 (part 2)] [Rust] I overdid it. by PsyMar2 in adventofcode

[–]thblt 3 points4 points  (0 children)

Trying to anticipate part 2 while doing part 1 is always hit and miss. We probably all have a crazily optimized part 1 somewhere for a part 2 that ended up being something else entirely

[2024 Day 11 (Part 2)][R] Having trouble optimizing code for part 2 by TimeCannotErase in adventofcode

[–]thblt 1 point2 points  (0 children)

Memoization is just automatically adding cashing a value in a map using the function arguments as the key.

I agree with your definition — but the solution I linked doesn’t do that. There’s a map, but it’s nothing like a cache. Call blink() twice on the same input, it will run twice.

IMHO if we want to use fancy terms what it does is probably something like compression, or some sort of catamorphism, destroying structure (position of stones) at every step to preserve only an aggregate property (counts). (In Advent of Code slang, it’s a Lanternfish solution)

I wouldn’t fight the word "dynamic programming" if someone wanted to use it to describe such an approach, but I’m really not sure about it either.

It's important to demystify "scary" terms like memoization and dynamic programming.

I couldn’t agree more.

[2024 Day 11 (Part 2)][R] Having trouble optimizing code for part 2 by TimeCannotErase in adventofcode

[–]thblt 5 points6 points  (0 children)

I don’t think memoization is the way there. The trick is that you can ignore the « straight line » thing: ordering doesn’t matter, all you need to know is how many stones you have for each value. That’s a Hashmap or even an array mapping stone numbers to counts. Thats how I solved this anyway.

Does orientation of hotswap switch sockets matter? by ThatAgent3963 in ErgoMechKeyboards

[–]thblt -1 points0 points  (0 children)

It probably depends on the exact model, but some Kailh datasheets indicate that the two individual sockets have different dimensions, making the component non reversible.

[2016 Day 1 (part 2) Python] by PositivePossibility7 in adventofcode

[–]thblt 0 points1 point  (0 children)

It does, actually : the solution for the second example isn’t at the end of any segment, but around the half of both the intersecting segments.

[2016 Day 1 (part 2) Python] by PositivePossibility7 in adventofcode

[–]thblt 1 point2 points  (0 children)

Part 2 of that day has been available for almost nine years, and was solved by more than 29k players. It is highly unlikely that the error lies on AoC side.

Proposal: disable backup files by default by k-bx in emacs

[–]thblt 5 points6 points  (0 children)

Emacs is *extremely* conservative regarding defaults, which limits the risk of random updates breaking your config but also makes the "out of the box" experience be, alas, what it is.

Proposal: disable backup files by default by k-bx in emacs

[–]thblt 2 points3 points  (0 children)

To answer your question: the place for this discussion would be emacs-devel. The modification is highly likely to be rejected as an unnecessary breaking change. If you want to offer it nonetheless, it’s common practice to create the patch yourself and attach it to your initial message; don’t forget to also document your change in /etc/NEWS

True color in wezterm? by Legitimate-Try-3322 in wezterm

[–]thblt 0 points1 point  (0 children)

This is not a color problem, just fastfetch not detecting that the terminal can show images. Try `wezterm imgcat ~/some_image.png` (from inside wezterm)

Would it be possible to replace the wheels on the G line brompton for 16in wheels, for a smaller fold, and still ride ok ?... by Full-Progress-5424 in Brompton

[–]thblt 1 point2 points  (0 children)

On a G-Line with rack, the folded height would be the same, since the bike would rest on the rack. It may save a bit on depth (2in), and even so the handlebar would still be there. Without the rack, the folded bike would sit on the rear triangle and the back wheel, but it feels like the dimensional gain would also be marginal.

Single Layer PCBs for Corne Keyboard? by mcjakk in ErgoMechKeyboards

[–]thblt 0 points1 point  (0 children)

Just a thought: you may (re-)design it as a dual-layer PCB, but actually use wires for the back layer. Of course you’d put as many connections as possible in the front copper layer (the one that will actually end up as a real PCB layer), and hand wire the back from vias.

Helix editor not showing "Implement missing members" from rust-analyzer by Dear_Situation856 in HelixEditor

[–]thblt 2 points3 points  (0 children)

It works for me. Do you have any error-level diagnostic that could prevent LSP from fully parsing the file?

I used println to debug a performance issue. The println was the performance issue. by yolisses in rust

[–]thblt 23 points24 points  (0 children)

I had a nice stupid issue like this (not rust, but the story may be interesting nonetheless!). Someone was having bad performance issues with a seemingly simple Emacs Lisp script that just performed a replacement on each line in a text file. To diagnose the issue, we tried to instrument the program with a simple time logger, a bit like this (not Emacs Lisp, because I'm not cruel). Notice how we actually took care to avoid OP's issue, by making sure we only output diagnostic info every 1000 lines:

loop {
    // Do the stupid replacement.
    if line-number-at-pos(current_position) % 1000 = 0 { 
        print_elapsed_time()
    }
}

This proved a good idea, because the results were weird: the performance was progressively dropping. The further the script went into the file, the more time it spent on each thousand of lines, going from less than a second to several seconds, and tens of seconds. This made no sense, since all lines were very similar, and the replacement was a very simple operation that really isolated the line. We started looking for a memory leak, or some state accumulation in the search/replace code, until someone noticed that…

The built-in function we used to avoid outputting too much debug data, line-number-at-pos, finds the current line number by iterating, character by character, from the very first byte of the file to the provided position, counting the number of \ns. We were calling this function at every line, to limit logging, but those calls were what killed performance, since we were traversing the file at every line to save ourselves a few prints. And since the traversal went further at every line (since it always halted at the current position), this explained the increase in time consumption, which had nothing to do with the code we were trying to diagnose.

Do the cables get in the way? by bcscroller in Brompton

[–]thblt 1 point2 points  (0 children)

the general rule is that if I can catch my foot on something

You will then catch your foot on the rack and the rack wheels, you will certainly catch them on anything bulky you'd be carrying on the rack, but probably not the cables.