Tuesday, October 26, 2010

PDF-Export in PowerPoint 2010: Beware of accessibility Option!

In Office 2010, the export to PDF is included out-of-the-box simply via the Save as feature.

That’s nice and neat, but be aware that by default, the resulting PDF is enhanced by accessibility tags. These tags may result in unwanted tooltip windows on hovering an image in Adobe Reader:

PDF with tooltips for images

You can overcome this by invoking the Options dialog directly from the Save as dialog:

PowerPoint SaveAs Dialog: Options-Button

Here you can deselect the corresponding option:

PowerPoint PDF export option for accessibility

Unfortunately this has to be done before every export.

Sunday, October 17, 2010

Four simple Things to please your Audience when Presenting with Code

If you have to show source code in a presentation, there are a few easy things you can do to improve your audience’s experience:

Use a larger Font

It’s obvious that for many people reading source code presented with a font size of 10 Pt might be a problem. In mid to large size rooms it will be next to impossible for many of your listeners to decipher it.

Visual Studio 2010 with default font

Visual Studio 2010 with default font

In my presentation when showing source code directly from some IDE, I use a font size of 14 Pt. Even with large rooms there never was a problem with that size.

Visual Studio 2010 with font in 14pt

Visual Studio 2010 with font in 14pt

Set you Selection Back color to yellow

A typical mistake with novice presenters is to select portions of source when they want to emphasize on that code. What works well on the laptop’s screen turns out to be even counterproductive. For the audience, the typical white letters on darkblue background just produce an unreadable mess of pixels.

Visual Basic for Applications IDE with selected text in default color scheme

Visual Basic for Applications IDE with selected text in default color scheme

When recently watching some video of Roy Osherove I had a real epiphany: when he showed sourcecode in Visual Studio, he highlighted it with a bright yellow background. Not only does this not infer the readability of the code. Moreover it is rather intuitive since we are used to that textmarker-like effect.

Visual Basic for Applications IDE with selected text with yellow textmarker-like selection color

Visual Basic for Applications IDE with selected text with yellow textmarker-like selection color

Hide unneeded Tools

Modern IDEs provide a vast amount of features and tools resulting in a number of toolwindows and commandbars. For the purpose of the demo you are doing just a few of the toolwindows in your IDE may be really needed.

Visual Studio 2010 with many open tool windows

Visual Studio 2010 with many open tool windows

Thus, just hide them so that your audience can focus the code you’re showing. I recommend not just to collapse the unneeded tools – also hide the tool’s tabs.

 

 

Visual Studio 2010 with almost no tool windows

Visual Studio 2010 with almost no tool windows

Use Full Screen Mode

Even after hiding the tool windows there remains a lot of clutter consuming screen real estate, such as the commandbars. If you feel the need to remove that distraction as well, your IDE may provide some full screen mode.

In Visual Studio you can enter the full screen mode by pressing Ctrl+Alt+Enter.

Visual Studio 2010 in full screen mode

Visual Studio 2010 in full screen mode

I hope I could show you that even when presenting with code directly from you IDE, the usability of your demo can be greatly advanced by considering simple tips.

Saturday, October 16, 2010

Commenting with ReSharper 5 and Visual Studio 2010

No doubt, ReSharper is great. ReSharper 5 for with Visual Studio 2010 is even greater.

Unfortunately with the new default keyboard shortcuts in ReSharper 5 at least one convenient shortcut has been changed.

In previous versions of ReSharper, by pressing Ctrl+7 (not the function key F7!)  the current line (or lines if several were selected) have been commented out using the double slash single line comment. If the selected lines already were commented out, that slashes had been removed.

Bookmarking overruled commenting

With ReSharper 5 by default the shortcut Ctrl+7 is assigned to a new feature – bookmarking. To go to a specific numbered bookmark you now can press any the keys 0 to 9 while holding down the Ctrl-key.

So when you first try to use your line commenting feature by pressing Ctrl+7 as you’ve grown accustomed to, you will get that annoying hint:

Could not go to bookmark #7. Bookmark is not set.

Could not go to bookmark #7. Bookmark is not set.

If you’re like me you’ll probably like to change that shortcut back to the function it provided with earlier version of ReSharper.

Changing Visual Studio’s keyboard shortcuts

Thanks to Visual Studios extensibility model all the keyboard shortcuts, even those provided by third party addins such as ReSharper, can be manipulated in Visual Studio’s dedicated dialog.

You can open that dialog via Tools – Options – Keyboard:

Visual Studio's options dialog with selection of "Keyboard"-section

If you want to see what commands currently are assigned to a specific keyboard-shortcut, you simple have to set the focus to the textbox labeled “Press shortcut keys:”

image

Here you see the guilty, the command ReSharper_Bookmarks_GoToBookmark7. Now you might think it should be straight forward to reassign that shortcut to our beloved line comment feature.

But – before you get frustrated mind the following: the currently assigned command is not displayed in a simple textbox, but in a combobox. That gives us the hint that in Visual Studio a single shortcut can be applied to several commands. That means that just assigning another command to a shortcut will in general not replace the old assignment, but add to it.

This feature does make sense to assign a shortcut to several specific commands depending on the context that shortcut is used. That context can be specified by selecting an entry in the drop down “Use new shortcut in:”. By default the entry “Global” is used indicating that the shortcut applies to all kinds of editors, be it text or graphical editors. For example with selecting the proper entry you can constrain the assignment of a shortcut to a specific command for the use in some special editor as the editor for UML activity diagrams, the XML schema designer or just the text editor.

Step by step instructions

So let’s go back to our original intention, restoring the shortcut Ctrl+7 to ReSharper line comment feature:

  1. Remove the current assignment
    1. Find the name of the currently assigned command
      Press the shortcut while the focus is on the field “Press shortcut keys:” (Ctrl+7). The current shortcut assignments are shown in “Shortcut currently used by:”
    2. Select the currently assigned command in the command list
      Select the command in the command list (ReSharper_Bookmarks_GoToBookmark7 in our case). You might want to use the filter text box to narrow-down the list (for example “rk7”).
    3. Select the shortcut to remove
      In the dropdown “Shortcuts for selected command:” select the command you want to remove.
      In our case this is “Ctrl+7 (Global)”
    4. Remove the assignment
      Press the button labeled “Remove”
  2. Add the new assignment
    1. Select the command to be assigned in the command list
      In our case this is “ReSharper.ReSharper_LineComment”. Use “comment” for filtering to find that entry quicker.
    2. Assign the command to the shortcut key
      Make sure the desired shortcut (Ctrl+7 for our case) is still shown in “Press shortcut keys:” and klick the button labeled “Assign”

Hope that helps some needy soul in despair. :)