I just spent that last couple of hours trying to figure out why I couldn’t create a new software RAID set on my Ubuntu 10.04 system. Long story short, it turned out to be device mapper grabbing hold of the drives at boot. No amount of lsof would show that the devices were busy. The key was running dmsetup table and seeing that the drives in question were indeed “locked” by the device mapper.

This thread was the key I needed to get it all figured out – http://www.mail-archive.com/[email protected]/msg10661.html

After issuing dmsetup remove followed by the device name shown in dmsetup table I was off and running.

Microsoft is at it again. They’re making wild claims about having a number of iPad killers at 2011’s CES based on their Windows 7 OS. I really hope that they came up with a way to make Windows 7 more appropriate for a tablet.

But after reading this I dare say they haven’t

The Times, citing unnamed sources, said the Samsung devices would be “similar in size and shape” to the iPad, but not as thin and equipped with a slide-out keyboard.

A slide-out keyboard?! Are f&($ing kidding me? Congratulations, you just made a more cumbersome laptop

Linux News is reporting that Acer will be launching two new Android tablets, both a 7″ and 10.1″ model, as well as a Windows 7 based tablet. I asked the magic 8 ball and it is already saying “outlook not so good.” Even the “experts” who cover this stuff already know that whatever Acer pumps out simply won’t match the iPad.

“The price point is the only way for other tablets to compete against the iPad for now, as it’s very difficult to battle the iPad in terms of the user experience,” Kitagawa explained. “But if the price is lower than the iPad’s, and the user experience is good enough, buyers might be attracted.”

That’s not exactly praise being dished out there now it is?

I’d really like to see more companies compete with the iPad by actually offering a compelling product. Samsung’s Tab is so far about the only Android based offering that even stands a chance but even that tablet comes up short. It kinda reminds me of a certain Dilbert cartoon

Dilbert.com

And we all know how I feel about Windows 7 on a tablet. That has #fail all over it.

Lets get something out in the open. I’m really picky, particularly with consumer electronics. I expect something to work as advertised, intuitively, smoothly and without crashing. I’ll quickly dismiss a device over things others will quickly get over. The Western Digital TV Live Media Player is one such device that got great reviews that I simply couldn’t stand. It was advertised as a product that could play virtually any file format either through an attached USB device or through a network connection. What I found was it “could” do some of those things but only some of the time. It repeatedly crashed, treated the same file different based only on the file extension and in the end, the product was a nightmare to own and I quickly sold it.

So anyway, lets talk about Android. Recently the on call phone that is passed around between myself and two of my co-workers was replaced by a Droid2 (which I pushed for). The Droid2’s hardware is top notch. It has a high quality feel to it and a great, to my eyes, screen. I haven’t had much time with the camera so I really can’t say much about it.

Android on the other hand is a mixed bag and as my co-workers pointed out today, this is where my picky tendencies just get out of control. I find many parts of the Android OS to look fantastic, especially when not in motion, and have a polished feel, while other parts just feel half-assed. For example, waking the Droid2 from sleep quickly fades the screen into view which looks very elegant. You are then offered two basic options using the same motion, just in different directions. Pull the tab on the left to the right and you unlock the phone. Pull the tab on the right to the left and you toggle between vibrate only mode or sounds on. These are great except the animation of either tab looks rather poor. Once the phone is unlocked, the lock screen fades away to reveal the default interface, which again looks great and is very smooth. This disparity between how the screen fades so smoothly and poor unlock animation breaks the continuity of the experience. The two bits feel like different parts when they should feel as if they’re all one part melded together.

As a long time iOS user, if there is such a thing, there are other parts to the Android experience that really stick out. One of them is text input. So far, I have yet to find a text entry box that brings up the keyboard by default. For example, open the Gmail app and compose a new message. The keyboard won’t show unless you tap the To: field even though the To: field is focused by default. Another example. Add the Android News and Weather widget by doing a tap and hold on the a screen. Once added, attempt to manually add a location. You will be faced with an all black screen with a single text entry field that has focus and a magnifying glass to the right of it. There will be no keyboard even though clearly this is the only text box and the only thing to do on that form is enter text. Touching the already focused text box will cause the keyboard to appear allowing you to enter text. If you then click the done button on the keyboard the keyboard goes away and then nothing happens. You have to click the little search icon instead. I find this incredibly irritating.

Another surprisingly jarring thing is that list views aren’t able to scroll past either ends. The ability for a list view to scroll slightly past the top or bottom of the list provides a visual cue that you’ve reached the top or bottom of a list of items. On Android, the scrolling simply stops but you don’t always know that it has stopped because it is out of items or because it isn’t registering that you want it to scroll. In other cases where the entire list contains just enough items to fill the whole screen, you again can’t really tell if it isn’t scrolling because there are no additional items, or if the screen isn’t meant to scroll or if the hardware isn’t “getting” your gesture.

Speaking of scrolling. Android’s response to touch is great except for initiating a scroll, either up and down or left and right. It seems to take almost twice as much distance for Android compared to iOS to realize you want to scroll a list view or move between screens. Once Android begins scrolling, the animation looks poor and full of judder. Again, this distracts from an otherwise pleasant experience.

All that said, this phone is far superior to the previous phone that was Windows Mobile based. Windows Mobile wasn’t great then and compared to what is available today was positively atrocious. I think Android has come a long way in a short amount of time and I hope Android can close the experience gap with iOS in future releases. Until then, I consider Android versus iOS to be like Windows 7 vs OS X. While I prefer iOS or OS X, having to use Android or Windows 7 isn’t a step backwards, it’s just a different way of doing things.

UPDATE: New post on getting Multicore Solr 3.4 running on Ubuntu 10.04

Been working a lot lately with the Apache Solr project.

Solr is the popular, blazing fast open source enterprise search platform from the Apache Lucene project. Its major features include powerful full-text search, hit highlighting, faceted search, dynamic clustering, database integration, and rich document (e.g., Word, PDF) handling. Solr is highly scalable, providing distributed search and index replication, and it powers the search and navigation features of many of the world’s largest internet sites.

Solr is written in Java and runs as a standalone full-text search server within a servlet container such as Tomcat. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like HTTP/XML and JSON APIs that make it easy to use from virtually any programming language. Solr’s powerful external configuration allows it to be tailored to almost any type of application without Java coding, and it has an extensive plugin architecture when more advanced customization is required.

One of the features of Solr is called multicore. Multicore in the context of Solr simply means running multiple instances of Solr using the same servlet container allowing for separate configurations and indexes per core while still allowing administration through one interface. The Solr wiki defines it as:

Multiple cores let you have a single Solr instance with separate configurations and indexes, with their own config and schema for very different applications, but still have the convenience of unified administration. Individual indexes are still fairly isolated, but you can manage them as a single application, create new indexes on the fly by spinning up new SolrCores, and even make one SolrCore replace another SolrCore without ever restarting your Servlet Container.

Although I’ve setup a few instances of Solr using tomcat, I thought I’d write out just how easy it is to get Solr up and running using Ubuntu Server 10.04 as well as talk about some of the scripts I’ve written to make the process of adding, removing and reloading cores easier. This post assumes you have already installed Ubuntu server with internet access as well having a basic understanding of how to use Ubuntu and Linux in general.

Installing Solr
On your Ubuntu server, become root using ‘sudo su -‘ and issue the following command:

apt-get install solr-tomcat curl -y

This will install Solr from Ubuntu’s repositories as well as install and configure Tomcat. At this point, you have a fully working Solr installation that only needs to be tweaked for your environment. Solr itself lives in three spots, /usr/share/solr, /var/lib/solr/ and /etc/solr. These directories contain the solr home director, data directory and configuration data respectively.

Enable Multicore
Enabling multicore is as simple as creating solr.xml in the /usr/share/solr directory and restarting Tomcat. Once you’ve done this, you only need to restart under certain conditions. Under normal operations, you should never need to restart Tomcat.

Using your favorite text editor create a file called solr.xml at /usr/share/solr with the following contents:

<solr persistent="true" sharedLib="lib">
 <cores adminPath="/admin/cores">
 </cores>
</solr>

Next, you need to ensure that Tomcat is able to write out new versions of the solr.xml file.  As cores are added or removed, this file is updated.  The following commands ensure Tomcat has write permissions to needed directory and file

chown tomcat6.tomcat6 /usr/share/solr/solr.xml
chown tomcat6.tomcat6 /usr/share/solr

That’s it.  You can now issue the following command to restart Tomcat and in turn Solr:

service tomcat6 restart

Managing Cores
At this point you’re ready to start creating new cores. Before you can do so however you need create config files, directories and set permissions. In order to make this process a bit easier I created a set of scripts that do all of this for you based on a template config directory.

Create the template config directory by issuing the following command:

cp -av /etc/solr/conf /etc/solr/conftemplate

Next, edit /etc/solr/conftemplate/solrconfig.xml and find the dataDir option. Change the dataDir line from:

<dataDir>/var/lib/solr/data</dataDir>

To:

<dataDir>/var/lib/solr/data/CORENAME</dataDir>

This will ensure the scripts work correctly.

Creating a new Core

Below is the newCore script.  Copy and paste it into a file and call it newCore

#!/bin/bash

# creates a new Solr core
if [ "$1" = "" ]; then
echo -n "Name of core to create: "
read name
else
name=$1
fi

mkdir /var/lib/solr/data/$name
chown tomcat6.tomcat6 /var/lib/solr/data/$name

mkdir -p /etc/solr/conf/$name/conf
cp -a /etc/solr/conftemplate/* /etc/solr/conf/$name/conf/
sed -i "s/CORENAME/$name/" /etc/solr/conf/$name/conf/solrconfig.xml
curl "http://localhost:8080/solr/admin/cores?action=CREATE&name=$name&instanceDir=/etc/solr/conf/$name"

You can now create a new core by issuing the following command

./newCore core0

On screen you should get something similar to this if it was successful:

<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">352</int></lst><str name="core">core0</str><str name="saved">/usr/share/solr/solr.xml</str>
</response>

If you get any other response, particularly one about permissions, go back and review this post as you’ve most likely missed something.

This script has created a new Solr core with the configuration directory set to /etc/solr/conf/core0/conf.  There you can edit the schema.xml file.  To view the default schema.xml file, you can visit http://localhost:8080/solr/core0/admin/. Replace localhost with the hostname or IP address of your Solr server if it is not localhost.

Next time I’ll talk about how to import documents into a core as well as how to reload a core, swap cores or remove/unload a core and merge the index between two or more cores.

Update:  Here are the rest of the scripts I’ve written for Solr

Reload a Core

Save to a file called reloadCore

#!/bin/bash

# reloads a Solr core
if [ "$1" = "" ]; then
  echo -n "Name of core to reload: "
  read name
else
  name=$1
fi

if [ ! -d /var/lib/solr/data/$name ] || [ $name = "" ]; then
  echo "Core doesn't exist"
  exit
fi

curl "http://localhost:8080/solr/admin/cores?action=RELOAD&core=$name"

 

Swap Cores

Save to a file called swapCores

#!/bin/bash

# swaps two Solr cores
if [ "$2" = "" ]; then
  echo -n "Name of first core: "
  read name1
  echo -n "Name of second core: "
  read name2
else
  name1=$1
  name2=$2
fi

if [ ! -d /var/lib/solr/data/$name ] || [ $name2 = "" ]; then
  echo "Core doesn't exist"
  exit
fi

curl "http://localhost:8080/solr/admin/cores?action=SWAP&core=$name1&other=$name2"

Unload/Delete a Core

Save to a file called unloadCore

#!/bin/bash

clear
echo "*************************************************************************"
echo "*************************************************************************"
echo
echo "            You are about to *permanently* delete a core!"
echo "                      There is no going back"
echo
echo "*************************************************************************"
echo "*************************************************************************"
echo
echo -n "Type 'delete core' to continue or control-c to bail: "
read answer

if [ "$answer" != "delete core" ]; then
 exit
fi
# removes a Solr core
if [ "$1" = "" ]; then
 echo -n "Name of core to remove: "
 read name
else
 name=$1
fi

if [ ! -d /var/lib/solr/data/$name ] || [ $name = "" ]; then
 echo "Core doesn't exist"
 exit
fi

curl "http://localhost:8080/solr/admin/cores?action=UNLOAD&core=$name"
sleep 5
rm -rf /var/lib/solr/data/$name

rm -rf  /etc/solr/conf/$name

Merge Cores

Save to a file called mergeCores

#!/bin/bash

# merges two Solr cores
if [ "$2" = "" ]; then
  echo -n "Name of first core: "
  read name1
  echo -n "Name of second core: "
  read name2
else
  name1=$1
  name2=$2
fi

if [ ! -d /var/lib/solr/data/$name ] || [ $name2 = "" ]; then
  echo "Core doesn't exist"
  exit
fi

curl "http://localhost:8080/solr/$name1/update" --data-binary '' -H 'Content-type:text/xml; charset=utf-8'
curl "http://localhost:8080/solr/$name2/update" --data-binary '' -H 'Content-type:text/xml; charset=utf-8'
curl "http://localhost:8080/solr/admin/cores?action=mergeindexes&core=$name1&indexDir=/var/lib/solr/data/$name2/index"
curl "http://localhost:8080/solr/$name1/update" --data-binary '' -H 'Content-type:text/xml; charset=utf-8'
curl "http://localhost:8080/solr/$name2/update" --data-binary '' -H 'Content-type:text/xml; charset=utf-8'

Well not quite. Turns out people have been getting confused on the pricing grid Oracle has on their site for the various products they provide. The confusion comes from the Embedded version of MySQL not supporting InnoDB and that the community edition isn’t listed as part of the grid.

The community edition still has InnoDB built in as an available storage engine but you can’t buy support from Oracle.

http://www.mysql.com/products/
http://palominodb.com/blog/2010/11/04/oracle-not-removing-innodb

Been a lot of rumors flying about that the Macbook Air is finally getting an update. The Air hasn’t gotten a meaningful update in quite a while and is currently the only laptop model from Apple that doesn’t have a the large multitouch trackpad. Rumors include an 11 and 13″ sku and SSD only. AppleInsider has the details at http://www.appleinsider.com/articles/10/10/16/more_details_surface_on_apples_next_generation_macbook_airs.html.