Skip Navigation
s12 s12 @sopuli.xyz
Posts 21
Comments 226
No common rube
  • Everyone uses laptops that plug into workstations like desktops now.

  • No common rube
  • *Shuts the laptop lid and opens it.
    “Ok! It’s restarted”
    IT person: “Well that was certainly quick. Are you sure you restarted it?”
    Person: *Feels smug about how they were able to restart quicker than most people.

  • No common rube
  • I like to imagine an IT person telling someone that story to see whether they understand it or get a stroke, as a way to check if they were telling the truth about being good with computers and having tried everything, or something.

  • Hello! Umm! (by Nima)
  • “Poor thing”

    … then I saw the pumpkins.

  • Unfinished business
  • I’m afraid you’ll need to achieve lichdom for that.

  • Why spend money on ChatGPT?
  • Generic isekai is fine.

  • There are big warning signs behind Labour's historic UK win
  • Never assume victory.

    One of the biggest disadvantages that you can have in a war is to have no idea that you’re fighting one.

  • Liz Truss loses seat as ex-prime minister becomes biggest scalp in Tory bloodbath
  • It amazes me that she nonetheless came so close to keeping her seat. Who voted for her?

    I don’t like how it was a labour landslide. I hoped it would be more balanced with the tories getting fewer seats than green if any.

  • How should I deal with multiple imports having the same name?

    stackoverflow.com How should I deal with multiple imports having the same name

    I have a repository that contains multiple programs: . └── Programs    ├── program1    │   └── Generic_named.py    └── program2    └── Generic_named.py I would like to add testing to this

    How should I deal with multiple imports having the same name

    I have a repository that contains multiple programs:

    . └── Programs    ├── program1    │   └── Generic_named.py    └── program2    └── Generic_named.py

    I would like to add testing to this repository.

    I have attempted to do it like this:

    . ├── Programs │   ├── program1 │   │   └── Generic_named.py │   └── program2 │   └── Generic_named.py └── Tests ├── mock │   ├── 1 │   │   └── custom_module.py │   └── 2 │   └── custom_module.py ├── temp ├── test1.py └── test2.py

    Where temp is a folder to store each program temporarily with mock versions of any required imports that can not be stored directly with the program.

    Suppose we use a hello world example like this:

    cat Programs/program1/Generic_named.py import custom_module

    def main(): return custom_module.out()

    cat Programs/program2/Generic_named.py import custom_module

    def main(): return custom_module.out("Goodbye, World!")

    cat Tests/mock/1/custom_module.py def out():return "Hello, World!"

    cat Tests/mock/2/custom_module.py def out(x):return x

    And I were to use these scripts to test it:

    cat Tests/test1.py import unittest import os import sys import shutil

    if os.path.exists('Tests/temp/1'): shutil.rmtree('Tests/temp/1')

    shutil.copytree('Tests/mock/1', 'Tests/temp/1/') shutil.copyfile('Programs/program1/Generic_named.py', 'Tests/temp/1/Generic_named.py')

    sys.path.append('Tests/temp/1') import Generic_named sys.path.remove('Tests/temp/1')

    class Test(unittest.TestCase): def test_case1(self): self.assertEqual(Generic_named.main(), "Hello, World!")

    if name == 'main': unittest.main()

    cat Tests/test2.py import unittest import os import sys import shutil

    if os.path.exists('Tests/temp/2'): shutil.rmtree('Tests/temp/2')

    shutil.copytree('Tests/mock/2', 'Tests/temp/2') shutil.copyfile('Programs/program2/Generic_named.py', 'Tests/temp/2/Generic_named.py')

    sys.path.append('Tests/temp/2') import Generic_named sys.path.remove('Tests/temp/2')

    class Test(unittest.TestCase): def test_case1(self): self.assertEqual(Generic_named.main(), "Goodbye, World!")

    if name == 'main': unittest.main()

    Both tests pass when run individually:

    python3 -m unittest Tests/test1.py . ---------------------------------------------------------------------- Ran 1 test in 0.000s

    OK

    python3 -m unittest Tests/test2.py . ---------------------------------------------------------------------- Ran 1 test in 0.000s

    OK

    However, they fail when being run together:

    python3 -m unittest discover -p test*.py -s Tests/ .F ====================================================================== FAIL: test_case1 (test2.Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/s/Documents/Coding practice/2024/Test Mess/1/Tests/test2.py", line 18, in test_case1 self.assertEqual(Generic_named.main(), "Goodbye, World!") AssertionError: 'Hello, World!' != 'Goodbye, World!' - Hello, World! + Goodbye, World!

    ---------------------------------------------------------------------- Ran 2 tests in 0.001s

    FAILED (failures=1)

    If I try to use a different temporary name for one of the scripts I am trying to test,

    cat Tests/test2.py import unittest import os import sys import shutil

    if os.path.exists('Tests/temp/2'): shutil.rmtree('Tests/temp/2')

    shutil.copytree('Tests/mock/2', 'Tests/temp/2') shutil.copyfile('Programs/program2/Generic_named.py', 'Tests/temp/2/Generic_named1.py')

    sys.path.append('Tests/temp/2') import Generic_named1 sys.path.remove('Tests/temp/2')

    class Test(unittest.TestCase): def test_case1(self): self.assertEqual(Generic_named1.main(), "Goodbye, World!")

    if name == 'main': unittest.main()

    Then I get a different error:

    python3 -m unittest discover -p test*.py -s Tests/ .E ====================================================================== ERROR: test_case1 (test2.Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/s/Documents/Coding practice/2024/Test Mess/2/Tests/test2.py", line 18, in test_case1 self.assertEqual(Generic_named1.main(), "Goodbye, World!") File "/home/s/Documents/Coding practice/2024/Test Mess/2/Tests/temp/2/Generic_named1.py", line 4, in main return custom_module.out("Goodbye, World!") TypeError: out() takes 0 positional arguments but 1 was given

    ---------------------------------------------------------------------- Ran 2 tests in 0.001s

    FAILED (errors=1)

    It seems to be trying to import the same file, despite me using a different file from a different path with the same name. This seems strange, as I've been making sure to undo any changes to the Python Path after importing what I wish to test. Is there any way to mock the path? I can't change the name of the custom_module, as that would require changing the programs I wish to test.

    How should I write, approach, or setup these tests such that they can be tested with unittest discover the same as they can individually?

    4
    Looking for FOSS Games
  • Does Katawa Shoujo count? It’s not quite FOSS, but it’s a renpy game under CC BY-NC-ND.

  • [Unresolved] What the hell is happening here??
  • Not sure about the closing everything issue. I’ve not had that. But for graphical issues; it often helps to restart cinnamon by pressing alt-F2 (or sometimes Fn+alt+F2), typing “r”, then pressing enter.

    Not sure if that would help for the kind of problems you’re having though.

  • what's a good open source license for a book?
  • RMS’s biography “Free as in Freedom” seems to be under the GNU Free Documentation License, incase that’s anything to go by.

  • Nigel Farage claims Russia was provoked into Ukraine war
  • Instead of trying to screw over our country any more, why don’t you just go and enlist?

  • COMEFROM
  • PLEASE COMEFROM 🏷

  • How to write Hello World
  • Thank you.

  • How to write Hello World
  • I understand that the characters are probably encoded into that number, but I’m struggling to understand that C/C++ code.

  • How to write Hello World
  • Umm… someone explain this code please?

  • Casting practice
  • I cast charm person on the nymph!

  • [SOLVED] Framework laptop 16 won't boot at all after failed Linux Mint install

    I assembled my new Framework laptop 16 yesterday and tested it out with a live Linux Mint environment.

    Today I tried to install Linux Mint to a storage expansion card. During the instillation, I had to create a secure boot password for the codecs. When partitioning, I made a 32GB Swap and had the rest of the storage as root. During the instillation, there was a fatal error. I tried unmounting the partitions on the card to create a new table to try again (using fdisk). This also gave an error, so I decided to reboot.

    When rebooting, the error shown in the image was displayed and then the computer is powered off. Trying to turn it on without the live USB inserted goes to bios. I tried re imaging the USB, but the Framework still displays the same error. I tried disabling secure boot; same result. I tried factory resetting secure boot; same result. I tried booting without the expansion card; same result.

    Transcription:

    Failed to open \EFI\BOOT\mmx64.efi - Not Found Failed to load image ###: Not Found Failed to start MokManager: Not Found Something has gone seriously wrong: Import_mok_state() failed: Not Found

    The "#"s are completely solid (or possibly checked) characters.

    I tried creating a debian USB, but using that gave the same error.

    I'm unsure what I should do. Any help would be great. Thank you in advance!

    Solution: Go into the BIOS with the USB inserted and locate the boot from file option, then navigate the usb to find the grub efi file and use it to boot.

    19

    The “Require videogame publishers to keep games they have sold in a working state” petition just got a response.

    The recent stopkillinggames campaign has been my first exposure to UK petitions.

    Link to petition: https://petition.parliament.uk/petitions/659071 Link to campaign: stopkillinggames.com Link to the campaigner’s video

    Update: Link to the campaigner’s video on the response

    50

    Why does transparency seem to get replaced with black in img2img? How to fix?

    I’ve been having a go at using Stable Diffusion through Easy Diffusion. I made a png with alpha for img2img, but the transparency seems to be getting replaced with black, ruining the image. I was expecting the transparency to get replaced with noise. Are there any good fixes/workarounds?

    • I don’t really want to add my own noise to the input image itself, because wouldn’t that make the randomness produced by stable diffusion useless?
    • Could I manually script it to automatically layer the image over the noise, or over the image after a few steps in?
    • I don’t have a dedicated graphics card yet, so I’m CPU only.
    1

    How easy is it to run stable diffusion on framework’s amd graphics card?

    I don’t know much about graphics cards, but the framework laptop seems to offer an “AMD Radeon™ RX 7700S” and stable diffusion requires Linux ROCm.

    It’s not completely clear if ROCm runs on AMD Radeon™ RX 7700S, so I was wondering if anyone had any experience with setting it up on framework.

    10

    [Help] GPU not found when trying to run Easy Diffusion in desktop mode.

    When I try to turn off Use CPU in settings, it says "No compatible graphics card found!".

    During the instillation, I got an error "hipErrorNoBinaryForGpu" which I looked up and found the command export HSA_OVERRIDE_GFX_VERSION=10.3.0 which got me through the instillation.

    I don't know much about GPUs, so thanks in advance for any help/advice!

    8

    How do I change font colour in code (Godot 3) (Solved)

    I want to create a "gradual colour change" effect in Godot.

    eg: some_set_font_color_func(Color8(255,n,n) where n gradually decreases to make the text fade from white to red.

    I can't figure out what function I would use in place of some_set_font_color_func to change a font's colour.

    Godot themes are somewhat confusing. Given some var var UI:control how would I set the colour of any font(s) contained within that node?

    7

    Not exactly an animeme, but I might as well cross-post since there's not much content here.

    cross-posted from: https://sopuli.xyz/post/770433

    Any tips for creating memes using FOSS. I made this in Impress, then copy-pasted it into gimp, and it reduced the quality a lot.

    > In PowerPoint, you can just select everything, then right-click -> save as image, and it saves whatever you have selected rather than the whole slide. There doesn't seem to be a way to do that in Impress, but I realised you could copy-paste into Gimp and that would copy the objects as an image, so I've been making memes that way.

    1

    Question about gdscript: Which is more efficient?

    I’m just curious about which is the most efficient way of doing this kind of node enumiration:

    for i in something(): o=[var1,var2,var3,varN][i] o.new() o.do_something_based_on_number_of_loops() add_child(o)

    or

    for i in something(): match i: 0: o=var1 o.new() o.do_something_based_on_number_of_loops() add_child(o) 1: o=var2 o.new() o.do_something_based_on_number_of_loops() add_child(o) 2: o=var3 o.new() o.do_something_based_on_number_of_loops() add_child(o) N-1: o=varN o.new() o.do_something_based_on_number_of_loops() add_child(o)

    or

    var items = [var1,var2,var3,varN] for i in something(): o=items[i] o.new() o.do_something_based_on_number_of_loops() add_child(o)

    Or is there a more efficient way of doing it?

    Edit: Sorry if that wasn't clear. Is it better to constantly get something from an "unstored list", store the list in a variable, or not use a list and use a match statement instead? Do they have any advantages/disadvantages that make them better in certain situations?

    21

    Anyone else suddenly having Steam Deck issues?

    Baldur’s Gate 3 worked fine before. Now it returns to the game’s library page just before it would normally show the game’s logos.

    We tried switching to proton experimental, as suggested by people who were having a similar issue back in August, but this gives the same result.

    Has anyone been experiencing anything similar, or does anyone have any advice?

    Thanks in advance.

    Edit: I tried setting “gamemoderun --skip-launcher” or “--skip-launcher” as a launch option, but this didn’t work.

    8

    Account anniversary day meme. Thought I might as well.

    Ah. It's still called cake day over here. Wasn’t sure if it had to be called something different on Lemmy.

    9

    "sgx: There are zero EPC sections" When trying to install Debian with existing /home in encrypted lvm in vm.

    I want to install Debian over an existing Debian install with an existing home partition in an encrypted lvm (to upgrade to testing), and I have been practising in a vm.

    After trying to follow the advice on https://www.blakehartshorn.com/installing-debian-on-existing-encrypted-lvm/, I successfully reached the end of the installation, but when I try to boot into my system, I get the error(s) shown in the attached screenshot.

    Any idea what I did wrong/need to do?

    Edit: "sgx: There are zero EPC sections" is something that displayes when booting successfully into a machine that works too.

    5

    Is the updater acting slow for everyone else?

    I noticed the updater was incredibly slow today. security.ubuntu.com seems to be down. Is that the reason the updater isn't working so well right now? Why is that the case? It makes it somewhat difficult to apply other updates. Even changing mirrors is incredibly slow and hardly works.

    Also, how long does this usually go of for if so?

    Update: Seems to be working fine now. Anyone know what happened?

    1

    Any tips for creating memes using FOSS. I made this in Impress, then copy-pasted it into gimp, and it reduced the quality a lot.

    In PowerPoint, you can just select everything, then right-click -> save as image, and it saves whatever you have selected rather than the whole slide. There doesn't seem to be a way to do that in Impress, but I realised you could copy-paste into Gimp and that would copy the objects as an image, so I've been making memes that way.

    9

    Thought I'd try digging up this old meme I made 5 years ago. Seems kind of edgy looking back. Hope this is alright for this community.

    I'd known I had Asperger's practically all my life, but it wasn't until much later that I'd heard it be called "a disability" and I took a lot of offence to it. It looks like this was actually the first meme I ever made.

    9

    What are the file size limits for Lemmy media uploads?

    Just curious. Couldn’t find out on Google.

    Since Lemmy instances are self hosted, I imagine that it would be much less than most social media sites. What about types of files? Could you upload an animated image sequence or video if the file was small enough? Does this vary between instances? Could you even upload stuff such as .zip if admins wanted to specifically allow it?

    10