German flip cards Google gadget
Filed under: Computers, Google, Languages, Programming, Technology, Web Programming, XML
gadget for Google homepage. It displays a German word for a few seconds and then shows it’s translation. And then repeats with a new word. The vocabulary is very small at the moment but it will increase by at least one per day.
At the moment it also limits itself to 5 words per viewing. That is after showing five cards it loops (if it didn’t you’d never actually begin to memorise them).
Google Homepage
To use Google personalised homepage, you must have a Google account. When you have one, go to “Personalised Home” (links for that and to create an account are in the top right corner of Google’s homepage).
Adding the Gadget
From your personalised homepage, click “Add Content”, then “Create a Section” and then put the following URL in the box: http://www.oliverbrown.me.uk/gadgets/flip.xml . Then just click “Go” and you’re done
If anyone is interested I might extend the idea to be more flexible.
So where are the Google gadgets
Filed under: Computers, Google, Programming, Technology, Web Programming, XML
Google personalised homepage, you can add Google gadgets to them. A
There are quite a few in their gadget directory but very little mention of them outside Google…]]>
BackBase really pushing AJAX
Filed under: Computers, Javascript, PHP, Programming, Ruby on Rails, Technology, Web Programming, XML
BackBase is another
Anyway, I don’t have time to run down all the features but basically it defines a whole new bunch of tags allowing you to create complicated content in a declarative HTML style way. These tags are then translated into proper
In fact BXML has a very
It all seems very clever.
BackBase
BackBase Demos
ASP.NET Atlas
Silly things with JavaScript closures
Filed under: Computers, Javascript, Programming, Technology, Web Programming, XML
JavaScript is immensely cool. You can do some amazing things with it. Although I’m not entirely sure whether you should.
For example I had a bunch of elements on a page I needed to update using
First I replace a simple replace_id function that accepts three arguments. An element id, a URL to GET to replace its contents with and finally a function to be called when it’s all completed.
And then things got silly.
function chain_replace(urls, ids)
{
id = 0;
next_id = function()
{
if (id < = ids.length)
{
return function()
{
replace_id(urls[id], ids[id++], next_id());
}
}
}
next_id()();
}
Now the next_id()(); bit towards the end should be a clue that something a little odd is going on. But I must confirm that this code does actually work. With enough arguments it might make the browser explode with some sort of call stack problem though…
Going more mobile
Filed under: Computers, Programming, Technology, Web Programming, XML
announced limited support for mobile devices viewing the blog recently. That support basically only covered phones with
Well now I have a
You can force WML output with any browser though (although most browsers do not understand WML).
Detecting Mobile Phones
You’re first instinct is probably to check the user agent. Although it’s true there are fairly consistent ways to detect a phone from the user-agent there is a better way.
One of the many under-utilised headers that browsers always send (well 99.99% of browsers you encounter will) is called Accept. This is just a list of text/vnd.wap.wml.
if (strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false) $mobile = true;
Now we need to find out if the phone can accept XHTML Basic (or XHTML Mobile Profile or whatever) in pretty much the same way:
if (strpos($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') !== false) $xhtml = true;
Many “real” browsers are inconsistent with regards to the MIME type for XHTML. As far as I know since mobile phones do not have any sort of backwards compatibility issues they all use the proper application/xhtml+xml.
XHTML Compliant – Thrice!
Filed under: Computers, Programming, Technology, Web Programming, XML
nobr tag not allowed, span tag not allowed inside a ul and few others) so I fixed them and I'm
The main reason I did it was for the sake of any mobile browsers that might complain really loudly about bad markup. So I started reading about script tags, style attributes, replace i with em and again, a few other minor things. The end result is that an XHTML Basic version of the site is available to mobile browsers. Since I don't have a mobile browser to test it on I can't guarantee I'm detecting them properly yet. If you want to see what it looks like though, just go to Oliver Brown - Basic.
Then I discovered that it's mainly
Just to let you know, when browsing the other versions manually all the links bring you back to the normal site - you actually need a browser detected as being a mobile phone for it to work properly.
Looking good in every browser
Filed under: Computers, Programming, Technology, Web Programming, XML
Firefox (and
Well now it looks how it should in
IE supports “conditional comments”. They’re
The dodginess in IE (if you hadn’t noticed or don’t use IE) is that the graphic behind the Google links bar was 1px to the left. So all I did was put a style definition inside an IE conditional comment to nudge it to the right:
<!--[if IE]><style> #linksbar { background-position: 1px 0 } </style><![endif]-->
Apparently you can do cleverer things with the comments like so conditionals on specific version of IE but that’s getting a little silly and if you want that much control it’s probably better to do it on the server so you don’t send every version of a page to every browser…
For more information, check out conditional comments on Quirks Mode.]]>
