in

Telligenti

Serving up fresh ideas every day, Telligent style

Scott Watermasysk

June 2008 - Posts

  • Why Not Vista?

    I could not have said it better myself.

    “This isn’t a matter of dissing Microsoft, but Intel information technology staff just found no compelling case for adopting Vista,” the person said. [Et Tu, Intel? Chip Giant Wont Embrace Microsofts Windows Vista]

    I know there is a better security model/etc under the covers for Vista, but when it comes to end user features, there is nothing that makes me say "I want that".


    Posted to Technology and tagged as vista

    Similar Posts

    1. iPhone vs. BlackBerry
    2. Modifying Your Vista Hosts File in Just Six Steps
    3. ASP.Net Quick Tips - Web.config

    Posted Jun 26 2008, 09:42 AM by Simpable
    Filed under:
  • Are You a FeedBurner Fool?

    There are few things more important to a blog than it's RSS feed. However, there are way too many good blogs out there who are playing the equivalent of blogging Russian Rullet with their blog's feed for no good reason.

    In case you have been living under a blogging rock, FeedBurner is a company (recently acquired by Google) who provides the following services free over charge to bloggers:

    1. Publicize your content and make it easy for people to subscribe.
    2. Optimize distribution so that your content is properly formatted for all of the major directories and can be consumed by subscribers wherever they are.
    3. Analyze your traffic to learn how many subscribers you have, where they're coming from and what they like best.
    4. Make Moneyitize by participating in the FeedBurner Ad Network. Why not reward yourself for your effort?

    While not listed above, another service provided by FeedBurner is the hosting of your feed. Since RSS probably accounts for 70% or more of the average blog's traffic, this is a very valuable proposition. However, it comes with a very substantial risk; you are completely giving up control of subscribers to FeedBurner. If anything bad where to ever happen to FeedBurner, you could potentially lose all of your blog's subscribers. Or put another way, imagine a blog like TechCrunch having nearly 800K subscribers today and zero tomorrow. I wonder what that would do to revenues and valuations?

    FeedBurner does a redirect feature, but it doesn't provide very much functionality. In addition, this feature is only usable if FeedBurner is still around. I know Google acquired them and this does decrease some of the risk (and scares the hell out of others), but there are no guarantees.

    What makes this whole thing even crazier is there is a very easy way to continue using FeedBurner and additionally protect protect your feed: MyBrand. MyBrand is a FeedBurner service which among other things allows you to specify your own url for FeedBurner to use via a DNS CNAME record.

    ...a record in a DNS database that indicates the true, or canonical, host name of a computer that its aliases are associated with. A computer hosting a Web site must have an IP address in order to be connected to the World Wide Web. The DNS resolves the computer’s domain name to its IP address, but sometimes more than one domain name resolves to the same IP address, and this is where the CNAME is useful.

    MyBrand used to be a commercial service and even though it used to only cost a couple dollars a month to use, I think this is why most blogs are not using. With the Google acquisition it is now completely free and very easy to setup. FeedBurner tracks statistics based on your feed name and not the Url, so there is absolutely nothing to lose. Once setup, if for any reason you need to take back control of your feed, you can change it from a CName to a regular DNS entry.

    Finally, while the MyBrand link above points out you will need to setup a CNAME record, this is a very easy thing to do if you manage your own DNS and I have yet to come across a reputable ISP who would not set one up for you if you do not manage your own DNS.

    If you currently use FeedBurner, you owe it to yourself to make this change ASAP. Everyday you wait you run the risk of losing more subscribers.


    Posted to Technology and tagged as feedburner , rss , blogging

    Similar Posts

    1. iPhone vs. BlackBerry
    2. What Software do I use on the Mac?
    3. ASP.Net Quick Tips - Web.config

    Posted Jun 12 2008, 09:13 AM by Simpable
    Filed under:
  • Jaiku To AppEngine?

    I was reading something about the downfall of twitter and came across a link to a post on Jaiku blog

    We know. It is frustrating. We believe the migration to Google App Engine will result in improved stability, so we made the hard call to invest all of our effort in finishing up the port rather than do what was needed to keep up our old servers up to date  [Jaikido Blog | Making progress]

    Reading more on the Jaiku blog, I found this other post on the move to AppEngine:

    We’ve been working quietly for a while to port Jaiku to Google infrastructure. Today we’re taking off our welding goggles to announce Jaiku will be one of the first apps to run on the new Google App Engine.

    If you are not familiar with Jaiku, it is a similar service to Twitter which was acquired by Google about 8+ months ago, but has not shown any progress. Whether it is capable of replacing/competing with Twitter is another story. What is interesting is the move to AppEngine.

    • Does it really take 8 or more months to port Jaiku to AppEngine? I know user accounts can be messy, but this seems like an awful long time, especially when scale is out the equation.
    • Does this mean AppEngine is going to get some support for background processing? I really like what I see in AppEngine, but the lack of background processing has deterred from spending a lot of time with it.

    It will be interesting to see what happens once they finally roll out an update hopefully along with some enhancements to AppEngine.


    Posted to Technology and tagged as gae , jaiku , twitter

    Similar Posts

    1. Unfuddle == BaseCamp For Developers
    2. Google Messages?
    3. The Value of Being First

    Posted Jun 07 2008, 09:33 AM by Simpable
    Filed under:
  • Developer Licensing

    As mentioned previously, I have been spending quite a bit of time working distributed caching for .NET (Community Server in particular). There are two main commercial players in the .NET space (prior to Microsoft announcing Velocity) ScaleOut and NCache.

    I am in the business of selling software, so I have zero problems paying for something that lets me get the job done and move on to the next thing. However, it drives me nuts when component/server tool companies require licenses simply develop against their product.

    Nache

    ScaleOut

    As you can see above, NCache wants $500 per developer just to build a solution. This does not include the cost of the software to actually move your solution to production. Since both products have different pricing structures it is hard to tell if one is actually more costly than the other. However, organizations who are most likely to be interested in this will likely have bigger teams and thus potentially incur an additional cost for every hire.

    It is a fine line between protecting your bottom line and annoying your users. Developers are much more finicky than your average consumer, so anything you can do to get your software in their hands is a good thing.


    Posted to Business and tagged as nache , scaleout

    Similar Posts

    1. Velocity - Microsoft Distributed Cache
    2. Unfuddle == BaseCamp For Developers
    3. What Software do I use on the Mac?

    Posted Jun 06 2008, 09:55 AM by Simpable
    Filed under:
  • SimpleTemplate

    By now it should be obvious that I am big fan of the open source component NVelocity. Most of the examples of its usage are UI related such as view engines for MonoRail and ASP.Net MVC. We (Telligent) also use it to power the theme engine for Graffiti. While it is great to be able to use it in this way, the are a lot more non-web UI uses for it.

    The other day, I received a comment asking for an example of how to use NVelocity, so I decided to put together a quick sample component, SimpleTemplate.

    SimpleTemplate has one goal, take a string that represents an NVelocity template along with the data you want to insert/replace in that template and return the results. If you find yourself using constantly using string.Format or StringBuilder.AppendFormat to build complicated strings, SimpleTemplate should be able to make things much easier for you.

    Here are a couple of quick examples of what you can expect it to do:

    [Test] public void SingleItemTest() { const string result = "Hello World"; const string template = "Hello $test"; var iContext = TemplateEngine.CreateContext(); iContext.Put("test", "World"); Assert.IsTrue(result == TemplateEngine.Parse(template,iContext)); }

    With a custom object:

    [Test] public void ObjectWithPropertyTest() { const string result = "Hello World"; const string template = "Hello $to.Test"; TestObject to = new TestObject() {Test = "World"}; var iContext = TemplateEngine.CreateContext(); iContext.Put("to", to); Assert.IsTrue(result == TemplateEngine.Parse(template, iContext)); }

    Finally, just to show off, anonymous types:

    [Test] public void TestAnonymousTypes() { var anonymousType = new {Test = "Hello", Child = new {ChildTest = "World"}}; const string result = "Hello World"; const string template = "$at.Test $at.Child.ChildTest"; var iContext = TemplateEngine.CreateContext(); iContext.Put("at", anonymousType); Assert.IsTrue(result == TemplateEngine.Parse(template, iContext)); }

    If you remove null argument handling code, the TemplateEngine class is probably about 15 lines of code. I have included the full source in the download.

    NOTE:

    I was browsing my local CastleProject source folder to see if there was a license I should be including with the NVelocity assembly when I noticed a project called TemplateEngine. There is not much information on the site about it and I only briefly browsed the included test suite, but it does look very nice. SimpleTemplate will certainly get you started, but I would recommend checking out TemplateEngine as well. I will do a follow later after I have had some time to play with it.

    Download SimpleTemplate.


    Posted to Code and tagged as nvelocity , open-source

    Similar Posts

    1. Setting Up Velocity (Distributed Cache)
    2. MvcContrib NVelocity Extension
    3. What Software do I use on the Mac?

    Posted Jun 05 2008, 08:14 AM by Simpable
    Filed under:
  • Setting Up Velocity (Distributed Cache)

    As I previously wrote, Velocity is Microsoft’s entry into Distributed Caching. It is currently in its first public CPT, so there are certainly going to be some rough spots. The documentation is pretty good, but setting it up and using it the first time required some trial and error. Here is a quick overview on getting it Velocity setup and and using the API.

    First, grab the CPT bits and run the MSI.

    As part of the install process, it is going to ask you to create a cache host configuration. I just created a folder called cache and named it Sample:

    captured_Image.png

    Next, execute the Velocity administration tool (should be a short-cut on your desktop). This is a command line tool. Type “start cluster” to get things going.

     captured_Image.png[10]

    Next, create a new VS.NET 2008 project and add references to following .dlls from the Program Files\Microsoft Distributed Cache folder: CacheBaseLibrary.dll, ClientLibrary.dll, FabricCommon.dll, CASBase.dll, and CASClient.dll.

    You will also need to add an app.config (or web.config) file to your project with the following (you can get this from the docs as well). You will also need to update the name attribute under dacheClient/hosts/host to include your machine name. The setup summary documentation was not clear about this.

    <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="dcacheClient" type="System.Configuration.IgnoreSectionHandler" allowLocation="true" allowDefinition="Everywhere"/> <section name="fabric" type="System.Fabric.Common.ConfigFile, FabricCommon" allowLocation="true" allowDefinition="Everywhere"/> </configSections> <dcacheClient deployment="simple" localCache="false"> <hosts> <!--List of hosts --> <host name="YOUR_MACHINE_NAME_HERE" cachePort="22233" cacheHostName="DistributedCacheService" /> </hosts> </dcacheClient> <fabric> <section name="logging" path=""> <collection name="sinks" collectionType="list"> <customType className="System.Fabric.Common.EventLogger,FabricCommon" sinkName="System.Fabric.Common.ConsoleSink,FabricCommon" sinkParam="" defaultLevel="-1"/> <customType className="System.Fabric.Common.EventLogger,FabricCommon" sinkName="System.Fabric.Common.FileEventSink,FabricCommon" sinkParam="CacheClientLog" defaultLevel="1"/> <customType className="System.Fabric.Common.EventLogger,FabricCommon" sinkName="System.Data.Caching.ETWSink, CacheBaseLibrary" sinkParam="" defaultLevel="-1" /> </collection> </section> </fabric>   </configuration>

    Now, we are just about ready to finally write some code. But before we proceed, there is one more thing we need to look up, the name of the cache. This is the part the tripped me up the most.

    The basic example in the documentation looks like this:

    using System.Data.Caching;   CacheFactory CacheCluster1 = new CacheFactory(); Cache Cache1 = CacheCluster1.GetCache("Cache1"); Cache1.Add("cachedStringKey1","This string will be stored in cache");

    I had wrongfully assumed the cacheCluster1.GetCache(“Cache1”) call was referencing the name attribute we set above. This was concerning for a couple of reasons:

    1. It did not work. :)
    2. I didn’t like the idea of having to reference a specific machine.

    The good news is #2 is not the case and reading through some of the documentation helped clear this up. The parameter that passed in GetCache is the name of the cache we are requesting. This is necessary since each host can support multiple caches.

    It turns out the default cache name is “default” (go figure). To find this value you need to go back to admin command line tool and enter “list cache”

    captured_Image.png[12]

    It also turns out, there is a static helper method which will supply the default cache name for you, so out of the box you can just ignore it (same goes for Region).

    All the objects we need to access are in the System.Data.Caching namespace.

    Here is the quick sample code:

    using System; using System.Data.Caching;   namespace CacheDemo { class Program { static void Main(string[] args) { var cf = new CacheFactory(); var cache = cf.GetCache(Cache.DefaultCache); var s = cache["sample"] as Sample; Console.WriteLine(s == null);   s = new Sample() {Test = "Hello World"}; cache.Put("sample", s);   s = cache["sample"] as Sample; Console.WriteLine(s == null);   Console.WriteLine(s != null ? s.Test : "I am null");   Console.ReadLine(); } }   [Serializable] public class Sample { public string Test { get; set; } } }

    In the code above, we create a new instance of the CacheFactory and then get a reference to the default cache. From there, it should look very similar to using the HttpCache with one exception, cache.Put. Similar to Memecached, Velocity supports the concept of Add’s and Put’s. The biggest difference between the two is Add will throw an exception if the given key already exists. If you use Put and the key does not exist, the object will be added. On the other hand, if the key already exists, Put will replace the object with he newer one.

    There is a lot more to Velocity than what I covered above. Just browsing the API there appears to be options for locking and versioning objects as well. As I previously mentioned, I am on the fence if this is a good thing, especially for the types of sites and applications I tend to build. But if you need this kind of object management, Velocity might fit the bill for you.

    Feel free to leave a comment if I missed a step or you need more clarification.


    Posted to Code and tagged as velocity , cache , memecached

    Similar Posts

    1. MvcContrib NVelocity Extension
    2. Velocity - Microsoft Distributed Cache
    3. Unfuddle == BaseCamp For Developers

    Posted Jun 04 2008, 09:59 AM by Simpable
    Filed under:
  • Velocity - Microsoft Distributed Cache

    A couple of days ago, I was chatting with David, I have not blogged since 2004, Penton about the lack of a built in distributed caching solution for .NET. There are a couple of really good third party tools available (more posts coming soon) but since caching adds such a huge boost in performance (if used correctly) it is really struck me as odd that the folks in Redmond had not yet addressed this issue on their own (I do not need a Microsoft certified solution to every problem, but since that is their style, it seemed to odd to be missing one here).

    However, while we catching up on what had been announced at Tech-Ed I came across a mention of Velocity.

    “Velocity” is a distributed in-memory application cache platform for developing scalable, available, and high-performance applications. Using “Velocity,” applications can store any serializable CLR object without concern for where the object gets stored because data is cached across multiple computers. “Velocity” allows copies of data to be stored across the cache cluster, protecting data against failures. It can be configured to run as a service accessed over the network or can be run embedded with the distributed application. “Velocity” includes an ASP.NET session provider object enabling storage of ASP.NET session objects in the distributed cache without having to write to databases, which increases the performance and scalability of ASP.NET applications.

    As I mentioned before, there are a couple pre-existing tools:

    • Memcached - The granddaddy of them all. Simple, used everywhere (I mean, EVERYWHERE), and free.
    • ScaleOut - Robust, fault tolerant distributed caching
    • NCache - similar to ScaleOut but with a very annoying developer licensing model
    • SharedCache - Open source managed code distributed caching

    There is an interesting distinction between these tools. One on hand you have Memcached which treats the cache as something you should never rely on. It is there to help but you should always assume it is going to fail on you and even more importantly (to Memcached) you should accept that as a fact. If you read the Memcached FAQ you can almost here the author laughing when talking about fault tolerance. On the other side of the fence you have features like replication and high availability. It is just a CPT, but it looks like Velocity wants to be in the latter group.

    I am still on the fence about which type of solution is most ideal. At first, I was in favor of the "high availability" group, but as I read up more on memcached their simplicity really started to grow on me. As with most other things, it will probably vary according to your applications needs.

    I am planning on posting some sample code and patterns we are thinking about soon. So far, in light testing, I like Velocity and I will certainly write about it some more.

    Anyone else in the .NET world using distributed caching? What is your tool of choice? Any tools I am missing?


    Posted to Code and tagged as velocity , cache , memcached , scaleout

    Similar Posts

    1. What Software do I use on the Mac?
    2. Graffiti v. Wordpress - Part II
    3. Unfuddle == BaseCamp For Developers

    Posted Jun 04 2008, 08:48 AM by Simpable
    Filed under:
  • WWDC 2008 Wishlist

    I am new to the Apple FanBoy world, so I am still feeling my way around the rumors and speculations of what will be announced at next week’s WWDC.

    I have no rumors to post, so instead, I am just going to post a wish list.

    • 3g iPhone. This looks like a forgone conclusion. I love my first generation model, so I will order v2 as soon as I am given the opportunity.
    • 13 inch MBP - I love my 15 inch MBP, but I would love to shave 1 or 2 pounds off of it. Since I use a monitor most of the time, I don't think I would be giving up too much (a beefier MBA would be welcomed as well).
    • Apple TV - My dad bought on 3 months ago and I have been very impressed by its simplicity. Since Apple has been stuck on 40 and 160 gig models, I am trying to be patient and wait for them to release a hardware upgrade

    Posted to Technology and tagged as apple , mac

    Similar Posts

    1. iPhone vs. BlackBerry
    2. Unfuddle == BaseCamp For Developers
    3. Life on a Mac - the Grass is Greener

    Posted Jun 03 2008, 08:45 AM by Simpable
    Filed under:
Powered by Community Server (Commercial Edition), by Telligent Systems