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).