Our Castles

November 15, 2022

A man’s house is his castle,
And we build the ramparts tall.
Only by royal decree
May you enter in these walls.

We scurry home from work,
And lock ourselves in our towers.
We plug ourselves in
To burn the evening hours.

Once upon a time there were:
Porches with rocking chairs and swings,
Front doors kept unbarred,
“Come in” called to the doorbell’s ring.

Now:
How many neighbors do you know?
How many locks on your door?
How many people just stop by?
Interkingdom relations seem to be very poor.

My castle keeps me distant
From all kings, near and remote.
A man’s house is his castle.
How wide is your moat?

Thanks Prometheus

November 10, 2022

Prometheus is the name of an open source tool used for gathering metrics. I’m amazed at how appropriate the name is. 

Prometheus is the Greek god who gave fire to humankind. But there’s a lot more to that story. “Prometheus” literally means forethought, as in thinking about something and planning before you act. His brother is Epimethius, which literally means afterthought, as in doing things before you think about it and then thinking about it afterwards and going, “oops!”  Epimethius gave humankind Pandora and her box. Oops.

To the ancient Greeks, pretty much every abstract noun was a god. But they also retained their aspect as that abstract noun. That’s why when Discord wasn’t invited to a party, she sent an apple that she knew would start a fight, and when it did, there was discord, and so Discord really did attend the party.

So when we say that Prometheus gave fire to humankind, we’re also saying that the way you make a fire is through forethought. Forethought is crucial to making a fire. You need dry wood, kindling, a safe place for the fire, and the all illusive spark to start the fire, whether that spark is a flint and steel, two sticks, or a lighter that hasn’t run out of lighter fluid. To assemble these ingredients, you need to think about it before you act. You need to exercise forethought. 

That’s why it makes sense to call a metric gathering system Prometheus. To collect metrics on your system, you have to instrument the different parts. You have to instrument it before the failure that you want to analyse. 

Many applications, like your database or messaging system, have instrumentation built in. (Thank you, app developers, for your forethought). But you still have to wire it in and get it collected and sent to Prometheus. Your application code needs instrumentation added. You have to add something to expose system metrics, and for application specific metrics, you have to add the code to count and log what you’re interested in capturing. And then you need to make sure it gets to Prometheus.

Getting an application instrumented is an intricate process. And above all, it requires forethought. Thank you, Prometheus.

No dying of treatable illnesses

June 14, 2022

I was talking to a neighbor, and he was complaining about people who got NHS healthcare without paying in to NHS. I thought about it, and I think everyone should get healthcare, regards of whether they’re contributing “their fair share”. But if you’re saying a person or group of people shouldn’t get healthcare, then you’re saying they should die of treatable illnesses. I believe no one should die of a treatable illness. I believe everyone should have access to healthcare. If someone is getting healthcare without contributing, I don’t care. They are human beings. Our society has science and medicine. They should get healthcare.

I guess this means I’m in favor of worldwide universal healthcare. We’re far away from that. I believe we can reach that, but we won’t get there in a year or even a decade. Can we please move in that direction? Our society should be working out how to expand the reach of healthcare to include more people. Because no one on the planet should die of a treatable illness.

#universalhealthcare #notreatableillnessdeaths

Sunsinger & the High Seas at The Bear Club

June 12, 2022

Sunsinger & the High Seas and Dan Raza performed at The Bear Club on 11 June 2022. It was a beautiful show and I got some nice pics.

Note: I don’t know the names of some of the band members. If you know, could you tell me in the comments and I’ll edit the captions.

Dan Raza
Simon Gutteridge, aka Sunsinger
____ & ____ (Who is this?)
____ (Who is this?)
Nigel ____
Dan Raza
Dan Raza
The stage before the show

Five Points Gang

June 4, 2022

I saw Five Points Gang yesterday, 3 June 2022. This was the third time I’ve heard them at The Bear Club, and they were amazing. Five Points Gang is Joe Pearson, Dinho Barral & Gaet Allard.

Dinho Barral in the zone
Joe Pearson loves playing those drums
Gaet Allard hitting those perfect notes
Dinho Barral on the tambourine
Gaet Allard showing his great guitar playing ability
Joe Pearson and Dinho Barral in the rhythm section
Gaet Allard and Dinho Barral facing off
Dinho Barral belting it out
Gaet Allard jamming out
Joe Pearson rocking out on the drums

Thoughts from a Tree

March 5, 2022

I got in an argument with my wife that night. I don’t remember what it was about. Afterwards I talked to a tree. I clearly remember what the tree said.

I went outside to get some fresh air. I leaned against a nice large tree. I asked the tree to tell me something.

“You?” the tree asked. “You were born. You will grow. You will change. You will die.”

That’s real useful there, tree. What matters then?

“How you grow yourself.” the tree said, “How you change within. How you dig your roots. How you place your branches.”

OK, tree, tell me something useful. What about tonight?

“Tonight doesn’t matter,” said the tree. “This year does not matter.”

Oh, so nothing matters?

“This decade matters,” the tree corrected me. “Your lifetime matters”

The tree went on, “You only change yourself. Just grow into a pretty tree. Our effect will only be in what it is we live.”

“All of us are artists,” the tree continued, “We each make one tree. All I want to see is what tree your lifetime will be.”

Strafe and Fire III

March 18, 2020

Devon swore as he lost his last life.  Before respawning, he checked his messages.  One new message: his friend Kale had just gotten a copy of Strafe and Fire III for his birthday, and invited Devon over.  Devon selected the quick reply for “Be right over” and pulled up the Transportation Manager to fill out a Travel Declaration.  “destination… favorites… Kale’s house.” Date: “today”. Kale had already filled out a Declaration of Visit, and it popped up now.  Devon chuckled at the Declared Purpose, “to kick his ass in Strafe and Fire III”. The approval went through and he headed out the door.  The game was just a small commute away.

Kale was at the grocery store, picking up some snacks for the evening.  As he approached the autoscanners, his mind went thru its checklist. Rarely did anyone have anything illicit, but everyone went thru the list in their head before an autoscanner.  “Did he have anything that could be considered a weapon? Any merchandise out of his age or class rating? Any medications outside of their original packaging?” He gave himself the “all clear”, and stepped into the autoscanner.

The scanner picked up the transmission from Kale’s Universal ID, then it picked up the transmissions from the groceries in his bag.  It looked up Kale’s records, and found the Declaration of Visit, which allowed for the additional food. Kale’s allowance account was deducted, and a few other checks were done.  These passed, except for one.

The sirens on the autoscanner went off, while the lights flashed bright yellow.  A stern automated voice said, “There has been a problem with your purchase. Please see security personnel.”  Two guards came over to Devon. “Hands against the wall, and please hand me your backpack.” One guard scanned him with a hand scanner while the other went thru his backpack.

Kale sighed.  He thought he had covered everything.

The guard looked at the message from the autoscanner.  “OK, Kale, the problem is your choice of snacks. They push your friend Devon over his heart-healthy cholesterol limit. You’re either gonna hafta put back some of those chips or buy some Heart Safe brand cholesterol limiting pills.”

Kale protested, “I can’t afford those pills.”

The guard looked at his display, “Yeah, you’re right, the pills would push you over your allowance limit.  Guess you gotta lose the chips.

“Can I just buy some carrots or something?”

The guards eyes narrowed.  This kid was protesting more than he should.  But he ran the carrots anyway. “Yeah, you can get a six ounce Good Berry Farms, Inc. baby carrots.  That’ll get Devon’s numbers square.” He handed him back his pack. “Get that taken care of, and stay out of trouble.”

Devon’s commute had gone as smoothly as it could have.  He caught the train that the Transportation Department’s computer predicted he would, so Trans Dep could time a bus to be ready as he came out of the train station.  He arrived at Kale’s house as Kale was picking out carrots.

Devon slid his ID thru Kale’s doorbell scanner.  A series of messages displayed on the screen. “Devon Garcia (425-76-2785-329) recognized… Sorry, Kale is not in… Visit Declaration found: Devon Garcia is expected…  Trust level: high… Access granted.” Devon heard the dead bolts click, then a fake cheerful computer voice said, “Welcome Devon”.

When Kale arrived, Devon was sitting in his guest gaming chair playing a spaceship dogfight game.  He blew up his opponent then flipped the game to pause. “Hey K.”

“Sorry I’m late.  Someone didn’t tell me their cholesterol numbers were high.” He threw the bag of carrots at Devon.  

“Oh, sorry about that.”  Devon said, opening the carrots.  “I hope you didn’t get into too much trouble.”

“Nah, it’s ok.”  Kale started unloading the rest of the snacks.  “I’m still under my detain limit. Just got a warning.  But you better enjoy these chips.” He tossed the chips at Devon.

Kale picked up the Strafe and Fire III package.  “And here it is.” He broke the quality seal and opened the game.  He inserted the game, then scanned first the authenticity card then his own ID card.  

He got into his gaming chair as the game yelled out, “Strafe!  And Fire! Three!” He raised his right hand just before the system said, “Please raise your right hand.”

The system immediately detected his right hand was raised, but still had to wait the legally required two seconds.  Then, in a dry voice, “Do you hereby swear (or affirm) that you have you read and agree to the terms of the licensing agreement and that you have legally acquired this software?”  Kale said “yes” in a clear monotone designed to make sure the system didn’t have to ask him to repeat himself.   

Then came the Purchase Circumstances Screen.  “How did you receive this software?” “Gift or Present” “Who gave it to you?”  Kale entered his aunt’s name. “What was the occasion?” “Birthday” Then the screen said, “Transferring to a live agent.”  The boys look at each other. Something must have gone wrong.

A bored-looking woman appeared on the screen.  She looked at an unseen screen, and didn’t look up when she asked in a monotone, “Name please?”

Kale responded mechanically, “Kale Kline 893-72-9838-12.”

The woman gave no indication that she had heard him and asked the next question, “How did you receive this software?”

“My aunt gave it to me.”

Still in a monotone, “What was the occasion?”

Kale was getting nervous, “Uh, for my birthday.  It’s a birthday present.”

Now the woman stared right into the camera, right at Kale, and spoke with inflection, “The problem, Kale Kline, is that your birthday isn’t for another four weeks.”

The woman’s sudden change in attitude had its desired effect on Kale, and he froze a moment, then responded, “She’s going on vacation.  For a month. She thought she’d give it to me now. It’s for work – her vacation I mean.”

The woman looked back down at her screen and fiddled with it for a bit.  After a moment she responded, “OK, I’ve got her Travel Declaration. Yes, she’ll be gone for your birthday.”

Her off screen hands worked with her system a second longer.  Then, back in her monotone she said, “I’m authorizing your registration.  Thank you, enjoy your software.”

Kale and Devon breathed a sigh of relief.  Then the Strafe and Fire III main screen showed up.  Kale turned to Devon and said, “And now, get ready for the finest video game carnage the world has ever produced!  Oh, and pass me the carrots.”

Declarative programming for business rules, imperative for the rest

July 9, 2019

I’ve been thinking and reading about declarative programming lately. I have a new theory: it would be possible to write all business specific programming declaratively, and make the imperative code completely business neutral. And I see it opening up all sorts of possibilities.

Ok, so now to explain what I just said.

Programming today is generally imperative. The programmer tells the computer, “do this. Then do this. Then do this.” A list of commands. In imperative programming, we tell the computer how to find the answer.

In declarative programming, on the other hand, the programmer tells the computer what the answer is. That is, we declare what we’re looking for. The computer can find the answer any valid way it wishes. Like in a spreadsheet, we declare the formula for every cell, but the computer can evaluate it in any order.

The problem is that computers can’t run declarative programs. Some programmer has to write some imperative code to interpret the declarative code. They must tell the computer how to achieve the what. In the spreadsheet example, these are the programmers who wrote the spreadsheet.

In practice, a programmer creates a special purpose language and the software to interpret and run that language imperatively. Sometimes this is called a Domain Specific Language, or DSL. Examples of declarative languages are SQL or regular expressions.

So why do I think we could write all business logic declaratively?

The names of the business objects, the language of the domain, changes in every program, or at least in every company or industry. But the fundamental concepts are all the same. Most business programming is about moving around and mutating data. A lot of the rest can be modeled as a workflow engine or even just a finite state machine.

And why do I think this would be a good thing?

It’s mainly about a separation of concerns. The two concepts are fundamentally different. We try to treat business rules and implementation specifics as the same thing, and it muddies the water.

And they need different things. Business rules need to be verified that what they’re modeling is what was intended to be modeled. Imperative code needs to be tested for correctly handling all cases, and for non functional requirements, like performance.

It’s also a code sharing thing. What if we shared all the imperative code? Most free software is business neutral. And with there being no business specific logic, we’re not divulging the secrets of how the company is run.

Declarative code would generally not be shared. That defines how the business does its business. Businesses tend to not want to let that information out, and someone not in their industry probably couldn’t do much with it anyway.

Once we have an ecosystem with some shared declarative languages and multiple interpreters, we can finally have some sort of interoperability. “How would this app work with a different database?” Let’s swap it out and see how it works. “Someone just made a better communication method.” Great, let’s deploy it into our entire software. As long as the new code uses the same declarative language, it can be swapped in.

What do you think? Would the declarative / imperative split solve your problems? Do you think this would (or would not) be a good idea? Tell me in the comments.

Programming on your phone

May 19, 2016

I have figured out how to program on an Android phone or tablet. Using Google Cloud Platform and a couple of Android apps, I have a cloud development box, and I can pull up a command line and edit files locally in my Android device.

I’m going to describe the method I use. You can, of course, use different apps that do the same thing. This is just my method of implementation.

Setup up Google cloud platform. See https://cloud.google.com/compute/docs/quickstart

Create an instance named dev-instance. I use a small preemptable insurance to save on money. You can use a larger instance (but not a smaller one). You can choose to make it preemptable or not. Preemptable is nice because if you accidently leave it running, it won’t stay up more than 24 hours.

Install the Android Google Cloud Console app. Also install JuiceSSH and the paid version of DroidEdit.

In JuiceSSH, go to Connections, slide to Identities, and click the plus to create a new identity. In the Nickname fields, enter ‘dev-instance identity’. Under username, type your Google user ID. Press Set next to Private Key. Go to Generate. Change Key Format to RSA. Hit OK to generate the key (this may take a while). Then press the checkmark in the upper right hand corner to save the identity.

When the identity is created, long press it and select Export Public Key. Select Copy to Clipboard.

Go into Google Cloud Console. Go to Resources then to VM Instances. You should see your instance, dev-instance. Click it and select Ssh from the the dots menu in the upper right hand corner. Select Connect via SSH. This will open a console window to your instance. Type

 cat >> ~/.ssh/authorized_keys

Be sure there are TWO greater than symbols. Then long press the screen and select Paste. This should paste your private key from JuiceSSH into the window. Press the console window to turn on the extra keyboard. Press Ctrl then ‘d’. Type ‘logout’. We’ll be connecting to the console from JuiceSSH from now on. Press OK to close your session.

You should be on the screen for dev-instance. Scroll to the bottom and expand Compute Engine Details. Long press the entry for External IP and select Copy. Also, write this address down, because we’ll need it later.

Go to JuiceSSH. Slide to Connections and press the plus sign to add a new connection. Under Nickname, type ‘dev instance’. Long press the space for Address and press Paste. This should paste the external IP. Make sure Identity shows ‘dev instance identity’. Hit the check mark in the upper right hand corner to create the connection.

Press the connection to test it. When it asks you to trust the connection, hit OK. You should get a command prompt. Type ‘logout”.

Swipe back to Identities. Long press ‘dev instance identity’. Select Export Private Key, then Copy to Clipboard.

Open DroidEdit (this must be the paid version). Press the drive looking icon to get a file menu. Press New. Long press the empty document and select Paste to paste the private key. Now select Save As from the file menu. Press local, then navigate to /storage/emulated/0. Press the folder plus icon and create a folder named ‘.ssh’ (make sure the folder name starts with a dot). Name the file ‘id_rsa’ and press create.

Go to Settings, then Remote Files. Scroll to the bottom and press Global Private Key Path. Enter ‘/storage/emulated/0/.ssh/id_rsa’. Hit OK. Press Add Remote Server. Server Name should be ‘dev instance’. For Server Address, enter the IP address you wrote down earlier (or go look it up again). For username, enter your Google ID. Check Use Global Private Key. Press Test to check it. If it asks for a passphrase then you’ve done something wrong. Press Save and exit the settings.

And you’re done! You can now program on your phone or tablet. To open files, use DroidEdit. To get a command line, use JuiceSSH. You have to set up the box with your development environment, but once you do, you can program wherever you are, if you just have a phone or tablet and an internet connection.

Austin Code Dojo

May 8, 2012

Anouncing
The All-New, Re-Imagined
Austin Code Dojo
Austin Code Dojo

This Dojo is a place for various forms of programming practice, just as a martial arts dojo is a place for various forms of martial arts practices.  We will have a beginners kata for new coders, students, and managers who used to code; and a more advanced kata, if there’s interest.  We also welcome all other forms of cooperative programming practice.  Solve a programming challenge, hack on an open source project, share some code you’re working on, or just talk about programming stuff in a friendly, unstructured atmosphere.  The point is group practice of all sorts.
Read the rest of this entry »