Saturday 26 May 2007

Doing that mobile thing

For the last two months I have been using 3's unlimited X-Series Silver Internet package. This has allowed me to use multiple mobile applications and services. However until the last week I haven't had to solely rely on it for my daily dose of Internet goodness. Last week I was away at Cefn Lea, which is near Newtown in Mid Wales. Sadly I had no broadband Internet access so in order to pick up mail and keep up to date with all my blog's. Now I was expecting that doing this on my tiny Sony Ericsson K800i would be a bit of a drag. However I was pleasantly surprised, using the gMail Java application and Google Maps was great. These applications if you haven't tried them are very easy to use and really do add to the mobile Internet experience, using your keypad for quick access to your inbox and to compose well saves Lot's of time and emails render amazingly well on such a small screen and you still get to see Google convert and render basic attachments for your mobile pleasure. Google haven't let us mobile users down with Google Calendar mobile edition and Google Reader mobile edition either. These online applications really do work. In my opinion Google Calendar mobile is still a touch in its infant stage as when you try to add an event its always entered as the current hour's event, which doesn't help, but it does have great potential. Sadly though, even Google can not save the entire day for mobile users. Google tries to convert as many sites as possible for mobile viewing if you use their search engine, but sometimes this still doesn't work. Some sites just aren't mobile friendly, sadly i must admit that trying to use Yahoo mail was one of these, it just wasn't happy and had some odd rendering. Flickr, CricInfo, BBC just to name a few however are awesome and work really well. Flickr Mobile even allows you to upload images directly from your mobile phone, tag them and do all types of awesome things. So after a week of mobile Internet instead of broadband I have to say it's getting there. Being able to access email and basic websites on the move is now becoming far more than a fad or just for "business" people. Especially with the introduction of monthly flat rate mobile access pricing. I would expect with the introduction of flat rate access that mobile web usage should go up. This should also mean mobile web applications which are accessible should become the norm. However for this to happen developers need to ensure they either make mobile editions of there sites which will encure more development or test their sites in a mobile environment. Now I'm not sure how wide spread this will become, but I would hope at least that as the Internet becomes more accessible on a mobile device that more effort will be put into the mobile development area. If Google have a say in it, I'm sure it won't be long before most of their applications will be found as mobile apps. Here's hoping for Google Doc's on your mobile ;)

Thursday 24 May 2007

Del.icio.us Links For 24/05/2007

Tip/Trick: Using IIS7 on Vista with VS 2005 - ScottGu's Blog - 24 May, 2007

Great Post on getting VS2005 to work with IIS7
Link: http://weblogs.asp.net/scottgu/archive/2006/09/19/Tip_2F00_Trick_3A00_-Using-IIS7-on-Vista-with-VS-2005.aspx

YUI Theatre, Tech Talks and stuff - 24 May, 2007

Used for a while just never bookmarked, its all good
Link: http://developer.yahoo.com/yui/theater/

More Vista Tips - IIS 7 and Visual Studio 2005

IIS 7 Woes

Tonight I decided to carry on with Old Roan's site, I havn't touched it since I reinstalled Vista on the weekend. Everything is running pretty sweet now, even got my "New Day" office 2007 installed. All was grand. Until I resetup the old roan site in IIS7. When I tried to view the site: oldroan.mjjamesdev.mj for example I got a nice: HTTP Error 500.19 - Internal Server Error Yummy, after about 10 mins of faffing I realised that the security permissions on the folder were set to, Administrators, Creator Owner and my user only. When copying the data back to my main drive off my backup the Users group got lost. So a quick add user group with read and execute permission solved everything.

Visual Web Developer Express 2005 Woes

By default, the VS 2005 range including the express editions don't like IIS7. When you try to open a site that you have running in IIS7 its says the product is not compatable. I was gutted to hear this but for the past month I have been using Vista I never really thought much about it as I know 'Orcas ' is only around the corner. However stumbled upon Scott Gu's Blog article detailing how to get it all working. Needless to say this is great and really does help :D

Tuesday 22 May 2007

Del.icio.us Links For 22/05/2007

ThickBox 3 - 22 May, 2007

ThickBox is a webpage UI dialog widget written in JavaScript on top of the jQuery library. Its function is to show a single image, multiple images, inline content, iframed content, or content served through AJAX in a hybrid modal.
Link: http://jquery.com/demo/thickbox/

Switching Domains

Just a quick post to say that this blog is moving from mjjames.blogspot.com to blog.mjjames.co.uk. Hopefully you should find this a smooth transition and probably not even notice :D

Sunday 20 May 2007

More ASP.Net Antics - using the Site Navigation with SQL

Now recently I have been building a website for a mate's mum's church. Mainly just in my spare time and have used it to learn .Net. Initially I was going to knock something together using an old PHP 5 CMS I knocked together at uni. But me being me wanted to learn .Net as it was about time I stated. Anyway I have been working on it for many a week now and it's coming along nicely, the point of this post is to discuss and share a development I made.

.Net 2's Site Map Provider

As standard ASP.Net 2's site navigation controls all use XML as there base. Now my basic CMS I have developed obviously stored everything in SQL. Which obviously isn't a simple XML file. My problem then was how do I use the navigation controls. My intital development, which left me learning a valued lesson I might add, lead me to start writing some that generated a new XML file for the site navigation as soon as the admin tool added / removed a page. As great as this was and it allowed me to learn to use XMLWriter it was a bit rubbish. Fancy having to write an XML file to the server all the time. Not an ideal solution. However shortly after this I was on the MSDN Magazines site and I found the following article this was a far better way. So I used it as it said to and low and behold the site navigation tool worked. Breadcrumbs, Nav all good. That was until I started looking at the code. Tables, no provision for selecting which pages would show up for nav customisation, no access keys for accessibility and must I say it again TABLES. So time for a MJJames customisation. The navigation control was easiest to solve as it involved making a custom control that used the SQLSiteMap datasource and then repeaters to render the navigation. My code for this will be available shortly here.

Modifying the SQLSiteMap code

The next step then adapting the SQLSiteMap datasource code. These changes involved 1) altering the SQL Stored Procedure so that instead of the SiteMap table the stored procedure used my page table and also returned the access key stored in the DB. This SP will also be found here in the code file. With the SP returning the right information it was time to customize the SQLSiteMap code to allow access key's to be inserted into the SiteMap XML being returned for use in the SiteNavigation Control. The first change was made to the initialization method. Within here I needed to add code to pull out which filter the navigation should, if any, use. The simplest way to store these would be in the web.config as this is customisable on a site per site basis. So:

sqlFilter = "";

    if (config["filter"] != null)
    {
        sqlFilter = config["filter"];
        config.Remove("filter");
    }

allows us so first set the sqlFilter to an empty string, so we don't get any nasty errors. We then query the config for the filter property. If the property isn't null then lets use it and then remove it from our config object so that we know it's used and it's not an unrecognised attribute and therefore can't break anything. With this done i decided to update
 public override SiteMapNode BuildSiteMap() 
within here the various indexes are set up for the siteMap, as I needed to another attribute another index needed to be added. So I added
                 _indexAccessKey = reader.GetOrdinal("AccessKey"); 
This then gets our AccessKey out of our recordset and were hunky dorey. Now we have the AccessKey in our index we need to use it. The method used to render / build our sitemap
    private SiteMapNode CreateSiteMapNodeFromDataReader (DbDataReader reader) 
To understand what we need to achieve in this method its worth getting to grip with what the method does. The method basically uses the indexes that were set in the BuildSiteMap method sees if there is any data in the datareader contained at he index location. If there is then we use it, if not we don't. Within here we need to pull out the data contained within the datareader that relates to our access key and then store it some how in the xml sitemap node. So the code for this little section takes on the form
 string accesskey = reader.IsDBNull(_indexAccessKey) ? null : reader.GetString(_indexAccessKey).Trim(); 
The next issue, as I hinted upon, was how do we get this data into our sitemap node. When I looked at the schema for the sitemap navigation, Web.sitemap XML schema, Microsoft talk about being able to store custom attributes as Named Value Pairs. This is exactly what I needed to do for accesskey's so i then created a namedvaluecolelction and added the accesskey to it.
        NameValueCollection attributes = new NameValueCollection();
    attributes.Add("AccessKey", accesskey); 
It's worth noting here that you could potentially add any other name value attributes here, so if you need to include any extra information into your navigation simply add it to this attributes collection using
 attributes.add()
The final step I took was to then update the insert sitemap node command to include the attributes collection, thus giving:
 SiteMapNode node = new SiteMapNode(this, id.ToString(), url, title, description, rolelist, attributes, null, null); 
. And that was it, the SQLSiteMapProvider now included accesskeys. And this process can be used to add any amount of attributes as you need. Just remember to work your way through the code and take time to understand what is being done, and why. My modified SQLSiteMapProvider, stored procedure and my simple navigation control using repeaters is all bundled together here, it's released here and this work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.

How many plugs does one study need...

This morning I was sat in my study and I noticed how many plugs I was actually using. By my estimates my study which is used by Hayley and myself has the following electrical appliances: 1 Tower PC, 2 LCD monitors, 1 Laptop, 3 Printers, 1 Surround set, 1 Modem, 1 Router, 1 Cordless Phone + Charging Station, 1 External HDD, 1 PDA Charger, 1 Mobile Phone Charger and 1 Free Standing Lamp. Now each of these have a plug so that means in one small study I need 15 plugs just to use everything, is it me or is that insane! Now when Hayley and I moved into our house we chose the study room as the study compared to the slightly larger spare room as it has 2 double sockets compared to just the one in the spare room. But even so it's still 1 four-way per socket. Luckily most of the appliances are low amp low drain devices otherwise this one room could end up costing me a fortune. Is it me or in this digital age shouldn't we be able to cut down on the amount of plugs needed? Surely there's a better way? For instance, a DVD Player, XBox, TV Set Top Box etc all need to plug into a TV, be this LCD, Plasma, CRT, you get the gist. Why not build into our TV's a modular power supply so that these devices along with the required audio/video connectors a simple power connector could be included. Not only would this save on all those untidy cables being everwhere but also save on the amount of plugs and unsafe multi-ways which are always overloaded. This idea could be developed for PC's, we have modular power supplys for the internal components but why not the external? LCD's use alot less power than CRT's, Printers are relatively low drain why not as well as our trusted USB connection have another power connection that can be plugged into our power supply but on the exposed side. Again less cabling, better use of cables etc. It's not like these devices would exceed the 3.2Kw of a plug socket anyway, as multi-ways cant! Anyway its an interesting idea, I wonder if we will ever see something like this. I hope so.

Friday 18 May 2007

Hack Day Baby

Just to announce its official, I'm coming to Hack Day so see you there ;)

Wednesday 16 May 2007

Tuesday 15 May 2007

When .Net and IIS Have a Lovers Tiff....

Now as I'm sure as many of you know .Net and IIS seem unseperatable nowadays, .Net powered sites are the norm, and why not its great. However there are times, like this evening, when something goes horribly wrong. IIS and .Net stop talking, and decide to be uncoropative. Why this happens, be it a software install / update, an IIS restore still manages to get past many people. Usually I find that doing a cmd prompt script fixes it and then they get back together as if nothing has happened. aspnet_regiis -i is usually enough. But tonight my virtual server wasn't having it. However after 10 mins of scratching ones head i realised the problem was that although registered .Net was not enabled, so simply run aspnet_regiis -i -enable and voila IIS and .Net are off into another honeymoon period

Monday 14 May 2007

Del.icio.us Links For 14/05/2007

d.construct 2007 conference - 14 May, 2007

information on d.construct 2007 - usability conference
Link: http://2007.dconstruct.org/

Tuesday 8 May 2007

Monday 7 May 2007

Del.icio.us Links For 07/05/2007

MSDN Article on there SqlSiteMapProvider - 7 May, 2007

MSDN's SqlSiteMapProvider and how to use it and configure caching depending on your db
Link: http://msdn.microsoft.com/msdnmag/issues/06/02/wickedcode/default.aspx

Tweaking My Del.icio.us Script

Well after running my del.icio.us script for a few months now I decided to tidy it up a touch, mainly in the form that as Blogger uses the email's title as the blog post's title there was no need to include a title in the emails body. This has been updated so now my daily del.icio.us post's wont have those horrible duplicate titles. If you want to run the script yourself then feel free to download your copy and host / run it yourself. All I ask is that you leave my comment header in the top. At some point I will tidy the code up a bit more and look into Google bookmarks.

Thursday 3 May 2007

Del.icio.us Links For 03/05/2007

Curvy Corners - 3 May, 2007

Another way to do curvy corners on your sites but you don't have access to your markup Link: http://www.curvycorners.net/usage.php