Dystopian nightmare

January 27th, 2025

So, I hear that Trump fired the federal judges that were investigating them. The president *should not have the power to fire judges*. The president should *be investigated for doing this*. Of course, we all know Trump belongs in the slammer and that the Republicans have become the most epicly corrupt party in American history – helped with a a nonstop lies and propaganda news network (Fox)

Republicans demonstrating their moronic tendencies

January 27th, 2025

So, Trump is talking about ending FEMA in favor of having individual states have their own emergency management systems. Now, this clearly is going to lead to a much less efficient system, because most of the time most states don’t need emergency management but when they do, they’re going to be in the middle of fires, hurricanes, etc.

Bear this in mind, Republicans.. as your house burns or is wiped away by hurricanes or whatever.. and it takes far longer than it used to to get help, and the help is less effective and less coordinated.. Trump is making things worse, because that’s what Republicans do, especially lately.

My hope is that all the many, many MAGA-ites being hurt by Dear Leader will remember getting their face eaten and in the future vote against right wing stupidity. Of course, odds are no, because Fox will continue to hold them in thrall.

Opposite of gratitude directed at Fender

January 22nd, 2025

Look.. guys.. let me spell it out for you. STOP ENGINEERING EVERY LAST PENNY OUT OF THE PRODUCT! You’re engineering away the shine, the reliability, the worth. Money isn’t worth it. You are selling your soul so your boss can drive a lambo that at some point will also be worthless because *their* engineers will make the same mistake.

Seriously.. this is a *guitar amp*, not a piece of bespoke stereo equipment that’s going to sit on the shelf somewhere. It’s going to get taken to bars, knocked over, have it’s instrument cable tripped over.. and that’s the world I *want* to live in. The one where all that happens, and the thing still works.

STOP IT WITH THE PLASTIC PCB 1/4″ FOR THE INSTRUMENT INPUT. I cannot POSSIBLY state this more clearly. Use a pigtail and a switchcraft jack. And a lock washer or two nuts while you’re at it.

In defense of some ideas that are anti the status quo

January 20th, 2025

#1: Property values – from my point of view, the sane person wants their property values to stay the same, or to go down. If you want your property values to go up, A: you hate your neighborhood and are planning on leaving B: you don’t want other people to be able to afford to live there C: possibly you’re doing two things which are a bad idea – 1) gauging your value as a person on your net worth and 2) including the value of your home in your assessment of your net worth – not only might you lose it at any time to the capricious whims of earth, but this encourages all kinds of unhealthy thinking surrounding the family unit – healthy families have more than a few people and the home may be owned amongst everyone or titled in one person’s name for convenience sake.

In any case, lowering property values is a good thing. Which is good, because I want to live in a neighborhood that looks lived in, with science projects and houses of all different colors and sports equipment and dogs and kids and general mayhem.

#2: The cheapest option is often *not* *the best. For example in southern california the argument against desal plants is often the cost of water. However, what SoCal is doing now will sooner or later lead to a catastrophe – indeed one could argue it already has (more on this in another post). SoCal should be self sufficient, water wise, and that is better than having the cheapest water.

#3: Ideally we would be getting rid of money in favor of a better system. Money, as I’ve discussed elsewhere, encourages bad decisions, some so bad that they may lead to the destruction of our species.

#4: We have undoubtedly made Earth too difficult. In general we should be thinking in every system how can we make this easier – how can we make less things illegal, how can we accept more people for who they are, how can we deprioritize GDP and prioritize health, happiness, and sanity.

Reminder – get on the WSHR announce list!

January 3rd, 2025

If anyone out there would like to receive emails whenever I do a radio broadcast on WSHR with a link for the most current show, shoot me a email at jonathanpullen@gmail.com and I’ll be happy to add you.

Thoughts on adulting

January 3rd, 2025

So, a long time ago, back when $PERSON still talked to me, back before my mental illness had picked it’s particular focus.. slightly before or slightly after the first really recognizable manic experience I had (I had a few before this but they always ended up with heavy duty coding sessions so I didn’t end up in any hospitals).. $PERSON asked me if I ever emptied the dishwasher. Now, from this distance, I can grok she was probably fighting with her husband-at-the-time about who empties the dishwasher. At the time I probably said something pretty noncommittal because I didn’t *own* a dishwasher and never at that point in my life had, although I had rented in houses which had one. But at that particular moment in time I was trying to live on minimum money in order to maximize the time I spent exploring music and so I was feeling pretty good to have air conditioning.

These days emptying the dishwasher is on my housemate/friend/etc’s chore list but I still do it pretty regularly – it’s one of those chores that I really almost don’t notice doing, and I can do it while I’m waiting for my coffee. I was pondering, though, today – almost writing this post in my head – how I am much, much more together than I was in my 20s as far as getting stuff done, showing up on time, etc, but I get a lot less credit for it. And I think it’s because by the time you’re in your 40s people expect you to have adulting down.

As may be. I’m still trying to be a better person every day. I really enjoyed my read of my friend Randy’s latest book about the bible, The Bible Reexamined. It fit in a lot with my beliefs, but it did re-amplify my desire to contribute to making Earth slowly more towards a utopia because it’s probably all we have or are going to have and at any case, we’re here now.

Memory leaks in perl

December 30th, 2024

So, I’ve been maintaining several very large projects in perl – I can enumerate them at a later date – and one of them in perl and XS. Interestingly, the one in perl and XS is the first to have significant memory leaks – but they’re not all from XS!

I’ve identified three types of memory leaks

#1) Scalers leaving XS without being made mortal and given a reasonable refcount. A useful tool for looking for these is Devel::Leak
#2) Circular references that are not weakened and therefore can never be reaped. A useful tool for looking for these is Devel::Cycle
#3) Scalers gaining a refcount that is not being cleared. A useful tool for looking for these is also Devel::Leak

I now need to go through all the major subsystems and make sure that they aren’t leaking one of these ways. If I find new ways to leak I will add them to this document. Comment below if you’d like a more comprehensive document on how to find these things.

Avoiding ref leaks in perl callback code

December 29th, 2024

So, one of the big problems I’m having with kt3 is memory leaks. This is probably no surprise to anyone who has done XS programming before.

I found one particularly pernicious one by using Devel::Leak.. this is in the log handler.

Originally I had this, which I’m fairly sure I got from the internet somewhere:


static void _kt_log_callback(int iLogLevel, char *log_subsystem, char *msg)
{
dTHX;
dSP;

HV *rv = newHV();
sv_2mortal((SV *)rv);

hv_store(rv, "loglevel", 8, newSViv(iLogLevel),0);
hv_store(rv, "message", 7, newSVpv(msg, strnlen(msg, KT_LOGBUFSIZE)),0);
hv_store(rv, "system", 6, newSVpv(log_subsystem, strnlen(log_subsystem,32)),0);

PUSHMARK(SP);
XPUSHs(newRV_noinc((SV *)rv));
PUTBACK;

call_pv("KittenTrader::KittenBrain::Log", G_DISCARD);
}

This worked well enough – it created a hash ref and passed it to the function – but the hash ref kept leaking.

Eventually – after much digging through the documentation – I figured out that what I needed to do on the XPUSHs was this:


XPUSHs(sv_2mortal(newRV((SV *)rv)));

If anyone is curious how I debugged.. I used this relatively simple function to invoke the callback:


my $count = Devel::Leak::NoteSV($handle);
for($i=0;$i<1000;$i++) { KittenTrader::KittenBrain::testLog(4, "THIS IS A MESSAGE"); } my $count2 = Devel::Leak::NoteSV($handle); Devel::Leak::CheckSV($handle); print "Count: $count\n"; print "Count2: $count2\n";

This gave me a count of SVs, which I could clearly see my leaking SVs in.

Then I added returns everywhere along the path until I could isolate the leaking SV to a few lines of code. In particular I could definitely see that as soon as I created the hash, I was leaking a SV, but not if I destroyed it before passing it in. I realized the problem was that the callee didn't realize that the SV was mortal - I had made the hash mortal but not the *reference* to the hash. ANd of course the hash could never be destroyed until the reference to it was.

1300 hours

December 14th, 2024

Forget checks and balances. Politics *needs* a ref.

November 29th, 2024

I was talking about Mitch’s blatant cheating to pack the supreme court and someone on Quora pointed out that the Democrats started the move down the slippery slope with Harry Reid. Well, yes, okay.

It occurs to me that one thing politics needs very badly is a truly nonpartisan body that exists only to make sure that both sides (or all sides, if we could leave this two party stranglehold behind) follow the rules. Someone who can give a black card to Mitch – or to Pelosi – or to anyone who tries to tilt the playing field.

I’m not sure how this would work – it’s clear the people don’t care about fair play at all or they would never have elected Trump (of course, we don’t know that they did – one reason I wish we did have blockchain as one path of our voting process is we could test vote aggregation for honesty, something we cannot do now)