Send to -> Compressed Folder

In Vista, if you right click on some files in Windows Explorer, you can select Send to -> Compressed Folder to create a ZIP file.

I use this feature a lot. It’s great to be able to quickly zip up a project and put it on a USB key or e-mail it to myself so I can work on it elsewhere. But today I ran into problem.

There was an empty directory in the project, and I got a warning that says that, because the directory is empty, it cannot be added to the archive.

That’s fine, but what it does not say is that IT STOPS right there — nothing else is added to the resulting ZIP file! So I got home and found that I had less than half of my project.

I don’t know why empty directories aren’t allowed in ZIP files — that seems lame, but not including the rest of the the files (and not reporting that the operation is stopping) is a bug.

Gallery in progress

I’ve made a lot of progress on my image gallery. It’s in ASP.NET, and initially my idea was not to use a database at all. Instead I’d just store image names, locations, tags, and descriptions in an XML file.

I got all that working, and all the lookups using XPath, but then I started wondering if this is a wise strategy. I like the idea that I can back everything up with a single file, and that I don’t have to mess with connection strings and all that jazz, but on the other hand, I’m sure to have threading issues, and the XML file could grow to be quite large.

Furthermore, I’ve been told both that XPath is slow and that XPath is fast, so I’m not sure if performance will be an issue either.

So last night I confirmed that I can access a MySQL database from ASP.NET, and now I’m thinking that is the safer way forward…

At any rate, I’ve learned a great deal about XPath and ASP.NET along the way, and may post some examples soon. With XPath in particular, it seems like the examples that are on the web now go from dead simple to esoterically complicated, with not much between.

“Visual Studio Team Suite 2008 Development Edition”

Whoever names the products at Microsoft should have been replaced a long time ago. If this were Apple or Macromedia, this would be called “Wildcat” or something. It would sound better, be more memorable, and be one third as long.

Over the weekend I installed Visual Web Developer 2007 Express Edition (again, surely a cooler name could be given to a snappy, slick and FREE version of VS), and was really impressed.

There is, of course a massive difference between the two (including the price), but Express is just cooler. It’s faster, for one thing, and the graphics and color scheme are nicer. And (and this is what prompted this post), it was features like intellisense turned on by default.

Yes, that’s right. The big daddy version doesn’t offer any suggestions when you type: variable name dot. You have to go to Tools | Options | Text Editor | All Languages, and select “Auto list members” and “Parameter information” before you get that feature.

For a while I just blankly tried over and over, typing in something and pressing “.” and I thought there is NO way I’m doing .NET programming without this feature. If someone — for some strange reason — doesn’t like it, they can turn it off, but SURELY that person would be in the minority.

That was the first thing I noticed. The second was that it was noticeably slower than Express, but I guess that’s not surprising. The third is that it seemed a little flaky. I loaded up a project that I’d started in the Express edition, and it complained about being unable to find an ASP.NET master page, but only for default.aspx. All the other pages that used it worked fine. Default.aspx found its master page at runtime, so it wasn’t a typo or something.

I created a new page and then copied the content of default.aspx into it, then deleted default.aspx and renamed the new page to replace the default page, and the warning went away. Not the best first impression.

Technology roundup

Incredible as it seems, I’ve been at my new job for seven weeks. In that time I’ve worked on four different projects, and gotten my Sitecore level one developer certification. I’ve learned a LOT, but not any one thing very deeply. It’s been very much a survey of web technologies.

Codehouse specializes in Sitecore, a Content Management System (CMS) that is very impressive. The entire authoring and development experience is browser-based. That’s not revolutionary, but in this case the UI looks like Windows. It has a start button, start menu with applications, a control panel, etc. It feels a bit like you’re in a virtual PC image, but you’re just in a browser.

On the one hand it’s profound — one can really see that the browser is becoming the platform. One can imagine that computers will become little more than dumb terminals that run either IE, Safari, or Firefox, and all applications will be written in Javascript and Flash. (Except games, of course, but they’re all headed over to XBox and Wii anyway.)

(more…)

Google Analytics

I just discovered Google Analytics, a free tool that let’s you track and analyze web site traffic.

Traffic sources Visitor browser types

It has all kinds of reports with charts and graphs. It’ll tell you what brower the visiter was using, the operating system, the screen resolution. It tells you how the user found the site and what search words they used — if they used a search site.

Proof of having laughably few visitors Visitor operating systems

There are a few things that are lacking — which I’ll mention but only after repeating that this is a free service. First, there’s no API. It would be great if you could query the data directly, but on the other hand Google makes much of the data available in XML format, so it’s not as though the capability isn’t there. The second is that the data is only updated every twenty-four hours. This is fine actually, but waiting for a new batch can be pretty tough — especially at first. This the first time that I’ve really wished that my site got more traffic. It’s a bit disappointing to wait a day and then discover that you’ve got only two visitors in that time.

My massive US fan base Clearly, half the population of Denmark visits my blog

It’s really slick. But by far the most fun part is the maps. It’s really cool to know where requests come from geographically. And, if there is an advantage to having a rarely visited site, it’s that I know where most of these requests are coming from. The data shows that it’s mostly friends and family — mostly “direct” traffic, as Google puts it. Then there’s a few visitors that find the site through Google or Yahoo. They’re usually using searchwords specific to Denmark like dansk folkparti or grundtvig. There was also a user searching for pacifier trees, which I’m almost certain is the mother of a friend of mine who recently asked me if her mother could use my pictures.

According to Wikipedia, when Google Analytics was rolled out, demand was too high, and Google had to suspend registrations. Later they went to a “lottery” system, but today apparently it’s openly available. I certainly had no trouble signing up.

Setting up Google Analytics to track a Wordpress blog couldn’t be easier, thanks to this plug-in. You just sign up with Google Analytics, install the plug-in, and enter the script Google provides into the plug-in. If you want to track a traditional static HTML site, then you have to add the script to every page.

Definite job change

I’ve resigned from Microsoft. My last day is September 28th. Assuming the work permit gets approved, I’ll start at Codehouse on October 1st.

If getting a new work permit turns out to be as easy as it appears to be, I will definitely consider myself to be more flexibly employed, and not be willing to suffer for long periods of time in a bad situation.

It’s not that I’ve been tortured or anything. Much of my time as MS was fine. But you get in with a company like Microsoft, and there’s a sense security that sets in — you know logically that you could work elsewhere, but you start to doubt that intuitively.

But then you add the foreigner factor: Now you’re working in a foreign country, but the company has paid for your move, and gotten you a work permit, and provides and English-speaking workplace… Now that sense of being unable to leave is much stronger.

But, I stayed the year that I had to in order to not owe for the move. And I’m applying for my own work permit, without the help of corporate lawyers (who in retrospect seem like overkill.) And it’s a Danish company, but they can all speak English, and I’m learning Danish, so there’s really no big problem.

Possible job change

I interviewed for a new job today, with a small company called Codehouse. They use a product called Sitecore extensively, which is a Content Management System (CMS) and is entirely based on .NET. That means Visual Studio, C#, XML, WPF, and all that stuff.

It seemed like a really cool place to work. There are only nine employees plus five in their London office. They work in small teams on projects that typically take one or two months to complete. They are also right in the middle of Copenhagen — five minutes from my apartment by bike.

It’s a 100% programming position, and it’s been a long while since I’ve had a job like that. I’m excited about it. It would be nice to concentrate one technology and get create some tangible and functional solutions. I’ve been with Microsoft for over five years now, all of which has been in technical writing positions for developer products. It sounds good in theory. Write some cool samples, and then document how they work. But in practice it’s mostly busy-work that customers never see, and often don’t benefit from.

Right now they’re looking into getting my work-permit situation worked out. So we’ll see…

Vista impressions

Overall, I like it. It’s nowhere near the revolutionary leap that Microsoft promised when it was originally annonced, as many features have been cut, but it is a move in the right direction.

Much to my surprise, Outlook Express has been overhauled and it quite nice. The IMAP support is much better than before, and is quite possibly better than in Outlook. I find, however, that the more I use it, the more it slows down and occasionally crashes. Granted, I’ve got a massive IMAP account (almost 1gb), but it seems to do this even when it’s not working with a really big folder.

The 3D interface is slick-looking, but once you use it for a while, you don’t think about it. It pretty much feels like a slick version of Windows XP.

(more…)

Office 2007 trivia

Did you know that the new file formats in Office 2007 like “.docx” and “.xlsx” are simply ZIP files? If you rename one of these files to “.zip”, you can open it up and see that these documents are represented with XML.

My Picasa -> WordPress tool

Picasa is a great little program. It has some faults, but it’s free, so complaining would be silly. One nice feature is that you can generate HTML photo galleries. Then you just upload the output, and your photos are on-line. That’s fine, but I wanted to have these galleries inside my blog, and use a nice viewer like Lightbox instead of the boring HTML that Picasa produces. Here’s an example of the Picasa HTML.

gallery-in-a-blog

So I wrote a C# tool that takes the Picasa HTML and converts it to HTML that you can drop into a WordPress entry. Here’s the same gallery as above, but in a WordPress entry. The tool even grabs the captions from Picasa and uses them as the “alt” and “title” tags in the resulting HTML, so Lightbox displays the caption under the image.

Right now the tool is a bit inflexible, and it’s a command-line tool, but with a bit more time I hope to add a user interface and support different configurations. In the meanwhile, don’t hesitate to ask if you’re interested.