Skip to content

"Free" Fi

The last time I was here in the States, two years ago, I found free wireless networking everywhere – all the hotels and coffee shops had it, or maybe just all the ones that I went near to, which may be some sort of demographic indicator. This time, the hotel access is both flakey (poor signal strength or down) and chargeable. Only the cafe I’m at right now (Stell’s, Redlands environs) has free access, and it has the faux hippy ethos to go right along with that. Back in Vegas, one cafe and a hairdresser both had it – there’s some logic there, I think.

We’ve had some problems sending email via our home mail server, for a stupid reason (the local ISPs here put all of their IP adresses on the anti-spam filters on spamhaus, which we use to reject connections). I know that I can tidy that up by messing with our security settings for mail server access, but this is a new mail client/machine, and I may need server access to sort it out properly.

So free fi seems to have been lost in the wash; it was great while it lasted, and may it come back soon.

Tagged

Vegas

I’ve just returned from my first visit to Las Vegas, and I think I have finally got a handle on the place; I have watched too many films, TV shows, and listened to too many Americans recount the lore and mystique of the place. First thing: I enjoyed myself.

The reason for my trip was simple: I was in Los Angeles, and had a spare weekend, which I guess makes me the arch-typical visitor. The trip was about 4 hours (from Redlands, the far north east side of LA), and the road was busy all the way; there are plenty of stopping points, but only two towns of any nature (Barstow and…).

We stayed at the Luxor, for no particular reason – it is one of the most southerly hotels on the strip. Rooms were ok and large, but there was no wireless reception whatsoever, and it would be chargable. I did find two access points – outside a hairdresser on the way to the Mandalay Bay, and a cafe near Ceasar’s Palace (in the mall there). There is free access from both of the two Apple stores as well, of course.

Being in Vegas in early March isn’t as hot as it could be – in fact, overnight was distinctly chilly. But the air is still bone dry, and I could feel the impact on my throat and face; bring water and moisturizer. Distances along the strip are large; hotel to hotel is going to be at least 1/4 mile, and may be more. From Mandalay Bay to Bellagio is 1.5 – 2.0 miles, and that’s just the most southern 4 hotels on the strip. You can mostly get from hotel to hotel by indoor walkways and escalators, but it’s hard to avoid crossing the casino floors. This isn’t helped by the various resorts signing policy – you won’t ever see an EXIT sign, and signs from hotel to hotel, even ones under the same ownership, are only visible when you are always at the exit point. There are no direct paths across the casino floors either.

You’ve herd stories of $1 shrimp cocktails and $5 steaks? Yeah, right – you see the signs everywhere you go, but you won’t see the food. basic hotel buffet food may be slightly cheaper than the rest of the USA, but it’s certainly no better, and expensive restaurants in Las Vegas are still exactly that – expensive.

Contrary to the propoganda, you can spend time in Vegas and not gamble; ok, so I blew $10 on slots, and Liz did the same (only she got $50 return). There may be some advantages to joining your hotels slots club, but I didn’t do that. SO I’m ignoring this aspect.

There are two reasons to go to Vegas (for me) – shopping, which is average, and shows. As for the shopping, when you see so many expensive fashion stores all in one places, you soon realise that expensive fashion is way more tacky than cheap fashion (which at least has the twin virtues of trying harder, and knowing that it is cheap). There are effectively no book stores along the strip, but that is balanced by the two Apple stores, if that helps (it doesn’t). But the shows make up for it – you could easily spend a month just going to the shows you want to see, although expect to spens at least $50-100 each night. We saw the Excalibur show (knights and horses, pretty decent), and Penn & Teller.

Summing up, in the same circumstances (bored in LA), I’d go again, and I’d be willing to spend longer. I guess I’d be there for shows, relaxation (sleep and pools), and to explore the strip a bit more. I know there is more and better to do if you are a resident, but that’s it for me.

Best thing: you can buy a map of the strip printed on microfibre cloth; it doesn’t look like you are consulting a map, and you can clean your glasses at the same time!

PDA Update – ASUS eee PC1000 and iPod Touch

Once upon a time, many years ago, I wrote a column for PC Pro (UK PC magazine) on “Mobile Computing”. The editor wanted me to write about Windows CE PDAs, which were then and are now extreme crap – and I submitted columns on what worked – which, back then, meant mainly Palm, and I expored mobile phones and laptops, which meant the early Mac OS X machines from Apple. Good stuff, and I was happy to see recently that Stephen Fry validated all my opinions in his blog. I was booted, and replaced by a guy who owned a PDA business, and wanted to write about what made him money – which, incidentally, was exactly contrary to the concept behind the Realworld Computing section in PC Pro (but then my column didn’t fit either, as it wasn’t my primary business, or even a secondary one for me).

Time for an update…

I have stayed away from hand-helds. Frankly, the market niche sucks. Palm sold out to Windows CE, and couldn’t recreate their (bought in) OS; they may (or may not) have held on to their original purity of UI, but didn’t have a platform to sell. Apple laptops, as everyone knows, hold their market – high price, good feature set, great UI, and good overall value. But I’m typing this on an ASUS eee PC (running Linux).

This trip has been an interesting one. I’ve been using an Apple iPod touch for some time, and my wife an iPhone, but this is the first long trip with one. For various reasons we decided not to take a laptop (staying with hand luggage only in both directions was a big part), and took the iPods to give them a good test.

At home, walking to a local cafe with an iPod/iPhone in the pocket is a trivial decision. They work very well for casual email and web browsing, although the iPod Touch shows up the problems of finding WiFi access in the UK; with the iPhone, the 3G data access makes that a non-issue.

The obvious weaknesses are the the small screen size; pinching to zoom every single page gets old, very quickly. Outdated sites that refuse you access because you aren’t running IE are a well-known problem, but less obvious. Lack of copy and paste is a big issue for us, as is the inability to do anything meaningful with Notes documents – I’d at least like to be able to edit them on the machine synched to.

The inconveniences turn out to be big when on a real trip. I wasn’t writing long enough emails back home, which I usually do to act as a form of trip diary for me. In the past, I have done the same with an Apple Powerbook and iWeb, very successfully – but there’s nothing close enough on the iPhone/iPod. Twitter really doesn’t match the requirement, having always a transient feel.

I concidered buying a 13.5″ Powerbook – that would cost approximately $1,000. It would fit the bill very closely, although battery life could become an issue. I have often thought about buying one for travel in the past, but the relatively large overlap with the 17″ Powerbook that I use for training classes and semi-portable development has been off putting. However, the new Linux netbooks are attractive – all the required ports and interfaces, good battery life and inexpensive. A white ASUS eee PC 1000HE (I think the suffix is correct, although it doesn’t mention it anywhere on the box) lasts me for a day mostly sitting in coffee shops, connects effectively to free WiFi (if I can find any), and handles mail/web/chat well – much better than the small screens and quirky software of the iPhones. With data roaming turned off (due to cost) on the iPhone, that kills the one advantage it has. Netbook price? < $300; no addons or upgrades are required. What you are buying is substandard from both the hardware and software point of views, when compared to the Apple offering, but at what saving? By substandard I mean the entire inconsistent Linux UI (that’s right, I wouldn’t consider Windows), and minor details like how hard you have to hit the trackpad button to make a click, and the balance when the screen is tilted back, and a myriad other tiny details that just don’t arise on Apple hardware and software.

Tagged

The Practice of Programming, Brian Kernighan and Rob Pike

This book is one of the (very few) classics of software development. It is written in a simple style that is easy to understand, but offers great truths. Many people with limited experience won’t be able to fully appreciate what it has to offer; this is the collation of two lifetimes of experience in the field, written so that that anyone can follow, although some may lack the insight to understand.

For programming novices, they would be better to start with a book that addresses the concerns of beginners, like Code Complete. Once they have digested the lessons it has to offer, it is time to move on to a more advanced book, like The Pragmatic Programmer. In time, when the lessons offered have been fully comprehended, the novice may be able to start to become a serious professional – and read The Practice of Programming.

Tagged

Bread Matters, Andrew Whitley

If you bake bread, then you will be in sympathy with what Andrew Whitley has to say. The author rants extensively about the state of the industry, and the depredations to our palate caused by the Chorleywood process with no signs of abatement. He informs this with an eye to the biochemistry of baking that is missing from most ‘hard-core’ bread books.

About three quarters of the book is devoted to the process of baking; we are taken through simple yeast risen recipes, and led directly into creating a no nonsense rye sourdough starter. The recipes here are centred around Russian style ryes, with additional recipes for different grains: wheat and rye of course, but also spelt and gram. Later chapters include the modern trend for flavoured doughs (tomato and onion, mushroom and garlic, etc), and cover the range from ciabatta and calzone to stollen and lardy cake, with an extensive chapter on gluten-free baking.

It should be clear to the experienced from the above description that Andrew Whitley favours working with very wet doughs, using natural leavens and a wide variety of grains. For a novice some of the descriptions could be more detailed, and the number of permutations for using leavens tends towards the confusing. On balance, I think that a novice breadmaker would be able to learn to make bread from the progressive instructions given in the three chapters devoted to this.

I baked my way through the central section of the book; I had to substitute dried yeast for his fresh yeast in the initial recipes with some stumbling on my part – the instructions for conversion are located in a different section of the book. My rye starter worked exactly as he predicted, and is currently producing a series of fantastic wholemeal rye loaves and French country style wheat and rye (which he calls Cromarty Cob). The doughs all come out somewhat wetter and more fluid than the author describes, but bake successfully (which is what really matters). He also suggests baking at 220-240 C for an initial period, which my last two domestic ovens refuse to reach (they all lie about their temperature, too, which is a very common problem).

Bread Matters is joining my bookshelf alongside Ed Espe Brown, Elizabeth David, Laurel’s Kitchen and Nancy Silverton. I can’t say any better than that.

Tagged , ,

Simple AJAX for WebObjects – without Project Wonder

Probably the simplest Ajax effect that I can think of that is desirable to add to web applications is to cause login boxes to “shake”, just like real computer login panels do, on a failed login. This is one of the few situations where a simple animation effect (too simple to qualify for Ajax, really) has a significant value. I’ve been doing this in projects for quite a while now.

The first stage is to find and install some suitable javascripts to implement Ajax. A popular set is the Scriptaculous and Prototype libraries. First find and install them from: http://script.aculo.us/. Take a look at the “effects engine” demo page to see what we are getting into.

Assuming that you have a reasonably standard page set up, the process for adding this shake effect is simple. What is going to happen is that a script will execute when your page is loaded after the failed login attempt. For this, just drop a script onto the page with the content that will invoke the effect; it will execute on load.

To make this happen, you need to make some minor changes to your java component for the page. Add the following few lines:

protected String onload;

public void awake() {
onload = "";
}

Then you need to set this string appropriately when your login fails:

onload = "new Effect.Shake(loginbox)";

Time to update the component wo to activate the effect:

Add to the wod file:

Onload: WOString {
value = onload;
}

And in the html file, you will want to add your Ajax libraries. In <head> insert:

<script src="/javascripts/prototype.js" type="text/javascript"></script> <script src="/javascripts/scriptaculous.js" type="text/javascript"></script>

The hardest part is going to be to isolate the part of the page that you want to shake. Luckily, most old login panels consist of a table in the middle of the page; add an extra attribute to the table: id =”loginbox”. If you don’t have a table for this, you can add a div with the id set, but not all html elements will shake.

Finally, add in anywhere in the body:

<script type="text/javascript"><!-- <webobjects name="Onload"></webobjects> // --></script>

I normally add this at the end.

Tagged , , , , ,

Ruby On Rails: Up and Running, Bruce Tate

O’Reilly seems to be suffering from more typos and code errors than they used to (in the distant past, before perfect bindings). This book suffers from a few that jarred on me.

If pressed, I’d describe this book as a reasonable taster for Rails. The authors assume that you are already familiar with the basic concepts (HTML, AJAX, and so on), and forgoes any serious coverage of Ruby. There is a basic, half page, description of MVC, and an awareness of object oriented programming is also assumed.

Other criticisms: unit testing is only covered in the last chapter. Come on! It’s a fundamental principle of Rails that you should develop your tests as you write, and leaving it all to last makes a mockery of that.

I wasn’t entirely comfortable with the programming style; it relies on use of primary keys, when I would be happier with passing the ActiveRecord model object that owns that key to methods that accept it; it also often uses quoted strings where symbols are now preferred.

The writing style was also cookbook style – do this, do that, and it will work; but with very little explanation of underlying principles. In an introductory book like this, coverage of principles is far more important than in thicker reference books.

My biggest objection, and why the title “Up and Running” is inappropriate, is that deployment isn’t covered at all. At least a cookbook version of deploying the example photos application using Capistrano and Mongrel should have been included to make the book meet its title.

This book is 167 pages long, including appendices and index. But 28 of those pages are in Appendix B, which is the (good) InVisible Ruby On Rails Reference (freely downloadable elsewhere). It’s a short book.

I have to sum up by saying that, despite its flaws, this gives a good, quick, preview of Rails development, and I can’t think of a better one on the market at the moment; it is also better, I believe, than any of the web site based introductions, but stops far short of the comprehensive reference that is ‘Agile Web Development with Ruby on Rails’ (Dave Thomas and DHH).

Tagged , ,

Spam and more spam

When I first set up the junkmail accounts on MacOS X Server, I came across some web pages describing problems that people had been having with it. Details are also given here: http://wiki.apache.org/spamassassin/SpamAssassin_on_Mac_OS_X_Server

Probably the most visible problem was that the spamassassin configuration file supplied used obsolete keywords, from a previous version. This is /etc/mail/spamassassin/local.cf. Run spamassassin –lint to see the errors in this configuration file.

But the second problem took some time to become obvious. The spam filter on the server seemed substandard in recognising spam, and didn’t seem to learn as more spam was sent to the junkmail account. The reason was that, although the nightly cron job was processing the spam, it wasn’t being written to the right directory! The two folders involved are /var/amavis/.spamassassin and /var/clamav/.spamassassin. Just make one into a link to the other to fix this problem (it obviously doesn’t matter which one is which).

Tagged , ,

ssh login without password

I need to make a note of this, as I keep on looking it up on the web. Here’s the situation: you want to automate access to a server from your private machine, and are prepared to give up the security of the password prompt to get this extra benefit. If so, use this:

ssh-keygen -t dsa -N ""
ssh  mkdir -p -m 700 $HOME/.ssh
# The next command should be the last time ssh asks for a password.
cat $HOME/.ssh/id_dsa.pub | ssh  'cat >>$HOME/.ssh/authorized_keys'
Tagged

Scheduled Tasks – launchd

For a long time I have used crontab for almost all scheduled tasks, with a few diversions into /etc/rc and other such Unix techniques. With Tiger, Apple created launchd, which is intended to unify these, as well as inetd and Apple’s previous (and largely ignored) attempt at the problem, StartupItems. Here are a few pointers on using launchd.

First off, take a quick look at Apple’s notes on launchd, Getting Started with launchd. This doesn’t actually tell you how to use it, but does contain a handy introduction. You ought also scan the man pages for launchd, launchd.plist and launchctl, which contain all the hoary details.

Now to get started in earnest, read the MacGeekery article and the follow up, and download Lingon. (The author of the MacGeekery article wrote an editor which is $5, but Lingon is free).

If you have read these, it is pretty much trivial to create your own cron (and rc and inetd) script replacements.

Tagged ,