Archive for the ‘Notes’ Category

The socialism of coding standards.

Tuesday, November 21st, 2017

I’ve been writing in my weird coding style for decades now, and everybody who’s ever seen it has complained that it’s stupid in one way or another.

That’s okay, it’s my style not theirs. Their style is different.

But the one thing that’s assured is that the coding style that is the corporate standard wherever you work won’t be quite like anybody in particular’s style.

Which means that everybody has to code in a way that is not comfortable to them. Everybody has to conform to something they find annoying in some way.

Seems to me, it would make more sense if everybody wrote in whatever style they felt most comfortable with and everybody else had to be open minded and tolerant of everybody else’s style.

Imagine that, having an open mind about other people’s opinions.

This way you could concentrate on figuring out how to convert the solution to a problem into a piece of software and not have to worry about reading it in a way you find awkward while doing it. It removes a distraction.

And just as a final kick in the head: your next job? Their coding standard is going to be different from your current job’s coding standard style and you’re going to have to get used to another style anyway, so why doesn’t everybody just do what they want be be tolerant of others. Sounds a bit libertarian, but that’s what makes sense to me.


Setting clocks

Tuesday, November 21st, 2017

The most uninteresting thing in the world is setting the time on a digital clock.

Cars have clocks on their radios or dashboards, and homes have wall clocks, and nightstand clocks, DVD players and wristwatches and dash cams. Everything has a clock. And if it’s not internet connected, you have to set it every six months for daylight savings time.

There are some ‘atomic’ clocks that set themselves based on the NIST broadcast thingi in colorado, but my experience has been that they only time they can set themselves is when there’s a blackout and there’s no other radio signal noise drowning out the signal from colorado. (not that I ever understood how the signal could bend around the curvature of the earth to get to my house in new york unless it’s bouncing off the atmosphere or something.)

Some people use their phones to solve most of their time problems, and now you can buy a watch that syncs to your phone for $15 that requires recharging everyday, so there’s progress for you.

But for those of us with older equipment like non-internet connected blu-ray players and free low-end dash cams, setting the time on digital clocks can be a pain. Simply because there is no standard interface for doing it.

I’ve been setting digital clocks since the 80s when they first came into existence and there is truly a marvel of different options when deciding how to design the clock setting mechanism. Do you have one button? Two? A rocker switch? Do you cycle through minutes as one number or the tens digit separately from the ones digit? Is there a button to reset the seconds to zero, does the selection of seconds-resetting come after the minutes or after the day setting? Do you cycle through the hours/minutes/seconds once then go to the main display or is there a separate button to get out of setting-the-time mode. Do you always go forward, or can you go backwards? Some clocks will go forward slowly and then speed up if you hold the button down. Some speed-up modes just makes the minutes go by faster, some make them minutes increment by 10 at a time. Some include the hours so you don’t have to select if you’re setting hours vs minutes, you do them both at once, but if you pass the time you want, you have to hold the button down for a long time to skip the next 23 hours and 59 minutes to get back to the minute you wanted. And if you can go backwards, you can only seems to go backwards slowly to compensate for having overshot the time you want going forward, which creates lots of angst when you have to set the clock backwards an hour. Do you go forward and sit through the 23 hours? Even in fast mode that takes a while, or do you suck it up and just sit through the going backwards in slow mode. You’ve all been there, you know what I’m talking about.

Just when you thought there was no way to possibly design a new way to set the time on a digital timepiece… I recently got a $4 watch from some noname brand of watchmaker, and they did something pretty neat: The watch has the feature of showing 12 hour am/pm time or 24 hour time. Every other timepiece I’ve ever used had a separate mode setting to cycle between the two options. This watch cycles through all the 24 hours of 1-12am/pm options and then through the 0-24 hour options, and you implicitly are selecting which of the 12/24 hour mode options you want by which hour setting you stop on.

Why would anybody bother to write a diatribe on all the stupid ways you need to figure out to set a clock?

Why did you bother to read to the end?

It just seems to me it is unlike anything else in this world. Digital clocks have been in homes and cars for over 30 years and everybody has had to deal with them, and in all that time there is no one obvious standard or monopoly system that has won out.

What is it that makes this procedure such an oddity?



Sunday, November 5th, 2017

The ants go marching one by one hoorah, hoorah.
The ants go marching one by one hoorah, hoorah.
The ants go marching one by one,
the little one stops to suck his thumb.
And they all go marching down.
To the ground.
To get out.
Of the rain.
’cause it’s cold.
In the rain.
And it sucks.

Open source software

Thursday, November 2nd, 2017

Open source software is designed by a collection of scratched itches. It’s like paving over a cow path and calling it a highway.

Some open source software started off life as a project owned by a company (like eclipse and zfs) and then was handed over to the open source community where it became a bunch of scratched itches.

Eclipse sadly doesn’t work anywhere near as well as it used to. It hangs when doing file searches, it has problems with gtk 3 occasionally…

ZFS still does work, although it’s not as old as eclipse and it’s far more complicated so I think there are fewer people scratching itches per year.

But the projects that started off life as scratched itches and didn’t have the control and concentration of the corporate mindset suffer more, earlier on.

Btrfs comes to mind. I’m sure there are lots of others, but I don’t keep up with that, because I don’t see much value in being aware of all the lousy software that exists in the world.

I meet people all the time who ask me what I do and I tell them, and they sound interested, and then I feel obliged to explain that if they knew what I knew they wouldn’t fly in airplanes anymore and even turning on the toaster is probably a bad idea nowadays.

But the bar is lower now, nobody really expects anything to work well. Nobody expects their privacy to be honored, nobody thinks twice about what life might be life, how much farther along we might be now if everything just didn’t suck so much.


Peak ZFS

Monday, October 30th, 2017

I went to the open zfs developers conference last week and I learned a lot.

I’ve gone for a few years now and this year I thought was the most interesting Maybe it was only 2 years, I forget. Anyway, all the talks were technical and were about useful features and things that could make zfs better. I didn’t notice how quickly the whole day went by. It was a lot to take in, but it was all zfs all the time, and if you’re in to that sorta thing, it was a lot of good.

First of all I have to mention one very noteworthy moment. Every speaker got well deserved applause after their talk, but there was one guy, lundman who got applause just for saying what he did, and what he said was this: “I ported zfs to windows.” And he showed it and it worked. Truly a moment to behold. It was amazing.

But after listening to a few of the talks I started to notice something, and that something is that I think we’re approaching Peak ZFS.

We, as in not me, but the we of all the actual zfs developers of which I am just a wannabe so my opinion has no merit. But the web being what it is, and thinking of my favorite line from the movie Dark Star, “A concept is valid regardless of its origin” you can choose to disagree with me, but you can’t tell me what I’m saying is wrong just because I’m not a zfs developer.

ZFS has had a good run so far, it is 10-15 years old depending on how you count and it has come a long way and it does a great many amazing things, but like all software, if you keep adding to it, you’re eventually going to end up with exception upon exception upon exception that wasn’t in the original design, that has to be taken into consideration when adding new features. And any new feature you add will be an encumbrance to any future features added, so you should be careful with what you add and how you add it so as to minimize the future pain everybody’s going to have to suffer.

But that’s not what’s going on.

There are currently 3 prefetchers in zfs. Nothing wrong with prefetchers, nothing wrong with three of them either, but it is note worthy that there are three and not one.

There are currently 2 log writing systems, one for the zil and one for the spacemaps. Matt suggested adding another one to make dedup faster (a welcome feature if there is one) and Sarah from delphix suggested another log to optimize clone deletes. Possibly a less popular use case, but valid nonetheless.

Yet this will yield 4 separate and different log implementations. Is the zil anything like dedup? No, but a log is a log, and maybe it would be in somebody’s interest to save the future from the present and consolidate the logging concept into a subsystem that can be shared by all of the things that need to log things to disk for optimization purposes. All 4 of the logs (with the possible exception of spacemaps) are optimizations, and now there are 3 or 4 of them.

But the icing on the cake was this one:

George was suggesting a feature to compensate for the performance hit caused by 512 byte sector emulation on 4k sector drives. If you know anything about the world of storage, you know this is a noticeable performance problem, and not just to zfs.

But in my opinion, it’s also a problem that’s going to go away by itself, and it got me wondering if it’s really worth adding another bit of code that will probably be in zfs forever, to compensate for a temporary problem. And then I realized there were a few other features that fall into this category.

Gang blocks exist to solve the problem of zfs not dealing well when it’s running low on space.

Seems to me if you’re running a data storage system large enough to justify a filesystem that can store a zettabyte, it’s hard for me to imagine you running out of disk, and if you are, you’re probably not doing your job very well. But from now on and forever more every zfs developer has to work around gang blocks because it seemed like a worthy goal at some point to sub allocate blocks of storage to deal with low-availability situations.

Somebody pointed out that the 512 emulation problem may go away, but someday it will be replaced by a 4k->16k emulation problem. Fair enough, but I say again, if you’re running an important enough system that you require zfs, you should be able to make sure your pool is filled with disks of the same type. And if you need to move to 16k sector disks, then you make a new pool of them and figure out a way to migrate your data, not make every future zfs installation suffer the cruft of dealing with this one edge case that most of the time, nobody will experience.

Hacking more and more exceptions into zfs isn’t going to help anybody in the long term, but that’s what’s happening, and there’s no SUN in control to keep it from getting out of hand, which it seems to me, it already has.

I love zfs and probably always will, it’s hard to imagine something cooler coming along anytime soon, and I’ve been doing this software stuff for 30+ years and I’ve seen it over and over and over, it’s inevitable, and there’s nothing you can do to stop it, but you can slow it down by taking a step back and thinking about what’s really worthwhile and what can be lived without to make it last as long as possible.

Now the real answer is to “write one to throw away.” Which means starting over with the knowledge of all the lessons learned, leaving out things you no longer need (sendmail being able to send mail via carrier pigeon comes to mind (by the way, last time I looked sendmail’s main() function was 3000 lines long.))

But that can’t happen, it’s called btrfs and it didn’t fly, or is slowly heading towards a landing or something. You can’t replace zfs, if anything I predict somebody will come along and fork zfs, remove all the stuff they don’t need and maybe some other people will pick up on it and it will become the new popular zfs. But it seems unlikely a new upstart will come of out nowhere and win.

If you see how open source projects come together, it’s easy to see why zfs was awesome when managed by sun and eclipse was awesome when managed by IBM.

No disrespect to any of the current zfs developers, they’re probably the most brilliant collection of developers there is, but being open source there’s nobody running the ship with an iron fist like a company could, and in my opinion, it’s starting to show.


The third level of opposable thumb

Saturday, September 23rd, 2017

What sets man apart is the opposable thumb. Man can grasp or pinch.
But that’s not all of it. With your hand you can grasp something. But you also need two arms, or more specifically two sets of pincers so that you can operate on something while holding it in place.
For example unscrewing the top off a jar.

But that’s it?

Why isn’t there a third level of pincer that allows you to hold a more complex thing in place while holding a simpler thing in place while operating on a third single part.

The answer I assume would be, “because two is good enough.”
It just struck me as odd that there are only two.

How many cool tools could we make and use if we had a third level of pincers.

What to do about identity theft.

Wednesday, September 20th, 2017

I’m not a tax guy but at this point it seems to me that we are forever more in our lives going to be the subject of id theft as soon as a thief gets around to us.

The information is available, it’s just that there are lots of people to thief from.
Eventually the smarter thieves will work out the most efficient ways of taking advantage of all of the information available to them, so the people with better credit scores will be targets sooner than people with bad credit scores.
So I suppose one idea is to have a lousy credit score.
Anyway. We talked about this at work and account freezes are a good idea. I’ve had freezes on my credit score accounts for a while now. (I’d recommend this for what it’s worth) which turns out to be little.
The security to protect the thief from unfreezing your account is a pin you get at freeze time.
You better not lose that pin or…. you’ll have to ask them to send it to you.
And all they require for them to send it to you, is the same information the thieves already have stolen. And to boot, somebody at work found the page and for experian at least, they’ll send the pin to any email address.
We’re all doomed.
So anyway, the point is to make it as hard as possible for the thieves so they pick on somebody else first, so freeze your accounts.
But back to my original idea.
One of the things thieves can do is steal your tax refund by filing before you do.
One simple way around this is to avoid having a refund.
Up your deductions, and start a savings plan with this newfound money so you can afford your tax bill. It may be annoying, but at least the thieves can’t get it.
And as the CPAs always say “You shouldn’t be giving the government an interest free loan anyway.”
Thoughts? Other suggestions?

Different base number set conversions.

Sunday, September 3rd, 2017

My other kid is fascinated with numbers. So he asked me to make him a page that would convert numbers between any bases.

So I picked the reasonable base 2 to base 36 range.



Saturday, September 2nd, 2017

If you dig a big hole, and then you take all the dirt you displaced and put it back in the hole, you’ve done a lot of work.

But you have accomplished anything? Have you improved anything?


Now let’s say you dig a big hole in somebody’s flower garden. Something pretty with rows of cutesy little flowers.

Then you take all the dirt you displaced and put it back in the hole.

You’ve done a lot of work. You can even say you’ve accomplished something. You’ve taken things a step back.

This isn’t progress, and it isn’t helpful.



Random letters

Sunday, August 27th, 2017

My kid liked this page so much I thought it would be easier to run it on my server so it would load more quickly.