thoughts of the driverSteinn Eldjarn Sigurdarson on tech, tel, digital freedom and possibly his life..

April 27, 2010

the Nordic Perl Workshop’s (volcanic) woes…

Filed under: General, Technology — Steinn E. Sigurðarson @ 2:21 pm

The Nordic Perl Workshop which was supposed to go ahead this weekend is now dying a slow and painful death as Eyjafjallajökull continues to spew it’s farts all over our skies, and the erratic yoyo-ish opening and closing of Keflavík airport puts more gray hairs on my head every day.

We (FSFÍ) somehow got ourselves involved with having the workshop, and since I happen to use Perl a lot (although I’m no guru) I stepped up to try and organize. Although the timing of the whole thing coincided rather badly for me due to personal and professional reasons, the rest of the FSFÍ board was even more busy with matters of digital freedom and law making in Iceland. Things started off peachy: we Icelanders have it easy when it comes to organizing conferences, everybody wants to come here (for the nature, not the people), so organizing an international event in Iceland is about as easy as e-mailing a couple of heavy hitters “Hey what up, wanna come to Iceland and talk about some shiiz?”, and whipping up a registration page.

For fans of Wayne’s World 2, you’ll love Iceland.. and my organizing “skills”. Just about the only thing powerful enough to upset plans of my caliber, would be the spontaneous glacially enhanced glass-shard synthesizing volcanic eruption, just the type which doesn’t really kill anyone, except if you are flying a jet-engined plane and very unlucky. I’ll leave it to others to discuss the legitimacy of the “great 2010 air-delay”, but for all it’s wonderful jokes

(who can forget classics such as “Iceland! We said CASH, not ASH!!”, the nationalistic: “Sorry Europe, we were aiming for London and Amsterdam!!”, or my favorite: the sublime “The last wish of the Icelandic economy was to have it’s ashes scattered over Europe”)

…I am no longer laughing.

To the brave souls who are coming here anyway, risking to fly through one of our countryside airports, willing to take the 8-12 hour bus-rides to get to Reykjavík, I salute you and will surely enjoy your fabulous company. To the rest who either postponed or cancelled, I understand and hope to see you later this year if we manage to salvage this (natural) disaster of a situation!

digg this

September 10, 2009

Why twitter, WHY?

Filed under: General — Steinn E. Sigurðarson @ 1:19 pm

I have been a twitter user since June 2008 (not particularly long.. I admit), but I just didn’t really see the point of having a 140char blog, unless designed around sms’s or something. In any case, when suddenly everyone around me was using twitter I figured “Hey, I’ll go use that old twitter account, and join my friends with all this cool #hashtaggery and whatnot!”. After all, we have a tradition of setting up a twitterwall in our office using a beamer when we have workshops at the lab, and we all participate and create a cool topical twitterwall experience.

However, my posts never appear on the twitterwall, and actually, when going to search.twitter.com I can’t find ANY posts from me, even if I search for “from:steinnes“. This has been the case for my account since the start, when I registered in June 2008, I did so to participate in #scohrid discussions. My posts did not appear, and I promptly decided that this wasn’t worth my time, so I focused on my work there (ie. drinking beer and spreading my questionable philosophies regarding the nature of data).

Last May, I decided to try and get some help from twitter because of this annoying predicament. Here’s my support request:

May 14 01:07

Good day.

I seem not to show up in any twitter search results. This is very inconvenient, as I am part of a research community where twitter is often used to coordinate information and happenings between conference/workshop guests. I tried it first last year, when I was at a week long summer school on technology-enhanced learning, which was using the #scohrid hashtag for communications. Needless to say, the fact that my (few) posts didn’t show up in the search for this tag, left me out of the discussion, and I gave up on twitter for a while.

Recently I started using it again, as it’s burst in popularity convinced me I had simply been using it wrong, last summer. However it turns out that now, when I am trying to collaborate in a workshop which has chosen to use the #mlss09 hashtag, and I am not showing up on searches for this tag, nor the wall we’ve set up, projecting a “twitterwallr” ambient twitterwall, made up from the search results for #mlss09.

Now, I wonder if my account is somehow flagged as a spam-account, or what could the reason be that even when searching for “from:steinnes” on search.twitter.com, I find nothing.

Best regards,
Steinn E. Sigurðarson

The (automated?) reply I got from twitter support went so:
May 14 02:47


We’re currently experiencing a couple of issues with finding people; if you can’t find yourself in search, make sure you’ve posted updates (so we can index you and your updates.) Profiles that haven’t posted updates aren’t indexed in search.

Profiles added in the last 8 weeks aren’t being indexed by search. We’re tracking this problem here:
http://help.twitter.com/forums/31935/entries/29912

Support requests reporting this issue are being closed, as we’re aware of and working on the problem. Please check the thread above for updates.

When you’re using ‘Find People’ to look for folks by name or user name, you can only perform 50 searches per hour before you’re limited– this is for abuse control and spam prevention. If you hit a search limit using Find People, try checking out Twitter Search’s advanced search:

http://search.twitter.com/advanced

If you’re not listed in search and your profile is public, we may be investigating your account for a violation listed here:
http://help.twitter.com/forums/26257/entries/18311

If you’re sure that doesn’t pertain to you and you still can’t find yourself or your friends, add your comments here:
http://help.twitter.com/forums/31935/entries/29912

At this point, my support request was closed and marked “solved”. I replied:
14 May 2009 03:47

This is NOT a solution.

I have not violated any of the twitter rules, and my account was
registered in June 2008 (so it is MORE than 2 weeks old!).

It really seems this is just an automated message, and no one took the
time to read my request and respond appropriately. As far as I know my
account is not “private” (it is accessible via twitter.com/steinnes
for anyone), and I have not violated any of your rules?

Can you please take a look at what could be the problem (and no, I am
not trying to search for myself, I am trying to see my tweets in a
search for a twitter hashtag).

Frustrated regards,
Steinn E. Sigurðarson

I got a couple more automated replies about my ticket being closed, and 2 weeks later I tried again to open the ticket, but to no luck — I still don’t show up in any twitter searches and can’t participate in hashtag-based discussions.

Now I realize twitter has been growing exponentially, this places a lot of load on the service both technically, and in terms of user support — people run into problems, often because they just don’t know how to use the system even, and I fully understand the need for automated support systems which try to reduce the load on actual people working support. I’ve worked computer support myself, and I wish I would have had something like this ;-)

However I really wish I could somehow reach someone at twitter to get some help with this — I would like to use their service, and I like what they are doing, and I would like to recommend it to my friends, and include the possibility for building support for it in any applications I develop, however at this time I’m not really in a position to do so, and every time my colleagues use twitter and ask me to participate in hashtag discussions it inadvertently ends up as a negative discussion about twitter :-(

So, please twitter, help me!

digg this

September 2, 2009

Thinking about a Moodle flexitheme

Filed under: General — Steinn E. Sigurðarson @ 3:56 pm

I’m thinking that the mobile/contextual theme I’ve been developing at work could be the starting point for some pretty amazing improvements.

The number one problem I always have when developing stuff for Moodle is that people want to squeeze things in where they don’t “belong” according to the Moodle design (afaict). In the COVCELL project this meant hacking the weblib.php file to squeeze our presence block into the standard header, in the grapple project it means doing something similar or not having the indicators/reflection-amplifiers displayed in the most important contexts (resources).

Now I am hacking a rating/annotating feature rather boorishly into the contextualized theme I have been working on before, so as to easily display the mechanics for this on every page. Now I ask myself, why don’t I just design a generic plugin-interface so that my theme can display certain blocks on the resource page, if the block has … a certain php method, or a certain configuraton option set?

Any ideas?

P.S.
I know Moodle supports displaying course blocks on resource pages, but as far as I’ve seen it displays all of them then, which is not what we had in mind.

digg this

August 4, 2009

Regexps in vim!

Filed under: General, Technology — Steinn E. Sigurðarson @ 1:27 pm

This took me like 10 minutes to get right. Just because of the slight differences between vim’s regexp and perl’s.

%s/context\["\([a-z]*\)"\]/context->\1/

However I need to this often when working with php, as more and more things seem to return stdClass objects (such as php5’s built-in json functions) and I always seem to write hundreds of lines of code assuming to use the formerly more common “smart arrays” of php. Syntactically though I must admit I much prefer the stdClass stuff.

digg this

July 30, 2009

Reflections on the last few weeks

Filed under: General — Steinn E. Sigurðarson @ 2:02 pm

These last few weeks have been eventful, and not always in a good way.

I will break my habit of being very topical and not-so personal here, in order to coherently explain to myself and others how the last few weeks have been. On June 19th, I wrote my last blogpost, and later that day I started getting symptoms of flu. This flu I decided would not stop me, and so I decided to barricade myself inside, wearing woolen sweaters, scarves, thick socks, and sleeping in socks/pyjamas while wearing a scarf, etc.

Of course I also took my own advice of getting enough Vitamin C and Zinc, and tried to stay moderately active. The flu actually kept getting worse progressively, and after a week of getting weaker and sleeping up to 16 hours per day, on the 26th of June I lost my voice which did not return for 3 days. On the 29th of June I think I returned to work since I had a skype meeting I did not want to miss, although it was canceled. This was one of the worst flu’s I’ve ever had, and I was still having symptoms as late as the 10th of July, and on that day, I set off up north (Árskógssandur) to a family gathering which was pretty great fun. The fun of the family gathering might have been slightly overshadowed by the fact that on monday morning I woke up with my elbow swollen to about double it’s normal size. Turns out I managed to get an infection in my arm, which the doctors explained was most likely a staphylococcus infection. I received some bandaging and a prescription for antibiots (dicloxacillin I believe, to be taken at 4×500mg per day). The next day, it was not just my elbow, but around 20% of my arm which was swelling up, getting red, and becoming quite hot to the touch. On Tuesday night when I arrived in Reykjavík, I went straight to the emergency room, and was given intravenous antibiotics, and still the infection seemed to get larger and worsen.

After 3 more IV doses on Wednesday, and one on Thursday morning, the doctors reluctantly cleared me to go to the Netherlands on Thursday evening, where I am located currently and writing this entry. Armed with a woozy head, right arm aching from 48 hours of having an IV plug in it, left arm hurting from the flesh eating staph infection, and a weeks worth of more oral antibiotics I left for my current few week stay in the Netherlands.

Now I have a little secret to share with anyone who would like to be a programmer: when you are ill, no work gets done, and the deadlines move closer. This is something I’ve noticed that not everyone realizes fullly perhaps, which may cause great frustration to all involved parties.

Personally I quite wonder if I may after all be suffering from the reactive arthritis I was supposedly misdiagnosed with in 2007, since my eyes are usually swollen every day, and my knees and left elbow hurt, the only missing part of the symptoms required would be some skin rashes, which I haven’t had since 2007 a.f.a.i.k. I find it a little too much of a coincidence that I get this massive infection in my elbow, and that both of my elbows frequently hurt when I lean on them, additionally my immune system has been strangely weak this year, as I’ve caught 2-3 flu’s, and each time been hit quite badly (2+ weeks of severe symptoms, large amounts of rest required, stomach upsets, headaches, and of course respiratory symptoms). Another theory of mine is that perhaps it is time to take a long vacation, as I haven’t taken a vacation for more than a week since 2004 when I took 17 days off.

Naturally I’ve been a little depressed over the whole thing, especially as I’ve run into less understanding from certain people than I would expect. Additionally I have been unable to keep up any regular training for 6 weeks or so now. In that time I have managed perhaps a couple of judo sessions, as well as two bjj sessions — the latter of which was a no-gi session on 8th of July, which I wonder if could be the source of my staph infection (getting a small scab on my elbow + rolling with 10 different sweaty guys on an exceptionally warm day…?). I hope that was not the source of it, but in any case I would be avoiding further no-gi sessions as I must admit, beyond the increased tactical options afforded to me by the gi, I was slightly disgusted with the sheer amount of sweat I was exposed to while training no-gi. Call me a wimp, I don’t care ;-)

Anyway — reflection time over, back to work-ahh..

digg this

June 19, 2009

New ICESAVE agreement compared to treaty of Versailles

Filed under: General — Steinn E. Sigurðarson @ 4:57 pm

This morning, radio journalist Sigurður G. Tómasson of Útvarp Saga, had as a guest an Icelandic economist and assistant professor of economy at Reykjavík University, Ólafur Ísleifsson. They discussed the commitments of the new ICESAVE agreement entered into by the Icelandic government. Pundits are expressing extreme concern over the agreement’s terms, which are said to include the right by either of the other parties (British and Dutch governments) to call in the loans before their due date for several reasons, such as the Icelandic government not honoring any payment of any loan of (approx.) 10 million pounds or more. Ólafur Ísleifsson said dishearteningly that he hadn’t read a single agreement or treaty between sovereign nations, where one party was addressed so one-sided-ly and defeated-ly, except for the treaty of Versailles.

For some very fuzzy/suspect reasons it was only “released” (leaked actually first) yesterday, while apparently signed by Steingrímur J. Sigfússon, finance minister of Iceland, on the 6th of June this year, myself and many other interested Icelanders have not yet had the time to read the agreement and come to any conclusions, but this comparison made by Ólafur this morning is very depressing, especially in the light of numerous legal experts of different nationalities who are claiming the legal grounds for the Icelandic government to assume these responsibilities are far from stable, and this matter is a matter for the courts to decide.

Naturally, I’m not a proponent of running to the courts every time you make a mistake, and indeed the Icelandic financial authorities may have made mistakes or failed to act. Why that happened, whether incompetence, corruption, or insufficiencies of the legal infrastructure has yet to be discovered, and as I pointed out in an earlier entry, the cost of those mistakes may just be too great for Iceland to pay.

Anyone interested in the actual agreements, here they are, courtesy of Economic Disaster Area.

digg this

June 3, 2009

The debts of Iceland, put into perspective?

Filed under: Economics, General — Steinn E. Sigurðarson @ 6:27 pm

I heard an interesting thing today, from an Icelandic economist, who recently joined the parliament. The Icelandic debts due to Icesave and other failed banks, valued at $5.8 billion, would be a huge burden on the Icelandic economy — paying these debts would require several years of reduced infrastructure (healthcare, education, social services), as well as selling some natural resources (at a time when it’s a buyers market, no less). He said, that if you take this debt as a proportion of the UK’s GDP, and and then multiply that percentage with the Icelandic GDP, the resulting number would be something rather trivial — around 300 million ISK (if I heard him correctly), which is equivalent to about 2.5 million dollars. Pocket change for a big country, right?

Now, because I thought this was pretty amazing, I went ahead and did some of my own calculations, and based on the GDP figures for Iceland and UK, as reported by Wolfram Alpha, and the (700.000.000.000 ISK = $5.8 billion) icesave-related debt, I decided to do some calculating.

As you can see here, I calculated that for an economy of the size of UK, to pay off the $5.8 billion, would be about the same load relative to the GDP, as if Iceland was paying off a debt of $39 million. Now, that’s obviously more than an order of magnitude away from what the Icelandic MP quoted (although him being an economist, and me being a programmer, I left the fields on my little calculator open for change!), it’s maybe not what I’d consider pocket change for the Icelandic government, as 0.21% of a country’s GDP shouldn’t be, but it’s a damn sight more possible than the possibility of paying more than 30% of a country’s GDP. To put the debt into more perspective, the entire Icelandic government budget for 2009 is $4.6 billion.

So, the idea of the exercise was pretty much to verify my MP’s claim, but on further examination, I figured out a couple of interesting things as well: what is currently happening to Iceland, if it were to happen to the UK, at the same scale the UK public would be asked to accept liabilities of around 864 billion dollars. Now, I’m not defending any bankers, but I’m pretty sure that UK public opinion on that kind of “bailout” would be rather divided, to say the least.

I Hope to get some reactions — especially in case I’ve made some drastic mistake somewhere (excuse: this was a quick hack at the end of the day, in order to procrastinate a bit!).

digg this

Slightly different take on javascript library detection..

Filed under: General, Technology — Steinn E. Sigurðarson @ 9:07 am

A small update in reference to this, a post I wrote earlier about upgrading my WordPress, and also a javascript method to safely check if a js library has already been loaded in a parent system of a widget or module.

I don’t know about you guys, but in my case, my earlier code would start acting up on my firebug sometimes, and it would force me to step through the exception which it was catching — very annoying, so I made another version which doesn’t use exceptions.

if (typeof(MooTools) !== 'undefined')
{
                // We have MooTools, is it recent?
                var numv = parseInt(MooTools.version.replace(/\./g, ''));
                if (numv < 122)
                {
                        // old version, what do we do?
                }
                else
                {
                        // new version woohoo! do nothing!
                }
}
else
{
        // Failure, we assume MooTools is not setup, and we include it
        // XXX: check here for prototype/jquery and abort in that case

        var head = document.getElementsByTagName("head")[0];
        var newscript = document.createElement('script');
        newscript.type = 'text/javascript';
        newscript.src = '/blocks/indicators/code/mootools-1.2.js';
        head.appendChild(newscript);
}

I do however think that my firebug and firefox combo on the windows machine are simply f*!@#$% …. but who cares… more code, another post, we happy! =)

digg this

April 27, 2009

Simple ways to strengthen your immune system

Filed under: General — Steinn E. Sigurðarson @ 6:13 pm

Without being alarmist, I find there is quite a lot of buzz online about the swine flu, and it’s possibility of becoming a global pandemic. Since I’m a bit of a health nut, I figured now might be a good time to share some of the ways I’ve come across in recent years, which according to research help boost your immune system.

1. Get enough rest. [1,2,3]
2. Stay calm and reduce stress. If possible, medidate, or perform other activities which reduce stress (stress hormones directly cause apoptosis of white blood cells). Other activities could include being affectionate with your (non-infected) loved ones. [4,5,6,9]
3. Use immune-boosting supplements such as Zinc or Vitamin-C — these supplements do not cure illnesses, but being deficient in them will affect the immune system negatively, and keeping your zinc and C levels high boosts your immune system. [7,8,9,10,11]
4. Do not stop exercising, and if you do not do so already, start: moderate physical exercise causes an increase in white blood cell production. A simple yet effective routine to do *at home*, is to do some pushups, squats, and crunches. Moderate is the keyword though, as complete physical exhaustion is probably not desirable. [12]
5. Eat spicy food, there have been some findings that spicy food, containing for example chili helps boost the immune system or fight illnesses. But mostly it tastes good, and makes your dishes keep longer (that’s why it was invented).

Now I could’ve found more references, and I’m sure there are more articles out there on this subject, so that should excuse my laziness. By the way, I’m not bothering with references for the 5th tip, I think eating spicy food speaks for itself ;-)

References.

1. http://www.ncbi.nlm.nih.gov/pubmed/10443758?dopt=A…
2. http://www.springerlink.com/content/wh8185q43g2325…
3. http://myheartmind.blogspot.com/2008/07/immune-sys…
4. http://www.pubmedcentral.nih.gov/articlerender.fcg…
5. http://www.nhs.uk/news/2007/October/Pages/Meditati…
6. http://www.springerlink.com/content/kk477701223g14…
7. http://www.ncbi.nlm.nih.gov/pubmed/7749260?dopt=Ab…
8. http://ods.od.nih.gov/FactSheets/Zinc.asp
9. http://my.clevelandclinic.org/disorders/chronic_fa…
10. http://www.positivehealth.com/article-view.php?art…
11. http://www.ltdk.helsinki.fi/users/hemila/immunity/
12. http://www.nlm.nih.gov/medlineplus/ency/article/00…

digg this

April 15, 2009

Fatal error: Cannot use object of type WP_Error as array

Filed under: General, Technology — Steinn E. Sigurðarson @ 2:45 pm

Quick post, since others face the same problem. When I updated I added a captcha plugin to my site, since I was getting about 10 spammers registering per day. This means that you need to enter a captcha phrase to register as a commenter here. If you however entered the wrong phrase, you were confronted with the lovely error:

Fatal error:  Cannot use object of type WP_Error as array...

A look at the code revealed the plugin to be checking if the captcha entered was correct, and then doing something like this:

$errors["error"] = "ERROR: You must enter the correct letters displayed in the image.";

(I’m not printing it verbatim because I’m too lazy to open the original file)

Obviously $errors (a global) was not an array, but an object of the type WP_Error. Solution: To read up on how WP_Error works, and use it? Easy peasy?

Not quite.

Simply using the preferred $errors->add(’errorcode’,'error message’); didn’t do the trick, in fact changing the code to that caused an even worse behaviour — instead of there being a fatal PHP error, the captcha simply didn’t complain at all, and new users were able to register at will — oh the humanity!

After checking wp-login.php, where they call the hook “register_post”, which the captcha user registration plugin was hooking into, I saw that it calls it like this:

do_action('register_post', $user_login, $user_email, $errors);

Eureka! I can’t simply use the global $errors array, I must use the one supplied to me by the do_action! Immediately I modify the capcc_validateregister function so that it’s declaration takes in 3 parameters, $user_login, $user_email, and the coveted $errors I so hoped to use. Errrrrr, now I got another wonderful error, that arguments 2 and 3 were missing! Oh lord, I was only getting the desired username!

After digging through into the definition of do_action in wp-includes/plugin.php, I found out that it actually loops through all it’s supplied arguments and appends them to a list of arguments which it then uses for all functions which are hooked in to this hook, but each of them has a little configuration variable called “accepted_args”, and upon freshing up on the wordpress plugin docs for hooks, I finally found the answer to my problem.

add_action('register_post', 'capcc_validateregister', 10, 3);

Where 10 is the priority level (10 is default, which I assumed was good enough), and 3 is the accepted_args parameter.

So hooray, captcha works, and now “all” my readers will know how to fix their “Cannot use object of type WP_Error as array” problems:
1. Make sure you are using the right $errors (in register_post case it is supplied as arg #3)
2. Use $errors->add(’errorcode’, ‘message’); instead of $errors['errorcode']= ‘message’;

Hopefully getting point 1 down will be quicker than it was for me, as including the writing of this post, it’s taken an hour of my time! And I really should be debugging a cool app which I’ll blog about later!

digg this

April 2, 2009

Upgraded..

Filed under: General — Steinn E. Sigurðarson @ 3:40 pm

Thanks to “wildcard”, a benevolent user who informed me how someone was using some of my posts to promote medications against erectile dysfunction, I have now upgrade my WordPress. It was either that or closing the blog — apparently I have registered myself for some planet sites, or am being picked up by some feed aggregators somewhere, and well, I wouldn’t want to propagate spam.

On another note, I actually never published the blog entry below, and I was fast asleep while it was published. It seems the spammer who compromised my entries did so for a sequence of post ID’s, starting with 63 and ending with 69. I guess the spamming mechanism also sets the post_status to published, as I guess this minor rant about JavaScript’s escape/unescape functions was an old draft.

Well, glad to see I have some audience for my varyingly intelligent outbursts anyway.

…. To turn this into a more fun blog post, I’ll write something about my work too:

Yesterday I spent probably 3 hours tracking down various problems related to having two independent modules within Moodle, both relying on and including MooTools. The first problem was easy: One module (a theme actually, which I am developing) was using an older version: MooTools 1.2.0. The other module (a block) was relying on 1.2.1 — embarrassingly but conveniently I wrote that one too, however I only wrote the moodly-blocky wrapping part, while my coworker Christian Glahn did the fancy JS stuff inside. A quick check on things revealed I could replace the older version of MooTools with the new one and voila: no more JS errors and conflicts. (google-help: The JS error was only appearing on my iPhone webkit browser, and something to do with Browser.freeMem not being an object).

But no, this was not the end of my problems, still there were bugs, but mysteriously no errors. For some incredibly “odd” reason, the anonymous function I added to the domready Event in my theme just wasn’t being executed. After severe amounts of searching I came to the conclusion that no one else had the same problem I had, and I was simply doing something horribly stupid and wrong. I started debugging the internals of MooTools, after trying unsuccessfully several times to examine the contents of Events.$events, and never ever finding my theme code in there.

Before starting to chase down this behavior, I had actually had a conversation with Christian where we decided I should simply write a mootools initialization script, which would check if MooTools existed, and if so which version, and try to make some kind of intelligent decision whether to create a couple of script elements and squeeze them into the head. It was at this moment, I realized that the 2nd MooTools inclusion, was of course redeclaring everything, and thus clearing my Events.

Problem solved. Solution: don’t expect things to work when including the same JS library several times from different locations… and don’t be stupid, I guess I’ll have to work on the 2nd one, so time for coffee.

For fun, here is the solution I hacked up, in all it’s glory (no complaints on the iphone either):

/* Checks if MooTools already exists, if not includes it. */

try
{
	if (MooTools.version)
	{
		// We have MooTools, is it recent?
		var numv = parseInt(MooTools.version.replace(/\./g, ''));
		if (numv < 122)
		{
			// old version, anything smart we can do?
		}
		else
		{
			// new version woohoo! do nothing!
		}
	}
}
catch (e)
{
	// Failure, we assume MooTools is not setup, and we include it
	// XXX: check here for prototype/jquery and abort in that case

	var head = document.getElementsByTagName("head")[0];
	var newscript = document.createElement('script');
	newscript.type = 'text/javascript';
	newscript.src = 'path/to/mootools-1.2.js';
	head.appendChild(newscript);
}

Merry times on the internets.

digg this

Turns out..

Filed under: General, Technology — Steinn E. Sigurðarson @ 8:11 am

That the javascript “escape/unescape” function combo sucks.

If you care about not trashing non-ascii characters for example, stick with encodeURIComponent/decodeURIComponent

Oh and if using PHP, stick with rawurlencode (but I guess everyone knew that one already).

peace

digg this

Next Page »

gin 1.511 & tonic. | Powered by WordPress