Arcane Thoughts: The Fourth Estate

Over the weekend I’ve been continuing to think about what I wrote Friday. In looking over other opinions on the web, I see a lot of folks who seem to want to blur the distinction between bloggers and journalists. This is dangerous. Let me say this once, and clearly so everyone can understand.

BLOGGERS ARE NOT JOURNALISTS.

Journalists are paid for their words. It’s their job. What they say reflects not only on them but upon the organization for which they work. When you go to the website of a major newspaper, often you don’t even know or care who it is that wrote the story you read. The paper as a whole carries a reputation, a credibility.

That’s why there are so many standards when it comes to journalistic ethics, and rightly so. An organization is responsible for all of the people who write for it, and one bad apple can spoil it for everyone. Remember Jayson Blair? He made up or outright stole stories that went to the New York Times. The entire paper’s credibility suffered. (see http://en.wikipedia.org/wiki/Jayson_Blair)

On the other hand, I as a blogger stand alone. My words are just that, mine. My blog is not affiliated with anyone else’s, and if I say something outrageous only I will suffer. Likewise, if I do something wrong such as libel someone, only I will be responsible for the consequences, not my coworkers and not my company.

Nor do I get paid for my words. Granted I hope to recoup my time investment some day, perhaps through notoriety, writing magazine or book articles, or public speaking engagements. But for now, my only reward is the satisfaction that comes from (hopefully) helping others with my blog entries. Thus, bloggers should be held to a totally different standard.

Of course we muddy the waters some with the corporate bloggers, those companies who have one or more individuals blogging, and that blog represents the company. Don’t get me wrong, I love the concept of a corporate blog. It’s a great way to communicate with your customer base. But just as no two companies are the same, it’s impossible to set one standard for all corporate bloggers. What would be appropriate for Billy Bob’s Beer and Bait might be totally inappropriate for Fred’s Fine Wines. Each company needs to decide for itself what standards it’s corporate bloggers need to uphold.

There’s also the rare coincidence where you have a journalist who blogs, someone like Mike Cassidy (http://www.mercextra.com/blogs/cassidy/). In those cases, unless it is clear the blog is a personal one, and not professional, as far as I’m concerned the blog entry is no different from an article that appears in the printed paper. The person is acting as a journalist, and thus should be held to the journalistic standard.

Finally, I have seen a few instances where a blogger claimed some sort of legal protection, claiming to be a journalist. Most notable is Josh Wolf, who took some video of an anarchist protest and now refuses to turn over his raw footage to a grand jury. He’s now in jail for contempt of court. Let me say up front I admire Josh Wolf, it takes a lot of guts to be willing to go to jail for something you believe in. That said though, I have to disagree with his conclusions.

I said it before, but let me reiterate in case you weren’t paying attention:

BLOGGERS ARE NOT JOURNALISTS.

When Mr. Wolf took the video, he was not representing any news organization, nor at the time did he sell it to a news outlet, he instead posted it on his personal blog. He was a private citizen, using his first amendment rights to express a viewpoint. He happened to choose a blog to do it on, but he could just have easily stood on the street corner and played it on his portable TV. From the standpoint of his personal, first amendment rights there is no difference.

My blog is merely a medium for expressing my thoughts and creations. You could read these words on printed paper, say a magazine, or on the bathroom wall. I could yell them at you from a soapbox, or you could read them right here on your computer screen. No matter what the medium, the result is the same. I’m a private citizen, expressing my views, not a journalist.

Those are my arcane thoughts, feel free to leave yours…

Arcane Thoughts: Do you trust me?

I’ve been watching an interesting debate between Scoble and Joel on the recent giveaway of Vista loaded laptops to bloggers. (No, I didn’t get one, dang it.) First, let me see if I can summarize their opinions, with apologies to both gentleman if I over simplify.

Scoble’s most recent posting on the subject can be found at http://scobleizer.com/2007/01/02/why-bash-microsoft-and-not-nokia/. His basic position is that it’s acceptable for bloggers to accept items from companies as long as there is full disclosure.

Joel in his posting at http://www.joelonsoftware.com/items/2006/12/28.html has the position that by accepting any item we destroy any credibility and lose trust with our readers.

As a relatively new blogger, I’ve spent a lot of time over the last few days thinking about both viewpoints. And while an admirer of his work I have come to a conclusion.

Joel is wrong.

Trust and credibility are something a blogger builds with his readership over time. Scoble is a perfect example of this. Microsoft paid his salary for many years, yet he still managed to gain an enormous amount of respect in the blogging community. Why?

Simply put, Scoble’s posts about the company he worked for rang true. Readers trusted him when he wrote something good about Microsoft, because he also wrote when Microsoft did bad things. Additionally, his experiences were reflected in the user community, who could hold his feet to the fire through comments. Finally, and most importantly, Scoble quickly and openly admits when he is wrong, publicly correcting his mistakes.

For a blogger who is willing to accept hardware / software, whether to review or not, his credibility will be born out over time. A blogger who only writes love letters about the things he accepts will soon be found out for the untrustworthy individual they are.

On the other hand, bloggers who are willing to be honest, provide full disclosure, and write negatively when justified, as well as positively (like Scoble did with Microsoft), those bloggers will gain that high level of trust and credibility regardless of whether they accepted freebies or not.

Those are my arcane thoughts, feel free to leave yours…

Outlook and “Macros are Disabled” error

One error some people seem to be getting when trying to run macros in Outlook is: “The macros for this project have been disabled.” It then goes on to tell you to review some help that isn’t very helpful.

The scenario is generally the same, you create your macro and it runs fine, you close Outlook and when you re-enter the macros no longer run. Some blogs suggested lowering your security settings, or signing the thing, but I tried both of these to no avail.  

The only way I was able to solve the problem was to follow these steps:

  1. Copy EVERYTHING out of your VB macro project, into a text file. Save the textfile to your drive. 
  2. Close everything, reboot the computer.
  3. Go to your C:\Documents and settings\<yourusernamehere>\Application Data\Microsoft\Outlook folder.
  4. Either delete the file VBAProject.otm, or (better and safer) rename to VBAProject.old or some similar name.
  5. Open Outlook
  6. Reopen the VB Macro editor
  7. Paste in the code from your text file.

After doing the above, I was able to start running the SaveAttachements macro I blogged about yesterday. From my research, no one is really quite sure why this headache occurs, and why this is the only way to fix it, but it does work. 

Enhancing the Save Attachments Outlook Macro

Update: Feb. 28, 2007: Due to numerous requests I’ve created a branch of this macro that saves attachments for all messages / calendar items, selected or not. To see it, please see my post https://arcanecode.wordpress.com/2007/02/28/saving-all-attachments-in-outlook/ or http://shrinkster.com/mhn. There I have uploaded a new file with both the macro below and the new one that saves all items, selected or not.

Yesterday I blogged about a macro I wrote for my wife to allow her to save attachments for multiple messages in Outlook. After using it today she asked for a few enhancements. First, she wanted to be able to select the directory to save the attachments to. Second, she wanted the macro to detect that a file already existed, and allow her to rename the new file or skip it.

To accomplish the first item, I found a handy routine in a google groups thread. I’ll let you read it for yourself, the code is about half way down in a message by Joe Earnest, and can be found at http://shrinkster.com/l0v. I took Joe’s code and created a function out of it called GetOutputDirectory. I made one enhancement, at the end I make sure the output directory ends in a backslash.

For the second enhancement I used the good old scripting runtime library. Use the Tools, References menu in the VBScript editor and set a reference to the “Microsoft Scripting Runtime”, scrrun.dll. Rather than reposting all the code I’ve put the entire macro in a txt file you can download here: https://arcanecode.com/wp-content/uploads/2007/01/saveattachments2.txt

Here is the heart of the code

fileExists = fso.fileExists(outputDir + outputFile)

Do While fileExists = True
outputFile = InputBox(“The file ” + outputFile _
+ ” already exists in the destination directory of ” _
+ outputDir + “. Please enter a new name, or hit cancel to skip this one file.”, “File Exists”, outputFile)
‘If user hit cancel
If outputFile = “” Then
‘Exit leaving fileexists true. That will be a flag not to write the file
Exit Do
End If
fileExists = fso.fileExists(outputDir + outputFile)
Loop

‘Save it to disk
If fileExists = False Then
att.SaveAsFile (outputDir + outputFile)
AttTotal = AttTotal + 1
End If

As you can see, I check to see if the file exists and store that in a variable. I then enter a loop if the file exists, ask for a new name, then check to see if the new name exists. I stay in the loop as long as it does.

Should the user click the cancel button on the input box, I exit the loop prematurely and use the fileexists as a flag to write or not write the file.

There you go, an enhanced version of the SaveAttachments macro. Take a look at the full file I’ve uploaded, and leave a comment with any questions.

Saving Attachments in Outlook

I spent my new years day recovering from a nasty cold. My wife asked me if there was a way to save the attachments in Microsoft Outlook for multiple messages. I spent a little time and came up with a handy macro, I thought others might find it useful as well.

First, in Outlook click on Tools, Macro, Visual Basic Editor. Now in the editor on the left you’ll see Project. Drill down Project1, Microsoft Office Outlook, ThisOutlookSession, and paste the code below in:

Public Sub SaveAttachments()

‘Note, this assumes you are in the a folder with e-mail messages when you run it.
‘It does not have to be the inbox, simply any folder with e-mail messages

Dim App As New Outlook.Application
Dim Exp As Outlook.Explorer
Dim Sel As Outlook.Selection

Dim AttachmentCnt As Integer
Dim AttTotal As Integer
Dim MsgTotal As Integer

Set Exp = App.ActiveExplorer
Set Sel = Exp.Selection

‘Loop thru each selected item in the inbox
For cnt = 1 To Sel.Count

‘If the e-mail has attachments…
If Sel.Item(cnt).Attachments.Count > 0 Then

MsgTotal = MsgTotal + 1
AttTotal = AttTotal + Sel.Item(cnt).Attachments.Count
‘For each attachment on the message…
For AttachmentCnt = 1 To Sel.Item(cnt).Attachments.Count

‘Get the attachment
Dim att As Attachment
Set att = Sel.Item(cnt).Attachments.Item(AttachmentCnt)
‘Save it to disk
att.SaveAsFile (“C:\Attachments\” + att.FileName)

Next

End If

Next

‘Clean up
Set Sel = Nothing
Set Exp = Nothing
Set App = Nothing

‘Let user know we are done
Dim doneMsg As String
doneMsg = “Completed saving ” + Format$(AttTotal, “#,0″) _
+ ” attachments in ” + Format$(MsgTotal, “#,0″) + ” Messages.”
MsgBox doneMsg, vbOKOnly, “Save Attachments”

Exit Sub

ErrorHandler:

Dim errMsg As String
errMsg = “An error has occurred. Error ” + Err.Number + ” ” _
+ Err.Description

Dim errResult As VbMsgBoxResult
errResult = MsgBox(errMsg, vbAbortRetryIgnore, _
“Error in Save Attachments”)
Select Case errResult

Case vbAbort

Exit Sub

Case vbRetry

Resume

Case vbIgnore

Resume Next

End Select

End Sub

Note some browsers trash the html I tried to do above, so I uploaded it as a text file. Just save to your hard drive and paste into the VBScript Editor or rename the txt to cls and do a File, Import and browse to this file: https://arcanecode.com/wp-content/uploads/2007/01/saveattachments1.txt

And of course save it. Now switch back to Outlook, and click on View, Toolbars, Customize. Click on the Toolbars tab, and click New. I named my new toolbar ArcaneCode, but name yours what you will.

Once you have the new toolbar, click on the Commands tab. Scroll down on the left to Macros and click on it. You should see your new macro in the Commands window on the left. Drag it on to your new toolbar. Now you can shorten the name a little, right click on the tool, to see it’s pop up menu. Go to Name and click on it, then shorten the name to what you want. I then drug my new toolbar up with the rest of my other toolbars.

Two notes, I made it easy on myself and am saving all attachments to C:\Attachments, which I’ve hardcoded in the macro. Feel free to change to what you want or add code to have it ask you for the folder.

Second, I have tested with Outlook 2002 and 2003, but have not tested under 2007. Your milage may vary.

And there you go, a way to save attachments on all the messages you have selected within Outlook.

Happy Holidays

Just wanted to wish everyone a Merry Christmas, Happy Holidays, or whatever your preferred religious observance is at this time of year. Hope you enjoy the festive holiday theme I’ve put on the blog. The old one will return after the holidays. Speaking of returning after the holidays…

Like everyone else in the blogosphere I’ll be taking a few days off to spend time with family and friends. Before I go, I’ll leave you with a link to another wonderful cartoon from George Sfarnas. Merry Christmas!

http://beingfive.blogspot.com/2006/12/curious-georgie.html

Yes Virginia, There Is A Mark Miller

My favorite, all time Visual Studio add-in is DevExpress’s CodeRush. I haven’t had time to do a good blog entry on it, but if you are looking to buy yourself a Christmas gift, this would be an excellent choice. (http://www.devexpress.com/Products/NET/IDETools/CodeRush/Index.xml)

DevExpress’s CTO of developer tools and grand poobah of programming is a C# MVP named Mark Miller. Mark has made many appearances on Dot Net Rocks (http://www.dotnetrocks.com) and DNR TV (http://www.dnrtv.com). His appearances are always informative and educational. He has a unique way of looking at the world that will make you think about programming (and other things) in new ways.

Mark just blogged (http://www.doitwith.net/2006/12/23/ChristmasCancelledAgain.aspx) that he’s got a quick feature he’s adding to the new version of CodeRush, and there’s a possibility it could be ready for Christmas Day.

Yes Virginia, there is a Mark Miller!

UPDATE: I finally got around to writing about CodeRush, you can read it here:

https://arcanecode.wordpress.com/2007/01/09/

Open Command Window Here Power Toy

If you liked the idea of quickly launching command windows, but want the window separate from your explorer shell you should look into Microsoft’s free “Open Command Window Here” Power Toy.

You can find it and other power toys for XP at http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx or http://shrinkster.com/kuy. The description is about halfway down, on the right side of the page are links to the downloads.

If you are a Visual Studio developer, you’d probably like to have a version of this to create a VS Command Window. No problem, Scott Hanselman has created some inf files you can use to create these. Find them on his blog at http://www.hanselman.com/blog/VisualStudioCommandPromptHereAndSearchUnknownFileExtensions.aspx or http://shrinkster.com/kuz.

Coding Standards

Every development organization should have a set of coding standards they follow. A clearly defined, written set of guidelines their developers follow. Things that will make it easier for one developer to read another’s code.

The fine folks at subMain have scored another hit by releasing their coding standards to the general public. (http://submain.com/?nav=products.guidelines) On their site they are now giving away in PDF form a copy of their own corporate coding standards.

I really like their document, as it goes far beyond the traditional “use pascal case” type documents. Their standards document gets into advanced topics such as design patters, security, threading, and even code reviews. It’s applicable to both VB.Net and C#.

While no coding guideline will ever be on the best seller list like Vince Flynn or Richard Marcinko, I found this to be well written and organized. It was easy to find what I wanted, each point laid out distinctly. I do wish there was a little more example code, even if was examples of what not to do. However, I consider that a minor nitpick for an otherwise complete document.

If your company has a standard already, you should check it against the subMain one to ensure you didn’t miss anything. And if you don’t, you should seriously consider the adoption of these standards for your own.

Be sure to check back with them in the January / February 2007 time frame, as Serge (subMain’s President) indicates an update will be available with a rewrite of the Control Naming Guidelines, and possibly some updates to the database section as well.

All in all another great contribution to the .Net community for subMain.

Note I last mentioned subMain on November 27th, writing about their Smart Outliner for VS.Net free add-in. (https://arcanecode.wordpress.com/2006/11/27/vs-add-ins-smartoutline2005/)

Arcane Thoughts: Time Got It Right

In its person of the year, Time Magazine named YOU, the savvy internet user as person of the year. Since the announcement a lot of the pundits and powers that be have been decrying the decision. They instead point to the political players and world leaders as better choices, saying Time weaseled out. Well I’m here to say Time got it right.

This isn’t the first occurrence of Time awarding a group of people the “Person of the Year” award. Back in 1950 Time awarded “G.I. Joe”, or the American Soldier the award. Most akin to this award is 1966 when they gave the title to what they call “Young People”, people under 25 years of age.

Over the last year I’ve seen the growth of what the web refers to as “Social Networking” or “Web 2.0” explode. Words like blog, podcast, and videocast have become common everyday language. Bloggers have risen to the point where they are almost considered journalists. News breaks first in the blogosphere before it hits the traditional media. Your average individual is creating podcasts and / or videocasts using minimal equipment.

The new social networking phenomenon has created it’s own slate of niche superstars. Just look at the popularity of ZeFrank (http://www.zefrank.com/theshow). In the Microsoft .Net arena, Carl Franklin’s Dot Net Rocks show (http://www.dotnetrocks.com) has made him a superstar in the programming world.

Meanwhile, stars from the “old” media have found new homes on the web. Take Leo Laporte for example, formerly of TechTV (before those idiots at G4 bought ‘em out and ruined a great channel) has a new home on the web, http://www.twit.tv. Each week Leo heads a huge list of informative podcasts. And let’s not forget his former co-host Patrick Norton, who now co-hosts a biweekly videocast at DL.TV (http://dl.tv) with Robert Heron. Another TechTV alumnus is Kevin Rose, who has used the whole Social Networking concept to create Digg (http://www.digg.com). Digg has turned Kevin into a rich (or at least well off) man by allowing people to recommend blog posts.

I meet people everyday who just a year ago were clueless as the existence of blogs and podcasts but today are using RSS aggregators like old pros. I can’t tell you why 2006 was special, maybe the world is finally broadband enabled enough, maybe it was just timing. Certainly the popularity of portable media devices such as the iPod, combined with powerful, low cost computers have a great deal to do with it.

Regardless, 2006 was definitely the year the Web and Social Networking took off, and it was YOU, the internet user who made it possible. You have given up your spare time to produce creative content to share, for little or no monetary return. Thanks! Now give yourself a pat on the back.

You can read the entire Time article at http://www.time.com/time/magazine/article/0,9171,1569514,00.html.

Think I got it wrong? Say so, and why! Agree? Leave a comment and stroke my ego.

Installing Ubuntu on VirtualPC Step by Step

Update: October 18, 2007 – Version 7.10 is now out. Complete step by step instructions on installing 7.10 can be found at:
https://arcanecode.wordpress.com/2007/10/18/installing-ubuntu-710-under-virtual-pc-2007/


Update: I’ve now determined how to get Ubuntu 6.10 working on VirtualPC 2007. If you are interested in the latest version, see my new post on February 26th, 2007 at https://arcanecode.wordpress.com/2007/02/26/installing-ubuntu-610-on-virtual-pc-2007-step-by-step/ or http://shrinkster.com/mff. Note there is still value in installing 6.06, as it’s the version of Ubuntu that will have long term support, and thus be the Linux of choice by many corporations. Also note that while the instructions below were written with 6.06 and VirtualPC 2004, the instructions are the same for 6.06 under Virtual PC 2007. So you’ve decided you’d like to try a Linux distribution, but don’t have a computer to dedicate to it. Further you’re understandably reluctant to mess around with your partitions and try and get dual booting to work. No problem, Virtual PC to the rescue.

First, you will need to obtain a copy of a Linux distribution. One of the most popular today is Ubuntu. Ubuntu uses the Gnome desktop for an “Apple like” feel. There’s a variant called Kbuntu which has a much more Windows like look and feel. If you are interested in Mono development (Mono is the open source implementation of the .Net Framework) be aware you will want to use a Gnone desktop, and thus Ubuntu, as my understanding is all of the Mono tools were designed for Gnome.

For this tutorial we’ll be using Ubuntu. To obtain your copy of Ubuntu, simply go to http://www.ubuntu.com , click on the downloads link, and select Ubuntu. I would recommend you use version 6.06, which is the long term supported version. I attempted to use the current version, 6.10, and had major issues with the graphics.

Key Point: Use Version 6.06, not 6.10.

Be aware the image is around 650 Meg in size, so have a good high speed connection. If you are on a dial up, check your newsstands for various Linux magazines. Each month ever one of the Linux magazines comes with a DVD loaded with a variety of distos (Linux speak for distribution).

Once you’ve downloaded the ISO image, you have two choices. First you can simply burn to a CD, using your favorite CD burning software. Make sure you tell it you want to burn from an image, if you just write the ISO file you’ll have a disk with an ISO image, but it will not boot.

Your second choice, the one I’d suggest is to use the Microsoft Virtual CD drive. I blogged about it back on September 13th (https://arcanecode.wordpress.com/2006/09/13/virtualization/ ). Read this post to see how to use it, then jump back here.

Back? Cool. Launch the Virtual CD app, with a drive letter assigned to your Ubuntu image. For this tutorial I’ve mapped my Ubuntu to drive Z.

Now that you have Ubuntu ready, you need to go read my VirtualPC Step by Step post (https://arcanecode.wordpress.com/2006/09/20/virtual-pc-step-by-step/ ). Keep it handy as I will be referring to it frequently for this tutorial.

In Step 1 you are instructed to create a new machine, do so. I’ve named mine “Ubuntu 6.06”. In step 2, you are prompted for your OS. You will need to pick Other. In step 3, you are asked about Ram. Ubuntu will run OK under 256 megs, however if you have the available space I’d suggest upping it to 512, especially if you intend to get into doing some graphics or mono coding.

In step 4 you will want to create a new hard disk, and in step 5 confirm what you’ve selected. OK, now you are up to step 6, installing the OS, which is where this tutorial picks up.

Launch your new Ubuntu 6.06 VPC. (Click on it in the VPC and click Start). When it starts, click on CD, Use physical drive Z: in the menu. In a moment you’ll see a menu that looks like this:

[Ubuntu VPC 1]

Select the “Start Ubuntu in safe graphics mode” option. It’s very important you pick this option, if you take the default “Start or install Ubuntu” you will get garbled graphics under VPC.

OK, now you have watched the Ubuntu screen flash as it loads, now you should see a screen like this:

[Ubuntu VPC 2]

While it looks like it, be aware you have not installed Ubuntu. Instead, you are running in what is known as “Live Mode”. This is a feature that is common to most CD distributions of Linux. In Live Mode you can boot your computer and use a Linux distribution without having to install.

Installing is just what we want to do, and Live Mode makes it easy. By now you’ve probably noticed the big icon that says “Install”. Let’s double click this.

[Ubuntu VPC 3a]

The first thing you are prompted for is the language you want to use. Select the language most comfortable to you, then click Forward.

[Ubuntu VPC 3]

Next you are asked for the city near where you live. You can select your city by either clicking on the map, or selecting from the list. After doing so you will want to set the time, just click on the Set Time… button to do so.

[Ubuntu VPC 5]

In step 3 we are prompted for the keyboard layout. Since my default is already selected, all I have to do is click Forward, otherwise you should pick your layout and click Forward.

[Ubuntu VPC 6]

Now Ubuntu needs to get some personal information. Just your name, what you want your login name to be, and the name for your computer. Enter your own information here, then write them down! OK, now you can click Forward.

[Ubuntu VPC 7]

Getting close, now in step 5 we’re asked about the disk space. Your two options are to install to the entire partition, or manually edit. Since this is a virtual machine, we’ll just take the default of “Erase entire disk:IDE1 master (hda) 17.2 GB Virtual HD” and click Forward.

[Ubuntu VPC 8]

OK, we’ve finally reached the final step of our install wizard. Just assure yourself that your selections are correct, then click the Install button.

[Ubuntu VPC 9]

As Ubuntu installs you’ll be able to monitor it via a progress bar:

[Ubuntu VPC 10]

When the install is done, you are asked if you want to restart, or continue using the Live CD. Let’s pick Restart Now.

[Ubuntu VPC 11]

Now during the reboot I got to the Ubuntu logo screen, then the VPC just sort of stopped. I wound up clicking the red Cancel x to close the window, and picked turn off. I then returned to my VPC console and clicked Start to restart my Ubuntu machine.

Once Ubuntu is running, you are first prompted for your Username. Enter the user name you provided during the install and press enter when done. Then do the same with your password, pressing enter when you’re done. Ubuntu will crank and grind, then come up to the desktop, and you’re ready to go!

I’m not going to go into details on how to use Ubuntu, but I will point out a few things. Let’s take a quick look at the desktop.

[Ubuntu VPC 12]

Starting in the upper left, you’ll see the menu:

[Ubuntu VPC 13]

The Applications menu is where your programs reside. Preinstalled is the Open Office suite, Gimp photo editor, and lots of neat games.

Places is sort of like My Computer, through it you can get to your personal folder, the network, CD / DVD drives, and more.

Through the System menu you can tweak your system settings, similar to Control Panel.

Next to the System menu is a little globe, this will launch the Firefox web browser. To it’s right is an open envelope, you’ve probably guessed this will launch an e-mail program.

By now, you’ve probably noticed this little announcement:

[Ubuntu VPC 14]

If it went away, just click on the orange icon you see on the screen. This is the notification icon, and will let you know of updates, system messages and more. Through the internet you can download the latest updates to Ubuntu. By the way, next to it you’ll see a little speaker icon, this is the Volume control.

Finally, you’re probably asking yourself how the heck you shutdown in Ubuntu. You can exit safely in one of two ways. First, on the upper right you probably noticed this red icon:

[Ubuntu VPC 15]

This is the shutdown icon. You can also select System, Quit from the System menu.

There you go, all the steps you need to get up and running with Ubuntu. Both it and Virtual PC are free, so you have no excuse to start experimenting with Ubuntu today.

Adding a Second Hard Drive to VirtualPC Step by Step

Microsoft Virtual PC defaults the hard disks for it’s virtual machines to 16 gig in size. For most instances that’s large enough, but you could have cases where you simply need more disk space. Or, perhaps you’d like to keep your demo or project code in a separate virtual hard disk than the main virtual disk your applications run on. Regardless of your reason, creating a second hard drive for your virtual machine is fairly easy.

A few up front points, in these instructions I’ll be doing what I believe to be the most common scenario for most folks and be using Windows XP for my guest system.

First, before you launch your Virtual PC click on it once and select the settings button. Now go to Hard Disk 2. Change the option button from “None” to “Virtual hard disk file”. Next, click on Virtual Disk Wizard.

The first screen is simply the welcome screen, just click next.

[Second VHD 1]

On the next screen it asks about disk options. Take the default of “Crate a new virtual disk” and click next.

[Second VHD 2]

You are now asked about what type of disk you’d like to create, a hard or floppy disk. Take the default of “A virtual hard disk” and click next.

[Second VHD 3]

Now you are prompted for the name and location. I stored this with my other VHD files, so enter the path and location you want and click next.

[Second VHD 4]

The next screen asks what type of drive you want to select. The default, “Dynamically expanding” is the default, and is what we’ll be using. This is a great option as it puts a small file on your drive and lets it slowly expand as you need it to grow.

“Fixed size” creates just what it sounds like, a fixed size hard disk. The one main use I could think of is to create a virtual disk the same size as a DVD. You can then store your files on it prior to burning to a DVD. Downside is that the drive always takes the same amount of disk space.

“Differencing” is a big topic, but in brief a differencing drive is based on another VHD file. Once you create a differencing drive, the original is locked and cannot be changed; all changes are written to the differencing disk. Why would you want to do this?

Well let’s say you were teaching a class and wanted to let the students work on labs. You’d create your base image with your software loaded, and then create a differencing disk. Your students would write their changes to the differencing disk. After that class was done all you have to do is create a new differencing disk instead of having to recreate your entire disk image.

Final is linked to a hard disk. It saves your info out to the real hard drive. This is considered an advanced option, and to be honest I haven’t experimented much with it so that’s all I’ll say for now.

As I said, we’ll go with the default for now, and pick “Dynamically expanding”. Click Next to continue.

[Second VHD 5]

Next we are prompted for the maximum size of the VHD. In this demo we’ll take the default of 16 gig and click next, however if you’d like to change it go ahead, enter the maximum number of megabytes you want, when you’re done click Next.

[Second VHD 6]

OK, you’re up to the final screen, this just asks you to confirm your choices. Click on Finish to complete the process.

[Second VHD 7]

You should see a small message saying you’ve created the disk. Just click Close to close this message.

[Second VHD 8]

Now that you’ve created your drive, you need to tell Virtual PC to use it. If you recall, in the settings window we’ve already selected the “Virtual hard disk file” option. Now click the Browse button and pick the vhd file we just created.

[Second VHD 9]

OK, now we’ve got Virtual PC all setup. Click on OK to close the settings, then click on Start to start the Virtual PC. Once you’ve logged in, open up a My Computer window. Here’s a snapshot of mine.

[Second VHD 10]

OK, I can hear you now. “Hey, I created another drive, where’d it go?” Well, it’s there, the problem is you haven’t formatted it yet so Windows XP doesn’t know what to do with it. Let’s fix that now.

Open up Control Panel, and go into Administrative Tools. Now double click on Computer Management. Now click on Disk Management under Storage in the tree. The minute you do, you’ll be presented with the “Initialize and Convert Disk Wizard”. After taking a look at the opening screen, click Next.

[Second VHD 11]

The next screen asks which disks you want to convert. Here, you see Disk 1 is selected, which is correct (your C drive is disk 0, then each additional drive is 1, 2, etc.) Click Next.

[Second VHD 12]

Now it asks about converting disks to Dynamic disks. Check this on, and pick next. (Note in the pic below I haven’t checked it on yet, you will need to.)

[Second VHD 13]

Finally, you are presented with the Finish window. Click Finish to complete.

[Second VHD 14]

Now the window shows Disk 1 as initialized, but it’s still not quite ready to use yet.

[Second VHD 15]

Hang on, we’re almost done. Right click in the Disk 1 area, and select New Volume. This launches the New Volume wizard. On the opening screen just click Next.

[Second VHD 16]

Now you are presented with the Select Volume Type. Simple is the only option enabled, so let’s just select Next.

[Second VHD 17]

The next screen is prompting you to see how much disk space you want to allocate to this new volume. In our case we’ll use all the space, so we’ll just click Next.

[Second VHD 18]

In the next dialog we’re asked what drive letter to assign to our new volume. You can pick any available letter, but I think I’ll just take the default of E and click Next.

[Second VHD 19]

Now the wizard will prompt about formatting. We need to format this drive, so we definitely want to do this. I did change the default volume label from “New Volume Label” to “VSDriveE” since I’m using this with a vhd I use for Visual Studio. However, you should name it something appropriate to your use. Other than that, I’m leaving the other options alone and clicking Next.

[Second VHD 20]

Finally we’re nearing the end. The next screen is the “Completing the New Volume” wizard. Here we are simply confirming our choices. Take a quick look, if all looks well, click Finish.

[Second VHD 21]

While it formats, it will show you the progress in the status window, as you see below.

[Second VHD 22]

OK, that’s it, you’re done. Close the Computer Management window, then the Administrative Tools window. When you return you new computer, you will see your new drive, ready to go!

[Second VHD 23]

Well there you go. Seems like a lot of steps, but it took a lot longer for you to read this than it will take you to actually do it. If you do create new drives, drop a comment and let us know what creative uses you use your second drive for.

Customizing Visual Studio – Shortcuts to Commands

One of the great things about Microsoft is the way all of their stuff is extensible. For years folks have been writing macros, add-ins for the office tools. In case you hadn’t noticed, Visual Studio is just as extensible as the rest of the Microsoft tools.

In this first article, we’ll look at making a shortcut to a handy VS command. First, we’ll need to fire up SlickEdit Gadgets Command Spy tool. What? You haven’t installed it yet? OK, go read my blog posting from November 14th (https://arcanecode.wordpress.com/2006/11/14/visual-studio-add-ins-slickedit-gadgets/ ). The rest of us will wait.

Back now? Great. OK, as I was saying fire up Command Spy. You’ll see it’s window appear, just slide it to an out of the way space, or dock it. In this example, we’ll want to create a shortcut toolbar to collapse and expand all of our code regions with one click.

There’s already a menu option to do this, click on Edit, Outlining, Collapse To Definitions. (Note if you don’t see the Outlining option, make sure you’ve clicked in the code window.) Glancing down at the Command Spy window, you will see that the command issued was Edit.CollapseToDefinitions.

[CommandSpy First Command]

Great, jot that down, and let’s run another command. Click on Edit, Outlining, Toggle All Outlining. You’ll see a new command has shown up in Command Spy.

[CommandSpy with Second Command]

Edit.ToggleAllOutlining is what we are looking for here. Now that we have the commands we want, let’s create a toolbar and hook them in.

Right click in the toolbar, and select Customize. In the Customize dialog, click on New. Give your toolbar a good name, it’s also helpful if you use something like your name to distinguish it from the rest of the built in bars. I named it ArcaneOutlining. You’ll see your new toolbar pop up to the right of the Customize window. (The red arrow is pointing at it.)

[Create a new Toolbar window]

I’m now going to drag the new toolbar under the Customize window, just so it will look decent for the next screen capture.

Now we need to drag our commands onto the toolbar. Click on the Commands tab of the Customize window. Under Categories, scroll down to Edit. Now in the Commands list area, scroll down to Outline Toggle All, and drag it onto the toolbar. Then, pick Outline Collapse to Definitions, and drag it into the toolbar. In this shot, you’ll see what it looks like when you’re done.

[Customize the toolbar window]

OK, we now have our commands, but all that text looks pretty ugly. Right click on the Outline Toggle All command, and you’ll get a menu. Click in the Name area, and you can type over the name of the menu option. I’m going to replace Outline Toggle All with + (a plus sign).

[Rename menu]

Once done, close the Customize dialog, then you can drag your toolbar to an appropriate spot. Use the – button to collapse everything, and the + to toggle it back.

[Picture of our new toolbar]

While I’ve picked out some specific commands, you can use this technique for any command that Visual Studio can produce, and create your own customized toolbars.

Visual Studio Add-Ins: VSFileFinder

If you tend to organize everything in your projects using file names, then you will love this add-in. VSFileFinder, available at http://www.zero-one-zero.com/vs/, adds a simple window to your Visual Studio environment. I elected to dock this window in the bottom center, where my output sits. There’s a text box across the top and a list box under it.

[Picture of VSFileFinder]

 

The text area lets you key in a file name (or part of one) to filter off of. The list area shows all the files in your project that match the entered filter. Clicking on a file will let you open it, or if already open will bring it to the foreground.

As you can see, entering “fo” matched all my Form1 files. Interestingly enough it also matched AssemblyInfo since it also contains “fo”.

That’s about it, VSFileFinder is a simple, one task tool that adds one specific type of functionality. But it does it well, and for free!

 

Visual Studio Add-Ins: Cool Commands 3.0

Update Feb. 9, 2008: Version 4 is now out, but there’s no new blog post. Follow the link below and scroll down through the comments to find the link to version 4.

Another handy add-in that brings functionality to the Solution Explorer is CoolCommands. Version 3 is available from http://weblogs.asp.net/gmilano/archive/2006/05/10/446010.aspx, and adds a whole series of new menu commands to the right click menu in the Solution Explorer window. It also adds a few new menu command to the Code Editor window. Since the site doesn’t do a great job of documenting all the features in the current release, here is a brief list of all the commands that get added.

Commands for the Code Editing Window

DemoFont – In the edit window, right clicking has a new menu option called DemoFont. This will let you quickly toggle back and forth to a larger size of the font you’ve been running. Clicking again will return you to the font size you previously had.

Wheel Font Zooming – My guess is this lets you use the mouse wheel to adjust the font size, but it didn’t work on my system. However the other commands are so useful I’m willing to overlook one dud.

Open File – This is very cool. Within comments you will sometimes see something like “// See the class file Xyz.cs for more info”. With cool commands, you simply right click on Xyz.cs and pick Open File, and that file will open in VS.

Commands for the Solution Explorer

Collapse All Project – Simple menu option to collapse all the projects in your Solution Explorer’s tree.

Command Prompt Here – Opens a command window in the directory where the project sits. (Only appears when clicking on a project).

Open Container Folder – Opens a Windows Explorer where the current file happens to reside.

Reference Manager – Lets you manage the references for the solution.

Resolve Project References – Validates all of your project references.

Copy and Paste References – Lets you create a reference for one project and paste it into another project. Makes setting up references between projects nice and easy.

Add Projects From Folder – Allows you to easily import one or more projects that are stored in a folder.

Commands for the open files tabs

Locate in Solution Explorer – This is cool, in the little tab markers at the top of the editing window, right click and pick this option. The solution explorer will then highlight the file for you.

One thing to note, technically CoolCommands is not an Add-In. While it adds new menu options, it cannot be loaded or unloaded from the Tools, Add-In Manager.

This free tool adds some nice functionality to your VS environment, and is well worth the download.