søren peter mørch

Timeline

Recent posts from feeds followed by sorenpeter@darch.dk

bender (twtxt.net)

I see the same thing, @prologic. They will eventually disappear.

In reply to: #f5koec3hvqmb 4 months ago
bender (twtxt.net)

I wish I could connect this with git.mills.io. I think there is a network issue preventing me from bring able to do it.

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

The firefly season is ending. I only saw 200 of them or so. There was one female directly on the forest road. If only I brought my camera and tripod, that would have worked out I reckon. I had my torch with me and this looked really cool.

Dusk took forever today. It was really long light out there. Full moon is tomorrow.

On the way back, there was suddenly a load clatter and crashing sound 100 meters away from me. I didn't see anything, but a tree fell over in the forest out of the blue. Fuck me dead, that was scary as hell. Luckily, I was already on the main road, only meadows around me. It's the second time I witnessed a tree accidentally coming down. The first one was during the most expensive hail storm in our area so far in 2011 behind me when setting up a summer camp. The weather changed in less than 15 minutes.

Maybe not such a good idea to go out so late alone. :-? Any rustling in the forest immediately reminded me of the boar the other day. Luckily, always false alarm. Still a bit terrified from that event.

In reply to: #7jia5xq 4 months ago
movq (www.uninformativ.de)

Ah, with lazy loading, browsers only start loading images when the load event occurs. And that takes time. Hm. Not a fan, I might revert this. 🤔

In reply to: #cbq7yna 5 months ago
lyse (lyse.isobeef.org)

@movq Right. A Go programmer eventually knows that its nanoseconds precision. Keyword arguments like in Python are just sooo superior to unnamed positional arguments. I wish that Go had them, too.

In reply to: #noj7qpq 5 months ago
lyse (lyse.isobeef.org)

A deer, multiple frogs, several thousand fireflies and something else. It was already very dark when I was silently drifting along on a nice soft mossy path, enjoying the firefly show left and right and in front of me. I then heard some rustling about 30 meters in the distance in the shrubs. I thought that I must have scared up a deer. But it kept on rustling without any worries. And I closed in without seeing anything.

Only when I heard the quick oink from just 10 meters away, I froze. Shit, no deer, but a boar! Suddenly, I was the one who was scared. It probably hadn't noticed me before. But did it notice me now? Was that grunt a warning or just completely unrelated? The rustling appeared to slowly come closer. What if there were also piglets around? I couldn't figure out how many boars there were. Maybe just one, possibly more. A wild boar easily rips a hunting dog apart, so I didn't want to take any chances and decided I will not wait for them to eventually pass me behind the brush in just a hand full of meters, so I can keep on going. While I was just turning around, I heard another oink and was frighened to death. I ran 20 meters, before calming down a little bit. I listened for half a second and nobody was following me. Phew. I then walked back the path.

What an adventure, I tell you. That was my second (or maybe third?) wild boar encounter in the woods ever. A hell lot more scary at night than during daylight when you can actually see something.

In reply to: #7jia5xq 5 months ago
lyse (lyse.isobeef.org)

@movq Hahaha. It could have been worse, though. I've heard stories from others that were many levels crazier than what I experienced. And I'm glad that I was very, very lucky with almost all of my teachers throughout all of school. One of my maths teacher, who was also my computer science teacher then, is the reason I do what I do for a living. It's all his fault! ;-)

Ja, possibly a BaWü thing. The ministry of education and cultural affairs changes the rules, curriculums and details every one or two years, anyway.

Said teacher had to fight real hard that he was allowed to teach CS in class 12 and 13. As a real subject, that is, not just an extracurricular activity („AG“). At first, the ministry refused, because we're just am „allgemeinbildendes Gmyi“, not an „informationstechnisches Gymi“. It's insane, you've got super motivated (and technically as well as humanly excellent) teachers and then forbid them to offer a class. What the hell!? (Fun fact on top, he had a doctor in CS and was also teaching at the university of applied sciences.)

Eventually, they granted permission to only have a two hours a week class („zweistündig, wie Nebenfach“). One or two years later – too late for me, unfortunately – they allowed four hours a week („vierstündig, wie Hauptfach“). But each pupil had to sign upfont that they will not take CS class in the Abi. That was still exclusive to ITGs only. Completely ridiculous.

I reckon, you can talk to any random teacher and they will endlessly tell you about very dubious decicions from the ministry. :-/

In reply to: #jvuxrrq 5 months ago
lyse (lyse.isobeef.org)

@movq That's right, way harder than centrally managed. They even didn't reach concensus over the main folder: "Alle Programme, "Alle Programme (x86)", "All Programs", "All Programmes", etc. Anyway.

For class 11 (or maybe already in 10, I don't remember exactly) we could choose either between traditional maths class with a graphical calculator or "Mathe mit CAS". There were two teachers in my entire school who were able to teach the latter. It was also fairly new at the time I believe. Certainly unheard of for a „allgemeinbildendes Gymnasium“, maybe the technical ones were already offering it for some time, not sure. It was clear to me that I would take the maths with CAS class.

Each kid had to buy their own Cassiopeia A-Something. I don't know how much that thing was (definitely more expensive than a graphical calculator) and whether the school subsidized that in any form. But it was slow and underpowered as hell. We rarely used it in class nor for homework (most if not all had already a desktop at home). Typically, when we worked with the CAS, we sat down on the desktop computers. Our class took place in one of the two computer rooms. The desktops were placed on the three sides (left, right, back, facing the walls or windows) and the regular school desks were in the middle. Since there were more pupils than desktops, we always shared. Nowadays, we call it pair programming. ;-)

For the exams we had the "mandatory part" (Pflichtteil) without any tools. Once we finished that and handed the papers to our teacher, we were then allowed to boot up our Cassiopeias and work with them for the second part. Before the exam started, everyone had to show the teacher that they reset their small computer to factory settings. This second part was called „Wahlteil“. But you had to do it in order to pass. So, I never understood the choice of this term. Maybe it's because the first part is the exact same for everyone (graphical calculator and CAS class), but the second part was definitely different for the two classes. Each suited to their tools.

After one or two exams, it became clear that the Cassiopeia was far from ideal. So, we took the second part at the desktop computers from then on. Our teacher unplugged the network cables himself to avoid cheating. Each computer had an "HDD Sheriff" running that reset the disk at startup. There was also an issue that the personal user accounts were affected by that. Sometimes all your data were lost. If you were lucky, they were still there. So, we saved our Maple project to local disk (if the computer didn't crash in between, that was no problem) and at least eventually before leaving the classroom, we then also saved it on the server. For that, the teacher quickly plugged in the cable, we saved, and then the cable was unplugged again immediately. Oh, and everybody used their USB sticks, too.

All in all, this Cassiopeia A-* was quite a useless purchase. :-D I'm not sure if I still have it. At least I thought several times about giving it to the flea market. Don't know if I did or not.

In reply to: #2ci547q 5 months ago
lyse (lyse.isobeef.org)

In the light of current events, I will first consult my pillow and only then write an article about readable code.

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

@lyse

Now I'm curious how movwin deals with that. ;-)

Focus handling? I hardly remember, lol. 😅 Did that 6 months ago and haven’t touched it since. Let’s see.

The core main loop gets keyboard/mouse events from curses. At this level, the main loop only knows about exactly one widget, so it passes the event to that widget (whatever that is, doesn’t matter – they all inherit from the Widget base class, it could be a Window, a WindowManager, or an Edit box directly).

The outermost widget is usually a WindowManager. It implements a few hotkeys of its own, like switching to another window. If none of those hotkeys match, it passes the event to the currently focused window.

Same story here: Window implements some hotkeys (like opening the menu bar). If none of those match, then … the magic happens.

Each Window acts as a focus manager. It can descend into its child widget hierarchy and collect all child widgets in a depth-first search. They are collected into a flat list. Each Window then has an attribute _focus_position, which is an index into that list. Pressing Tab or Shift+Tab increases or decreases that index and that allows you to select the next/previous focusable widget in the current window.

Eventually, Window passes the input event to the currently focused widget.

Usually on initialization, the application can ask a Window object to focus a certain widget. The file selection dialog does that, for example, because the “natural” focus order would be to focus the Edit box at the top of the window first – but that’s not what the user wants, the Table showing the list of files should be focused.

If no widget ever feels responsible for handling a certain input event, then there’s a global unhandled_input callback that the application can provide (same as in urwid).

I think that’s it.

Hm, that’s more complicated than I remembered, but apparently it works fine, because I completely forgot about this. 😅 All I did in the last few months was make new classes that inherit from Widget, like the new Table class or Edit or HexEdit or whatever, and if they want to get input events, then they must implement the methods input_key() or input_mouse().

Does this answer your question? 😅 (I admit that I didn’t exactly understand your scenario, so I just went ahead and rambled about my implementation. 😅)

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