Puzzlin’ Code

Okay, here’s some SwiftUI code:

Section(header: Text("Tip amount")) {
                // right now we are in a trailing closure
                    Picker("Tip percentage",  selection: $tipPercentage) {
                    // and now we are inside a second closure
                        ForEach(0 ..< tipPercentages.count) { // here, tipPercentages doesn't need to be prefixed by 'self.'
                        // and now we are inside a third closure
                            Text("\(self.tipPercentages[$0])%") // here, tipPercentages *does* need to be prefixed
                        }
                    }.pickerStyle(SegmentedPickerStyle())
                }

Why, why, do I need to prefix tipPercentages with ‘self.‘ once we’re in the third closure but not inside the second or even the first? What’s magical about this situation? I know there’s something, but nobody is saying what.

Specify Your Dream

I keep wanting to be able to write native apps for my devices, and it keeps being true that I can’t wrap my brain around The Way You’re Supposed To Do It. I’ve taken Coursera and Udemy courses on iOS and macOS programming, and I’ve even shipped a couple of toy apps to the App Store, but when it comes to anything real, I find myself getting stuck because the way that the UI gets tied to the model is just so…tight.

This is absolutely not the way to write code for a web application. The whole gosh-darned point of writing a web application is that it’s skinnable, so that your business logic neither knows nor cares how it’s being displayed. I knew this in 1997, and it has only been reinforced by my experience since then.

So anyway, now I have to learn how to write non-skinnable software. It’s like it’s 1985 all over again, in my brain. And lemme tell you, this old guy has never wanted to go back and do high school over.

Okay, so this time I’m hoping it will stick. I’m doing the 100 Days of SwiftUI series from Paul Hudson. I’ve bought several of his books and found them really helpful in figuring out Swift, and I like his style. So, I am feeling pretty positive. But I’m going to go ahead and bring some of my own expertise to the table and on this, the first challenge day, spec out not only the challenge app (a unit converter) but the app that I should write for unit conversion.

Okay, so, first up: challenge. “Build a unit converter app”. The point of this application is to exercise the skills taught in the first demo. Picker, @State, Text, TextField, etc. Okay. Yawn, I’ll do it. But: I’ve already written (in Swift, but not SwiftUI) a unit converter that I would actually use: ThermoSlide. The point, here, is that if you have to select which unit to convert, then type in what value to convert, then select which unit to convert to, by the time you’ve done all that plus launched the app, the moment has passed. When, what’s really more likely is that your wife has set the display to Celsius but you can’t be bothered to learn another gosh darned system at this point in your life and you just want to know how (not) hot to make the car.

Right. So for challenge day of 100 Days of SwiftUI, I’m going to rewrite ThermoSlide as a SwiftUI application. Extra brownie points because I’m going to have to figure out how to make it a watch app at the same time, and while I’m at it I want to reorient the slider so it’s vertical, not horizontal.

San José, City of Murderous Douchebags

We went over the hill to visit the dentist today. Yesterday, the governor signed a law requiring people to wear masks in public. We took two of the dogs, because our hygienist appointments were an hour apart and there’s a park a couple of blocks from the dentist. You see where this is going?

It should read, “Douche Park.”
Full parking lot

The parking lot of the park was full. There were many people at the park. None of them were wearing masks. So, here in this affluent area, the attitude of the people seems to be, “Stay away from my breath or I will murder you.”

I know there are lots of people talking about society, but more than unrest in the streets (which at least speaks to collective action) this little walk demonstrated that there is no society. These people might as well be walking around with pistols, firing in all directions every time they exhale. That isn’t a society, it’s the opposite.

Not running.
The dogs walk faster
Nope, no mask

Rats Got the Baby

Last year, I gave in to the family, admitted that we live in the woods, on top of a mountain, and we have a persistent need to haul large volumes of stuff from there to here and back again. We bought a pickup truck. Problem is, we live in the woods, on top of a mountain, and the environment is very much interpenetrating our infrastructure. Because we drive the truck infrequently (that is, we don’t drive it every day), some rats decided the top of the engine block would make a great nesting spot. As well as filling every cranny with acorns, they chewed through one of the leads coming off the battery, which led to the truck’s computer (God bless it’s little silicon heart) to think that the battery wasn’t charging.

After a few adventures and phone calls, I finally found a place that would sell me a chunk of 16 gauge stranded wire (not Radio Shack, not Fry’s, not the hardware store, but the auto parts store — which probably says more about me and my expectations than it does about the state of electrical supplies and their availability) and I spliced the severed wire back into service. Wrapping it all up with electrical tape, which in our household is used principally to adjust the pitch of bagpipe chanters. So, for the first time in a few years, I’ve used electrical tape in an electrical context. That’s new!

Age of Corporations

In 2017, Charlie Stross talked about corporations as slow AI, and he identified some ways in which they have supplanted humans as first-class citizens.

I remember reading, as a teenager in the early 1980s, a story about a world where humans were not citizens of nations but employees of companies and the whole thing was some battle among the big three companies in the world. That meant that when I read Snow Crash the idea of burbclaves and the quasi autonomous states didn’t strike me as novel so much as just natural, in a hyper capitalist dystopia.

A recent Reset episode, “When Big Tech Calls 911,” talks about how the Tesla gigafactory in Reno uses lots of public infrastructure for workplace accidents (like, ambulance and fire dispatch, every day — to be fair, there are 7k employees at the one site, so it’s a 100% employed small town) yet it doesn’t pay for any of it (because of tax breaks to lure the company there). As well, it talks about Facebook and how they’re building out a bunch of housing in Menlo Park, which will, like, double the city’s population — so Facebook tried to get ahead of this by funding a big expansion of the city police near their campus. Which makes people feel a little weird, like, the company somehow owns the cops. The point being, though, that public services are usually funded by the public via taxes, and Facebook doesn’t pay enough taxes to Menlo Park to cover the infrastructure costs they incur. Because yeah, they’ll need police, but they’ll also need schools and roads and emergency services, won’t they? But police, they’re gonna fund that.

And there was some other podcast I was listening to (probably Make Me Smart) where it was mentioned that, hey, some of these big companies have yearly budgets bigger that those of a medium-sized country (which has been true for a long, long time and is news to nobody, I’m sure).

And yet. All of this still gets reported on as though it’s some kind of surprise to people.

Here’s the bottom line, my readers: corporations have no empathy. They do not care about human lives as such. They are economic sociopaths and they optimize for economic return, not for human welfare. They don’t like you.

Right Thing, Wrong Time

Cryptocurrency, quantum supremacy, imminent death of the Internet.

So, Google recently announced that they’d achieved quantum supremacy. One of the things that quantum computers are supposed to be really good at is cracking crypto really fast.

The past couple of years have seen an explosion of cryptocurrencies, which are one application of blockchain, which relies heavily on crypto.

I have a Keybase account, because of lots of reasons, but mostly nowadays I use it for backing up my private git repos. But, as a consequence of having a Keybase account, I am being given Stellar Lumens (XLM), which is a cryptocurrency. I wondered what good these things are, and did a little bit of poking around. It seems to be the case that this is principally for moving other currencies around. I have dollars, I want to give you euros, I can turn the dollars into lumens, send you lumens, and then you turn the lumens into euros. So, remittances with better (maybe?) exchange rates, and with less (maybe?) government oversight.

But now, here’s the thing: you and I don’t have quantum computers. But nations and companies with budgets the size of nations’ do. So, how secure is cryptocurrency, really? And what good is blockchain when Google or Amazon or China or whoever can diddle the crypto? I dunno. Maybe someone smarter than I am can explain it to me.

Well, duh

So, Iran has reconnected to the Internet, and there’s this quote way down in the Washington Post article about it:

“Why did (the Americans) get angry after we cut off the internet? Because the internet is the channel through which Americans wanted to perform their evil and vicious acts,” Fadavi said.

I’d say that this, right here, is an excellent example of a thing politicians do all the time. It is absolutely true, to the point of being bleeding obvious, that of course the Americans want to perform their evil and vicious acts through the Internet. It’s cheaper that way. And yet, it is also not necessarily true that the protests were instigated by Americans, and I find it extremely implausible that nefarious Internet posters could get the whole population out on the streets in protest, getting shot, beaten, and arrested.

Regression

I’ve been ignoring Facebook for a few months, now, and my engagement with Twitter has mostly been retweets and likes. Yesterday, a friend who takes what other people say more seriously than I do decided he needed to back way off and go back to writing blog posts instead of tweets. Frankly, I would way rather read his essays, as I think his analyses are interesting and insightful and I’m really a fan of the long form. I’ve always felt that if a position is short enough to fit on a bumper sticker, it’s far too simplistic to be useful.

So then I thought, “Man, I sure don’t want to miss his writing, but I also sure do want to miss these 18 screens of ignorant hot takes and performative dunks; I wonder if there’s a decent RSS reader…”

There is.

And then I thought, “You know, I like being able to work offline and then occasionally connect to the world to send and receive. I wonder if there’s a decent[1] client app for my blog.”

There is.

Also, a few days ago I finally went ahead and updated my laptop to run Mac OS Catalina, which means that the GPG plugin for Apple Mail no longer works for me. I’d read that Thunderbird with Enigmail works okay, and hey, it sure does!

So now, here I am, with an up-to-date operating system and a blogging and email experience that feels like the late nineties. And that’s not bad, actually. I kinda like it.

Endnotes

1 – I do not consider a native app that simply wraps a web view and delegates all the logic and storage to the browser and/or remote host to be “decent”. If I wanted a web page, I’d just use a browser, not install a whole new application.

Why Monoculture

At some point, I don’t remember exactly when, I told my family that since I didn’t use Windows in a professional capacity and I didn’t use it personally, there was no way I was going to go to the effort of becoming and staying smart about Windows, and if they wanted me to do tech support, well, that was just too bad. I may even have been that much of a jerk in saying it, too. To my surprise, that was pretty well received. As a result, we mostly have Macintosh computers in the house.

Continue reading “Why Monoculture”