SQL Server Compact Toolbox – Extension #12

Today’s post comes from Guest Blogger Erik Ejlskov Jensen, SQL Server Compact MVP, @ErikEJ

Toolbox for SQL Server Compact developers

If you use SQL Server Compact, Microsoft’s embedded database for devices, desktops and soon ASP.NET, this extension is for you.

It adds several features not found in Server Explorer Data Connections:

  • Support for both version 3.5 and 4.0 database files
  • Script tables, including data
  • Script entire schema, optionally with data, both of SQL Server Compact and SQL Server 2005 or later databases
  • Import to SQL Server Compact from a SQL Server 2005/2008 database or a CSV file
  • Basic, free form query execution, with Excel friendly output
  • Parse SQL scripts
  • Display graphical estimated query plan
  • Generate detailed DGML files for visualizing table columns and relationships (requires VS 2010 Premium or higher to view)
  • Create and manage SQL Server Merge Replication subscriptions

clip_image002

To install

http://visualstudiogallery.msdn.microsoft.com/en-us/0e313dfd-be80-4afb-b5e9-6e74d369f7a1

To use

To start using the add-in, go to Tools, and select SQL Server Compact Toolbox:

clip_image004

The add-in will list any version 3.5 database connections, which you have defined in Server Explorer. For 4.0 (which is currently not supported in Server Explorer, but will be so in VS 2010 SP1), you can add a connection from the context menu (or even create an empty 4.0 database file):

clip_image005

To refresh the listed connections, click the refresh button on the add-in toolbar.

Scripting an entire database

To create a SQL script file with all object definitions and data in your SQL Server Compact database (for documentation, backup or migration use), select “Script database schema and data” from the context menu:

clip_image006

Viewing estimated execution plan

To find out if you are missing indexes in your database, you can examine the graphical estimated query plan.

clip_image007

With the SQL editor open, press Estimated Plan:

clip_image008

It looks like an index is used here, which is a “good thing”.

Displaying a graphical view of your database

From the database context menu, select “Create Database Graph (DGML)”

clip_image009

This will allow you to explore an interactive graph of your database tables, relationships, and columns:

clip_image011

More information

You can submit feedback/patches, request features and browse/download the source code at the CodePlex site: http://sqlcetoolbox.codeplex.com – and keep up to date with the latest SQL Server Compact news on my blog: Everything SQL Server Compact

Have you written an extension? Want to see it featured here? Let me know!

9 years at Microsoft

Today marks my 9th year at Microsoft. Next year, I’ll collect my second Final Fantasy crystal.

I thought it would be fun to share a few blogging statistics:

It’s tradition to recap the teams you’ve worked on over the years…

  • QA on the Environment SDK (also known as VSIP, VS SDK, VS Extensions). The first feature I ever tested was “devenv.eve /safemode”
  • Learned how to do Accessibility Testing – worked without a monitor for 3 months (seriously, I listened to a screen reader) when i first joined Microsoft
  • QA on the Profiles feature (Tools – Import / Export Settings) – my first feature I worked on from design to launch
  • QA on the Extensibility team (add-ins, macros, recording macro).
  • QA on the Core IDE team (Window Management)
  • Started blogging here in October of 2003 (content was moved a few months later here)
  • Drove the Accessibility Effort for Visual Studio 2005
  • Assisted driving the User Experience Consistency Effort for Visual Studio 2005
  • QA on the Editor team (core Editor functionality)
  • QA on the Project / Solutions team, completing a tour of all the Visual Studio feature areas (okay, okay, i didn’t own Help, but i helped analyze test case failures when those owners were out of office)
  • Program Manager on the Developer Solutions (aka Power Toys) team, releasing 3 of the first 28 projects on CodePlex.com when the site went public back in 2006.
  • Kicked off the Visual Studio Tip of the Day series
  • As a hobby, I assisted teams within Visual Studio in releasing to CodePlex by authoring a framework for what sorts of releases go where and how to get them to the outside world.  Even received a ThinkWeek review by Bill Gates.
  • Program Manager for CodePlex.com. First got my CodePlex.com account back in early 2006. Joined as PM when site had 2800 projects.
  • Achieved 4 of my childhood dreams: Rode on a Mardi Gras float, Held a Koala, Got To Be In That Number When the Saints Went Marching In!, and got my 2nd degree black belt. Only 2 dreams left to go: Buy a DeLorean and Do an Ironman.
  • Achieved 2 of my professional dreams; Wrote my first book and started a college scholarship for folks back home; Got to be in a TechEd Keynote (in Australia)
  • Overcame 1 of my biggest nightmares: Jumping from a Tall Building
  • Left CodePlex.com after watching 10,000 Open Source Projects get created as the Program Manager
  • Finally moved to California after 81 months without seeing the Sun. No joke! 9 months of gray * 9 years = 81 months.
  • Now a Developer Evangelist for Silicon Valley who can demo 101 Visual Studio features in exactly 55 minutes ;-)

It’s also tradition to bring in a pound of M&Ms for each year at MSFT. Since my team is scattered across the west coast, I’ll bring my 9 pounds of M&Ms to SuperHappyDevHouse on Saturday.

Thanks everyone for a fantastic 9 years!

Solution Explorer Tools (When to Sync to Current File) – Extension #11

Control when Solution Explorer syncs to the current file

I’ve given many talks on Visual Studio, and one of the most popular questions is about controlling when Solution Explorer syncs to the current item. This extension is the best one I’ve seen in providing this functionality.

To Install

You can find the Solution Explorer Tools extension at http://visualstudiogallery.msdn.microsoft.com/en-us/ef4ac3e9-d056-4383-8ca2-11721bd879b4

To Use

First, you must disable the “Track Active Item in Solution Explorer” in Tools – Options – Projects and Solutions – General page.

Track Active Item in Solution Explorer option disabled

Now the fun can begin.

On the Solution Explorer, you’ll see 3 new icons.

New commands on Solution Explorer

Starting right from left:

  1. Sync Item – sync’s the Solution Explorer to whatever document is open (or the last active item if a tool window is in the file tab channel).
  2. Collapse All – recursively collapses everything in the solution explorer
  3. Collapse to Item – this combines the previous commands. This will sync to the currently opened item and collapse everything else.

You can also bind keyboard shortcuts to each of these commands via the Tools – Options – Keyboard page:

  • Project.SyncItem
  • Project.CollapseItem
  • Project.CollapseToItem

Some keyboard shortcut suggestions are to bind Project.CollapseToItem to Ctrl+Alt+semicolon, since it is right next to the Ctrl+Alt+L keystroke that opens the Solution Explorer. If you really like this feature and want it on all the time, you could bind it to Ctrl+Alt+L, overriding the standard Open Solution Explorer commands, so the Solution Explorer will always open and collapse to the current item.

Just double-check what your keyboard shortcuts are bound to, as your settings may be different than mine.

More information

Check out the extension’s gallery page at http://tinyurl.com/solexp

Windows Phone 7 Developer Launch Events

For those outside of Northern California or can’t make these dates, you can watch our launch event live on Oct 12 from Mountain View.

Attend either day or both days!  Note that Day 2 is all Hands-on Labs, and no presentations. More information about each day below.

—————————————————————————————

Mountain View, CA | Microsoft Silicon Valley Office | October 12 – 13, 2010

San Francisco, CA | San Francisco Design Center | October 20 – 21, 2010

—————————————————————————————

Day 1: Jump-Start Your Mobile Development | 8:30am – 5:15pm
In the first of this two-day launch event, we’ll take you under the hood of Windows Phone 7 and the Windows Phone 7 platform with a progressive set of learning sessions. We’ll start with the basic tools and fundamentals of Windows Phone 7 application development and as the day unfolds, we’ll go deeper into development scenarios using Silverlight, XNA and the Windows Phone 7 SDK. You’ll also see how to earn cash for your apps in the fully loaded Marketplace.

Day 2: Unleash Your Best App Workshop | 9:00am – 4:00pm
This hands-on workshop is designed to help you turn those napkin sketches and subway scribbles into real, sellable apps. You’ll apply fundamental Windows Phone 7 design principles to build an app and upload it to the fully revamped Marketplace. Go at your own pace or follow along with a proctored group lab. Either way, you’ll get step-by-step advice from Microsoft and community experts. It’s an unprecedented opportunity to stake your claim in the marketplace – using familiar tools and consistent specs.

Emacs Commands – Extension #10

Use your Emacs commands once again!

If you have opened the Tools – Options – Keyboard page, looking for the “Emacs” keybindings, but only found disappointment instead.

Emacs in keyboard scheme options

This extension is for you!

To Install

http://visualstudiogallery.msdn.microsoft.com/en-us/09dc58c4-6f47-413a-9176-742be7463f92

To Use

In order to finish the installation, you must open/create a project. This will prompt you for elevated permissions to finish installing the Emacs.vsk file (the emacs keyboard shortcut file) to the Visual Studio IDE folder located under Program Files (hence the elevated permissions since you need to be an admin to get in here on the file system).

image

Once a project is opened, you’ll see the Emacs item in the Tools – Options – Keyboard scheme dropdown.

Emacs in keyboard scheme options

Quick Primer on Emacs

For those new to Emacs, here’s a quick example how it works in Visual Studio. (This is the way Emacs was explained to me 10 years ago.)

The “big” key is the Alt key.

The “small” key is the Ctrl key.

If you want to navigate forward, just letter by letter, you press Ctrl+F (small Forward). If you want to navigate backward, just letter by letter, you press Ctrl+B (small Backward).

If you want to navigate forward, word by word, you press Alt+F (big Forward). If you want to navigate backward, just letter by letter, you press Alt+B (big Backward).

My favorite part of using Emacs was the ability to move up and down without having to reach for the arrow keys (Ctrl+U, Ctrl+D).

Uninstall

I’m calling out the uninstall because it looks like when you disable or even uninstall the extension, the Emacs option still remains selected in the Tools Options Keyboard list. You must go back to Tools Options Keyboard and select the “(Default)” keybindings.

Selecting Default on the keyboard mapping scheme

Since it required admin rights to add it, you’ll need admin rights to remove it. And i’m guessing if the extension waits until a project is opened to prompt you for these permissions, there isn’t a place for the extension to prompt you to remove the .vsk file. (you can’t be prompted the next time you open a project because the extension is gone.) But that’s just my guess.

If you forget this step, you’ll notice a great many things not working, like Ctrl+F. Since in the Emacs keybindings that’s bound to a command that no longer exists in VS, you’ll won’t see Quick Find dialog. Simply go to Tools Options Keyboard and select Default, and VS will be right as rain.

You can always manually delete the Emacs.vsk file yourself at your own risk.

More Information

You can find more information on all the Emacs keyboard shortcuts supported by the extension at the bottom of this post.

http://visualstudiogallery.msdn.microsoft.com/en-us/09dc58c4-6f47-413a-9176-742be7463f92

VS File Explorer – Extension #9

Get a Windows Explorer experience within the IDE!

My series continues with the VS File Explorer. I call this extension out because of its tag line:

The Visual Studio File Explorer Add-in (sexy name we know, but hey, it’s self documenting)

Gotta love self-documenting Add-in names. Rock on.

Seriously, it was the Shell Extension within Visual Studio experience that grabbed my attention. See below.

To Install

The VS File Explorer extension can be found in the Visual Studio Gallery at http://visualstudiogallery.msdn.microsoft.com/en-us/7193af78-b06e-48dd-8994-9deb2bfa1959

To Use

The tool can be found at View – Other Windows – Mindscape File Explorer.

View - Other Windows - Mindscape File Explorer

This will open a tool window that has a Windows Explorer look-and-feel.

But a Windows Explorer in itself isn’t exciting. There’s some additional functionality that’s worth calling out.

Maybe there’s a feature here that will help improve your productivity.

Shell Extensions within Visual Studio

Let’s say I have a shell extension like TortoiseSVN. (Tortoise doesn’t have a GUI per se. It inserts itself into Windows Explorer.) Using VS File Explorer, you can now see TortoiseSVN within Visual Studio.

TortoiseSVN shell extensions within VS

Just a heads up, for you 64-bit users, you might want to read this thread. (You need the 32-bit version of Tortoise to run within VS).

Command Prompt Here

This command will open a command prompt, regardless whether the selection is in the right-pane or left-pane.

Command Prompt Here icon

But note, this by default will be your standard command shell, cmd.exe, and not the Visual Studio Command Prompt. There is an option to customize what is run when you press this button.

Home

Home icon

I had to ask Mindscape about this one.

The “Home” button will change the root folder to whatever the “Default Root Folder” is in the Options dialog.

However, seems that there’s a bug that you have to change the “Default Root Folder” to something other than the installed default in order for the “Home” button to do something. Otherwise, trying to click “Home” will cause Visual Studio to stare at you like an old dog in obedience class looking at you as if you actually expect him to fetch that ball.

Snap to Current Solution

At first glance, I thought “snap” would take the highlighted project/code and add it to the current solution. Mais non!

“Snap To Current Solution” changes the current root folder to the current solution folder. As shown below, my Code default root folder becomes ConsoleApplication1

example of "Snap To Current Solution"

Change Root Folder

Change Root Folder icon

Not to be confused with the “Default Root Folder” setting, this command just changes the current root folder view in the left-pane. It doesn’t change the “Default Root Folder”, the folder that “Home” will go to.

Options

Options icon

Just as it sounds, here be anthropomorphic dragons, i mean here is where all the settings live for the VS File Explorer.

There are four settings here

  • Default Root Folder – What the “Home” button will take you to
  • Excluded Files – the files the VS File Explorer should not show
  • Open In Visual Studio – what do you want to happen when you double-click or press “Open” on a .sln file? Do you want VS to open it, or do you want it opened by its default application.
  • Command Prompt – here’s where you can change the .exe that is executed. For example, I changed mine to \Windows\System32\notepad.exe. Now when I click the command prompt icon, I get notepad. Might be able to do some interesting things here.

Know of an Extension you’d like to see here. Let me know!

Power Commands for Visual Studio 2010 – Extension #8

I’m way behind in my extension series. Relocation + New Job + Work Travel, it’s been a crazy year!

The Power Commands for Visual Studio are back! The Power Commands were an extremely popular add-in for Visual Studio 2008, giving you even more options for your IDE.

To Install

The Power Commands extension can be found on the Visual Studio Gallery at http://visualstudiogallery.msdn.microsoft.com/en-us/e5f41ad9-4edc-4912-bca3-91147db95b99

Please see this post on how to install extensions if you need additional help.

To Use

The Power Command options can be found all throughout the IDE. To help you discover what all the Power Commands do, I’m going to review each option below.

Pay close attention to the Choose Which Commands You Want To Use section. All commands are enabled by default, but if there are a few you never will use, or don’t want to use, you can disable them in Tools Options.

Format Document On Save

Ctrl+K, Ctrl+D is the keyboard shortcut to format the current document (found under Edit – Advanced – Format Document). This is very useful to know when you cut and paste code from a website or somewhere else that causes the formatting to go crazy.

But maybe you don’t want to think about keyboard shortcuts. Or maybe you just one less thing to worry about as you save the document.

You must enable the “Format Document On Save” option at the Tools – Options – PowerCommands – General page.

Now whenever you save a document, and formatting that’s off, as shown below

extra whitespace on line

will be corrected automatically.

corrected whitespace

Remove And Sort Usings On Save

Alas, this is only for C#. On the C# context menu, there are the “Organize Usings” commands.

Remove and Sort Usings on context menu

These options are great when you want to clean up your using statements at the top of the file, by removing any using statements not actually being used and also by sorting them in alphabetical order.

non-sorted using statements

Talk about a huge timesaver!

But let’s save even more time by having the editor do this automatically whenever you press save. You can find the option to enable this feature at Tools – Options – PowerCommands – General page.

Remove and Sort Usings

Let’s take this awesome one step further. Instead of removing unused using statements at the file level, let’s remove and sort them at the project level!

Remove and Sort Usings on context menu

As illustrated above, the command “Remove and Sort Usings” can be found on the Solution Explorer context menu at both the Solution level and at the individual project levels.

Clear All Panes

In the Output Window, you can have multiple panes, the most common being Build and Debug. There’s a “Clear All” button (indicated below) that will just clear the current output window pane.

If you want to clear all output sub-windows at once, press the “Clear All Panes” button located just to the right of the “Show Output From” drop down.

Clear All Panes on Output Window

Copy Path

No more having to open a file to copy its file path from the file tab.

This command copies the full path of the currently-selected item to the clipboard. It works with the solution node, a project node, any project item node, and any folder.

Copy Path on Solution Explorer context menu

Email Code Snippet

Exactly as it sounds.

Select some code in the editor, then right-click and select “Email CodeSnippet.”

Email CodeSnippet on context menu

And it also fills out the subject for you.

To: You
From: Me
Subject: CodeSnippet from Program.cs

Insert Guid Attribute

To add a GUID attribute to a class, right-click anywhere within the class and select “Insert Guid Attribute”, and those few extra keystrokes are done for you.

System.Runtime.InteropServices.GuidAttribute(...)

Show All Files

The only thing better than one “Show All Files” button is two “Show All Files” buttons! The one on the left is for the current project, but the one on the right is for the entire solution.

current project versus entire solution icons

Undo Close

ROCK ON!

How many of you like me close something only to realize in that instant that you wanted to look at something again. This command is for us!

To reopen the most-recently closed document, go to Edit – Undo Close. Keyboard shortcut is Ctrl+Shift+Z. It’ll even return the cursor to its last known position.

But it gets better…

Want to see all of your most-recently closed documents? Go to View – Other Windows – Undo Close Window.

Undo Close tool window

Collapse Projects

If you want to collapse everything under a project node, including any sub-nodes (this being the key difference from the standard Windows behavior), right-click and select “Collapse Project” from the Solution Explorer context menu.

Thus a project like this

fully expanded node in Solution Explorer

will collapse everything, including the Properties and the Resources.resx nodes, as shown below. (I expanded the XAMLVisualizer node for illustration purposes).

collapsed sub-nodes in Solution Explorer

This command works for solutions, projects, and solution folders.

Copy Class / Paste Class

On the Solution Explorer, select a project item (usually a class file) you want to copy. Right-click and select “copy class.” Now navigate to the project node and right-click to see the “Paste Class” command.

a copied class in solution explorer

It will also rename the class to avoid compiler errors.

Copy References / Past References

This command allows you to copy all your references for a project, then paste them into another project. No Add Reference Dialog needed!

Copy References on Solution Explorer

You can also do this across multiple instances of the IDE.

For C# projects, the command is found on the references node. For VB and ASP.NET projects, it is found on the project node.

Copy As Project Reference

Just like in the previous command, why use the Add Reference Dialog if you don’t have to. The “Copy As Project Reference” command found on the Solution Explorer context menu will allow you to copy a project (from its project node) and then paste it into another project node as a project reference.

Copy as Project Reference example

Edit Project File

One of my more popular tips, especially for those who work on MSBuild project files, is the ability to quick edit your project files without having to shut down Visual Studio and open up notepad. The tip was to Unload Project and Edit Project (all via Solution Explorer context menu).

The “Edit Project File” combines these two commands for you, unloading the project and opening the file in the editor for you.

Edit Project File in editor context menu

You’ll still need to Reload the project file when you’re done. The command is found by right-clicking on the project node.

Open Containing Folder

Similar to the command found on the File Tabs and in the Solution Explorer for a node, this command opens the containing folder for an item in the Solution Explorer.

Open Containing Folder on Solution Explorer context menu

Open Command Prompt

For The Win!

Open a Visual Studio command prompt directly from the Solution Explorer! I say a “Visual Studio” command prompt, and not just a command prompt, because this one has the Environment Variable set to know where devenv.exe lives. So no more having to be frustrated with “devenv is not recognized as an internal or external command….”

Open Command Prompt via Solution Explorer

Unload Projects / Reload Projects

Similar to the built-in command for unloading a project, the Unload Projects command (found on the Solution Explorer context menu for a project node) will unload all the projects in a solution. Useful for editing multiple MSBuild files.

Unload multiple projects example

And to reload all your projects, there’s the Reload Projects command.

Extract Constant

Found under the Refactor menu, the Extract Constant will do exactly what it sounds like it does. It will create a constant based on the selected text. For example, consider the Console.WriteLine() parameter I have below:

Extract Constant on context menu

Selecting this text, I can specify “Extract Constant”. It will bring up a dialog to allow me to specify scope and give the new string a name.

Extract Constant dialog box

Pressing enter creates the string, the WhoDat constant in this example.

image

Clear Recent File List

No longer having to go to the registry to clean up your recent files list. The “Clear Recent File List” command will do that for you. Go to File – Recent Files – Clear Recent File list.

Clear Recent File List on File - Recent Files menu

This will bring up the Clear Recent File List dialog for you to pick and choose what to delete.

Clear List dialog box

Wow! I have a lot of recent files!

Clear Recent Project List

Similar to the above tip, the Clear Recent Project list will allow you to clean up your recent project list. It is found at File – Recent Projects and Solutions – Clear Recent Project List.

Clear Recent Project List dialog box

Close All

Found on the File Tab context menu, this command will close all open documents.

Close All on File Tab Context menu

Choose which commands you want to use!

By default, all the power commands are enabled. To only enable those you’re going to use, you can go to Tools – Options – PowerCommands.

Tools - Options - Power Commands - Commands

And on the Commands page, you’ll find the full list of all the commands available with this extension.

All possible PowerCommands options to enable/disable

The Rematch – Webcast of my 101 VS tips in 55 mins via O’Reilly is now available

Earlier this week, I decided to rematch the clock to demo 101 VS Tips in 55 minutes with O’Reilly Media hosting and recording the webcast. In an earlier attempt, I missed by 15 seconds. And like the earlier attempt, if I make it, all attendees receive a free copy of my Visual Studio Tips ebook. 

The Rematch —> http://oreillynet.com/pub/e/1730

Did I make it this time? Let’s just say a picture speaks a thousand words.

stop clock with 6 seconds remaining

Actually, I demo’ed #102 tips, because I started off with Tip #0. ;-)

Since I entered hyperspace in the final 2 minutes, some folks were asking what were those last tips. The order is the same as the Channel 9 version of the talk as well.

Here’s the breakdown:

  • #97 – How to see caught exception in Watch Window
  • #98 -? You can disable the Exception assistant
  • #99 – How to use the Intellitrace DVR controls (The lack of oxygen to my brain made me call it by its old name – Historical Debugging)
  • #100 – How to open an IntelliTrace? Log (I miscalled this tip 99)
  • #101 – How to use Extension Manager / Get VS Tips in your start page. Yeah, you need to set it up in the Tools – Options – Environment – Startup.

And to that comment at 15:30, I was so tempted to say something in response, but I didn’t want to waste my precious time on Brett Favre. =P

If you want to find out more about O’Reilly’s webcasts, you can visit http://oreilly.com/webcasts/. Thanks again to O’Reilly for hosting and for providing the ebooks!

5 years later – remembering Hurricane Katrina

I wanted to pause for a brief second to remember the 53 people in my hometown who lost their lives 5 years ago yesterday, when Hurricane Katrina took my hometown off the map.

If a town doesn’t have any buildings, is it still a town? Waveland answered that question by surviving.

For those of you who have just recently met me, this post is mostly a FYI. But for those of you who have been following me throughout Katrina, I know I sound like a broken record, but I’ll never be able to thank you enough.

My Parents on NBC Nightly News

And once again, my parents were featured on NBC Nightly news for the 5 year anniversary.

“Living through hell prepares you for anything life throws at you.”

Quote taken from a friend’s blog post regarding an outsider’s perspective on the storm. Amen.

Save Waveland Scholarship Fund

Just wanted to remind folks that they can still donate directly to the scholarship fund I created from my Visual Studio Tips book royalties. https://www.mgccc.edu/creditcard.htm

clip_image001[6]

Photo found here. Annotations are mine.

Is New Orleans / Waveland rebuilt?

I guess it depends on what you mean by “rebuilt?” If rebuilt means “back the way it was” then the answer is a definitive no. In many places it has rebuilt, but it many, many different ways. And in many places it still 5 years later looks like Katrina just happened.

But every time I go home, things are looking better and better.

How I Bonded with my Windows Phone – a cycling misadventure

I had an interesting bike ride on Saturday, where I unexpectedly got to do some serious bonding with my Windows Phone. And since we have a big Windows Phone event coming up next month, where I’ve been heads-down learning the developer tools, I had to share this story, especially since this is the longest blogging hiatus i’ve ever taken in 7 years.

I’m in the middle of training for my first triathlon (a half-ironman: 1.2 mile swim, 50 mile bike ride, 13 mile run) with Team in Training. Cycling is my favorite, so when I go riding, I’m gone for hours. As I pack my gear for the ride ahead, I look at my new Windows Phone sitting next to my old faithful Blackjack phone. I debate whether to take the device that’s only been used for 12 hours, or do I take my blackjack device? I decide to take my Windows Phone, thinking “what’s the worst that’s going to happen?”

A guy from Team in Training says I should check out Calaveras Road in East Bay. He says, “it’s a bit hilly” but there are very little cars and awesome views. So I think, cool, why not try it. Those who cycle in the Bay area are already laughing, knowing what’s about to happen.

Lesson Learned #1 – always check elevation gains on maps

So I head out from Calaveras Road heading towards East Bay. Incredibly steep, but I’m doing it and having fun. I get to a little park nearby and I ask a fellow cyclist for directions to Sunol Regional Wilderness (it didn’t look very far on my little cycling map I carry with me, maybe 15 miles). He says, “oh, it’s just over that road, if you can get up ‘The Wall,’ but after that it’s all downhill.’”  I had to walk my bike up “The Wall” it was that steep for about 500 yards, and I thought about turning back, but I thought it would be cool to see the Reservoir. And it’s all downhill, so no big deal. I just forget to ask what “all” means.

Lesson Learned #2 – Mountains can be steeper on one side than on another side

I reached the Reservoir and start the downhill. Everything’s great, except I’m starting to realize that I’ve travelled much farther on this side of the mountain going downhill than on the other side going up. I start to calculate how much water I have (I can only fit one bottle on my bike frame) and how many gel packs I have (I took 3 with me and have used 1 thus far). I’m thinking “my cycling map says there’s a park nearby at the bottom of the Reservoir. If I’m going to head back, I have to refill my bottle. Can’t be much farther to the bottom.”

Lesson Learned #3 – Always, always, always know what the distances are between major milestones

Now nearly 25 minutes have gone by since starting my descent, and I’m still mostly going downhill. Now I’m in a really uncomfortable situation. I can’t turn around because I don’t have enough water to make it. I’ve been riding for nearly 20 miles now, and anything beyond 30 miles I “hit the wall” meaning if I don’t have proper water and gels, I get serious muscle fatigue and risk injury or passing out from exhaustion. So I pull over and consult the cycling map. There’s still that park nearby where I can refill my bottle – priority number one. Now I’m thinking I should call a taxi or a friend to get me, so priority number two is to find a small town. I continue down the mountain.

Lesson Learned #4 – When asking other cyclists for directions while riding, their answers will not be completely accurate.

As I continue the descent, and it’s now been 45 minutes so I’m committed to the Taxi idea. I start asking cyclists who pass me where’s the park to refill my water bottle. No one says I need to turn on a particular road to reach the park. And the cycling map didn’t say anything about the park entrance.

I miss the park entrance.

Now, I’m way beyond the park , and I’m still going downhill. Turning around isn’t an option, because i won’t make it back up that elevation gain to the park.

I pull over. In the distance I can see an interstate, so I know I’m getting close to a small town. I decide I’m going to chill out here until I can flag down other cyclists.  I’m in front of a construction site, so it’s high visibility, so both cyclists and cars will see me. There were enough cyclists on the road that I knew I wouldn’t wait long. After a few minutes, a group of 3 come by. I flag them down, apologize profusely for interrupting their ride, and explain that “I’m a little lost” (it sounded better than “I climbed over that mountain and now I’m too tired to climb back over it”) and how I’m looking for a store where I can call a Taxi from. They said there’s one just 5 miles down the road. They ask if I’m okay, and I’m like “yeah, just embarrassed beyond belief.”

I’m at mile 22, so 5 miles is still in my comfort zone, and I still have a couple of gels left. I finish the bottle (no more water) and a gel.

Lesson learned #5 – Karma always wins

After 5 miles, I reach the small little market (in the city of Sunol). I pull out my Windows Phone realizing this will be the first time I’m going to make a call using it. The shop owner gives me her phone bill envelope, so I can give the Taxi the address to GPS it. Now I stare at my phone, thinking “how do I use this thing?” I press the phone icon, and at the bottom I see the “…” which usually means “more” when displayed on application buttons. Sure enough, it displays textual info to the icons, so I find the people icon that takes me to all my phone contacts from my old blackjack. I call the taxi (when you travel a lot, taxis go on your speed dial), give the dispatcher the address, and request a van since I have a bike. Oh the embarrassment.

I hang out with another cyclist (who also lived in Seattle and moved down here because of the weather) and a husband/wife who retired from teaching in Florida and now ride motorcycles in CA. I also buy some food and Gatorade since I’m so done for the day. We chat about life, the weather, and CA wines.

As we chat, I notice the phone vibrating and faintly ringing. This was an old feature I missed from the flip phone I had before my blackjack, being about to vibrate and ring at the same time. I couldn’t hear the ringer, so I was glad the default was set to both. The taxi driver is having trouble finding the place. I’m new to the area, so I realize I might have misread the street. I decide to try to look up directions on the phone while the taxi driver is on the line. As I bring the phone down from my ear, the UI turns back on. I unlock the device, press the start button, and go to Maps. I again press the “…” thingy to figure out the icons, and to my relief there’s a “me” button. I’m able to locate myself (as I silently kick myself for not doing this earlier), and I tell the driver where the major roads and crossroads are.

Something you need to know about me is that I have a natural talent for breaking software. If I’m not shown how to do something first, I can almost guarantee I’ll break the UI. That’s why I loved software testing. The bugs always found me. This is why I bonded with my Windows Phone. No only did the UI made sense, but more importantly it worked as I expected it to. This is huge for me.

Not too long later, and after showing my new best friends of the day my cool phone, the taxi van arrives. The driver helps put my bike into the van.  A group of cyclists pass by and see what’s happening. The pack leaders point and laugh about me getting a cab. I think it was to tease someone else in the group. But I could care less. I’m getting home, safe and injury free.

As the taxi drives by them on the road, I lower my window and wave at them, grinning that I’m in the taxi and they are about to do 20 miles of nothing short of pure terror (at least from my point of view).

Reaching the interstate, the taxi cab driver says, “So, um, what happened?” I said, “I just moved here and had no idea what that road was like. There’s no way I can get back over that mountain, so I called a taxi. Never in life had I had to call a taxi before to pick me up. My friends are going to tease me beyond belief.” The taxi cab driver just starts laughing. So do i.

When we reach my house, he asks where to drop me off. I said, “Anywhere. I might as well ride the last few hundred yards home.” He cracks up laughing again. I tip him twenty for the inconvenience of trying to find the random little market on the side of the road, for helping me get the bike into the van, and for Karma for everything working out well.

He says, “This was definitely a first for me, picking up a cyclist.” And I said, “and I hope this will be my last!”

And just a reminder, if you’re in the Silicon Valley area and want to ramp up on Windows Phone development, check out our one-day Windows Phone 7 Unleashed event! We’ll have Windows Phone handsets there for you to test your apps on!