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)
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)
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.
#zusammengegenrechts
#Brandmauer
#BrandmauergegenRechts
#niewiederistjetzt
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
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….
Hello Fediverse. This is my #Introduction. I'm an audiovisual and editorial #translator looking to connect with fellow #translators and #language lovers to exchange ideas on: why languages are great, why translation is amazing, and how we can navigate the #translation industry now AI is becoming more and more impactful. Some topics that interest me: inclusive language, inclusive communication, inclusion, linguistic varieties, linguistic prejudice. #Xl8
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…