Posted by Tim Riley
Sat, 29 Sep 2007 00:23:48 GMT
Hey sports fans, forget the football this weekend, make sure you go check out the opening round of the new Layer Tennis season: an engaging match between Shaun Inman and Kevin Cornell, with entertaining commentary by John Gruber.
Posted in Geek, Tumble
Posted by Tim Riley
Mon, 24 Sep 2007 06:02:00 GMT
I am sitting in Adelaide airport waiting for my flight back to Canberra. It has been delayed, so I thought I would make use of the extra time to write something here. However, all of my notes (including a list of topics on which I would like to write) are at home on VoodooPads, and not on the laptop I have borrowed.
At times like these, I wish I used online services a little more to keep track of lists and ideas. However, the more clicks that it takes to achieve something, the less likely it is that I do it regularly. So go and check out Jottit, an extremely simple and easy to use website/wiki creation tool.
While it lacks some of the refinement of Backpack, its simplicity (it is built around little more than a single text area for editing pages) makes it look like a quick and easy system to use.
Posted in Geek
Posted by Tim Riley
Fri, 07 Sep 2007 08:36:00 GMT
This weekend, Hugh and I will spend 48 hours building a new web app as part of the Rails Rumble. We're going to build something that I have personally wanted to use for a long time. It should be a lot of fun!
We may be looking for some beta testers, so feel free to register your interest here. Anyway, watch this space, I will keep you all posted throughout the event!
Posted in Life, Geek | 6 comments
Posted by Tim Riley
Fri, 07 Sep 2007 07:51:00 GMT
This week I have been working in some parts of an app that were written a long time ago and have not been touched since.
I've had to resist the temptation to clean up all the code, but a couple of things I could not just let be.
Behold the ugly, ugly, JS code used to select checkboxes within a particular div:
/* Iterates through all users within the TBODY and checks their checkboxes */
function markCheckboxesForDiv(tbody, value) {
for (i = 0; i < tbody.childNodes.length; i++) {
if (tbody.childNodes[i].tagName == 'DIV') {
for (j = 0; j < tbody.childNodes[i].childNodes.length; j++) {
if (tbody.childNodes[i].childNodes[j].tagName == 'DIV') {
for (k = 0; k < tbody.childNodes[i].childNodes[j].childNodes.length; k++) {
if (tbody.childNodes[i].childNodes[j].childNodes[k].tagName == 'SPAN') {
for (l = 0; l < tbody.childNodes[i].childNodes[j].childNodes[k].childNodes.length; l++) {
if (tbody.childNodes[i].childNodes[j].childNodes[k].childNodes[l].tagName == 'INPUT') {
tbody.childNodes[i].childNodes[j].childNodes[k].childNodes[l].checked = value;
}
}
}
}
}
}
}
}
}
Apart from the obvious problems with the depply nested if statements, this code is strongly dependent on the structure of the page markup. I actually broke it while making some unrelated changes.
Here is the new version:
function markCheckboxesForDiv(divname, value) {
$$('#' + divname + ' input[type=checkbox]').each(function(f) {
f.checked = value;
});
}
Much simpler, more robust and more loosely coupled thanks to the wonders of the CSS selector utility function from Prototype, dollar dollar.
Posted in Geek | no comments
Posted by Tim Riley
Thu, 06 Sep 2007 08:02:00 GMT
Gruber wrote after the announcement of the iPhone, that:
Perhaps it’s playing well in the mainstream press, but here at WWDC, Apple’s “you can write great apps for the iPhone: they’re called ‘web sites’” — message went over like a lead balloon.
Now that the iPod Touch has been announced with the inclusion of MobileSafari, this position that web apps are iPhone apps begins to make a lot more sense.
The only Internet-enabled components from the iPhone that have found their way into the iPod Touch are the Safari and YouTube apps. Mail, maps, and widgets - the prime examples of rich native applications that put web apps to shame - remain only on the iPhone. Given that the iPod Touch is much more narrowly focused than the iPhone, this smaller selection of Internet-enabled apps may likely remain a key distinction between the two products.
The release of this cheaper, more accessible, Wi-Fi enabled Apple device will no doubt bring a large influx of new MobileSafari users to the world. Designing web apps for MobileSafari will ensure these applications are available to largest possible market - both iPhone and iPod Touch users.
Posted in Geek | 73 comments | 213 trackbacks
Posted by Tim Riley
Mon, 03 Sep 2007 00:48:00 GMT
To restore a deleted directory or branch in a subversion repository, use the svn copy command. Copy it from the last revision before it was removed:
svn copy -r 1234 http://svnserver/path/to/branch http://svnserver/path/to/branch
Posted in Geek | 1 comment
Posted by Tim Riley
Sun, 19 Aug 2007 23:37:00 GMT
Dear Internet,
I’ve been having some troubles getting my PC to boot while connected to one of the new Apple USB keyboards.
I have it connected with a USB extension cable in order for the keyboard to reach my desk. However, in this state, the BIOS will print a “No keyboard present” error and fail to boot.
When I remove the extension cable and connect the keyboard directly, this error oes not appear and the system boots fine! When I plug it back in through the extension cable after this point, everything is fine also. The problem seems to occur only when the BIOS is loading.
Now ideally I need the extension cable because typing under my desk is just not comfortable. Does anyone have any ideas about how to fix or work around this issue? The USB keyboard support in my BIOS is turned on, for what it’s worth.
You are my only hope!
Love,
Tim
Posted in Geek | 3 comments
Posted by Tim Riley
Tue, 14 Aug 2007 13:34:00 GMT
To use the keyboard to move to the next tab on the right, for selected apps on OS X:
| Safari | ⌘ + shift + ] |
| Firefox | ⌘ + ⌥ + → |
| Adium | ⌘ + ] |
| VoodooPad | ⌘ + ⌥ + shift + ] |
In my time using OS X, I've found it generally to be quite a polished OS, and the application authors on the whole adhere to a consistent or obvious set of behaviours. Keyboard navigation of tabs, however, is one thing that continues to trip me up.
As far as I know, this is something where the Linux desktops are much further ahead, where "Control + Page Down" does the job in the majority of apps I use.
Posted in Geek | 3 comments
Posted by Tim Riley
Mon, 13 Aug 2007 02:13:00 GMT
Recently I have installed an Apache reverse proxy to delegate external requests to a number of different MS SharePoint installations.
It was straightforward to set up and it worked quite well, with one problem -- The reverse proxy accepts HTTPS connections from clients, but all internal traffic to the SharePoint installations is over plain HTTP. At some point during the user signin process, the SharePoint server redirects to a new page using an absolute link beginning with "http://", since that is the only protocol of the requst.
This results in the user being prompted to authenticate twice: once when they hit the HTTPS site, and then once again when their browser is redirected to the plain HTTP site. Worse still is that all secure traffic is taken back to an insecure protocol.
Ideally, it would reload using protocol-independent relative links, but the Windows engineer I was working with said this was not possible.
To fix this, I had to set up a simple RewriteRule for mod_rewrite that redirects all traffic to HTTPS for the virtual hosts listening for HTTP requests:
RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule ^(.*)$ https://urlhere.com/$1 [R,L]
This fixed the double-authentication problem and has the added benefit of moving all traffic to a more secure protocol.
Here is the whole HTTP virtual host block for the reverse proxy to SharePoint:
<VirtualHost 192.168.0.1:80>
ServerName urlhere.com
<Proxy *>
Order Deny,Allow
Allow from all
</Proxy>
ProxyPass / http://10.0.0.100/
ProxyPassReverse / http://10.0.0.100/
RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule ^(.*)$ https://urlhere.com/$1 [R,L]
</VirtualHost>
Posted in Geek | no comments
Posted by Tim Riley
Fri, 10 Aug 2007 07:28:00 GMT
Be careful when use use Rails' observe_field helper. If you point observe_field to an invalid DOM ID, then all subsequent field observers on the page will fail to work.
This is easily avoided if you are using the helper manually. However, if you are programatically generating observers, they do not fail gracefully, so make sure that you only create them if the necessary IDs are present.
Posted in Geek | no comments