Feng Shui and the Art of Development

I’m not a big proponent of Feng Shui. For those unfamiliar with it, Feng Shui is a Chinese philosophy that essentially says that the placement of your furniture can have a big affect on your health and prosperity. Like a lot of things, something that starts off as a good idea seems to me to be carried too far. I do however firmly believe that your physical environment can have a dramatic effect on your mental environment. I saw a blog posting by Scott Hanselman describing his new home office layout. It was then that I realized something important: my own home office no longer worked for me.

I’ve been in my house eight years now. Like a lot of folks, I accumulate a lot of things related to my work / hobby. Books, computers, CDs/DVDs, and gadgets galore. It probably doesn’t help that my home office is also my ham radio “shack”, the place that contains all my radios, books and associated gear. For some time now I’ve been pretty unhappy with my basement office, having problems concentrating, etc. It had even gotten to the point where I had no place to even lay a book and reference it while working. After reading Scott’s post I immediately realized what my problem was: my environment.

Unfortunately December and early January were a bit hectic, what with my wife’s health problems and work, I haven’t had much spare time. Well, this weekend good luck finally arrived. My wife is healing very nicely and is much more self sufficient. We had snow, which made going out impractical, so it was the perfect opportunity. I pulled nearly everything out of my office, placed a lot of my “junk” into storage and relaid out the tables I use for working.

I’m typing now from my reconstructed office. A lot of the spare parts I had accumulated are gone, boxed up and placed in the storage area under the stairs. A lot of old catalogs and magazines hit the trash, many of the books I seldom reference were moved to another area of the house that had space. I now have plenty of space for my computer and can finally have all three monitors laid out side by side. I have a workspace now, somewhere to put the book I’m using for learning or reference. In addition, the moving of old books gave me space to put away my new books. I was able to do a little shuffling so the books I currently reference the most were on the lower shelf within arm’s reach, instead of piled on the floor.

Once again my office feels like a safe place to learn. When it comes to your office, whether it be your desk at your employer or your desk at home, don’t overlook your environment. Everyone has their own style. Look around your office right now. Is it comfortable? Quiet? Can you think effectively? Are the tools you need close at hand? If you answered any of these “no”, then start thinking about what you can do to make your home office a refuge, a safe place to work and learn. Then go do it.

Arcane Fun Fridays – Broadcast your Podcast

A little fun tip for today’s post. As long time readers know I love podcasts. They are a great way to capitalize on time, learning while doing other activities. As I was puttering around the house, I wished I had an easy way to listen to my podcasts without having to use my headphones, and also be portable. Then it occurred to me, I did.

When I drive back and forth to work, I use a cassette adapter to plug into my cheapy mp3 player into the my old car’s stereo and listen to my podcasts. Sometimes I travel on business, and these days it’s seldom I get a rental car with a cassette, so I picked up an inexpensive radio transmitter, similar to this one but a heck of a lot cheaper. Well, being an amateur radio operator (often called “ham radio”) I have a wide variety of power supplies lying around. I dug into my box and found one kind of like this. I mated them up, found an unused frequency, and plugged the other end of the transmitter into the speaker jack of my computer and boom I was listening to my podcasts through my various radios. Very nice, and I can see a lot of use.

I was pleased too with the range, I can hear it all over my house and even into my yard a bit. I could probably get a bit more range moving it out of my office basement.

One last hint for today, next time you go to various stores keep an eye out for a “clearance” area. They are usually tucked away in the back corner of the store, often near the restrooms. I know I’ve seen them in Staples, Radio Shack, Office Max and Office Depot to name a few. You can get some really good deals, for example I picked up my transmitter for 10 dollars, marked down from the original 49 bucks. Also check out sites like woot for “deal of the day” specials.

Life in Tinkie Land

My wife wrote a rather long post over on her blog, southerntinkerbelle.com. She detailed her hospital stay from her point of view. I thought the whole thing was rather surreal, although I did think it extremely cool the hospital had free wi-fi. Let me keep myself occupied with my laptop while she slept.

I know I sound like one of those typical husbands when I say this, but I never quite realized how much she dealt with on a daily basis until I tried to do it for her, and hold down my regular job, not to mention taking care of a wife recovering from surgery. Fortunately my work was very nice and let me telecommute last week which made life a bit easier for all of us.

I should probably try and draw some sort of metaphysical parallel between  the whole event and software development, but frankly I’m just glad she’s on the mend and doing much better.

SOA Society Meeting

Just thought I’d let you know of more doings in Birmingham. The SOA Society will hold it’s first meeting of 2008 next Tuesday, the 22nd. SOA stands for Service Oriented Architecture, a methodology for integrating IT and Business. That’s a pretty broad simplification, to learn more about SOA you’ll just have to come to the meetings!

See the Society’s website at http://soasociety.com for more info.

VS 2008 Technical Overview

Just thought I’d pass along an upcoming event, on Thursday January 17th 2008 Doug Turnure will be presenting a technical overview of Visual Studio 2008 at the IPSA (Internet Professional Society of Alabama). Doug’s will be talking about new features and designers in VS2008, LINQ, and will even be giving away a couple of copies of VS2008. RSVP ahead of time at the IPSA site, especially if you want to purchase a lunch.

Enjoy!

Where’s Waldo?

I have been a bit absent of late with the blogging. I just thought I’d take a second to explain. Last week my beloved wife had some pretty serious abdominal surgery. She’s going to be fine, but for a bit I’ll be playing both Mommy and Daddy, taking care of the kids, doing housework, etc. Thus my spare time for blogging, learning new technology and other geeky pursuits is quite limited.

I did have one pleasant surprise, during the three day hospital stay (yes I stayed with her) I found the hospital had free public wi-fi. When she was napping I was able to get out my laptop and handle a few work items, and communicate to the extended family about her condition. It was a nice “extra” that made the stay that much better.

It got me to thinking, there are a lot of places I go that it would be nice to have that free wi-fi access. Anywhere that you spend a lot of time, or need to do some sort of research. Around here I know several restaurants and coffee shops with it, as well as all the public libraries. There should be more though. One bookstore chain has wi-fi, but charges for it, another doesn’t have it at all. I mean, come on wi-fi doesn’t cost that much, and I would certainly be paying for it through my store purchases.

Doctors offices are another place I wish I had it, often you can spend hours waiting on a doctor. Sure would be nice to be able to check e-mail and let the office know “I’ll be here a little longer…”

What other public locations can you think of that you’d love to have some wi-fi in?

Does MacGyver Dream of Mark Miller?

For Christmas this year my family gave me a copy of MacGyver, Season 1 and 2 on DVD. My wife’s side of the family gave me a gift card which I used to get seasons 3 & 4. I’m a long time MacGyver fan, but my wife had only seen one or two episodes and my kids had never seen it at all, so we’ve been having a lot of fun watching. My favorite part of the series was the voice-overs, where you’d hear MacGyver’s voice as he explained what he was doing. It always started with some odd thought or story that led you through the thought process of how he came to the conclusion to build whatever wacky life saving device he was constructing.

I’ve come to realize in some ways these blog entries are sort of like the MacGyver voice-overs, my inner thoughts being created for you on the web. So I hope you’ll bear with me a few minutes while I relate a rather bizarre dream I had last night.

In my dream I’m standing on stage, in front of a fully loaded computer. It has all the bells and whistles, VS2008, SQL Server, and so on. On the other side of the stage, Mark Miller is there, in front of a similar computer. For those unfamiliar with Miller, he’s the genius behind CodeRush and RefactorPro, tools to help you write code faster. Some time back, when the product was first released Miller used to challenge the audience to beat him in a code writing contest. His machine had CodeRush, and he would use chopsticks to write code, his competitor could use their fingers but did not have CodeRush on their machine. Of course Mark always won.

So sure enough, in my dream there’s Miller, chopsticks in hand ready to go, and I’m the guy going up against him. Our task is to take data from table A1, create a mirror table and name it table A2, and then move all million rows from A1 into A2. As you might guess, in my dream, I win. How?

Well I didn’t write a program. Instead I first jumped into SQL Server Management Studio (SSMS) and used its script generating capability to produce a create table script. Make a quick search and replace and boom I’ve got table A2 created. I then jump over to the Business Intelligence Developer Studio (BIDS) to create a SQL Server Integration Services (SSIS) package to do the data move. (Yes, I probably could have used the script generation of SSMS again to generate an Insert script, but I was showing off.) In about three to four minutes I had accomplished the task and moved all the data while Miller was pecking away at computer with his chopsticks.

I didn’t win because I’m a hot shot coder who is smarter than my competitor. Miller is a (some say mad) genius who can run circles around me in the coding world. As I told the folks in my dream, and I’m telling you now sometimes the best solution to a programming challenge isn’t to program at all! If you read yesterday’s post, Straining at Gnats, you may recall I said “…take some time. Push back from your computer and think for a moment. Think what the true outcome of your application is supposed to be. Not “what will the program do” but “what will the program do for the user???” Think about how best to achieve the user’s goals.

When you are thinking about solutions, take a minute to look outside of your favorite programming language. Is it possible to achieve the goal without writing any code at all? What tool or tools do you have in your tool box that you can combine to get the job done? Here’s a great example that happened to me just before I took off on my holiday vacation.

As I’ve mentioned before at work we have a Business Intelligence (BI) app I work as the lead on, it imports data to a SQL Server 2005 warehouse via SSIS then uses SQL Server Reporting Services (SSRS) to generate reports. The data is imported from a work order management system we bought many years ago. We also have some engineers who have a tiny little Microsoft Access database. This database has a primary key column; we’ll call it a part number for purposes of this example. There are three more columns, some data they need to know for each part but are not found in our big system. They’d like to add this data to the reports our BI app generates. Two last pieces of information, they only update this data once per quarter. Maybe. The last few years they have only done 3 updates a year. Second, the big system I mentioned is due to be replaced sometime in the next two years with a new system that will have their three fields.

A lot of solutions presented themselves to me. Write an ASP.Net app, with a SQL Server back end then use SSIS to move the data. Elegant, but a lot of work, very time consuming for a developer, especially for something that can go away in the near future. Write an SSIS package to pull data from Access? Risky, since we had no control over the Access database. A user could rename columns or move the database all together, in either case trashing the SSIS. Several other automation solutions were considered and rejected, before the final solution presented itself: not to automate at all.

Once per quarter I’ll simply have the engineers send me their Access database. Microsoft Access has a nice upsizing wizard that will move the table to SQL Server, I’ll use that to push the data onto the SQL Server Express that runs on my workstation. I’ll then use the script generating capability of SSMS to make an Insert script for the data. Add a truncate statement to the top to remove the old data and send it to the DBA to run. When I ran through it the first time my total time invested was less than ten minutes. In a worst case scenario I spend 40 minutes a year updating the data so it’s available for reporting. That’s far, far less time that I would have spent on any other solution.

The next time you have a coding challenge, take a moment to “think like MacGyver”. Look at all the tools you have lying around your PC and see what sort of solutions you can come up with. Once you are willing to step outside the comfort zone of your favorite coding language, you may be able to come up with some creative, MacGyver like solutions to your user’s problems.

 

PS – If you missed the announcement while on vacation, DevExpress just released CodeRush / RefactorPro 3.0. More than 150 refactorings and lots of new CodeRush features! Update yours today.

Straining at Gnats

Here in the south (I live in Alabama) we have a saying “quit straining at gnats”. A gnat, by the way, is a very tiny bug that proliferates during the summer and tends to fly in your face when you walk outdoors. The saying essentially means “you’re working very hard to get rid of something very small”.

In Episode 300 of Dot Net Rocks (a great episode) Richard Campbell tells a great story. The short version is Richard is called in to look at a computer that’s having problems. It’s the mid 80’s or so, and this PC is responsible for downloading financial info. Every hour the computer reboots itself and they have to go start it all back up. He says “I can fix it, but it’ll cost you 3 grand”. Client sputters and says they’ll think about it.

Two weeks later he gets the call “OK, you got the 3 grand, come fix it.” So on the way to the client he stops and spends 1500 bucks on a new PC, puts it in place at the client, copies all the old software over and boom it’s up and running perfectly. As he’s walking out the door, check in hand, he’s asked “what was wrong with it?” “Heck if I know.” Richard replies. “But the problems fixed.”

It’s a great story (and much funnier when you hear Richard tell it), but it illustrates a great point. All too often we obsess over some problem, and lose sight of the desired result. All too often we focus on some piece of code, trying to come up with the most “elegant” solution, or frustrate ourselves over some piece of code instead of tossing it and rewriting.

I’m not saying write bad code, or write sloppy code in a hurry just to get it done. I am saying when you run across a problem, don’t get so invested in it that you don’t see alternatives. Time and again I see a developer getting stuck on a problem, trying to fix some arcane piece of code, or spending hours to get that extra millisecond from a SQL query.

When you run across that road block, take some time. Push back from your computer and think for a moment. Think what the true outcome of your application is supposed to be. Not “what will the program do” but “what will the program do for the user???” Think about how best to achieve the users goals.

As Campbell pointed out several times in the episode, when you are writing software for a business it’s all about making money. Your program should either make or save the company money in some fashion. Whether it’s by crunching numbers in a faster, more efficient way than a human could, by providing information in a more timely fashion, or any of a thousand other scenarios. Never lose sight of the fact your software is to provide a solution, and not being written for artistic purposes.

Don’t get so lost in the code that you wind up straining at gnats.

Happy Anniversary

I typically don’t post much in the way of personal stuff here on my tech blog, but I had to take a moment to wish my beloved wife “Ammie” Happy Anniversary! Eleven years ago today my best friend and I walked down the aisle, which was an adventure in and of itself. Here’s a hint for all you guys out there: if you are going to get baptized together the day before the ceremony, make sure your bride to be’s ex-boyfriend isn’t in charge of filling up the baptistery!

My wife always wanted to have a baptism ceremony with her groom, so the day before they wedding we got baptized together. Let me set the scene for you. It’s December, and even though we live in the sunny south it was still COLD that day. As in 33 degrees Fahrenheit for the high. Oh, and winds from the north at 15 miles per hour, which made the wind chill factor “way on down there” as we say.

Seems my wife’s ex thought it might be a good idea not to fill the thing ahead of time and let it get to room temp. Oh no, he thought we needed the water good and fresh. Fresh from the icy cold well they used to fill it. And did I mention it seems that just coincidentally the heater for the water wasn’t working that day?

So when the pastor, my bride and I got into the water, little icebergs were floating all around us. And then just as the pastor is about start the dunking “Brother Bill” who was on stage, got a little befuddled about his part. He was supposed to give a little talk after our dunking, but got confused and started on his fifteen minute monologue while we were still standing in the frozen pond they called a baptistery.

Someone finally drug Brother Bill off stage and we got on with the dunking. More fun followed, it seems when you exited the pool, the door led outside. Yes, you read that right, outside. It seems the building designer didn’t want wet robes dripping on the carpet, and thus in bare feet and dripping wet robes we walked down the long side of the church, then back around the front and back in to the bathrooms.

The fun didn’t end there though, we still had the ceremony to get through. At the end of each pew were candles and garland. My wife had a long veil on her gown. Can you guess where this is going? About half way down I saw a little flare up as the thing began to smolder. Fortunately just as quickly I saw a pair of hands, I still have no idea who it was, reach out and snuff it out. Fortunately the happy bride was blissfully unaware as she continued her march.

Disaster was almost repeated during the candle ceremony on stage, you know the one where we take two candles and light one in the middle then blow ours out? This time I was on hand, she was so excited she brought her candle right to her face forgetting her veil, I had to stop her before the open flame reached it.

I had my brain dead moment of glory as well. We were rushed through our ceremony, photos, reception, and by the time we left we were both starving. We stopped at a drive through window, and my new wife asked me to get some cold meds out of the back. Yes, the cold dunking in the baptistery had left her sick! Well I was so excited I sat my 32 ounce cup of ice tea on the dash in front of her, then jumped out. I have a stick shift. Guess what I didn’t do?

Yup, take it out of gear. I stalled it out and large cup of tea went floop right in her lap. Icy cold again!

It all turned out well though. Eleven long years, two kids and a mortgage later we are still happily married and going strong. I have to give a lot of credit to my long suffering wife for putting up with me, listening to my ramblings about the .Net framework or some SQL function, and staring at the back of my head while I worked on blog posts or learned some new tech.

Happy Anniversary Ammie! Love ya babe!

Happy Holidays

Ah, the holidays! Time for carolers, festive trees, and eggnog. And, time to squeeze in all that vacation I haven’t been able to take all year!

Like a lot of folks I’ve been enjoying some time off, spending time with the family, fighting the crowds for a little last minute shopping, and catching up on some honey-do’s. And, for a change, staying away from the old PC for a bit.

But I wanted to take a moment to thank everyone for visiting, and wish you all a safe and happy holiday season.

  –Arcane Code

SQL Server 2005 Learning Resources

I’ve been spending a lot of time lately in the SQL Server realm, learning all I can about it as both a database and business intelligence platform. Turns out to be a far more complex, and fascinating subject than I’d first imagined. I thought that you too might find some of the same resources I’ve been using useful. All of these are free, which is a great price.

Rather than putting them all here, I’ve updated my Arcane Links page (https://arcanecode.wordpress.com/arcane-links/ ) with a new section on SQL Server 2005 Resources. Over the holidays I plan to update the links page with fresher links, local user groups, etc. I’m also working on learning SQL Server 2008 as well, so look for those links upcoming shortly.

A timely mention, the RunAsRadio that was released this week (episode 36, see the RunAsRadio link in the links page) has an interview with Kimberly Tripp and Paul Randal. Not only was it a great interview, they let it slip they’re actually considering doing a show. If you’d like to see a SQL Server show, please leave a comment over on Carl Franklin’s blog (http://shrinkster.com/sv5 ) and let them know. Personally I’m thrilled, there’s a lot of good shows on Visual Studio but only one good one that I know of for SQL Server, SQL Server Down Under (again see my links page). If you know of other shows let me know by leaving a comment here. I figure there’s plenty of room for more and Kim and Paul would be a great duo.

Over time my posts will catch up with what I’m learning, and I’ll start getting more into SQL Server content as time goes by. Meanwhile check out the links and learn along with me.

Happy Anniversary Commodore 64!

According to a report in CNN (http://www.cnn.com/2007/TECH/ptech/12/07/c64/index.html ), folks are gathering today to celebrate the 25th anniversary of the Commodore 64 computer. Those of you under 30 may not remember this gem of a machine. It wasn’t my first computer, but it was probably my favorite. The amount of hacking and modding you could do with these things was incredible. I cut my teeth on BBS’s (Bulletin Board Systems) using my 300 baud modem. Yes, 300 baud, if you happen to recall what a baud is. For comparison, 56,000 baud (56k) is about the fastest dial in you can get today, and then it jumps to broadband.

I remember way back when I was the third person in my area to upgrade to a 1200 baud modem. And would you believe at first I didn’t like it? With my old 300 I could easily read my e-mail as it scrolled onto the screen. With the 1200 it zipped by so fast I had to go learn all the message scrolling commands for the various BBS’s I dialed into.

I’m something of a packrat; I still have a lot of “ancient” computers in my home-office closet. TRS-80’s, Radio Shack Color Computers, parts of a Timex Sinclair, and a Commodore Amiga. But the one that’s still setup on my desk is a Commodore 128, with a stack of drives, software, and even a Commodore 1702 monitor. I find it relaxing to fire it up every so often and play some old fashioned arcade games, or play some of that old midi music.

Happy Anniversary Commodore 64!

Arcane Thoughts – Firefox Got It Right

We had a nerd lunch today, 5 developers at the round table of my favorite restaurant, Richards BBQ & Grill. We talked about a lot of different things, and spent a while ranting on what I can only describe as the narcissism of companies taking over our system trays with their stupid applications.

I’m not saying nothing should ever go in the tray. Software that needs to run 100% of the time to wait for my command, like SlickRun or TouchCursor, should have an easy interface and the tray makes sense. But there’s a lot of software that runs, but doesn’t need to.

Why, for example, does Adobe Reader need to install it’s applet into the system tray? What value does it add? Checking for updates? Yeesh, why do you have to run 100% of the time on the off chance an update might come out?

How about all the hardware makers who want to install interfaces to their hardware? Why do I need another program running all the time on the off chance I might perhaps possibly maybe want to tweak a setting? Isn’t that what Control Panel is for?

Firefox, on the other hand, got it right. When you launch the application, it quietly checks for updates in the background. When it’s downloaded them and has them ready to install, a little dialog pops up and asks if you’d like to restart Firefox to take advantage of the new updates. If no, it just says “Okey Dokey, I’ll install them the next time you run Firefox”. And that’s it, no harassment; it only runs when I run the app! No annoying system tray icon for Firefox.

There’s no reason why other tools couldn’t follow the same model. Adobe Reader for example, when I launch the reader, at that time and only at that time, it should head off in the background and see if there’s an update. Let me know if there is, and away we go. But if it’s six months between the time I run the program, then just lie dormant on my hard drive, don’t suck up my valuable CPU and RAM with your app that adds no real value to my system.

Well, at least there’s one company out there who knows how to handle updates correctly. I’d love to hear your examples of good software. Software that handles updates correctly and respects your system resources. Let’s give these makers an “atta-boy”.

SQL Server Staging Tables – Truncate versus Delete

I’ve been reading a lot of books on SSIS (SQL Server Integration Services) and BI (Business Intelligence) over the course of the year. I want to pass along a little tidbit I haven’t seen in any of them. I’ll preface this by stating our staging tables and data warehouse are all in SQL Server 2005.

Our process is probably similar to others, we pull the data in, and if the warehouse needs to be updated we place the data into a staging table. At the end of the process we do a mass update (via a SQL statement) from the staging table to the main data warehouse tables we use for reporting. Then we delete the records in the staging table. Which seemed like a reasonable thing to do, but wound up getting us in a lot of trouble. Over the course of the last few months our run times for the SSIS job have gotten slower and slower and sloooooooooooooower. Our job was taking as long as 50 minutes to complete sometimes. One of our developers noticed the database seemed to be taking up a lot of space. He found a simple select count(*) was taking eight minutes on what was supposed to be an empty staging table.

Some research on the web explained what we were doing wrong. In one of my favorite SQL Server blogs, I want some Moore, blogger Mladen Prajdic has a great article on the differences between delete and truncate.

http://weblogs.sqlteam.com/mladenp/archive/2007/10/03/SQL-Server-Why-is-TRUNCATE-TABLE-a-DDL-and-not.aspx

The solution then was to not perform a delete, but a truncate on our staging tables. We went ahead and manually issued a truncate on our staging tables, and saw an immediate beneift. Our average run time went from 50 minutes to 8 minutes!

I’m not sure why I haven’t seen this mentioned before, perhaps I just haven’t read the right blog or book yet. But I wanted to pass this along so you could be spared some of the headaches we went through. If your SSIS uses SQL Server 2005 tables, use a truncate and not a delete to avoid speed issues. Alternatively, at least make sure to run truncates on a regular basis to keep those staging areas cleaned out!

ITAC Lunch and Learn – Dec 4th

My friend and co-worker, Jeff W. Barnes, MVP will be speaking on Tuesday December the 4th at the Emmet O’Neal Library during lunch. His topic will be “The Future of .Net Development” which sounds pretty interesting. Come on out, here a good presentation and grab some lunch.

For more info, including registration info, see Jeff’s blog entry at http://jeffbarnes.net/portal/blogs/jeff_barnes/archive/2007/11/27/itac-lunch-and-learn-for-net-on-dec-4th.aspx

See ya’ll there!