Dialup2.0

Posted 2007-05-31

There is simply too much graphics on the web.

Bandwidth is cheap today, and everyone have loads of it. When web designers got more bandwidth, they forgot to keep it simple, and to avoid huge amounts of gigantic images, flash crap, and similar stuff.

Everyone knows that the best way to make many people do something, is to make it fashionable. Web2.0 is fashionable.

To fix the crap problem, utilizing the fashionable effect, I've created a Great New Way to display images! It's utilizing AJAX, combined with WHAT-WG's HTML5 and a brand new XML-based image format. It works in Firefox and other Gecko-based web browsers, it sometimes works in Opera (could anyone tell me why this seems random..?), and it doesn't work in IE at all (that's no bug, that's a feature). It does also not work in Konqueror, but it might work in Safari.

The image format is simple: the main element is the <image> element, that contains a bunch of <row> elements. Those, in turn, contains <pixel> elements, that contains three elements: <red>, <green> and <blue>. An image that is a white pixel would thus be described as

<image>    <row>        <pixel>            <red>255</red>            <green>255</green>            <blue>255</blue>        </pixel>    <row></image>

Feeling sick yet? It'll get worse ;)

I have written a javascript library that will utilize AJAX to load these XML files, and then draw them, pixel by pixel, into a <canvas> element.

All you, as a webmaster, will need to do to start using this modern, new image delivering method instead of legacy image formats, is to get this file and include it in your html files, add onLoad="loadXMLImages()" to your <body> tag, and replace all your <img> tags with <canvas> tags. The canvas tag does not have a href attribute, so you need to type the URL to your image as the text content of the tag, as in <canvas>http://URL.here</canvas>. That's it!

Since most images that currently exists are in one of these legacy formats, I have also developed a PHP file that can convert any image you give it (and it likes) into my XML Image format. You can get that here.

What is the end result? Before I give you any link, I must warn you: you Will need a bit of RAM. Your computer Will get slow. And your browser Will go on and on about how there's an unresponsive script (it's just doing it's job!). Of course, this is only true if you use a browser that this works in - if you see a printed URL, it doesn't work. I used quite small images in order to not kill your computer too much. (even 640x480 images are big enough to crash peoples browsers from out-of-memory conditions) Still up for it? Click!

There are 4 comments

Tomboy to Wordpress

Posted 2007-05-18
Tagged

This is an old post. You should get the newest version from http://flukkost.nu/blog/tomboyblogposter

I don't like web interfaces. I don't care how slick, neat or sexy they are - they are not local applications, and I like local applications. Web interfaces destroys my virtual desktop layout (If I'll be doing something for a long time, like writing a blog post, I want it to be on the same desktop as my IRC client. If it isn't, I'll be constantly switching desktops to check IRC, which destroys my flow, but a web browser is to clunky to have on the same desktop), and I don't like having to log in time and time again. Some people love their terminals, some people love their Google Apps. Me, I'm a Gnome hugger.

I love tomboy. I can not live without it. Whenever I think something, I type it into tomboy. If I think about something too much, it'll magically become a blog post. Now, I have to copy my tomboy note, and then paste it into Wordpress, then redo the formating, and finally post it. Booooring.

Doing stuff I don't understand is among the best things I know of. I don't know C#, xml-rpc or XSLT. So I set out to do something I would never finish: create a tomboy plugin to post my tomboy notes to Wordpress.

I am proud to announce that a primitive first version is now completed. This post is, as far as I know, the first blog post ever to be posted from Tomboy directly to a blog. Woho!

Of course, there are loads of things to improve. For now, it'll just export the note to more or less sane HTML, using a modified version of the XSLT stylesheet in the Export to HTML plugin (which needs more modifications), and then use the XmlRpcCS library to post it to Wordpress. It supports paragraphs, bold, italics, lists, urls and possibly something else. It doesn't do categories, edit posts or links that doesn't use the URL as the linked text (I bet there's a fancy name for that). It probably doesn't handle errors properly, and the code is awful. You can't upload attachments, nor include images. For now, it'll only post your posts as drafts, and let you do the final touches through the web interface, so you can add fancy stuff yourself.

A new feature in the unstable tomboy branch is tagging - that could probably be integrated with Wordpress category system. It might also be interesting to add support for more blog platforms than Wordpress, but I'll wait untill I get users before I do that. ;)

I am sometimes imagening advanced syncronisation features between Tomboy and Wordpress, but I quickly realize that the reason I use Tomboy for this, instead of something like Drivel that already does that, is that Tomboy is much more versatile - I can (and do) put everything in there, not just blog posts.

Sounds interesting? You can get a precompiled DLL here: http://flukkost.nu/Tomboy2Wordpress.dll and put that in $HOME/.tomboy/Plugins or you can get the source code here: http://flukkost.nu/Tomboy2Wordpress.tar.bz2 Note, though, that this is extremely experimental and probably mostly broken.

Again, this is an old post, which is why I removed the hyperlink. You should get the newest version from http://flukkost.nu/blog/tomboyblogposter

There are 16 comments

Dagens hälsning till FRA

Posted 2007-03-12

Förut idag fick jag se http://politruck.blogspot.com/2007/03/farliga-ord.html. Det är ett javaskript som genererar en eller flera "meningar" med ord som är mer eller mindre troliga att få FRA:s avlyssningsdatorer (som, enligt Maud Olofsson, redan är igång) att säga "Ka-shing!"

Men javaskript är ju jäkligt lamt, eller hur? Då måste ju besökarna inte bara hitta Garefelts blogg, utan dessutom klicka på länken. En mycket enklare lösning är ju såklart att automatisera det hela: visa en ny sträng vid varje sidladdning. Så det har jag gjort, i form av en Wordpress-plugin. Skaffa den här: http://flukkost.nu/blog/fula-ord

Jag vet. Blogger ligger utanför Sverige, och min server står inom hörhåll, så uppenbarligen kommer javaskriptsversionen att ge fler triggar i FRA:s databas (om det nu är så det går till), och den kommer därmed vara mer effektiv. Dock ska vi inte glömma att en väldig massa trafik routas ut ur, och tillbaka in i, Sverige, eftersom det helt enkelt blir bäst så. Så även om du bor i Sverige, och tittar på den här sidan, som serveras från Sverige, så kan trafiken mycket väl skickas utrikes, och därmed genom FRA. Och även om bloggerversionen är effektivare - visst är det coolare att få en ny obegriplig samling galna ord i högerpanelen på en wordpressblogg varje gång man besöker den, än att vara tvungen att klicka på ett javaskript? :D

There are 2 comments

Fuck Lisp!

Posted 2007-02-22
Tagged

Don't you just Hate Lisp? You know, there's parantheses enough to drive a sane man nuts (not to talk about people like me, who aren't even sane to begin with).

Well, to all of you masochists out there, I have created a shorter path to insanity. Meet Fuck Lisp!. Fuck Lisp! is the turing-complete language that contains more parentheses than the almighty Lisp itself!

That's amazing! How is this possible!?

Fuck Lisp! is based on brainfuck, but instead of using a single ascii character for each instruction, it uses triplets of parentheses. Since everything that isn't a parenthesis is considered a comment, there are interesting possibilities to turn your Lisp Fuck! applications into nifty Lisp applications - or the other way around.

How do I use it?

If you know brainfuck, you should be able to pick up Fuck Lisp! just fine. If you know Lisp... Well, it's not exactly the same :) I'll throw in a small conversion table for you here.

Fuck Lisp! Brainfuck C
(()>++ptr
))(<--ptr
()(+++*ptr
)()---*ptr
()).putch(*ptr)
)((,*ptr=getchar()
((([while (*ptr) {
)))]}

Isn't this wonderful? The fastest way to complete instanity Ever!

Where do I get it?Get it now: http://flukkost.nu/blog/wp-content/uploads/2007/02/lispfuck.pyThis little python script was mostly written by James Tauber as a Brainfuck interprenter. I edited it slightly to turn it into Fuck Lisp!. The script is licensed under CC BY-SA - read more in the begining of the script.

I would like to dedicate this script to Linköping University for making me study boring languages such as Lisp and Ada, and thus making me do other stuff, which resulted in this.

There are 7 comments