Archive

Archive for the ‘development’ Category

DeepZoom / PhotoZoom

March 11th, 2008 No comments

Straight of the back of the deepzoom announcement capabilities of Silverlight to comes photozoom. 

PhotoZoom is a site created by mslivelabs and incorporates the DeepZoom technology.  Don’t expect a full blown flickr site here, this is a demo obviously, but it demos beautifully the possibilities  of DZ on a photo site.

So if you don’t know what DZ is or have seen PZ then pop along to my album I created here.  Use the Mouse Wheel to zoom and left mouse to grab and move the canvas.

http://photozoom.mslivelabs.com/Album.aspx?alias=BinaryJam&album=1&lc=2057

 

For those who really have no clue as to what DZ is here is a description nicked from MS. Note Seadragon is the original name.

Seadragon is an incubation project resulting from the acquisition of Seadragon Software in February. Its aim is nothing less than to change the way we use screens, from wall-sized displays to mobile devices, so that visual information can be smoothly browsed regardless of the amount of data involved or the bandwidth of the network.

Tells you loads that don’t it.  Essentially you stitch a whole bunch of photies together creating a huge photo I mean really really huge, then the processor rips it apart into tiles.  Those tiles are loaded dependant on viewpoint and zoom level.  So instead of downloading some 10 billion pixel image only the viewpoint tiles are loaded each zoom level being a image scale of the original until you get right down in it.  Apparently this only produces 1.33 times the original file size but massively reduces the download size.  And it looks really cool too.

 

Technorati tags:
Categories: development, Silverlight Tags:

IE8 Ajax Navigation – Integration with the browser

March 10th, 2008 No comments

One of the things that’s being touted as an improvement to IE8 is the integration with the navigation of the browser in AJAX.  One example is your looking at a map and zoom in then you press the back button and it goes back to the previous page.  In IE 8 you can get it to go back to the previous zoom.

One of the great things about AJAX apps, one of the things I was asked for by customers was get rid of that damn back button.  The great thing about AJAX was the removal of the back button. 

So who asked for this ?  Honestly unless they ask for it its not something I would not implement as a default, I want people on the site and use the site navigation not the back button. 

The Keynote and Talk T04 of mix mentions this.  By the way the speaker of T04 a talk entitled, “Developing cutting Edge Web Applications with IE8″, was singularly the most boring so far.  If you entitle something cutting edge you better damn well have some enthusiasm about the topic

I’m listening to it right now ….ZZZZZzzzzzzzzzzzzz.

Technorati tags:
Categories: development Tags:

Population Density SQL and Dense_rank()

February 18th, 2008 No comments

Whilst trying to create a means of mapping my population data, I created a SQL statement to pull all the people out of the system grouped by outbound postcode.

But what I needed was to plot a circle bitmap dependant on the density.  I found some functions in T-SQl I’d not heard of before  rank() and dense_rank().

I used dense_rank() so rather than trying to deal with sets of numbers ranging from 1 to 109 I now had nicel grouped results from 1-34, the number of different types of density ranked in order.  This I used to calculate my ranges.   It helped when the top most range of density was massively different to all other values.  not much use in real populution density maps but really useful for what I needed which was a rough idea of where people where in general numbers.

Without the ranking I had lots of single pixel dots and 3 large 7 pixel blobs, not really representative of the data I wanted to portray, and there is the trick isn’t it, when plotting data like this you know what you think it should look like in your own mind, this is a sql tool that can help you quickly organise that data.

Technorati tags: , , ,
Categories: development Tags:

How to Calculate My Nearest Neighbour, I Think ?

February 1st, 2008 1 comment
Map image

In my last post I found some great algorithms and libraries for calculating distances between two points.  I used it to update some archaic data listing adjacent postcodes.

With these algorithms and some online services that are now available it should be quite simple to create your own, “find my nearest store”, type service in your own websites/apps.  So here is how I plan to do it.

For ease of reference I’m going to talk about finding people instead of stores and it explores more avenues than a fixed number of stores and searching through large datasets for geo data.  Also SQL Server 2005 can do spatial searches and here is the article on doing it, it is probably really fast, but I didn’t have time to get my head around some of the complex topics discussed here, and sometimes its just fun to code it.

The system in question stores members details. They store, amongst other data, their address, postcode,zip code and work place.  Then they search the system for other members nearby who they can share a care journey with to a common destination, work.

Now trying to mathematically find the distance between 12 Arcadia Ave, Coventry and 26 The Oaks, Little Bottom isn’t possible.  So all this hinges on being able to get a mathematical representation of their location, this is the WGS84 co-ordinate system, decimal lat/long to you and me.

Imagine that you capture the address, you need to get hold of the lat/long info.  Thanks to the many API’s out their for mapping this is close at hand *. 

Read more…

Categories: development Tags:

Fun with Geodata

February 1st, 2008 No comments

Image:The Earth seen from Apollo 17.jpgA long time ago, before Google maps and live maps there was street map but no API, I wrote an car share application.  It was done in conjunction with a 3rd party who hardware bit. It logged data and awarded points for environmentally friendly travel.  That data fed into the membership system via web services.

The web based membership system interfaced with the identity system and people registered with this system and stored they type of travel they used and there outbound UK postcode.

We needed a way in this system for people to find other car sharers, so as public geodata was in its infancy and very expensive, it was done by adjacent postcodes.  A SQL table stored the adjacent postcodes for another postcode

e.g.

The full post code might be CV5 8FG  (I made this up)

I would store

CV5   CV5

CV5    CV6

CV6    CV5

CV6    CV6

And so on.

As the system grew and more sites came online, the search capability did not service the new sites for finding a car sharer as no one took responsibility for adding new postcodes and budget of course and ignorance of what needed to be done.

Yesterday I figured out that there must be some data somewhere that can help.

Well that proves hard as I have no budget and no time.

Unlike the United States our data is not free, you have the great USGS who recognise as they are funded by the public the data is in the public domain.  In the UK we have Ordnance Survey, a great organisation, but like all UK organisations, private and public alike they charge for pretty much everything, so us UK tax payers pay twice for all our data.  Likewise Postcode information was created by a public organisation, the Post Office, and whilst private now, does and always has charged for Postcode information.

I scoured the interweb for some information and eventually found a great little site, www.nearby.org.uk.  On this site he has a webservice for postcodes and location information in WGS84 format.  This is great, but even better for my purposes was the raw data available as a download !

Read more…

Categories: development Tags:

Learning Powershell

January 23rd, 2008 No comments

Its time I dipped my feet into learning Powershell, I know its going to figure a lot more in my new role, well my old role I’m going back to.

So fire up Powershell and here we go,

ll – that works

cat – that work

mv/cp – that works too

grep – Hmm no

sed – nope

awk – nope

Ok, Ok its not UNIX, might need some help here.  Lots of examples lets paste them in and see what happens.  First I need an editor

vi – damn done it again

Really don’t fancy editing in a separate window.

I did find a pretty little Powershell tool though “PowerGui“.  The main tool I find pretty pointless, when you have gone to the lengths of creating a script language why stick the output in a GUI again, It’s not my cup of tea but others might like it.  What I do like is the Script editor that comes with it. 

Now this is a good tool.  Its a script editor, you can just cut and paste your examples for leaning then press play (or step, built in debugger!)  and the output appears in a little output window.  Much more Vis Studio and more of what I’ve been used to.

So in the absence of vi, here is something much better, lovely, this should help quicken the pace.

image

 

 

 

 

 

Technorati tags: ,
Categories: development Tags:

Regex

January 21st, 2008 No comments

Well I’ve tried to avoid them as long as possible. But I have finally come round to using regex’s.

Considering that I came from a Unix background to Windows world you’d think that it would be second nature to me, but no. If ever there was a “sed” script that needed writing, I’d do it in awk, giving me power and less reliance on the old regex element of things.

I can’t avoid it any longer.  I would dabble now and again, I had Chris Sell’s Regex tool installed to help out now and again, and of course Stuart to ask and say “Hey how do I do this in this damn regex nonsense again ?”. 

But now there is truly a tool that is helpful.  Expresso, from ultrapico,  is just great at creating regexes.  Now there are many good tools out there but they have to fit the brain of the user and this one fits mine.  It was down to this tool I finally got it, it introduced names groups and replacement section or whatever they are called enabling me to do complex search and replaces that I wanted but couldn’t figure out.

So if your still a ludite after all this time then take a look at this tool, complete with a great help file which is actually the test data  as well.  Brilliant, just brilliant.

 

Technorati tags:
Categories: development Tags:

WPF, Minority Report style interaction

January 14th, 2008 No comments

Found this on the interweb.

http://www.cynergysystems.com/blogs/page/rickbarraza?entry=connecting_to_the_wii_control 

It’s a video of some chap whose created a Minority Report interface using

WPF

.NET

WiiMote

Fancy Custom pair of gloves (with leds in the fingers I reckon)

A piece of string

It’s quite impressive, It uses Brian Peeks .Net library for interaction with the WiiMote.(Other Article in case your websense blocks it). 

Then using the custom hardware (gloves) can control the items on screen.   The Wiimote can track up to four infra-red LED items at a time, the rest is all software.

This should be possible in Silverlight 2.0 as well.,

**UPDATE** : reading the forums its unlikely this is the case.  Silverlight reacts to the keys and the mouse specifically, people are saying the sway silverlight is built, is that is is not possible.

Technorati tags: , ,

Categories: development, Silverlight Tags:

Excel VBA and the Ribbon and Excel Web Service Data

January 4th, 2008 No comments

Now I’m not much of a VBA person, in fact I hate doing, I avoid it like the plague.

Recently I was asked to knock something up that showed a report of our open calls. 

No problem I though just connect to the existing Web Service I will just knock up a simple asp.net 2 page with a grid and away I go.  This was easy enough until I wanted it deployed to IIS, and not having played with Studio 2005 that much I just gave up and thought I’ll do it in 2003.  Well long story short my machine really could do with a rebuild.

Damn, I’ll just do it in Office 2007 Excel, That’s all XML based now isn’t it !

HA!

For all MS’s talk of web services and connectivity excel can’t natively consume a web service.  If I’m wrong show me, please, but I could not find add web reference in the VBA or create a web service data connection.

Well the XP/2003 Office Toolkit came in handy it allows you to connect to a web service, tick the box and it generates a load of VBA code in a handy Class.  It doesn’t matter that it’s for 2003 it works in 2007 (did for me).

This worked great, once I figured out how to actually reference a cell in VBA, I had it ripping through a node list and putting the data into cells (its not a big report if it was then this is quite slow).

But there is just something really nasty about having Buttons “IN” the spreadsheet, its shoddy.

So I wondered how I could create a custom menu with buttons on it.

Well in 2007 with the Ribbon bar it could not be simpler.

Take a look at this series of posts by Ken Puls

http://www.excelguru.ca/blog/category/the-ribbon/  

This allowed me to quickly figure out how to create my own custom interface to execute the evil VBA macros making calls to web services.

 

Handy Tools :

CustomUIEditor – http://openxmldeveloper.org/archive/2006/05/26/CustomUIeditor.aspx

Web Service Toolkit – http://www.microsoft.com/downloads/info.aspx?na=22&p=1&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=&u=%2fdownloads%2fdetails.aspx%3fFamilyID%3dfa36018a-e1cf-48a3-9b35-169d819ecf18%26DisplayLang%3den

Categories: development Tags:

Fancy bit of design

November 30th, 2007 2 comments

It’s not often that something grabs me on the internet nowadays, obviously Silverlight did and the amazing capabilities for design and interface it offers whilst having a programming model that I am familiar with.  Bog standard html/css well I’ve seen it all haven’t I ?  You can’t do anything else to surprise me, can you ?

Well actually you can.  Perhaps its been around for ages, perhaps it’s a new tilt on something that’s very common and I’ve had my head so deep in RSS to notice.

MS just released the MIX ’08 site.  I’d love to go but I’m from the UK so will have to wait for some poor cousin affair in London, with none of the same speakers and some blueberry muffins scattered about to placate us.  Hardly the Vegas equivalent.  Perhaps they could do it in Blackpool in a new super-casino, if they ever get built.  But I digress, again.

There is something about this site just so simple and so elegant, and it occurs in the top two inches of the page, the rest of the page is the usual stuff but I had not seen such an elegant header before that allows the content underneath to scroll under it, but its a window scroll not a Div scroll that threw me.

It took a little digging in the css but I discovered an attribute I had not seen before 

position:fixed

Absolute and Relative sure, but when did fixed appear ?  Has it been there a while and I just missed it and been server coding so long.

Well combined with a transparent png it is used to great effect.

Shame that the Silverlight panel is not set as a windowless control so gets its own window and doesn’t slide under the header.

 

Technorati tags: ,
Categories: development, Internet Tags: