Theming WordPress

Published at 08:22 on 19 April 2021

Executive summary: It’s not that easy, but it’s not really all that hard, either.

The main complication is, well, complication. WordPress is a mature and very full-featured software system, and web layout itself is intrinsically a not-so-simple thing, because the same layout must work well on both a big desktop screen and a tiny smartphone screen.

If you start by editing the existing WordPress default theme, you will quickly get lost in the complexity. It is far better to start with a simplified, bare-bones theme like Tania Rascia’s untheme and work from there. The rub is, such bare-bones themes tend to be too simplified, so you will then be compelled to add the missing features you desire.

This still is working out quite well for me, because I am getting a theme that has the features I want and none of the features I do not want, resulting in a very clean layout overall.

The design itself is based loosely on mid-twentieth century newspaper typography. The typefaces come pretty close, and I justify my body text margins, but column width and paragraph style follows more typical Web standards.

This is yet another stage in the process of moving this blog off of its current host and onto the virtual host where the rest of my online presence is kept.

Why WordPress Is the Market Leader

Published at 13:51 on 17 April 2021

Wanting to plan for the coming day where this blog moves to a new host, and wanting to try alternatives to PHP-based blogging (like WordPress) I decided to create a test blog using Roller.

The first thing that stuck we was how many configuration steps there were. Then I noticed how needlessly repetitive the configuration was; some things, like the database connection URL, must be specified in multiple places. That’s horrible. It’s literally begging for inconsistencies to crop up later. Configuration parameters should only need to be specified once. Then I run into ambiguities in the documentation; locations for files I am being told to create are not explicitly specified anywhere.

Finally I get things configured, only to receive a curt message from Tomcat that it cannot run my Roller instance because the Java was compiled against a JVM that is newer than the Java 8 JVM that runs my existing Tomcat instance.

I could fix that, of course, but f*ck it. Nowhere in the release notes was this dependency specified, and at this point I’ve already pissed away well over an hour and have yet to see so much as a blank dummy page for my efforts.

I notice that I already have PHP installed anyhow, because I needed it to run another canned solution at one time. I shelve the effort and give WordPress a try. Within fifteen minutes of following the install instructions (which are complete), I am rewarded with my blank dummy page. No multiple configuration files that repeat the same parameters. No ambiguous instructions. No unstated dependencies on PHP versions (there are dependencies, but they are clearly stated). It just works, as advertised.

Take it away, Coding Horror:

I’ve written both VB and PHP code, and in my opinion the comparison is grossly unfair to Visual Basic. Does PHP suck? Of course it sucks. Did you read any of the links in Tim’s blog entry? It’s a galactic supernova of incomprehensibly colossal, mindbendingly awful suck. If you sit down to program in PHP and have even an ounce of programming talent in your entire body, there’s no possible way to draw any other conclusion. It’s inescapable.

But I’m also here to tell you that doesn’t matter.

The TIOBE community index I linked above? It’s written in PHP. Wikipedia, which is likely to be on the first page of anything you search for these days? Written in PHP. Digg, the social bookmarking service so wildly popular that a front page link can crush the beefiest of webservers? Written in PHP. WordPress, arguably the most popular blogging solution available at the moment? Written in PHP. YouTube, the most widely known video sharing site on the internet? Written in PHP. Facebook, the current billion-dollar zombie-poking social networking darling of venture capitalists everywhere? Written in PHP. (Update: While YouTube was originally written in PHP, it migrated to Python fairly early on, per Matt Cutts and Guido van Rossum.)

And the best thing about it? Although WordPress is written in PHP, it’s basically written (past tense) in PHP. I don’t have to do much with PHP’s awfulness myself. Edit some manifest constants in wp-config.php, and (since I am tinkering with templates) edit some .php files that are mostly parameterized HTML with a few PHP function calls. And what there is, is thoroughly documented, because WordPress is used so much.

Sure, it sucks that WordPress is written in PHP. But, it doesn’t matter.

The Inevitable Finally Happens in Afghanistan

Published at 09:18 on 16 April 2021

It was obvious from the moment it became crystal-clear that the US ruling class was not serious about Afghanistan, that the military operation there was doomed to failure.

It would have been an extremely heavy lift even if the ruling class were firmly committed to the pursuit of victory: the USSR, which had the advantage of Afghanistan being a neighboring country, had still been forced to retreat from Afghanistan in humiliation and defeat. That land is not called “the graveyard of empires” for nothing.

So there we had the USA, trying to chintz out on foreign aid to the Afghans, and getting promptly distracted by Saddam Hussein and launching a war of lies against his regime instead of focusing on finishing something already started in Afghanistan. The conclusion was foregone; the only question was how much time it would take before the inevitable happened.

The rationalizations put forth for invading Afghanistan were crap, too, by the way. The Taliban are vile, but really not much more vile than longtime US allies the Saudi regime, which engages in its own repression of women and has its own Committee for the Promotion of Virtue and the Prevention of Vice. So much as for harboring terrorists like Osama bin Laden, well, Pakistan did that, and it was possible to deal with bin Laden (poorly; he should have been arrested, interrogated, and tried, not summarily executed) in Pakistan by means that fell short of all-out invasion. But I digress.

What sucks now is that the Taliban is primed and ready to once more rule the roost there. Expect Biden to be blamed for that or any other immediate fallout from his acceptance of defeat.

In a way, he will have been responsible, though not in the immediately proximate way that Establishment rhetoric will paint him to be. Biden was one of the Democrats who fell for the Bush regime’s snow job about Saddam Hussein and weapons of mass destruction. He deserves blame for that, and to be honest, he has in hindsight accepted at least some blame for it.

Again, US defeat became a foregone conclusion in about 2003. The only question was how long it would take to finally admit it. And Biden is not a unique president in this regard: Trump basically conceded the same thing, and was planning an even earlier pullout than Biden now is. So no matter what the outcome of the 2020 election was, the US was going to be pulling out of Afghanistan.

The Anti-Sanders Cult

Published at 08:21 on 12 April 2021

Something interesting recently happened. Senator Bernie Sanders has proposed expanding Medicare to age 55 or 60.

One would think this would make many loyal Biden Democrats happy. Biden campaigned on a robust public option, and now Biden’s chief opponent in the primary has come around Biden’s own position and is proposing a form of a public option. He even watered it down a lot (Biden proposed a public option for everyone; Sanders is proposing it begin at age 55 or 60) to increase its chances of passing through a Senate where nothing gets through unless Manchin and Sinema support it.

The chief complaint from the right wing of the Democratic Party is that the party’s left wing is too idealistic, too impractical, and too unwilling to compromise. And now we have one of the leaders of that left wing proposing one of the very same “practical” things party’s right’s own horse in the race campaigned on, and compromising on it to increase its chances of passage!

Yet, by and large, there is no joy in Mudville. There is no shortage of grumping about Sanders and his proposal by that same crowd. Compromise, political reality, past policy positions: none of it seems to really matter. What matters most for many is the proposal came from the desk of Senator Sanders, and that means it cannot have any merit.

Remember that when you hear Sanders and his backers criticized as a political cult. There may in fact be such a cult, but there is also very much an anti-Sanders cult out there.

Vaccinated!

Published at 19:58 on 9 April 2021

I had sort of been keeping an eye on possibilities for registering to get on wait lists as soon as I become eligible for the vaccine on the 15th, so any vaccine-related threads on the local Reddit group immediately get my attention. Yesterday morning, rumors were circulating that three tribal clinics in the area had excess supply and were letting any adult, regardless of age or tribal status, receive the vaccine.

Two of the three rumors got promptly shot down in flames. But people kept insisting that the third one was actually a possibility. I went to the web site for that clinic, and sure enough, hundreds of vaccine doses for that afternoon were yet to be claimed.

Could it be? It sounded too good to be true. The clinic in question was in the next county and almost an hour’s drive away, and I didn’t want to make the drive only to be turned away, so I called them to verify. It was indeed true: they had a surplus of Johnson & Johnson vaccine, and any adult, regardless of tribal status, who made an appointment and showed up could claim a dose.

Everything was handled outdoors in the parking lot of the Swinomish Casino. I did not even have to leave the cab of my truck. I waited less than five minutes to get my shot. It all seemed surreal, what with how so many people are scrambling merely to get on waiting lists. It still seems surreal.

But I have a piece of card stock to prove it was all very real.

Thinking about Privacy Policies

Published at 13:27 on 6 April 2021

I am in the process of developing and publishing an Android app to the Google Play store. Part of the process of doing so is developing and publishing a privacy policy.

Initially, I thought this would be super-simple: Don’t collect information, then there is nothing to share or to establish policies about sharing. Simple. However, in the real world, things are seldom so simple as they might at first appear.

The first complication came when I realized that although my app does not (and probably never will) gather and pass on usage statistics, the places from which users might download my app, which will include a web site run by yours truly in addition to the Google Play store, certainly will gather such statistics.

Virtually every web server on the Internet logs each and every request it receives, and these log messages typically contain, at a bare minimum:

  • The time a request arrived.
  • The IP address the request arrived from,
  • The URL of the resource being requested, and
  • Basic information on the user agent (i.e. web browser) used to make the request. Such information typically includes the operating system that the user agent was running under.

So, say you are an AT&T customer in Brooklyn who uses your Samsung Galaxy S21 to download a copy of my app. I (or Google) will be able to tell from your IP address that you are an AT&T customer in the New York City metro area. We may even be able to tell that you were in the borough of Brooklyn, and that you were using a Galaxy S21. If we share your IP address with AT&T Wireless, they will be definitely able to determine exactly who you are, what hardware you used, where you used it, and (if you were doing something unlawful and/or abusive) take action against you for what you did.

Some Internet users are shocked to discover this. If you are one of those, consider yourself educated.

Why is this done? Not always for nefarious purposes! In fact, not usually for such. Gathering such data can be extremely useful for dealing with things like abusive users (they exist), troubleshooting software and network problems (they are inevitable), or managing the growth of traffic to a web site or to a cellular network.

But it’s still pretty simple, right? So I am collecting basic usage statistics (and Google Play will doubtless collect some on my behalf that it can share with me in reports). Just do not share the information!

Well, there is the matter that I could end up in jail on a contempt of court charge for adhering to such a policy: what if a law enforcement officer or a process server arrives at my door armed with a warrant or a subpoena?

Okay, then, exclude that and nothing else. Solved!

Not so fast, yet again! What if my app becomes popular with violent white nationalists and neofascists? I am, after all, promising to gather a fairly minimum amount of information and to be as reluctant as possible in sharing it; that makes my app attractive to such individuals.

It also makes it attractive to those breaking laws to undermine oppression and to advocate for more freedom, which is my main intent. If that sounds reckless to you, just ponder that any oppressive order has always considered it a crime to undermine said order; revolutionary politics is intrinsically criminal politics. Lech Wałęsa was a criminal; Martin Luther King was a criminal; Mahatma Gandhi was a criminal. If the Founding Fathers of the United States had failed in their endeavor, they would have been prosecuted and for the most part executed for the crime of treason against the British Empire.

The only exceptions to the above rule are certain situations when the revolutionaries are judged to be sufficiently tiny in number and powerless so as to pose little or no threat to the established order. And as soon as they gain enough power to cease being so, watch out! The velvet gloves will be replaced by an iron fist.

But I digress. So now I must craft an exception for things like neofascist and white nationalist politics. While I do not want to, and do not have any intent to, regularly monitor the download logs, I want to be free to cooperate with antifascist organizations should my cooperation prove helpful to the cause of fighting fascism.

That, of course, begs the question of just what, precisely “neofascist and white nationalist politics” is. However I define it, it opens up the prospects of all sorts of word games: “No, I am not a ‘fascist,’ you stupid leftist. I am a ‘nationalist’ and an ‘identitarian.’”

Now I am stuck trying to anticipate those word games, all the while also having a privacy promise that still is meaningful to the vast majority of people, even people whom I might politically disagree with, who are nonetheless not fascists and whose beliefs must be accepted as part of the diverse spectrum of beliefs in any free and open society.

In the real world, things are seldom so simple as they might at first appear.

Testing Android Apps

Published at 09:36 on 3 April 2021

It leaves a lot to be desired.

The normal unit testing is advertised as supporting most of the Android class library (which is not the same as the standard Java class library), but what they don’t tell you is that it’s chock full of stub-out dummy logic. The routine to load an image from a file, for example, always returns a 100 by 100 black image. That’s sort of a deal-killer if one is trying to test image-processing code.

The instrumented testing runs on Android devices so avoids those headaches, but it too is extremely limited in scope and needlessly developer-hostile. For example, the test code is by default strictly disallowed from making any modifications to the filesystem. If one is testing an app that processes files, that again ends up being a deal-killer (how, exactly, am I to create the test files to feed to the app being tested)?

There are ways to disable this misfeature, but they are very poorly documented. It’s a setting buried deeply in an obscure settings menu somewhere. Where, exactly, is not standardized: it varies from device to device so much that one set of instructions is not even valid for a single Android OS release. I gave up in disgust after pissing away at least an hour searching in vain for it on my phone.

If Google wants developers to write good, comprehensive tests for apps, they need to stop making it as difficult as possible for us to do so. Until then, Google can take its pleading about writing tests and go fuck themselves. I will still write tests, but not very comprehensive ones.

Crimping versus Soldering

Published at 15:26 on 31 March 2021

The world is full of analyses like this one that confidently perform crimping to be better than soldering. The real world is not nearly so simple.

Yes, a properly executed crimp connection with a quality crimp connector is by all measures superior. The devil is in those weasel words.

Given that it is possible for a crimped connection to be superior to a soldered one, and given that crimping is faster than soldering, why would anyone solder? Soldering when connections can be crimped seems obsolete.

That is how many retail hardware stores promote crimping, often in a big blister pack with cheap crimp connectors and a cheap crimping tool like this one. Well, good luck with that. It takes a skilled craftsman to execute a quality crimp with a cheapo tool and cheapo connectors. It is, in fact, easier to learn to solder.

An anecdote to close: When I worked in IT support, the department purchased a cheap crimping tool, that could crimp both 6 and 8-position modular connectors, and some bulk cable. No longer would custom lengths of cable need to be special ordered.

Those crimps were responsible for trouble ticket after trouble ticket. When I broke the crimpers in the attempt to exert enough force for a quality crimp, I put my foot down and insisted they spend over $100 on a name-brand, quality crimping tool and set of crimping dies. It was money well spent, because the number of trouble tickets dropped to zero on connectors crimped with it.

It’s not that bad with standard wire crimp connectors; $25 or so can get you a good, compound-action, ratchet-based crimping tool. Even then, it’s good to budget in some practicing, and learning how to recognize a bad crimp. But again, that’s not how crimping is sold. Most of those crimp kits don’t even cost $25 total, and no mention is made of skill development.

Personally, I solder. Already have a soldering iron and know how to use it as a result of messing with electronics for many years, and I don’t splice wires often enough to justify the expense of a crimping tools, the clutter managment headaches of maintaining a stock of crimp connectors, and so on.

Danger, Joe Biden, Danger!

Published at 11:57 on 22 March 2021

Make no mistake, the refugee crisis along the southern border represents a real danger for Biden and a real opportunity for the fascists.

The Democrats are already swimming against the tide: their majority in Congress is razor-thin, and midterm elections tend to go badly for the party that occupies the White House. A refugee crisis would be just the thing the fascists need to whip up their base and get people to forget what a disaster Trump was.

Remember how the Trump regime was rightly excoriated for the deliberate cruelty of its policy of separating children from their families? Well, now unaccompanied minors are showing up en masse at the border, asking for refugee status. They have, in other words, been pre-separated from their families, largely by the actions of those families themselves.

What does that say, that large numbers of families are now willing to impose the same cruelty on their children that hateful fascists once wished on them? The most logical explanation, I think, is that families are doing so because the conditions the children are experiencing when with their families, both in the refugee camps, and before the families fled their home countries, is so bad that, as bad as child separation is, it is being judged as better for the affected children.

Conditions, in other words, must be really bad for those refugee families.

Any solution to the crisis must therefore be focused on resolving that problem, and not just making things more difficult at the border itself. Such latter measures are unlikely to work very well. Most likely a massive military deployment (with shoot-to-kill orders), and the impressment of the survivors into Nazi-esque forced labor and death camps would do the trick, but obviously that’s beyond the pale for any civilized country to so much as contemplate.

Measures that fall much short of that are unlikely to be sufficiently discouraging. Remember, families are already volunteering to send their children into concentration camps that fall short of death camps. The border wall is both incomplete and porous (it is easy to defeat with standard tools, and smaller individuals, such as children, can squeeze through the slats).

The conditions that are pushing refugees across the border must be addressed. The quickest short-term fix would probably be to fund improvements at the holding camps in Mexico. Once COVID-19 is under better control, we can (and should) resume admitting refugees, and on a widespread scale.

The fascists will howl that the latter is being done to destroy their vision of America, and they would be right. This is very much a reason why we need more immigration to the USA.

Letting more immigrants in is good for many reasons, and one of those reasons is that it dilutes the power of the fascists, because recent immigrants tend not to become fascists. Immigrants, as a rule, simply make for better citizens of an open and free society than does Trump’s base of Christian fascists. It is probably politically toxic to admit this, however, so don’t expect any establishment figures to do so. (Such frankness is something I can get away with, because I am just a semi-anonymous nobody with a blog.)

That said, however, it is far better to not be compelled to flee one’s country of birth in the first place than to be admitted as a refugee in a foreign country. That is going to be a harder nut for establishment politics to crack, because it means questioning U.S. neo-imperialism, which is directly responsible for regimes like the one in Honduras (installed with the approval of the Obama administration) that are prompting so many to become refugees in the first place.

The bottom line is that Biden must move swiftly and decisively on addressing the issues that are forcing Central Americans to move north. Failure to do so would not only be a moral weakness, but a weakness from the standpoint of realpolitik as well.

Dumb Dems, Part Two?

Published at 10:27 on 20 March 2021

In one of my more obvious (to me) insights, I correctly predicted that the Democrats would end up sorely regretting their decision to go nuclear in 2013.

Well, here we go again.

Or do we? The most likely measures fall short of an outright kill of the filibuster and are more a scaling-back of it. Of course, as the article linked above argues, that is likely to beget further scalings-back.

One thing that bears pointing out is that weakening the filibuster is less Constitutionally harmful than the continued evolution of an imperial presidency, and the latter becomes more likely if Congress is paralyzed by an unweakend filibuster. The filibuster is mentioned nowhere in the U.S. Constitution; it is merely one of the many “Rules of its Proceedings” the Senate chose to establish for itself per Article I Section 5, and it can just as easily weaken or abolish that provision as it first created and then strengthened it.

Yes, strengthened it. It is far easier to filibuster something today than it has historically been. A filibuster is nowadays mostly a simple matter of paperwork. It used to be the case that Senators opposing the measure had to actually be physically present and take turns speaking in order to talk a bill to death. In fact, returning to this past state of affairs is probably the most likely measure to be enacted.

In a real sense, this time, there is less room to maneuver. Fail to pass a new civil rights bill, and we head into a new Jim Crow era of near-permanent minority rule. So the Democrats’ hand is being forced in a way that it was not in 2013.

But this does not in any way change what Ruth Marcus wrote in the article linked above; a backlash is still likely to come. It is one reason for my general pessimism about the political future of the United States.