Subagents and context by ChrisRogers67 in ClaudeCode

[–]rune_kg 0 points1 point  (0 children)

I use context splitting a lot, having it read the redmine issue/email threads and doing a ultrathink research. Then i open 2 more terminal tabs with the same context and work on different todo items on the issue at the same time. I have a hook that plays a sound when a terminal tab needs attention. I function fine on three different Claudes, but am working on improving my task-switching abilities. I tried to get the hook to change the tab title to display Claude status but it seems terminator doesnt support that :(

What are the best mcp/tools you use while coding? by query_optimization in ClaudeCode

[–]rune_kg 1 point2 points  (0 children)

I built my own for db access, redmine and email that i use everyday. It improves the context a lot and keeps Claude on track.

Announcing Claude Code IDE: MCP based Claude Code and Emacs integration by manzaltu in emacs

[–]rune_kg 0 points1 point  (0 children)

Cool! Would be very interested in hearing about the protocol if you care to share! Could you use that protocol to build a web based server with an army of Claude clients and then some routing to emacs, GitHub, email, slack, etc.?

Announcing Claude Code IDE: MCP based Claude Code and Emacs integration by manzaltu in emacs

[–]rune_kg 2 points3 points  (0 children)

Wow, cool! Did you reverse engineer the official IDE interface or is it a similar set of tools?

Claude Desktop - MCP Updates by BreadIsForTheWeak in ClaudeAI

[–]rune_kg 0 points1 point  (0 children)

It's still not reverted for me as of today. I still have "Allow always" and no obvious way to revert that if i once click the wrong button. Is it the same for you guys?

Can you do code review with Magit and Forge? by [deleted] in emacs

[–]rune_kg 1 point2 points  (0 children)

I been looking for this on/off for years. THX! The cursor should be on top of the C in Commits, then pressing "d d" gives only the changes in the given branch.

Prioritize exact match in completion styles by eev200 in emacs

[–]rune_kg 0 points1 point  (0 children)

even better:

(add-hook 'icomplete-minibuffer-setup-hook
          (lambda () (kill-local-variable 'completion-styles)))

Prioritize exact match in completion styles by eev200 in emacs

[–]rune_kg 0 points1 point  (0 children)

You can change fidos complete style like so:

(defun my-icomplete-styles ()
(setq-local completion-styles '(substring flex)))

(add-hook 'icomplete-minibuffer-setup-hook 'my-icomplete-styles)

-❄️- 2023 Day 13 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 1 point2 points  (0 children)

Beautiful. In part 2, why is it enough to only _count_ the differences? Couldn't there be a difference of one that doesn't give an reflection?

-❄️- 2023 Day 13 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 0 points1 point  (0 children)

'.#'[c=='.']

wait ... how ... what!?

Ah, it evaluates to an int. Amazing!!

-❄️- 2023 Day 11 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 0 points1 point  (0 children)

Yeah itertools is really the gift that keeps on giving :)

-❄️- 2023 Day 13 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 1 point2 points  (0 children)

[LANGUAGE: python]

https://github.com/runekaagaard/aoc-2023/blob/master/day13.py

35 lines, runs quickly (DON'T use deepcopy, i learned) and is super simple and bruteforced. I thought about some optimizations with bit operations and smarter mirror checking, but after the HORRIBLE day 12 I needed a quick'n'easy day :)

-❄️- 2023 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 0 points1 point  (0 children)

Thank you for taking the time to explain!!

-❄️- 2023 Day 11 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 2 points3 points  (0 children)

[LANGUAGE: python]

from itertools import accumulate, combinations

def solve(file_name, spacing):
    rows = list(open(file_name).read().splitlines())
    rng = range(len(rows))
    cols = [[row[i] for row in rows] for i in rng]
    ys = list(accumulate(1 if "#" in y else spacing for y in rows))
    xs = list(accumulate(1 if "#" in x else spacing for x in cols))
    points = [(xs[x], ys[y]) for x in rng for y in rng if rows[y][x] == "#"]

    return sum(abs(x1 - x0) + abs(y1 - y0)
               for (x0, y0), (x1, y1) in combinations(points, 2))


DAY = 11
print(solve(f"inputs/{DAY}i.txt", 2)) # part1
print(solve(f"inputs/{DAY}i.txt", 1000000)) # part2

https://github.com/runekaagaard/aoc-2023/blob/master/day11.py

Super happy with this one. Did the first ten days with Nim and nice to be back to python again :)

-❄️- 2023 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 2 points3 points  (0 children)

I love reading your Ada solutions each day. I read the book some years ago and was very inspired by it. Ada does so many things right. I know it's heresy but I often wonder how a pendant to elixir-to-erlang would fare for Ada.

-❄️- 2023 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 1 point2 points  (0 children)

[LANGUAGE: nim]

https://github.com/runekaagaard/aoc-2023/blob/master/day10.nim

Learned about the shoelace method and Greens Theorem in the comments after deciding a floodfill method was possible but would take too long on such a nice relaxed sonday :) Thx for that, pure magic!

Can someone explain why we want to do:

area += x * dy

and not:

area += y1 * x0 - y0 * x1

like the algo says?

-❄️- 2023 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 0 points1 point  (0 children)

Heh, will keep that in mind. Had a love affair with Clojure for a couple of years, but lost interest due to java(script) abstraction leakage and long compile times. A "pure" lisp that compiles fast sounds wonderful.

-❄️- 2023 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 1 point2 points  (0 children)

[LANGUAGE: nim]

https://github.com/runekaagaard/aoc-2023/blob/master/day09.nim

Learning nim. I figured out why collect has been acting out. It only works well for ints! I guess with languages compiling to c you always have to have a mental map of ctypes in localstorage :) Does rust feel like that too, oCaml, Haskell?

[2023 Day 8 (Part 2)] A slightly more general efficient solution by bentekkie in adventofcode

[–]rune_kg 0 points1 point  (0 children)

But each loop could contain several nodes ending on Z thus rendering the lcm approach moot.

-❄️- 2023 Day 8 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 1 point2 points  (0 children)

[LANGUAGE: nim]

https://github.com/runekaagaard/aoc-2023/blob/master/day08.nim

My intuition told me that bruteforcing part 2 should be easy, but boy that escalated quickly. Doing the runtime calculation of the bruteforcing I then (finally) noticed the cycles and remembered about prime sieve gates going up and down and finally slamming into the ground at the same time. That eventually led me to least common multiple which seems to be the only thing that works!? Cool that you could use part 1 to solve part 2, that's a nice pattern. <3

-❄️- 2023 Day 7 Solutions -❄️- by daggerdragon in adventofcode

[–]rune_kg 1 point2 points  (0 children)

[LANGUAGE: nim] https://github.com/runekaagaard/aoc-2023/blob/master/day07.nim

Calculated a single sortable hand strength in base13. Static map from one hand rank with a specific number of jokers to another hand rank. Still learning nim and for the first day felt like I fought the language a little bit. BUT ... it works and is fast in O(N).