• 2 Posts
  • 251 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2023

help-circle







  • Falsehoods About Time

    Having a background in astronomy, I knew going into programming that time would be an absolute bitch.

    Most recently, I thought I could code a script that could project when Easter would land every year to mark it on office timesheets. After spending an embarrassing amount of…er…time on it, I gave up and downloaded a table of pre-calculated dates. I suppose at some point, assuming the code survives that long, it will have a Y2K-style moment, but I didn’t trust my own algorithm over the table. I do think it is healthy, if not essential, to not trust your own code.

    Falsehoods About Text

    I’d like to add “Splitting at code-point boundary is safe” to your list. Man, was I ever naive!


  • Many renewables are stuck in the “interconnection queue,” a long line of projects waiting to get connected to the grid. According to Lawrence Berkeley National Laboratory, more than 1,500 gigawatts of power, mostly renewables, are waiting for approval to connect. (That’s more than one-third of all the power produced in the United States.)

    That is really unfortunate. I’m in Canada, but it wouldn’t surprise me if we are in the same boat. Where I live, there is a lot of wind and solar going in, but my understanding is that this is in part because it’s one of the rare areas with an under-capacity grid that is not too far from several major urban centres.

    And you can see how important the grid layout is in that solar farms are popping up mostly along large transmission corridors, presumably to allow for easier connection. This is less evident with wind, since geography plays a bigger role in where you want to put a wind farm for optimal results.

    It makes me speculate that renewables like wind and hydroelectric (including pumped hydro storage) which are less negotiable in terms of location compared to solar are more likely to be waiting a long time on this interconnection queue? I don’t know if that is actually the case though.



  • If I were chronically sad in the evenings, I would actually bring it up with the doctor. I wouldn’t make a special appointment for it necessarily unless its progressing towards suicidal thoughts or something, but during a regular visit I would bring it up. I’m no stranger to mood disorders, and frankly, I wish I had approached a professional sooner about it. Would have saved a lot of grief not just for me but for family members who also suffered through my episodes.

    For something that seems too minor for a doctor visit, I would suggest speaking to a pharmacist. They are readily available without appointment or long waits, and have an encyclopedic knowledge of all sorts of over-the-counter remedies that are backed up by an advanced degree in medicine. Definitely an underutilized resource. Of course they may well suggest you talk to a doctor, but in my experience at least, they give thoughtful consideration to what you have to say and make such a recommendation not out of some lazy buck-passing but rather a genuine concern for your condition. So you would do well to heed their advice, whatever it might be.



  • I’m with you on this one. There are lyrics on almost every single track for crying out loud. Throw us instrumental lovers a bone won’t you? Songs that are lyrically driven but are otherwise super-repetitive instrumentally tend to put me to sleep.

    What I love about concerts is when the band goes off script and just starts jamming. Even a 5-minute drum solo will have me grinning ear to ear, and that’s what I’ll be remembering on the way home.


  • Ah so it’s not only Tkinter then. Interesting. Maybe this is one of the reasons why Python-specific GUIs like Kivy came about? When I first started learning Python though, I came under the impression that Tkinter was the “official” Python GUI with privileged status in the standard library, so I started there and was surprised at how it actually doesn’t play all that nice with the language.

    Oh well. I’m glad OP brought it up because I’m sure everyone who’s tried to write a GUI in Python for the first time hits this before long and has that same wtf moment. :)




  • I’ve used Tkinter in a number of projects, though not the PIL specifically. At least not recently?

    What I have found with Tkinter in general is that it can be rather quirky in terms of dealing with object ownership. I don’t know why this is? You shouldn’t have to worry about tracking object lifetimes in a garbage-collected language like Python, but Tkinter is just…weird about it.

    My wager would be that for whatever reason, once your change_image() function returns, the garbage collector is coming around and releasing new_tk_image (or maybe even new_image?), even though test_image_label should hold a reference to it by that point? And the breakpoint() stops the function from returning, so you are “safe” (at least temporarily).

    What I would try then, as a workaround, would be to store your own references to some of these and see if it works? You can begin by just making them globals to see if this is indeed the problem, though it’s probably more elegant to group them together in a class with anything else to do with the window.



  • In terms of consoles, I got the most enjoyment out of Super Nintendo. I think that’s in part because my kids were still young at the time and we played a lot of coop mode games on it before they got older and their tastes started diverging from mine.

    It was the golden age of platformers I guess, and the focus was still solidly on game mechanics over production. I especially liked Bomberman. The gameplay was just perfect the way the challenge scaled naturally even as you got upgrades or added a 2nd player. Literally a blast!