[-] [email protected] 15 points 1 day ago

Mario being such a big part of my childhood makes it sad that stuff takes like 100 years to enter public domain.

I wish it was 20 years.
Imagine how much easier fan games, modding, and emulation/preservation would be!

Galaxy was amazing!

[-] [email protected] 8 points 2 days ago* (last edited 2 days ago)

Interesting. Thank you.

Edit: Is this the video?

[-] [email protected] 23 points 2 days ago

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.

9
submitted 3 days ago by [email protected] to c/[email protected]

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?

[-] [email protected] 5 points 6 days ago* (last edited 6 days ago)

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

[-] [email protected] 2 points 1 week ago

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.

[-] [email protected] 11 points 1 week ago

RMS’s biography “Free as in Freedom” seems to be under the GNU Free Documentation License, incase that’s anything to go by.

[-] [email protected] 12 points 2 weeks ago* (last edited 1 week ago)

Instead of trying to screw over our country any more, why don’t you just go and enlist?

[-] [email protected] 36 points 2 weeks ago

PLEASE COMEFROM 🏷

[-] [email protected] 1 points 2 weeks ago
[-] [email protected] 4 points 2 weeks ago

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

[-] [email protected] 36 points 2 weeks ago

Umm… someone explain this code please?

[-] [email protected] 1 points 2 weeks ago

I don’t know much about SSDs.

17
submitted 3 weeks ago by [email protected] to c/[email protected]

Even without the search, those two were the only small SSDs I could find under "Memory and Storage".

60
submitted 1 month ago* (last edited 1 month ago) by [email protected] to c/[email protected]

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.

26
submitted 1 month ago by [email protected] to c/[email protected]
325
submitted 2 months ago* (last edited 1 month ago) by [email protected] to c/[email protected]

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

7
submitted 2 months ago by [email protected] to c/[email protected]

Does anyone know if this has been reported yet, or how long these issues last for?

10
submitted 4 months ago by [email protected] to c/[email protected]

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.
2
submitted 4 months ago by [email protected] to c/[email protected]

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.

3
submitted 4 months ago by [email protected] to c/[email protected]

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
submitted 6 months ago* (last edited 6 months ago) by [email protected] to c/[email protected]

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?

25
submitted 9 months ago* (last edited 9 months ago) by [email protected] to c/[email protected]

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?

12
submitted 9 months ago* (last edited 9 months ago) by [email protected] to c/[email protected]

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.

view more: next ›

s12

joined 2 years ago