Archive for June, 2010

28 Jun 2010

Welcome To Last.io

2 Comments Uncategorized

I wanted to save this historic post for my blog, post number 250, for a special occasion.  And I can’t think of a more special occasion than what I am about to announce.  Over the past month or so I have been working on a new web application, in my spare time.  The goal of the web app was to provide a more usable and accessible interface to a product that I believe has great potential beyond what the publisher originally imagined.

The product that I am talking about is Microsoft Tag, it is probably not very well known to most of you.  But here is the basic concept.  You are given a image representation of a hyperlink so that it can be easily shared in a visual and usually physical medium such as a poster, banner ad, magazine, or something in print.  Or at least it is marketed that way.  The idea behind it is that you can get information that is relevant to a customer by having them just focus their camera phone on an image that looks like this in any of the mediums I listed a few sentences ago:

microsoft-tag

If you would like to try Microsoft Tag out please follow the directions on the tag on your mobile phone.

Where last.io Fits In

The concept behind last.io is that there are many circumstances that don’t fit into the marketing of Microsoft Tag, where a tag would be the perfect way to share a link.  last.io is bring together the short URL services that provide a tiny URL for consumption on services like twitter and Microsoft Tag for consumption in a more visual medium.

The idea for last.io came to me while watching the audience members at a monthly Philly.NET meeting take a picture, with their smart phone, of a slide with a link to more information about the presentation, that the presenter thought was important for the audience to jot down and keep for future use.  However this process seemed flawed and inefficient to me.  First of all the audience members need to then take that picture and transcribe the slide in to the URL bar, which is pretty painful to impossible to do on your phone.  The process of this gets exponentially more complex the longer the URL is, so it can be very frustrating.  Second the presenter has no idea now many people actually made it from his presentation to the link, and the drop off factor of interested people goes down, when people forget they took the picture to transcribe later, the longer the URL is, and the less sense of immediacy the audience has to get the information.

Who is last.io For

last.io is:

  • For Apps
    Create a tag and put it on posters, billboards, or advertisements for your iPhone apps, so that your customers can download your app with ease.
  • For Presentations
    Want to provide downloadable content or links in your presentations, and even short URL’s are too complicated to have your audience copy down. Try a tag and let them visit the link with ease.
  • For Developers
    Use our API to create short URL’s and tags and embed them in your applications and websites to provide easy transfer from the computer screen to your customers mobile phones with ease.
  • For Anything
    Create a tag or short URL for anything you can imagine to help make your content more accessible to anybody and anywhere.

How Does last.io Work

The first thing you must do when you go to last.io is to enter in a URL that you want shortened:

image

After you do this you will be presented with your short url:

image

You are provided a short URL that will work just the same as any other short URL, by doing a 301 redirect to the location that you entered in.  In the above case the short URL is:

http://last.io/1

From here if you want a tag you will just need to click on the self explanatory “Click Here To Create A Tag” text on the right hand side of the box.  By do this it will remove the text, un-dim the image, and provide you your fresh new tag.  Which can then be clicked on to see the full size version:

image

Easy as that.

But What If I Want To Embed The Image

Well that is actually pretty easy to do.  Because the raw image is provided by taking the short URL, in the example case above, http://last.io/1, and adding an exclamation point to the end of the URL like so.

http://last.io/1!

You can do this with any of the last.io URL’s because if the URL doesn’t already have a tag when the exclamation point is added, a tag is created, and then returned for your convenience.

Conclusion

So do you think this is something you can find a use for?  Currently there is a very limited API for creating the URL’s, but it will soon be expanding, beyond the concept phase.

17 Jun 2010

Run Cassandra As A Windows Service

14 Comments FluentCassandra

One of the main issues that comes up over and over again for Cassandra is:

How do I run Cassandra as a Windows Service?

In this post I am going to answer that question and in the process demonstrate how to do it in less than 10 minutes.

Background

Cassandra is mainly developed by Linux developers so very little attention has been paid to the Windows developer or administrator as far as Cassandra goes.  So as Windows developers we have to hop through a couple more hoops than just clicking on an install.exe file and and letting it do all the work.  However lucky for us, those hoops are easy and quickly hopped through.

Step 1

If you haven’t done so already please read my jump start for Windows users on install Cassandra, this guide will get you ready for the next steps.

Step 2

The second step is also an easy one, you need to download a package called RunAsService, which provides the ability to run any program as a Windows Service.

After you have downloaded the file extract the contents to a directory of your choosing.  (I extracted it to c:\RunAsService)

Note: RunAsService was originally developed here, however I recompiled it to run on .NET 2.0.

Step 3

To install RunAsService open up a command prompt with Administrative privileges and run this command.

cd c:\RunAsService
install networkservice

This registers RunAsService with your Windows Service.  Make sure to keep your command prompt open because you will need it for the 5th step.

Step 4

To configure RunAsService for Cassandra open up the RunAsService.exe.config file in your favorite text editor and replace <service.settings> section with the following so that it looks like this:

<!-- Services configuration -->
<service.settings>
    <!-- Run Cassandra as a service -->
    <!-- My Cassandra install path is C:\apache-cassandra\ -->
    <service>
        <name>Cassandra Database</name>
        <executable>C:\apache-cassandra\bin\cassandra.bat</executable>
        <parameters></parameters>
    </service>
</service.settings>

After you have finished, save the config file and exit your text editor.

Note: My Cassandra install is in c:\apache-cassandra\ you will have to correct the config above for where you installed it if different than mine.

Step 5

The last and final step of this process is to start the RunAsService service.  You can either do it through the Services control panel or just type the following in to your command prompt.

net start runasservice

You should see a response in the command line saying that the service has been successfully started.  To verify that Cassandra has been started you can use the cassandra-cli.bat file:

cd c:\apache-cassandra\bin\
cassandra-cli.bat
connect localhost/9160

It should report that it is connected to the server if the service is running.  And with that we are done, and I told you it would only take about 10 minutes.

13 Jun 2010

Using LINQPad to Query Stack Overflow

8 Comments Uncategorized

Update (2010-12-30): I have updated the OData URI locations below, because of a recent move and re-architecture by the StackExchange team.

In case you haven’t read, Stack Overflow and the rest of the Stack Exchange sites are now able to be queried using OData.  This is great because as Jeff points out in the blog post:

…if you just want to play with the data, it’s kind of tedious: you have to download the entire 700 plus megabyte archive, import it into some kind of database system — and only then can you even begin thinking about how to query out the results you’re looking for.

This hurdle has stopped me from performing some basic queries that I would like to know on the spot.  But that is no longer the case, and I am going to show you how you can get started querying Stack Overflow from a tool called LINQPad.

First Things, First

You need to download LINQPad, which is a general learning and development tool for composing and executing LINQ queries.  After you have downloaded and installed the application you will have a screen that looks like this:

LINQPad

Setting Up Stack Overflow OData

The next step is to add the OData endpoint for Stack Overflow, which is:

http://data.stackexchange.com/stackoverflow/atom

This is done by clicking on Add connection in the top left of LINQPad.  Which will give you a screen that looks like this:

Choose Data Context

Select WCF Data Services and click Next.  You will get a connection screen where you enter the endpoint for Stack Overflow that I described above:

LINQPad Connection

After entered click OK, and you will be taken back to the LINQPad application with a new connection to the Stack Overflow data source that lists all the available tables and fields that you can query.

LINQPad w/ Stack Overflow

Lets Have Some Fun Querying

Lets start with an easy query that we all should know.  Who is the number 1 Stack Overflow user?

Surprise it is Jon Skeet.

What about which user has the highest number of votes?

Not Jon Skeet, which is surprising.

What about down votes?

Another guy in the UK

Show my insightful comments with a score of 5 or greater?

I only have one :(

Conclusion

As you can see this is a very powerful way to get some quick answers out of Stack Overflow, and it is amazing that Microsoft, Azure, and Stack Overflow is able to bring all of this to us for free.

Also if interested they also offer OData endpoints for all of the other major Stack Exchange network of sites:

Post some of your interesting queries below.