Sunday, 28 September 2008

CSS, still not great

After being in the too-comfortable position of being able to develop and demo the Intelligent Book on a Mac, I finally had to bite the bullet and sort out the layout for various different browsers. Sadly, it seems that cross-browser CSS is still just as much of a pain as it ever was.

Some of the wrinkles (as "notes to self"):

Firefox 2 does not understand inline-block. IE7 does, but only for inline elements (not 'div's and 'li's). One solution to this is to make almost everything a span, and then:
display: table-cell;
display: inline-block;
Firefox 2 will default to table-cell (skipping the following inline-block). Most other browsers will use inline-block.

IE8, even though it has better support, gets things wrong with resized images in inline-blocks. Specifically, if you resize the image by setting just the height, although it readjusts the width of the image as it displays, it still uses the old image width when calculating the size of the block (meaning lots of excess whitespace).

Chrome (so perhaps also Safari) has an odd effect when you try to work around browser differences by lining inline-blocks up as
diplay: table-cell
A paragraph placed in the code above nested table content within the table-cell will often appear underneath the table-cell instead of above it. This can be fixed by setting the paragraph as
display: table-caption

Thursday, 18 September 2008

Redirecting

I don't use Google's Chrome browser very often, but today I did and I noticed that in the home page (that shows little square snapshots of your most visited sites), the square snapshot of the GMail login page is shown with the title "Redirecting" rather than Gmail. Just thought it was curious that happened for one of Google's own products.

Monday, 1 September 2008

Google Chrome

So apparently Google is working on it's own browser, and they have produced probably the least funny comic in history to let the world know. Apart from the technical reasons for the browser, that are trumpeted in the cartoon, I imagine the business types at Google are also interested in solving the little issue that while most of the world use Google's search platform, they mostly do it using their arch-competitor's browser (Internet Explorer). Despite extensive funding from Google, Mozilla have never had the brand presence to undo Microsoft's browser-dominance as much as Google would, no doubt, like.

Google's project is planned to be open source, make all the technical bloggers very happy people. But it's worth remembering that "open source" does not mean "democratic". We can reasonably expect Google's browser to be designed carefully around Google's services. This is a branded browser that it likely to be promoting GMail over, say, Hotmail or Yahoo, and GTalk over Skype, AIM, or Facebook's instant messaging.

But then, the chances are that even Google's brand presence will not push out IE in the near term -- how do you market a "better browser" to an end-user who doesn't know any of the technical reasons? Especially when you can't afford to stop giving the browser they're already using great support? However, a Google Browser probably could out-compete Mozilla's Firefox. (And for how long will Google continue to fund Mozilla? They are by far the biggest financial contributor at the moment.) That in turn could help Google dominate some of the competition in Web-based applications -- the losers from this might well be AOL, Skype, and Adobe.

And then there's the small matter of upcoming competition -- competing for the next generation of apps. Adobe AIR threatens to take Web applications out of the browser, and provides a rich application environment without some of the hassles of HTML. That could become a compelling story, and Adobe have a history of getting their product out to a large userbase (Flash has around a 90% install-base). And they have an online-documents suite that is a minor competitor to Google Docs, but that could easily become more compelling. So, it is very much in Google's interests to improve the HTML+Javascript experience of the browser, since that is where all of their business is based.

Wednesday, 20 August 2008

Width and readability

I've just switched the "theme" of this blog to a fixed width theme. As screens get wider, it can be awkward if lines of text are too long because it's too easy to lose your place when your eyes flick back to find the start of the next line.

Related odd thought: I remember reading (I forget where -- I think somewhere in the documentation for the LaTeX publishing system) that the Times font was designed specifically for narrow columns of text, as you get in the Times newspaper, and there was a warning that it could look awkward for documents with much wider single-column formats. However, it's been the default in Word for a decade (though they changed it in Word 2007), and probably most of the documents any of us have printed have used it, without it seeming awkward. Anything else looks unusual. So does that mean that the warning was wrong, or just that we've got so used to it we don't notice any more?

Saturday, 16 August 2008

"Prove it's unsafe"

UK Environment minister Phil Woolas has supposedly claimed it's now up to the opponents of GM to prove that it is unsafe. This seems like fairly disingenious phrasing -- either it has been proven safe or it hasn't. If it has, then surely that's what he should focus on. If it hasn't, then effectively saying "well, we're stumped; let's put the burden on proving there's going to be a problem" doesn't sound like a sensible approach. It was very difficult to definitively prove there would be a problem with feeding processed cow-remains to living cows (we can kill all the bacteria and viruses), until the BSE crisis hit (oops, we forgot about prions).

Wednesday, 25 June 2008

LaTeX, monospace, bold, computer modern, bera

This isn't exactly "general interest", but if any other person trying to format their thesis has hit the same issue, it's useful to have this up there for Google to pick it up:

I've just been reformatting my PhD thesis (approved and graduated last year) as a technical report for the Computer Laboratory.  It's formatted in LaTeX, which is the typesetting system lots of computer science graduate students still use rather than stretchy rubber. If you use the Times font package, you might find that its monospaced font (something a bit like Courier) is rather wide, and looks very odd if you put a keyword in monospace in the middle of some Times prose.  The Computer Modern monospace font is a much less clashing size, much narrower than the other monospaced fonts I could find, and so that's what I used in my PhD when I printed it for submission.  Only it doesn't have a bold.  There's a trick on the Internet to put a bold monospace (typewriter) Computer Modern font in – but it's only good for print documents because it ends up being a bitmap font (looks blurry in most PDF viewers when viewed at the wrong size on the screen).  So, no good for the PDF technical report.

After some hunting around – Latin Modern is very similar to Computer Modern and does have a bold typewriter font – but not a bold italic monospace font – so bold italic ends up looking odd compared to not-bold italic.

After more searching around, a solution.  The Bera (Bitstream Vera) package has a small note in its documentation, in a file called bera.txt, saying: 
\usepackage[scaled]{...}    selects a default scaling of 90%, which makes the Bera fonts approximately match the size of the Computer Modern fonts.

(Actually I find scaled=0.88 fits better with surrounding Times text)

In otherwords, if you do \usepackage[scaled]{beramono} you'll have a monospace font that doesn't jar quite so much with surrounding Times text, and does have bold and bold italics, etc.

Oh, theres also a note saying Bera only works with T1 encoding, so you need:
\usepackage[T1]{fontenc}
\usepackage{textcomp}
as well (I put it before the \usepackage[scaled=0.88]{beramono}.

Saturday, 14 June 2008

CUE Business Plan Grand Final

A few months ago, three of us (Ed Schofield, Wallis Motta, and myself) made a last minute decision to enter the Cambridge University Entrepreneurs (CUE) Business Plan Competition. It's a very successful competition, having spun out companies that are now worth more than £40-million, so we always knew it was going to be tough.  Our team was "The Idea Belt", a company to sell innovation management software to mid-sized companies.  It's a software category that is coming into vogue, there aren't many vendors (and they're mostly small), and we'd spotted a better way of doing it. 
Happily for us, we made it through to the Grand Final, which was last Wednesday night, appropriately enough just a few hours before Sir Alan Sugar picked his latest Apprentice on the telly.  We didn't win – we were beaten by some absolutely fantastic teams (if you have a few pounds spare, Microantenna looks like a fabulous investment!).  But I was very happy we made it into the final.