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

0

 

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

1

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.

Chris Eargle Speaking at HubCityNUG October 14th 2010

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

0

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.

Hub City NUG Meeting Oct 14th 2010!

Posted by Keith Elder | Posted in .Net | Posted on 23-09-2010

0

Just a quick plug so you know sooner than later.  Starting Oct 14th we are starting http://hubcitynug.org back up at the University of Southern Mississippi!  More details will follow but save the date!  As soon as we finalize all the details I’ll let you know.  If you haven’t already, be sure to join the mailing list.

SQL Saturday 28 in Baton Rouge – A Blast

Posted by Keith Elder | Posted in .Net, Speaking | Posted on 16-08-2010

3

Before I even start about the event I need to thank INETA who made Saturday’s event possible.  INETA sponsored the “.NET From Scratch” track at SQL Saturday #28 in Baton Rouge this past Saturday.  So thank you INETA for helping out to make this happen!

The event was a top notch run event thanks to Patrick LeBlanc, Mike Huguet and others from the Baton Rouge area.  By the way, Patrick runs the SQL group in BR (Baton Rouge) and Mike runs the .NET User Group there, both great groups.

Friday evening we met up at Mike Anderson’s Seafood in Baton Rouge for a speaker dinner.  They had me at seafood.  I will say this is the first speaker dinner I’ve been to where there was crawfish.  Awesome!

6

After a good meal, great conversation, and fun I headed back to the hotel to work on demos, slides, and run through the deck one more time. 

The next morning I made it over to the LSU campus.  The last time I was on campus it was for a LSU vs Southern Miss football game back in the mid ‘90’s when I was in college. 

For the .NET From Scratch track we had attendees register for the track so we’d be able to gage attendance.  The room only held 50 people and I’m happy to say we filled the room and even had to cut the registration off.  What does that tell you? It tells you that even though we are at version 4.0 of the .NET framework, there is a huge void out there that speakers continue to ignore which is a way for new developers to learn about the platform. 

5 

I wanted to say thanks to those that came to the track on Saturday.  I mean this when I say I had a blast!  It was such a great group and I hope it was worth your time.

1

As promised I zipped up the slide deck and the demos.  You can download them here:

.NET From Scratch Slide Deck and Demos

Hope to see you next year!