Netbook: Jolicloud

While searching through DistroWatch for netbook specific distributions, I stumbled on Jolicloud.  This version is labeled “pre-final release”, but it seems pretty solid.  Jolicloud is another Ubuntu derivative, this one based on  Jaunty Jackalope.  It comes with a desktop launcher similar to Ubuntu’s netbook remix, except that it displays all disk volumes on the main screen.

Installation went off without a hitch.  WiFi connected without any complaint.  Apparently it’s been tested against a substantial list of netbooks.

There’s no synaptic package manager in Jolicloud.  Instead, you must sign on to the free Jolicloud service.  Once connected to the Jolicloud app, you can download applications.  There also “social” aspects to Jolicloud, which are pretty much lost on me.  One interesting twist is that some of the downloadable apps are actually websites, which are wrapped by Mozilla’s Prism framework.  Websites such as Google docs, Netvibes, and LinkedIn become first-class application icons available on desktop launcher.  In fact, the Jolicloud app itself is a Prism application.

The basic browser is Firefox.  It comes with Flash, but not with Java.  There’s no easy way of installing the Java plugin.  Chrome is available from the Jolicloud installer.

Surprisingly, there’s no email application in the default installation.  You can download Evolution and Thunderbird from the Jolicloud installer, as well as Prism applications around Gmail and Yahoo mail.

Movies and music run fine from the Totem Movie player.  All codecs are already installed.  Music plays directly from the Nautilus file browser.

No office apps are in the base distribution, but you can easily download Open Office, Abiword, or others.

Skype loads directly from the Jolicloud app, and everything about it works.  This was even easier than the Ubuntu netbook remix install.

The only problem I’ve seen so far is that the desktop launcher crashes occasionally.  OK, that’s a pretty serious problem, but hopefully they can resolve things before things go “final”.  Also, the Prism basis around the Jolicloud app means that searching for apps suffers from slow page refreshes.  Again: fix it.

In general, this seems like a pretty solid choice for general netbook users.

Advertisements

Netbook: Moblin

Version 10.04 of Ubuntu is due to be released at the end of this month.  While waiting, I thought I’d try one or more alternatives. Moblin is a Linux distribution optimized for the Intel Atom processor running inside my  Dell Mini 10v.  Under the covers it’s Fedora, but it comes with a desktop designed for netbooks and an integrated software suite.

The basic installation worked fine.  The result booted up, but wouldn’t connect through Wifi.  It seems that Moblin doesn’t include drivers for the 10v’s Broadcom Wifi card.  Wired ethernet worked fine, but Wifi was quite obstinate.  Googling around turned up many people who had the same problem, none of which worked with my installation.  After a lot of trial and error, I got it working.  The solution involved loading dev tools, downloading the source code from Broadcom, and manually installing the driver.

Moblin, version 2.1

Moblin is designed to be light and quick. Bootup took about 20 seconds from the time from the time bootloader kicked in to the opening screen. That’s quick, but only about 5 seconds quicker than Ubuntu 9.04.

The “Moblin Internet Browser” (known as MIB) is Mozilla based. It comes with Flash 10 installed. Java is not provided, and there was no quick to to install it. Normal Firefox add-ons seem to work.

Conveniently, the Application Installer allows you to load Google Chrome and the normal Firefox.  Firefox even comes with a Moblin icon theme.  Ultimately, Chrome is always the best choice on underpowered hardware.

One frustrating aspect of MIB is that it doesn’t provide full-screen mode. On a netbook, the vertical space is especially valuable, so all apps should have a full-screen function to turn off optional chrome and window controls.  Both Firefox and Chrome offer full-screen modes, both triggered by the F11 key.  Unfortunately, the Moblin toolbar is disabled whenver the full-screen kicks in.

The Moblin mail application works fine, and connected up directly to my gmail account. However, I’m completely baffled that mail isn’t an icon on Moblin’s toolbar. Also, although the myzone page lists all your Twitter feeds, it doesn’t show updates to your mailbox.

The Media application can play Ogg Theora video, but no others.    Music plays  fine, as long as it’s Ogg Vorbis.  The Application Installer offers media alternatives, including Banshee and Totem, but these programs will suffer from the same lack of codecs.   Other codecs are available, but  require modest command line kung-fu to  install.  Again, lots of kind folks have posted instructions on loading the codecs, most of which don’t work on my particular hardware or kernel.

For word processing, the Moblin Installer doesn’t offer Open Office, but it does let you load AbiWord, which should do the job for most users. Dia is available for drawings.  I couldn’t find any spreadsheets.

Finally, I tried Skype.  After the headaches of getting simple drivers and codecs to install, you’d think that Skype was completely out of the question.   Incredibly, and as if to demonstrate that life doesn’t have to be so hard, Skype loaded up without much problem.  Microphone, speakers, and video work fine.

  1. Download the RPM for Skype on Fedora.
  2. Install libXScrnSaver:   sudo yum install libXScrnSaver


After spending a couple days with Moblin, I’d have to say there are promising features here, but that it’s definitely not ready for prime time.  The Wifi troubles are perhaps understandable; Moblin didn’t anticipate my particular hardware.  Wireless probably works fine on some netbooks.  Moblin isn’t positioned as a general purpose distribution like Ubuntu.  Moblin is intended for installation by hardware manufacturers, who would take responsibility for driver setup.

Moblin’s speed and standardized graphics are nice.  I like the concept of zones to organize programs.  The toolbar and myzone page show promise.

The MIB browser is a particular weakness.  Besides the poor use of screen space, I find that the JavaScript performance is worse than Firefox’s and distinctly inferior to Chrome’s.  Since MIB gets special treatment by myzone, this will be a problem for casual users.

In general, this is a good distribution, and would provide a totally workable experience for netbook users.

Netbook: Ubuntu Netbook Remix

So I’ve been using my new netbook for a while now.  I play with it at home.  I brought it in to work for a week to use as a secondary console and web browser.  It’s fun and cute.   It’s also slow and the screen is tiny.

Mostly it’s an experiment to see how much value I can get out of a computer that’s smaller than most tech books and whose cost is minimal.  I should start by saying that my expectations are pretty low.   I want this thing to :

  1. Browse the web, including Flash and Java applets.
  2. Read the mail.
  3. Play movies and music
  4. Do a little word processing, spreadsheets, and drawing.
  5. Run Skype.

That’s a pretty modest list.  I think it represents the needs of an average consumer.  I don’t need it to play high-end games or edit movies or host a database.  Just normal day-to-day communication and simple entertainment.

Ubuntu 9.10 Netbook Remix

The first task was to load up the latest release of Ubuntu’s Netbook Remix operating system.  This Linux distribution was customized for the Atom processor in my little Dell Mini.

The netbook came with Windows XP installed.  My intention was to overwrite this completely, but the Ubuntu install offered to set up a dual boot setup, so I could pick either operating system during startup.  What the heck.

Here’s my experience:

  1. Firefox was built in, with Flash v10 and Java 1.6, which takes care of this requirement completely.  For fun, I installed Google’s Chrome browser.   It’s actually shocking how much faster Chrome is on JavaScript intensive sites.  On my other computers I don’t notice much difference, but on the netbook Chrome is much snappier.
  2. Evolution is built in for mail.  It connected up to GMail and other IMAP accounts with no problem.  If you prefer Thunderbird, it’s available in the Synaptic Package Manager.
  3. Movies and music played without a hitch.  This was a pleasant surprise, since in past years I’ve had trouble getting movies to play on Linux.  I guess all the codecs must be lined up now in Ubuntu, because it all just worked.
  4. Open Office comes with the distribution.  That’s all ya need.
  5. It took a while to get Skype installed.   Since this isn’t free software, it wasn’t available on the default repositories within the Synaptic Package Manager.  Once I got this configured, Skype worked fine, including video.

In general, I’d have to say the Netbook Remix is completely usable, and I’d recommend it to non-technical users as a virus free alternative to the big operating systems.

New Netbook

I just picked up a new toy, a Dell Mini 10v.

It’s difficult to explain why I got this, since our house isn’t lacking for extra computers.  My boss pointed out that for fifty bucks more buys a full-powered laptop.  Honestly though, the form factor on the netbook is sufficiently different.    It’s just easier to sit on the couch with it. It’s substantially lighter and quieter.  Folded up, it fits in my hand like a book.  And, at half the price of the low-end iPad, I figure I won’t worry about the thing the way I do with my laptops.

We’ll see.

netbook

Also, although I’ve been using Linux on the server side for years, I’ve spent hardly any time with client side Linux.  The open question for me is  whether I can recommend desktop Linux to my non-technical friends and relatives.

Sun’s Java certifications under Oracle

One of the fall-outs of Oracle buying up Sun is that the Sun Java certifications now become Oracle certifications. We’re now seeing some of the plans to reorganize the different certifications. It looks like the Sun Certificated Java Programmer stays in the same place, but the higher level certs will be split up by subject area, and then recombined into “master” certifications.

I hope the tests and scope of the tests are retained. I have a fairly high opinion of Sun’s Java certification tests. Every time I studied for one of them, I learned new things about the domain. These certs are reasonably priced. The tests are difficult, but it is entirely possible to pass even if you haven’t taken Sun’s (expensive) classes.

Of course, Oracle has always had a highly regarded certification system. But getting their certification is quite expensive. It would be difficult to move up the Oracle ranks without the classes, which will typically require funding from your employer.

I recently looked into Spring certification. Spring is a significant technology, and one I’d like to know more about it. This cert looks interesting and challenging. The test is only $150, but you’re not allowed to take it unless you’ve attended the $2500 class on “Core Spring”.

For Java developers, if you haven’t taken a certification, I highly recommend it. We all need to keep ourselves educated, and it helps to have a specific goal to shoot for.

H2 database on GlassFish

Previously I’d written about running the H2 database within Tomcat.

Here’s a recipe for running under V3 of the Glassfish application server. I’ll create a datasource for the same “employee” database I used previously. I’m creating an in-memory embedded database, but you can connect to any other H2 configuration. Just change the URL format.

Installing the driver

H2 comes with a single JAR file containing both the database and the driver. Before starting up GlassFish, copy this h2.*.jar file into your domains/domain1/lib/ directory.

Now, start up the server: asadmin start-domain

Open up the admin console at http://localhost:4848

It’s possible to configure everything by editing your domain.xml file, or through the admin console GUI. For now, I’ll explain how to get things going through the GUI.

Create a connection pool

On the left side of the page there is a tree of tasks. Find Resources / JDBC / Connection Pools. Hit the “New…” button.

Set the pool name to be “empPool”, the resource type to be “javax.sql.DataSource”, and then fill in vendor name to be “H2”. Submit with the “Next” button.

On the next page, fill in the datasource class name as “org.h2.jdbcx.JdbcDataSource”. At the bottom of the page, edit the additional properties to have only the following, then hit the “Finished” button.

  • user = sa
  • password = ()
  • url = jdbc:h2:mem:employee

Note that the password is set to just left and right parentheses. The admin GUI will interpret this as a blank string. If you tried to enter a blank password, the GUI would disregard your password field.

Now that the pool has been created, you’ll see “empPool” listed under the task tree. Click into this pool to review your setup. There is a “Ping” button on this page that will verify that you can connect to the database.

Set up a JNDI datasource

In the task tree, click into Resources / JDBC / JDBC Resources. Click “New…” to create a JNDI resource to the new connection pool.

The JNDI name should be “jdbc/empDS” and the pool name will be “empPool”. Submit with the “OK” button.

The GlassFish admin console can take care of everything. Just for fun, you can take a look at the “domain.xml” file to see how things are set up. Some environments work better by just deploying XML files.

Use your new datasource

At this point, you can retrieve the datasource "jdbc/empDS" from the InitialContext, and then get connections from the pool:

Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/empDS");

 ...

 Connection conn = null;
 try {
     conn = ds.getConnection();
     ...
 } finally {
     if (conn!=null) { conn.close(); }
 }

The death of applets

Today there’s an article on Javalobby asking if, thanks to JavaFX, are Java Applets Making a Comeback? Clicking into the example applet documenting Olympic medals hangs Firefox on my Mac every time. This is my usual experience with JavaFX. So I guess the answer to the headline is “no”. JavaFX, despite being ambitious and well-intentioned, is putting some nails into the coffin.

The thing is, I’ve always been a big fan of applets. They can be a great platform for rich clients and for amateur game development. They’ve never really been a “failed” technology; they just didn’t develop the momentum that Flash enjoys. If you have a captive audience, such as with business applications, you can be reasonably sure that all users have Java installed, go ahead and develop as an applet. Wanna write some toys? Give Slick or PulpCore a try.

In the long term though, I’d say that applets are doomed. Not because of the initial start-up time (which isn’t so bad) or the lower installation base (which is easily manageable) or massively bloated graphics libraries (just avoid). Applets are doomed because they’ll never run on iPhones or Android devices.

The big future for client development will be on mobile devices, so the most important platform is going to be the one that runs on smart phones and pads and netbooks as well as conventional desktops. The only horse to bet on is certainly HTML5.

The next question is what kind of development platform will emerge on top of HTML5. Much of Flash’s success is due to the tools that let graphics folks become productive application developers. Some of us will try crafting apps with just text editors, but that definitely won’t be sufficient to supply all the new devices.

The iPad launch

Like half the nerds in America, I spent yesterday’s lunch hour watching events unfold at Apple’s big product launch.  Even watching second-hand through the live blog on Engadget, Steve Jobs’ salesmanship is amazing.   I’m as psyched as anyone.  I have shelves of unused electronic gadgets at home, but my iPod Touch still gets constant use.  Big Steve hit all the right markets: games, books, newspapers, and iWork.

The most exciting aspect of the iPad is what it will do to the competition.

The competition for the iPad is the whole netbook sector, a category that has been growing stagnant.  When netbooks first came out, it was amazing to have this little device that would put anyone on the internet.  They were cheap and light and booted up fast.   Any kid or business person or grandparent could buy them and get onto the web.

Unfortunately, the manufacturers decided that getting people to adopt Linux was too big of a business risk;  they had to get Windows onto the things.  Also, people kept saying they wanted their workplace spreadsheet and word processor.  Not that anyone was actually using netbooks for work, but they needed to justify the purchase.    That meant adding hard disks, more memory and more horsepower.  Add the Microsoft-tax, and netbooks became one of the few electronics categories where prices were going up instead of down.

Now the iPad debuts with a starting price at the high end of the netbook spectrum.  You can bet that iPad prices will inch downwards after Apple has sold to all the early-adopters.  More important is that all other hardware manufacturers will be scrambling to bring out similar devices at lower prices.  The Ubuntu and Android folks will be fully involved.

Consider that the whole netbook category was kicked off by the One Laptop per Child program.  That program has been a financial and educational failure, but simply announcing that they would build a usable computer for $100 (and later $200) changed consumers expectations.  Notebook manufacturers responded to this (anticipated) competition and we all got cheap netbooks.

There were smart phones before the iPhone came out, but Apple’s phone pushed innovation in a huge way.  Now every carrier has an iPhone wannabe or two.

There were MP3 players before the iPod, but they were mostly little gadgets that stored a dozen songs for use at the gym.  Apple’s concept that you could store your entire music collection invigorated the category.  The iPod is still on top, but competition forced Apple to fill out its product line.  There are now iPods for every budget.

Although I’m excited, I’m also patient.  It will probably be at least a year before I buy an iPad.  But this product release will be good for all of us.  Competition is the consumer’s friend.

H2 database on Tomcat

I’ve been looking at embedded in-memory databases for application servers. Although there’s decent documentation out for setting up datasources in Tomcat, it takes a bit of experimentation to get things just right.  Here’s my recipe for configuring H2 as a database embedded in Tomcat 6.  The steps should be similar for other databases.

In this case, I’m creating an in-memory database called “employee” with a connection pool named “jdbc_empDS” with a JNDI address of “jdbc/empDS”.

 

Install the driver

With H2 you get a single JAR file for the whole distribution. Most databases have separate JARs for the drivers.   The H2 JAR contains both the drivers and the whole database.  For just a second this seems excessive, but it makes sense because the database can be run embedded in your app server.   When your code loads the driver, it can start the whole database in local memory.

Install Tomcat and change directories to base directory.   Copy your h2.*.jar file into Tomcat’s lib directory.

 

Create a connection pool

Now go to the conf directory and edit the server.xml file.  You’ll be defining a new connection pool as a Resource within the GlobalNamingResource section.

You can also trim out a lot of unnecessary text in this file. Here’s a minimal server.xml file sufficient to run Tomcat:

<?xml version='1.0' encoding='utf-8'?>

<Server port="8005" shutdown="SHUTDOWN">

  <Listener className="org.apache.catalina.core.AprLifecycleListener"
      SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <GlobalNamingResources>
    <Resource name="jdbc_empDS" auth="Container"
        type="javax.sql.DataSource"
        driverClassName="org.h2.Driver"
        url="jdbc:h2:mem:employee"
        username="sa" password=""
        maxActive="20" maxIdle="10" maxWait="-1"
        description="Datasource to employee database"  />
    <Resource name="UserDatabase" auth="Container"
        type="org.apache.catalina.UserDatabase"
        description="User database"
        factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
        pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <Service name="Catalina">
    <Connector port="8080" protocol="HTTP/1.1"
        connectionTimeout="20000"
        redirectPort="8443" />
    <Engine name="Catalina" defaultHost="localhost">
      <Realm resourceName="UserDatabase"
          className="org.apache.catalina.realm.UserDatabaseRealm" />
      <Host name="localhost"  appBase="webapps"
           unpackWARs="true" autoDeploy="true"
           xmlValidation="false" xmlNamespaceAware="false">
      </Host>
    </Engine>
  </Service>

</Server>

Note that the JDBC URL here is in the format for an embedded/named instance of the H2 database. You can specify any other type of JDBC URL, such as an embedded/file database or an external server.

 

Set up a JNDI datasource

Now you’ll need to define a Java datasource that uses your new connection pool, and then you’ll declare it is a resource that Tomcat will serve up through JNDI.  You can specify this in the central conf/context.xml file.  You can also define this within your web application by creating a META-INF/context.xml file.  I usually do the central definition, since it makes the datasource available to all webapps.
Add the following to the context.xml file:

    	<ResourceLink name="jdbc/empDS"
			global="jdbc_empDS"
			type="javax.sql.DataSource"/>

 

Use your new datasource

Now you can start up Tomcat and start using the database:

Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:/comp/env/jdbc/empDS");

 ...

 Connection conn = null;
 try {
     conn = ds.getConnection();
     ...
 } finally {
     if (conn!=null) { conn.close(); }
 }

If the Tomcat manager app is enabled, you can verify that your datasource is available by listing all JNDI resources at http://localhost:8080/manager/resources
You can get a peek into Tomcat’s internals if you run JConsole. This will let you drill into the MBeans for Catalina and see the DataSource and Resource definitions. You’ll need to add the following system property to your CATALINA_OPTS variable:

-Dcom.sun.management.jmxremote

Java web frameworks

This is great:

What kind of woman would your web framework be?

I always knew that JavaFX was trouble.