Saturday, January 09, 2010

Using the TFS 2010 SDK (Beta 2)

With significant changes to the way TFS 2010 works, especially in relation to Team Build and the new concept of Projects Collections, the API has necessarily adapted to account for these changes. For developers wanting to use these new API’s, there is currently very little in the way of documentation. The TFS SDK code gallery site has a small amount of examples, as well as the beginnings of the API documentation, which although sparse, because of reasonably clear naming conventions actually offers users some guidance when attempting to write integration software for TFS 2010. There are also a few other bloggers around who have some posted code examples.

I have been looking at re-writing TFS Dependency Replicator for TFS 2010, and in so doing have created a very simple application to enumerate some of the objects I am interested in.

In the interests of helping other developers, here is my source code. You can also download the full solution from here.

To run it, you must have .Net 4.0 beta 2 and TFS 2010 Explorer Beta 2 installed on your machine.

class Program
{
static void Main(string[] args)
{

// Get a list of all registered Project Collections
Console.WriteLine("Project Collections");
var collections = RegisteredInstances.GetProjectCollections();

foreach (var collection in collections)
{
Console.WriteLine("Connecting to TFS Server {0} at {1}", collection.Name, collection.Uri.ToString());

// connect to tfs
using (var tfs = new TeamFoundationServer(collection.Uri))
{
tfs.EnsureAuthenticated();
Console.WriteLine("Successfully connected to {0}", tfs.Uri.ToString());

// Get items of interest from TFS
EnumerateServer(tfs);
}
}

Console.ReadLine();
}

private static void EnumerateServer(TeamFoundationServer tfs)
{
// Get all of the Team Projects
var structureService = tfs.GetService();
var teamProjects = structureService.ListAllProjects();

Console.WriteLine("Team Projects");

foreach (var teamProject in teamProjects)
{
Console.WriteLine("\tName: {0}", teamProject.Name);
}

// extract all the work items
// NOTE: this uses wiql to query the work item store
Console.WriteLine("Work Items");
var workItemStore = tfs.GetService();
var workItems = workItemStore.Query(
"SELECT [ID], [Title] FROM WorkItems");

foreach (WorkItem workItem in workItems)
{
Console.WriteLine("\tID: {0}\tTitle: {1}", workItem.Id, workItem.Title);
}

// Get the build servers
Console.WriteLine("Build Servers");
var buildServer = tfs.GetService();
var buildControllers = buildServer.QueryBuildControllers(true);

// Get all the build controllerrs
foreach (var buildController in buildControllers)
{
Console.WriteLine("\tController: {0}", buildController.Name);

// Get all the build agents
foreach (var agent in buildController.Agents)
{
Console.WriteLine("\t\tAgent: {0}, Team Project: {1}", agent.Name, agent.TeamProject);
}
}

foreach (var teamProject in teamProjects)
{
// Get each build definition for this Team Project
var buildDefinitions = buildServer.QueryBuildDefinitions(teamProject.Name);

foreach (var buildDefinition in buildDefinitions)
{
Console.WriteLine("\tBuild: {0}", buildDefinition.Name);

// Get all build Details for this build definition
var buildDetails = buildDefinition.QueryBuilds();

foreach (var buildDetail in buildDetails)
{
Console.WriteLine("\t\tBuild Number: {0} Build Status: {1}", buildDetail.BuildNumber, buildDetail.Status);
}
}
}

}
}

Sunday, December 27, 2009

Broken Angels book review

In his first book, "Altered Carbon", Richard Morgan sets up a universe in which human consciousness has been digitized, and can be transported over inter-planetary distances, re-sleeved (placed into another human body), and backed up. Broken Angels follows the main character Takeshi Kovacs, into another "Subjective" life on another colonized planet.

The exploration of the digitized consciousness concept is great. I particularly love the graphic description of the "Soul Market". He also does reasonable job of describing the not so subtle links between greedy corporations and wars, but I feel he could have gone further. This time Aliens make an appearance (although long extinct), and there are some interesting explorations of the academic attempts to explore alien culture, and the parallels with our attempts to understand ancient earth cultures is fairly obvious.

The development of some of the characters was good enough to understand their motives, but still allowed for some surprises in the end. Other characters I feel weren't really developed as well as they should have been.

I feel that the books main problems revolve around the central character Kovacs. At times it can feel very much a "One man takes on the world", "Alpha Male" stereotype. I think this was also the first books main problem as well. It also uses the created universe of digitized consciousness and technological advances to allow for more graphic violence, but I think that is an acceptable exploration of the ideas the universe is based on.

As with the first book, the general outlook is bleak, basically accepting that technology will never be a panacea for human ills, but it does leave the reader with the slightest glimmer of hope at least for some of the characters you have met along the way.

I will definitely be reading the third in the series.

Technorati Tags: ,

Thursday, December 17, 2009

Linq2SQL Bug with derived classes and Calculated fields

Today I discovered a bug in Linq2SQL. When you define a class hierarchy in dbml, where you derive a class from a base Class, and both use the same underlying table, and a discriminator property, as shown below:

derived_dbml

If you then wish to expose a calculated field in the derived class, (and trust me I have come across situations where this is a requirement), you will find that Linq2SQL throws an exception when you attempt to insert or update items of the derived class to the database.

The exception is as follows

Test method DerivedClassTest.DerivedClassTest.TestInsert threw exception:  System.ArgumentException: Property 'System.String CalculatedField' is not defined for type 'DerivedClassTest.BaseCLass'.

This bug occurs deep within the Linq2SQL logic, and is to do with the AutoSync functionality where Linq2SQL attempts to create a select statement to return the values of AutoSync fields at the same time as it performs the insert.

You may be able to work around this by setting the AutoSync property on the Column Attribute to “Never” as shown below

[Column(Storage="_CalculatedField", AutoSync=AutoSync.Never, DbType="NVarChar(61)", IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
        public string CalculatedField

And note that setting this in the designer doesn’t seem to work either, it just removes the AutoSync parameter all together, but still fails. You manually have to set it in the generated code (another bug perhaps?).

Of course this means that you won’t get the new value of the field after an insert or update to the table, and you’ll have to re-query the table if you need it.

The alternative workaround is to ensure that all calculated fields are placed on the base class.

Saturday, December 12, 2009

I have joined the e-Book Revolution

I have finally bitten the bullet and purchased a kindle. I had been tossing up between the kindle and the nook, and even though in many respects the nook is a superior device, there were really 2 “features” that persuaded me in the end. The first was Text To Speech, the second was availability.

The Nook does not have Text To Speech, and I could not find any evidence that they were thinking of adding it in a firmware upgrade. Also I wanted it before Christmas, and the earliest anyone can get there hands on a Nook is 15th of January.

I’ve had my kindle for 2 days now, and so far I am really happy with my purchase, but there are certainly some negatives, so here is my review.

The positives.

  • Great looking device, thin and light.
  • reasonable 3G coverage (in most major Australian cities).
  • Text to speech rocks.
  • Latest firmware upgrade (2.3) adds native support pdfs.
  • Good reading experience (eInk is cool).
  • Support for converting files of many different formats such as html, mobi pocket, rtf, etc…, although native support for these document types would be better.
  • Can sync your personal documents via your own PC.

The negatives

  • No Wifi. I have been amazed at how Amazon have actually sold this as a feature “You don’t have to hunt around for a wifi hotspot”, actually Amazon, I have one of them at home, as do many people, also many of the cafe’s I would go to read have them as well.
  • No Australian news content. This really infuriates me, I would love to get The Age delivered to my kindle, but alas I’ll have to go on killing trees to get my news.
  • Proprietary DRM format. It really annoys me that if I do eventually decide to go for another ebook reading device, I will potentially lose my entire book collection.
  • Not all books come with Text To Speech switched on. I got caught out on this on my first purchase, not checking the information thoroughly enough. I feel a bit cheated, as I feel the publisher has no right to determine how I choose to consume their content. Are they going to dictate that I cannot have another human being read it to me? No, then why draw the line at a computer?

My particular reason for wanting the Text To Speech feature is that I am a very slow reader, and Text To Speech would drastically increase the amount of books I could “read”. In future I will be making purchasing decisions based heavily on whether or not Text To Speech has been allowed by the publisher. Having said that, I wouldn’t be surprised if the problem with Text To Speech rights lies more with audio book retailers than with publishers, but that’s one for the conspiracy theorists to argue about.

Thursday, December 03, 2009

Visual Studio Help Integration Wizard and Continuous Integration

As .Net developers we are constantly using msdn and the Visual Studio help system. One of the most powerful features of Visual Studio is the ability to hit the F1 key on a class, property or method, and have it whisk you away to the correct msdn entry for the item of interest. When using third party libraries, it is great when they are able to provide you with the same ability to search API documentation from within Visual Studio. This is all possible, but I recently discovered, not necessarily trivial, and there is a really big gotcha if you want to add it to your Continuous Integration process.

To start with you need to ensure that all developers of your API are meticulous about putting XML Summary comments on ALL public facing entities. This is a good practice whether or not you intend to distribute the API.

The second step is to use a tool like sandcastle to build compile the xml comments into a usable format. Sandcastle has a number of different outputs including the classic .chm (Compressed html) output that is easy to read and can be distributed with your project, however, if visual studio integration is what you are really after, then you need the Html2 help output (*.hxs). As there are a lot of different settings for sandcastle, it is good to use the SandCastle Help File Builder that provides a nice settings based interface as well as a command line utility to aid you in building your help files.

The third step is to create an installation package (.msi or .msm) to distribute your documentation to the millions of developers who will be using your API to write the next killer application. There are a few ways of achieving this, to do this from scratch you could follow these intructions, however, in the Visual Studio 2008 SDK, there is a project type called the Help Integration Wizard that attempts to automate this process for you. This very simple project template works great right up to the point where you try to integrate it into your Continuous Integration Process.

The first problem is that the solution created contains 2 vdproj files, which means that you can’t build them with MSBuild, and are forced to pollute your build server with Visual Studio and compile it using the devenv command line. However, even after you have taken this hit, the pain doesn’t stop there.

The reason is because of 2 files that are included surreptitiously in the project path but not added to the solution. The executable FixRegTables.exe, and a merge module called MSHelp2_RegTables__RTL_---_---.msm get added to the CollectionFiles folder for the merge module project that is created. If you fail to check these in to your source control solution, your CI build will break with an error about a post build step. However, if you do add them to your source control repository, then chances are when you perform a “Get Latest” operation, these files may well be marked as “Read Only” as this is standard practice for many source control systems to ensure that source files are not modified during a build. In this case, the build will work as expected and produce an msi file, however, the resultant msi file will not install anything when run. The issue is that the Post Build step mentioned above needs to modify the merge module.

The solution is to either check the 2 files in to your source control system, and make the merge module writable as part of a pre build step, or to copy the two files from their location in the visual studio sdk into the Collection Files folder as a prebuild step.

Sunday, November 08, 2009

Bragging time

On Friday, I successfully passed Microsoft Certification exam 70-561. This now makes me a MCTS: .Net 3.5, ADO .Net Applications.

I am going to do a few more exams over the coming year, but I’ve yet to decide what the next one will be.

Saturday, November 07, 2009

One small gripe about my laptop

I absolutely love my new laptop, especially since I put an SSD in it. I have one small gripe however, and that is with the keyboard, or rather the lack of one key that I have become very reliant on, that is the “Right Mouse Key”.

I am often too lazy to plug in my mouse, or often (like now) not in a position to do so (reclining in a comfortable chair with my Feet up, and the laptop on my lap), and I have become quite used to the keyboard shortcuts for all the applications I use, which is why I have always loved the right mouse key, but alas on the Dell Precision M4400 laptop, no such key exists.

Having said that, just in doing my research for this rant, I have in fact discovered that Shift+F10 does the same thing, problem solved! Still would  be nice to have a single button for this though.

Monday, October 05, 2009

Laptops, SSD’s, vhd’s and Hyper-V

I recently splurged and purchased one of these for my new laptop. I was finding hard to justify the extra expense for the 128GB over a 64GB SSD, knowing full well, that if I was careful I could run an OS and all the applications I normally use on 64GB, but I thought… what the hell. This weekend I discovered the “boot from vhd” feature of Windows 7, and I can say I am so glad I spent the extra money.

I have successfully created a dual boot for Windows Server 2008 R2 running on a 25GB vhd stored on my SSD. It is a bit of work, mucking around with DISKPART and BCDEDIT, but once it’s set up, it just works a treat, and thanks to my SSD, the speed is awesome. My main reason to do this was to play with Hyper-V as I have been charged with setting up a build server and test server at the client I am currently engaged to.

Saturday, May 16, 2009

New Laptop

having recently gone back to work after returning from a year in Buenos Aires, I have been tooled up. One of those tools as you may already have seen from my previous post is a new laptop, and just by way of showing off, I thought I’d post the specs up.

My Laptop

  • Mobile Workstation AW-M4400n - Dell Precision M4400n-series Base
  • Intel(R) Core(TM)2 Duo Processor T98002.93GHz, 6M L2 Cache, 1066MHz FSB
  • 8GB (2x4GB) 800MHz DDR2 SDRAM
  • 15.4 " Ultrasharp(TM) WUXGA (1920x1200) RGBLED Display with TrueLife(TM)
  • NVIDIA Quadro FX 770M, 512MB dedicated memory
  • 8X DVD + /-RW Drive
  • 2nd Hard Drive 120GB SATA (5400RPM) Hard Drive (External)
  • Integrated 0.3 Megapixel VGA Webcam with Single Digital Mic for WUXGA LCD
  • Wireless Network Cards -Intel WiFi Link 5300 (802.11 a/g/n 3X3) MiniCard

I have also made the decision (as many other Readify people have) to install Windows 7 RC on it. So far there have been no serious problems, but there are a few things I have found and I will blog about them as I find and (hopefully) fix them.

The first one was Google Chrome not working, but there are many posts about this, however even after this, Chrome does seem to be a little unstable from time to time, the end result of which is I end up spending half my time in IE8 which I have no real problem with.

The second problem was the bluetooth issue I talked about in my previous post.

I do get a little bit of instability from Visual Studio 2008 from time to time. I think it has something to do with Team Member Presence information in VSTS Team Explorer, and so I turned off this feature and it now seems to be a lot more stable.

Technorati Tags: ,

Windows 7 and Bluetooth Issues on DELL M4400

Since yesterday evening I have been trying to get Internet connection sharing happening between my new brand HTC Touch HD, and me brand new Dell Precision M4400 running Windows 7 RC.

My new laptop

as could be expected, there were some issues. In fact, I still haven’t managed to get it working, but I am 1 step closer to a solution. The first and most overriding problem was that the device drivers on my DELL weren’t working properly. A quick google search and a few clicks later, and I found this discussion on notebookreview.com from someone having the same problem as me with their M6400.

http://forum.notebookreview.com/showthread.php?t=340326

So I tried it, and sure enough it worked. I decided to do the right thing by the community and reply to the thread, thanking them and adding the DELL M4400 to the list of laptops that it works with, as well as adding a link to the right driver downloads for the M4400, but alas, even after registering with the website, it appears as though I don’t have the necessary privileges to reply to the forum. So I will disseminate the information here on my blog.

So if you have a DELL Precision M4400 and are trying to get your bluetooth to work, you need to

  1. Download these drivers from DELL 
  2. Open the folder where the downloaded executable resides
  3. Right Click and select “Troubleshoot Compatibility”
  4. Select “Troubleshoot Program”
  5. Select “The Program worked in earlier versions of windows, but won’t install or run now” and Click “Next”
  6. Select “Windows Vista” from the top of the list and select “Next”
  7. Click “Start the Program”

At this point the bluetooth drivers should install no problems.

I have now successfully created a bluetooth connection between my phone and my PC, and can happily use some of the bluetooth networking features. Unfortunately, Active Sync doesn’t quite seem to connect properly over bluetooth, I think it’s a problem with “Windows Mobile Device Center” on Windows 7 RC, and of course I still haven’t been able to get Internet connection sharing working. Any help or suggestions would be greatly appreciated.

Thursday, May 14, 2009

New phone, was happy, then… suddenly… not

A few days ago I was the happy owner of a new HTC Touch HD phone which I have been happily playing with. Sure it might not be as trendy as the iPhone, but I was pretty impressed. It has a 5 Megapixel camera, as well as a lower res camera for video conferencing. It has WM 6.1, plus HTC’s own Touch Flo home screen which gives you some of the iPhone look and feel that Windows Mobile is seriously missing. I was starting to really enjoy it, downloading all the applications I wanted on it, connecting it up to my WiFi network and watching You-Tube videos on it, etc… then it came time to change my SIM card. I opened the back, took the battery out, replaced the SIM card, replaced the battery, and then this.

Dead phone

The phone would not boot, the OS would not load. I tried 20 different things, changing the SIM card back, doing a soft reset, without SIM card etc… nothing helped. The only thing that did eventually fix the problem was a hard reset. This means wiping ALL your data. So I am currently trying to re-install all the software I had up and running. Not very happy, starting to loose confidence in the device, and starting to wonder whether I should’ve purchased an iPhone.

Saturday, March 07, 2009

CityRail not just biased towards iPhone

It seems that a number of mobile application developers have fallen foul of CityRails timetable copyright antics. At one stage CityRail even went to the extent of scrambling their website in order to stop people screen scraping. I repeat, it may be true that they legally own the copyright to this information, but that is in no way helpful to the people who want (and dare I say have a right to) this information. It’s not that hard, really. Other governments have managed to do it, what is wrong with the NSW Government.

Friday, March 06, 2009

Government 2.0

Reading an article in The Age about CityRail’s attempts to stifle a very useful iPhone application reminded me of a seminar I attended at Web Directions North 2008 on Government 2.0. The thrust of the seminar was basically for governments to encourage this sort of effort. They are the sacred holders of the information that the public need, they should release this information and let the general population use it in the way they see fit. Governments don’t always have the best ideas, or even if they have great ideas, they don’t always have the necessary resources to realise them. In the past forward thinking governments have found abundant creativity and resources if they simply provide the information and let the community do what is needed with it. Sure you may need to provide some disclaimers for legal purposes, something like “While <insert name of government agency here> supports development of third party applications based on the data we provide, we cannot vouch for the accuracy of the program, nor it’s suitability for any particular use” I’m sure every application developer would be happy to include this in there terms of service.

In this specific incident, CityRail has used the copyright argument saying we own the timetable information. Which is probably legally true, but at the same time totally unhelpful. People like Alvin Singh should be rewarded for there creativity and effort, not threatened. He has even offered to give CityRail the source code on which to build a better application. CityRail should take up his offer, or at the very least, bring out a competing application that is more accurate (ie includes the latest information about service disruptions, etc…), and has better features, that will quite naturally defeat Alvin Singh’s application.

Saturday, January 24, 2009

Conficker and Password Advice

I was just reading an article in The Age today about the Conficker virus, and the article was pretty straight forward… bad virus, infected lots of machines, uses brute force to crack passwords. Some of the advice that was given was obvious, use stronger passwords, make sure your OS is up to date, and any anti virus software you use is also up to date. However, the last sentence really bothered me

From the article :

"Go get a notebook, keep it next to your computer and record your password in it. No hacker in the world can hack the written page locked away in your office."

This is a quote from David Perry a “Software Security Specialist” from Trend Micro.

I have not heard worse advice regarding password security in many many years. Sure a virus can not leap out of the computer file through your notebook and try everything written down, but what about anyone who uses your office. Your cleaner, your spouse, your kids, their friends etc…. It’s the same basic principle with you bank card PIN number. If you write it down, then another person can potentially see it and use it, and if you follow the other advice in the article about using numbers and special characters (which you should) it makes it quite easy for a human to pick out a password from a heap of other random scribbling on your desk-side notepad. You may well say, but it’s only my spouse and my kids that use my office, and I trust them. Sure, but I’ve never seen it as an issue of trust in these cases, I see it as an issue of protection. I trust my spouse implicitly, but will never tell her my password. The reason being that if there is ever a security violation using my account, and my company asks me who else may have been able to find out my password, I can honestly and confidently say no-one, not even my spouse, there-by protecting her from any suspicion.

So what’s the solution. We know for a fact that username and password is a flawed security model, and we often talk about three-factor security, ie username, password and hardware key like a smartcard, as being more desirable. However, the reality is that the vast majority of systems are still protected by the humble username and password (two-factor security), so how do you choose a password that will protect your computer without the dreaded fear of forgetting it?

My tips are as follows. Pick something from your life that is obscure enough that other people wouldn’t be able to guess. As an example you may be into 70’s rock music, and in particular you may love the album from WHAM called “Make it Big”. That’s pretty obscure (not to say quite sad), or you may have just finished reading Dostoyevsky’s “The Brothers Karamazov” which is in itself an achievement worth remembering long after. Pick something from this aspect of your life, a phrase or a name, so in the first instance you might pick “Guilty feet have got no rhythm”, in the second case lets say one of the characters names “Dimitry Fyodorovich”, although a minor character may work even better, now adapt this to a password. Leave out some words and leave out spaces (if you want), then replace certain letters with numbers, capitalize others, and replace others with special characters like this “gui1tY#eeTn0rhythM”. In the second case something like this might would work “d!m!trYfY0d0r0v!ch”. Make sure the password length is greater than say twelve characters, and satisfies any other constraints your Systems Administrators want to put on your corporate network. Now you have a password that is, for you, fairly easy to remember without the necessity of writing it down, and extremely hard for a brute force crack to guess, or (and this is where the obscure thing comes in), no one who knows you will be able to guess either.

The other good thing is you now have a scheme for creating really interesting passwords, and it means that you can change the password regularly, and each time it is a game to see just how creative you can get in picking your new password. The more creative you get, the harder it will be for anyone or anything to break it, and the easier it will be for you to remember what it is.

Technorati tags:

Thursday, October 30, 2008

WCF error when transferring large byte arrays

Today I was receiving the following error when attempting to send a reasonably large byte array to a WCF Service.

There was an error writing to the pipe: Unrecognized error 232 (0xe8).

 

As you can see another potential candidate for least descriptive error message known to mankind. The only references to this error that google could find (here and here) were not all that helpful as they were about timeouts and closing the channel, in my case nothing was timing out. The solution was eventually obvious, a simple oversight on my part, the maxReceivedMessageSize property of the binding needed to be set to an appropriately high number so that the channel would allow for such a large message to be sent. Note you'll also need to set the maxArrayLength parameter of your readerQuotas configuration entry to a suitably large number otherwise it won't accept your byte array. eg.


<binding name="MyBinding" maxReceivedMessageSize="99999998">
<readerQuotas
maxStringContentLength="65536"
maxBytesPerRead="9000000"
maxDepth="96"
maxArrayLength="2097152"/>
</binding>

Friday, October 10, 2008

Personal Projects

Most developers have them, an idea in the back of their mind for a project they'd like to write. Could be anything from a little utility app to automate something that they find tedious, through to the next big web 2.0/3.0 application that will change the world (or at least make them very rich). I know I always have a few that I've got on the boil from time to time. Mitch Denny has even gone as far as posting up some of his ideas. My biggest problem has always been finding the time between a fairly full on job, and a reasonably active social life, to sit down and make some significant progress on any of them. This in fact has formed part of my justification for taking a year off work and travelling to Argentina (for a full list of justifications see this post on our tangotrails blog).

I have been making some significant progress on a couple of my ideas over the past few months, and it has re-affirmed to me the professional value of having personal projects like these. The main project I've been working on is an idea to combine my technical side and my creative side. I won't say any more in this post, except that I want to see how far the web can push the way we experience the narrative form.

Because it is my project, and my idea I have full ownership over everything, good and bad. I have full ownership of the codebase, I have full control over the direction, over deadlines and milestones, I have full responsibility for testing and bugs, I'm even in charge of running a beta program (which I intend to do soon), and marketing the product. Legal issues, hosting provider, selection of tools, graphic art, everything is my responsibility, and mine alone. It has been a really educational experience to work on a project so fully from end to end, and not be able to assign parts of the application off that are "not my problem" to someone else. I am learning so much, not just about new technologies, but also some of the non-technical aspects of getting a project like this off the ground.

I think forward thinking companies should try to encourage these personal projects for their technical staff, even if the projects their developers want to work on don't wholly align with their business goals. I'm thinking along the lines of a company integrating personal project time into their staffs professional development plan. Something like allocating X days of your professional development time to a personal project. Of course you may need a project approval process, but this shouldn't be aimed at the business determining if the project is aligned with their goals, but more that the project is significantly challenging for the developer for her to really gain something out of it. Also, a short presentation of their work, in whatever state it is in after the allotted X days, would ensure the developer is kept honest, and that information is disseminated to other developers in the organisation.

I can see this benefiting this hypothetical forward looking company in a number of ways. For starters, I've seen a lot of developers get bored with what their business wants them to do on a day to day basis. Often developers end up in roles where the domain holds little or no interest for them, or if it once did, the constant focus on it destroys some of the enjoyment they once had. Focusing, even for a short time, on something completely different, that they are really interested in, will re-invigorate the developer. Also, having developers play with technologies outside of their normal sphere of day to day experience in the business, will make them a valuable asset if the business ever needs to consider any of those technologies in the future. Being able to advertise this approach to professional development would also attract the right sort of candidates when recruiting. A really forward thinking business may also be open to the possibility that one of their developers might just be creating the next big web 2.0/3.0 application and might even be willing to partner with them in an endeavour to commercialise it.

 

Sunday, October 05, 2008

XHTML 1.1 strictly ASP.Net

For those of you who are interested in web standards, you may have noticed that when you create an ASP.Net application the standard project item templates create a web page that complies to the XHTML 1.0 Transitional doctype. This may or may not be what you want.  XHTML 1.0 Transitional is for existing websites that are in the process of migrating, or if a website specifically needs to support browsers that don't know about CSS. This is because XHTML Transitional still supports the presentation based tags such as <font> and <center>. New websites however, should generally adhere to the XHTML 1.1 strict doctype which does a better job of enforcing separation of content from presentation. So as an ASP.Net developer I have to re-jig all my pages when I add them into my solution, to comply with this doctype.

 

No longer do I have to do all this manual work, thanks to a fellow Readify colleague, Damian Edwards, who's work I really admire and respect, you can now add proper XHTML 1.1 strict templates when developing ASP.Net applications. Damian has created this CodePlex project that installs XHTML compliant item templates for ASP.Net Web Project items such as Web Form, Master Page, Ajax Web Form, Ajax Master Page, HTML Page, and StyleSheet for Visual Studio 2008.

 

Note : you also have to add the following to your web.config

<xhtmlConformance mode="Strict"/>

This tells the ASP.Net rendering engine... "no I really meant it when I said strict, and I know what I'm talking about."

What does this guarantee you as an ASP.Net developer?

Because of ASP.Net's browser capabilities detection mechanism, what this guarantees you is that when ASP.Net is serving a page to a modern browser, it will serve XHTML 1.1 strict compliant markup. Be careful, this does not necessarily mean that your site will validate with the W3C Validation Service, in fact I've been caught out on this one before.

This reminds me that I've been meaning for a long time now, to write a more concise article on developing standards compliant web pages in ASP.Net, I'll put it on my daily goals list, item #44 right after "learn Spanish". (sorry for those who don't quite get the obscure red dwarf reference).

Thursday, September 04, 2008

Developing Live Writer Plugins

I really like Live Writer. I have been using it for some time now to maintain a number of blogs, and I think the advantages of this offline blog post editing tool outweigh the advantages of the online equivalent. I'm not going to go into an in depth feature comparison here, but I will say that one thing I really love is the ability to have plugins. I have installed a number of plugins myself, the two that I use most frequently are Flickr4Writer and Tag4Writer. They are just simple little utilities that generate small bits of html and save you from the drudgery of hand crafting cookie cutter HTML yourself.

What I love more about live writer plugins as a .Net developer, is that it's fairly easy to develop them yourself. There are some fairly good articles on this that I've found, so for anyone who wants to get started writing their own Live Writer Plugins, here is a list of recommended reading.

These are all great resources, but the one thing that each one of them fails to mention is that if you are developing on vista with UAC enabled (as you should be), or if you're developing on Windows XP as a least privileged user you need to change the permissions on the C:\Program Files\Windows Live\Writer\Plugins folder to allow the user you are running visual studio under to write and modify dll's in that directory.

permissions

Saturday, July 26, 2008

Pocket PC development connectivity issues

I have been returning to my roots and doing some Pocket PC development recently. I haven't really done that much since Visual Studio 2003, and to be honest, apart from SQL CE 3.5 which is a modest improvement on SQL CE back then, I feel like everything is pretty much the same. Emulators are slow, debugging is tedious, and device connectivity is sporadic at best. I was happily developing away when for no apparent reason I got the following error when trying to connect to my device which was happily Active Syncing,

Connection failed. A socket operation was attempted to an unreachable network.

I tried everything, disconnect, re-connect the device, shut down, restart Visual Studio 2008, even rebooting my laptop, I was still getting this error. Google was no help either, it appears to be a fairly generic, but seldom encountered winsock error not specifically related to Pocket PC development. What eventually solved my problem was performing a soft reset on the device.

Wednesday, July 23, 2008

Stopping applications that run automatically on startup

I thought I'd put this information here mainly for my own purposes, because every time I decide to clean up the various applications that run up automatically when I can never remember the windows system tool to use to view these, so I end up doing a google search and have to wade through all the commercial products that do the same thing to find the name of it.

It is mscofig.exe, and is located in the %SystemRoot%\system32\ folder. On Vista you can just click on Start then type msconfig and hit enter. It is also accessible through the Administrative Tools folder in Control panel.

msconfig

Once this has opened you can go to the startup tab and deselect any annoying programs that appear in the system tray that you really don't use, and don't provide an option for you to stop this behaviour.

Technorati tags: , , ,