» Archive for February, 2007
Solitaire - JavaScript version
Long time since last post. I’ve played with SuSe 10.2, very nice distro, I had no problems with any application which I’ve tried to install on it. Also, I’ve made another JavaScript game based on YUI. I think, everyone knows what the word “Solitaire” means.Copule of years ago I wrote similar project in Delphi. The main feature of that application
was that the cards were automatically generated by functions implemented in the code. Instead of using 52 images which would represent each of the card I used only small pictures of figures,symbols and small images of king, queen and jack, the rest were done by specified functions.
The JavaScript version works the same.This is very controversial technique, It’s hard to say what exactly is faster and what is slower: loading one big image (16/8 colors GIF - with size 71×96px) or a few small images (2 colors GIF with size - ~15×15px). The answer is not that simple. However I choose the second way and this version of the Solitaire demostrate how that technique works.
Firefox and Opera are loading images only once; if, for example, two objects refers to the one image in the same document, then on the second time the image will be loaded from cache. On IE each image will be loaded separately, so if you’re using IE you will need to wait a little bit longer.
This also is a demonstration of YUI drag and drop techniques…
Enjoy…
Extended Google Ajax News Bar
As I promised, I wrote new application based on Google Ajax News Bar. This is not exactly new application, it might be say that this is an extension to the original News bar.
Google provides two kinds of ways in displaying the results:
- Horizontal - animated bar with ability to show the description in the other wrapper (
options.horizontal=true,andoptions.currentResult=document.getElementsById(wrapper)). - Vertical - all the news results and its parts (title, description, etc.) are displayed in the specified container plus you have ability to switch between search items.
My version is between these two methods but near the first one. It is the normal horizontal bar but the difference is that the title and description are displayed in the popup box near mouse pointer when you move it over the news title.
You can use all options that are available in the original New Bar (and for horizontal method) except of currentResutls and horizontal (always true) - these are used internally and values will be bypassed.
The bad or good information is that this version using prototype.js.
Google Ajax News Bar
Google provides new feature called AJAX News Bar. This application lets you add news search results to your website or blog. You can specify the orientations, the number of results (of course 4 or 8, nothing has changed), etc. The interesting thing is controlling through the links in your page which news results are displayed (works same as my green-links). If you are not good in JavaScript you can use Wizard, it will generates the code for you.
Here are the links to reference, example, and
Wizard.
So, I’m starting to write new application right now, lets see what we can do with it…
Web browser memory usage
Couple of days ago I found the interesting article - “Reduce your Linux memory footprint“, the author writes how to reduce the amount of memory used by applications working on Ubuntu.
For me the most interesting part was about the web browsers. The results form “Comparison of Web browser memory usage” table are not very good for Firefox.
I decide to make same test on Windows XP with the latest version of the browsers.
This is what I did:
I launched the browser, then I opened the page, when loading was done I checked the memory usage with Process Explorer (browser was maximized),
then I closed the browser.
Each test I did three time.
And the results:
BLANK PAGE
| Browser | Average memory use |
| Firefox | 36MB |
| IE7 | 27MB |
page: www.digitalinsane.com
| Browser | Average memory use |
| Firefox | 41MB |
| IE7 | 25MB |
page: www.google.com
| Browser | Average memory use |
| Firefox | 39MB |
| IE7 | 31MB |
page: www.yahoo.com
| Browser | Average memory use |
| Firefox | 45MB |
| IE7 | 43MB |
page: www.msn.com
| Browser | Average memory use |
| Firefox | 45MB |
| IE7 | 44MB |
three tabs with all above pages
| Browser | Average memory use |
| Firefox | 53MB |
| IE7 | 66MB |
It’s not hard to guess that the Opera uses less memory than the other browsers. Internet Explorer is a little bit better than Firefox (in these tests), but it ate more memory when more tabs were open.
And the verdict is:
- Opera - first place! (fast and less memory usage),
- IE7 - second place (very interesting),
- And at the last position, The really hungry Fox!
While I’m writing this post Opera and Firefox are lunched, so lets see the actual memory usage:
Opera (6 tabs opened/6 pages loaded) uses 32 320 Kb,
FireFox (5 tabs opened/5 pages loaded) uses 77 924 Kb
Hmm… Nothing else to say…
