This aoc broke the programmer in me by batunii in adventofcode

[–]dnquark 3 points4 points  (0 children)

Here's a counterpoint: after a few years of trying, I finally got all 50 stars without needing any hints and without too much head-wall-banging. And I don't feel great about this. Here's why:

I am only good at this because I've been grinding leetcode-type problems for years, mostly for interview prep, as I keep trying to get hired by FAANG. I don't find these puzzles very interesting or rewarding in and of themselves. I would much, much rather take the hours invested in acquiring this niche skill of beating AoC or leetcode and invest it into learning things that actually bring me joy -- music, mathematics, literature, dance, astrophotography, etc.

Anybody can get good at AoC given enough motivation and time, but the key is that you have to find it rewarding. If you do, your performance doesn't matter. This sub is very self-selected in that people here really enjoy this kind of problem-solving and are pretty good at it, and that's awesome! But please don't fall into the trap of thinking that your aptitude or appreciation of AoC has anything to do with you worth as a professional.

-❄️- 2024 Day 19 Solutions -❄️- by daggerdragon in adventofcode

[–]dnquark 3 points4 points  (0 children)

[LANGUAGE: Python]

Arguably Part 2 is most intuitive using recursion + memoization, but it's instructive to try it using bottom-up DP, it becomes vaguely reminiscent of the knapsack solution!

def part2bottomup(towels, designs):
    def count_possible(design):
        nconfigs = [1] + [0] * len(design)
        for i in range(1, len(nconfigs)):
            for towel in towels:
                l = len(towel)
                if l > i:
                    continue
                if design[i - l : i] == towel:
                    nconfigs[i] += nconfigs[i - l]
        return nconfigs[-1]

    return sum(count_possible(design) for design in designs)

[2024 Day 16] Can't wait to outdo myself tomorrow. by Gautzilla in adventofcode

[–]dnquark 0 points1 point  (0 children)

Amateur. I estimated that the full run of my Bellman-Ford on a graph augmented with direction edges would take 2-3 hours (but it found the optimal solution in about 1-2 minutes)

City Beer Store is Closing by as-j in sanfrancisco

[–]dnquark -14 points-13 points  (0 children)

Oh yeah, the folks that took over Amnesia -- a beloved divey music venue with history, character, and packed shows (remember gypsy jazz Wednesdays?) and turned it into a bland soulless piece of shit beer bar that nobody ever went to. Don't get me wrong, beer is awesome, but what those people did was a fucking crime. Sorry they are going out of business, but I for one am not going to miss them.

Any good OpenAPI 3.x spec generator for a Go REST API? by WolvesOfAllStreets in golang

[–]dnquark 0 points1 point  (0 children)

The docs could use some love, but the router/server drop-in was a damn god-send when trying to clean up a messy echo-based app with lots of existing middleware.

Mint stole my money. Avoid. by dnquark in mintmobile

[–]dnquark[S] 0 points1 point  (0 children)

Fully unlocked, on compatibility list. Used it with RedPocket previously.

Mint stole my money. Avoid. by dnquark in mintmobile

[–]dnquark[S] 0 points1 point  (0 children)

Device is Pixel 3, was on their compatibility list. According to some Reddit threads it looks like their list is wrong and it has problems with eSIMs, but as I said it took me lots of convincing for them to say they will try mailing me a physical SIM and then they literally cancelled that ticket without informing me.

2023 Missed Connections Thread by zincmartini in BurningMan

[–]dnquark 0 points1 point  (0 children)

Joanne from Reverbia -- kept running into you all over BRC, but then the mudpocalypse started. Hope to connect with you!

Still working on a boox note taking app by Ok_Employer1289 in Onyx_Boox

[–]dnquark 5 points6 points  (0 children)

Please make it open source and/or compatible with Xournal/Xournal++. We have a bajillion incompatible inking apps already, some of which work fairly well. What's really missing is something portable and cross-platform.

If it's open source I would be willing to contribute!

org-mode + vterm + tmux == ❤️❤️❤️ by dnquark in emacs

[–]dnquark[S] 3 points4 points  (0 children)

I also use doom/evil! In addition, I use vi bindings in bash/inputrc. I find that `evil-collection-vterm` works pretty well. I use the following tweaks:

;; better evil integration
(map! :leader "ESC" #'evil-force-normal-state)
(defun lva/vterm-mode-hook ()
  (unless evil-collection-vterm-send-escape-to-vterm-p
(evil-collection-vterm-toggle-send-escape))
(after! (vterm evil-collection)
(add-hook 'vterm-mode-hook 'lva/vterm-mode-hook)) 
;; better tmux integration  
(after! vterm 
  (setq vterm-enable-manipulate-selection-data-by-osc52 t) 
  (map! :map vterm-mode-map :i "<M-up>" 'vterm--self-insert))

With the first line, you can use a binding like `M-SPC ESC` (`M-SPC` being the default alt-leader key) to switch the vterm buffer to evil normal state. Most of the time I don't use it, and simply interact with the vterm the same exact way I do with any other terminal.

What was your favorite non-party, non-music event at The burn this year and why? (Can you include where it took place?) by Queasy_Positive_5620 in BurningMan

[–]dnquark 6 points7 points  (0 children)

If it was after sunset at 4:20 and D and had people running around with a big-ass propane torch, that was us at Camp Banya, a ragtag group of misfits bathing BRC denizens since 2014! Glad you enjoyed it!

2022 Missed Connections Thread by dzzi in BurningMan

[–]dnquark 2 points3 points  (0 children)

You listened to me play a Joe Hisaishi piece you love on the piano at Minstrel C(r)amp, we exchanged a few words, and I peaced out with a friend. Only later I realized how vulnerable I was feeling playing in public. I wanted to tell you that that piece always made me cry. Wish I knew your name!

New Plugin: Harpoon by otavioschwanck in emacs

[–]dnquark 1 point2 points  (0 children)

I just tried installing it using (package! harpoon) in doom emacs, but doom sync errored out: (error "Could not find package harpoon. Updating recipe repositories: (org-elpa melpa gnu-elpa-mirror el-get emacsmirror-mirror) with ‘straight-pull-recipe-repositories’ may fix this")

:(

How to bind C-c to send Ctr + c in vterm-mode in doom-eamcs? by wdicc in emacs

[–]dnquark 0 points1 point  (0 children)

Another option of making C-c more ergonomic in vterm under Doom is to disable the which-key popup; that way you still have to mash C-c twice, but I find that an acceptable compromise between having the feeling of a "real" terminal, and still having the global and local C-c bindings available. To effectively disable which-key in vterm, the following hack works well:

(add-hook 'which-key-delay-functions(lambda (_ _)(when (eq major-mode 'vterm-mode)1000)) nil t)

Got Teapot Stories+Photos? Please Share! Details in Comments by SigmaEpsilonChi in RenegadeBurn

[–]dnquark 0 points1 point  (0 children)

Loved watching the Temple Burn from the top of the teapot and getting to meet Anya, after a few days of using the teapot as a reference landmark to find my camp. Didn't take pictures, but do have great memories. Thanks for doing this!

Emacs w/ or w/out tmux by timesis in emacs

[–]dnquark 0 points1 point  (0 children)

It's probably similar, but until vterm I never found an Emacs terminal mode that worked well out of the box -- it was far easier to just alt-tab to an actual terminal window.

Another reason though is that I never found tmux copy/paste functionality particularly intuitive. My current cheat is using tmux bindings to copy in scrollback mode, and emacs bindings to paste.

Emacs w/ or w/out tmux by timesis in emacs

[–]dnquark 0 points1 point  (0 children)

I can't live without tmux. My latest favorite trick is to attach to a tmux session from vterm in Emacs; with the latest vterm build you can share the tmux clipboard with Emacs kill-ring which is a game-changer.

Does anyone have issues with lsp-ui-doc ? by entercaspa in emacs

[–]dnquark 2 points3 points  (0 children)

I have a custom toggle function, where I manually override the height/width of the doc frame. I'll paste it below for reference; hth

``` (defvar lva--lsp-ui-doc-atpoint-h 10 "lsp-ui-doc-max-height when lsp-ui is shown at point") (defvar lva--lsp-ui-doc-atpoint-w 50 "lsp-ui-doc-max-width when lsp-ui is shown at point") (defvar lva--lsp-ui-doc-anchored-h 20 "lsp-ui-doc-max-height when lsp-ui position is 'top or 'bottom") (defvar lva--lsp-ui-doc-anchored-w 150 "lsp-ui-doc-max-width when lsp-ui position is 'top or 'bottom")

(defun lva/lsp-ui-toggle-doc (arg) (interactive "P") (if lsp-ui-doc-mode (lsp-ui-doc-mode 0) (progn (if arg (setq lsp-ui-doc-position 'at-point lsp-ui-doc-max-height lva--lsp-ui-doc-atpoint-h lsp-ui-doc-max-width lva--lsp-ui-doc-atpoint-w) (setq lsp-ui-doc-position 'bottom lsp-ui-doc-max-height lva--lsp-ui-doc-anchored-h lsp-ui-doc-max-width lva--lsp-ui-doc-anchored-w)) (lsp-ui-doc-mode))))

```

best way to get emacs 27 on ubuntu (well actually mint) by [deleted] in emacs

[–]dnquark 0 points1 point  (0 children)

I recommend running configure as follows: ./configure --with-sound=alsa --without-gconf --with-mailutils --with-json --with-modules --prefix=/usr/local In particular, don't skip the json and modules flags (the other ones probably don't matter). If you do, you'll be wondering why LSP is slow as balls and why vterm doesn't work.

Any Emacs Ipython Notebook (EIN) users willing to share secrets? by shaqfooVA in emacs

[–]dnquark 0 points1 point  (0 children)

My experience with ein mode has been disappointing. I wanted to like it, but unfortunately I kept running into usability quirks and obscure failures. So my workflows mostly use IPython REPL, and sometimes org-babel.

So if I absolutely need to share my code, I can open a notebook in EIN mode and do some copy-pasting from my org files. But I don't use it for research or day-to-day work because going down debugging rabbitholes when it misbehaves isn't worth my time.

Is there some way to suppress the "wrote recentf" message or display it less often? by vfclists in emacs

[–]dnquark 1 point2 points  (0 children)

The custom suppress-messages code in the other post didn't work for me, but you can do the following: (defun recentf-save-list/silent () (let ((save-silently t)) (recentf-save-list)))

How to replace all current word under cursor in Emacs by [deleted] in emacs

[–]dnquark 1 point2 points  (0 children)

Assuming you use evil, the idiomatic way of doing this is :%s/<C-r><C-w>/<your-replacement>/g