Category Archives: blogging

On the Register in November: Windows desktop development woes, inside Amazon Aurora, more

As I mentioned last month, I have been working part-time for the Register since the beginning of October. Here’s what I wrote last month:

Google Chrome on Windows ‘completely unusable’, gripe users

This one seemed to strike a chord: is Google neglecting its Windows users?

Pity the poor Windows developer- The tools for desktop development are in disarray

And this. The price of the Windows 8 adventure was lost momentum on the desktop side. If Universal Apps come good, it might yet have been worth it.

Inside Aurora- how disruptive is Amazon’s MySQL clone?

A more detailed look at what makes Amazon Aurora tick.

The cloud that goes puff- Seagate Central home NAS woes

Not just about the need for backup, but a note on how hard it is to read the drive outside its enclosure, even when it is not faulty.

Microsoft adds video offering to Office 365. Oh NOES, you’ll need Adobe Flash

That dreaded syncing feeling- Will Microsoft EVER fix OneDrive?

The weak spot in Microsoft’s cloud story.

Amazon, Docker hop in bed- What happens in Vegas WON’T stay in Vegas

Microsoft .NET released from its Windows chains… but what ABOUT MONO?

Interview with Miguel de Icaza on Microsoft’s big open source news. Check the forum at the .NET Foundation for more on this.

Boxing clever- Amazon Fire TV is SO CLOSE to being excellent

Review of Amazon’s video streamer and budget games box.

All but full-fat MS Office to be had on iPads, Droidenslabben for NOWT

Microsoft improves Azure SQL Server cloud service, simultaneously makes it worse

Improving JavaScript- Google throws AtScript into the mix

Running WordPress on Windows Azure

I am investigating hosting this site on Windows Azure, partly as a learning exercise, and possibly to enable easier scaling.

I discovered that any web site short of Standard is worthless other than for experimentation and prototyping. I set up a Small Standard Web Site (£48 per month). But what database? I recalled that you can run WordPress with SQL Server and tried using a 1GB SQL Server Web Edition hosted on Azure (£6.35 per month).

In order to use this, I used the Brandoo WordPress configuration which is set up for SQL Server. I later discovered that it uses the WP Db Abstraction plug-in which according to its home page has not been updated for two years. The installation worked, but some plug-ins reported database errors. I imported some posts and found that search was not working; all searches failed with nothing found.

My conclusion is that running WordPress with SQL Server is unwise unless you have no choice. I looked for another solution.

Azure has a Web Site template which uses WordPress and a MySQL database hosted by ClearDB. I would rather not involve another hosting company, so considered other options. One is to run a VM on Azure and to install MySQL on it. If you are doing that, you might as well put WordPress on the same VM at least until the traffic justifies scaling out. So I have created a new Medium Linux VM – two virtual cores, 3.5GB RAM – at £57 per month, with Ubuntu, and installed the LAMP stack and WordPress on that. The cost is similar to the Windows/SQL Server setup, but the VM is a higher specification, since a Small Web Site is 1 virtual core and 1.75GB RAM. You also get full access to the VM, as opposed to the limited access that a Web Site offers. The installation is a bit more effort but performance is better and it looks like this might work.

image

ITWriting app hits the Windows 8 store

Hands on where possible is part of my technical journalism philosophy, so I have been trying out Windows 8 development for some time. After playing around with and adapting Microsoft’s blog reader sample I decided to take it further and try submitting it to the Windows 8 Store.

Today it was certified so you can install it now. It is free of course. 

image

There is not much to it. It features quick access to recent posts on itwriting.com and gadgets.itwriting.com, recent tweets, and dedicated links to Windows 8 survival guides for both keyboard/mouse and touch/tablet users.

Despite its simplicity, creating the app was an interesting exercise. Having the app layout change in a moderately sensible way when switched between portrait and landscape, and filled or snapped, taught me a bit about XAML and the VisualStateManager element. I also struggled a bit with the flyouts that you use to implement app settings, the ones that appear when the user displays the Charms menu and taps or clicks Settings when your app has the focus. I used the official sample though I discovered that it will not compile as-is because the standard brush names have changed since the release preview for which the sample was apparently created. I have have some sort of z-order bug there which I have not yet solved.

Creating apps for Windows 8 is not difficult exactly, but it is fiddly. It seems to me harder than, for example, creating a desktop app using Windows Forms. In mitigation, setup and deployment is done for you which is a significant advantage. I was also pleased to discover that the app works fine on a Surface RT.

image

The Windows Store certification process was rather straightforward in my case; the app passed first time. I had noticed from other reports that having a privacy policy in place is important, so made sure that this is linked in this settings.

I do have some ideas for making the app a little more interesting. Share support and offline support would be obvious enhancements. Watch out for future updates!

Gadget Writing – iPhone docks, 5.1 headphones, mobile, gaming and more

I have started a new blog over at gadgets.itwriting.com which is for reporting on mobile, audio, gaming and other such enthusiasms. The main reason is to have somewhere to cover these subjects without diluting the focus of itwriting.com itself.

Currently on Gadget Writing:

AVI preparing a successor to the ADM 9.1 – the floorstanding ADM 40

Surround sound 5.1 headphones–why and why not. Roccat Kave reviewed

How to get better sound: higher resolution, or something else?

Review: Audyssey iPhone Audio Dock South of Market Edition

and a few more bits and pieces.

What you read in 2010: top posts on ITWriting.com

With three days to go, traffic on ITWriting.com in 2010 is more than 50% up over that of 2009 with over 1 million unique visitors for the first time. Thank you for your attention in another crazy year in technology.

So what did you read? It is intriguing to look at the stats for the whole year, which are different in character from stats for a week or month. The reason is that over a short period, it is the news of the day that is most read – posts like The Java Crisis and what it means for developers. Over the year though, it is the in-depth technical posts like How to backup Small Business Server 2008 on Hyper-V that draw more readers, along with those posts that are a hit with people searching Google for help with an immediate problem like Cannot open the Outlook window – what sort of error message is that?

The most-read post in 2010 though is in neither category. In July I made a quick post noting that the Amazon Kindle now comes with a web browser based on WebKit and a free worldwide internet connection. Mainly thanks to some helpful comments from users it has become a place where people come for information on that niche subject.

On the programming side, posts about Microsoft’s changing developer story are high on the list:

Lessons from Evernote’s flight from .NET

Microsoft wrestles with HTML5 vs Silverlight futures

Microsoft’s Silverlight dream is over

Another post which is there in the top twenty is this one about Adobe Flash and web services:

SOA, REST and Flash/Flex – why Flash does not PUT

along with this 2009 post on the pros and cons of parallel programming:

Parallel Programming: five reasons for caution. Reflections from Intel’s Parallel Studio briefing

This lightweight post also gets a lot of hits:

Apple iPad vs Windows Tablet vs Google Chrome OS

It is out of date now and I should do a more considered update. Still, it touches on a big theme: the success of the Apple iPad. When you take that alongside the interest in Android tablets, perhaps we can say that 2010 was the year of the tablet. I first thought the tablet concept might take off back in 2003/2004 when I got my first Acer tablet. I was wrong about the timing and wrong about the operating system; but the reasons why tablets are a good idea still apply.

Watching these trends is a lot of fun and I look forward to more surprises in 2011.

Speeding page load with dynamic JavaScript

I’m delighted that ITWriting.com is sufficiently popular to sustain some advertising. I’m not pleased though with the impact on performance. The problem is that ads such as those from Google Adsense or Blogads are delivered by remote scripts. It usually looks something like this in the HTML:

<script type="text/javascript"
  src="http://some/remote/script.js">
</script>

When the browser encounters this script, it stops and waits until the script returns. This means that your site’s performance depends on the performance of the site serving the script. At times I’ve noticed significant slowdown – though to be fair, Google is normally faster than most others in my experience.

So how can this be fixed? I’ve spent some time on the problem, but with limited success. Ideally I’d like an Ajax-y solution where the ads flow in after the rest of the page had loaded and rendered, because the content is more important than the ads. The first step though is to place the scripts at the end of the page, so that the rest of the content is downloaded first. However, the ads have to appear towards the top of the page, otherwise the advertisers will not be happy. I tried inserting the script dynamically like so:

var addiv = document.getElementById("addiv"); //where the ad is  to appear
var theScript = document.createElement("script");
theScript.type="text/javascript";
theScript.src = "http://some/remote/script.js"; 
addiv.appendChild(theScript);

While this works after a fashion, it does not do the job. The problem is that the script typically calls document.write. If you are lucky, the ad will appear at the bottom of the page. If you are unlucky, the ad will replace the entire page.

What I needed to do is to capture the output sent to document.write and then insert the HTML dynamically. It turns out that JavaScript makes this easy. We can simply override document.write with our own function. Like so:

var addiv = document.getElementById("addiv"); //where the ad is  to appear
var adHtml = ”;
var oldWrite = document.write;
document.write = function(str)
{
    adHtml += str;
}
<script type="text/javascript"
  src="http://some/remote/script.js">
</script>
document.write = oldWrite;
addiv.innerHTML = adHtml;

This is brilliant, and in fact works perfectly for some of my ad scripts. Unfortunately it does not work for the slowest performer. The problem is that I have no control over the content of the remote script. In the non-working case, the remote script does not return HTML. It returns another script, which references another remote script. Now I have to figure out how to handle all the possible cases where scripts return scripts, which might or might not call document.write.

I’d be interested if anyone has a generic solution. There is a library here that looks like it might be helpful.

Another reflection is that it is in the interests both of advertisers and publishers to have scripts that execute fast and/or behave in a predictable manner that is friendly towards deferred loading techniques. It is no use writing convoluted code to deal with a particular script, when it might change at any time and break the site.

A note to RSS subscribers

This blog has a full-text RSS feed. In other words, you can read the entire contents of a post without visiting the site – though I hope you will visit the site from time to time to read the comments, like the excellent discussion on web vs desktop applications here.

The reason for this note is that the feed broke for some subscribers recently; and the reason it broke was that I’d hacked the code to ensure that you get full text feeds and not excerpts with a “read more” link. I had hacked the code not because WordPress was broken exactly, but because of a legacy problem. The feed for this blog used to be http://www.itwriting.com/blog/rss.php. WordPress still supports this URL, but without my hack it delivers excerpts, even though WordPress is set for full text. The hack works; but it is perilous because I use Subversion to keep WordPress up-to-date. If I modify the WordPress source, and then the same file gets updated in the official source, then Subversion inserts some stuff in the file to assist in resolving the conflict. That’s fine, except that it may break the PHP until I get round to fixing it. There’s also a risk that the modified file will no longer work because of changes elsewhere.

The sane solution then is not to modify the WordPress source, but to ask you to use the modern, approved and up-to-date RSS feed URLs which are:

http://www.itwriting.com/blog/feed for RSS

and

http://www.itwriting.com/blog/feed/atom

for Atom.

If you use Google Reader, for example, I suggest you remove the existing subscription and add a new one with one of the above URLs.

That said, the old URL now works again, but with excerpts and not full text. The reason is not that I want you to visit the site, add to my page views and enjoy the unobtrusive advertising (though I do); it’s because of the technical issue above. Now you know how to fix it.

Fixing a WordPress plugin setting

I changed the theme and plugins used on this blog recently. Along the way I managed to slightly corrupt the settings for one of the plugins, GD Star Rating, the result being that the stars in the Top Rated Posts widget would not display. I figured out the problem: the plugin stores the path to the graphics which represent the stars, and this had incorrectly been set to an https path. Since I use a self-generated SSL certificate, the result was that browsers did not trust the connection and refused to display the graphics.

Unfortunately this path is not configured directly in the plugin options, as far I can see. I temporarily changed it to display a text rating while I worked out how to fix it.

The setting had to be in the MySQL database somewhere; and I found it. It is one value in a massive 10,000 character field called  option_value, in the main options table. It seems that most of the settings for the plugin live in this single colon-separated field, even though the plugin also creates 12 tables of its own for the ratings data. Hmm, I don’t like the way this implemented. How often does this field get queried and parsed?

Still, the immediate problem was to alter the value. I ran up the MySQL interactive SQL utility and typed very carefully. This is where one false move can obliterate your WordPress install; I’m reminded of someone I knew (not me, honest) who set all his company’s customers to have the same address with a careless update missing its WHERE clause. Fortunately this is only a blog. Transactions are also good. Anyway, what could go wrong? it was a simple combination of UPDATE, REPLACE and WHERE.

It worked, the stars have returned, and I know a little bit more about the innards of WordPress and this particular plugin.

Seven years of blogging, and a redesign

This blog began in 2003, though the website goes back to 2000, and I now see little difference between what is now a blog, and what in 2000 was a more painful process of authoring web content, especially with the decline of RSS readers. Still, my first blogging efforts were powered by a now-defunct project called bblog. I modified this heavily to add features and cope with comment spam – almost non-existent in 2003 – and then in 2006 accepted that I would be better off with a mainstream blog engine and selected WordPress, which has exceeded my expectations.

When I moved to WordPress I picked a theme which met my requirements, then modified it to tidy up the layout and to support non-intrusive advertising. I found myself to some extent boxed in once again, since I could not change or upgrade the theme without losing my modifications. This also meant I was missing out on newer features of WordPress. Widget support is a breakthrough feature, letting you add features to the site through a simple drag-and-drop admin page, but I could not use them. I also wanted to support gravatars, which show an image chosen by the author alongside their comments, and to add a ratings system.

Ratings are a lot of fun, though not really reliable as a gauge of quality. If your article extolling the merits of the Xbox 360 gets linked by a PlayStation fan site, or your article critical of Apple gets linked by an Apple fan site, there is little chance of a fair rating. Some readers also find it difficult to separate what they think about the subject matter from what they think about the quality of reporting. Even so, ratings are always interesting and I’d like to include a list of best-rated posts.

It has taken me some time to find a theme that looked right for my needs, but I have now settled on Atahualpa from BytesForAll. It is a popular theme, so my blog will look similar to many others, but it is flexible and I’ve been able to add the most important features by modifying settings rather than editing the raw PHP, a critical issue for upgradability. I’ve also added rating support with GD Star Rating.

As ever, it is work in progress, and I expect to modify the design and add features as time allows. Although it may not look much improved yet, it is much easier to modify in a maintainable fashion, so expect more changes soon.

A year of blogging: another crazy year in tech

At this time of year I allow myself a little introspection. Why do I write this blog? In part because I enjoy it; in part because it lets me write what I want to write, rather than what someone will commission; in part because I need to be visible on the Internet as an individual, not just as an author writing for various publications; in part because I highly value the feedback I get here.

Running a blog has its frustrations. Adding content here has to take a back seat to paying work at times. I also realise that the site is desperately in need of redesign; I’ve played around with some tweaks in an offline version but I’m cautious about making changes because the current format just about works and I don’t want to make it worse. I am a writer and developer, but not a designer.

One company actually offered to redesign the blog for me, but I held back for fear that a sense of obligation would prevent me from writing objectively. That said, I have considered doing something like Adobe’s Serge Jespers and offering a prize for a redesign; if you would like to supply such a prize, in return for a little publicity, let me know. One of my goals is to make use of WordPress widgets to add more interactivity and a degree of future-proofing. I hope 2010 will be the year of a new-look ITWriitng.com.

So what are you reading? Looking at the stats for the year proves something I was already aware of: that the most-read posts are not news stories but how-to articles that solve common problems. The readers are not subscribers, but individuals searching for a solution to their problem. For the record, the top five in order:

Annoying Word 2007 problem- can’t select text – when Office breaks

Cannot open the Outlook window – what sort of error message is that? – when Office breaks again

Visual Studio 6 on Vista – VB 6 just won’t die

Why Outlook 2007 is slow- Microsoft’s official answer – when Office frustrates

Outlook 2007 is slow, RSS broken – when Office still frustrates

The most popular news posts on ITWriting.com:

London Stock Exchange migrating from .NET to Oracle/UNIX platform -  case study becomes PR disaster

Parallel Programming: five reasons for caution. Reflections from Intel’s Parallel Studio briefing – a contrarian view

Apple Snow Leopard and Exchange- the real story – hyped new feature disappoints

Software development trends in emerging markets – are they what you expect?

QCon London 2009 – the best developer conference in the UK

and a few others that I’d like to highlight:

The end of Sun’s bold open source experiment – Sun is taken over by Oracle, though the deal has been subject to long delays thanks to EU scrutiny

Is Silverlight the problem with ITV Player- Microsoft, you have a problem – prophetic insofar as ITV later switched to Adobe Flash; it’s not as good as BBC iPlayer but it is better than before

Google Chrome OS – astonishing – a real first reaction written during the press briefing; my views have not changed much though many commentators don’t get its significance for some reason

Farewell to Personal Computer World- 30 years of personal computing – worth reading the comments if you have any affection for this gone-but-not-forgotten publication

Is high-resolution audio (like SACD) audibly better than than CD – still a question that fascinates me

When the unthinkable happens: Microsoft/Danger loses customer data – as a company Microsoft is not entirely dysfunctional but for some parts there is no better word

Adobe’s chameleon Flash shows its enterprise colours – some interesting comments on this Flash for the Enterprise story

Silverlight 4 ticks all the boxes, questions remain – in 2010 we should get some idea of Silverlight’s significance, now that Microsoft has fixed the most pressing technical issues

and finally HAPPY NEW YEAR