No Free Time

Because my therapist says I need to let things out

Archive for the ‘Uncategorized’ Category

Design Your Experience

with one comment

Gratuitous money shot

So I deployed a personal website last week which I was quite happy with at the time but over the last few days I’ve thought of some features I wanted to add. I wanted visitors to be able to do a couple of things when they view my website:

  • pause and skip the music (not everyone likes minimal-tech-dub)
  • choose which videos are in rotation
  • i also want the UI not to get in the way when not in use

Everybody needs options

So I added an options panel. It presents you with a pause/play button and a skip button to control the music. Most people, including myself, hate it when websites play music and you can’t stop it so here’s the option. I used the WebDings font for the button icons which I copied from my windows folder into my solution and embedded it.

Further below in the options panel you have a list of checkboxes which determine what kinds of videos are circulating in the pool that can be selected to play. Uncheck the ‘cows’ tag to any videos everything featuring cows, for instance. I use System.Linq methods to regenerate the pool on each click, like so:

if (c.IsChecked.HasValue && c.IsChecked.Value)
{
tagSet = tagSet.Union(new string[] { tb.Text }).ToArray();
}
else
{
tagSet = (from t in tagSet where !t.Equals(tb.Text) select t).ToArray();
}
string[] tagSet = new string[10];
if (c.IsChecked.HasValue && c.IsChecked.Value)
{
    tagSet = tagSet.Union(new string[] { tag }).ToArray();
}
else
{
    tagSet = (from t in tagSet where !t.Equals(tag) select t).ToArray();
}

In the above snippet, tagSet is my collection of active tags, it’s just a string array as I’ve indicated with the declaration on the first line. The first logic branch is adding the selected tag to the array using a Union() and the second logic branch removes it by performing a select where not equal. I wonder if this is awfully inefficient.

Finally at the very bottom of the options panel there are some blurry lines which now and then shrink and expand. These are gauges which indicate the current buffering and download progress of the videos. If you look closely you can see four distinct lines. The 1st and 3rd lines indicate buffering progress while the 2nd and 4th lines indicate download progress.

Now you know what these do

What’s actually happening behind the scenes is that while one video is playing another one is silently buffering. Once the background video source is ready to play and the timing is right a cross-fade transition will occur. As soon as the transition is completed the video source that was previously in the foreground begins buffering the next video in the pool, and so on the so forth. I can see what’s happening by switching into my diagnostics view:

Diagnostics view shows both video sources

I’m reasonably happy with the way that the options panel slides out smoothly to meet the mouse cursor as you move it towards the left-hand side of the screen, and retracts discretely in the same way. I’ve wanted to experiment with this method of revealing/hiding UI for a while and I like this as a prototype. I’m not a designer though so I’m pretty sure the whole thing could be much slicker.

One more thing I’ve added is a little ‘loading’ note with initial buffering gauges. There are two separate white bars which indicate the loading process – these are for source A and source B which I load both of initially before video starts. Sometimes however (actually, quite frequently) Silverlight is loading a cached video, so it doesn’t need to buffer in which case Silverlight reports a buffering progress of 0.0. This isn’t the desired behaviour in my case, because it means I have to set up some hacks to detect this case and show a full buffering gauge instead. From my point of view this is a bug.

Written by tad

June 16th, 2009 at 2:36 pm

Silverlight Streaming and Google Analytics

without comments

I can’t seem to find a way to implement page/event tracking from Silverlight using Google Analytics when hosted using Silverlight Streaming. The usual solution to do this with with a regular Silverlight app is to reference the Google Analytics ga.js script and call HtmlPage.Window.Invoke() from Silverlight. But a difficulty arises because that javascript is executed in the context of the Silverlight application, which (in my case at least) is inside an iframe, and therefore can’t use the ga.js script.

One of the features available with creating a Silverlight Streaming application is to include javascript files with your Silverlight app so that you can use them from Silverlight, but ga.js isn’t my script so I can’t do that. Unless I downloaded the obfuscated version using Firebug or something… but… ugh!

I’m sure there will be some combination of HtmlPage.Window.Parent.Parent.Whatever I can use to do what I want to do, but I’m already into my second glass of wine for the evening and my brains starting to go on holiday. Any UK devs just waking up want to tackle this problem?

I guess you could simulate the issue yourself by adding a new .html page to your standard Silverlight hosting website containing an iframe with loads the Silverlight test page. In fact that’s how I’ll start tackling it tomorrow.

For now, I’m going to call it a night.

I see I’m getting a little bit of new traffic/twitter follows which I guess I can attribute to my new website… not because I think it’s brilliant but because there aren’t many actual cases of websites making use of Silverlight Streaming, so the Silverlight enthusiasts on Twitter seem to be retweeting. Maybe I’m wrong but if I’m right, thanks everyone, and please provide feedback about what I’ve made. I’ll be really pleased to hear from you.

Written by tad

June 12th, 2009 at 9:25 pm

Posted in Uncategorized

Tagged with

The Windows Hosts File Just Saved My Skin

without comments

I had an issue today where a virtual machine couldn’t connect to our team foundation server. I had connected the client machine to the VPN, could ping by IP but not by hostname. I suspect it was to do with the fact that my VM is not part of the AD. I didn’t want to connect it to the AD because keeping a VM off the domain saves headaches. So after a few moments trying to think of a workaround I remembered the Windows Hosts file. I added an entry to map the IP for the TFS server to the domain name it should have and – voila – my visual studio solution was able to connect as normal. I’ve never ever used that file to do anything useful before, so this was a first. :)

Written by tad

May 4th, 2009 at 7:05 pm

Posted in Uncategorized

Tagged with

One of those cookie quirks

without comments

Today I discovered a weird thing that happens if you’re creating an authentication cookie and you’re setting the domain of the cookie.

Let’s say my site is http://mysite.somedomain.com and I set the domain of the cookie to “mysite.somedomain.com”. If I attempt to log in the cookie won’t be saved, meaning I can’t log in. Setting the cookie domain to “somedomain.com” on the other hand works fine. Is this weird behaviour or am I just cookie-ignorant?

Written by tad

January 12th, 2009 at 10:13 pm

Posted in Uncategorized

How cool is Cuil?

without comments

So there’s buzz around this new search engine, but I want to know if it’s good, and whether it’s something I’d actually use. Off-hand I can think of three types of search I perform reguarly: technology, social networking and Wikipedia. Technology searching demonstrates up-to-date indexing, and the latter two demonstrate a level of index depth. So I performed a couple of tests, and here are my results with handy links if you want to compare for yourself.

Note: Cuil will probably improve a lot, and these are three very specific searches so we can only draw limited conclusions from them. So take all of this with a pinch of salt. If you know of a good comparison search let me know and I’ll add it here.

Search Results

Technology: Search term = ‘asp.net mvc preview 4′

Cuil: http://www.cuil.com/search?q=asp.net%20mvc%20preview%204&sl=long

The first page gives me eleven links to content, none of which is specifically to do with the latest build of the ASP.Net MVC Framework, let alone a link to a download page. Some of the pages are tutorials relevant to older versions of the framework but may still be applicable to the new version.

Google: http://www.google.co.uk/search?q=asp.net+mvc+preview+4&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_enGB260GB260

The striking thing to notice in Google’s results page is that, of the ten results, nine of them actually have the words ‘preview 4′ in the title. From this I can immediately gather that their results are more relevant to me. Also, three of the pages contained links to the MVC project page or the installer on CodePlex, and one of the pages was a direct link to the CodePlex project page.

Social networking: Search term = ‘twitter andrew myhre’

Cuil: http://www.cuil.com/search?q=twitter%20andrew%20myhre&sl=long

Interestingly, Cuil’s first page provides a list of people I follow/who follow me, but none of the results is a link to me or my Twitter page. Most likely that’s because noone would deliberately link to my feed, but those links do exist on the pages in Cuil’s search result.

Google: http://www.google.co.uk/search?hl=en&rlz=1B3GGGL_enGB260GB260&q=twitter+andrew+myhre&btnG=Search&meta=

Google gives a somewhat better result. The first link is to a tweet within the feed of someone who follows me, and the second is a link to their profile. The third and fourth links are to my FriendFeed and the fifth is to a much-less-up-to-date mirror of this blog. The rest are barely or not at all related to me. Somewhat better than Cuil but I still expected better somehow.

Most interesting is when I search using my actual Twitter username ‘andrew_myhre’:

http://www.google.co.uk/search?hl=en&rlz=1B3GGGL_enGB260GB260&q=twitter+andrew_myhre&btnG=Search&meta=

Google finds me, first hit.

http://www.cuil.com/search?q=twitter%20andrew_myhre&sl=long

Cuil actually returns zero results. Disappointing.

Wikipedia: Search term = ‘wiki bicycle pump’

Google: http://www.google.co.uk/search?hl=en&q=wiki+bicycle+pump&btnG=Google+Search&meta=

As expected, the first result is the exact record I’m looking for – the Wikipedia entry on bicycle pumps.

Cuil: http://www.cuil.com/search?q=wiki%20bicycle%20pump&sl=long

Cuil earnestly presents a number of options but comes up short. No links to Wikipedia to be found.

Summary

Generally, Cuil doesn’t give me information that’s as relevant as what Google does. The problem seems to lie in the relationships between content nodes – why can’t Cuil knit my blog and social networking sites together to provide a seemingly complete ‘whole’ in the way that Google does?

On top of this, the value-adds that Google provides like postcode parsing, shopping information and natural language parsing of terms like time zones, weather and money (interesting that they don’t parse Zimbabwe dollars btw) I just get a lot more out of Google’s results.

Written by tad

July 29th, 2008 at 9:31 pm

Posted in Uncategorized

Tagged with

Neat video

without comments

Written by tad

July 16th, 2008 at 9:23 pm

Posted in Uncategorized

Tagged with

Mobile Applications for S60 Phones

without comments

A couple of weeks ago I bought a Nokia N82 from Ebay, a major step up from my previous phone which, though I can’t actually find a product page for, was not unlike this one. So all this time I’ve been feeling a little left out of the mobile social services game, which is all very exciting. So now that I’ve got the new phone I’ve been going application crazy, and I’m going to share my thoughts and favourite apps here.

The phone supports WiFi and I have an unlimited data plan, so I’ve spare no concern whatsoever for data hungry apps – bear that in mind if your provider charges you per megabyte (is that really still a realistic option these days??).

Firstly, two obvious ones: the Google Mail and Google Maps applications are essential. Google Mail provides a fast and data-friendly way to check and write emails on the go. Checking your email will cost you about 1k and opening an email another 1-2k, so it’s totally 3G friendly. Google Maps churns though a bit more data when it downloads map tiles, but don’t go overboard with the zooming and you can keep a maps session under 100k easily enough. The address search functionality provides the same intuitive fuzziness as its online counterpart, and in this area it blows the built-in Nokia maps application out of the water. When we were in Berlin last week I couldn’t find anything in Nokia maps because I couldn’t be bothered getting the special characters right – Google Maps figured out what I was looking for every time. It also syncs with your GPS as you’d expect, and will provide directions for you in the same manner as the web app. In both applications the shortcuts are cleverly chosen and they’ve made excellent use of screen real estate when providing popup information.

I’m also really interested in always-connected applications and the clear and inevitable merge of desktop and mobile, so I wanted apps that will allow me to be productive on my phone and let me communicate with people in a variety of ways. The main methods of communication I’m interested in are Twitter, Skype and IM (GoogleTalk in my case).

Twitter provides a really simple way to use their service. Once you provide your mobile number you can elect to receive SMS updates from people you follow (you don’t have to receive SMS updates from everyone you follow – this provides a really nice level of spam control). You can broadcast your tweets by sending SMS messages to a phone number provided by Twitter, and using clever symantics you can reply and DM people as you need to.
http://twitter.com

For Skype and IM services there are two applications to consider: Fring and Nimbuzz (I don’t consider the S60 Skype application because it sucks). Both are conduits for a number of other services; Skype, GoogleTalk, AIM, Yahoo, MSN are fully supported by both. Both applications will hang around as background tasks once connected so you can do other things on your phone while still remaining available to receive chat and calls. I like the Nimbuzz interface a lot, but Fring is the only app I’ve been able to make a true VOIP call with. Fring only seems to like WiFi connections though, whereas with Nimbuzz I was able to connect via 3G and maintain a GTalk chat with someone. Bit of a shame that, so for the time being I’ll keep both apps installed and choose the appropriate one for my connection.

I’m also an enthusiastic last.fm user so I was stoked to discover that some bright chap had written an audioscrobbler application for S60 phones called Mobbler. Again it just lurks around in the background and keeps a record of what you’ve listened to on your music player, and once you’re connected (as far as I know this is a manual process) it then uploads to last.fm servers. Very very slick application. I listen to a lot of music on my IPod, and while I prefer it to the music player on my phone, I just love the fact that my tracks are being scrobbled. So I’m making a concerted effort to not hate the phone’s player.

On the user-generated content front, I also want to be able to upload my photos and video directly to *some service* from my phone. I *hate* synchronising, I *hate* the Nokia PC Suite. I don’t want to have to deal with that stuff.

Enter Shozu. Create an account with them and you’ll be given the option to add sites to publish content to. Facebook, Flickr, PicasaWeb, Friendster, Blogger, Kodak, LiveJournal, YouTube, PhotoBucket, Seesmic, SmugMug, Twitter, WordPress – to name about 1/3 of all the supported services. The genius thing about this app is that you can nominate a service to be your 1-click photo or 1-click video service. When you take a photo or record video on your phone you’ll immediately be presented with a little prompt – “Upload to [your service]“. Just hit the ‘Yes’ key and the Shozu app queues the media for upload and sends it when you’re connected. Just brilliant.

I’m also looking forward to trying out Jaiku, the location-based chat/networking service. I’ve requested a beta invitation so if/when I get one I’ll give it a go.

Cool! Hope all this gives someone a way to kill a few hours :)

Written by tad

June 22nd, 2008 at 12:28 am

Posted in Uncategorized

Tagged with ,

New Regime

without comments

Boy, the weeks have really flown by.

Lately I’ve been working on a WSS 2007 project which has been keeping me quite busy. I’ve been learning a great deal about Sharepoint development but I’ve been recording my learnings in the form of documentation rather than blog posts. My co-worker Scott Cowan has been keeping a thorough blog though. Initially my point of view was that I was being invested in to learn this stuff, so to broadcast my knowledge as I gained it would be ethically murky. But I’ve changed my mind about that now, so from now on whatever I learn I’ll post.

I’ve also been working on my CMS recently, trying to get it into shape so that it doesn’t disgust me anymore. It’s like a love-child I concieved during a more irresponsible time in my life and it’s turned out not only to be a time-suck but also just disappointing. I’m really trying to dig in, improve, refactor and rerelease. But I’m happy with the key features and with time and effort I think it will become a good product.

I hosted my blog for a while on it, but I switched because the features I wanted to include in my blog would have taken my too long to implement when I could just sign up for a free one and set it up in a few minutes. That was a good time but now I’m getting more serious about finishing the project I’m going to migrate back to my CMS. I realise now that in the long run I actually want my blog to be hosted on my own software, so to avoid messing up people’s bookmarks andRSS subscriptions (20 people a day and counting!) I’m going to cross-post everything I blog on the wordpress site to my original site. That way when the switch finally happens most of the content will just be there. It’s going to be annoying but hopefully I’ll find a way to automate it.

I managed to get a beta license for ping.fm so it’s going to be cool playing with that. It was really, really hard to get the license (hint: just email them and ask).

I’m also in the process of shifting my hosting from www.enom.com to DiscountASP.Net. So far they seem really cool – pages load in a heartbeat whereas enom was dead slow, and my sites are running on a Windows Server 2008 box. I can manage things like Http Handlers through my IIS7 Management Console, and it’s bliss! They also answer questions promptly which is a huge bonus.

Also I have a Nokia N82 on it’s way to me. It’s about time I had a smartphone and I’m super excited about building some J2SE apps. I have a couple of ideas for things I want to try out.

And I’m using www.rememberthemilk.com, it’s actually really good.

Written by tad

June 6th, 2008 at 10:16 am

Posted in Uncategorized

More on WAPs and WDPs

with 2 comments

Here’s a very interesting post: http://undocnet.blogspot.com/2007/12/web-application-project-2008-still-not.html

Currently I’m having trouble with MVC projects. I’ve given up trying to use a WDP so I’ll have to write my own /rip off a web.config replacement task.

Right now I’m getting a weird error though:

(CoreTestConfiguration target) ->
TESTTOOLSTASK : warning VSP2013: Instrumenting this image requires it to run as a 32-bit process. The CLR header flags have been updated to reflect this.
TESTTOOLSTASK : warning VSP2013: Instrumenting this image requires it to run as a 32-bit process. The CLR header flags have been updated to reflect this.
MSBUILD : warning MSB6006: “MSTest.exe” exited with code 1.

Bizarre! Interestingly this error happens when I run the team build project using msbuild on my development desktop.

Written by tad

May 12th, 2008 at 10:18 pm

Posted in Uncategorized

Tagged with , ,

This is too scary

without comments

Man trapped in elevator for 41 hours:
http://disembedded.wordpress.com/2008/04/14/madness-trapped-in-elevator-car-30/

And if you can’t be bothered reading the story, here’s a time-lapse film of the whole ordeal:

http://www.snotr.com/video/1078

Written by tad

April 18th, 2008 at 8:56 pm

Posted in Uncategorized