Friday
Aug012014

I Hate SQL Server

This little gem is being written during a viewing of Mega Shark vs Mecha Shark. I find these Syfy movies are kind if like soccer, where I can compose my thoughts while watching and write during commercials and slow parts. These movies are generally not that great, but I find them highly entertaining. I definitely have a thing for Creature Features, but they're pretty rare in main stream movies these days.

So what I really wanted to write about was to vent about how frustrating I find SQL Server. More specifically, setting up SQL Server. It's great once it's all up and running, but it feels like getting it to that place requires a series of almost random and repetitive tasks. Some of this, I know, is my relative inexperience with the product. Some of it, I suspect, is Microsoft taking a more proactive approach to security, which is probably a good thing. Stuff like giving you the option to try logging in with a SQL user when that option is disabled. You would think it would gray out the option to log in that way, but it doesn't, and the error message you get is basically useless. Even better, if you go to the link referenced by the error box to learn why you got that error, it goes to a page not found page on Microsoft's website. I can understand giving unusable options and vague error messages as security measures, but the help link going nowhere really seems like a middle finger.

That was the inspiration for writing this, the half hour snipe hunt I went through to figure out why I couldn't log in with my app user on the new computer. It's not like I'm using an old version. It shouldn't be that difficult to just find out what an error code means. That's honestly my biggest gripe. The other stuff is just the particulars of how SQL server does stuff, like requiring you to make a login, then add that user to the database separately. The somewhat vague user roles that you need to add before that user can do anything. Where you have to go to create and add the users. It's all stuff that makes sense and is easy enough if you're familiar with the product, but it's very counter intuitive at first.

OK, I'm done complaining for now. I think I kind of talked myself of the ledge there. I was far more annoyed and ready to complain when I started writing this. But what good does it do, right? Gotta stay positive

Tuesday
Jul292014

How I Know We're Living in the Future

This is unrelated to my conviction we're living in the future, but I thought it might be interesting. I'm generally not a big sports fan, but I've taken an interest in soccer in the last few years, ever since Seattle got a MLS team. I like that it doesn't really stop for anything. I like football when the action is happening, but it seems like 3/4s of the game is waiting for something to happen. Soccer can be boring at times, but I find it's the closest I come to caring about sports. I've also noticed a certain synergy between writing (creatively, not code) and watching soccer. When I write I frequently have an idea of what I want to say, but I make frequent stops to mull over the wording. While I'm doing that, I'll watch the game. It's sometimes distracting, but I'm usually able to watch and enjoy most of the game while formulating specific sentence structure. So the reason I wrote something yesterday was because the Sounders were playing (and got massacred by LA. It was embarrassing), and today I'm watching an old English Premier Game that NBC Sports was replaying at 4AM that I taped. I don't know how I even found it, but there you go.

On to the topic at hand. I know the gold standard for living in the future is flying cars, and we don't really have those yet, but I think I can make a case for this story being adequate proof of our future-living. This story is a few weeks old at this point (so we're at least 3 weeks into the future, I think), but I only heard about it recently. Basically, some good guy hackers found they could extract the wifi network key because of a poorly implemented crypto system in smart light bulbs (!!!WTF?!?!) When security vulnerabilities in your light bulbs are a real thing, I think it's safe to say we live in the future. There's a million articles about this already so I won't go into painful detail about it, but it is a pretty clever attack.

It's not really as bad as it sounds. This wasn't a trivial thing that they did to discover the vulnerability. They had to acquire a bulb, take it apart and basically reverse engineer it. The light bulbs used a mesh network to communicate with each other, which got around the issue of needing to have a light bulb in range of the wifi router. As long as they were in range of each other, they could pass along traffic to bulbs in range of the router. Part of the traffic the bulbs would send to each other, and specifically new bulbs, was the wifi password. That sounds bad, but I think it's understandable given the size limitations of a light bulb and what they were trying to accomplish. They were encrypting the password also, the only problem was how they implemented that. Here comes the bonehead part. They used a static key for all light bulbs. Once the security researches were able to discover the key, that was pretty much it. All they would have to do is pose as a new bulb and any bulbs nearby on the network would gladly pass on the wifi password to the newcomer. If that's not living in the future, I don't know what is.

Monday
Jul282014

New Computer

So I got a new computer. It's a desktop, which is kind of weird and fun for me at this point. I've been exclusively using laptops since before I started college, which is probably six or seven years at this point. I had a decent desktop back then, but I didn't really have a place to work. I tried plugging it in and using it a few months ago, but the motherboard, apparently overcome with feelings of neglect, decided to end it all in a magnificent display of scrambled output which turned into perpetual blue screens of death.

I thought I was content with laptops, but lately I've found them lacking for what I want to do. Part of it is the screen size. I don't like large laptops, and my eyesight never got worse, so 13" set to the highest resolution is pretty much perfect for me for most things. However, as I get deeper into programming, I'm finding that this size is simply not adequate. I've been having a lot of trouble moving forward with the employee directory, and I think part of it is I can't see a lot of the code on my laptop. With all the indenting and the chunks of the screen taken up by the editor it can get cramped and hard to read. Up until now it hasn't been a big issue because what I've been doing isn't terribly complicated. But this directory is by far the most complex thing I've tried to do, and I find trying to work on it on the laptop intimidating. I'm hoping a big screen or two will help with that.

The other thing I've found lacking on laptops is gaming. For better or worse, video games are my relaxation method of choice. I've been content to use Xbox to scratch this particular itch for years, but there are some games that just don't translate well to a controller. Laptops are fine for some of this stuff, but they just aren't meant for it. I know there are "gaming" laptops out there, but the requirements for what laptops are and what games need seem to be fundamentally at odds with each other. Games want big everything. Huge files, the more processing power the better, lots of RAM, etc. Laptops are all about miniaturization and power conservation. I know you wouldn't be doing much gaming with it on battery power, but still. It can work, but it just seems like a sub-optimal configuration.

The last thing that I think will be good with a desktop is that it's stationary. I'm hoping that sitting at the desk will tell my brain that it's time to use the computer and nothing else. I can't use it on the couch, and I don't have a TV in my office (which also doubles as the doggie dining room), so there should be less distractions.

We'll see. This is all largely theoretical at this point as I'm in the middle of the worst part of buying a new PC, which is setting all my crap up again. The dev stuff is almost done, so I'm going to be fresh out of excuses soon. Only time will tell.

Sunday
Jul202014

Employee Directory

I haven't been very good about posting updates. I don't know if it's the summer heat, or if I'm just feeling down lately, but it's been hard to get myself motivated.

There have been some developments. I've been working on a PHP project at work to keep track of our computers and help plan our migration to Windows 7. It's not especially sophisticated, but it's probably some of my better PHP code, and it shows I'm not a one-trick pony I've got at least two or three tricks. I'm also planning to add a repo for some powershell scripts once I have a few that are worth it. All of that is on Github

What I wanted to talk about today was the new C# project I've been working on, which is an employee directory for work. I don't know if it's more apt to compare me working on this directory to Sysiphus and his rock where I'm Sysiphus and maintaining the directory is the rock, or maybe like Grendel in Beowulf. Although in that one, I guess I would be a mead-hall, and the directory would be the unkillable beast that terrorizes me. You know what, nevermind. Suffice it to say I've been working on this thing in one form or another for years.

It started out as an excel spreadsheet that would be converted to HTML when people were added or removed. This was cumbersome, and rather inefficient. We would add photos, and resize them, and it would often include the resized image and the original. There would also be TONS indecipherable code that I assume was meant for translating the particulars of the XLS format to HTML. Worst of all (as far as I was concerned at the time) it was visually inconsistent. In hindsight, maybe we should have resized the images first, but it didn't occur to me at the time.

In an effort to fight the bloat, I tried moving it Open Office's version of Excel. I'll call this better-ish. It eliminated some of the big problems, but also introduced some new ones. But the new problems weren't that bad.

I wasn't happy with better-ish, and I had run out of spreadsheet software to misuse, so I opted to hand code a directory with plain ol' HTML and CSS. This completely fixed the issues of visual consistency and bloat, but it's cumbersome to hand edit changes and add people, and it imposed a certain knowledge hurdle on making changes. No one in the company knows the first thing about HTML except me and my boss, and him just barely. While that sounds like good job security, it's not really the greatest job out there. I wouldn't be upset if I never got to manually edit that directory again.

That's where PHP came in. I was teaching myself how to code HP, and I can't really learn something unless I break it down and see it in action, so I wanted a project. That version of the directory was the most ambitious thing I had tried at that point. I did get a mostly feature complete version running, but I abandoned the project.

It was abandoned for a few reasons. For one, we didn't really have a production server to run it on. Our intranet server at the time was old and temperamental at the best of times, so installing PHP on it seemed like a bad idea. New hardware was apparently around the corner, but that corner turned out to be pretty far away. Plus the requirements changed drastically in the middle of the project due to a new HR person. Now granted, she had no idea I was working on this, but it really sucked out the last of my motivation to finish. It's probably just as well. I looked at the code the other day, and it was a little rough. You'd think I got paid by the comment. Every line had a comment, with paragraph length description comments of every function and section.

That brings me to current times. I'm trying to take things a little further. The PHP version was basically just a database-powered version of the HTML one with a form for adding and modifying people. This one is a bit more dynamic, allowing for multiple phone numbers of various types, multiple job descriptions, etc.

This is my first real use of LINQ that I know of. I'm using it to filter employee-specific data during the loop that creates each employee's entry. So if employee A has 3 phone numbers, it will just extract those from a larger phone numbers query-result set while on that employee's part of the loop. I owe that little bit of insight to mentor/teacher Adam. My initial attempts at implementing these open-ended fields was to use nested loops, which would mean looping through the entire employee result set 6-7 times to catch all the dynamic elements. In practical terms, this probably wouldn't have created a noticeable lag in the creation of the page. Work has about 120-130 employees, so there wouldn't be much lag, and people would probably write it off as typical network latency. But it really bothered me how staggeringly inefficient that approach was.

As of this writing, I am done with a rough version of the display page. It's ugly as sin, both the code and the presentation, but the information is there. I'm going to re-factor the code a bit to make it easier to read, then get started on the adding/modifying employee form. I'll probably focus on the presentation last so I can make everything visually consistent at the same time. I also need to figure out how to restrict the editing to a few individuals. Wouldn't want just anyone able to modify these entries, right? More on that as it develops.

Sunday
May252014

Blood Lake? Blood Snakes? Lake Vampires?

I wanted to write about this before the whole thing was over.  A while ago my wife signed up for an online focus group/survey with Discovery.  Every now and then she'll involve me in them because she's not really into that particular panel of questions.  This seems to fundamentally go against the idea of using her as a focus group participant, right?  But it's fun.

The last time she started asking me their questions it was about what movies have they seen, and it was a bunch of the terrible made-for-Syfy, low budget, campy monster movies that I absolutely love.  Sharktopus?  You bet.  Sharknado?  Of course.  Megashark vs [other large thing]? Definitely.   They weren't all shark related, but those are the ones that come to mind.

So then it starts asking about other things you watch, and asking about what movie names you might be interested in.  Stuff like in the title, but they don't tell you what the movie's about.  A lot of them included either blood or vampire, and lake.  I kept thinking it was about redneck vampires that lived near a lake.  Blood Lake ended up being out favorite.  I don't think they ever really let on what the movie is about, but I think there were enough clues to figure out it was about rampaging lamprey eels.  I found the whole thing interesting but never really gave it another thought.

So a few weeks ago I was watching Animal Planet, and I saw them teasing monster week, and in particular a movie at the end of it.  I don't think they said the name in those early teasers, but it ends with a close up of a lamprey mouth.  How would I know what a lamprey mouth looks like, you ask?  I saw it on the show I was probably watching Animal Planet for, called River Monsters.  I never would've thought a fishing show would be interesting, but it features the real and absolutely horrific critters that populate fresh water rivers.  Here's a link to a google image search for tiger fish as an example. One of the monsters was lampreys, and while they are not particularly dangerous, they are disturbing looking.

It's hard to tell in hindsight if I put it all together right away, but it sunk home in the next round of ads when they announced the name of the movie:  BLOOD LAKE!  I think my head exploded when I heard that.  After I put my head back together, I set up a recording for it.  In normal circumstances, I don't know that this movie would have really caught my interest.  I love monster movies, but this one sounds a little normal for my tastes.  Maybe if they were giant eels, or could fly or something.  The focus group thing got me invested.  Also, some of the teaser stills look downright disturbing, which is always a good sign.  Plus they listened to me about naming it, so I feel like I kind of owe them