Welcome

You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

Introduction To Silverlight with Brian Sullivan at HubCityNUG Nov. 18th 2010

Posted by Keith Elder | Posted in .Net | Posted on 31-10-2010

 

Brian Sullivan will be at HubCityNUG for the month of November giving a presentation on “Introduction to Silverlight”.  If you are in any of the following cities located near Hattiesburg, MS we hope you’ll come out on Thursday November 18th, 2010 for Hub City .NET User Group meeting:

  • Hattiesburg, MS
  • Meridian, MS
  • Jackson, MS
  • Biloxi, MS
  • Gulfport, MS
  • Mobile, AL
  • New Orleans, LA

About the Speaker

brian_sullivan

Brian Sullivan is a developer analyst for Falcon Applications, LLC in Shreveport, LA.  He got his start in programming maintaining legacy mainframe applications in COBOL at a large trucking company, but quickly realized he needed to find a more productive environment in order to stay sane.  He jumped at the opportunity to help transition some of those COBOL applications to .NET, and he hasn’t looked back since. He has been working with Microsoft technologies for about 5 years, and is interested in increasing the exposure of agile techniques and methodologies in the Microsoft developer community.  He currently runs the Shreveport .NET User Group and speaks frequently at local user groups and regional conferences. Brian is a graduate of Harding University in Searcy, AR.

Presentation: Introduction To Silverlight

Abstract: Silverlight is a powerful development platform for creating engaging, interactive experiences for web, desktop, and mobile applications, both online and offline.  In this presentation, Brian will highlight some of the features that make Silverlight a unique development platform, discuss why you might (or might not) choose Silverlight for your next application, and dive into the process of creating a Silverlight app, from laying out your UI in XAML to calling web services to access your data. 

Register Here!

(while the event is free, we ask you to register so we can plan better for food)

http://hubcitynugnov2010.eventbrite.com/ 

Time: 7:00 PM (6:30 PM food starts)

Location: University of Southern Mississippi

Directions

Joseph Cook Library – Room 123
University of Southern Mississippi Campus
Hattiesburg, Mississippi 39401

Map:http://lib.usm.edu/about_us/floor_and_campus_maps/map_to_cook_library.html

Room 123 is located in the back of the common study area on the right hand side.

Prizes and Free Food

Food will be served for those attending this event.  Please arrive early starting at 6:30PM to eat.

We have books to give away and free software from Telerik.

Writing Unit or Integration Tests That Rely on Events Firing

Posted by Keith Elder | Posted in .Net, C# | Posted on 22-10-2010

For the past week or so I’ve been working on wrapping the Sonic API to simplify it for developers at my company.  The API itself is pretty much a straight port from Java.  There is nothing C# about the API.  For example no enumerations, no generics, no nothing.  This means when you are using the API you see functions that take a parameter that is just an integer since there are no enumerations for example.  That wouldn’t be so bad if the code was documented in the proper C# way but it isn’t.  So, instead of having 100+ developers at work learn how Sonic works I have been coding up several scenarios that we need to support for the business. 

In my quest to wrap the Sonic API into a more C# centric approach I needed to write some tests obviously to make sure things were working.  Primarily these are integration tests as each test relies upon connecting to a Sonic dev environment. 

If you aren’t familiar with Sonic it is an enterprise messaging platform.  It does pub/sub, supports queues, fault tolerate and so on.  I think the stock market even uses Sonic to route messages so it has a proven track record. 

One of the scenarios I had to cover was I needed to send a message to a queue and then have that message pulled out of the queue on the other side, processed and acknowledged.  In order to do this there is one object that sends a message, and another object that is listening for a message(s).   But how do you write a test that waits on an event to happen?  Well, it turns out we’d done this before in other tests but I couldn’t for the life of me remember how.  So here’s how it works. 

Using an EventWaitHandle we can wait on an event to occur.  First is to create a handle.

   1: EventWaitHandle handle = new ManualResetEvent(false);

Using the handle we can tell it to WaitOne() which blocks the current thread until the WaitHandle receives a signal.

   1: handle.WaitOne();

Then inside our event we simply call handle.Set() (this is the signal). 

Putting all of this together we can write an integration test that sends a message to Sonic and then waits for that message to come through.  Obviously the Sonic piece doesn’t really matter, the important piece here is how to get a test to wait for an event.  Putting it all together it looks like this.

   1: [TestMethod]

   2: public void Can_Send_To_Queue_And_Receive_Message_From_Queue()

   3: {

   4:     EventWaitHandle handle = new ManualResetEvent(false);

   5:     SonicQueueSender sender = new SonicQueueSender(Helpers.SonicQueueArgs);

   6:     string sendMsg = "test";

   7:     sender.SendMessage(sendMsg, SonicDeliveryMode.NonPersistent);

   8:     SonicQueueReceiver consumer = new SonicQueueReceiver(Helpers.SonicQueueArgs);

   9:     string receiveMsg = "";

  10:     consumer.MessageRecieved += (mySender, args) =>

  11:         {

  12:             TextMessage txtMsg = (TextMessage)args.Message;

  13:             receiveMsg = txtMsg.getText();

  14:             handle.Set();

  15:         };

  16:     consumer.StartListener();

  17:     handle.WaitOne();

  18:     Assert.AreEqual(receiveMsg, sendMsg);

  19: }

Hope this helps someone out.

Protected: Catfishing with Keith

Posted by Keith Elder | Posted in Fishing | Posted on 17-10-2010

This content is password protected. To view it please enter your password below:

Taco

Posted by Keith Elder | Posted in Family, Funny Stuff | Posted on 07-10-2010

Last night I was driving home and saw something run out in front of the truck.  Turns out it was a very young Chihuahua puppy. He ran up under the truck and I spent the next few minutes trying to coach him out with no luck. 

Finally some neighbors that live down the street stopped to help.  But then again we couldn’t get him out.  Ellen (wife) drove by and we decided we could get him out with some food.  Long story short after about 20-30 minutes we finally got him out from under the car. 

Without any further adieu I give you TACO!

IMG_0164

The poor guy was just scared to death.  I can’t blame him, he’s only a few inches tall.

I brought him home and gave him food and water and watched over him as he didn’t want to leave my side.  Last night he spent the night in my bathroom. 

This morning Taco and I took the trash out and I showed him the best spots in the yard to use the bathroom.

I’m not sure what we’ll do with him if we can’t find his owner (I honestly think someone dropped him off), but whatever it is it Taco will have a better life.

“Then shall he answer them, saying, Truly I say to you, Inasmuch as you did it not to one of the least of these, you did it not to me.” Matthew 25:45

Update – 10:27AM Oct. 7th

It didn’t take Taco long this morning to start running the kingdom.  He has officially taken over.  He managed to overthrow the other two dogs without a fight and take their bed. 

IMG_0165

The other dogs retreated under my desk to take watch to see what Taco’s next move was going to be. 

 IMG_0166

Update – 12:27PM Oct. 7th

Taco is a dog of compassion.  He thought about it for awhile and came to the conclusion it wasn’t fair for the other dogs who were here first. Thus he allowed them to come back and rest.  But only if they gave him the best spot.

IMG_0167

Chris Eargle Speaking at HubCityNUG October 14th 2010

Posted by Keith Elder | Posted in .Net, Community | Posted on 24-09-2010

If you are in any of the following cities located near Hattiesburg, MS we hope you’ll come out on Thursday October 14th, 2010 for Hub City .NET User Group meeting:

  • Hattiesburg, MS
  • Meridian, MS
  • Jackson, MS
  • Biloxi, MS
  • Gulfport, MS
  • Mobile, AL
  • New Orleans, LA

About The Speaker

Chris Eargle is a Microsoft Most Valuable Professional – C# and INETA Community Champion from Columbia, SC, USA. He has designed and developed several enterprise and open source applications, and he runs the local .NET User Group: the Columbia Enterprise Developers Guild. He is a frequent guest of conferences and community events promoting best practices and new technologies. His blog, kodefuguru.com, has been featured on ASP.NET, MSDN, and Reddit.

Presentation: Secrets of a .NET Ninja

In my years developing C# applications, I have seen techniques both good and bad. I will demonstrate those that are good, rant against those that are bad, and reveal those unknown to many.  Whether a novice or a seasoned coder, you will find something useful, or perhaps even wicked, that you can do with C# and the .NET Framework.

Register Here!

(while the event is free, we ask you to register so we can plan better for food)

http://hubcitynugoct2010.eventbrite.com

Time: 7:00 PM (6:30 PM food starts)

 

Location: University of Southern Mississippi

 

Directions

Joseph Cook Library – Room 123
University of Southern Mississippi Campus
Hattiesburg, Mississippi 39401

Map: http://lib.usm.edu/about_us/floor_and_campus_maps/map_to_cook_library.html

Room 123 is located in the back of the common study area on the right hand side.

Prizes and Free Food

Food will be served for those attending this event.  Please arrive early starting at 6:30PM to eat.

We have books to give away, free software from Telerik, JetBrains, and DevExpress.