Update to Store Locator Project

by Donn Felker 31. December 2008 06:30

I had a real rookie JavaScript mistake in my Store Locator project that was causing some people some grief. I had no idea this project was actually being used by many people for real live stores and companies. That's kind of cool (until it breaks).

Anyway, something changed (somewhere - probably the Google Maps API) and people had issues with the map showing up when it shouldn't have. Oops.

Anyway, I just fixed it and posted a new release to CodePlex. Get it here.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | GIS

Sometimes you just have to burn one

by Donn Felker 30. December 2008 07:44

This is really old news to some blogger's,but I'm posting it again because a lot of people I know are just starting off in the blogging space. 

If you have a blog you're probably wondering how many people are reading it. You can get some decent statistics from your feed (RSS/ATOM, etc). However, most blog engines do not provide a way for you to get at the really good statistics of your blog.

For a lot of people your RSS feed is your interface into your blog. Personally, I NEVER go straight to a blog from typing in the URL. I use Google IG as a feed aggregator. There are tons of other tools for this, but I personally like Google IG. I set it to my home page and I can read stuff as I encounter it and I don't have to open ANOTHER program to read WEB items.

Ok, so you already have an RSS feed. So what? Do you know how many people subscribe to it? Do you know what types of browsers they use? Do you know how many people you had 1 month ago? Probably not.

 

Would you like to know?

 

feedburner If so, then Feed Burner could be of some use.

Benefits of Feed Burner include:

  • Less bandwidth pull on your RSS feed. Hanselman (among many others) have stated that their RSS bandwidth is crazy huge. Moving it to Feed Burner can remove that bandwidth polling.
  • Statistics on how many subscribers you have to your feed.
  • If you move locations your feed stays the same. Just update the location of your blog in Feed Burner. This is especially useful if you are part of a community such as Blogspot and then decide to move your blog to your own domain or another community. You don't  loose subscribers when you move (muy importante).
  • Ping Shot - Notifies feed reading services that your blog has been updated.
  • Email Subscriptions - Allow people to get updated via email when your blog is updated.
  • Stats... graphs, and pictures... :) as shown below ....
  • And a lot more ....

 

The best part is... its free.

 

So what's the downfall?

Single point of failure. If Feed Burner goes down, your blog is down to readers. I think I've only see this happen ONCE in the years I've used it. It was only down for maybe an hour or so. This could have been scheduled, who knows.

 

Also, no, I did not get paid to write this ... I actually like the service so much that I wanted to write about it.

 

 

Subscriber Reader Type Break Down

FeedBurner_without_Google2

 

Feed Dashboard - See what's happening and when

image

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Misc | Productivity

New Dime Cast: Migrating from .asmx web services to WCF web services

by Donn Felker 30. December 2008 07:29

Woo hoo! I created another Dime Cast and its up and running today!

Learn how to migrate from your old asmx web services to new fancy WCF web services.

Check it out here

dynomite 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

WCF

Beginning Programming Audio: ASIO4ALL Is Picky

by Donn Felker 29. December 2008 10:54

I'm delving into some audio based development with Mark Heath and the NAudio library for a side project. This is a ton of fun and I hope to make a good presentation out of it for some code camps and eventually larger venues.

Everything was going good until I started playing with the MIDI controller. The set up was fine, however whenever I plugged in a MIDI controller into the laptop I'm using I would get that hiss/pop/crackle sound when I hit the keys on the controller (I use an AKAI MPD 24 for a MIDI controller). This is caused by buffer under-runs to and from the software from the controller. Basically, the sound buffer has to be full and ready to play when I hit a key. The lower the latency setting, the more buffer under-runs I got - the more snap-crackle-pop. Not good.

Here is a screen shot from FL Studio with the number of under runs:

image

Well... bump up the buffer length then, right? Well, not really. When you bump up the buffer length this bumps up the time that the software will return from a key hit. In music, if you hit a key, you expect a sound immediately. So if you have 100 millisecond latency to fill the buffer that's 1/10 of a second off. THAT IS A LIFETIME between key hits. Imagine playing a piano and hitting a key and the sound doesn't emit until 1/10 of a second later. When it comes down to it, this makes playing/recording music impossible and really crappy.

 

Welcome ASIO4ALL

ASIO4ALL Helps solve this problem. ASIO stands for "Audio Stream Input/Output" ...

ASIO bypasses the normal audio path from the user application through layers of intermediary Windows operating system software, so that the application connects directly to the soundcard hardware. Each layer that is bypassed means a reduction in latency, the delay between an application sending sound to the sound being reproduced by the soundcard. In this way ASIO offers a relatively simple way of accessing multiple audio inputs and outputs independently. Its main strength lies in its method of bypassing the inherently high latency of Windows audio mixing kernels (KMixer), allowing direct, high speed communication with audio hardware. Unlike KMixer, an unmixed ASIO output is "bit identical", that is, the bits sent to the sound card are identical to those of the original WAV file, thus having higher audio fidelity. [Source]

ASIO4ALL is a free driver that you can download to get this improved speed:

ASIO4ALL is a hardware independent low latency ASIO driver for WDM audio devices. It uses WDM Kernel-Streaming and sometimes even more sophisticated methods to achieve its objectives. [Source- Project Brief]

 

It Works, Sometimes

I installed the driver, set it up in my audio software (FL Studio) and got to town with some sound development. Sounds simple? Right? Well, you sort of need a little luck to get it running sometimes. I had some problems with the driver working intermittently. It took a few hours to figure out what was going on.

The problem had to do with streaming media such as You Tube. I would watch something on You Tube and then my ASIO4ALL driver would stop working.

 

The Fix

imageAs soon as I closed FireFox or IE (which YouTube was running in) the driver would start working again. It looks like something in FireFox or IE grabs a hold of the sound driver it needs (not the ASIO one), forces itself to be the primary and kills all other drivers (I think, maybe - I'm sure someone on 'teh internets' knows more about this than me - so please chime in).

So the fix? Close all other windows/apps that play sound while working with something that utilizes ASIO4ALL.

Now, when I have my buffer length set to 7 milliseconds, the under-runs are absolutely ZERO and my latency is gone - well, its 7ms, but that's virtually nothing.

The a screen shot with ASIO4ALL shows it all.

I can now hit the keys on the MIDI controller, have an effective response and actually play music as it is meant to be played.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | Audio

Prism Drop 8 Breaking Changes

by Donn Felker 23. December 2008 06:26

The Prism team dropped another version of Prism last Friday at the usual spot: www.codeplex.com/compositewpf . This is Drop 8 of their product.

Breaking Change #1 - Cannot Find CompositeWpfEvent

However, there is not note of a breaking change in this drop that is not noted in the release notes.

The type "CompositeWpfEvent" has now been changed to "CompositePresentationEvent". I had to hunt around in reflector for a few minutes to find what they had they had changed it to. Update your composite events to inherit from that new class name and you'll be good to go.

Example:

Pre Drop 8:

public class CustomerAddedEvent : CompositeWpfEvent<Customer>
{

}

 

Post Drop 8:

public class CustomerAddedEvent : CompositePresentationEvent<Customer>
{

}

 

Breaking Change #2 = ModuleCatalog.Groups.Add Not Found

Here's what the previous code looks like:

var catalog = new ModuleCatalog();
catalog.Groups.Add(
	new ModuleInfoGroup {InitializationMode = InitializationMode.WhenAvailable}
		.AddModule(typeof(MyTestModule).FullName, typeof (MyTestModule)));
return catalog;

 

here's what it looks like now:

var catalog = new ModuleCatalog();
catalog.AddModule(typeof (MyTestModule), InitializationMode.WhenAvailable);
return catalog;
They changed the catalog so that the Modules and Groups return an Enumerable of the modules or groups. You cannot "Add" to an Enumerable return value. You can only get the enumerator on it and iterate through it (and then do some other stuff etc).

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Silverlight

Intro to WCF Screen Cast Now Available

by Donn Felker 16. December 2008 03:48

I have a new Screen cast available on  DimeCasts.net. It is entitled "Introduction to WCF: Creating your first Service".

In this episode we will take a look at how to create your first WCF service. We will first walk you though the ABCs of what a WCF service is, we will then show you step by step how you can create a service.

Click here to watch.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

WCF

Speaking at the Twin Cities Code Camp 2009

by Donn Felker 10. December 2008 03:20

I will be speaking at the Twin Cities Code Camp 2009. The topic I will be presenting is:

"Testing With Mocks"

Abstract: Test this, test that, no problem. But what about when we need to start building full object graphs into our test in order to test an interaction or state? Yeah, Houston, we have a problem. With mocks we can streamline development by mocking out dependencies. Mocks will allow us to not only mock our dependencies but to also test our interactions and state very easily. In this session learn how to use mocks in your day to day testing.

 

The date for the event is: April 4th, 2009

For more info please visit the web site: www.twincitiescodecamp.com

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Events

Twin Cities Give Camp - April 26th and 27th 2009

by Donn Felker 5. December 2008 02:53

The Twin Cities Give Camp is set. The date of the camp is April 26th and April 27th. If you are in the Twin Cities area (Minneapolis/St Paul, MN) please consider helping out the cause. We need sponsors, and volunteers. At this time we're working on securing our charities.

If you have a charity that you feel should be considered for the give camp,  please email me through my contact page. We're mainly going after charities that benefit the following causes:

  • Children
  • The Disabled
  • Elderly
  • Animal & Wildlife

 

You can volunteer at the web site www.TwinCitiesGiveCamp.org.

 

Please volunteer!

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Events

How To: REST Services in WCF 3.5 Part 2 - The POST

by Donn Felker 3. December 2008 17:29

This post is part of a series.

 

Implementing a POST HTTP Verb Call

In this post we're going to cover what it takes to implement a PUT into our REST Service that we defined in Part 1 of this series.

First of all, what is the POST HTTP verb for? To understand this lets take a look at how a HTTP Get call is formed from an HTTP Header perspective. A GET request fetches data from a web server based solely on a URL value and a set of HTTP headers.

HTTP GET Header Example:

GET /index.html?userid=joe&password=guessme HTTP/1.1
Host: www.example.org
User-Agent: Mozilla/4.0

In this example the Get requests from a host (www.example.org) with the Mozilla/4.0 type browser and is asking for the index.html page with the query string values userid and password (and their corresponding values).

Now for the HTTP POST... POST request sends additional data to the web server, specified after the URL, the headers, and a blank line to indicate the end of the headers. An example:

POST /login.aspx HTTP/1.1
Host: www.example.org
User-Agent: Mozilla/4.0
Content-Length: 27
Content-Type: application/x-www-form-urlencoded

userid=joe&password=guessme

 

At a very simple level - A POST is normally done from a web form. When we fill out a form and send the data the form attribute "method" is set to "post".

If you want the super formal explanation of POST check out the POST definition on the W3C site.

 

The implementation in WCF

In the previous example we used a simple Gas Price Service. This next service is something a little different. Lets assume that we have a comedy web site that allows users to get "insults" and "save insults". We are going to use this example, and its called the "Insult Service". Its a very simple REST service that insults you or your co-workers or anyone else for that matter. Kind of fun to mess around with. This version of the insult service has the following methods:

  • GET: Insult someone (an exact copy of the previous part 1, just in a different context)
  • POST: Add a new insult

To receive an insult we ask the insult service to insult someone via the GET (again, this is the same as the previous example).You would call the service like this: http://localhost:7000/insult/{personsNameToInsult}  .

NOTE: The insult service grabs a random insult from a list of insults and returns it to the user.

Here it is in action: Replace {personsNameToInsult} with "Donn" (minus the quotes)

image 

Here is the GET in code from the WCF Service Contract:

 

[OperationContract]
[WebGet(RequestFormat = WebMessageFormat.Xml,
	ResponseFormat = WebMessageFormat.Xml,
	BodyStyle = WebMessageBodyStyle.Bare,
	UriTemplate = "/insult/{personToInsult}")]
Insult GetInsult(string personToInsult);

 

Now, to implement the POST we need a way to tell the server that we want to POST data to a service. Here's how we do it in WCF:

 

[OperationContract]
[WebInvoke(RequestFormat = WebMessageFormat.Xml,
	ResponseFormat = WebMessageFormat.Xml,
	BodyStyle = WebMessageBodyStyle.Bare,
	UriTemplate = "/insult/Add/{insultName}/{insultText}", 
	Method = "POST")]
void AddInsult(string insultName, string insultText);
In this service contract we are telling WCF that the URITemplate is going to be as such:
/insult/Add/{insultName}/{insultText}
Where {insultName} and {insultText} map to the string values in the "AddInsult" method. To add an insult we'd have a POST request that looks like this:
http://localhost:7000/insult/Add/TestInsult/This+is+a+test+insult
However, if we type this into the Browser window we will get the following:

image

This is because the web browser by default performs a GET operation on the URI that is posted into the address bar.

So how do we POST? We can either build a web form to do it for us, or we can use a web debugging tool.

 

Adding a New Insult: The POST

Since we do not have a web front end for this service we need to construct a HTTP POST manually. We can do this with Fiddler. Fiddler is a Web Debugging tool that allows you to inspect HTTP Traffic and construct requests. We're going to use it for constructing our POST call. (You could also create a simple web form to do this as well).

Constructing the POST:

  1. Install Fiddler
  2. Open Fiddler
  3. Open the request builder
  4. Select Post
  5. Build the request
  6. Submit the request

...

3. Open the request builder

image

 

4. Select POST

image

 

5. Build The Request

 image

Like this:

image

 

6. Submit the request

image

At this point our service has been called and the values have been written to the data repository (db or file, etc).

Now lets see if the insult shows up in our service. Lets hit refresh on our GET page a few times to see if it shows up. Which it should.

image

 

Conclusion

As you can see, its fairly simple to implement a POST action to add new values to a WCF REST service. This has been done utilizing the WebInvokeAttribute to handle our POST action.

Additional Reading:

 

Download Code

Part2.zip (~11kb)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

WCF

SVCUtil & VS2008

by Donn Felker 2. December 2008 05:56

After some research into a Service Reference problem I was having with Silverlight I came to find out (but not officially) that VS2008 DOES NOT use SvcUtil under the hood to get its service reference. It uses its own internal implementation of a proxy generation tool. I'll have to confirm this conclusion with some authority/book/etc, but if this is the case, I made a statement in Dime Cast 67 (WCF Rest Part 1) that informed viewers that VS2008 uses SVCUtil under the hood.

I'll see what I can find out and post it back here when I confirm my thoughts.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

WCF

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Donn Felker

Senior Consultant
MCTS
ScrumMaster
Agile Practitioner

About Me | Books I Recommend

Gotta Pay The Bills


Tag cloud

    Popular Posts

    RecentComments

    Comment RSS

    Calendar

    <<  January 2009  >>
    MoTuWeThFrSaSu
    2930311234
    567891011
    12131415161718
    19202122232425
    2627282930311
    2345678

    View posts in large calendar