Awesome code is awesome (LINQ plus Lambdas edition)

While going through my feeds this evening, I found this awesome article from LukeH. He built a raytracer using nothing but C# LINQ to Objects and Lambdas.

While its clear abuse of the syntax (I can imagine my SQL-pure professors having a heart attack at seeing their beloved syntax used this way), it is freaking cool. Head over to read the article and try parsing that monster LINQ statement (I’ll not steal his thunder by posting it here).

Secondly, related to that, is a post on the recursive lambda expressions that Luke uses. I knew I should have paid more attention in maths. 🙂

As a side note, it makes more sense from a programming perspective than it does from a purely math oriented point of view. Had I written my math exam in C# lambdas, I may have got a higher mark 🙂

Both of the above posts show if code that is above and beyond what I do. I remember doing a happy dance a while back after first cutting my teeth with LINQ plus lambdas in the same statement, which now seems a bit premature 🙂

This does speak volumes about the state of C# as a language. It’s an exciting time to be a programmer. 

My RSSCloud Server: Thinking of doing some screencasts.

This year was my last at Uni ( actually, i still have an exam to write, so the past tense isn’t accurate). As is typical with Honours year undergraduates, a final year project was set.

If you are regular reader of this blog, you’ll probably know that what i picked was a RSSCloud server running on Windows Azure. However, as they say on the home shopping networks, THERES MORE! My project needed a little more body to it. So I added an online Feedreader, in other words a poor (dirt-simple) imitation of Google Reader.

Now, this app uses a number of technologies for which it would be a pretty cool demo project. Windows Azure itself (obviously), Windows Azure Tables and Blobs, LINQ, WCF, MVC2 and so on. This includes it being a demonstrator of the RSSCLoud specification itself.

Although its an academic submission, my lecturers are fine with me opensourceing it.

Given the rise of .Net 4, and the experience points gained writing the first version, I feel that everyone would be better served with a rewrite. Not to mention the fact that It’ll give me a chance to use the new Windows Azure Tools for Visual Studio.

As I re-write it, I think a screencast series is in order. All the code will be checked in to codeplex. This’ll give everyone a chance to double check my logic (particularly interested in what Dave Winer thinks of my implementation of RSSCloud).

So, firstly, What do you think?

And secondly, anyone know a good hosting provider? I don’t know about Youtube. But Vimeo looks pretty good. If their limit is 500Gbs/per week upload space, it’ll give me chance to do one video each week, more or less.

I have all the software required to pull this off. So thats not a problem. I actually did a screencast of a live coding session in class for one of my lectures (writing an interpreter turns out to be pretty fun, actually).

i think this would be a pretty good contribution to the community as a whole.

Bill Buxton: Respect The Skills Acquired By Your Users

Take 30 minutes and watch his keynote appearance: http://live.visitmix.com/MIX10/Sessions/KEY02 (he’s introduced at the 2:13 mark). Its worthwhile.

If you notice the title, you’ll see that it’s slightly different to what Bill Buxton actually said. Bill is a UI designer. UI design is the natural application of his design paradigm.

But it goes deeper than simple UI design.

You see, Bill’s paradigm is that User Interfaces must respect the skill that has been acquired by the user. Since the acquiring of skill is on thing that we all have in common.

Bill gives this wonderful example of a violin. The violin itself may be worth millions of dollars (if I remember correctly, Joshua Bell paid $4.5 million for his Stradivarius). The bow of the violin for any first violinist in any symphony orchestra is never less than $10,000. Remember these are musicians. They make a pittance. So as a proportion of income, it’s a fortune. But it’s worth it. Why? Because it’s worthy of the skills that those musicians been acquired over decades.

Bill was taking purely in terms of User Interfaces. But the application of this paradigm is rather broad.

For instance, lets take developers.

Developers typically end up working with libraries and API’s. We rarely rewrite what Joel Spolsky affectionately calls duct tape code. Like date comparisons and string builders. It’s a brutally Darwinian process in which the libraries and API’s that are most easily used rise to prominence.

Personally, when I write any code, whether it’s an API used by some other code to do processing, or some plumbing for my UI, or even a class definition with functions and parameters, I always think of the way in which this code is going to be consumed. Since the consumer typically dictates what it needs to get out of that API/function/class. At this point, simple abstraction takes over: how can I abstract away processing code such that my consumer code is much easier and cleaner. In this case the User Interface is not pixels on a screen. No, it’s functions and parameters. The consumer code is and should be treated as a fully fledged user of that code.

The premise this blog post started off with was that user interfaces should respect the skill that has been acquired by the user. Of course, code has no appreciation of skill, whether the code is elegant or not has no meaning to the compiler. But you, as the programmer are consuming the service, the function or the API. You have skill. A skilled programmer writes elegant code. He or she draws on a vast reserve of skill and talent even in the most simplest of tasks.

My point is that when you write your API, when you write your function, when you define you class. You want to ask: "How can I help the programmer that programs against this service write elegant code, how can I write an interface that respects the skills acquired"?

let make some practical application of this:

Typically, I find Web services frustrating. I find it frustrating because I can’t just point Visual Studio at a URL and say "this API lives here and I want to use it". WSDL files, where available, make this so much easier because Visual studio will generate either a web or a service reference.

Why do I say this? For me as a programmer, it does not respect my skills to spend hours each day parsing SOAP or XML or JSON results when what I should actually be doing is writing program code. And yes, some of you will say that it takes all the fun out of life. But I want to be able to go off and write code. Program code. Not low level plumbing, specially plumbing that should be automatically generated for me here in 2010.

That’s one of the things that blew me away about Microsoft’s OData protocol. Here’s a URL and BOOM you have data and are ready to program. You don’t even need a WSDL (whether we need yet another data protocol to have this functionality is another question altogether). It respects the skills of the user, namely me, the programmer. It allows me to immediately get on with the business of practising my chosen craft.

It should be noted that I’m not arguing that we never get our hands dirty in the plumbing. Someone has got to do it. And it is essential training for anyone interested in programming, let alone web services.

In some ways writing an interface that respects the skills I have acquired is a meta-function. The better the interface/class/API is, the better my code is going to be: it’s writing code to write code.

Let’s take another aspect. PowerPoint presentations.

This mornings lecture borrowed a slide deck from TechEd 2009. It was about the BizTalk 2009 ESB Toolkit. Now the slides had no relevance to us as programmers. At all. No respect to the skills we have acquired over years or training and practise. Just a lot of SmartArt. (Id argue that BizTalk as a whole shows little or no respect for our skills as programmers). As a result I discovered what talented doodlers there are in my class, and that nobody snores.

But when was the last time you watched a Scott Hanselman presentation? He uses little or no slides. The majority of his talks involve coding in visual studio. Seriously, how much more respect can you have for the skills your audience has acquired? As a result people sit up and pay attention (and that has absolutely nothing to do with Scott’s various attempts at humour).

Want to see what I mean? See this video: Creating NerdDinner.com with Microsoft ASP.NET Model View Controller (MVC) or this one from Mix10:

BEYOND FILE | NEW COMPANY: FROM CHEESY SAMPLE TO SOCIAL PLATFORM

Talking of Scott Hanselman, have you seen his BabySmash WPF app? It’s written for babies. Babies smash your keyboard very much at random. The app takes this input and turns it into colourful animated shapes that move about the screen. Once again, the User Interface shows respect to the skills the user has (or in this case hasn’t) acquired.

Do not misconstrue this as me banging my drum about ease of use. The easiest point and click UI is the one Smith and Wesson developed many years ago. Yet that UI shows absolutely no respect to the skills developed by its users. And BabySmash may be easy to use, but it shows no respect for my skills as a developer.

As it has been said many times, software is hard. It will always be hard. There will always be challenges. But if we respect the skills of the code ninjas that come forth to complete those challenges, we all benefit.

Help Needed: Silicon Image Sil 3512 SATALink Controller BIOS Flash

So, I installed a 2 port eSata adaptor from LaCie last week and connected my brand spanking new 1.5Tb drive to it.

This is a Windows Home Server system, if you must know. So disk activity is always high, both reading and writing.

Now the hard drive itself is perfectly fine (I’ve tested it on other computers using USB 2.0). The enclosure is perfectly fine (since I’ve tested that too).

This leads me to the issue I have with the controller.

This error message always preceded a crash:

“The device, \Device\Scsi\SI3112r1, did not respond within the timeout period.”

That error let me to this Microsoft KB article: http://support.microsoft.com/kb/154690/EN-US/

A quote:

The reason that drives tend to have these types of problems under heavy stress is often slow microprocessors. In a multitasking environment, the processor may not be fast enough to process all the I/O commands that come in nearly simultaneously.

Hmmmmm…… This certainly fits he bill, since, after much careful examination, it seems heavy reads cause this problem.

I’ve tried all the other stuff in the KB article except flashing the PCI cards’ BIOS.

Now this is where it gets interesting. The LaCie card uses the Silicon Image Sil 3512 SATALink Controller. This is what shows up in Windows Device Manager.

I’ve updated the driver to its latest version from Windows Update. But not the BIOS.

Now the download is simply a flashtool and a readme file thats gives the following command line instructions:

Procedures to run SiFlashTool .exe

· Open Windows command prompt

· Change to a directory where the SiFlashTool .exe and BIOS binary file are located.

· Run SiFlashTool to update the flash memory with BIOS binary code

The SiFlashTool.exe command line syntax is as follows:

SiFlashTool [/BusNum:xx /DevNum:xx] [/File:filespec] [/v]

Where:

BusNum / DevNum: These parameters specify the PCI bus and device number respectively of a Silicon Image storage controller. These parameters only need to be used if there is more than one Silicon Image storage controller in the system.

File: This parameter specifies the path and name of the BIOS image file to be programmed.

/V: This switch causes the program to only display the version number of a controller’s BIOS. No BIOS image is programmed when this switch is used. The /File parameter is ignored if specified along with this switch. If /BusNum and/or /Devnum are specified, then only the BIOS versions of controller’s at the specified PCI locations are displayed.

If I Run it with /V it tells me that BusNum is 05 and DevNum is 04.

Question One, what BIOS binary file are they talking about?

Question two, how am I supposed to include the BusNum and DevNum arguments?

 

Many thanks for any help all the hardware and command prompt gurus out there can give.

Scobles’ Molecules of Infomation

Devotion to Duty

Scobles’  molecules of information post reminded me of something. Blog posts are the original molecules of information. A blog post is a place to bring tweets, pics and youtube videos together. Since blogging took off, we have a host of new tools to add to the army knife. We have foursquare check-ins for example. they provide an awful lot of context to location sensitive tweets.

Thats why I’m sharing this here rather than going straight to Friendfeed and Twitter. 

I commented on Scobles’ post:

Er, Scoble. You can tag tweets. Its called hashtags. What we DON’T have is the ability to search and mine that information.
Friendfeed has hashtags as well. And FF has a far more power search engine for all these little atoms of information.
Friendfeed is way ahead of you. They show you related items.
The future is here, its just not evenly distributed yet.

To which Scoble replied (Disqus comments with replies are awsome, BTW)

Nice try. Hashtags are NOT tags. At least they aren’t anything like the tags that Flickr photos have. FriendFeed does NOT have tags. It has comments. Not the same again. Not even close. FriendFeed’s related items? They are to remove some duplication noise and that feature doesn’t work anywhere close to as well as a human curated system would. Try again.

To which I responded:

Robert, hashtags need a systematic engine for them to work as actual
tags. Twitter should add this.

But nonetheless they provide a way of categorising tweets. Tweetdecks
tweet filtering works primarily due to hashtags. For events, for
example, hashtags are brilliant.

Friendfeed related items link may primarily be for noise reduction,
but this functionaity could be greatly extended. Comments are content
as well, but quite often they provide context too. See Jesses’ FF3.0
FF posts this morning for an example. Where links between FF items are
posted in the comments.

If this were extended to solidify the relationtionship between items
beyond simply showing the items linking to the same page, we’d have
your information molecules.

The sum total of tweets, posts, videos, foursquare check ins, you name
it about something often ends up providing more context than any one
single service or method can provide.
Typically speaking blog posts have filled this need for creating
context, collateing all this related information together in a single
article. This tweet, that twitpic, this video. The first instance of
an information molecule.

As noted above we already have been manually adding in links between
related content. Geolocation services have always created information
molecules, combining tweets and google maps. In like manner, the
services concerned need to solidify these methods for other types of
information.

What do you think?

Fences from Stardock (and some Windows 7 screenshots)

I heard of this great little utility called Fences. Scott Hanselman* mentioned it in a blog post a while back.

image

As you can see, it groups controls into little fenced off corrals. If there are too many icons in the corral, it will scroll like so:

image

That scrollbar fades in nicely when you hover your mouse anywhere on the corral and fades out when you leave.

There is a nice settings panel:

image

 

Helpfully, it will also  take snapshots of how you’ve arranged your desktop:

image

 

Its immensely useful and you should go check it out. Right now.

While we’re showing off Windows 7 desktop screenshots, this gorgeous theme is available for download.

You can get it from the Windows 7 Theme Gallery here.

If you’re in the US, this theme shipped with Windows 7, if not its the “United States” theme in the gallery. All of the localized themes for all countries are available in addition to one or two jazzier ones.

*PS I’m convinced we have to start calling Scott Manselman “the Ha”. We already call Scott Guthrie “the Gu” – naming conventions, people.

iTunes Extras

I bought Night at the Museum 2 last night purely to test iTunes Extras.

Naturally, since we’ve had these special features on DVD’s since, well, forever, it wasn’t the most mind blowing experience in the world.

I have to say I have seen some DVD menu’s that look, frankly, a lot better.  But I suspect that it will improve as publishers get to grips with the full capability of the format.

It’s worth noting that iTunes Extras is actually 2 files. The movie itself and the Extras. For a moment I’d though I bought the movie twice. But rest easy.

Here are pictures from my Apple TV.

DSC_0001

As you can see, its not strikingly different from a DVD menu.

 

DSC_0003

Again, not a new feature. Nothing noteworthy here, move along.

 DSC_0005

One nice feature is the above menu, allowing you to go to the extra Screen instead of playing the movie.

 DSC_0007

I must say, it is nice to have special features without having to get the DVD. I hope more and more movie get this, and not just the new releases (Though I did notice that the original The Wizard of Oz movie has Extras – see last picture). I suppose that this is one area where Apple’s grab for the living room puts it in sharp contrast to Windows Media Centre. I don’t think WMC will do the special features if you copy and paste the Video_Ts folder.

DSC_0009

This is also interesting: a shameless attempt to sell us more stuff. A link to iTunes movie trailers and a link to Twentieth Century Fox. It would be cool if this were updated on a regular basis with other stuff. It would be a good place to put special offers. Such as 50% off the soundtrack because you bought the movie (so you have you buy the movie and get the soundtrack from this screen).

The movies with Extra have this little icon next to them to distinguish them from the rest of the “ordinary” movies:

DSC_0011

 

Finally, here are the available movies with iTunes Extras:

 DSC_0012

I have two of those movies: Walle-e and Iron Man, both bought from iTunes when they were released. But iTunes Extras weren’t available then. A Endgaget post seemed to suggest that only if you already bought these with Extras could you re-download them to work with Apple Tv 3.0.2. So I’m not sure hat the deal is. It would be very sad if i could not get Extras for them.

Finally, it would be interesting if someone figured out how to translate from DVD menus to iTunes Extras.

PS And yes, some pictures are not properly centred and are thus utter crap. Sue me. 🙂

Announcing RSSCloud Notify for Windows Live Writer

CloudRSS

I’m developing a project this year around the RSS Cloud protocol.

As a starting point, I’ve written a a short and sweet WLW plugin.

I’ve got it installed locally (eating my own dogfood), mainly cause useful in testing my system once its written.

This may be a bit of a contradiction in terms since wordpress.com already supports RSSCloud (you’ll see a RSSCloud tag in my feed if you view source. It gives the details of the wordpress.com aggregator).

By default it will use Dave Winer’s test server as an endpoint so make sure you change your settings before use.

Its available at codeplex here: http://rsscloudnotify.codeplex.com/

The source is in the repository if anyone wants to look at it.  Its not quite ready for prime time yet. 🙂

Update 17/11/09 Updated to version 1.01

Why I said that.

Capture

(me being modest as ever 🙂 )

Those of you who follow my twitter stream would have seen the above tweet a few hours back.

I’ve been finalizing what I’ll be doing for my honours year project (Computer Science) and that’s what the tweet is referring to.

I’m penning this post because it comes down to one thing: knowledge.

I took up RSS reading about 5 years ago and never looked back. Over that time I’ve spent countless hours read blogs covering every corner of the tech world. If i hadn’t spend that time, I would not have the foggiest idea what to do for my project.

While all my fellow students are sitting there going “aw shucks” (or, in the funnier version “eh, whats up doc??” 🙂 ), I’m planning in detail.

So I’d like to thank everyone of the authors of the blogs I follow for their time, dedication and inspiration. It would be impossible to name them all here.

More recently, twitter has become a valuable resource in connecting with other devs and getting questions answered. Those devs I correspond with regularly, you know who you are. And I thank you.

As academic restrictions permit, I may or may not be able to share project details.

In the mean time, back to work.

PS. For those of you following my work on whs2smugmug, I will do what I can in between. Note I have set up a twitter feed (whs2smugmug) and a friendfeed stream (here)

Apple v Google

Apple’s rejection out-of-hand of the Google Voice App has the interwebs all a flutter with rumours and speculation, not to mention fury as well.

Although I’m in the Uk and therefore locked out of a GV account until its released here, I’m looking forward to using it soon. Its no accident that I’m especially looking forward to using it with my iPhone, or i was in any case.

The reason why this is causing such an uproar is that the target market for GV users just happens to overlap rather significantly with that of the iPhone.

The fact is though, Google Apps for Business does not get enough attention these days. In fact, there has been a spate of articles on how Google Apps for Domain falls down when it comes to being a valid option for businesses.  My hope is that Google integrates GV into the suite, giving clear value and functionality for the business user (read: me).

I envision a number of use cases where this could work.

  • Imagine, via GV, a Google Wave, document, spreadsheet or presentation open magically when you answer the call. Not only are you talking to the person, you can collaborate in real time)especially rue of Google Wave).
  • Google Contacts will give caller identity a whole new meaning, even if the callers aren’t already in our address book.
  • In fact, Since this is really a domain oriented service, imagine being able to ring contact.yourdomain.com and getting through to reception????

The fact is that Google is positioning Google Apps for Domain to be its integrated business offering.

Microsoft has Office Communication server, which requires built in telephone networks. But has none of the integration opportunities that Google Apps for Domain has.

In fact, it would be worth the money.

If true, the fact is that Apple is obstructing Google’s business plans. No wonder the FCC and the net-neutrality lobby is up in arms.

And if this eWeek article has any truth to it, its because Apple wants to built a similar service for Mobile Me. Its not too far fetched to imagine, and makes logical sense.

Depending on Apples implementation of it (keeping 9n mind the debut of Mobile Me), it may just tempt people away from Google Apps for Domain with GV.

But apple, seriously, if you are going to start acting like this to pre-empt the competition, remember one thing: Out-Innovate Google and you’ve won. It would be a shame for Apple to start acting like Microsoft in the 1990’s.

And what if it was AT&T???? that i can’t answer. But AT&T’s reputation is so battered and bruised with iPhone users, that they may all jump ship to Android and Pre. And even more are going to be jailbreaking to get the app.

This is a state of affairs that benefits no one.

See. I like my iPhone. A lot. Every day I discover some new feature or app that makes it even better. When el Jobso gave his blessing to this device, you can see why. And they have thrown that all away with this one stupid decision.

Or have they??

Apple have a very definite reason for doing this.

I can’t wait to see what it is.