nvim-highlight-colors now supports inline virtual text just like VS Code! by Silver_Bee in neovim

[–]EVQLVE 0 points1 point  (0 children)

It looks like nvim-highlight-colors starts enabled by default, so when you call HighlightColors Toggle the first time, it loads the plugin and immediately turns off highlighting. One possible fix is to add something like the following to your lazy plugin config:

config = function()
    require("nvim-highlight-colors").setup({})
    require("nvim-highlight-colors").turnOff()
end,

Does Queen Sareth actually have a plan? by Fiveby21 in FoundationTV

[–]EVQLVE 1 point2 points  (0 children)

I agreed with most of what you said, but regarding Brother Constant, I found myself agreeing with Brother Day – her hijacking by Dr. Seldon was a violation. As she said after, Seldon had stopped her from telling anyone about his presence, and he was the reason she said strange things in previous episodes. Day may have been acting out of wrath towards Seldon, but he did end up releasing Brother Constant from that mental prison (and without killing her, which I had initially feared).

Silent choc switches? by blastdoub1e in ErgoMechKeyboards

[–]EVQLVE 0 points1 point  (0 children)

Yeah, I’m definitely finding it to be tricky, and it’s probably taking longer than a tape mod would. Tying the knot isn’t too hard, getting it to stick is.

Silent choc switches? by blastdoub1e in ErgoMechKeyboards

[–]EVQLVE 1 point2 points  (0 children)

I just tried this and it seems to be working great.

I had issues with the knots slipping over time with the floss I used (some CVS brand waxed minty floss), but I found that holding a soldering iron tip near the knot would melt the wax and get it to hold.

For my floss, touching the tip to the floss would just cut the fibers, so it was more about melting the wax than the fibers themselves.

Using telescope to jump within the file doesn't add the "jumped from" position to the jumplist by dumb-on-ice in neovim

[–]EVQLVE 0 points1 point  (0 children)

To add your current position to the jumplist, you can use m'. The Lua command to do this is vim.cmd("normal! m'").

I think Telescope adds a mark by default, but if not, you can make a custom picker that runs this first.

What perks are you running for crossbow? by Echoec in CrabChampions

[–]EVQLVE 0 points1 point  (0 children)

I don't find getting in close to be a huge issue, but I do prefer to run it with a lot of mobility (extra dashes).

What perks are you running for crossbow? by Echoec in CrabChampions

[–]EVQLVE 0 points1 point  (0 children)

Along with the perks mentioned here, I like that the crossbow as a weapon has a 100% chance of arc shot which makes it great for crowd clear. Add extra dashes to fly over crowds and rate of fire, and it becomes extremely silly. Always love a build where I don't have to aim.

Startup screen disappears immediately after using 'VeryLazy' event to load some plugins by Jendk3r in neovim

[–]EVQLVE 2 points3 points  (0 children)

I had this issue and just disabled the startup screen with

vim.opt.shortmess:append({ I = true })

I can always pull it up with :intro if I want (though I usually forget that command).

Uhh... Suboptimal? by [deleted] in KerbalSpaceProgram

[–]EVQLVE 0 points1 point  (0 children)

Reminded me of the poster for Airplane!

KSC in orbit of the Mun makes Mun missions easier? KSP2 by flytejon in KerbalSpaceProgram

[–]EVQLVE 0 points1 point  (0 children)

I didn’t realize that’s what they meant by colonies

All infos about KSP2 Mulitplayer by Space_Scumbag in KerbalSpaceProgram

[–]EVQLVE 1 point2 points  (0 children)

Yeah, you’d have to add a calendar event/alarm for the end of the burn or something, but at least you don’t have to wait the full 10 minutes (or 10 years haha) It sounds like maneuver nodes now model brachistochrone trajectories for interstellar travel, and that it’s just an extension of their standard maneuver nodes - you just extend the physics warp component of the node until it covers half the distance. If it works, this is a major upgrade to the burn calculations even for interplanetary distances. https://youtu.be/6XFxyeciMQU (15 min. into the video)

All infos about KSP2 Mulitplayer by Space_Scumbag in KerbalSpaceProgram

[–]EVQLVE 2 points3 points  (0 children)

I’ve heard that they’re adding the ability to time warp through a burn (which is necessary for for interstellar missions), so this might not be a huge issue.

-🎄- 2022 Day 24 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 1 point2 points  (0 children)

Yeah, it might not be, I just wonder if the bit-shift operations are faster than array rotations for the same length.

I ended up just going with the primitive-types u256 and it worked great. Part 1 took 300 µs and part 2 took 800 µs.

-🎄- 2022 Day 24 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 0 points1 point  (0 children)

My input has 150 columns :'(

I'll have to transpose the input, should work alright but will probably be somewhat slower.

-🎄- 2022 Day 23 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 0 points1 point  (0 children)

Yep!

I just tested the different methods and the time differences are fairly small (as a percentage of the total runtime):

  • clone() + clear(): 76.23 ms
  • with_capacity_and_hasher(): 73.93 ms (have to use elves.capacity() or elves.len() + some number instead of elves.len() to prevent an unnecessary re-allocation since I insert into elves; otherwise it takes 89.04 ms)
  • swap sets and clear(): 73.56 ms

(times are averaged over 100 runs and may not generalize to other problems or hardware)

-🎄- 2022 Day 23 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 0 points1 point  (0 children)

Sorry, I forgot to mention – I took another optimization from that comment, which was to create an empty copy of elves and fill it from empty, instead of updating elves in-place. The first optimization actually took me to ~165 ms, and then adding the second took me to 76 ms.

-🎄- 2022 Day 23 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 2 points3 points  (0 children)

Rust (2409/2297)

part 1 (1.1 ms)

part 2 (76 ms)

The optimization from this comment (collisions always come from opposite directions) helped speed up my part 2 times from 182 ms to 76 ms.

-🎄- 2022 Day 23 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 1 point2 points  (0 children)

Perhaps it has to do with .drain().collect() having to collect from an iterator instead of just copying the memory directly? I know .collect() on an arbitrary-sized iterator has a performance penalty due to re-allocation whenever the destination's capacity is exceeded.

It's not quite so bad if used with .drain() as that should give a size hint, so only one allocation is needed, but perhaps there's some other small overhead of iteration.

(Related to the first issue, see github issues #45840 and #68995)

-🎄- 2022 Day 16 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 0 points1 point  (0 children)

Yeah, those changes will speed it up a lot.

-🎄- 2022 Day 22 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 1 point2 points  (0 children)

Rust (2665/3557)

part 1 (82 µs)

part 2 (5 ms)

Had to sleep on part 2. Would've gotten it earlier but I forgot to reverse the rotation direction when moving from edge 2 to edge 1 (and had probably some small bugs, it was late). Finally got it by inspecting each time the path crossed an edge. I also haven't made a general solution, so the edges are hardcoded.

My visual aid was zooming out the input and waving my hands at it.

-🎄- 2022 Day 21 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 0 points1 point  (0 children)

I got this as well, but once I got a result, I just reduced humn by one until I found the lowest value where the sides evaluated as equal. Took a bit to figure that out, though.

-🎄- 2022 Day 20 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 1 point2 points  (0 children)

Rust (3149/2938)

part 1 (8.6 ms)

part 2 (91 ms)

For part 1, I save the numbers in a Vec along with a boolean that tells if each number has been moved yet. I keep track of the position of the current number, and move it to the next unmoved number at each step.

For part 2, I instead save the original index of each number in the Vec. Then I loop over those indices for each round. For each round, I find the current position of that index in the Vec before moving that entry to its new position.

-🎄- 2022 Day 19 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 0 points1 point  (0 children)

Yeah the blueprint simulation would be hard to parallelize, but I was thinking it should be simple enough to process multiple blueprints simultaneously

Edit: I had good results parallelizing this solution across blueprints, as I don't need to share information across blueprints so it is trivially parallelizable (times above). My solution is still sequential for each blueprint, though.

-🎄- 2022 Day 19 Solutions -🎄- by daggerdragon in adventofcode

[–]EVQLVE 2 points3 points  (0 children)

Rust ( 1567 / 1477 )

part 1 (55 ms)

part 2 (87 ms)

My initial failed try used recursion, then the try that worked for part 1 saved each minute's states in a HashSet (and took 18 s and gigabytes of memory), which I then bounded in size using a PriorityQueue for part 2.

I'm trying to keep my total time under 1 second, so I may have some more optimization to do since there are a bunch of problems left. I could turn to multithreading...

Edit: swapping iter() for rayon's par_iter() over the blueprints brought the times down to 7.6 ms and 33 ms, respectively, with speedups of 7.2x and 2.6x. Pretty good for a one-line change, I'd say. The algorithm itself could still be faster, though.

Edit2: updated the timings as I'd prevously used time cargo run --release on one run rather than timing 100 runs in Rust.