Resetting the Python logger level

| python

I wanted to get extra debugging output from a Python script that I was running, but one of my imports seemed to mess things up and the logger level was 20 (info) instead of debug.

import logging
from llama_index import GPTSimpleVectorIndex, MockLLMPredictor, MockEmbedding, QuestionAnswerPrompt
logging.basicConfig(level=logging.DEBUG)
logging.debug('This is a test.')

As it turns out, there was already a call to basicConfig in github_repository_reader.py which llama_index loaded at some point, and the Python documentation says: "As it’s intended as a one-off simple configuration facility, only the first call will actually do anything: subsequent calls are effectively no-ops."

So this is what I needed to do instead:

logging.getLogger().setLevel(logging.DEBUG)

A+ 0, X220 1!

| geek, parenting

We were playing MineClone 2 in the living room, as we often do these evenings. I was tidying up the farm, and A+ was impatiently waiting for me to finish because she wanted to pretend to be the village witch and trade some potions for emeralds. She tried to clamber over me to get to the other side, and she tripped on my Lenovo X220T laptop's screen.

The screen glitched solid blue and didn't go back to normal even after I rebooted. Aaaah! Big feelings! I took a few deep breaths. A+ immediately became defensive, blaming me angrily for having the laptop there in the first place. (It was on my lap! I was sitting on the couch!) I took a few more deep breaths. I reminded myself that this is precisely the reason I have an "oops" fund, and that taking out my frustration on her wouldn't solve the problem. I also reminded myself that I didn't have to freak out about her not apologizing. First things first. I SSHed in and started another backup, took a few more breaths, and thought about things.

So the screen was probably broken. I still had lots of options. I could use it with an external monitor. I could swap the SSD into the other X220T, the one with the slightly broken screen (I had stepped on it during the sleep-deprived days of early parenting) and the wobbly power input that tended to lose contact. When my laptop screen glitched dim in university, that got me to learn more about Emacspeak and I ended up making that the basis for my senior project; perhaps this was another opportunity along those lines.

If it was unrecoverable, I could buy another computer, as I've been meaning to upgrade. Still can't have nice things, obviously, so probably the Lenovo T480 for its upgradability. T480s seem to be selling from between CAD 300-400 in our area. I've been waffling on upgrading my computer for a few years now, so that might be a good option.

It was already quite late at night, and I decided not to spend too much more time on it. Things would be clearer with more sleep and more space.

The next day, W- and A+ gave me enough space in the morning to disassemble the X220T following the service manual, down to the LCD panel and LCD cable. I disconnected and reconnected every component, and then I turned the computer on again. It worked, hooray! And I only had three screws left over. (Whoops! That's what I get for not following the service manual closely on the way back up, and not using lots of labelled containers for sorting the different screws for each steps.)

I'm glad about how it all worked out. I'm glad I didn't lose my cool and that I didn't catastrophize either the accident or A+'s response to it. This was the most I'd disassembled my laptop so far, which was pretty neat especially since I managed to get it working again. And it works, which means I might be able to procrastinate deciding on a new computer for another couple of years.

Hooray for this X220, and for learning how to be a better parent!

MineClone 2 so far: new worlds

| mineclone, fun, gaming

It turns out that A+ has a license for Minecraft Education using her school account. We installed it on W-'s old laptop since it still had a Windows partition, and she went through some tutorials. She likes to switch between survival mode and adventure mode, and she enjoys experimenting with some of the features that haven't made their way into MineClone 2 yet. We haven't decided to buy enough Minecraft Education or Minecraft Bedrock accounts for all of us to play together, though, since MineClone 2 has been enough for W- and me, and we like being able to fly in survival mode. A+ sometimes explores Minecraft independently, but she's more likely to join our MineClone world when we play together in the evenings. I like the way MineClone lets you fly around while still being in survival mode, and my damage prevention mod has been holding up well.

After flying around in our original world, I noticed there was very little water. It turns out that the tutorial set the water level to -31000 in the server configuration, so I stopped the server, deleted that line, and started a new world. That one looked more realistic, with rivers and lakes. A+ picked a spot near the water for us to settle down in and we made a pretty good base, but it was a little annoying to deal with slimes at surface level all the time. So we started yet another new world, and this time I challenged myself to do the starting segment as regular MineClone, no flying around to find a good spot. One of the tunnels I dug ended up close to a village, and we moved our base there.

I set up underground farms for wood, wheat, potatoes, and sugarcane, and an automated furnace and a composter to get through the excess stacks of cobblestone and wheat seeds. The MCL Quick Harvest & Replant mod with cora's fix_seed_dupe patch is handy for farming quickly, since I can hold down the right mouse button and just move around to harvest and replant. Since the villagers kept getting lost and killed, I gave in and created a trading hall, spawning the villagers into their stalls. A+ thought that was a great idea and made herself a stall. She's our village witch and she sells potions for emeralds. She likes going into creative mode to get the ingredients and then brewing the potions herself.

We decided flying around was pretty fun, so we usually keep that turned on. Teleporting saves a lot of time, too. Travelnet boxes make it easy for A+ to go to different places independently. When we come across something interesting, like diamonds or another village, A+ asks us to teleport her to our position so that she can join in. I'm thinking about adding custom commands like /mom or /dad so that she can teleport herself automatically. The Home Point mod lets us go back home easily or bookmark places for later exploration, and I granted everyone the home_point_unlimited privilege so that we can teleport quickly.

I've been really liking the ability to go into MineClone's source code and see if something's been implemented and how. I haven't needed to dig into Minetest yet, but it's nice that it's there in case I want to go deeper into the engine. A+ likes exploring villages, so I tweaked them to generate slightly more often (going from 1/77 to 1/40 probability per chunk, before the height difference check). I also use /findbiome to jump around. The maps from minetest-mapserver were helpful for noticing structures, since I sometimes missed them when just looking around. About the only thing I couldn't find normally was some sugarcane, so I looked in the source code for the item string and used the /giveme command to give myself one piece of sugarcane so that I could start our farm.

Today A+ was curious about the Ender dragon and the wither. She fetched some ender pearls from creative mode and we followed them to the stronghold, where she filled in the portal. We went through it and fought the Ender dragon, which was easy because we had my damage-negating chicken feet on and we could fly around. When we killed the Ender dragon, we went back to the overworld. A+ used creative mode to build a box out of bedrock some distance from our base. She put together the blocks needed to summon the wither, which we then defeated (yay chicken feet). Now that she's tried out both, she's back to figuring out interesting crafts and potions.

I'm glad we're all getting into it together, and that we have this digital sandbox where A+ can try out ideas in a way that's easy to clean up. In a recent session, W- teleported back into the house and was surprised to find water flowing everywhere. A+ yelled, "Everybody, get to higher ground!" Apparently she had been trying to figure out how to make mud, and the water got a bit away from her. After we helped her clean up, I looked in the source code to find out how to make mud (use a water bottle on dirt, I think). Me, I'm continuing to learn more about saying yes. ("Yes, you can go ahead and use the iron to make golems." "Yes, I'll enchant some pickaxes for you. Please give the pickaxes to Daddy so that he can wear them down before you combine them in the anvil.")

Next, I'd like to learn more about redstone contraptions, since MineClone 2 has some support for them and A+ likes playing with them in Minecraft. The NOR latch we tried for the front door was fun to make, and it seems to be working. Many of the automated farm ideas from Minecraft don't work because water doesn't move dropped objects in MineClone (because of the Minetest engine it's built on), but maybe there are other forms of semi-automation that might do. We'll see!

2023-03-20 Emacs news

| emacs, emacs-news

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs. Thanks to Andrés Ramírez for emacs-devel links. Do you have an Emacs-related link or announcement? Please e-mail me at sacha@sachachua.com. Thank you!

2023-03-13 Emacs news

| emacs, emacs-news

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs. Thanks to Andrés Ramírez for emacs-devel links. Do you have an Emacs-related link or announcement? Please e-mail me at sacha@sachachua.com. Thank you!

2023-03-06 Emacs news

| emacs, emacs-news

[2023-03-06 Mon] Update: Added https://www.fredgruber.org/post/ess_emacs_default_r_session/ to Org Mode section.

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs. Thanks to Andrés Ramírez for emacs-devel links. Do you have an Emacs-related link or announcement? Please e-mail me at sacha@sachachua.com. Thank you!

Minetest and MineClone 2

| fun, geek, play

A number of A+'s friends play Minecraft, so she got curious about it and started reading lots of e-books. We figured it might be time to let the video game genie out of the bottle since she tends to dive deeply into new interests and learn a lot. I wanted to get her started on Minetest, though, instead of buying one of the Minecraft editions. (Yay free and open source software!)

I installed MineTest, then used the Content tab to install MineClone 2 and the tutorial. I updated the other X220 so that I could run it there too, and we eventually turned it into a server. I went through the tutorial and then I showed it to her. We drew up an agreement to treat it the same as video time (20-minute timers for eye breaks, daily limits, need to be in the green zone). W- connected the other X220 to the TV with a VGA cable, and I used a USB hub to connect two keyboards and two mice to the laptop. A+ completed part of the tutorial. She found it hard to work the keyboard and the mouse while looking at the screen. She liked giving me directions to follow, taking over clicking or crafting whenever she felt comfortable.

We've been playing MineClone for almost a week, and it's starting to feel comfortable. We have a little base with a wheat/carrot farm, a well, and a fishing pond, and we're exploring the world. We might try creative mode in a while.

It looks like A+'s mostly curious about mobs, farming, ores, and flying around. She loves noticing things to explore and new recipes to craft. W- sometimes joins us, which is extra fun and helpful.

Minetest gives me opportunities to learn useful things, too. I'm getting better at saying yes to A+ when she wants to craft something, even if I wanted to save the materials for something else. (I should make a MineClone version of the reminder in our kitchen that says "Groceries are tuition for raising a cook.")

I'm still too impatient for the regular process of navigating around and bumping into resources, especially since we're working within 20-minute segments. I flew around with noclip/fast and set up some Travelnet boxes near interesting things, which A+ has liked a lot because now she can teleport independently.

I'm way too chicken to deal with damage, hostile mobs, or even night time at the moment. Since A+ would really like me to go fight the mobs she loves to read about, I'm thinking about how to gradually build up my courage with some kind of exposure therapy. =) I started learning how to modify armor so that I can keep myself mostly protected while leaving damage enabled for anyone who's braver (like W-). Maybe as I get the hang of it, I'll be able to dial down the protection or just let it keep a minimum HP level.

Lots of learning ahead!