Friday, March 10th, 2006


I’ve got some serious JavaScriptage going on with my site: I sometimes wonder if it’s too much. One thing I have noticed is that on my iMac I get occasional “There is a script taking a long time to finish. Continue/Stop Script” errors, but never see these on the PC. I also don’t see them under IE/Win, the platform I am forced to use at work.

I also get errors with Camino, but I’m not sure about Safari.

I’ve gone into about:config, and changed dom.max_script_run_time from the default of 5 to 20, just to see if that makes a difference.

View Comment (1)   RSS Feed for Comments on this Post

I had a standard Smarty function, {list_cats}, that under certain circumstances generates invalid XHTML. Specifically, when a feed_image is supplied, not alt tag is generated. This annoys me, as I have worked hard to make my template generate “nice” code.

Smarty to the rescue. Whilst you cannot pass the results of a Smarty function through a Smarty filter, like replace, you can capture the results, and then pass this through the filter:

<h2><a href="/categories/">Main Categories</a></h2>
<ul>
    {capture name=cats}{list_cats optionall='1' all='All' sort_column='name' optioncount='0' children='0' hierarchical='1' feed_image='/images/feedicon10x10.gif'}{/capture}
    {$smarty.capture.cats|replace:"/></a>":"alt='Live Bookmark (RSS Feed)' /></a>"}
</ul>

By the way, I used a similar technique to convert a list of (list) items into a list of selects:

<h2>Links Dropdown</h2>
<ul>
    <li><form name="linksform" action="" method="post" style="margin: 0px; padding: 0px;">
        <select id="link_list">
        <option value=''>Select Link to View</option>
        {capture name="linklist"}{get_links}{/capture}
        {$smarty.capture.linklist|replace:'<a':'<option'|replace:'</a><br />':'</option>'|replace:'href':'value'}
        </select>
        <input type="button" class="button" value="Go" onclick="window.location = (document.forms.linksform.link_list[document.forms.linksform.link_list.selectedIndex].value);" />
    </form></li>
</ul>
View Comments (10)   RSS Feed for Comments on this Post

I have an Asides category, posts in which appear differently on my site. That’s all well and good, but I want these posts to appear normally if viewing the Asides category, or an individual Asides post.

So, I need to be able to style stuff differently depending on a couple of factors.

The most obvious method for this would be to have CSS changing if certain conditions are met. However, in practice this seems to be somewhat difficult. You cannot access the equivalent of a DOM tree in CSS. You can add new entries to a style description, but not find out much real information about the current styles.
(more…)

View Comments (0)   RSS Feed for Comments on this Post

I have my Dock hidden, and aligned to the left of the screen. I don’t really use it for much other than a launcher, although I do have a couple of shortcuts to folders there as well.

I tried to drag an image from a website into one of these folders. I can drag like this to the desktop, or any open window. Why can’t I do this to a folder Dock icon? This seems crazy!

View Comments (0)   RSS Feed for Comments on this Post

Years ago, I was involved in the development of Anygui, a GUI development wrapper designed for python. Basically, it was supposed to be like anydbm is for accessing database modules from python. That is, it was intended to make it into the standard library, and use the best GUI available from it’s list on a given system. I was responsible for the BeOS components, using Donn Cave’s excellent Bethon package.

Today, I noticed a referer in my backend from someone searching for PyMail on Google. I had a look on Google as to what else is found on this search, and came across a site with the following content (I’ve reformatted it, since the site was gone, and this is from the cache):
(more…)

View Comment (1)   RSS Feed for Comments on this Post

Boing Boing: Wirelessly-enabled wine glasses

MIT Media Lab students Jackie Lee and Hyemin Chung have designed wireless-enabled wine glasses (actually, big tumblers) so couples can imbibe “together,” even when they’re geographically apart. From New Scientist:

When either person picks up a glass, red LEDs on their partner’s glass glow gently. And when either puts the glass to their lips, sensors make white LEDs on the rim of the other glass glow brightly, so you can tell when your other half takes a sip. Following tests in separate labs, Lee says the wireless glasses really do “help people feel as if they are sharing a drinking experience together”.

Man, I can’t believe it took this long to invent!

View Comment (1)   RSS Feed for Comments on this Post

Nardac, a new Blogsome user, tried out my Page Templates hack, and asked the following question:

Gravatar Image

I’m having a hard time getting the pages to work. I think I’ve followed your instructions to a tee… but well… hmmm… can you take a look?
the page in question is http://nardac.blogsome.com/nardac/

I looked, and what is occurring is that his normal blog index page is appearing. So I tried the same with my blog: http://schinckel.blogsome.com/schinckel/ - I know I don’t have a Page with this name, so I was interested to see what occurred. It too showed my index page.

Looking down the bottom, I see the arguments that are passed to the server, and in this case, only the blog name is being sent (wpblog=schinckel). So, it seems that a page with the same name as the blog name cannot be used. I suspect this has something to do with the HTTP Rewrite Rules, but I’m not sure. I don’t see it as a big issue, anyway.

Workaround: Don’t use your blog’s name as a Page name.

View Comment (1)   RSS Feed for Comments on this Post