The Twitter API: The Schrodinger's Cat of Web Service APIs

January 25 2010

I just started reading Professional Twitter Development: With Examples in .NET 3.5 (Wrox Programmer to Programmer) and came across this quote, which cracked me up:

The Twitter API is the Schrödinger’s cat of web service APIs. Until you call it, you never know if it's alive or dead. Sometimes the mere act of calling it is enough to kill it.
--Scott Koon,Witty

Hilarious. And true.

The Importance of Using CNames with Windows Azure

January 22 2010

I recently had to move an Azure service from one account to another.  Unfortunately, they could not migrate my account, which meant that I manually had to migrate it.  In the case of the service, I had created a cname {name}.mysite.com that pointed to the Azure DNS name ({name}.cloudapp.net).  Lucky me: I was able to migrate the service and then repoint the CName to the same DNS entry with no changes or problems.  But in the case of my blob storage ({name}.blob.core.windows.net) I hadn't created a Cname, which means I manually have to update any reference to anything in blob storage. 

Lesson learned: use CNames for everything in Azure in case you need to transfer accounts, ownership, etc.

Using Cerebrata's Cloud Storage Studio To Download IIS logs from Multiple Instances of Windows Azure

December 18 2009

I've written before about the most excellent tool Cloud Storage Studio by Cerebrata. I use exclusively for uploading blobs to Windows Azure as well as downloading my IIS log files. I just hit an issue as far as IIS logs which (fortunately) easily resolved. By default, Cloud Storage Studio does not preseve path settings when downloading files.  This presents a problem if you have multiple instances of your application on Windows Azure, because, when you go to download the log files, there will be duplicate log file names (aka  "u_ex09121403.log") from your different instances. 

The fix is easy. Go into options and see if the "Preserve directory path information in blob name when downloading files & directories" setting checked or not? You can check this setting either under "Configuration Settings --> Container/Blob Setting" or under "Download Window --> Download Settings" By default it is unchecked. If it is checked, then Cloud Storage Studio will preserve the folder hierarchy. You may need to restart the app after you set it as it didn't pick up my configuration changes after I set it. (They need to implement INotifyPropertyChanged!)

 

Incarnate

December 16 2009

 Just shipped Incarnate, a new lab from the fresh new looking Mix Online site. I think the appropriate tagline for Incarnate is "Who do you want to be today" as people are quickly realizing that it can be more entertaining to be a celebrity avatar than yourself.

Now you know what all those posts about JSON-P, Windows Azure, REST Starter Kit and more were about! 

And, as you may notice, I've implemented Incarnate on this blog, inside .NET Blog Engine. Unfortunately, I couldn't use their plug-in model and I actually had to modify the source, but it wasn't too bad. If you are running .NET Blog Engine and want to know how to install Incarnate into it, let me know.

overflow:hidden -- a fix to a CSS problem

December 11 2009

Just resolved a funky little css issue where I was having problems with getting Firefox, Chrome and Safari to respect the background-color I was setting. Turns out the div itself needed to have overflow:hidden added to its CSS; IE8 was interpolating that space for me.

Adventures With Windows Azure Diagnostics

December 4 2009

New blog post published up on Mix Online about Windows Azure Diagnostics -- my experience, gotchas, etc.

JSON-P: An Elegant Hack

December 2 2009

I've been doing a lot more blogging these days over at Mix Online. My most recent post was about JSON-P and, in particular, how to get it working with the WCF REST Starter Kit.

IRhetoric Ported To BlogEngine.NET

November 24 2009

Well, at last I have ported my blog off the old engine that was a spam magnet to the latest and greatest BlogEngine codebase. So, now, feel free to leave comments again and know that this blog is no longer a spam vector.

Weird Behavior With Twitter Rate Limiting

October 21 2009

Twitter rate limiting was doing some funky stuff.  Was using the Search API and getting 503, which means you are getting rate limited even though the error response is Server Too Busy.  Discovered their rate limiting API, which you can call at http://twitter.com/account/rate_limit_status.xml to find out what was going on.  When this was called from a browser, it return 150. But when called using WebClient and passing a User Agent string with a URI, the api returned with 20000 as the upper bound although it didn't seem to respect that. Another funny thing is that, although I'd send a single request, it would ding me for multiple requests.  Not sure what is going on there under the hood.

Cross Domain Silverlight XAP Access in Silverlight

August 4 2009

So you want to host a Silverlight application (aka a .xap) on a server, making it available to be called from other servers. I just had to do this and figure I'll document the steps. It isn't rocket science, but here's the story.

First, you need to place a clientaccesspolicy.xml or a crossdomain.xml file at the root of your server. Read this MSDN documentation for more.

Then, you need to set the enableHTMLAccess attribute to true in the object tag:

<param name="enableHtmlAccess" value="true"   />

Lastly, make sure your server is sending the right mime type for the .xap (application/x-silverlight-app). Tip o' the hat to Joe Field for that one.

And, with that, walla -- you are good to go.  Here's an example of a music player being served from http://visitmix.com where I'm dynamically passing in the URL to the .mp3, which sits entirely on another server:

Get Microsoft Silverlight

VSAchievements
Visual Studio Achievements
Karsten Januszewski (207 Points)