2015-06-10

Minimizing Coupling, Brittleness, and Breakage Between Systems

I have found myself in several conversations recently with other technologists and portfolio companies regarding how to minimize coupling, brittleness, and breakage with software.  Typically I find the start of the answer in realizing where your "implementation contracts" exist.  These are usually at development seams, between:
  • internal components and/or systems
  • internal development teams
  • external and internal development teams
  • you and your customers
  • you and your vendors
  • you and your partners 

Kill Them With Clarity

Start with being precise and clear.  It is your responsibility to document your software, especially when someone else is using, let alone depending on, it.  If someone is consuming what your producing, picking up what you're laying down, then be clear with the expectations.

 Follow A System, Any System

Some kind of consistency, a standard if you will, goes a long way.  I'm (relatively) agnostic to which one you pick, just be sure it's (relatively) obvious and not arcane.

Don't Reinvent the Wheel

It's likely that your business involves building something that isn't versoining or implementation contracts - those are just necessary byproducts.  If this is the case, and just a means to a bigger end, then I'd like to suggest using Semantic Versioning (semver to the cool kids).  I find it to be very well thought-out, and addresses most concerns eloquently.

If you're willing to jump on the semver bus, then this might be a good place to start.

Semantic Versioning

The Spec. 

Authored by Tom Preston-Werner (ever use GitHub?), this is a quick read.  Be sure to read all sections, especially "Why Use Semantic Versioning?"  To his point, you are probably doing something "close to this already".  But this isn't horseshoes, nor hand-grenades - close isn't good enough.  You need compliance to some standard.
http://semver.org

The ~ and ^

Shift-Backtick and Shift-6 are confusing enough to find, you want to be clear with the differences before you start using them.  A great explanation between the tilde and caret operators here:
http://www.jakobm.com/semver-in-nodejs-and-npm

Pattern Examples

Check the "Commonly Seen semver Range Patterns" section here.
http://developer.telerik.com/featured/mystical-magical-semver-ranges-used-npm-bower/

MAJOR 0 = MAJORly Different

Be mindful of the MAJOR 0 (0.y.z) caveat with semver. Lot's of people bitch about this, but I think it's brilliant.  The point is that any zero-dot release has NO contract and may (should?) change at anytime.
https://nodesource.com/blog/semver-tilde-and-caret


Go Forward and Version

Try it.  For any dependency management I find this to be a very lightweight, easy to understand set of concepts and rules that work on systems, documents, software, hardware, recipes - you name it.

2012-07-19

Windows 7 + Paragon HFS = NTFS Event ID 55, 57 Errors

I have just recently reinstalled Windows 7 Pro on my MacBook Pro which is also running OSX Lion.  After installing all my applications, utilities, and the requisite N-update/reboot cycles from Microsoft Update, I thought I was doing pretty well.

Then I noticed that there were a ton of errors in the System Event Log.  Most from the Ntfs source, firing Event ID 57:
"The system failed to flush data to the transaction log. Corruption may occur."

That can't be good.  I also noticed that these errors were coming in every 5 seconds or so.  Not something you want to leave alone.

The error didn't really tell me what the issue was with.  After some digging, I ran "mountvol" to show a listing of mount points.  One volume in particular showed ***NO MOUNT POINTS***.  The guid for that phantom volume (let's call it GUID-PV) wasn't terribly useful, so I tried mounting it (to U:).  It mounted, but I couldn't read anything at that mount point.  However the Event ID 57 errors above changed their text to include the U: drive being the issue.  I think I'm on to something now. Also, in addition to the Event ID 57, I was now also getting Event ID 55 errors saying:
"The file system structure on the disk is corrupt and unusable. Please run the chkdsk utility on the volume \\?\Volume{GUID-PV}." 
Ok, at least I know where the issue is.

After more googling I found this post. It pointed me to the WinObj tool from the fine folks at SysInternals (now Microsoft). WinObj showed me that the GUID-PV pointed to "\Device\Harddisk0\Partition6".  Strangely that is what Windows showed as the 4th partition on my primary drive, the same partition which hosted my NTFS partition that I was currently running Windows from (as C:).

I looked into the HKLM\System\MountedDevices key and noticed that the entry for "\\?\Volume{GUID-PV}" had the binary payload of "Volume{GUID-WTF}" in it.  After a bunch of registry searching for the GUID-WTF guid, I concluded that this was infact some kind of symbolic pointer (or ??) to at least some GPT partition and not a phantom USB drive or other unmounted disk.

At this point I started to question the Paragon HFS+ drivers I had installed.  I uninstalled them, rebooted, and magically all the errors went away.  I ran "mountvol /r" from an elevated command prompt and the erroneous "\\?\Volume{GUID-PV}" entry in MountedDevices vanished.  Sweet.

Unfortunately when I reinstalled Paragon, the same errors and crazy MountedDevices entries returned.  The PhantomVolume guid was different, but what it pointed to (the GUID-WTF) was the same.  After a couple uninstall / install cycles of Paragon, and watching how the registry changed, I decided to look at what was getting loaded.

I pulled down DriverViewer.  Great tool, feels like a SysInternals Tool but they didn't seem to have an equivalent.

I noticed that after Paragon was installed, it loaded a bunch of drivers:
apmwin.sys      Apple Partition Map Driver
gpt_loader.sys  GUID Partition Table Support Driver
hfsplus.sys     HFS+ File System Driver
hfsplusrec.sys  HFS+ File System Recognizer
mounthlp.sys    HFS+ Mounter Helper Driver

However, the core Apple drivers from Bootcamp were still loading:
AppleHFS.sys    Apple HFS
AppleMNT.sys    Apple Mount Manager

Most the blog posts said to just rename the driver files to something like AppleHFS.sys.old.  That seemed hacky to me, so I dug into how Windows knows to load drivers via the HKLM\System\CurrentControlSet\Services keys.

I set the "Start" key (which was set to 0x0 for "Boot") to 0x4 for "Disabled" for both AppleHFS and AppleMNT drivers in HKLM\System\CurrentControlSet\Services. After I set both of these drivers to disabled (I left the drivers on disk on purpose) and restarted Windows they didn't load.  I reinstalled Paragon HFS+ drivers again, rebooted, and the error in the System log has not reappeared, the Apple drivers are not loading, and the mysterious volume is no longer appearing.

Hopefully I'm out of the woods.  Let's see how Paragon holds up...

2010-02-25

Sushi Mon: Worse Than Ever

I recently decided to eat at Sushi Mon by the Beverly Center for the first time in years. I always had fond memories of the place and thought it would be fun to give it a go one more time. Yeah, bad idea. Below is my Yelp review of the experience - my first ever negative Yelp review.

--snip--

Disclaimer: I don’t like saying bad things about places. Alas, this food sucked so badly that this is my first overly negative review on Yelp. Yes, it was that bad.

I used to love this place. I used to go here fairly often (twice a month) back in the early 2000’s, and thought their fish quality was 3.5 star, service was 4.5 star, and price-to-size ratio was 5 star. I used to have a great time every time I went; walking away with the exact experience I wanted. I used to want to be a garbage man and hang onto the back of the white garbage truck that came by my house every week as a kid.

Sadly, those ships have sailed. Far, far away. They may have sunk en route.

Granted that my sushi palate is far more developed these days, but still, Sushi Mon would have gotten an extra half-point in their favor for nostalgic reasons alone. No, they had to try, hard, to fail this badly. We sat at the bar, the service was not exceptional, not miserable. What the sushi chef lacked in ability and personality he surely didn’t make up for with his bar-side manner. To be fair, he did say he was new there, but still. Our orders came out with no cadence:

“Why am I sitting here starring at you with wide doe eyes? Oh yeah, because my fat ass is hungry and you, my chosen conduit to happiness, haven’t placed raw-fish-goodness on my tray in over 5 minutes. WTF-san?”

We had marked “cut” and “hand” rolls, figuring he would know what that means. I mean, the f’n sheet had a column for cut and hand. Apparently this was new to him. Upon reception of my cut spicy scallop roll, I say: “I’m pretty sure that was supposed to be a hand roll fine sir.” To which he looks at the sheet, shrugs, and says something to the effect of: “oh yeah, sorry.” No offer to fix the order, or replace the order. Just a shrug. Ok, fuck you guy.

But still, that’s just service; interface if you will to my raw fish Mecca. If the food is still good I will accept brow-beating from sushi bar staff. Your review is not in jeopardy yet Sushi Mon. Just give me those pieces of tasty fish goodness!

The hamachi was ok, let’s see where this goes – remaining optimistic.

The seared albacore nearly made me gag.

He FORCED the monk liver out of a caulk tube with great difficulty in-front of us. A caulk tube. FML.

The medium tuna had NO flavor. How they made this happen is a black magic that only the Japanese must know.

The snapper was good, well done sir.

The halibut was good, +1. Maybe we just picked some of their bad stock and this is going to turn around.

Ahh, next up, the Blue Fin Toro. I love Blue Fin Tuna. I have dreams about Blue Fin Tuna. And while I prefer the medium Blue Fin, I will accept Blue Fin Toro as a stand-in with no complaints. We ordered two orders. I knew the proverbial sushi train was off the f’n rails when our sushi chef now asks us if we’d like the toro “seared”. WHO THE FUCK SEARS TORO? Was this beginner’s day? Busch league my friend. I tactfully say “no thank you, how about just one order not seared”. I mean, I don’t want either order when this MFer is suggesting he sear it and cover it with scallions. His response: “I already cut two orders”. I DON”T GIVE A FLYING FUCK! Your fish is miserable, you just admitted it as you recommended searing your pièce de résistance to try and burn off the horribleness that is your food, and now you have the audacity to stick me with the fucking order?! Ok, fine. I’ll play your game.

The raw order was pretty bad. Flavor was below ok, but the texture was as firm as an overcooked porkchop. How you sell this as toro is beyond me.

He asks again on the second order if we’d like it seared with scallions on top and sweet soy. Sure fuck face, I hate you and want to leave this shithole as fast as I can. So go ahead, break out your MAP gas torch and sear the fuck out of it. Medium Well please. Give me a fork and steak knife too so I can cut the fucker up and eat it like you want me too.

Guess what? That piece was miserable. I “chewed” it enough to break it into pieces that I thought I had a 50/50 chance of NOT getting lodged in my esophagus and swallowed it near whole. EPIC FAIL SUSHI MON!

But wait, there’s more. While I only experienced mental trauma and a destroyed flavor palate after our fine dining experience at Sushi Mon, my sushi bar companion experienced the Level 4 poops. What better way to end your miserable sushi eating experience than with a little peeing out of your butt.

I have no interest in returning to Sushi Mon in the future. Maybe this was a one-off experience, but there are too many good sushi restaurants in LA to even consider going back to this dump. DINER BEWARE!

2010-02-22

Maths Adlibs

Very cool article in Wired on Compressed Sensing.


Compressed sensing works something like this: You’ve got a picture — of a kidney, of the president, doesn’t matter. The picture is made of 1 million pixels. In traditional imaging, that’s a million measurements you have to make. In compressed sensing, you measure only a small fraction — say, 100,000 pixels randomly selected from various parts of the image. From that starting point there is a gigantic, effectively infinite number of ways the remaining 900,000 pixels could be filled in.

The key to finding the single correct representation is a notion called sparsity, a mathematical way of describing an image’s complexity, or lack thereof. A picture made up of a few simple, understandable elements — like solid blocks of color or wiggly lines — is sparse; a screenful of random, chaotic dots is not. It turns out that out of all the bazillion possible reconstructions, the simplest, or sparsest, image is almost always the right one or very close to it.

2009-02-04

Ticket Master sucks, why are you surprised?

N.J. Congressman seeks probe of Springsteen concert sales by Ticketmaster

Bruce Springsteen, Ticketmaster Ticket Scam

Congressman Wants Ticketmaster Investigated For 'TicketsNow' Website

This is blown out of proportion. A pile of people flooded TM site. The site broke. The site always breaks. Technology will do that with unexpected loads. Ok, fine. Their service sucks and is overpriced – we all agree. This is not news.

But for people to blow up over being directed to TicketsNow is stupid. So if the TM site just broke, and didn’t force people to TN, then they wouldn’t be angry? I believe that TM is doing that as an upsell courtesy for its fan base – nothing more.

The “writers” of these articles and blog posts assume that TM and TN are in cahoots. I’m not so quick to assume that, I find it entirely believable that everyone that bought tickets stuck them up on TN to try and make a quick 3x to 5x. I don’t think those are TN tickets that were somehow bought/transferred/provisioned by TM.

And all the politicians getting around it? Please, that’s show boating. I agree that TM charges way too much. The solution is to connect the producers of the shows with the fans themselves, increasing producers margin, decreasing fan cost. Cut TM out of the loop – the internet and digital distribution is making this all very real and possible. Politicians have better, bigger problems to deal with – pay attention boys.

As for the secondary market – I believe in free markets, and this is supply and demand at its finest. I don’t think it should be regulated, but I do think there should be a “priority” given to true fans that don’t participate in the secondary market. Print my name and SSN on the ticket, and check my ID on the way in – if I’m willing to do that give me the ticket at 1/2 price as a fan. If I don’t want that, I should have to pay full boat to get a “blank” ticket that I can sell to the secondary market. I’m not sure I like the privacy ramifications of this yet, but it is an idea in the right direction. NIN did something similar for their last tour, but I don’t think they checked IDs for those tickets.

Conclusion: TM sucks, always has always will until a competitor eats their lunch; these articles are blown out of proportion and taken out of context; I clearly want to be distracted at the moment...