søren peter mørch

Timeline

Recent posts from feeds followed by sorenpeter@darch.dk

itsericwoodward (itsericwoodward.com)

@movq @david @thecanine Yeah, I'm with you. It is just a tool, but it's a tool that burns rainforests and boils lakes when you use it, owned by some incredible awful human beings, and built on the backs of an increasing number of crippling mass-scraping campaigns. These costs are just too high.

I have to use it at work, but it's "the new norm" in software, so I'm hoping to use it just enough to get by until either 1) the bubble pops (and we don't have to use it anymore) or b) I retire. And actually, 1) happened for a minute back in June when M$ increased the prices of tokens, so it's certainly possible it could happen again.

All that having been said, I think the technology itself has some interesting uses, and I'm looking forward to the day when I can host some open source models on local hardware. But I can wait.

And yes, the site is unreadable on mobile, which is kinda wild for 2026. 🦆

In reply to: #div7er6gy5qx 3 months ago
itsericwoodward (itsericwoodward.com)

I finally managed to get back out disc golfing today at Vietnam Veterans Park and had a good time despite losing a brand new disc on hole 3 (on its 3rd throw ever, my glow-in-the-dark Lynx disappeared into an overgrown creek-bed and was swallowed by the underbrush). After my buddy lost a disc on hole 4, we were kinda demoralized and both threw for crap the rest of the course, but it was still a nice day to be slingin' in the sun...

https://itsericwoodward.com/images/a6aa1f26.jpg

Read replies 3 months ago
prologic (twtxt.net)

@movq it's a shame we have to ruin such great technology that only depends a lot of this with crappy bullshit nonsense like advertising we've been into responses 🤦‍♂️

In reply to: #xvhatyqxvabx 4 months ago
lyse (lyse.isobeef.org)

I finally built a prototype of a marking gauge with a cutter wheel out of some scraps.

https://lyse.isobeef.org/tmp/streichmassprototyp-mit-messerrad/

It had been a long time in coming, I bought some replacement cutting wheels three years ago for exactly that purpose. I also found out that I need more M3 countersink bolts for future marking gauges that I want to make (maybe two or three more). Luckily, I had exactly one. I thought I got way more than that, but M3 is very, very scarce in my collection. My M3 bolt was barely long enough to attach the cutting wheel to the bar. But it's okay for the prototype.

I was pleasantly surprised that I managed to drill the 2.5mm diameter hole almost perfectly in center in the 8mm diameter aluminium round bar. Center finder, drill press and vise with a vertical prism for the win!

I knew upfront that the M5 steel bolt to lock the bar in place definitely needs to be replaced with a brass or aluminium one (maybe with a knurled head). Otherwise, it cuts into the aluminium bar and leaves ugly marks. These burrs might even scratch the workpiece. But, of course, I don't have any brass on hand either. Alternatively, I swap out the aluminium bar for a steel or even stainless steel one. Stainless might be tricky to precisely drill and tap, though.

I already learned a few things by making this prototype. The final wooden fence can be even a bit bigger. This round thing behind is also too short, I'd like it to be a tad longer and thicker. The final one will be made from hardwood, not spruce. Other than that, it's great and already more practical than my store-bought marking gauge with its round fence. This only causes the tool to roll around on the workbench. Or even roll off. Stupid design.

Read replies 4 months ago
itsericwoodward (itsericwoodward.com)

@movq Thanks for that. I'd been hearing about this in the context of browser plugins turning computers into residential proxies for web scrapers, but I hadn't considered that a TV could be used the same way. ☹️

In reply to: #v732qmy5bod3 4 months ago
prologic (twtxt.net)

Ahh crap, I didn't take any 😅

In reply to: #xc5s6v7ojg7i 4 months ago
lyse (lyse.isobeef.org)

Hurray, I can now press gg instead of g to go to the top in tt. Much better! :-) Other multi-key combinations are also easily possible now.

I should probably write a real article about this at some point, but here we go. The only downside with my new key binding system is that it breaks tview's established pattern. You've got an InputHandler(), that is implemented using WrapInputHandler(…). It typically then directly implements the switching logic depending on the key press. Something like this:

func (w *Widget) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive)) {
    // WrapInputHandler allows for intercepting key events with SetInputCapture(…)
    // from the outside for customization. This handles the default key bindings.
    return t.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p tview.Primitive)) {
        switch event.Key() {
        case tcell.KeyRune:
            if event.Modifiers() == tcell.ModNone {
                switch event.Rune() {
                case 'k':
                    w.scrollUp()
                    return // we already handled the event, stop processing

                case 'j':
                    w.scrollDown()
                    return
                }
            }
        }

        // We didn't handle the key event. Maybe the parent
        // widget knows what to do with it.
        if handler := w.parent.InputHandler(); handler != nil {
            handler(event, setFocus)
        }
    })
}

From the outside, you can intercept and either stop or continue the widget's original key handling with a potentially rewritten key event using SetInputCapture(…):

w := NewWidget()
// customized or additional key bindings
w.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
    switch event.Key() {
    case tcell.KeyUp:
        // Rewrite the event, so the "cursor up" key is an alias
        // for the vim key binding "k", that is handled by the
        // wrapped input handler above. (I know, I know, this is a
        // completely unrealistic example, why would anyone use
        // cursor keys when there are vim key bindings available?!)
        return tcell.NewEventKey(tcell.KeyRune, 'k', tcell.ModNone)

    case tcell.KeyRune:
        if event.Modifiers() == tcell.ModNone {
            switch event.Rune() {
                case 'q':
                    app.Stop()
                    // we already handled the event, do not pass it
                    // to the wrapped input handler above
                    return nil

                case 'r':
                    toggleMessageReadStatus()
                    return nil
            }
        }
    }

    // we didn't handle the event, pass it to the wrapped
    // input handler above
    return event
}

Since they all expect a single key, I've noticed that using multiple dedicated KeyBindings of mine on these different levels kinda breaks multi-key handling with common prefixes. The outer-most KeyBinding captures the prefix, but it can't transfer it to the inner one if not handled by the outer one. At least not without some more (potentially ugly) changes. So, I now have to work with just a single KeyBindings object for the entire widget chain (if it consists of multiple other widgets or the regular input handler and input capture are in the game). The outside needs to register all its key bind customizations or extensions at the same level that the original widget handles its default ones. Doable by exposing the widget's KeyBindings instance, but not pretty. You always have to keep this in mind.

With the KeyBindings, it will look like that:

type Widget struct {
    parent tview.Primitive

    // make it available to children or the outside either by
    // direct field access or by providing a getter method
    KeyBindings *bind.KeyBindings
}

func NewWidget() *Widget {
    w := &Widget{KeyBindings: &bind.KeyBindings{}}
    w.KeyBindings. // default key bindings
        Bind0(bind.KeySequence('k', w.scrollUp).
        Bind0(bind.KeySequence('j', w.scrollDown)
    return w
}

func (w *Widget) InputHandler() InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive)) {
    return t.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p tview.Primitive)) {
        // also note the missing support for focus transfer at the moment
        event = w.KeyBindings.Capture(event)
        if event == nil {
            return
        }

        if handler := w.parent.InputHandler(); handler != nil {
            handler(event, setFocus)
        }
    }
}

And then from the outside, or in a child widget:

w := NewWidget()
w.KeyBindings. // additional or customized key bindings
    Bind1(bind.KeySequence(tcell.KeyUp), func(*tcell.EventKey) *tcell.EventKey {
        return tcell.NewEventKey(tcell.KeyRune, 'k', tcell.ModNone)
    }).
    Bind0(bind.KeySequence('q'), app.Stop).
    Bind0(bind.KeySequence('r'), toggleMessageReadStatus)

When directly working with tview primitives that are not part of custom widget implementations, the following works well so far:

textView := tview.NewTextView().
    SetWordWrap(true).
    SetText("…")
    SetScrollable(true)
textView.SetInputCapture((&bind.KeyBindings{}).
    Bind0(bind.KeySequence('q'), app.Stop).
    Bind1(bind.KeySequence('g', 'g'), func(*tcell.EventKey) *tcell.EventKey {
        return tcell.NewEventKey(tcell.KeyHome, 0, tcell.ModNone)
    }).
    Capture)

I need to sleep on this some more.

Also, writing very long messages like this one is really not all that fun in tt's editor. I should absolutely provide a way to shell out to vim.

(Took me about one and a half hours to compose, holy crap. But not only because of not using vim. Although, that might have saved me a quarter hour or so for sure. Proof-reading this message also uncovered quite a few bugs in my real documentation. So, that's a big win!) Good night!

Read replies 4 months ago
movq (www.uninformativ.de)

Oh, crap! It’s only Thursday! I thought we had Friday already … nnnnooooooo, not another day. 😭

Read replies 4 months ago
lyse (lyse.isobeef.org)

My mate and I hiked up the backyard mountain. We got 25°C and quite some wind, so it was actually not too terrible. The wind could have blown harder or the temps a little lower, but oh well.

I saw the squirrel's bushy tail stick up on the forest floor in the sunlight and immediately thought of this cute little feller. Since it didn't move at all, even when we came closer, I got irritated and reconsidered that it might actually be some kind of dried up farn. But then we also were able to see its body. Unfortunately, the squirrel ran up the tree too quickly, so all the shots are kinda crap.

At one flower spot, there were sooo many butterflies, wasps, flies, bugs and other insects. The botanic was completely crowded.

The workers were transferring logs from one log truck to the other in a parking lot. I've never seen this happening before. When we passed the same place on the way home, they had moved logs into a sea container. That was surprising. This semi wasn't there on the way there. One log was probably too long and sticking out the container, so they probably had to wait for somebody to return with a chainsaw. Crazy that they're shipping logs from here probably overseas. Why else would they put them in a sea container?

After our first break, a blackbird was really posing for us with his worm in the dark shade.

Today was my first time I ever saw a hummingbird hawk-moth (Taubenschwänzchen) for real. My mate photographed them many, many times before, but I never came across one myself. So, that was really special.

The forest service installed an outdoor table with two benches next to the timber lion, that was cool to see. We sat down for a few minutes and enjoyed both the view into the Fils valley and ant on the tabletop, but the sun was beating down too heavily on us, so we had to move on.

All in all, it was a very nice few hours long hike. Enjoy! https://lyse.isobeef.org/waldspaziergang-2026-07-03/

Read replies 4 months ago
itsericwoodward (itsericwoodward.com)

@prologic Fair point, and I don't plan on doing it myself.

But I also understand raging against the broken social contract(s). It's like using Iocaine or zip-bombs against the scrapers. I don't do it, but I understand why someone would feel justified in doing so.

In reply to: #d4bu4fq 5 months ago
Reply via email