Hire me at Go Tripod.

A longwinded title, but this is mostly as a note for me. Assuming your Mac’s IP address is 192.168.1.101:

  1. You need matching users with matching passwords on both Windows and OSX. So, your main user on OSX is u:colin/p:password. You need a user on Windows u:colin/p:password. Casing is important!
  2. Enable SMB on OSX from File Sharing
  3. Share the OSX folder you want to serve up (let’s say it’s named “mysite”)
  4. Create a new site in IIS with the physical path as \\192.168.0.101\mysite

The first point is key, as is using the UNC path in the last point, rather than a mapped drive. I used this Stack Overflow question to get this up and running.

Update: I just tried to run some unit tests via the Resharper test runner and received a security exception. The following fixed the issue:

caspol -m -ag 1 -url “file://\\192.168.0.101\mysite\*” FullTrust -exclusive on

This post from backroom security tech and also this from .NET security blog helped here.

Update 2: In a new VMWare VM, I came across two additional problems. Using ” around the URL caused caspol to throw an error, and having spaces in the URL doesn’t work – replace them with %20.

Update 3: In some cases, such as writing across the UNC share to the virtual directory your site is running in, you may need to set up Impersonation in the web.config with your matching user. You may additionally need to set the AppPool identity to that shared user. Note that I now have this system working in VMWare Fusion.

Ext JS 3.0 Final Released!

August 10th 2009, 9:19 pm in Ext, Uncategorized.

I’m really excited that the final release of Ext JS 3/ is here, along with a preview of the Ext JS Designer application. This is built on top of Adobe AIR and allows developers to piece together their Ext JS app with a rich UI, tweaking configuration options and embedding components as required.

To my knowledge, there is no other JavaScript framework approaching the richness of Ext JS, and this designer takes it to the next level. I’m extremely excited about what the brilliant Ext JS team has in store for the future.

Resizing a VirtualBox VDI Hard Disk

August 1st 2009, 4:50 pm in Uncategorized.

Start off by creating a fresh new drive of the size you’re after using the VirtualBox user interface. Then, locate both the your old, smaller HD and the new, larger one and run the following command:

VBoxManage clonehd --existing oldhd.vdi newhd.vdi

After some progress indicators ahve come and gone your HD should have been cloned to the larger one. You now need to use some software to expand your drive partition into the new space. Vista and W7 have this feature built in to Disk Management, or you could use something like GParted.

Gateshead Council Website Fail #2After yesterday’s post I didn’t really imagine that it’d attract the attention of anyone in the right departments – I guess I just assumed the problem would get fixed due to someone high up noticing it. What I didn’t imagine is that the problem would get replaced by another totally different issue:

Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Cannot create an object of type 'System.Web.UI.WebControls.Unit' from its string representation 'r_height' for the 'Height' property.

Source Error:

Line 1559: <div class="sys_news">
Line 1560: <div class="sys_standardrepeater">
Line 1561: <asp:literal visible="false" id="D2_Count" runat="server" text="0" /> <contensis_controls:dataviewdatalist id="D2" runat="server" repeatlayout="Flow" cssclass="sys_standardRepeater" height="r_height" repeatdirection="Vertical" repeatcolumns="1" shuffledataset="False" displaytype="SpanLayout" onupdatecommand="dlUpdateCommand" oncancelcommand="dlCancelCommand" oneditcommand="dlEditCommand" ondeletecommand="dlDeleteCommand" onitemcommand="Link_Data_Click" datakeyfield="PageID"><itemtemplate><% D2_Count.Text=cstr(clng(D2_Count.Text)+1) %>
Line 1562: <h2 class="sys_repeaterItemInner">
Line 1563: <%# CustomProcessing_D2(DataBinder.Eval(Container.DataItem,"newsHeading"),"newsHeading") %>

What sort of process is in place to allow a developer to replace a known failing page with another failing page? Surely, knowing that the first version was failing you’d be double-eager to check the latest upload is working? Baffling.

Council Website Fail

July 23rd 2009, 4:45 pm in .NET, Personal.

My local council, Gateshead in the UK, recently had a notice on their website declaring that it would not be updated for two weeks as they were performing essential maintenance. This was WTF number one – I have no idea what happened behind the scenes to make them buy this nonsense but it smacked to me of technical incompetence. What do I know though – like I say, there could have been valid reasons for this decision and it’s really not that big a deal.

So today I went back on their website and it seemed to be up and running with some new updates. I hit the News section to see this message:

Server Error in '/' Application.

Compiler Error Message: BC30569: 'New' cannot be used on a class that is declared 'MustInherit'.

Source Error:

Line 341: DataviewObject(component).GetData
Line 342:
Line 343: Dim RSSWriter As New CMS_API.WebUI.WebControls.BaseRSSFeedWriter
Line 344:
Line 345: Me.Controls.Add(RSSWriter)

Source File: E:\websites\www.gateshead.gov.uk\Council and Democracy\news\home.aspx Line: 343

Ouch. This brought down the page with a bang, no decent error handling. What’s the problem? It looks like someone’s been trying to set up the RSS feed for that page but has used an abstract class instead of the concrete one. Fair enough, that’s a simple mistake but surely WTF number two is that this could be pushed to a production server?

A good provider would have a local test, a staging server, and then production, at the very least. It looks to me like this change has been pushed directly to the site without any kind of quality control.

A possible WTF number three arises when you think again about the error message in general, which should only be shown when debug information is available. This could mean that debug settings are enabled on the web server, which is a definite WTF. Showing any kind of information like this – such as drive names and file paths – probably isn’t a very good idea.

I wouldn’t really care if this was just some corporate website but I know that my tax has gone into the development of this system and it’s painfully clear that the developers are not up to the job. Are open bidding systems in place for this kind of contract? I don’t know, but I bet that even if they are they don’t go on merit. Gateshead Council: shame on you. Can I get a refund? I can certainly recommend so decent software companies with local ties:

http://www.plastiscenic.co.uk/
http://www.gotripod.com/

The book which Cutter, Shea and I wrote is up on the publisher’s site for the Author of the Year award. Obviously in our case it’d be co-author of the year but it’d be really nice to be in with a chance. Packt have a microsite for the award and the actual poll is here. It’s up against some other great books so if you could spare a minute to vote it would certainly be appreciated!

Ext JS 3.0 RC1 Is Coming

April 15th 2009, 3:22 pm in Ext, Javascript.

The Ext JS 3.0 examples are online already, and I believe Jack made the announcement at the Ext Convention today. Take a look at this sample showing how to create a Microsoft Word-style ribbon UI with Ext JS 3.0. I really like the new button features and the GroupTabs. I’d expect some more examples on how to use some of the new features like the charting and Ext.direct and I’ll try and cover those when they appear.

Update: Cutter points out that there’s a new Image Organizer which shows off the Direct functionality but I can only see that in the download at the moment. The examples on the download also cover charting too.

Fizzler Used to Style WPF

March 11th 2009, 7:33 pm in .NET, CSS, Fizzler, Projects, WPF.

After I wrote Fizzler in a burst of development enthusiasm a few months back, it’s been sat on Google Code – a solution in need of a problem to solve. That is until Colin Eberhardt emailed me to report a bug in the selector engine, and to talk a bit about the way he was using Fizzler when working with WPF. This was totally outside the domain I’d anticipated Fizzler being use in, and Colin E has now revealed his project in full. By wrapping part of Fizzler in a few interfaces, thus abstracting it away from HTML and towards a more general purpose solution, he was able to use it to query a XAML UI definition and apply style declarations. CSS selectors for WPF!

This is an amazing use case for a library which I hope will start to see more use in the future. Thanks to Colin E for letting me know about the work which Scottlogic are doing with Fizzler.

Balsamiq Mockups

February 21st 2009, 11:09 pm in Design, Specifications.

I love the idea of Balsamiq Mockups; it’s one of those idea which makes you wonder why it took someone so long to come up with it. Knock together a few UI mockups from common UI elements and you’ve got a great way to preview sites and programs to your client.

In fact I’ve seen people use the Visual Studio win/web forms drag and drop for this sort of thing but it’s pretty limited in terms of the UI elements you can use and the amount of information you can present without doing some coding work. When Balsamiq Mockups lets you put a data table on the page, for example, you can do headers, links and data with a simple comma separated list. It lets you display a placeholder for a mapping interface with absolutely no code.

So the idea and the basic implementation are both great, but I’m not sold on the larger picture. If you’re trying to explore a UI then you’re going to need more than one screen. It looks like Balsamiq Mockups supports this on the desktop version by letting you save mockups and load them later, but I’d really like to see a way of having multiple mockups together in one canvas. I think there’s a case for saying that this increases the complexity of BM in that many would like to see a way of showing how each mockup links to the next. I’m not too bothered about that, I’d just like to see multiple “pages”, each presenting a different mockup.

The other thing that baffles me is the ability to get an online preview of BM but not being able to use the software online once you’ve bought it. I’d really love to see an edition where I can use the software online, save my mockups in my online account, and be able to access them from anywhere. I’m writing this from my netbook and it’d be great to look at the mockups I’d created on my desktop without having to pass the files over.

I don’t want these points to distract from Balsamiq Mockups though, because it’s great, a revelation in fact. The way it allows us to piece together UI ideas without resorting to pen and paper or a paint package is a dream come true and gives us another method of rapidly prototyping for our end users.

Easing NHibernate Development

January 27th 2009, 1:27 am in .NET, C#, NHibernate.

NHibernate is now my framework of choice for working with a relational database. With a little bit of knowledge and a willingness to research, it’s pretty straightforward to make NH jump through whichever hoops you need it to. That said, there are certainly a number of friction points which can slow down any development effort. Mostly, these can be solved with a couple of tricks and tools which can be applied at various stages of a project.

Fluent NHibernate is a method of cutting down on XML mappings which are commonly associated with NH. While in the past, tools such as ActiveWriter have enabled developers to bypass the most laborious parts of creating mappings, Fluent NH takes it a step further and provides a strongly typed means of setting up your entity mappings without even touching XML. You can either use the auto mapping facility or fully customise the mappings, but it’s all done with full intellisense support and a serious lack of angle brackets.

Once the mappings have been defined – either in XML or in code – you need to start working with the database itself. NHibernate has a built-in facility which can help you out here, by generating the database schema based on your entity mappings. In fact, in the latest releases, you can even update the existing schema without having to delete and recreate, which makes it possible to preserve your test data during development. This allows you to go end-to-end from the mappings direct to the database and keep in that context throughout the development process.

Here’s a quick aside: some of the criticisms put against ORMs are that a developer with great SQL knowledge can tweak and craft code better than any autogenerating tool. From my point of view, every query would have to be written to a high standard, all column choices would have to be perfect every time. NHibernate’s generated code has been reviewed by experts and it will be produced in the same way time after time, to the same level of quality.

With that in mind, I don’t really have a problem letting NH control every part of my database interactions. What I do need is a way of ensuring that if the mappings i’ve created are wrong, or are sub-optimal, that I have a method of finding out what’s going on. NH Profiler is a piece of software which has recently started a beta phase and hooks in to NH itself to provide real-time analysis of what queries and sessions are being used by your application. As well as reporting, it also provides suggestions if it detects sub-optimal behaviour. Lazy loading, for example, can cause some nasty performance problems if used incorrectly, so NH Prof can pick up situations in which it would be better to change mappings to specify eager loading.

Over the last six months, new features and community involvement have transformed NH from a great development framework to the premier ORM for rapid development teams. The bumps have been smoothed, and we can get on with leveraging the wonderful work of the NH team.

Next Entries »