Wednesday, 18 December 2024

mój pierwszy raz

Zasiadłem dzisiej w tramwaju od pana prezydenta, co to on go nam zbudował bez swoje dobre serce... Nawet jeździ toto - brawo, to wielkie osiągnięcie w porównaniu do wczorajszej katastrofy 172 - czekanie od 13:54 do 14:30 na przystanku, bo 2 sztuki se nie przyjechały, i wleczenie się Dolną i Sobieskiego - szlag mnie trafił, aż biletu nie kupiłem, żeby se odbębnić tę krzywdę, bo mój czas jest cenny. A że przy Rakowcu korka jeszcze nie było i to tam nie kupiłem biletu - no, antycypacja, jak to u teoretyków. Dużo czytam, zapamiętuję... No i wielkim osiągnięciem było to, że nie było gościa, który niestety na Sobieskiego nie podróżuje. Brzmi trochę jak "Pamiętnik" Lema, ale nieco mniej pozbierane. Czego to klej i rap nie robią z mózgiem. A my wszyscy zdrowi przecież.

Wednesday, 11 December 2024

return None

Another silly looking thing in vsc's snake oil plugin:

Having a base class with some AddItem function (which is sort of complicated, requires lots of checks/validations and bells and whistles) which is obviously void*, I made some child class and wanted to override AddItem. Which both (a) requires the base function to run, (b) makes some crucial additions/corrections afterwards. And the pie-lance thing autocompletes to

def AddItem(self, ... ) -> None:
    return super().AddItem(...)

even though it's known that there is nothing to return. Well, at least the base function would be called. According to some post from 2019, the issue has been fixed. Apparently, for __init__'s only.

* " -> None" is the pythonic way of speaking of void or subroutine; at least for those who jack off to PEP-8 or zen of whatever and prefer code with underscores and without caps. And teach others what is more pythonic than something less pythonic, and be fiercely proud of it. And perhaps find frequent "typing" childish.

Yet another battle with "circular imports". Sheesh, two modules with almost 500 lines each, just fucking because two classes have to know about each other! Are you fucking with me? Plus endless hidden errors giving fake info on apparent c.i. in test exploder or expander ...

Another hidden treasure in (otherwise great!) unittest extension: when I reference another test class in order to use its function (oh, it's a method ... fuck business logic) in a test, the thing gets lost in translation and "discovers" some fictional test, so it seems. It can even run and debug that thing, but looking into source code gets us in trouble of "file not found". Workaround: just import the object you need at the top of the file, not in that single test function:

module TA:
class TestsA:
    def testThisOrThat(self):
        //...
    def SomeStuff():
        # produce test objects or so
 
module TB:
class TestsB:
    def testWhatever(self):
        from TA import TestsA <- works, but introduces the problem. Move to the top of TB.
        t = TestsA()
        t.SomeStuff()

In Python, we cannot declare a variable or value as constant in Python. But we can indicate to programmers that a variable is a constant by using an all upper case variable name.
Yeah, dumbass, you forgot the third "in python". Script kiddies as we used to call'ems.

Hey, wait! I can wrap the to-be-constant value in a class and throw exception at anyone that tries to set it to something else!

Mr van Possum, your braindead kid is doing great. Young, Gifted and Crude ...

Whatever it is, I'm against it.

Monday, 9 December 2024

Friday, 6 December 2024

another broken piece of snake

Here we go again:

class SomePlot(PlotBase):
def __init__(self,\
data: list[tuple[array, array]],\
legendItems: list[str],\
b: float,\
aspect: float = None,\
showGrid: bool = True,\
xrange: tuple[float, float] = None,\
yrange: tuple[float, float] = None):
assert b > 0.0, f'Wrong b passed: {b}.'
super().__init__(data = data,\
axisLabels = ('x','y'),\
title= '...',
legendItems = legendItems,\
xrange = xrange,\
yrange= yrange,\
tics = None,\
aspect = aspect,
showGrid = showGrid)
 
Why the hell is some parlance thing showing me bullshit about unclosed parens in the call
to super's init and why there is this braindead stuff about this or that kind of args (named 
vs keyword?)  - me dunno nothin; super/Base ctor args are listed in the correct order, just in
case. Didn't help much though. 
 
Time to switch to normal languages, I've had enough.

Oh, another thing that drives me nuts is MsVsStudio that tries helping me while I'm typing, 
guessing namespaces. Half of the time when I write List<...> it puts some obscure
System.Windows.Documents that I don't care much about... Or the xml-like docs above
classes/functions - I recall writing to myself something along the lines of "TODO: consider
making this function virtual" and then there is some smart-ass service that gets in the way
and automagically turns it into <see langword="virtual"/>. Utterly annoying.

Aria Jontka

 1100! 1100! 1100! Смерть в лицо нам дышыт!

Z kolei "Герой асфальта"  zalatuje miejscami Mercyful Fate. Ja znam tylko 3 kawałki, w tym jeden z countrowym zakończeniem.

Tuesday, 3 December 2024

pandas int -> float nightmare

Yeah,

426,{name},77565,77514,77469.0,-1

all numbers are ids, the next to last is automagically converted to float. What the heck?

Workaround: avoid empty values (there are some).

It seems people have had problems the other way round too. Funny.