Settling In At DreamHost

Well, things aren’t going too badly with DreamHost, I’m sorting out all my domains and CGI, databases, PHP etc and things are looking good. When I get beaulebens.com across, then I will know things are good 🙂

UPDATE: Things are looking very good – .com.au is transferred properly and appears to have propagated pretty much everywhere, judging by the traffic on my old account. I’ll leave it there for a couple days longer and make sure I’ve migrated everything properly, then close my account at phpwebhosting.com.

New Web Host Soon

Well, I think I’ve finally outgrown phpwebhosting.com as my host, so I’ve started the process of setting up my new account with DreamHost.com.

The reasons that I have decided on DreamHost are along these lines:

  • UNIX Servers (personal requirement)
  • SSH/Shell Access (crucial)
  • .htaccess Editing (crucial)
  • CGI/PHP (crucial)
  • Ability to host multiple domains/subdomains (can only have 1 domain on phpwebhosting)
  • IMAP Mail server – good benefit, since I am switching to web-based mail
  • Good price – for me to host 10 domains there (6 properly + 4 mirroring) is $14.95 per month
  • Good reputation – checked around and only heard good things. The usual criticism of their support, but hopefully I won’t be using it much, so it won’t matter 🙂
  • FTP – I can add users who will have FTP access to certain areas on my servers, which will be good for sharing some space with friends
  • crontabs – can edit them and set them when I want

So please bear with me over the next few days as things might get a little messy on this site (and related ones) while I am moving things around between this host and my new one.

Trialling webpad Personal Edition 3.0

I am posting this from webpad Personal Edition 3.0, which I am trialling in raw beta mode on my server at the moment (minus blogging functionality until I decide what to do about that).

Development is progressing well, and at this stage, I hope to release at least an official beta within a few weeks, pending more rigorous file and security tests, as well as some browser compatibility tests.

Useful JavaScript Snippet

One of the coolest things in the PHP programming language is its excellent handling of arrays. The same, sadly, cannot be said for JavaScript 🙂

This small JavaScript function implements one of the cool functions available in PHP, making it easier to store things in an array, and then check to see if they’re in there later.

// Returns true or false based on whether the specified string is found
// in the array. This is based on the PHP function of the same name.
// Written by Beau Lebens
function in_array(stringToSearch, arrayToSearch) {
	for (s = 0; s < arrayToSearch.length; s++) {
		thisEntry = arrayToSearch[s].toString();
		if (thisEntry == stringToSearch) {
			return true;
		}
	}
	return false;
}

webpad 3.0 Nearing Completion

Well, call me crazy, but I had some time off work, so I went ahead and worked on webpad Personal Edition 3.0. I got a lot done in the week or so that I was working on it, and it’s nearing a point that I will be happy with, barring one major hurdle: blog operations.

In version 3.0, I’ve decided to attempt to support 3 platforms for blogging, namely:

  1. blosxom (what I use)
  2. Blogger (what I used to use)
  3. MovableType (which I’ve never used)

This isn’t a problem in itself (apart from the complexity it adds to those operations :), but I don’t want to release anything for Blogger which is based on the current Blogger API, because they are planning on implementing the Atom API in the near future, which will be much better than what they’ve got now. In the meantime, blosxom is easy to support (filesystem-based, what could be better?) and I think MovableType is also going to be changing their API structure in the near future (as mentioned here).

I’m leaving all the blog operations until as late as possible in the development cycle for this version of webpad, but basically if the blog vendors don’t sort themselves out, I’ll just release this with blosxom support, and perhaps support for the existing APIs, then extend support and release a patch once Blogger and MT have implemented their new APIs.

This version also has some more advanced features like renaming and deleting files, creating new folders and XHTML compliance on all HTML that gets created directly by webpad. The interface has been updated as well to make it a little slicker, and hopefully load a little quicker (more reliance on CSS). The big news though, is that this version will be compatible with Mozilla browsers as well as IE (still working on some of the HTML tools for Mozilla though…). Coming along, coming along. Get on the mailing list at https://beaulebens.com/webpad/ if you’re not already, because I’ll be sending an email to that list with notification when webpad Personal Edition 3.0 is released.

blosxxxom – it’s not porn

In amongst all the talk of the Atom API (which might one day actually be released and usable) and RSS, and with me working on some XML/XSL things at work, I realised that there’s probably another option entirely with blosxom as far as templates/flavours/themes goes, and it goes a little something like this;

Three Xs, therefore blosxxxom, that’s one for blosxom (Apple’s OSX), one for XML and one for XSL, which are the three technologies we’re dealing with here.

  1. Install the theme plugin for blosxom and get it working (this plugin makes life much easier!)
  2. Now create a new theme, with a suitable name (mine’s called ‘blosxxxom’ for the sake of the experiment, and it looks like this; page.blosxxxom. This theme should create a valid XML document from your posts.
  3. Your XML output should refer to an XSL stylesheet, which will actually take care of doing the formatting, entirely client-side (style.xsl in my example theme file)
  4. In the XSL file, just use normal XSL processing instructions to handle the output and presentation of the XML document into XHTML!
  5. Point your browser to blosxom and tell it to use the flavour name that you used to create this theme, and you should be able to see what the output looks like. View the source of the document and you should see the plain XML produced by blosxom 🙂

Now, for a couple notes;

  • I made my content_type value in the theme text/xml, but this forced blosxom to encode special characters to be nice for me. I found that it was better to comment this section of the main CGI out so that I could drop the values in, and wrap them in the CDATA tag seen in the XML theme.
  • Rather than worry about what’s in the body much, I just wrapped things in a <![CDATA[ tag ]]> to be safe.
  • Mozilla doesn’t currently display my output properly – it’s not doing links (or any tags) properly, and it’s just showing them rather than interpreting them as HTML. Anyone got any ideas on this one?
  • There’s more to be done, but it’s a fun point to start at, and there’s no reason why you can’t add things like a COMMENTS element to your STORY node, or a KARMA, a META node with a series of elements – it’s pretty free-form if you’re only doing the XML for your own presentation needs!

Hope that’s inspired some people to try some things out that they might not have otherwise tried, and if nothing else, it just demonstrates how flexible blosxom really is! 🙂

Resizable Google

I don’t know if anyone else noticed, or indeed when it actually happened, but I know that a couple months ago, you couldn’t successfully resize the Google results pages using the ‘Text Size’ option in Internet Explorer.

Purely by accident, I opened a Google page with my text size set to ‘largest’ and lo and behold, they have modified their HTML to allow for resizing of fonts. Even their AdWords ads resize according to the browser preference.

Looking at the source, it looks like they are slowly moving towards a CSS-based layout/design, although they still have a ways to go. Incidentally, I did a copy of their layout with CSS for an internal search engine that I built and it wasn’t that hard at all, their design even lends itself to being done with DIVs, UL/LIs and A tags, styled up with CSS.

So here’s their style definition on a results page now-days;

body,td,div,.p,a{font-family:arial,sans-serif } 
div,td{color:#000} 
.f,.fl:link{color:#6f6f6f} 
a:link,.w,a.w:link,.w a:link{color:#00c} 
a:visited,.fl:visited{color:#551a8b} 
a:active,.fl:active{color:#f00} 
.t a:link,.t a:active,.t a:visited,.t{color:#ffffff} 
.t{background-color:#3366cc} 
.h{color:#3366cc} 
.i,.i:link{color:#a90a08} 
.a,.a:link{color:#008000} 
.z{display:none} 
div.n {margin-top: 1ex} 
.n a{font-size:10pt; color:#000} 
.n .i{font-size:10pt; font-weight:bold} 
.q a:visited,.q a:link,.q a:active,.q {color: #00c; text-decoration: none;} 
.b{font-size: 12pt; color:#00c; font-weight:bold} 
.ch{cursor:pointer;cursor:hand} 
.e{margin-top: .75em; margin-bottom: .75em} 
.g{margin-top: 1em; margin-bottom: 1em}

As you can see, they are not defining a font size for a lot of their elements, which is a good move, as it will inherit the browser settings automatically. One thing that I did notice is that the fixed-size fonts they are using (“.n a” and “.n .i”) are only applied to the numbers used for the links to different pages of results. I am assuming that they have done this because otherwise there’s the potential that thei cool little string of ‘o’s will be messed up from font sizing 🙂

Good Work Google! Good to see more of the big-boys embracing CSS design, I just hope that they continue down this path and have a completely CSS-driven design in the near future, browsers are almost up to speed so that it’s a valid move for them I think.

UCMore At It Again

A couple weeks ago, I realised that the UCMore Toolbar was hitting my website something like 20,000 times a day (based on the User Agent string in my Apache logs). I looked into their site and it looks like it’s trying to get my favicon.ico (which I don’t have) to use as part of a suggestion for similar content to people using their toolbar.

I emailed the guys there and asked them to remove my site from their toolbar because that traffic was a waste, and the icon wasn’t even there. They replied courteously and said that they’d remove my site. A couple days later, the traffic dropped off to around 10,000 hits a day, but has since returned to, and exceeded, 20,000 hits a day.

I emailed them again, and they say they are taking care of it, but so far it looks like something similar is going to happen again (ease off, then jump up again). If things don’t change, I’m going to have to revert to a technique I have seen used around the place and use Apache Rewrites to redirect all traffic coming from their toolbar back to their site, which will be something like an automated DoS I suppose, although I don’t suppose that this amount of traffic will cause any problem on their server, but it’s a statement if nothing else.

Waiting, waiting — will give them 5 days from now.

Local WSDL

I’ve modified XooMLe slightly (Search, Spell and Cache) so that they use a local copy of the Google WSDL, rather than retrieving the remote one, because it speeds things up slightly (one less remote request).

Everything appears to be operating correctly on all operations still, so all’s well. I will also be releasing a downloadable version of XooMLe soon, so that you can host it on your own server and more thoroughly integrate it with your own search solutions.

XooMLe will be a free download when it becomes available (hopefully within a week). Sign up to the mailing list on the XooMLe Project Page to be the first to know when it’s available.