www.geekybob.com

Just a short, simple blog for Bob to share his thoughts.

Adding Windows Phone 7 Support to BlogEngine.NET

08 December 2010 • by Bob • BlogEngine.NET, IIS, Windows Phone 7

I love BlogEngine.NET, and I love my Windows Phone 7 mobile phone, so it goes without saying that I would want the two technologies to work together. I'm currently using BlogEngine.NET 1.6.1, but Windows Phone 7 is not supported by default. That being said, it's really easy to add support for Windows Phone 7 by modifying your BlogEngine.NET settings. To do so, open your Web.config file and locate the following section:

<appSettings>
<add key="BlogEngine.FileExtension" value=".aspx" />
<!-- You can e.g. use "~/blog/" if BlogEngine.NET is not located in the root of the application -->
<add key="BlogEngine.VirtualPath" value="~/" />
<!-- The regex used to identify mobile devices so a different theme can be shown -->
<add key="BlogEngine.MobileDevices" value="(nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)" />
<!-- The name of the role with administrator permissions -->
<add key="BlogEngine.AdminRole" value="Administrators" />
<!--This value is to provide an alterantive location for storing data.-->
<add key="StorageLocation" value="~/App_Data/" />
<!--A comma separated list of script names to hard minify. It's case-sensitive. -->
<add key="BlogEngine.HardMinify" value="blog.js,widget.js,WebResource.axd" />
</appSettings>

The line that you need to modify is the BlogEngine.MobileDevices line, and all that you need to do is add iemobile to the list. When you finish, it should look like the following:

<add key="BlogEngine.MobileDevices"
  value="(iemobile|nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)" />

You could also add support for Apple products by using the following syntax:

<add key="BlogEngine.MobileDevices"
  value="(iemobile|iphone|ipod|nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)" />

That's all there is to it. ;-]


Note: This blog was originally posted at http://blogs.msdn.com/robert_mcmurray/

Who is this Santa, Really?

05 December 2010 • by Bob • Humor

I spent the weekend in Leavenworth, Washington, with my wife, our kids, and my future son-in-law. It was a fun-filled weekend of bright lights, snow-capped mountains, hot apple cider, chestnuts roasting on open fires, and Christmas carols sung by choirs. But the more that I listened to Christmas carols, the more I started to get an interesting picture of Santa Claus.

Like many other people, I grew up with the concept of Santa Claus as a kindly old gentleman that brought gifts at Christmas to all the good children of the world. Santa was like the ultimate grandfather - with a bright red suit, a cheery disposition, a full beard of whiskers, and a sleigh that flew through the air by magic reindeer.

But this year the words to some of the traditional Christmas carols began to really sink in, and I started to see a different Santa. A darker Santa. A scary Santa. Let me give you just a few examples:

My childhood illusion is finally shattered - this Christmas Eve Santa isn't filling STOCKINGS hung by the chimney with care, he's STALKING you by the chimney with care. That's why he's sneaking into your house like a burglar, and why he has so many aliases around the globe - even James Bond doesn't use as many pseudonyms: Saint Nicholas, Father Christmas, Kris Kringle, Grandfather Frost, Yule Man, Sinterklaas, Дед Мороз, etc.

So this Christmas Eve I suggest that you heed the wise advice found in the "Here Comes Santa Claus" Christmas carol: "Jump in bed and cover up your head, Because Santa Claus comes tonight."

In Honor of Veteran's Day

11 November 2010 • by Bob • Military

The Soldier

It is the soldier, not the reporter,
who has given us freedom of the press.

It is the soldier, not the poet,
who has given us freedom of speech.

It is the soldier, not the campus organizer,
who has given us the freedom to demonstrate.

It is the soldier, not the lawyer,
who has given us the right to a fair trial.

It is the soldier,
who salutes the flag,
who serves under the flag,
and whose coffin is draped by the flag,
who allows the protester to burn the flag. 

--By Father Dennis Edward O'Brien, USMC

Misadventures with Foreign Languages

21 October 2010 • by Bob • Humor, Military

I served in the Army for 8 years as a Russian translator. When I was still in Russian school, we were required to attend "conversation" class, where a group of students would sit down and discuss various topics with one of the instructors.

One day the instructor asked me what I had been doing the previous evening, and I said that I had played soccer. She asked what position I played, and since I didn't know the Russian noun for a goal keeper, I took a chance and replied in Russian that "I played goalie." She looked surprised, and asked if I was often goalie when playing soccer, and I replied yes - I usually play goalie. After that we chatted back and forth about how I preferred to play goalie, why I preferred to play goalie, etc. This conversation continued for about a minute, when she switched to English and informed me that in Russian "goalie" (голый) is the adjective for "naked".

So I had spent the last part of the conversation waxing poetic about my preference for playing soccer... well... you know. ;-)

Uh, yeah - I meant to fix that...

04 August 2010 • by Bob • IIS

One of my coworkers (Mike Pope) sent me the link to a great blog post by Raymond Chen that was titled "Don't forget to replace your placeholder bitmaps with real bitmaps". Raymond's blog was a good story, but he referenced another great blog post titled "We Burned the Poop", and let's be honest - who can resist reading a blog post with a great title like that? (Note: I won't spoil the impact of that blog - you should read it first.)

But reading those two blog posts made me think back about the various code blunders that I've made over the years, which have [thankfully] never been as bad as the stories in those blog posts.

But one mistake that I made which I have never been able to live down is when I wrote the MetaEdit 2.x utility for editing the IIS metabase.

Every day I was making a huge number of changes to the MetaEdit code, and it was getting hard to keep track of everything that I needed to finish. Of course, there are several ways to track work items, and the preferred method is to keep track of everything in a bug database. But I also like to flag sections of code with comments that say things like "TODO" or "BUGBUG", that makes it easier to do a search on the code before inadvertently checking it in with something that needed to be completed.

As the deadline was rapidly approaching for me to check in the final build of MetaEdit for the Windows Server 2000 Resource Kit, I decided to add a dialog box that MetaEdit would display if you were using it with a version of IIS that was later than IIS 5.0, which we were shipping with Windows Server 2000. I wanted to make sure that MetaEdit would warn users that they might have problems using MetaEdit with a later version of IIS since I didn't know how the metabase would work in the future, or if we would deprecate the metabase like we eventually did in Windows Server 2008. I was obviously distracted for some reason and I didn't finish that section of code, but I hadn't added a comment with the text "TODO" or "BUGBUG", so I dutifully checked the code into the Resource Kit database and I didn't think anything about it.

At least I didn't think about it until we released Windows Server 2003.

If you'll recall, IIS 6.0 was shipped with Windows Server 2003, which meant that anyone who wanted to use MetaEdit in order to modify their metabase was rudely greeted with the following nonsensical and ultimately useless dialog box:

Suddenly I was receiving emails from all over the place asking me what the heck that dialog box meant. The text was supposed to have a generic warning about damaging your metabase with some sort of "use-at-your-own-risk" verbiage and a set of Yes/No buttons that would allow you to opt out of opening the application.

(Deep Sigh)

Eventually Henrik Walther wrote KB 555081 that informed users what to do, but still - I should have fixed that. Darn.

My apologies to everyone that ever saw that dialog box. ;-]


Note: This blog was originally posted at http://blogs.msdn.com/robert_mcmurray/

FTP Clients - Part 9: Expression Web 4

30 July 2010 • by Bob • FTP

For this installment in my series about FTP Clients I'm going to review the FTP features in Microsoft's Expression Web 4 (EW4). You can find out more about the Microsoft Expression series of products from the following URL:

http://www.microsoft.com/expression/

Note: There are a lot of really cool features that are built into EW4, like Search Engine Optimization (SEO) tools, rich extensibility APIs, previewing content side-by-side in multiple browser windows through SuperPreview, built-in support for programming languages like ASP/ASP.NET/PHP/etc. But that being said, in keeping with the main theme of my FTP client series, this review is focusing on just the FTP aspects of EW4 - not the entire product.

EW4 Splash Screen

At the time of this blog post, EW4 is a for-retail product that is available as part of the Expression Studio 4 Web Professional and Expression Studio 4 Ultimate suites.

Expression Web 4 Overview

The EW4 user interface follows the same design paradigm as earlier versions of Expression Web, albeit with the darker color scheme that Expression products have been using in recent versions. While EW4 contains many features that you would expect in a Microsoft Office application, it does not resemble the Office 2007/2010 user interface, so there is no ribbon-style toolbar. (This is a bad thing if you love the Office ribbon and a good thing if you hate the Office ribbon; but I'll leave that up to you to decide. <grin>)

Fig. 1 - EW4's built-in support for PHP Files

One minor personal issue that I have with Expression Web is that VBA was deprecated a while ago, so EW4 doesn't have a macro language that I can use to automate tasks like I would do with previous versions. It's possible to create "add-ins" for Expression Web, but there's a lot of overhead associated with that. From my perspective, that's pretty much like saying to someone, "I know that you would like to get across town and you already have a really nice car, but we're going to take that away. If you take 17 different buses and then walk three or four blocks, you will eventually wind up where you want to go. Of course, it will take you several hours longer and it's a really big hassle, but sooner or later you'll get there." (No comments about carbon footprint - please. <grin>)

That being said, EW4 is a great web site editor and is a good FTP client, and EW4 is much better than its predecessors. (Note: By "predecessors" I mean earlier versions of Expression Web and FrontPage.) I'll explain more in the following sections of this post.

Opening an FTP Site

Opening a site is straight-forward, and for the most part the user interface is the same whether you are opening a site over FTP/FTPS or over HTTP using WebDAV or FPSE.

Fig. 2 - Opening a Site in EW4

When you are opening an FTP or HTTP site for the first time, your list of managed sites will be empty. As you open sites, the list of sites will be populated for each site there you have the Add to managed sites check box selected.

Fig. 3 - EW4's Open Site Dialog Box

Once you have entered your site information, EW4 will prompt you for your remote editing options. This allows you to choose between editing the live site over FTP or editing a local copy and publishing your changes at a later date & time.

Fig. 4 - EW4's Remote Site Editing Options Dialog Box

The last dialog before opening the FTP site is the all-too-familiar prompt for your user credentials, albeit with a warning about FTP credentials being transmitted without encryption. (This is why you should use FTPS, but I'll discuss that later in this post.)

Fig. 5 - EW4's Remote Site Editing Options

Once the credentials have been verified by the FTP server, EW4 will display your site and you can begin editing your content.

Fig. 6 - An example phpBB site opened in EW4

EW4 has some basic site management functionality, which is accessed through the Site -> Manage Site List menu. From there you can add or remove sites from the list. Unfortunately you cannot modify the settings for sites in the list; you have to remove and re-add sites with different settings.

Fig. 7 - Opening the EW4 Site Manager
Fig. 8 - Viewing the list of managed sites

That's it for the simple stuff - now we'll take a look at the specific FTP topics that I've discussed in my other FTP client blog posts.

Using EW4 with FTP over SSL (FTPS)

EW4 supports both Implicit and Explicit FTPS, so the choice is up to you to decide which method to use. The FTPS method is specified by the port number that you choose when you are connecting.

I realize that I have posted the following information in almost all of my posts in this FTP client series, but in the interests of completeness it needs to be said again - the following rules apply for FTP7 when determining whether you are using Implicit or Explicit FTPS:

EW4 doesn't have a way of specifying Explicit or Implicit FTPS other than the port numbers listed above. That being said, more often than not you will probably be using Explicit FTPS on the default port (21) so you won't need to enter a port at all.

For example, if you are using EW4 with Explicit FTPS on the default port, you can skip adding a port number.

Fig. 9 - Opening a site using Explicit FTPS

However, if you are using Implicit FTPS, you need make sure that you configure EW4 to connect on port 990.

Fig. 10 - Opening a site using Implicit FTPS

Using EW4 with FTP Virtual Host Names

Because EW4's login dialog allows you to specify the virtual host name as part of the user credentials, EW4 works great with FTP7's virtual host names. All that you need to do is use the "ftp.example.com|username" or "ftp.example.com\username" syntax when specifying your username, and when you connect to the FTP7 server it will route your requests to the correct FTP virtual host site.

Fig. 11 - Specifying an FTP Virtual Host name

EW4 Does Not Support True FTP Hosts

Unfortunately EW4 does not have built-in for the HOST command, nor does it have support for entering commands that will be sent before the client has logged in, so you cannot use true FTP host names when using EW4 to connect to FTP7 sites that are configured with host names.

Scorecard for Expression Web 4

This concludes our quick look at some of the FTP features that are available with EW4, and here are the scorecard results:

Client NameDirectory
Browsing
Explicit
FTPS
Implicit
FTPS
Virtual
Hosts
True
HOSTs
Expression Web 4 Y Y Y Y N1
1 As noted earlier, EW4 has no way to send a HOST command, so true FTP HOSTs are not supported.

Note: I've included the following disclaimer in all of my posts, and this post is no exception - there are a great number of additional features that EW4 provides - once again I'm just keeping the focus on those topic areas that apply to FTP7. ;-]


Note: This blog was originally posted at http://blogs.msdn.com/robert_mcmurray/

Peace Sells, But Who's Buying?

09 July 2010 • by bob • Rants

I saw a video the other day for the song "Crying for John Lennon," which is a truly pathetic piece of hero worship about a boorish, drug addicted, womanizing narcissist. Putting aside the fact that John Lennon is no person to be admired, this video and song are another entry in a long line of juvenile visions of a world where nothing evil ever happens. The trouble with such a naïve approach to life is that it presupposes that everyone agrees with your interpretation of evil. How utterly immature.

Some cultures ignore their neighbors, some cultures fight their neighbors, while other cultures eat their neighbors. There is no common ground - there is no singular interpretation of what constitutes the concept of good or bad, much less a concept of "peace."

But for that matter, many a conquered people in western cultures have believed in peace at all costs. Crowds of angry youths who have been so sheltered by the blanket of freedoms which have been thanklessly provided for them are lulled into adolescent complacency and they form a misguided view of the world that ultimately leads to their destruction. I think that John Stuart Mill put it best when he said:

"War is an ugly thing, but not the ugliest of things. The decayed and degraded state of moral and patriotic feeling which thinks that nothing is worth war is much worse. The person who has nothing for which he is willing to fight, nothing which is more important than his personal safety, is a miserable creature and has no chance of being free unless made and kept so by the exertions of better men than himself."

For every person who dreams of pacifism no matter the cost, there are a dozen people who are willing to kill them simply for their shoes. I have travelled abroad - and I have met some of these types of people. It is difficult for simple minds to understand that there are some people in the world who hate you just because you exist. It's nothing that you have done, it's nothing that you believe, and there's nothing that you can do about it.

So while the songwriter who inspired me to write this post may be crying for John Lennon, I am weeping for our future - because if people like this songwriter continue to persist in their delusions, we are truly doomed.

Famous Amos is Out to Kill Me

15 June 2010 • by Bob • Humor

Let there be no misunderstanding – I love Famous Amos cookies. But that being said, Famous Amos is out to kill me.

If I eat a small handful of Famous Amos cookies, I will pay for it with severe heartburn that lasts for several hours. But the following week, I’ll buy another package – I know that I'm going to be in pain, but I just can't help myself.

I know that one of the hardest experiences for mankind is trying to kick the smoking habit, but I have to be honest – trying to stay away from Famous Amos cookies is much harder. At least for me, anyway.

What’s even worse is when I have just enough pocket change to buy a little bag of cookies from the vending machine and the @#$% machine won’t take one of my coins. Those machines do that just to mess with me, I’m sure of it. All I can do is stare at the bag of cookies – just out of reach – and there’s nothing that I can do. There they sit – right in front of me – taunting me to resort to drastic measures.

[Deep Sigh.]

I have to go – the day is getting late and I feel like a snack.

I wonder how much change I have?

FTP Clients - Part 8: SmartFTP Client

07 May 2010 • by Bob • FTP

For this installment in my series about FTP Clients I'm going to review the SmartFTP Client from SmartSoft Ltd. For this blog post I used the SmartFTP Client Ultimate Edition version 4.0.1105.0, and it is available from the following URL:

http://www.smartftp.com/

At the time of this blog post, SmartFTP is a for-retail product that is available in three editions: Home, Professional, and Ultimate. A description of the prices and features that are available in each edition is currently available from the following URL:

http://www.smartftp.com/features/editions.php

As for myself, I would use at least the Professional edition, and that statement is based on the features that I typically look for in an FTP client. (Although I would have loved to have had the Ultimate Edition several years ago when I used Telnet to connect to servers. <grin>)

The SmartFTP Client is pretty intuitive and it's easy to navigate within the application. If you are used to using typical Windows applications then you should find that the user interface follows most of the established paradigms that you would expect from a Microsoft application; it seemed to me that the design emulated the relevant parts of Windows Explorer, Visual Studio, and Office with an FTP focus.

For example, switching your directory listing views align with most Windows applications, and the site management functionality is managed through a hierarchical set of "Favorites."

Each "Favorite" has a variety of additional settings that you can edit by open the properties dialog for the favorite.

One of the great features in all editions of the SmartFTP client is a nicely-implemented Remote Edit functionality, which allows you to invoke your favorite editor from inside the client's GUI.

Command-Line Support versus Extensibility

The SmartFTP Client does not have a built-in command-line interface, although there is a script-based command-line interface that you can download separately from the SmartFTP web site. That being said, that script is not created by the folks at SmartSoft, and it's functionality is extremely limited.

For me personally, the SmartFTP Client's extensibility model more than makes up for the lack of command-line functionality. More often than not I'm simply using the command-line in order to script FTP operations, and the SmartFTP extensibility features provide a great deal more capabilities than I would have available to me when automating a command-line FTP client.

I haven't spent a great deal of time working with the extensibility features, but so far I am pretty impressed. I was able to take one of the samples and retool it into a simple FTP client pretty easily. (I will include that as an example in a later blog post.) In the meantime, you can download the SDK for the SmartFTP Client from the following URL:

http://www.smartftp.com/features/sdk/

Using FTP over SSL (FTPS)

The SmartFTP Client supports both Implicit and Explicit FTPS, so the choice is up to you to decide which method to use. The FTPS method is stored as the Protocol in a favorite's properties, which is easily located in the General settings for a favorite.

Once again, the following rules apply for FTP7 when determining whether to specify Implicit or Explicit FTPS:

If you are using Implicit FTPS, make sure that you configure your FTP client to connect on port 990.

Using FTP Virtual Hosts

Because the SmartFTP Client's properties for favorites allow you to specify the virtual host name as part of the user credentials, the SmartFTP Client works great with FTP7's virtual host names. All that you need to do is use the "ftp.example.com|username" syntax when specifying your username, and when you connect to the FTP7 server it will route your requests to the correct FTP virtual host site.

Using True FTP Hosts

The SmartFTP Client provides built-in support for the HOST command, which means that you can have real multi-homed FTP sites when using the SmartFTP Client to connect to FTP7 sites that are configured with host names. In order to use true HOSTs in the SmartFTP Client, you need to configure the client to send the FEAT command before logging in. This is configured in the Connection settings in the drop-down menu for "Send FEAT."

As an FYI - I had some discussions with Mat Berchtold from SmartSoft while I was writing this review, and Mat informed me that the SmartFTP Client doesn't automatically assume support for the HOST command; sending the FEAT command before logging in allows the client to discover if HOST is supported before continuing.

Host Names and Firewalls

Mat Berchtold from SmartSoft also mentioned that some firewalls do not yet recognize the HOST command, and therefore those firewalls may not pass the HOST command through the firewall. That's something to think about if you start to see connection failures related to hostnames not being found - you can check your FTP server's logs to see if the HOST command is arriving at the server.

Scorecard for the SmartFTP Client

This concludes our quick look at some of the features that are available with the SmartFTP Client, and here's the scorecard results:

Client NameDirectory
Browsing
Explicit
FTPS
Implicit
FTPS
Virtual
Hosts
True
HOSTs
SmartFTP Client Ultimate 4.0.1105.0 Y Y Y Y Y 1
1 As noted earlier, true FTP HOSTs are fully supported, but you need to configure the SmartFTP Client to send the FEAT command before logging in.

Note: I've included the following disclaimer in all of my posts, and this post is no exception. ;-] There are a great number of additional features that the SmartFTP Client provides - once again I'm just keeping the focus on those topic areas that apply to FTP7.


Note: This blog was originally posted at http://blogs.msdn.com/robert_mcmurray/

Windows 7 Hotkeys

02 May 2010 • by Bob • Windows

I put together this list for my brother when Windows 7 launched. I got the information from a variety of sources, thereby living up to the old adage that "Copying from one person is plagiarism, copying from a hundred people is research." Some of these are new to Windows 7, while others have been around a little while. In any event, here are some notes that explain how to interpret the keystrokes:

Taskbar Modifiers

Shift+Click Open a new instance of the program
Ctrl+Click Cycle between windows in a group
Middle Click Open a new instance of the program
Ctrl+Shift+Click Open a new instance of the program as Administrator
Shift+Right-Click Show window menu

Managing Windows

Alt+F4 Close the active window
Alt+Tab Switch to previous active window
Alt+Esc Cycle through all open windows
Win+Tab Flip 3D
Ctrl+Win+Tab Persistent Flip 3D
Win+T Cycle through applications on taskbar (showing its live preview)
Win+M Minimize all open windows
Win+Shift+M Undo all window minimization
Win+D Toggle showing the desktop
Win+P Open the projection menu (generally used for laptops connected to projectors)
Win+[Up] Maximize the current window
Win+[Down] If the current window is maximized, restore it; if the current window is restored, minimize it
Win+[Left] Dock the current window to the left half of the screen
• If it is already docked left, it is moved to the right half of the screen
• If it is already docked right, it is restored to its original size
Win+[Right] Dock the current window to the right half of the screen
• If it is already docked right, it is moved to the left half of the screen
• If it is already docked left, it is restored to its original size
Win+Shift+[Left] Move current window to the left monitor (with dual monitors)
Win+Shift+[Right] Move current window to the right monitor (with dual monitors)
Win+Home Minimize all but the current window
Win+Space Peek at the desktop
Win+[Plus sign] Zoom in
Win+[Minus sign] Zoom out

Starting Programs

Win+1 Open the first program on your Quick Launch bar
Win+2 Open the second program on your Quick Launch bar
Win+n Open the nth program on your Quick Launch bar
Win+U Open the ease of access center
Win+F Open the search window
Win+X Open the Mobility Center
Win+E Open Explorer
Win+R Open the Run window
Win+B Move focus to notification tray (the right-most portion of the taskbar)
Win+Pause Open the System Properties portion from the Control Panel
Ctrl+Shift+Esc Open Windows Task Manager

Logging In And Out

Win, [Right], Enter Shutdown
Win, [Right], [Right], R Restart
Win, [Right], [Right], S Sleep
Win, [Right], [Right], H Hibernate
Win, [Right], [Right], W Switch Users
Win+L Locks computer

Viewing Folders With Explorer

Alt+[Left] Go back
Alt+[Right] Go forward
Alt+[Up] Go up a directory
Alt+D Move focus to address bar
Alt+D, Tab Move focus to search bar
Alt+Enter Open the Properties window of the current selection
Ctrl+Mousewheel Change the view type (extra large, small, list view, detail, etc.)
Alt+P Show/hide the preview pane

Blog Navigation

You are on page 61 of 71 pages.

1 ... 59 60 61 62 63 64 ... 71