Wednesday, May 06, 2009

SeasideXUL = Seaside + XUL
A Brief talk and links about Seaside XUL = a remotely served rich client powered by Firefox XUL and Seaside
  • What is Seaside?

  • Firefox
    • No introduction required

  • What is Gecko?
    • Part of Firefox. Firefox rendering Engine, which renders XUL into a User Interface.

  • What is XUL?
    • XUL (XML User Interface Language) is Mozilla's XML-based language that lets you build feature-rich cross platform applications that can run connected or disconnected from the Internet. These applications are easily customized with alternative text, graphics and layout so they can be readily branded or localized for various markets. See XUL Periodic Table in Firefox or another Gecko-based browser to see some XUL demos.
    • Also see http://en.wikipedia.org/wiki/XUL
    • To Run XUL, Firefox or at least Gecko must be installed locally.
    • XUL allows to write a web application that also run as "local native applications" - but there are some limitations such as opening local resources.
    • XUL Applications use"Firefox native widgets" that is, they look on every platform as Firefox, but can be skinned as any web applicatiuon can.
    • Main Link: https://developer.mozilla.org/en/XUL
    • XUL Tutorial: https://developer.mozilla.org/en/XUL_Tutorial
    • my XUL links on http://delicious.com/mzimmerm/xul

  • How does XUL code Look? (abbreviated)
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>

<window title="XUL Nested Trees"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<description><html:h1>XUL Nested Trees</html:h1></description>
<hbox flex="1">
<groupbox flex="2">
<tree id="tree1" flex="1" >
<treecols>
<treecol id="sex1" flex="1" label="Name" primary="true" />
<treecol id="color1" flex="1" label="Color" />
<treecol id="attr1" flex="1" label="Attribute" />
</treecols>
<treechildren>
<treeitem container="true" open="true">
<treerow>
<treecell label="Female" />
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="Pearl" />
<treecell label="Gray" />
<treecell label="Frumpy" />
</treerow>
</treeitem>
....
</treechildren>
....
</tree>
</groupbox>

.......
</hbox>
</window>
  • How
    does the result of above XUL code look?





Sunday, April 26, 2009

Sugar OS Neighbourhood (F1 key):
2 VirtualBoxes running Sugar on the Same Network appear as one to jabber.sugarlabs.org


As I plan to plan to play with Squeak interface to Sugar / OLPC Low Level Activity API , which includes things like Journal interface (Datastor API), Security, and Sharing (Presence API), I wanted to first test how it works with existing Sugar Activities.

I should have really started with the Journal Datastore stuff, as it does not require sharing to be setup. But sharing is the more exciting part, that I have been avoiding since I only have one OLPC, and failed to setup sharing under virtualization in the past. But now, with Sugar on a Stick and mainly Sugar in VirtualBox, it is easy to have two or more virtual OLPC's at home, at setup sharing. I did setup Sugar in VirtualBox , and was finally able to play with Presence and Activity sharing between my OLPC and a virtual OLPC running Sugar on Linux (same for Windows or OS X).

Well the long story above brings me to one problem I am having. Running one instance of Sugar on OLPC, and another one in VirtualBox on another system at the same network works fine. What that means is that, on either system, I can go to the Sugar "network neighborhood" (many dots button, or F1), and the systems see each other as they are announced both through jabber.sugarlabs.org . But when I create 2 Virtualboxes on my home network, each running Sugar, only one of them has the neighborhood showing other users at a time. They clearly fight with each other - they must appear as one system to the jabber.sugarlabs.org. If one of the virtual boxes asks for it's neighborhood, it "steals" it from the other which is wiped out. I tried all possibilities VirtualBox 2.2 offers: "NAT Network", "Bridge Network", "Intenal Network", "Host only Network". (Really the only reasonable alternative for what I am doing, is the "NAT Network" or "Bridge Network"). But in all cases both VirtualBox'ed Sugar OSs appear as one to jabber - even on "Bridge Network" where both VirtualBod'ed machines ifconfig shows different IPs.

I know the above is not enough info to figure out the reason, but wanted to document this in case others have the same problem and/or figured it out.

I did not try netstat or other network tools to figure it out as that is usually a recipe for a lost weekend :).

Saturday, April 11, 2009

Script which Creates Live USB from ISO
For OLPC XO or any system
(Fedora script ported to SuSE 11.1)

I wanted to run the Sugarlab's latest Sugar-on-Stick Soas2 on the OLPC using Live USB (Actually SD). There is a utility which uses syslinux to convert ISO to a live USB or SD or CR (or hard disk I guess), and is here: https://fedorahosted.org/liveusb-creator/ , but underlying is really one shell script, writen originally by Jeremy Katz from Red Hat http://people.sugarlabs.org/sdz/livecd-iso-to-disk.sh .

My goal was to convert the script livecd-iso-to-disk.sh to SuSE and it was succesful with a few changes. (Although I ended up with many more changes of cosmetic and refactoring nature).

There were some things that did not work on SuSE, a few I remember - there was a harcoded path to "parted", a hardcoded partition id=1 which did not work for my SD on SuSE (partition id=p1 e.g. /dev/mmcblk0p1). Also I neede later version of syslinux then SuSE version of syslinux, which was missing gptmbr.bin for the Extensible Firmware Interface option.

Also I added lots of comments on top. This script is amazing, it does the whole process of creating Live USB and has tons of options, including format, ability to create "home image" on the USB which is not overwritten with an update, contains the OLPC boot Forth script etc etc. Thanks Red Hat.

The script now runs on SuSE and it is on the below. I would be interested to know if it still runs on Fedora (it should) and other distros (I do not know).

Here is the version with my changes. The most significant "functional" difference is the added last parameter, partition name (which could be "1" for the USB, "p1" for SD but it will depend on the distro).

Saturday, October 18, 2008

New OLPC Laptop Give 1 Get 1 Program



OLPC renewed the G1G1 program, available at

http://amazon.com/xo

as of November 17, 2008

Saturday, November 18, 2006

OLPC Close to Mass Production and Java Free Source



Two important events happened this week, the first is closer to my heart. The One Laptop Per Child hardware had first few hundreds laptops assembled by Quanta. The hardware and software contains some real innovation, it costs a third and uses a tenth of power compared to what the biggest companies can muster. Sure sign of a good thing when Microsoft and Intel complain about it. It also has Squeak and eToys installed! I love it.

Java went free source, and it was very wise from Sun to use GPL. I think that is the only way to prevent fragmentation. Also a good sign that IBM has already complained about Sun's use of licence!

Monday, September 25, 2006

Electrical Battery (sounds more like a Capacitor) for tomorrow.



If this turns out realistic....

http://money.cnn.com/2006/09/15/technology/disruptors_eestor.biz2/index.htm

But, we need to make sure to feed the power grids with non-CO2 ways to produce electricity, mostly nuclear or eventually fusion!

Update: May 2009 - does not seem like they got very far in almost 3 years...

Wednesday, August 30, 2006

Swarm of Artificial Flying and Cooperating Robotic Insects



Looks like The Guardian has a few peaceful usages I asked about for the artificial insects from my blog a few months back. This link here talks about autopilot airplanes, but the use can be similar: Monitor the environment, find shoals of fish (does not sound "environmental" to me), "aid the police in controlling crowds and traffic" (crowds, excuse me?) - well I will stop there, read it, it all sounds a bit lame, but they are trying. The article talks about such drones needing flight clearance etc. I wonder if insect-size drone would still need a flight clearance ....

Saturday, July 08, 2006

Short Roots of Human Tree



Once at it, there is another article related to another interest of mine: Whoever you are reading this, you and I share an ancestor who may have lived as late as 2 thousand years ago!

So if you consider to make a not-so-nice comment to this blog, beware: you are my dear relative!

Roots of human family tree are shallow

Swarm of Artificial Flying and Cooperating Robot Insect



This week I came across something that renewed my old dream to build, one day, a swarm of robotic flying, cooperating, self-sustaining insects. A dream as close as old-fashion cellulose. Apparently, cellulose is piezo-electric, and the pictures they show have a bonus - the insect is my favorite dragonfly (ok, perhaps dragonflies are not insects but they are super-cool)

The article describing it is here, the dragonflies are in a blog here.

What is boring about all these is everyone get immediately excited about a military use of those things. Can nobody think of a peaceful use? Protecting crops from insects? Monitoring wheather? Hey, swarm, get me some water , each a drop, into my glass :)

Saturday, June 17, 2006

Making a Website with Seaside on Squeak


Last month, the hockey team I play hockey with in a (low key) league, asked me to setup a website where players could register and mark themselves as "Available", or 'Not Available', so we can keep track how many players can make it for the next game, and someone does not have to spend time counting email responses before calling substitutes if too few players can make it.

While the user interface for such website is simple, websites that maintain persistent data are not completely trivial, for the simple fact of having to introduce persistence.

I decided to use Seaside for the job and I have to say, it was a super-pleasant experience from the start to the end!

I have not looked at much Seaside code before, and it took two late nights (about 15 hours), much of which was to learn seaside basics and then figure out how to force KomHttpServer load images. The result is a decent looking functional site with persistance, that already served the team well and helped us not to miss any games short of players.

To get the a few things out of the way, the code is not a pinnacle of software engineering, but is was not intended to be. The main thing I do not like the entanglement of "application code" and user interface I end up with in my HockeyWebsiteWAComponent>>renderContentOn:. But the business code amount to a few lines of code and I just wanted something simple, so I am excusing myself, and next will be architecturally sounder.

Apart from that, everything was very simple. While working on it,


  • I had these sites opened in browser at all times:

    David Shaffer's Seaside Tutorial here.
    The Seaside main site.
    The tutorial linked from the above site.


  • I kept hese classes in Squeak browser to find how to generate html tags:

    WAAbstractHtmlBuilder
    WAHtmlRenderer


  • From the tutorial, I figured the best way to build a simple site is to subclass WAComponent and override it's WAComponent>>renderContentOn: method. From there, it was just to work out the details of writing the html tags and adding the (simple) application code in blocks. I was surprised how "easy going and natural" (at least to my brain) it was to work it out in Seaside.

  • For persistence, I simply store the image every 60 minutes (can be made more frequent). This is just one of many great things that Smalltalk having an image is so cool for - I think that for 90% of applications this is perfectly sufficient, and developer has persistence virtually for free. The code is borrowed from an older Goran Krampe's email on squeak-dev (See HockeyUtilities.st)

  • For data structures, I simply populate a singleton (for example, HockeyPlayers class>>getInstance, GameDates class>>getInstance serve as "players table" and "gameDates table".



  • A few comments at the end:
    ==========================

    a) I used Seaside 2.5, and when writing the html the HTML code kept going a bit mure cluttered then I liked, yet on Google I kept coming up with results that showed more elegant API that would not clutter. I think this is Seaside 2.6, so anyone reading this about to learn Seaside I think it makes sense to start with Seaside 2.6 http://www.seaside.st/Download/Images/

    b) It would be good to have a (x)html to Seaside converter. One reason is that some companies designers use html/css to for initial design, expecting the resulting page will use the html code they created.

    c) You can look at the site (with removed players personal info) is here.

    d) Notes on how to create and run the application


    e) The classes can be downloaded here:

    HockeyWebsiteWAComponent
    HockeyPlayers
    Utilities (persistence)
    HockeyPlayer
    GameDates

    Hope this helps .. and I had to share how good Seaside on Squeak is :)

    Monday, March 27, 2006

    Software Industry / Computer Science Forgetting it's History. (Albert Einstein and Alan Kay)



    It is now about 35 years since the term Object Oriented was coined, and first implementations of an Object Oriented system started to be built in the Xerox-PARC research group. It is amazing what this group achieved in the 10 years between 1970 and 1980:


    • - For all practical purposes, invented personal computing, including what later became "the laptop".

    • - Built implementations of Smalltalk, first Object system, Late-bound, using a Virtual Machine, Collection library etc (stuff that Java took and brought to the masses).

    • - Overlapping windows, method to put graphics on the screen was invented and implemented.

    • - First Laser printer was built.



    This research did rest on shoulders of other giants, underlying reseach and ideas were developed in the 1960s in Lisp, Simula and other languages, people like Sutherland, Engelbart, and others, but most of these things have one name on it:


    Alan Kay


    What is interesting to me, is a comparison of general awareness of how much Alan Kay ment for "Computer Science" with what people like Einstein, Pauli, Heisenberg and others ment to physics at the beginning of the 20th century.


    35 years after special theory of relativity was about 1940, 35 years after beginnings of Quantum Theory was roughly 1955-1960. I am sure in 1940 any physics university student knew who Einstein was, and I am sure in 1955 any physics student knew the names of Pauli and Heisenberg and their contribution to physics. In fact, I would bet many high school students those years knew these names and had some idea what these people did.


    Yet, 35 years after these ideas were gelled, I am yet to find a workplace, with computer development professionals using "Object Oriented Technologies" who would not wonder "Alan Kay who?". At the best people have some idea Smalltalk existed (and mostly think it's dead). All people know is Bill Gates and Steve Jobs, who both just borrowed his stuff... Engelbart, at best is remembered as "inventor of the mouse" yet he did so much more.


    I do not know what this ignorance means, perhaps just that the mainstream computing is not much of a science but more or less a glorified fashion industry (well, not even glorified)!


    PS: Also amusing is that in 2006 that I am manually entering < p > <b> and other symbols (as at-ld-semicolon if I want to show them) right into the blog text to format it.

    A few of my friends were following my blog when I started but I let them down by not writing :( so I will try to post more often.

    Saturday, December 17, 2005

    Stem Cell Research - Mankind must be still in the Stone Age of this Research



    Reading the article Stem Cells and the Experiment That Shook the World, I am thinking we must still be in the flint-shaping age of this, given how crude the tools are. The article describes how James Thomson started his ground-breaking experiment: "With a microscope, a steady hand, and a very thin, hollow glass needle, Thomson removed the clump of cells from inside the sphere and placed them in a laboratory culture dish". Then later, to show the stem cells can be converted into any type of tissue: "...the human cells from the culture dishes and injected them into experimental mice. These mice are engineered to lack an immune system so they do not reject the human cells. Once in the mice, the human cells divided rapidly and formed tumor-like structures made up of all the major human tissue types, including skin, muscle, and bone. "

    Excuse me? "steady hand, and hollow needle" and later "inject them into experimental mice" are what it takes to be able to be healing diabetes, spine injuries and who knows what else? Compare those primitive tools with electronic microscopes, particle accelerators and other tools physics uses (or any other branch of science). We are still at the alchymist level here - "pour them together and see what happens". It seems we need a much deeper understanding of these processes and much better tools to take to the next stage. This is just a beginning of a long process!

    Thursday, November 17, 2005

    Microsoft Monopoly, Schools, and Family Feuds.

    My twin daughters are first year high school this year, they are taking a business course which teaches basics of internet, word processing, spreadsheet and so on. A pretty good course, well designed and taught. The problem is that it only uses (and assumes the kids have at home) Microsoft operating system, and Microsoft office, as there is always some stuff to be finished at home, mailed back and forth to work on it some more at school next day.

    The Microsoft-centric approach of the course is a problem at our home, because I was banning installing Microsoft products at any home computer. The girls have learned (ok, forced to learn) to work in OpenOffice, but over certain complexity of the document, saving stuff in OpenOffice as doc and opening it in school next day in MS-word only brings sweat and tears. It is simply impossible, after several evenings of shouts "I hate this Linux thing" I broke down and installed an old version of Windows at home. Of course it is too old, and cannot open the new formats they work in school with, so the girls outsmarted me, and simply stay longer at school to finish their projects there in the cozy Microsoft-only environment. Family friendly.

    What is interesting in all this, is the Ontario School System purchased Sun's StarOffice with province-wide license. But no one is using it, and no one at all is teaching using it. So that is an interesting conundrum, why did Ontario spent my and other's tax-dollars for it? The problem is likely the generic herd behaviour, if the teachers were teaching it using non-Microsoft products, I can hear the parents shouting "why do you teach something my kids will not be able to use at future work" etc.

    So all this contributes to the fact that weaning off the Microsoft stuff will take much longer than I thought. But it will happen. I will take either a generation (start counting in 1990, so by 2015 we should be there :) ), or (more likely) a paradigm shift, invalidation of this "computer = office suite + IE" view.

    Monday, October 24, 2005

    From an interview with Open Office contributor Louis Suarez-Potts
    (oct 25, 2005)

    http://madpenguin.org/cms/index.php/?m=show&id=5370&page=2

    We support over 50 language projects. And every major Linux distributor is involved in the project, with companies like Novell, Red Hat, Mandriva, Propylon; organizations like Debian, and so on participating in building the code. I'm not even counting the hundreds of independent groups and individuals localizing and porting the source. And now, governments are getting into the act. I feel immensely proud and optimistic when governments like those of Brazil, Massachusetts, Vienna, and parts of the French administrations adopt Openoffice.org, even though I personally have had little to do in making the code. Being part of the community has never felt so good.

    Thursday, October 20, 2005

    CSS and the Monopoly.

    Last weekend, I have played with CSS after a while. Testing some advanced features, in SeaMonkey and Firefox, I found several things that work there, but do not work in Internet explorer. Expected. So I started to Google around for how to fix that. I have done that for a few things, spend half of my weekend googling, and suddenly it hit me: At least one of the things I had clearly not working in IE was CSS1. 1996 stuff. Here we are in 2005, and the world is spending incredible amount of energy, resources and time that could be used creatively, to bypass errors that, under normal competitive situation, would have been fixed years and years ago. Of course they rely on the fact that developers will finally only ever develop and test on Internet Explorer, because it is impossible to write code that adheres to standards, and works on Microsoft stuff, and it is twice the time to write stuff that does both. Another facet of how monopoly is bad for us all.