Posts
2919
Following
79
Followers
66
python Coding Question
Show content

Hey fedi I have a coding question for you today. I would basically want to know if this “something” I have in my brain right now.

The basics are, that I am wrinting a little Program with pyQT that should help me with some character sheets for the trpg I am playing.

Decided to ask here since I don’t really can put my finger on exactly I am looking for that makes search kinda hard atm.

Here is a link to the code. It is a kinda long snippet so I uploaded to privatebin: https://privatebin.net/?570a6d8ea9dbe90c#FQkCQf8jkq85xW7YQ2MFfRdAqD1antmduFFMFaEerRsf

So the basic gist is I have some Code for some QT-Dropdowns which works generally (very proud of that btw)

My “problem is that I have a lot of duplicated code in there right now. I do almost the same thing for the left hand and right hand resepectably.

I have to do the same for 100 Skill Blocks as well and having the same code blocks 100 times does scream to me some way.

Is there maybe a way I can reuse a function in python with different names?

Like renaming def change_equipment_list_right_hand(self): to def change_equipment_list_x_hand(self): and then kind of replace the “x” in the whole function with something else?

I hope I somehow got across what I am looking for. It is kinda hard for me to ask smart question about this stuff since I am really a novice with python (just dabbling in it here and there)

#python #coding #question

0
1
1
python Coding Question
Show content

Hey fedi I have a coding question for you today. I would basically want to know if this “something” I have in my brain right now.

The basics are, that I am wrinting a little Program with pyQT that should help me with some character sheets for the trpg I am playing.

Decided to ask here since I don’t really can put my finger on exactly I am looking for that makes search kinda hard atm.

Here is a link to the code. It is a kinda long snippet so I uploaded to privatebin: https://privatebin.net/?570a6d8ea9dbe90c#FQkCQf8jkq85xW7YQ2MFfRdAqD1antmduFFMFaEerRsf

So the basic gist is I have some Code for some QT-Dropdowns which works generally (very proud of that btw)

My “problem is that I have a lot of duplicated code in there right now. I do almost the same thing for the left hand and right hand resepectably.

I have to do the same for 100 Skill Blocks as well and having the same code blocks 100 times does scream to me some way.

Is there maybe a way I can reuse a function in python with different names?

Like renaming def change_equipment_list_right_hand(self): to def change_equipment_list_x_hand(self): and then kind of replace the “x” in the whole function with something else?

I hope I somehow got across what I am looking for. It is kinda hard for me to ask smart question about this stuff since I am really a novice with python (just dabbling in it here and there)

#python #coding #question

0
1
1
@DM_Ronin Such a cool thread. Reminds of those Manga Guide to Databases and the like

RE: https://mstdn.social/users/DM_Ronin/statuses/112389235245875971
0
0
0
repeated
Edited 8 months ago

Mal wieder Respekt für diesen Unternehmer.

Eigentlich wäre es nur konsequent an Würth zu schreiben und zu bitten, die Firmen, die die Geschäftsbeziehungen eingestellt haben zu nennen, damit man als Privatperson zu diesen Firmen auch die Geschäftsbeziehungen einstellen kann.




https://www.swr.de/swraktuell/baden-wuerttemberg/heilbronn/anti-afd-brief-kostet-millionenumsatz-100.html

9
1
0
Guten morgen an die feuchte Fedi-Montags-Welt ElainaWave
1
0
0
long programming post (python)
Show content
I am actually having fun doing some programming right now. There is actually a problem I have I can solve with programming lol. Something that helps when I want to learn new stuff.

Allow me a quick tangent to explain what the goal is....

I really like playing the konosuba TRPG at the moment. I found two comfy groups to play with keeping me busy at the weekends (for 2 of any given month atleast)

I kinda was not the biggest fan of all the math I needed to do to create a character (especially since you have to redo lots of math when leveling up)

Since I don't really know any programming language. I made what everyone would do. Create a Spreadsheet. That was ... fun. I did get it to work how I wanted in the end. Which is cool. Really proud of what I made.

There is one problem. If I have to update the sheet for any reason (like wrong formulas or correct and add new skills) my players need to rebuild their character in the new sheet from scratch. It does not take too much time to do. But is something one could avoid.

I had that idea for a long time now to create a little program for this instead with a GUI component that is separate from the database portion (even a proper one!). So I could update the database any time I wanted and the players just need to drop in the new database and be done.

(And yes I did use the spreadsheet as a sudo-database maybe not the best decision oh well)

I have choosen python for the project since its all I really know even the tiniest bit (not that I know that much of it anyway, but debugging it is kinda nice I suppose...) from building a web scraper with it once.

I knew you could build GUIs with python. So I started searching around. Found pySimpleGUI and started with that only to get limited quite quickly and throwing that idea in the bin.

I found tkinter, which is a standard library in any python install. This is great since my players only would need python on their PCs as of now. I will likely need to add a dependency later for sqlite anyway, but why pull more stuff then necessary right?

The tkinter-GUI looks kinda bland and dated but it works so akko_shrug

I am starting to figure out some stuff and have made some progress. Right now I am just building the GUI without (much) logic behind it. Just so I have everything in place in terms of variables later. The screenshot shows my progress so far.

I already figured out how to make Input Boxes, Labels, Dropdowns and Tabs (weee)

That table at the bottom is built likely absolutely horribly but I needed many variables to do math with... So each column and row has its own variables. with lovely names as "Base_Stat_Attribute_Strength" and "Class_Mod_Strength" and "Class_Mod_Strength_Number" blobcatjoy

That should help me atleast to implement the logic easier later.

I started using Code-OSS for this project and have to say that microsoft does have build a nice editor for code. I could even add a Python debugger later which makes testing the file easier (instead typing commands to start the file into a terminal).

The one thing I saw in pyCharm which Code-OSS does not seem to have (yet?) is a nice list of all the variables I have defined which might be nice to implement the logic later.

If anyone of you has some ideas for useful stuff in Code-OSS let me know. I only know by now I won't use PyCharm since it seems like really heavy on processing power (Laptop fans spun up for sure when I started that lol)
0
1
1
Homeserver Chronicles RAID-Edition
Show content

Some stuff is just funny to me. You I today went ahead and updated my server remotely (since I am not home atm for some time, ssh sure is nice ey)

So updated my Ubuntu on my homeserver just fine, new kernel and all. Went ahead to reboot. That takes some time normally with the homeserver.

When it was up again I ssh’d into again and I made a habit to check if any systemd-services did fail after a reboot. There was actually one: docker. It could not mount its storage-system.

Digging a bit on the internet revealed that some kernel module might not been loaded properly. Looking through some stuff I found I had the kernel

5.15.0-100-generic was loaded (via uname -r) but under /boot I only had 5.15.0-105-generic and 5.15.0-92-generic

neocat_confused How does that work xD

Looking around more I found out a disk was not mounted in the raid1 that is the system-disks (both SSDs).

So checked that disk and …. it seems fine?

Then why would linux throw it out of the md-raid?

I am utterly confused but that explains how I can load that kernel that does not exist on the other disk.

Basically I have only software-raid so both disks have their independent bootloaders installed.

It seems to me the disk got dropped out some time before the update today? and the update only took place on one disk?

The one disk that dropped was in a lower sata slot. So the dropped out disk was /dev/sdf, while the one still going is /dev/sdg

I suppose the system will mostly use /dev/sdf bootloader and somehow find that 100 kernel in there and boot that? I am utterly confused how this can even work….

Since the kernel modules are not quite the same linux gets a tad confused I suppose. I am though kinda surprised how usuable that server still is in that state.

I mean most stuff like sharkey, nextcloud and postgres run only on that array of raid5 spinning rust I have.

Right now I added the dropped-out disk in again and its now resyncing….

1
1
0
@epsi Soon™ in your windows Powershell / Command Prompt.


I am sorry epsi fedi just broke me at this point. I had to think of you reading this. neocat_sweat

RE: https://mastodon.social/users/andymoose/statuses/112329271398147988
0
0
0
I am not sorry for this. I just had to get this one out of my system. Sadly I was not able to find the Sword Princess there. Instead I found a russian-style store.
0
1
2
Is this really happening? Mastodon of all things getting quote-post neocat_surprised_pika

Next thing you tell me is that they add custom emotes and custom emote reaction.

Is this an out of season Aprils Fool Joke? neofox_laugh

Will be interesting to see if mastodon builds on something existing or builds its own implementation. The latter likely and then everyone else will have to scramble again to support it lol.

Also will be interesting to see if all those doomsayers against the feature will be true or not (likely not)

(And yes this quote post is intentional comfyevil )

RE: https://oisaur.com/users/renchap/statuses/112299860209222424
0
0
0
repeated
Edited 9 months ago

Hello Fediverse. This is my . I'm an audiovisual and editorial looking to connect with fellow and lovers to exchange ideas on: why languages are great, why translation is amazing, and how we can navigate the industry now AI is becoming more and more impactful. Some topics that interest me: inclusive language, inclusive communication, inclusion, linguistic varieties, linguistic prejudice.

9
1
0
depol -
Show content
Ich schäme mich grad wieder für mein Land.... also wirklich übel. Ich hab mir die heute-show von letzter Woche angeschaut. Mit dabei die Höcke TV-Debatte darum gehts mir gar nicht.

Mehr um das Ende der letzten Folge wo sie über das Gesetz von Lauterbach reden, dass ja auch die Globuli als Kassenleistung streichen sollte...

Der passus fehlt nämlich jetzt auf einmal. Und wer ist dran schuld? Nein es ist mal NICHT DIE FDP! ES SIND DIE GRÜNEN! und dann auch noch die aus Baden-Württemberg.

Ich hab einfach keinen Bock mehr auf die ganze Scheiße hier. Hier noch ein Artikel der Tagesschau dazu....

https://www.tagesschau.de/inland/innenpolitik/lauterbach-homoeopathie-102.html

Besonders geil find ich ja den Passus weiter unten wo geschrieben wird selbst man das weiter zahle falle das nicht ins Gewicht... 20 bis 50 Millionen von 300 Millarden Budget sind nicht viel klar.

Aber jeder Cent denn man für diese Scheiße ausgibt die wisschenschaftlich-erwisene nicht über den Placebo-Effekt hinausgehende Scheiße ausgibt ist doch zuviel. Ich bin mir sicher man könnte das Geld sinnvoller verwenden.

ALLES IST SINNVOLLER ALS FUCKING ZUCKERKUGELN!!!

Ich mag nimmer... Ich schau jetzt keine Politik mehr an heute...
0
0
0
SPAM WHY DO YOU EXIST?! Its fun to fight spam-accounts at 4am in the morning :neocat_woozy:
Show content

My 4am brain has a little PSA for you. Just don’t run services with open registration and no further barrier on the internet.

You will end up like me when I got up today to use the bathroom then look at your smartphone only to find like 60 messages of registration on the service you run, all with usernames comprised of three random english words wie etwa hier

@abyssservicecalculations:chat.lightnovel-dungeon.de
@arriveopenlyversion:chat.lightnovel-dungeon.de
@aspiratenegligentno:chat.lightnovel-dungeon.de
@betterreportsgenius:chat.lightnovel-dungeon.de
@boastfulnessunlearnedheard:chat.lightnovel-dungeon.de
@burnestgeneralbeneath:chat.lightnovel-dungeon.de
@burthenedfornicatinglabour:chat.lightnovel-dungeon.de
@characternimblebeat:chat.lightnovel-dungeon.de
@conferdescendtire:chat.lightnovel-dungeon.de
@corruptionspantingstage:chat.lightnovel-dungeon.de
@diminishfarspend:chat.lightnovel-dungeon.de
@discoursingpayingsprang:chat.lightnovel-dungeon.de
@docsnourishmentsisrael:chat.lightnovel-dungeon.de
@editioncapablenarrowness:chat.lightnovel-dungeon.de
@esteemlivedrenderest:chat.lightnovel-dungeon.de
@foreheadparedpage:chat.lightnovel-dungeon.de
@foulnesscircusturmoiling:chat.lightnovel-dungeon.de
@harmonizedsupportoverwhelmed:chat.lightnovel-dungeon.de
@impostumestriersstream:chat.lightnovel-dungeon.de
@indirectbackpopular:chat.lightnovel-dungeon.de
@inspiringfiresmanifold:chat.lightnovel-dungeon.de
@itselfdisappearprovince:chat.lightnovel-dungeon.de
@khumarahn:chat.lightnovel-dungeon.de
@kruxytfsgs:chat.lightnovel-dungeon.de
@lightbroughtesttemper:chat.lightnovel-dungeon.de
@loathedinstructioncombine:chat.lightnovel-dungeon.de
@madestdebtorchief:chat.lightnovel-dungeon.de
@marksawebegged:chat.lightnovel-dungeon.de
@meditateexcludedredeemed:chat.lightnovel-dungeon.de
@mindedpersonallyfirst:chat.lightnovel-dungeon.de
@murmurshapendocs:chat.lightnovel-dungeon.de
@narrownesscitiesinvolved:chat.lightnovel-dungeon.de
@oftentimesrankedrequest:chat.lightnovel-dungeon.de
@oratoryshowedstcareful:chat.lightnovel-dungeon.de
@perilsseveraltorment:chat.lightnovel-dungeon.de
@pghonouringyes:chat.lightnovel-dungeon.de
@pointedunionreturns:chat.lightnovel-dungeon.de
@productsimitateexhortation:chat.lightnovel-dungeon.de
@protectionhoneyfire:chat.lightnovel-dungeon.de
@representwipefigurative:chat.lightnovel-dungeon.de
@roomambitiousstupidity:chat.lightnovel-dungeon.de
@ruledinitiatoryuntil:chat.lightnovel-dungeon.de
@savagenesssometimead:chat.lightnovel-dungeon.de
@senselessweightsuniverse:chat.lightnovel-dungeon.de
@singethgovernorrecovering:chat.lightnovel-dungeon.de
@skiesvirginsmean:chat.lightnovel-dungeon.de
@subordinateneverflies:chat.lightnovel-dungeon.de
@thingspentranscription:chat.lightnovel-dungeon.de
@treatspentdisobeyed:chat.lightnovel-dungeon.de
@trusteesfrontweariness:chat.lightnovel-dungeon.de
@unlikerdividinginvited:chat.lightnovel-dungeon.de
@unrulilycomparebeasts:chat.lightnovel-dungeon.de
@vicesbasilicaaccused:chat.lightnovel-dungeon.de
@whocogobustle:chat.lightnovel-dungeon.de
@yieldsspreadestblasphemy:chat.lightnovel-dungeon.de
@youthsdispraisemisdeeds:chat.lightnovel-dungeon.de

This is 56 users someone registered… I tried to shove the problem and get some sleep. Well guess who could not go to sleep without solving that issue first? This idiot here.

So as I was finished setting registration on conduit (a very nice matrix-server I might add) via tokens only it was already like half past 5 and there was no use in going to bed anyway since I normally get up at 6am.

Just make sure to secure your services fedizens…

0
0
0
You just got to love these stupid videos. I know I do

https://www.youtube.com/watch?v=OY-oYfHeE64
0
0
0
neofox_bottom Am I now allowed to "pspspspsps" at volpeon and he will come?
0
0
0
You know I am still translating some stuff for the konosuba TRPG. What I did not expect is to @volpeon in there blobcatjoy
2
2
2
windows rant
Show content
Just why is windows being so shit? Like how is the default state in which an OS should function ever?

Story time: I have two devices flying around here. An old laptop and a newer tablet (librem 11). I use them for different things. The laptop is now relegated as a des "desktop"-replacement thingie. Just sitting on my desk all day being hooked up to a monitor keyboard and mouse.

the librem 11 is for taking to uni mostly, since I found it to be kinda lacking for home use. (Its just missing some ompf sometimes taking a tad too long for stuff).

The librem 11 obviously runs linux. But on the laptop I have windows installed atm, since its just way easier to use for my online courses (with stuff like zoom and webex, which I know run in a browser but ...)

The laptop also runs windows so I have easy access to adobe digital editions when needed (and can strip the DRM easily neocat_devil )

I was using the laptop the last few days to do some work ("translating" some stuff for the konosuba TRPG). I was doing some work on that today and decided to take a break and eat something. I just put the thing into stand-by and left the lid open. (should have just closed it tbh)

The laptop was making some noises here and there. I thought maybe some notif from discord or fedi.

What it actually likely was is windows telling me it will start doing updates soon. I know this is a setting you can change, but I clearly did not do that yet...

Anyway that sucker then rebooted without prompt. Obvs. closing my document. Good thing that LibreOffice is an actual chad just saves so much headache when restoring stuff. I also am very paranoid and save often.

ablobfoxhyperwhaaaat

Good thing the bigger SSD should come tomorrow so I can just dual boot that sucker.
1
0
1
While browsing for shopping trolleys on amazon it seems like I found one for @volpeon
1
2
15
Alya-san Anime! I repeat Alya-san Anime!

They dropped a trailer last week. Now there is some funnies that russians did not understand what the VA said (sometimes I guess?)

It is though very cool they casted a VA who also speaks russian for Alya. Makes it kinda more cute tbh. She speaks pretty nice russian from what I could make out (the music kinda overtones it a bit) clearly accented but it is very cool to see.

https://super8.absturztau.be/watch?v=fiSZXSBDjrs

neocat_melt
0
0
0
got another 3DS XL (question included)
Show content
Hey fedi maybe someone of you wants to help me out with something.

I grabbed myself another new 3DS XL since I broke the last one I had by being dumb. It is generally in good condition technically. Has some minor damage cosmetically.

There is something which is a bit unfortunate. You can see it on the attached 3rd image. You can see a gap on the left side of maybe 1 millimeter. The Hinges generally work well though being a bit wobbly.

This seems to be a common issue with these things. Some suggest taking it apart and applying some tape to the hinge.

Tbh I am not super comfortable taking one apart after breaking the last one by doing so.

Generally the gap does not hinder function but it looks kinda dumb tbh and it kinda makes me unconfortable lol seeing it. Also I dunno if it is really all that healthy for the device?

Anything you guys can suggest I could do about it?
0
0
0
Show older