Arcane Recommendation: Coding Horror

I’m on the road again, so sporadic posts this week, but wanted to recommend something to you. I’m a big fan of Jeff Atwood’s Coding Horror site, http://www.codinghorror.com. Jeff has some really great insights into the coding process.

Recently Jeff was a guest on a great podcast, Dot Net Rocks. May I suggest it’d be well worth your time to listen to episode 232 (http://www.dotnetrocks.com/default.aspx?showNum=232)? Jeff has some great insights, and some great lines as well. I intend to expound on a few of these, so consider this a little “homework” for my upcoming post.

IE Developer Toolbar Released!

After a long beta, Microsoft has released the IE Developer Toolbar. This toolbar allows you to look at the DOM (Document Object Model) in depth. You can delve into the CSS in detail as well. Take a look:

[Picture of IE with toolbar activated]

First you need to install the toolbar, you can download it from http://www.microsoft.com/downloads/details.aspx?FamilyId=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en or http://shrinkster.com/ozm.

After installing, launch IE, I’m using IE7. Select Tools, Toolbars, Explorer Bar, IE Developer Toolbar to open the toolbar inside IE. You’ll see more features than I can cover here, just start playing with a webpage.

Here I’ve got this blog open, and clicked on a header element in the DOM tree. You can see a blue outline at the top of the picture (look at the dark blue next to “Arcane Code”). That’s the IE Dev Toolbar highlighting the element you just clicked on.

If you are doing serious ASP.Net development, this tool will be invaluable for working out the coding to make your website look it’s best. And it’s free, so you’ve got no excuses!

Arcane Software: TouchCursor – For us keyboard geeks!

I hate to sound like an advertisement, but I recently found some software that absolutely rocks and I just have to share. I have to confess that I’m a “keyboard freak”. I hate having to take my hands off the keyboard, so much so that I bought a Lenovo keyboard with the touchpoint mouse cursor to use on my desktop, just like what you’d find on an IBM Thinkpad.

Now I’ve found some software that even further reduces the number of times I have to move my hands away from the home position to reach for those awkward keys, such as the cursor keys. It’s called TouchCursor, available at http://touchcursor.com.

What they do is use your space bar like another shift / ctrl / alt key. They then combine the space bar with the letter keys to emulate the odd keys like cursor, page up, etc. For example, space bar + I moves up one line. Space bar + K moves back down, space bar + J moves left, and so on. Here’s the default mapping (graphic courtesy of their site):

This is wonderful stuff, no longer do I have to move my hands off the “home” position to move the cursor around. And even better, the software is completely configurable. I can change the key combos to anything I want, and even add new ones.  It also works perfectly with existing key combos like ctrl, shift, and alt. For example, SHIFT + SPACEBAR + L is the same as SHIFT + RIGHT ARROW.

Now, you may think “well what if I have that odd program it doesn’t work right with?” No problem, the software allows you to turn off the functionality for specific applications. For example, I found it behaving a bit oddly with Virtual PC sessions (probably had something to do with both the guest and host OS wanting to look at the keyboard), so I disabled it for Virtual PC and just run it inside the VPC guest. Or you can take the reverse tactic, and only enable it for certain apps.

It really looks like they have thought of everything, all the little tweaks you might want to do with the software are available for you to do. I’ve been testing this with both Vista and XP and it works great on both platforms.

TouchCursor is shareware, you can download a copy and try it out for 30 days with no nag screens or any other crippling feature. The cost is only 20 US Dollars though, well worth the investment (I just sent in my 20!). For your money you get tech support, lifetime upgrades and permission to run on all of your computers. Not to mention the good feeling of helping out a worthwhile product. All that for 20 bucks? Count me in.

This is a really creative solution for increasing productivity at the keyboard. Rarely do I fall in love with a piece of code, but this product has made my very short list of “must have won’t operate a computer without it” software. I highly recommend trying it out, and using it for the full 30 days. It does take a little getting used to, but once you get the hang of it you won’t want to operate a keyboard without it!

Standard disclaimer: I have no financial affiliation with Rare Pebble Software, the folks who make Touch Cursor, other than being a customer. I receive no consideration of any kind for this mention. I just think it’s some awesome software and wanted to share.

PS Sorry for no post yesterday, it was a business travel day and I got home much later than I anticipated.

Arcane Thoughts: Thinking Inside the Box

Today I’m at an offsite meeting, talking about a new project. I won’t get into too many specific details, but we have to pull data from a web service and update an Oracle database. We can use a vendor provided Java API that runs on a Unix box to do the updates, or we can write to the database directly as long as we handle integrity issues.

So we spent the day brainstorming, to come up with possible solutions. Here is the list of contenders:

  • Write a Java app that runs on Unix that uses the vendor API’s.
  • Write a Java app that runs on Unix and updates the database directly.
  • Write a C# app that runs on a Windows Server, where a Batch Scheduler will kick it off.
  • Write a C# app that runs as a Windows Service under XP (we haven’t taken the Vista plunge at work yet).
  • Write a SQL Server Integration Services package that is run by the SQL Server job scheduler. It will use the web service as the input and update Oracle.
  • Use one of the above methods to pull the data then let BizTalk process it from there.

We haven’t made a decision yet, and my point was not so much to talk about the pro’s and cons of each solution. Instead it’s to get you to think creatively when it comes to new solutions for your company. Sitting down and cranking out yet another C# or VB.Net app may not always be the best approach. You may have a task you can accomplish with less code by using SQL Server Integration Services. Or maybe BizTalk might fit the bill.

All too often as programmers our first answer to any solution is to pull up Visual Studio and start grinding out code. Take some time though, to explore a few other options. There’s a rich set of tools out there, and sometimes the best solution to a programming problem may not be programming.

Orcas and SQL Server Compact Edition

The new beta of Orcas (the next version of Visual Studio) is now out. You can download it either as an installer or as a Virtual PC image. I opted to download the VPC image (I would have put it in a VPC anyway, so why not save some work?).

The main info page for Orcas is at http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx or http://shrinkster.com/oqp. From there you can pick the download type you want. As I mentioned before, there’s an installer version and the VPC version. If you have a spare machine lying around, you can use the installer, otherwise I highly recommend the Virtual PC version. (I grabbed the Visual Studio Team Suite Only – VPC).

It’s very very VERY important you completely read the instructions. Did I mention it was important to read the instructions? Well in case I didn’t, be sure to read the instructions.

There’s actual two VPC images you have to download. The first is named Orcas, the second though is called BASE (it’s in an exe). When you run the Orcas VPC the first time, it will ask you to point to the base VPC. In addition, you will need to know the user id and password to login, both available on the download page and buried in the instructions. (See, I told you it was important to read the instructions!)

Like most people playing with Orcas, the first thing I did was tested what I already knew. In this case, I loaded in some of the SQL Server Compact Edition samples I’ve published here in the past few weeks. Most notably the code in my post on April 13th (http://shrinkster.com/oqq).

In some ways I wish I had a lot of new technical content to share with you. Harrowing tales of how I was able to fight the bugs and to conquer the evil things lurking in Orcas. But I can’t. It just worked. And, I’m happy to say worked without any flaws. I didn’t have to install any special add-ins (Orcas comes with SSCE assemblies preinstalled) or make special references.

I’ll keep playing with it, but for now I’m quite happy to report that while I don’t see any radical changes with SSCE in Orcas, I don’t see any issues so far either.

Arcane Thoughts: Honorable Mentions

In reflecting on Friday’s post, I realized there are a few people who I consider “heroes” in the tech world, but aren’t programmers (or at least it’s not what they are primarily known for). I thought they deserved a mention, hence today’s post.

Leo Laporte

You may remember Leo from the MSNBC, then TechTV channels doing shows like Call for Help and The Screen Savers. Today Leo runs the successful TWIT Podcast network (http://twit.tv), producing many helpful shows on the state of the tech industry. His relaxed but informative style is a pleasure to listen to.

Patrick Norton

Patrick was Leo’s co-host on The Screen Savers. This guy knows hardware. Today he still has a TV show, only you can download it and watch it at your leisure. At DL.TV (http://dl.tv/) Patrick, with co-host Robert Herron puts out a bi-weekly show reminiscent of the Screen Saver days. They look at the latest tech, answer viewer questions, and provide useful info.

Steve Gibson

What a treasure Steve is. Each week he and Leo have a show on the TWIT network called Security Now (http://www.twit.tv/SN). I have learned so much about the way networks work, ways to secure your computer against attacks, each week it’s like attending a doctorate level course in networking and security.

If his name sounds familiar, Steve is the same Gibson of Gibson Research Corporation (http://www.grc.com), the guys who do Sheild’s Up (for testing your computer’s security) and SpinRite, the disk recovery tool.

And there you go, a few guys who deserve a mention for their contributions to the tech community.

Arcane Thoughts: Programming Heroes

When Jeff Atwood was on DotNetRocks recently, he mentioned his programming heroes. It got me to thinking back on some of my own heroes, and thought what the heck. So if you’ll indulge me as I head down memory lane…

My Dad

I guess my earliest hero was my own dad, Ron. He brought home a TRS-80 Model 1 when I was around 12. He wrote a little Star Wars game on it (all ASCII graphics) in BASIC. His downfall was letting me, an clueless kid and geek in the making get his hands on a 2000 dollar (US) computer to play the game.

And not just that, but letting me go in and look at the source! I wound up having more fun tinkering with the source code than playing the game. Primarily I hacked it to make it harder for my sister to win. 😉 But it set me down the path of software development, and so for being crazy enough to let a 12 year old kid put his hands on one of the earliest of the home computers, Dad makes my first coding hero.

Mark Westbrook

I mention Mark’s full name in hopes he’ll find this and give me a shout out. I knew Mark when we lived in southeast Alabama together, he was the first guy I ever met who was really passionate about programming. He ate, sleep, and drank computers. His house was just a place to keep his computer, an IBM PCjr.

Mark was the guy who reinforced my belief in software as a craft, an art form, and not just a 9 to 5 job. To say he was an enthusiast was something of an understatement.

Ethan Winer

For those who don’t remember Ethan (http://www.ethanwiner.com/index.htm), you may recall his company Crescent Software. Crescent made all sorts of really cool libraries to work with QuickBasic. His stuff rocked, and made it possible to do really serious (and cool) things with QuickBasic. I remember writing several TSR (Terminate and Stay Resident) programs with one of his libraries.

Dan Appleman

Most people include Dan Appleman because of his Win32 API book for VB Coders, but for me it was his book “Developing ActiveX Components With Visual Basic 5.0: A Guide to the Perplexed” which put him into the hero category. It was after reading this book I felt like I’d turned the corner into true understanding of a lot of the guts behind VB and COM.

Carl Franklin

Back in the early days of VB there was one place to go for all your really good VB Tips: Carl & Gary’s. My memory is a little foggy, but about the time I found the site Gary took a sabbatical and Carl picked up the bulk of the work. (I don’t have anything against Gary, he just wasn’t around.) At any rate, I learned so much and got so many cool coding tidbits Carl makes the list as one of my early heroes.

Dan Fox

Dan Fox wrote a book called Pure Visual Basic (http://shrinkster.com/opa), back in the VB6 days. This was a great book, because it contained everything you needed to know to write professional level applications. It was great both for teaching and as a reference.

I used it to teach a series of VB6 classes that started at the basics and went all the way through to advanced topics, and for the entire series Dan’s book was all I needed. At work, I used it as a reference to look up the “how to” for those things I didn’t do on a daily basis.

Bill Vaughn

No list would be complete without the original database Hitchhiker, William R. “Bill” Vaughn. His books over the years have taught me and many others the ins and outs of programming against the database, primarily SQL Server. His early works combined with his current (and fabulous) version of the Hitchhiker guide and SQL Server Compact Edition E-Book make Bill a hero, and a good transition from my early heroes to my current ones.

Deborah Kurata

Much like Bill, Deborah has been around a little while writing books since the VB5 days. She has turned out many books on objects, and still continues with one of my favorites, her “Best Kept Secrets of .Net’ book (http://shrinkster.com/oph). I’ve also heard her speak at conferences, and was impressed with her depth of knowledge and instructional capability.

Carl Franklin and Richard Campbell

Carl gets to make the list twice, this time with his cohort Richard Campbell. Their work on Dot Net Rocks (http://www.dotnetrocks.com) has taught me an incredible amount on the .Net world. I also have to get shout outs to Rory Blyth and Mark Dunn, Carl’s earlier co-hosts, as I’ve been working through the older shows. When I started listening though, Richard had taken the co-host helm.

Through the podcasts I’ve been exposed to so much good info, and gotten to do it while stuck in traffic or stopping at my local grocery store. Great job guys!

Mark Miller

My final, and most current coding hero is Developer Express’ head of developer tools, Mark Miller. I first saw Mark at VSLive in Orlando. He wasn’t just enjoying himself, he was excited about writing code. Not since my old friend, the afore mentioned Mark Westbrook have I seen anyone that passionate about writing code! (Maybe it’s something about the name Mark?)

His presentation was also one of the more useful I’ve ever seen, it was on practical ways to measure the user experience. Measuring the number of twips a mouse had to move to click various user elements, for example.

After the show I went and watched him at the DevExpress booth, and wound up standing for an hour watching Mark and his coworker (can’t recall if it was Julian or Dustin, sorry) interact with the crowd.

Again, Mark’s enthusiasm continued, you could tell he was thrilled to be there demoing CodeRush and cranking out code. It was his enthusiasm that rekindled my own tech interests, and led me down my current career path. I became inspired to start blogging, and speaking at code camps and user groups.

And there you go

There’s my list, starting in my youth and working toward today. I thank you for indulging me in my trip down memory lane, and hope it brought up some fond memories for you as well. As for tomorrow’s heroes, who knows? Maybe it’ll be you.

Arcane Review: Don’t Make Me Think

I just completed Steve Krug’s classic “Don’t Make Me Think!” book on web usability. (http://shrinkster.com/onw to see it on Amazon.) This was actually his second edition, published in 2005, a follow up from the original done in 2000.

I thought this was a nice fit with an earlier book I read called “Why Software Sucks” (see my review at http://shrinkster.com/onx). In “Why Software Sucks” the author concentrated on bad web sites / software, what was wrong, and how you could demand it become better.

In contrast, Steve Krug looks primarily at good, well designed sites (although he does throw in a few bad ones for comparison purposes). “Don’t Make Me Think” is written from the developer’s point of view, and shows what works. More importantly, Krug explains why a particular design works. That kind of insight was well worth the cover price alone.

But even better, Krug covers the concept of usability testing, and explains how you can do usability testing on your own website at little cost (or even no cost if you have a few friends and family members you can victimize!). If the insights I mentioned previously weren’t worth the cost then this one chapter alone, with it’s scripts and suggestions, certainly justify it.

Finally, this book was a quick, enjoyable read. Right around 200 pages and many, many illustrations made this a fast book. Steve Krug’s humor and writing style made it an enjoyable way to spend an evening or two, and I even managed to learn something in the process.

Standard disclaimer, I make no money off sales of the book, yada yada yada. Just thought it was a good read.

SQL Server Compact Edition To Be Shipped With Windows Mobile 6.0!

I was relaxing Monday evening, watching some of Channel 9 videos I’d downloaded (yeah, I know, but I really do find it relaxing). In this video on Windows Mobile 6: http://channel9.msdn.com/Showpost.aspx?postid=303900 Rory is interviewing Mel Sampat who showed off some cool stuff with Windows Mobile 6.0.

One of the coolest things is that WM6 includes both SQL Server Compact Edition and .Net Compact Framework 2.0. What this means for you as a developer is that you don’t have to worry about deploying all the SSCE plumbing. How sweet will that be!

They also demoed some cool voice capabilities that you have to see. Very very awesome.

Now if they’d just hurry up and release Windows Mobile 6!!

The New Yankee Programmer

I don’t watch much TV. By “watch” I mean step away from the computer and turn on the big screen and stare at it without interruptions. By “much” I mean 3.5 hours a week. 1.5 hours is basically one long show, the This Old House / Ask This Old House / New Yankee Workshop block my local PBS station shows on Saturday afternoon. (Although thanks to my DVR it’s usually Saturday night when I watch.)

Of the three I think The New Yankee Workshop is probably my favorite. For those unfamiliar with the show, each week master carpenter Norm Abram takes on a new wood working project that is both beautiful and functional. Some of the things he says though lead me to believe that Norm Abram would make a great programmer.

“…as you can see in the prototype…”

Norm starts every episode with a prototype piece. He uses it to work out the kinks of the project he’s building. He refers to the prototype while he builds the main project, shows you what he did. How much better could your programming project be if you created a prototype before starting your main project.

“…this stain really makes the details pop out…”

Norm understands that so many times it’s the small details that make the difference in the success of your project. I can’t tell you the number of times I go use an app and try to tab to the next field and instead my cursor jumps elsewhere. Small oversights like not setting correct tab order can really make an impact on how your application is perceived.

“…while the glue dries, I’ll work on the lower half…”

Norm’s great at multitasking. When he gets to a point where he has to stop working on something, he has something else ready for his attention. How often have you gotten stuck, waiting on a DBA to make a change, or someone to supply critical information? Always have a backup plan, something else you are ready to work on while you wait.

“…for now I’ll just dry fit these pieces…”

Frequently during the project development Norm will fit the pieces together, without glue, just to be sure they are going to fit together. In the software world this clearly parallels the concept of continuous integration. Check in your code regularly, do daily (if not more often) builds to make sure everything will fit together.

“…here in my well equipped workshop.”

Norm has tools. A lot of tools. He’s got a huge drawer with nothing but routers! The point is, he uses the right tool for the job. Make sure your coding toolbox is well equipped. I don’t know any .Net coder who can use just Visual Studio to get his job done. Check out add-ins, third party components, etc. to make sure your toolbox is full.

“…we’ll make the cut using our home made jig.”

When Norm can’t buy the tool he needs, he builds it. Over the years he’s shown how to build many types of jigs in his workshop. If you can’t find an add-in or control that does what you want, build your own. Take time to learn how to write macros, Visual Studio Add-Ins, or your own reusable controls and code libraries. Like Norm you’ll use these tools over and over.

“Be sure to read, understand and follow the safety instructions that come with your power tools…”

Norm starts each show with the classic warning to be careful. Visual Studio is one of, if not the most powerful programming tools around. Take some time to learn how to use it. Spend an afternoon and go through all the menus. Use online help to look up the commands you aren’t familiar with. You’ll save yourself a lot of effort by investing a few minutes in learning the commands available to you.

“And remember, there’s no more important safety rule than to wear these, safety glasses.”

Norm reminds us each week of the importance of safety. While I’m not likely to cut off a finger or poke out an eye using a mouse, it is important to remember to use your computer safely. Take breaks about once an hour. Get up and move around. Save your eyes, look up from your monitor, glance out a window. Flex your hands, move them around.

I don’t know how many times I’ve been doing some heads down coding, not realizing 3 hours had flown by until I took that sip of cold coffee (yuck!). Not good though, my back gets stiff and eyes get tired. Listen to Norm, wear your safety glasses.

Norm Abrams, New Yankee Programmer

Each week Norm uses his creative skills to craft a beautiful, yet functional item out of wood. As developers, we (hopefully) craft (and I do think coding is a craft) beautiful yet functional applications for people to use. Norm would have made a great programmer. I’m just glad he sticks to wood working, I don’t think I could handle the competition.

Arcane Thoughts: Tips for Daily Blogging

Last Thursday I wrote a post on The Benefits of Blogging, which has turned out to be quite popular. One of the comments mentioned how easily you can become overwhelmed trying to create posts daily. I thought I might share a few of the tips that I’ve picked up to make life easier.

Use tools

I use a variety of tools to create my blog. My first pass is done in Microsoft Word. By using an editor I can keep copies of my blog posts locally, should something happen with my blog. (Backups are always a good thing.)

I then use a posting tool to help with the pushing of my entry to the site. Currently I’m using Microsoft Live Writer Beta (http://get.live.com/betas/writer_betas). I cut and paste what I’ve done in Word over to it, and add in embellishments such as graphics or additional HTML. I can swap back and forth between presentation view and html easily.

To do my graphics I use two tools, WinSnap and Paint.Net. I’ve already blogged about WinSnap (http://shrinkster.com/oif), and you can get Paint.Net at http://www.getpaint.net/index2.html. Both of these are free tools.

Finally, if you plan to paste Visual Studio code samples into your blog, an indispensible tool is the “Copy As Html” add-in. I’ve blogged about this as well at http://shrinkster.com/oig.

Write in advance

Using the tools above also allows me to write my articles in advance. Often I’ll pick one or two evenings a week or a quiet Sunday afternoon, and write several articles at once, then post them as each day arrives.

This allows me to take a little bit of the daily stress off, as I don’t have to worry about a post every day. Second, it allows me to write a series of posts much more coherently. You can break large subjects up over multiple days, which means you avoid posts that are too big and won’t overwhelm either your readers or yourself.

Obviously there are times or blogs who are not suited to this. Daily tech news sites, for example. But for most of us, having a week or so worth of posts ready to go is a reasonable balance to achieve.

Write Now. And Later!

Another benefit to writing in advance is that it gives you time to review what you’ve done. You can write the post, then walk away for a bit, several hours at least if not days. Once you’ve had that break, you can come back and re-read what you’ve created. Make sure it still makes sense.

There have been many times I’ve gone back and revised entries I’d written several days earlier, prior to posting. I think it only makes your writing stronger when you can have a break so you can look at your creation with fresh eyes.

Use a Reviewer

When I’ve written something I’m not sure about, or have an especially long piece I want checked for accuracy and consistency, I will ask one of my co-workers or on-line friends to act as a reviewer or editor. I’ll e-mail them the post, and let them make comments. I’ll then incorporate their feedback into the post.

It’s important though to select someone who you have a good relationship with, someone who will give you honest feedback. One way to get good feedback is to use a technique I picked up in Toastmasters: Ask the person what three areas could use improvement, and what three areas did you get right. People aren’t so reluctant to criticize when they know they will also be able to say something positive.

It’s also important to pick someone who is knowledgeable enough about the subject to be able to provide worthwhile feedback. I recently did a series on SQL Server Compact Edition in C#. A coworker, who is good with C# and SQL Server but new to SQL Server Compact Edition, was a great choice to act as a reviewer. In contrast my lovely wife, who is good with computers but doesn’t know a thing about C# or SQL Server, would not have been able to provide the quality of feedback I needed.

Use Illustrations

While not every post is a good fit for a graphic of some sort, many can benefit by having a simple picture or code snippet included. These are pleasing to the eye of the reader. Be careful not to make them so big they dominate the page though, unless you actually need them to (such as in a ‘step by step’ set of instructions).

Use Categories (Tags)

Most blogging tools I know of allow you to add tags or categories to your posts. Use them! And don’t be afraid to use a lot of them, you never know how your readers will need to find the information you are providing.

Additionally, it makes it easier to help others who are interested in a particular topic. Remember the point I made about mentoring in my benefits article? I’ve been surprised at how many times I’ve said “just got to my blog and look at my posts under the XYZ category.”

Be Flexible

Sometimes you need to be able to change what you had originally planned to post. Perhaps some company makes a new announcement you feel the need to respond to. Or perhaps a comment on your blog inspires thought, such as this post. I originally had another post ready for today, but when I read a comment made last night inspiration struck, and this post came to life.

Set Reasonable Goals

My final piece of advice is to set a reasonable posting goal. For me, for various reasons one post per weekday seemed a reasonable goal. You will notice I don’t usually post on the weekends or holidays, to give myself some time off.

Your life though is not mine. You may find three times a week to be enough, or even just once a week. It’s important though to set a goal and stick with it, make it a commitment, just as if it were a job. Just be careful not to set your goal too high, or else you’ll wind up burning out and growing to hate or resent your own blog. Consistency though is the key, again select a goal and stick with it.

Well there you go, a few of the techniques I use that allow me to keep up the pace of daily blogging. Please feel free to leave a comment below with your own tips and tricks.

Arcane Events: Upcoming Tech Events in the Birmingham AL Area

Today we’re having a big staff meeting at work, and the organizers are graciously allowing me to mention some of the upcoming tech events happening in the Birmingham, Alabama area. I’m also providing this info here, so everyone can benefit.

Tech Birmingham’s (http://www.techbirmingham.com/) Tech Mixer (http://www.techmixer.org) is the huge gathering for anyone in the local tech industry. Vendors, user groups, geeks, and nerds of every type will descend upon the McWane Center in downtown Birmingham on May 1st. Entry and parking is free, go to the third floor entrance on the parking deck. If you pre-register you will be eligible for a special door prize, so jump online now it’s quick and easy.

https://www.itsbits.com/TechMixer/Default.aspx

The Birmingham Software Developers Association (BSDA) meets the second Thursday of every month at 6:30 pm. The BSDA meets in the computer center of Virginia Tech college, which is located on the backside of the Palisades shopping center in Homewood. While most of the club presentations are Microsoft centric, we do stray into other areas from time to time. For more info go to the club website at http://www.bsda.info/

The Birmingham Dot Net User Group (Bug.Net) meets the second Tuesday of every month, also at 6:30. With a heavy emphasis on Microsoft dot Net development, the club meets in the CTS offices in Riverchase. Details and directions can be found at http://www.bugdotnet.com/

So you say night meetings are hard for you to attend? Well for the lunch time crowd there’s the Internet Professional Society of Alabama, or IPSA. Meeting at St Vincent’s Bruno Conference Center, IPSA meets once a month to discuss internet development, and they’re even sponsored by Alabama Power! See the club site at http://ipsaonline.org/ for meeting times and directions.

These are just a few of the groups in the Birmingham Area. There are user groups for Linux, Oracle, DB2, Perl, Java, Ruby, and much, much more. See a complete list at http://shrinkster.com/oe1.

Whatever your interest is, there’s a tech group for you. Just do a google on “user group” and the name of your town and I bet you’ll find a match.

Arcane Thoughts: Benefits of Blogging

This week marks six months of serious blogging for me. Nearly every weekday I’ve tried to provide some new piece of information. A couple of important milestones have been achieved, as well. Last week this blog rolled over 50,000 hits, and also got its first day with over 1000 hits in a single day.

To celebrate I decided to give the blog a little face lift, and picked a new look. I thought all the blue looked somewhat Microsoftish. I also liked the 3 column look.

Over the past months I’ve been surprised, pleasantly, by some unexpected benefits to keeping up this blog. I thought I’d share some of them with you, should you decide to take the plunge.

Meet and Greet

Through the blog I’ve met some interesting new people, and it’s made a good tool for introducing myself to others.

Self Documenting

I’m sure you’ve heard the notion that well written source code is self documenting. Well this blog has let me document a lot of the things I’ve done in the past, so I can go back and reference it later. Not unlike a personal wiki.

Self Promotion

Like most folks I have an exaggerated sense of self importance. Blogging just reinforces my narcissistic streak and inflates my ego even further. Seriously, if you have an interest in writing, speaking, etc., a blog serves as an important tool in promoting your skills and desires to others.

Mentoring

I guess the biggest surprise has been the ability to use the blog as a mentoring tool. When someone asks a question, it’s been great to be able to say “oh yeah, I wrote a post about that on such and such date, go take a look”. A real time saver too, and it means I don’t overlook telling someone a critical piece of information.

Education

OK, I admit it, some days I’m just blocked. Not a clue what I want to write about. On those days I pull a book off the shelf, open to a random page, and read something. Try some code, and next thing you know I have a post, and I’ve managed to learn something new in the process.

Giving Back

Finally, but I think most importantly, blogging gives me a chance to give back. I’ve learned so much by reading the contributions of others, I feel an obligation to “pay it forward” (so to speak).

Well, what can I say? It’s been a lot of work, but a lot of fun as well, and quite an education to boot.. Thanks for the nice comments and the visits, I look forward to see what the future has in store.

SQL Server 2005 Compact Edition – Important Component

In my post on Getting Started with SQL Server ( http://shrinkster.com/nsk ), I mentioned 3 things you need. SQL Server CE, Visual Studio 2005 SP 1, and the SQL Server CE Books on Line. As it turns out there’s an important fourth item.

The missing component is the “Microsoft SQL Server Compact Edition Tools for Visual Studio 2005 Service Pack 1”, available at http://www.microsoft.com/downloads/details.aspx?familyid=877C0ADC-0347-4A47-B842-58FB71D159AC&displaylang=en or http://shrinkster.com/oam .

This service pack fixes a few things using SSCE with VS, one of them I consider critical. When you do a Project, References from VS, in the .Net list you will now be able to find a selection for System.Data.SqlServerCe.

Second, all of the Create Database dialogs now correctly read “SQL Server Compact Edition” instead of “SQL Server Mobile”. It also updates device CAB files correctly and includes new features such as Click Once support.

This should be installed fourth in your list, so if you’ve already done the other components, you are good to go for installing this. To recap:

  1. Install SQL Server Compact Edition components. (http://shrinkster.com/l9f).
  2. Install Visual Studio Service Pack 1. (http://shrinkster.com/lel )
  3. Install SQL Server CE Books On-line. ( http://shrinkster.com/lem )
  4. Install SSCE for VS SP1, as I’ve described here. ( http://shrinkster.com/oam).

A special thanks to Doug Tunure, our regional MS Developer Evangelist who helped me communicate with the SSCE team to figure out what was missing, and thanks to the SSCE team for a great tool.

System Views in SQL Server Compact Edition: Provider Types

The last view we’ll discuss is the INFORMATION_SCHEMA.PROVIDER_TYPES. Strictly speaking, this does not provide a view into your particular database, but into SQL Server Compact Edition. As such, it probably won’t be very useful in day to day queries into the database.

What it may be useful for is in automating database code generation. This table lists all of the valid database types that SQL Server CE supports. Presumably if Microsoft chooses to add new data types to SSCE they will show up here.

Let’s take a look at the query that’ll return some useful info, and what each field means.

select type_name, data_type, column_size,

       literal_prefix, literal_suffix,

       is_nullable, case_sensitive,

       unsigned_attribute, fixed_prec_scale,

       minimum_scale, maximum_scale, is_fixedlength

 from information_schema.provider_types

 

type_name contains the list of valid datatypes, such as int, real, nvarchar, etc.

data_type contains a numeric representation of the type of data stored in the field. Note this is not unique, for example nchar and nvarchar, and ntext all have the same data_type of 130.

Column_size indicates the max size for a data_type.

Literal_prefix / literal_suffix indicates what you should use to wrap a literal value. This is probably one of the more useful items in this table. Let’s say you have a static text value you want to insert into a SQL statement, perhaps a system name such as the word arcanecode.com. Looking up the literal_prefix for a ntext item I see that it is N’ (the letter N followed by a single quote). The literal_suffix is just a single quote mark, so to include in a SQL statement I’d need to put N’arcanecode.com’ .

Is_nullable is obvious, a 1 indicates the field is allowed to hold null values, a 0 means it can’t. As of this writing, all the field types in SSCE are nullable.

Case_sensitive is similar, 1 shows the field is case sensitive, 0 not. Again, as of this writing none of the fields in SSCE are case sensitive.

Unsigned_attribute is null for non-numeric type, but for numbers a 1indicates the data_type is unsigned only (i.e. no negative values allowed). A 0 indicates negative values are valid.

Fixed_prec_scale is another Boolean field. A 1 indicates the precision (the number of positions after the decimal point) is fixed. A 0 indicates you can change the precision.

Minimum_scale, maximum_scale is tied to the fixed_prec_scale. For items like int’s where the precision is always the same, this is null. However on numerics the user (i.e. you) can set the scale, and these fields indicate the valid range.

Is_fixedlength is a Boolean that flags whether the data_types length is fixed. For numerics this is going to be 1 (true), and for most text types this is 0 (false).

If nothing else this table makes a great quick reference. Since SSCE only supports a subset of the SQL Server data types, it’s handy to have a place to see which types are supported.

In your application, you could use this to build code generators or build SQL statements to create new databases. For example you could use it to look up the prefix / suffix types for a data_type.

And there you go, this completes a week long look at the various views built into SQL Server 2005 Compact Edition, and how you can use them within your applications.