Monday, June 30, 2008

Only One Day Left…

Not too long ago Page Brooks and myself made the three and a half hour drive from Florence, SC to Greensboro, NC to attend the Ineta Carolina Community Leadership Summit '08. This was a great event and there we meet a lot of the local Ineta user group leaders. We also meet Andrew Duthie, aka DEvHammer. One issue that rose to the top of things we wanted to work on improving at the leadership summit was awareness of events that are occurring in the local regional area. That’s when Andrew told everyone about the project he has been working on: Community Megaphone.

I love have information at my fingertips, so I decided to write a tie-in application:

image

image

Community Megaphone Reader

Basically, this application connects to the Community Megaphone RSS feed and pulls down event data. Then it takes your current GPS position and calculates your distance from each event. Finally, it takes all the events and sorts then so you can find the event that is the closest to you. This is a great application for the traveling .NET geek. Where ever you are you can find great .NET events to attend.

The UI is paying homage to Andrew’s Community Megaphone site. I tried to match the basic colors to keep it familiar. The hyperlinks are active and will take you the event’s page on Community Megaphone. The menu only has a few options: Refresh, About, and Exit.

An application like this is really exciting, because it is tying the world of mobile together with the world wide web.

These types of mashup applications will contitue to take of for years.

LoadRss Method

   1: public static DataSet LoadRss(string requestUriString)
   2: {
   3:     HttpWebRequest feed = HttpWebRequest.Create(requestUriString) as HttpWebRequest;
   4:     StreamReader streamReader = new StreamReader(feed.GetResponse().GetResponseStream());
   5:  
   6:     string rssXml = streamReader.ReadToEnd();
   7:     rssXml = rssXml.Replace(@"<?xml version=""1.0"" encoding=""utf-8""?>", string.Empty);
   8:  
   9:     StringReader stringReader = new StringReader(rssXml);
  10:  
  11:     DataSet dataSet = new DataSet();
  12:     dataSet.ReadXml(stringReader);
  13:  
  14:     return dataSet;
  15: }

 

GetEvents Method

   1: public static List<Item> GetEvents(DataSet dataSet, GpsPosition gpsPosition)
   2: {
   3:     List<Item> items = new List<Item>();
   4:  
   5:     foreach (DataRow dataRow in dataSet.Tables["item"].Rows)
   6:     {
   7:         Item item = new Item();
   8:         item.Title = (string)dataRow["title"];
   9:         item.Description = (string)dataRow["description"];
  10:         item.Link = (string)dataRow["link"];
  11:         item.PublishDate = DateTime.Parse((string)dataRow["pubDate"]);
  12:         item.Latitude = Double.Parse((string)dataRow["lat"]);
  13:         item.Longitude = Double.Parse((string)dataRow["long"]);
  14:  
  15:         if(gpsPosition.LatitudeValid && gpsPosition.LongitudeValid)
  16:             item.Distance = GeoCodeCalc.CalcDistance(gpsPosition.Latitude, gpsPosition.Longitude, item.Latitude, item.Longitude);
  17:  
  18:         items.Add(item);
  19:     }
  20:  
  21:     items.Sort(delegate(Item item1, Item item2)
  22:     {
  23:         return item1.Distance.CompareTo(item2.Distance);
  24:     });
  25:  
  26:     return items;
  27: }

Display Events Method

   1: public static string DisplayEvents(List<Item> events)
   2: {
   3:     StringBuilder stringBuilder = new StringBuilder();
   4:  
   5:     foreach (Item item in events)
   6:     {
   7:         stringBuilder.Append(@"<span style=""color: #FFFFFF;font-weight:bold;"">");
   8:         stringBuilder.AppendFormat(@"<a href=""{0}"" style=""color: #DBB94F;"">{1}</a><br/><br/>", item.Link, item.Title);
   9:         stringBuilder.AppendFormat(@"{0}<br/><br/>", item.Description);
  10:         stringBuilder.AppendFormat(@"<b>Distance: <span style=""color: #DBB94F;"">{0} miles</span></b><br/>", item.Distance.ToString("0.00"));
  11:         // stringBuilder.AppendFormat(@"<b>{0}</b><br/>", item.PublishDate);
  12:         // stringBuilder.AppendFormat(@"{0}<br/>", item.Latitude);
  13:         // stringBuilder.AppendFormat(@"{0}<br/>", item.Longitude);
  14:         stringBuilder.AppendFormat(@"<br/><br/>");
  15:         stringBuilder.Append(@"</span>");
  16:     }
  17:  
  18:     return stringBuilder.ToString();
  19: }

Possibilities:

Andrew recently added iCalendar file support to Community Megaphone. This would be a great feature to add to a Windows Mobile application, and it is totally doable. The HTML could be a little more fancy maybe even use a few 16x16 fonts for a little personality.

Download executable: communityMegaphoneReader.cab

Download Source Code: communityMegaphoneReader.zip

Feedback:

Want more? What else would you like to see? Time’s running out only one more day. Be sure to get your ideas in soon!



Sunday, June 29, 2008 23:31:00 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Wednesday, June 11, 2008

I mentioned to the group that I would post the Prize Picker application we wrote together on my blog as part of my 30 Days of .NET series. I think this was an awesome idea, and it looked like everyone really enjoyed themselves. Hopefully, a few of them will see this post and share their thoughts as well. It was very nice to have a hands on type presentation that everyone got to participate in together. And since only one person was “driving” we didn’t have to stop and fix a disconnected monitor. Ok, we did one time, but just one time. Open-mouthed 

Big thanks to everyone that came out and participated! Page Brooks, Donny Craft, Benton Little, , Jamey McElveen , Shawn Morris, and Thad Smith. It was a lot of fun!

 

PrizePicker

Prize Picker

There is probably someone out there who doesn’t think this is the best looking application ever. Well, you’re right! It’s not, but we didn’t really focus on that any until we had a fully functional application. At that point it was time to pick prizes for the lucky hopefuls that became winners at the event.

The only big item we didn’t implement, was an item that came up right at the end, we wanted to show the last winner in the area down at the bottom of the screen in big blog letters. And we wanted to rotate through remaining hopefuls and then finally pick a winner moving them to the winners table.

The application is a firm believer of the KISS principle. We did the entire application in about an hour and a half. And that is including some refactorings, and changes we made along the way. I’m pretty happy with the application, and will love it once we have the “Jackpot” style UI element added.

We added validation as we needed it, and decided to keep the applications logic in the UI, as hard as it was for us to do, to in this case to follow our KISS guidelines.

We have used RNGCryptoServiceProvider class already in the Pocket PasswordGen application on day six. This class makes sure that our random numbers are statistically random and not pretend watered down random.

   1: Byte[] randomBytes = new byte[4];
   2:  
   3: RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
   4: rng.GetBytes(randomBytes);
   5:  
   6: // Convert 4 bytes into a 32-bit integer value.
   7: int seed = (randomBytes[0] & 0x7f) << 24 |
   8:             randomBytes[1] << 16 |
   9:             randomBytes[2] << 8 |
  10:             randomBytes[3];
  11:  
  12: int pick = seed % listViewHopefuls.Items.Count;

 

Download executable: prizePicker.cab

Download Source Code: prizePicker.zip

Feedback

The cool thing is we used this application to actually pick the winners for the prizes, and everything went great. So our intention is to keep using it from now. We are also going to post it on CodePlex soon and allow others to work on it as well.



Wednesday, June 11, 2008 02:55:00 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Saturday, June 07, 2008

I had a couple submissions for ideas to use in today's application, but decided I would use one of my own. Friday night and all: girlfriends like to go out on Friday evenings, we need to go shopping, and later we want to watch a little TV together, so I didn't feel tonight was the best night for a big project.

My idea is a simple yet very useful application for generating random passwords.

image

Pocket PasswordGen

Nothing too fancy here. It's a good looking application, but it didn't take much to make it so. Just clean layout and simple design. I did add a horizontal ruler line between the inputs and the outputs. It is actually two panels set to 1 pixel high each with ones back color set to light blue and the other pure white. The form's background is just a little off-white to add some warmth, but it is hard to tell directly.

The application engine is also clean and simple. There is a password class that has properties for each of the options, and there are two methods: Generate, and ConvertToPhonetic.

I have four character groups:

     static string  lowerCase = @"abcdefghijklmnopqrstuvwyxz";
     static string upperCase = @"ABCDEFGHIJKLMNOPQRSTUVWYXZ";
     static string numbers = @"0123456789";
     static string punctuation = @"~!@#$%^&*()-+='"",.?";

Based on options the user chooses a character list is created with all possible characters for the user's password.

Next I Generate PasswordLength worth's of characters for the password.

This is very important. I use RNGCryptoServiceProvider to generate a random seed number for the random number generator. We want real random numbers, not wishy-washy random numbers. This is a good source for how to use Crypto providers to make a password generator.

Pretty cool code, so check it out if you haven't ever generated random numbers before.

I pulled the Phonetic Alphabet off Wikipedia and made it into a generic dictionary object.

Lastly, I added a menu item that allow users to copy the password to their clipboard. I had to write some code to copy text into the clipboard. This is the best code I could find for doing so.

BTW, there is a bug in the above screenshot. Fixed in the current release. Can you see it? It's subtle. It has to do with the handle the last character. Good luck finding it.

Download executable: passwordGen.cab

Download Source Code: passwordGen.zip

Feedback

Nothing but positive feedback so far. I really appreciate. It seems we are off to a good start. Still I have another 24 days left, and only a handful of ideas I really like. So don't keep that good idea to yourself. One comment on the blog and you might have yourself your first Windows Mobile custom application.



Saturday, June 07, 2008 01:35:45 (Eastern Standard Time, UTC-05:00)  #    Comments [5]  |  Trackback
Thursday, April 10, 2008

image

Heroes Happen {Here}: Hands On Lab Manuals [Source: Paulo's Blog]
Windows Server 2008
Download All (zipped file: 7.32 MB)
Visual Studio 2008
Download All (zipped file: 13.2 MB)
SQL Server 2008
Download All (zipped file: 20.5 MB)

Hands On Lab Manuals

Windows Server 2008
Download All (zipped file: 7.32 MB)
Visual Studio 2008
Download All (zipped file: 13.2 MB)
SQL Server 2008
Download All (zipped file: 20.5 MB)

Thursday, April 10, 2008 03:00:25 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Wednesday, April 09, 2008

imageIt's almost that time. What time is it you ask? Well, it's only 4 days, 02 hours, 20 minutes, and 22 seconds left until this year's Microsoft Most Valuable Professional Global Summit.

And the best part, at least for me :D, is that'll I'll be going this year. I can't wait to meet all the other MVP's, and to get to hang out with some of my developer friends that I don't get to see nearly enough.

This year's conference looks to be really exciting. I'm expecting some big news to come out of Redmond next week.

And I was able to find a great "utility" to help me keep track of when the conference starts: :D

Windows Vista "MVP Global Summit Countdown" Sidebar Gadget



cool | INETA | miscellaneous | MVP | personal | windows
Wednesday, April 09, 2008 16:49:28 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Tuesday, April 08, 2008

imageAbout a dozen of us are getting up early tomorrow, leaving at 4:30am, to ride up to Charlotte, NC to attend the Windows Server 2008, Visual Studio 2008, and SQL Server 2008 launch event there.

Not only do you get to attend a great event hosted by Microsoft for free. But you'll also get to take home a promotional kit with versions of all three products.

You should definitely make a point of attending one of the launch events in your area!

http://www.heroeshappenhere.com/

I'll try and twitter updates from the event live tomorrow: http://twitter.com/CJCraft



Tuesday, April 08, 2008 03:00:48 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Monday, April 07, 2008

Due to the scheduling conflict with the Heroes Happen Here Event in Charlotte, the April PDANUG Event has been moved to April 29th, 2008.  More details to follow.  See you all in Charlotte tomorrow!


imageTuesday, April 29th, 2008
Chris Reeder, Chris Craft, and Page Brooks

Topic:
SQL Server 2008, Windows Server 2008, and Visual Studio 2008 (Respectively)

Tuesday, April 29th, 2008, is the next meeting of the Pee Dee Area .NET User Group.

Chris Reeder, Chris Craft, and Page Brooks will be presenting on the latest exciting new products from Microsoft.  First, Chris Reeder will give us a run down on a few cool features in SQL Server 2008.  Next, Chris Craft will take us on a tour of some excellent new features in Internet Information Services 7 (IIS7).  Page Brooks will finish off the presentation with a few cool tips and tricks in Visual Studio 2008.

Please click the link below to register.  We use this information to determine how much food to buy!

Here is the tentative schedule:
6:00 PM - 6:20 PM Socializing / Free Dinner
6:20 PM - 6:30 PM Introduction, Sponsor Time, and News.
6:30 PM - 8:00 PM Presentations



Monday, April 07, 2008 03:00:08 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Friday, April 04, 2008

imageDuring my "Welcome to the World of Windows Mobile" presentation at the Atlanta Code Camp 2008 I used Remote Display for Windows CE to allow the attendees to see my device, on my desktop, on the presentation screen. After my talk was over, a few people from the audience approached me, and asked me how I was able to run Remote Display on Vista, and connect with it to my Windows Mobile 6 device.

They told me they had tried to do the same thing, but all they ever got was a "the OS or CPU of this device is unknown to this application" error. I explained that this wasn't due to Vista, but actually was caused by a missing file on most newer Windows Mobile devices.

In order to use Remote Display the first thing you will need to do is download the Windows Mobile Developer Power Toys, and install the ActiveSync Remote Display application.

Windows Mobile Developer Power Toys

ActiveSync Remote Display - Display Pocket PC applications on your desktop or laptop without needing any device side configuration.

Work Around:

Copy the cerdisp2.exe file from the desktop's "\Windows Mobile Developer Power Toys\ActiveSync_Remote_Display\Devices\wce400\armv4\" folder, and paste it into the device's "\windows" folder of your Windows Mobile device.



Friday, April 04, 2008 03:00:06 (Eastern Standard Time, UTC-05:00)  #    Comments [1]  |  Trackback
Tuesday, April 01, 2008

imageOf course, I would get this on April Fools Day, but I've verified it and it is for real!
Dear Chris Craft,

Congratulations! We are pleased to present you with the 2008 Microsoft® MVP Award! The MVP Award is our way to say thank you for promoting the spirit of community and improving people’s lives and the industry’s success every day. We appreciate your extraordinary efforts in Device Application Development technical communities during the past year.

This is a great honor and privilege for me to have received. Thank you Microsoft, it means a lot to me!

What is a Microsoft Most Valuable Professional, MVP?

http://mvp.support.microsoft.com/

Microsoft Most Valuable Professionals (MVPs) are exceptional technical community leaders from around the world who are awarded for voluntarily sharing their high quality, real world expertise in offline and online technical communities. Microsoft MVPs are a highly select group of experts that represents the technical community's best and brightest, and they share a deep commitment to community and a willingness to help others.


Tuesday, April 01, 2008 11:52:53 (Eastern Standard Time, UTC-05:00)  #