Oops! Something went sideways.

Looks like the styling got goofed up. Sorry about that, unless it's what you wanted. If this isn't what you were looking for, try force refreshing your page. You can do that by pressing Shift + F5, or holding Shift and clicking on the "reload" icon. (It's the weird circle arrow thing "⟳" just above this page, usually next to where it says https://blog.unitedheroes.net...)

isn't quite ashamed enough to present

jr conlin's ink stained banana

:: Con-frigguration

If it’s a static value, it probably belongs in a configuration file.

That’s one of my golden rules of programming, and it’s generally saved my ass. Mostly because someone else sometime else decides that something isn’t quite as permanent as they said it was and it changes. (That was for the benefit of the two or three folk out there that don’t use config files.) Still, after nearly half a century of coding, we still have terrible ideas about configuration files.

The worst offender, by far, is the horrible programming language masquerading as a config file. These seem to be en vogue again. Such as “yaml” format:

  - alias: "Morning kitchen on"
    trigger:
        platform: time
        at: "06:45:00"
    condition:
        condition: and
        conditions:
          - condition: time
            weekday:
               - mon
               - tue
               - wed
               - thu
               - fri
          - condition: sun
            before: sunrise
    action:
        service: homeassistant.turn_on
        entity_id:
            - group.lights

That’s from my Home Assistant configuration file to turn the lights on in the morning if they need to. Home Assistant is written in Python, and i don’t really want to pick on it because it’s really good. If anything, the config system being bad just stands out that much more. i can’t tell you how much easier it would have been to just code up the python function.

import time
def MorningLight():
    now = time.localtime()
    if (now.tm_wday in range(1,6) and 
            (now.tm_hour == 6 and now.tm_min in range(45, 59)) and
            time.time() < homeassistant.sensor_state("sun.sunrise")):
        homeassistant.turn_on("group.lights")

Hell, make some convenience functions and it's shorter.

def MorningLight():
     homeassistant.set_state(
         "switch.OfficeLight",
         (homeassistant.time_between( 
             "06:45 AM",
             homeassistant.sensor_value("sun.sunrise")) and
          homeassistant.is_weekday()))

Yes, this proposes that the individual know python. They’re programming. It’s ok to use the same language you’re using. Forcing the user to learn some convoluted semi-language syntax that is even more alien, doesn’t have countless free tutorials and books, and a vibrant support system, isn’t helpful.

There is literally zero difference between the above yaml version and this:

♥️alias🍳"Morning kitchen on"
🐸trigger🍳
🐸🐸platform🍳time
🐸🐸🐸at🍳"06:45:00"
🐸condition🍳
🐸🐸condition🍳and
🐸🐸conditions🍳
🐸🐸🐸♥️condition🍳time
🐸🐸weekday🍳
🐸🐸🐸♥️mon
🐸🐸🐸♥️tue
🐸🐸🐸♥️wed
🐸🐸🐸♥️thu
🐸🐸🐸♥️fri
🐸🐸🐸♥️condition🍳sun
🐸🐸before🍳sunrise
🐸action🍳
🐸🐸service🍳homeassistant.turn_on
🐸🐸entity_id🍳
🐸🐸🐸♥️group.lights

Actually, i’d argue that it’s clearer because the “🐸” are visibly defined rather than just whitespace (tabs? spaces? tabs+spaces? 🤷‍♀)

We keep insisting on doing this. Sure, that wheel is pretty and all, but what we really need is to make something that rolls on the ground around an axis.

What’s frankly hilarious to me is that programmers have even beaten multiple paths to the “give the customer a simple programming language” route (Lua, Javascript, Visual Basic, etc.) and STILL we come up with crappier solutions. Hell, at one point i was writing a shopping site in a custom XML based language. Someone, quite possibly multiple people, not only thought that was a good idea, but took a significant amount of time to prototype, develop, implement, test, and document that.

Stop it. Just, stop it.

Stop trying to shoe horn a horrible solution to an obvious problem.

If you’ve got static values you need to set, use a simple key-value config system. Maybe allow for sections if it’s super complicated, but also consider that perhaps divvying things up might also be a viable solution. Windows, Unix, and yeah, even Macs all do this, and they work pretty well for exceptionally complex systems. (i’ve got my complaints about Windows Registry tables cross references, but at least i’m not writing XML if statements.)

If you need templates, use an established template system. HTML is no party, but it works, and there’s library support for it. If you want to grant programmatic access to users, give them a damn programming language. And not one that you created in your Junior systems class and got a “C-“.

Granted, if you’re building a complex virtual machine like a web browser, then rules are quite different. Chances are exceptionally good, though, you’re not.

Yes, this means trusting your users. Yes, this also may mean giving up the dream of providing a configuration system safe for 6 year olds. Granted, you could also give them Scratch, so there’s that.

(Dammit, now this means i need to submit a patch to HomeAssistant that actually replaces the crappy config system with an actual programming system, doesn’t it?)

:: Land Line Lubber

It’s 2018, and i still have a land line.

Well, sorta.

So, growing up on the east coast where thunderstorms are a real thing, you learn pretty quickly that the phone lines are nearly magical. They run off of their own power and generally tended to continue to operate even in the event of significant disasters. So, having a land line was the techie equivalent of having a safety blanket.

Of course, in those days a disturbing amount of the phone system was still analog and the power was mostly due to banks of lead-acid battery bunkers, so you know, there was that.

40+ years later, things are more than a bit different. If you have a phone, you’re using VOIP. Doesn’t matter if it’s a 1950’s era princess dial-up that still uses cloth wrapped copper lines, once it gets to the central hub, it’s goin’ over the same lines that bring you cat videos and nazi screeds on twitter.

And that was the absurd bit about my “safety blanket”.

Up until a few years ago, i had a deal where my long distance was unlimited and cost $45. A year. This may be the reason that the company is no longer in business. Looking around for a replacement proved a few things, mostly that cell phones are REALLY popular for a reason. i did manage to find a service that provided unlimited long distance for a reasonable price (at least compared to other services), and that service was: Vonage.

Yeah, the “Telephone over the Internet” people.

It worked out fairly well, except for the near constant barrage of spammers that made my phone announce calls from “Sheboygan, WI” or “8058086:4803768” or “V4071151200013107835” (all of which i just pulled off my call history log). Vonage lets me block up to 25 callers, which gets full mighty fast when spoofers can just make up numbers. They don’t offer a way to whitelist numbers, so i’ve had my home number of “Do Not Disturb” 24/7 for about a month now. i’ve even changed my voice mail number to say “Hey, call my cellphone”.

Basically, i’d go from 4 numbers to 2. One cell number i’ve had since 1996, the other a Google Voice number i got when they rolled out the service.

Still, it’s funny how you hang onto some things mostly out of habit, rather than having a really good reason.

:: The Internet of Less Than Shit

i’ve been making my home a bit smarter.

Mind you, this is not what you’d expect me to say. i’m paranoid. The idea of opening up my house to a remote exploit because some company forgot to use encryption is very much unlike me. Hell, i put my cable box and guest devices on their own, isolated subnet. What the hell am i thinking?

i’m thinking that i don’t need to go out to the internet.

The guiding principle i have is to not require external connectivity where and when possible. While things can talk to the outside world, i discourage it. Enter Z-Wave.

Z-Wave is an interesting semi-proprietary protocol that allows devices to talk to each other. What makes it useful to me is that those devices can talk to a managing hub. What makes it REALLY interesting to me is that i can run an open source package on a Raspberry Pi that lets me control the devices. Data never leaves my local net.

What makes it super-duper interesting is that many of these devices are advertised as “works with Amazon Alexa”. i don’t have an Alexa in my house, but it’s becoming the clear winner in the “voice controller” market. This means that there will be a lot of controllers out there that will be talking Z-Wave, including light switches, outlets, thermostats, door sensors, and more that can integrate into my device network.

Again, and delightfully, none of that info needs to leave my LAN.

The very nice thing is that there are a few different open hubs i can use. Currently, i’m using Home Assistant. It’s nice, but absolutely not end user friendly. It’s a typical dev app and requires lots of weirdly formatted files, obscure naming conventions, reboots, and other fiddly bits. Mozilla is also working on a less fiddly version called IoT, which promises to be more noob friendly, but it’s still very much in pre-beta.

Still, i’ll admit that having control of my house (and remote control thanks to the glory of SSH tunnelling) is rather nice.

Now, if i can only figure out how to read directly from my solar panel controller and the SleepNumber bed, i’ll be all set.

:: Lunatic Debate Club

There are some things that i’m willing to say are “non-controversial”.

i don’t believe that the following need to be discussed, in long form, where dissenting ideas need to be heard out.

  • Humans require oxygen.
  • The moon exists.
  • High voltage electricity does not taste like candy.

There are lots of other things that can be proven readily and also do not need to be discussed and rationalized to a dissenting party.

  • JFK, Elvis and Tupac are all dead.
  • The earth is an oblate sphere (“round” also works).
  • Millions, mostly Jews, were killed in the Holocaust of WWII.

It is quite safe to consider anyone who does not hold those facts as true as a lunatic, someone willfully disassociated from reality, and not really worth having a discussion with.

This is not to say that there are some facts that are worth discussion, or that there’s not nuance that can be argued. We can spend hours or days discussing the finer points of how to best reduce global CO2 and other heat trapping gasses. Likewise there are areas that i gleefully state i have no knowledge that i’m happy to learn about, such as the horsepower differences between a hemi vs standard piston v6. Gravity, while undeniable and present for a mighty long time, is still very much an unknown force.

One thing that’s been pretty <Insert multiple expletives here> settled, however, is that brains are brains. i can’t, with any certainty predict your level of musical talent, pool acumen, or skill at balancing dual carburetors by knowing your sex or race. i can’t tell how well you’d solve for X by knowing your nationality. There may be other factors that contribute to your level of skill, including your background or even the way your brain happens to be wired, but none of those hinge on the configuration of your core chromosomes.

And things get even worse when it comes to programming computers.

i have colleagues who have studied computer science for decades who learn new techniques from folks who just started coding a few years ago. Coding is collaborative. If it wasn’t, sites like github or StackOverflow wouldn’t exist. To deny or somehow refute that fact is equivalent to saying that California doesn’t exist.

So here’s one more irrefutable truth along the lines of “Glowing red iron should not be licked”:

  • Race, gender, national origin, sexual preference, language, hair and eye color, number of useful limbs or anything else does not make you a better or worse problem solver. Solving problems makes you a good problem solver.

Everyone has the potential to write code. Should they find it worth while, some will go on to become great coders, and should they have true talent, a very select few will go on to become legendary. They will come from all walks and a few rolls of life. i work on internal plumbing which has zero glory. i kid that i do the digital version of a Dirty Job. If it works, you’ll never know, but when it doesn’t, i will.

And let’s face it; most of us are not writing code that cures cancer or delivers clean drinking water to 60% of the planet. Most of us are writing glorified string manipulators or adding machines. We make electrons and silicon do neat party tricks that turn a profit for someone else. i welcome anyone willing to dive in and help, particularly someone who doesn’t look or think like me for the same reason that i don’t live on only peanut butter and jelly sandwiches.

So, welcome all you weirdos that want to learn and write code. The days can be long, frustrating, and deeply annoying, but the bursts of pride and accomplishment once things are working are phenomenal. If you love learning and teaching, you will absolutely love this industry. Everyone in the industry started by not knowing how to code and got better. Many have been in that position multiple times as new tech, languages, and designs were created. Find someone who understands that and is willing to help you get better. They had someone do it for them, this is how they can pay that back.

And if you find someone who doesn’t think you could ever do what they do?

Ignore them.

They’re lunatics.

:: Goin’ Solar

Recently, i had solar installed on my roof. It’s not a huge system, but it covers my average daily need of about 4KWh. It cost me about what a brand new economy car would have, and i understand that i’m in a fairly privileged position, both in the ability to have solar panels installed, and the ability to afford them.

The reason was pretty simple: my electric power rates had hiked up in the past few years and i expected to be at home a bit more. If i could reduce that cost down, there’s no reason i shouldn’t. There are other reasons i considered them, like the fact that i live in earthquake country and having panels means that i’d have some power available 1, and the panels would provide some shade to keep my metal roof from overheating2, but honestly, not forking over $100+ a month was really the major draw.

And, yeah, i get that i’m late to the game on this. i’m ok with that. Cutting edge tech on these sorts of things is foolish. You want something that’s had the kinks worked out and is reliable as hell for the 30+ years they’ll be running.

So, i find it kinda hilarious that there’s a growing backlash about roof top solar.

Part of the problem is that power companies built way the heck too much generation capacity. i can’t really fault them, Natural Gas is cheap thanks to the current glut, and not a lot of folks saw the residential solar panel growth happening the 10 or so years ago that these plants were authorized. Still, residential solar is a fraction of the power generated daily. It does, however, mean that the return on all those bright, shiny, and new power plants won’t be quite as great and it’ll take a few more years before they become profitable. Hooray! Power is a commodity and subject to supply and demand.

Which kinda leads to the next point. Residential power generation is kind of a fluke. Let’s ignore solar, and say that i’ve somehow created a tiny universe filled with residents who step on pedals in order to provide me Watts to spare. In the era before smart meters, i’d plug that in and the analog meter would literally run backwards. The power company would come by every month, read the meter, and wonder how to deal with consuming negative KWh. The simple solution, because not a lot of folks were creating tiny power-plant universes, was to just credit at the same rate they charged and move on. Some months i’d owe, others i’d collect as i fed the excess power back into the grid for my neighbors to use.

This is because the grid doesn’t really care where the power comes from, just that it’s there. It could come from coal plants, gas, wind-turbines, really anything that can send electrons along a path at the proper AC frequency.

So, i’m a little confused by articles like this which state:

Utilities argue that rules allowing private solar customers to sell excess power back to the grid at the retail price — a practice known as net metering — can be unfair to homeowners who do not want or cannot afford their own solar installations.

Uhm, what? They’re using power, from the grid. The same grid i’m feeding. They’re writing the same check, just that the power company is acting as a broker rather than the generator.

What’s more, i was required by the power company to install a “smart meter”. Meaning that unlike the analog predecessor, this sucker knows exactly when and how much i am either using or contributing. This means that i could be charged/credited fairly accurately, based off 15 minute increments over the course of the day. Since folks in my neighborhood have been told they’ll be hit with a $120 annual fine if they refuse getting smart meters, i’m guessing that it’s just a matter of time before even the most ardent folks concede and get one. So, yeah, the power company has/will have a stunningly accurate accounting of power patterns for this locale, minus some of the fun of long lines and massive substations.

So, you know what? i’m also 100% ok with not getting residential power prices for the power i’m generating. Yeah, it means that it’ll take longer before my system “pays for itself”, but as stated above, not really the goal. Plus, i know some folks with hilariously huge arrays on their roofs will be pissed, but just like the power company and their now less useful LP plants, Welcome to commodity based markets, bitches!


1So, yeah, fun fact. Solar needs to be able to sense the grid to operate. Otherwise they shut off because they don’t want to barbecue linesmen that might be working on the outage. You can solve that with a battery, but most of those are crap right now so not happening for a few years.

2It’s not a lot, but i’ll take what i can.

Blogs of note
personal Christopher Conlin USMC memoirs of hydrogen guy rhapsodic.org Henriette's Herbal Blog
geek ultramookie

Powered by WordPress
Hosted on Dreamhost.