@veronica@mastodon.online
@veronica@mastodon.online avatar

veronica

@veronica@mastodon.online

Senior Developer at https://mastodon.social/@turtlesec ★ High Energy Physics PhD from Uni Oslo and CERN ★ Linux ★ Python ★ Open Source ★ Unicode Unicorn ★ ISO 8601 Enthusiast ★ Consumer of Sci-Fi ★ Hobby Writer ★ Born at 336 ppm CO₂ ★ she/they, Dr.

Open Source: https://novelwriter.io, https://fosstodon.org/@novelwriter

(Banner image from Wallpaper Access)

This profile is from a federated server and may be incomplete. Browse more on the original instance.

arnfinnp, to random
@arnfinnp@oslo.town avatar

So. Eurovision this weekend. Lots of people boycotting. But the "friends" of Israel are gearing up. And there just might be enough of them around Europe for Israel to win.

veronica,
@veronica@mastodon.online avatar

@arnfinnp I wonder why violent regimes crave the ESC attention. Maybe it signals "business as usual" so they can pretend nothing is going on? As if people are that easily fooled by propaganda?

scy, to python
@scy@chaos.social avatar

Imports in Python can be confusing.

I just saw someone ask "why do I have to prepend a dot to import a file in the same directory?"

That depends on whether the file with the import statement is in a package or not.

But, whether Python considers it to be in a package depends on how you imported (or ran) that file. You can't determine it from the file's content or the filesystem structure!

Check alt text (image description) for explanations of the examples.

Running four commands from the parent directory. "python3 mypkg/abs_import.py" prints "in pkg", because Python found mymod.py in the same directory as the file it has been asked to run. That's because sys.path (which is used to define search order for modules) is initialized like this (quoting from the docs): "The first entry in the module search path is the directory that contains the input script, if there is one. Otherwise, the first entry is the current directory, which is the case when executing the interactive shell, a -c command, or -m module." "python3 mypkg/rel_import.py" throws an ImportError: "attempted relative import with no known parent package". Just because you're running a file in a subdirectory doesn't make this directory a package. "python3 -m mypkg.rel_import" prints "in pkg", because Python is now interpreting mypkg as a package name, has found the rel_import module in that package, and is able to do relative imports from there. "python3 -m mypkg.abs_import" prints "top level". Remember the documentation from above: If there is no input script (and there isn't, we're asking Python to resolve and run a module instead), sys.path will first look in the current directory, i.e. the one containing the mypkg package, because that's the one we're currently in.
We now change into the mypkg directory with a "cd" command. "python3 abs_import.py" prints "in pkg", because Python is going to look for "mymod" in the directory containing the input script (which happens to be the current directory, but that's not relevant). "python3 rel_import.py" throws an ImportError "attempted relative import with no known parent package" again. Understandably, because Python has no way of knowing that the directory we're currently in can be interpreted as a package. "python3 -m abs_import" prints "in pkg", because sys.path first looks for mymod the current directory. "python3 -m rel_import" raises an ImportError "attempted relative import with no known parent package" again. That's because, in contrast to what we did in the last example in the previous screenshot, we're now just using "rel_import" as the module name we're asking Python to run, without the "mypkg" prefix. Adding the prefix wouldn't work, because our current directory is already inside the mypkg package and Python (correctly) wouldn't find another "mypkg" directory in it. But without the prefix, Python doesn't know that the "rel_import" module resides in a package at all.
We now move into the parent directory again ("cd ..") and delete the top-level mymod.py file. Then, we attempt the examples from the second image again. "python3 mypkg/abs_import.py" prints "in pkg" as before, because Python found mymod.py in the same directory as the file it has been asked to run. "python3 mypkg/rel_import.py" throws an ImportError: "attempted relative import with no known parent package", just like before, because it interprets the file path as a script to run, not as a module in a package. "python3 -m mypkg.rel_import" prints "in pkg", just like before, because Python is interpreting mypkg as a package name, has found the rel_import module in that package, and is able to do relative imports from there. "python3 -m mypkg.abs_import" throws a ModuleNotFoundError "no module named 'mymod'. Before, it printed "top level", but now we have deleted the top-level mymod.py file that it was importing.

veronica,
@veronica@mastodon.online avatar

@scy Even if they were optional, packaging tools still tend to expect them for auto-discovery. We've run into this a few times at work. I usually drop them except for in the root folder of a package.

veronica,
@veronica@mastodon.online avatar

@scy Several reasons. For libraries, I use it to control how things are imported by the user by exposing it there. Which means I can restructure the files behind it without changing the import path.

For applications, I use it as the entry point.

In both cases I often do some initialisation there, like set up logging, etc.

veronica, to gaming
@veronica@mastodon.online avatar

So, I started playing World of Warcraft again this weekend ... 😁

I've been playing it on and off since just after its European release in 2005. My oldest characters have reached legal drinking age. 😅

I stopped playing in 2021 as I really disliked the Shadowlands expansion. The one before was excellent, and I'm now playing Dragonflight from 2022, which also seems good so far. There is a new one coming after the summer or thereabouts. We'll see how long I last this time!

veronica,
@veronica@mastodon.online avatar

I'm not really a gamer, and I'm too old to bother learning new games. The fact that World of Warcraft is still around after almost 20 years suits me just fine!

veronica,
@veronica@mastodon.online avatar

World of Warcraft still runs smoothly on Linux too, which makes me very happy. I hate having a dual partition setup with Windows because then I have to reboot to access my regular stuff.

Also, it looks so much better in 24x9 ratio as opposed to the previous 16x9 format, or shudder 4x3 like back when I started. Now all my action bars, chat windows and quest log widgets are out of my way. I opted out of running full 32x9 as I had to turn my head to read things. 😋

veronica,
@veronica@mastodon.online avatar

@cvennevik I got the double wide for work (home office), but it really was too wide for such an information heavy game as WoW. Since I mostly run in windowed mode anyway, using 1.5 x Wide was the sweet spot. It leaves a regular wide screen worth of free space in the middle.

veronica,
@veronica@mastodon.online avatar

@markus I played a fair bit of adventure and strategy games back in the day. Monkey Island, Dune, Warcraft, Starcraft, Age of Empires, Heroes of Might and Magic, etc. So World of Warcraft was perfect for me when it arrived. I've taken a number of long breaks for expansions I disliked, but I've played it for about half the time it's existed I guess.

The reason I started now is that I ran out of interesting TV series to watch when I have some time off, so I thought I'd check out WoW again. 😊

veronica,
@veronica@mastodon.online avatar

@jotho I totally get that people get addicted to games. I've played with people in WoW whose lives fell apart because of it.

However, it doesn't have that affect on me. For me it's just entertainment. It's pointless in the same sense watching TV is. I still do it. I find storytelling rewarding, and WoW has plenty of that, and it is a beautiful game from an artistic point of view, which is mainly what captured me in the first place. Even if the graphics was relatively simplistic, and still is.

veronica,
@veronica@mastodon.online avatar

@jotho As a software developer, I have noticed that a lot of people don't pay attention to how things look. 😁

Personally, I avoid (open source) software that looks like a train wreck. It gets on my nerves and I can't get used to it.

veronica,
@veronica@mastodon.online avatar

@mattontech @jotho His opinion and experience is perfectly valid. We clearly get different things from the game, and that's fine.

I agree that the achievement itself is pointless in the grand scheme of things, but that's not even close to why I play the game. It is just for fun, and that itself has value. At least to me. 😊

veronica,
@veronica@mastodon.online avatar

@mattontech In any case, interactive story telling is a nice entertainment form, and I've been following the Warcraft story since the third strategy game.

Battle for Azeroth was excellent story telling. I loved every moment of that expansion. Maybe the best one yet. Such beautiful design and artwork too.

veronica,
@veronica@mastodon.online avatar

@fizbanek For the Horde!

tinybishie, to Game
@tinybishie@mastodon.social avatar

Just a heads up that World Of Warcraft: Cataclysm classic is now live, so going forward any new World Of Warcraft classic VODs or let's plays will just be known as World Of Warcraft classic.

veronica,
@veronica@mastodon.online avatar

@tinybishie I was around the first time, and I remember I really disliked Cataclysm. I don't think I want to repeat that. 😁

novelwriter, to random
@novelwriter@fosstodon.org avatar

Patch release 2.4.1 of novelWriter is now available. It fixes a few issues, mainly with the Manuscript Build tool, and makes a few improvements like remembering the scroll position if you update the preview.

https://novelwriter.io

veronica,
@veronica@mastodon.online avatar

@novelwriter It also fixes the font issue you reported, @oli 😊

veronica,
@veronica@mastodon.online avatar

@novelwriter @oli Yay for issue reports on Mastodon!

veronica,
@veronica@mastodon.online avatar

@oli I remembered it, so no problem. 😊

stux, to random
@stux@mstdn.social avatar

Uh.. why do we care about Jack Dorsey? :flan_laugh:

/ignoooooore! :blobhappy:

veronica,
@veronica@mastodon.online avatar

@stux Jack who? 🤔

veronica, to random
@veronica@mastodon.online avatar

Atlassian is so bad at UX that it boggles the mind that they're still in business. Jira is a monster that requires infinite patience to try to wrangle into submission. I hate every moment I spend in that tool.

veronica,
@veronica@mastodon.online avatar

@Benhm3 My current project uses Confluence a lot too. It is also awful, but less so than Jira.

I don't know if there are better tools out there, but I doubt the company I'm contracted to has any plans to switch in any case. I mostly avoid doing anything other than drag tasks to the review/done column. It's probably best for my blood pressure.

veronica,
@veronica@mastodon.online avatar

@Benhm3 Yeah, I've used ServiceNow a fair bit too on an earlier project I was on for the same contract. It doesn't look very appealing, and it's a little intimidating, but not that hard to get used to. Once you do, it works fairly well. Jira I've used for years, and still find it a total mess.

gerrymcgovern, to random
@gerrymcgovern@mastodon.green avatar

The Paradox of the Nordic "Green" Transition

“The per person emissions in Norway were incredibly high. With this data set we can confirm that from a Norwegian perspective we have a lot of work to do, because we are third in the world when it comes to emissions per person from domestic [flight] emissions.”

https://norwegianscitechnews.com/2024/04/big-data-reveals-true-climate-impact-of-worldwide-air-travel/

Per capita, Norway is 3rd worst in world for domestic flight pollution. It is 1st worst in world for e-waste. Norway has also voted to mine and destroy the deep seas.

veronica,
@veronica@mastodon.online avatar

@gerrymcgovern As I've said before, Norway greenwashes its reputation by cooking the books, not actually doing much to become greener in practice. It's mostly down to greed.

We are doing our best to elect better representatives, but too many either don't care or are buying into our own propaganda.

veronica,
@veronica@mastodon.online avatar

@gerrymcgovern Out of 169 seats in parliament, only 35 are occupied by representatives from parties with decent or good green policies. If we had an election today, that number would only grow to 39. It isn't making much of a difference unfortunately.

I wish other countries would sanction us for the whole ocean mining initiative. We deserve that 100%. I think that's the only response that would register with the major parties.

dlundh, to random
@dlundh@horrorhub.club avatar
veronica,
@veronica@mastodon.online avatar

@UKFilmNerd @dlundh Both "Aliens" and "The Abyss" are on my favourites list. Number 7 and 23, respectively. Great films!

veronica,
@veronica@mastodon.online avatar

@UKFilmNerd @dlundh I just export the list of my 9 and 10 ratings on IMDB and sort it. 😁

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • kavyap
  • cisconetworking
  • thenastyranch
  • magazineikmin
  • hgfsjryuu7
  • DreamBathrooms
  • InstantRegret
  • Youngstown
  • slotface
  • PowerRangers
  • Durango
  • everett
  • rosin
  • normalnudes
  • vwfavf
  • modclub
  • ethstaker
  • khanakhh
  • tacticalgear
  • ngwrru68w68
  • osvaldo12
  • mdbf
  • tester
  • cubers
  • Leos
  • GTA5RPClips
  • provamag3
  • All magazines