Skip navigation.

Lorentz Attractor demo by Canvas

I created another demo of HTML Canvas.

Lorentz Attractor with Canvas

It makes use of sylvester_canvasviewer.js which I created, and publishing under public domain. It's a 3D graph plotting library that works on top of Sylvester.

Ripple effect by Canvas

, , , ...

Here is a demo I made today.

http://atsushi-takayama.com/junk/ripple/



I tested it on Safari, Opera, Firefox. But Opera 9.64 has a bug about transparency of the canvas, so the color is worng. Opera 10 alpha works fine.


You can also copy the JavaScript source (link below) and paste it in the address bar to run as a bookmarklet, on any page you like.

http://gist.github.com/105217

AutoPagerize - Don't Click "Next Page" Any More

AutoPagerize is the revolution of User Interface.

Imagine when you search something on Google, Yahoo, MSN, you name it. The most annoying thing is that you have to click "Next" again and again and again...

You click, wait for the next page to load, scroll, click, wait to load, scroll, click, wait again, and then "Oh, what was written just two pages ago." Now you go back and back. I don't know how much time we are wasting there.

AutoPagerize is a User Script that was written to optimize the web experience, by cutting this stress. Not just redusing it, but by making it absolutely zero.

The script automatically fetches the "next page" and inserts it into the current page as you scroll. No need for clicking. Simple as that. Because it adds the next page while reading the current page, the waiting time is almost zero! (I'd say completely zero but sometimes there is network delay and so on, huh?)

If you want to go back, simply scroll up. Or do in-page search. No more waiting.



What? "90% of the links clicked on Google search results are on the top 3 result pages?" Just forget it already. It's yesterday's web. Now you can search as much as you want.

Good thing is that the script is not only for the search results. But for columns, blogs, etc. At the moment the coverage is limited to only A FEW THOUSAND websites. But you can contribute to increase it. All you need to do is edit SITEINFO.



So where is the script?

It's AutoPagerize for Firefox/Greasemonkey, and oAutoPagerize for Opera, Google Chrome, Safari/GreaseKit.

The Greasemonkey version is easy to install if you know how to use Greasemonkey. There is even painless AutoPager add-on for Firefox too.

oAutoPagerize can be a little bit complecated to use. That's why I was editing this wiki page. I hope I made everything clear for all of you.

Also if you are using the Firefox version and wondered what SITEINFO is, take a look at the wiki.

Pixel-wise Manipulation of Canvas on Opera

Yesterday, I saw a cool demo of <canvas>

Opera canvas sand


Opera has 'opera-2dgame' context for <canvas>. One of the things you can do with it is that you can manipulate the canvas pixel by pixel (link below). It's using that to get the animation effect looking as if the image is blown away by a wind.

The 'Opera-2dgame' Canvas Context - By Web Applications

Nice, isn't it?

Flashblock and iframe-block for Opera by CSS

Do you love Lex1's Flash-block script?

I certainly do.

I love the fact that, with that script, I was released from an enormous number of irritating "moving ads".

However, a while ago, I stopped using it, simply because I found an equivalent to it.

It's not a User JS, but it's a User CSS.


So here is the full source code and the author's explanation. It's only some 30 lines of CSS or so including iframe-block functionality.

Amazing, isn't it?

For those of you who can't read Japanese. I'm going to tell you how to use it.


  1. First, go to the above page and copy the code.
  2. Then create a file in your Local CSS Files Directory, paste the code, and save it.
  3. Restart Opera so that the style file appears as "Flash block by CSS" in your [View]->[Style] menu.
  4. Tick the above menu, and boon! All Flash is gone.


You'll notice you can still watch YouTube video even with the CSS turned on.

That's because YouTube Videos are whitelisted.

These parts of the code below are how you can whitelist certain kinds of Flash and/or iframes.

embed[src]:not(.ucContent):not([src*="nicovideo"]):not([src*="ytimg.com"])

iframe[src]:not(.ucContent)



If you want to unblock a Flash file that has "src" attribute containing "example.com", then just add :not([src*="example.com"]) at the end of the above line.


Note: each time you change. You have to restart Opera if you have followed the direction above. (or use "Reload stylesheets" action that Opera hasn't assigned to any key/menu by default...) If you are doing with "Site preferences" you don't need to restart Opera. Changes are reflected right away.

Can we change the replacement icon? Or remove the Flash/iframe source URLs shown? Yes we can!

Change the below part for example.

content: -o-skin("Window Document Icon") attr(src);


This -o-skin icons are listed here and you can change by putting another icon's name. Or set by a URL (you can even wirte a data: scheme URL just like Lex1's script does).

The "attr(src)" part is for the source URL, remove it if you like.


Of course you can just delete the Flashblock part or iframe-block part of the script, which should be quite obvious if you look at the source, to enable only one of the features.

The very good thing about it is that Opera does not load images, Flash, etc. in "display:none;" parts. So you can save some bandwidth! (It apparently still downloads source HTML files for the blocked iframes).

Improved Hit-a-Hint Bookmarklet With Your Keybind

, ,

I wrote a post (link below) about 3 month ago about a Hit-a-Hint bookmarklet.

Improvement to Hit-a-Hint bookmarklet for Opera

Today I made it even nicer with integrated ability to focus on text areas, select buttons, click javascript-executing links.

I also made a page where you can customize your own keybind.

Here it is Hit-a-Hint Generator for Opera

Feel free to tell me if you found a bug. Most of the time when hints are not drawn, it comes from Opera's bug with getClientRects...

Opera 9.60's bug on getBoundingClientRect and getClientRects

,

Opera has getBoundingClientRect and getClientRects methods just like IE and Firefox.

But the implementation seems a bit poor. Usually they work fine, but in certain conditions they either return weird results or don't work at all.

I made a test page that should hopefully show you when this bug occurs. Here you go and see what's going wrong.

Opera's getBoundingClientRect() and getClientRects() bug test page

I'm going to report this to Opera. Hopefully they fix it soon...

Improvement to Hit-a-Hint bookmarklet for Opera

, , ,

The Hit-a-Hint bookmarklet created by Blazeix is absolutely fabulous.
Vimperator for Opera - Blazeix's Blog - by Blazeix

I made a change to the original script so that I can have any letters I want for hints.

Here it is.

javascript:(function(){var hintkeys='asdfghjkl';var maxdigit=4;function createText(m){var ret='';var l=hintkeys.length;var d=maxdigit*l;while(m>=0){while(m-l*d<0){d--;}ret=hintkeys.charAt(m-l*d)+ret;m=d-1;}return ret;}function retrieveNumber(w){var ret=0;var wlen=w.length;for(var i=0;i<wlen;i++){var fix=(i==0)?0:1;var t=w.charAt(wlen-i-1);ret+=(hintkeys.indexOf(t)+fix)*Math.pow(hintkeys.length,i);}return ret;}var bgcolor = '#FF0';var bghighlight = '#0F0';var color = '#000';var hintlist = new Array();var hintedlinks = new Array();var map = new Array();var choices = new Array();var mapindex = 0;var choice = '';var keycodemapping = {'13':'Enter','27':'Esc','8':'Bkspc','44':','};for(var i=0;i<hintkeys.length;i++){var ithkey=hintkeys[i];keycodemapping[ithkey.charCodeAt(0)]=ithkey;}var originalTitle = document.title;function drawHints(){document.addEventListener('keypress',interpretKeyStroke,true);document.title+=' - ';var allLinks = document.getElementsByTagName('a');var viewportStart = window.pageYOffset - 5;var viewportEnd = viewportStart + window.innerHeight + 10;for (var i = 0;i<allLinks.length;i++){linkYcoord = getAbsoluteY(allLinks[i]);if(linkYcoord > viewportStart && linkYcoord < viewportEnd && allLinks[i].href != '') {hintedlinks.push(allLinks[i]);}}for (var i = 0;i<allLinks.length;i++){var hint = document.createElement('span');hintlist.push(hint);hint.style.backgroundColor=bgcolor;hint.style.color=color;hint.style.position='absolute';hint.innerHTML = createText(mapindex);map[createText(mapindex)]=hintedlinks[i].href;mapindex++;hintedlinks[i].appendChild(hint,hintedlinks[i]);}}function getAbsoluteY(element){var y = 0;while (element) {y += element.offsetTop;element = element.offsetParent;}return y;}function removeHints(){for (var i=0;i<hintedlinks.length;i++){hintedlinks[i].removeChild(hintlist[i],hintedlinks[i]);}choice='';document.title=originalTitle;document.removeEventListener('keypress',interpretKeyStroke,true);delete map;delete hintlist;delete hintedlinks;delete choices;}function interpretKeyStroke(e){e.preventDefault();var key=keycodemapping[(typeof event!='undefined')?window.event.keyCode:e.keyCode];if(key=='Enter'){choices.push(choice);for (var i=0;i<choices.length;i++) {if(map[choices[i]]!=undefined){window.open(map[choices[i]]);}}removeHints();}else if(key==','){if(choice!=''){choices.push(choice);hintlist[retrieveNumber(choice)].style.backgroundColor=bghighlight;choice = '';document.title+=',';}}else if(key=='Esc'){removeHints();}else if(key=='Bkspc'){if(choices.length){if(choice!=''){choice='';}else{hintlist[retrieveNumber(choices.pop())].style.backgroundColor=bgcolor;document.title=originalTitle+' - '+choices.join(',');}}}else if(key == undefined){removeHints();}else{choice+=key;var choicestring = (choices.length) ? choices.join(',')+','+choice : choice;document.title=originalTitle+' - '+choicestring;}}drawHints();})();


It's only for the extended hints mode (see Blazeix's post).
It doesn't work on firefox (Hints disappear when you start typing them in).

You can set any hint letters by changing
var hintkeys='asdfghjkl';


The following
var maxdigit=4;
is the maximum number of hints it can deal with. If you have too few letters for hints, you'd better change this. By default it's capable of showing (9 letters)^(4 digits)=6561 hints.

The main change is the next two functions.
function createText(m){var ret='';var l=hintkeys.length;var d=maxdigit*l;while(m>=0){while(m-l*d<0){d--;}ret=hintkeys.charAt(m-l*d)+ret;m=d-1;}return ret;}
function retrieveNumber(w){var ret=0;var wlen=w.length;for(var i=0;i<wlen;i++){var fix=(i==0)?0:1;var t=w.charAt(wlen-i-1);ret+=(hintkeys.indexOf(t)+fix)*Math.pow(hintkeys.length,i);}return ret;}

The first one is to convert the a number (1,2,3,...) to a hint (a,s,d,...aa,as,ad,...), and the second one does exactly the opposite. I inserted them in the code.

Then I changed keycode mapping as the following so that your added letters will be reflected.
var keycodemapping = {'13':'Enter','27':'Esc','8':'Bkspc','44':','};for(var i=0;i<hintkeys.length;i++){var ithkey=hintkeys[i];keycodemapping[ithkey.charCodeAt(0)]=ithkey;}


That's it. Enjoy!


[Update 2008-10-21]

I made a new version, which is almost complete rewrite from this one.

Improved Hit-a-Hint Bookmarklet With Your Keybind

Update Twitter Status From Opera Address Bar

,

Just add a new search engine to your Opera and configure as below.



Then type
tw blah_blah_your_status_blah_blah

into your address bar.


*Tips*

1. According to the twitter API documentation, the posting status has to be encoded with UTF-8, but I can do it with iso-8859-15, which Opera writes to search.ini by default.
There was a slight change on the API, apparently. You have to do the above with UTF-8. Since there is no GUI way to do it on Opera, the easiest way is to right click on Twitter's Status update field and choose "Create Search...", then input the above!

2. The callback will be an XML data, which will be shown ugly-ly in your Opera. But if you set the default view as "mobile" (or go to http://m.twitter.com once) then the xml page will be directed automatically to your friends' timeline!

**UPDATE 2008-12-19**

Try this UserJS to redirect the XML page to twitter home.

// ==UserScript==
// @include http://twitter.com/statuses/update.xml
// ==/UserScript==
location.href='http://twitter.com/'

But you need to enable opera:config#opera:config#Always Load User JavaScript

**TILL HERE**

3. OperaAddressBar is now officially supported as a Twitter client.

Fastladder--The Fastest Online RSS Reader Goes Local & Open Source



Fastladder is an online RSS reader that come with a very powerful prefetching function. Its interface is well designed so that users rarely feel any delay. The feeling speed is almost incredible compared to Google Reader or Bloglines, especially if you have a large number of subscribed feeds.

The service sells itself with the copy "1000 feeds in your sight", by which they are trying to say "No matter how many feeds you subscribe, it will never slow down." In fact the developper of this service claims that he is reading 7000 feeds, and Fastladder is made for those people like him. At the moment, I'm reading only 164 feeds--of which about 10 are newspapers, 20 are online magazines, and the rest are blogs--but if I export them to Google Reader, it is already quite stressful to use.

It's free, of course. You just need to go to Fastladder.com and sign up or use OpenID/Yahoo ID to sign in. If you are migrating from another feed reader, you can import the OPML file. There is a bookmarklet to subscribe for an atom/RSS as well. In Opera, I use a keyboard shortcut for subscription,

Go to page, "javascript:location.href='http://fastladder.com/subscribe/'+location.href"


How it works is that you look through your feeds with the keyboard shortcuts. As you go down ('j'/'k' for up/down items, 's'/'a' for next/previous feeds), it prefetches the feeds ahead. If you want to open an article, you can either open by 'v' or pin it by 'p' and open all the pinned items later by pressing 'o'. These shortcuts makes news reading superfast. You can still use Fastladder with a mouse, but in that case you have to use a user JavaScript to turn on the prefetching function (I saw this script somewhere and I'm looking for it). By this pinning, I sometimes open over 100 tabs. What Opera is nice about, unlike Firefox, is that there is no speed loss even if you have that many tabs open. I think Opera IS the browser to use Fastladder.


So that's about Fastladder online. Yesterday I saw quite a stunning news. Fastladder now made an open source version which you can install in your local machine. It acts as a local server that you can open in your browser, and has most of the functions of Fastladder online version.

For windows, there is a one-click installer. How to install is described in their blog. On Mac OS X and Linux, installation is a bit harder. You need to have Ruby 1.8.6 and RubyGems (and FreeImage library for Linux) installed. According to the blogs of people who already tried it, the installation is straightforward, a few lines of command.


As I wrote above, the online Fastladder is (or feels, at least) as fast as many of the local RSS readers already. You might want to install it if you wnat to use it even faster (no time lag even using a mouse), or if you need to read non-public feeds in an intranet, for example.

The open source Fastladder is aiming to work on group sharing functions, full text search, etc, which Fastladder is currently lagging behind Google Reader.


See also
Videos
http://www.youtube.com/watch?v=6C0BRHj0_5o
http://www.youtube.com/watch?v=VV7qASlEmtw
(Fastladder is originally released as Livedoor Reader in Japan)

Introduction on Life Hacker
http://lifehacker.com/software/newsreader/organize-and-search-your-feeds-with-fastladder-274833.php

User's blogs
http://www.insideview.ie/irisheyes/2007/08/fastladder-spee.html
http://garbledzombie.wordpress.com/2007/10/11/switch-to-fastladder/