Meizu miniplayer

I wouldn’t say I was a gadget freak, but some gadgets do appeal to me. Nor am I a fan of listening to music on the move; I originally got an MP3 player to listen to audio books and podcasts while out walking. My first was a cigarette-lighter sized Creative Zen, which worked so well it was pinched by my husband to use as a dictaphone when he was out walking :-)

I replaced it with a pretty red iRiver the same size as the Creative. The sound quality on this one was superb, even better than the Creative (which was pretty good), but it had two flaws which meant I eventually stopped using it:

1) because of the size and shape of the player, the display was tiny. I found that even with my glasses on, I simply couldn’t read it (to be fair, this was a problem with the Zen too, for the same reason). So the only way to find what I wanted to listen to was to scroll through listening to the beginning of each item. Couple that with tiny, invisibly labelled buttons, and it became problematic.

2) It was designed to work with Windows Media Player. Problem: I don’t use Windows. A firmware upgrade meant I could use it like a standard removable drive in Windows, instead of having to go through the painful, clunky WMP to transfer files, but it wouldn’t play with my Linux PC at all.

Of course if you are a Windows user with very good eyesight, these problems won’t apply to you, and the iRiver is a very good player for its size.

Anyway, I allowed myself to be tempted by a special offer from Amazon, and snapped up a 2Gb Meizu. This has a completely different form factor: the size and shape of a credit card, only thicker (just thick enough to fit a headphone jack on one side, along with the mini USB connector). The aesthetics are beautifully thought out: mine is glossy black, with a mirror-finished back that can be used as … a mirror! Of course it picks up fingerprints very easily, but a little cloth is thoughtfully provided for polishing it up to a beautiful lustre and it has a little case to protect it from scratches.

The big plus is the bright, high-resolution 2.4 inch screen, intended for watching videos. I’ve never understood why people want to watch video on a screen that size, but I’m obviously just too old. In any case, for me it means that menus and track information are easy to read, even in sunlight. Alongside the screen is a touchpad which you use for navigation, scrolling, and volume control. It takes a little bit of getting used to, but after a skim of the manual I found it easy and intuitive; for example when listening to something you can increase the volume by simply sliding your finger up the touchpad. The same technique is used for navigating menus; tapping “Enter” at the bottom of the pad selects an option. Again, the sensitive areas are big and well-labelled enough for it not to be fiddly to use.

There are lots of possibilities for customization, including pre-set EQs for jazz, classical, pop etc. — or you can choose your own custom settings. The sound quality seems pretty good to me, from what I’ve listened to so far.

The other excellent feature is that it is OS-agnostic. To transfer files you simply plug it into you computer with the supplied USB cable and drag and drop files (videos have to be converted using Windows-only software, but I haven’t bothered with that). This works just as smoothly in Linux as it does in Windows, and you can organize the files in a way that suits you. It even supports the open-source OGG format, which neither of my other players did. Note that you should make sure MP3s and other audio files are tagged appropriately, then they will automatically be organized by artist, album etc. You can create your own directories in addition to the default ones for videos, music, and pictures — for example I created one called Podcasts — and use the built-in browser to access them. And of course you can create playlists, though I haven’t tried that yet.

Like both the iRiver and the Zen, it has a dictaphone feature, so I will have to keep it hidden from my husband :-) Unlike them, it doesn’t use standard AAA batteries (which didn’t seem to last long and were always running out at inconvenient times). Instead it has a non-user-serviceable internal battery and charges via the USB port. We’ll see whether this proves to be a problem in the long term. Battery life is said to be excellent, but I haven’t used it enough to know yet. Some people complain about lack of an option to charge directly from the mains, but as I am rarely far from a computer, I don’t see that as a problem. If it were, I believe there are USB-to-mains adapters available.

The eee now spends most of its time being used as a convenient way to play music through the stereo. This means it needs to mount the shared directory on the server downstairs that contains all the music. This caused a few problems initially because Amarok doesn’t seem to like Samba shares and it just wouldn’t build the collection even though I could access the tracks by simply browsing the file system. It took me some expert help and a few goes to get the syntax of the mount command right, and what I ended up with was rather a mouthful:

sudo mount -t cifs //silver/music /home/user/silvermusic -o username=samba_username,password=samba_password,iocharset=utf8,
file_mode=0777,dir_mode=0777

Thank goodness you can use the up-arrow to recall terminal commands! But it does work, and Amarok can build the collection correctly. Helpful Mike S explained to me how to set up fstab to load it automatically:

The following line would do it:

//silver/music /home/user/silvermusic cifs username=samba_username,password=samba_password,iocharset=utf8,
file_mode=0777,dir_mode=0777 0 0

But it would be better to not put the login details in fstab, so you should create a credentials file to hold the username and password:
sudo nano /root/.sambacred

Then add the following to it:

username=samba_username
password=samba_password

Then make it read/writeable only by root in order to keep other people out of it:
sudo chmod 600 /root/.sambacred

Then use the following line in fstab:

//silver/music /home/user/silvermusic cifs credentials=root/.sambacred,iocharset=utf8,
file_mode=0777,dir_mode=0777 0 0

Note: I have introduced line breaks for formatting here, but it’s very important to avoid extraneous spaces in these lines :-) After cifs there should be no spaces. Unfortunately in my case it doesn’t work, I think because the wireless interface doesn’t come up until after fstab has been read, in fact it isn’t activated until after the GUI has loaded. So I ended up just putting the original unwieldy line in a shell script called loadmusic.sh so I can easily run it from the shell prompt. I imagine Mike’s way would work if I was using a wired connection.

This is one of those things I can never remember how to do when I need to do it. I don’t know why, it’s really quite simple:

SELECT emailaddress, firstname, lastname,
COUNT(emailaddress)
FROM customers
GROUP BY emailaddress
HAVING COUNT(emailaddress) > 1

Chocs To Go The goal for students on the intermediate PHP and MySQL course that I’m running for IWA/HWG is to create a working shopping cart. The course starts in only three days, and I decided I’d better walk the walk and prove I could do it. So I have quickly mocked up a working version of the cart they are expected to build and put it online here. I think it will be helpful to students to see what they are aiming at, and it will make it easier for them to work out the logic if they can click through a real example. The design may not win any prizes, but the basics are all there.

All course materials now written and double-checked, quiz questions written and checked, SQL scripts generated and tested … just need to put week one’s materials up now!

Why doesn’t SQL Server come with a built-in method for generating SQL dump files so you can easily port your data to another database? Microsoft in its own little walled garden I suppose; while the facilities in Enterprise Manager for exporting to Excel, Access, ODBC, CSV etc. can be very useful, sometimes you just need a bunch of SQL statements <whisper>so you can export your data to Oracle</whisper>.

SQLDumper to the rescue; a handy little free utility that does just that, with a neat user interface that lets you select which database/tables you want to dump. Windows only, but hey, it’s a SQL server tool after all! Downside: you have to download and install the .NET framework if you don’t already have it, but the setup program handles that itself — just something to be aware of if you have a slow connection.

Since 1999 I’ve been teaching online for the Open University. It may not pay brilliantly, but it’s regular income and I really enjoy doing it; OU students often overcome major barriers to achieve a qualification they missed out on earlier in life, for whatever reason, so they can be very rewarding to teach. And the fact that it’s online means I can conveniently fit it around other work. Currently I teach three courses in the Certificate in Web Application Development.

I can now announce that I’m also going to start teaching an online course with eClasses.org, the online learning branch of IWA/HWG. The course uses PHP and MySQL to build a shopping cart, and is aimed at intermediate PHP developers (you don’t have to know anything about MySQL, but it certainly helps if you do). I’m really lookng forward to this; you can see the full course description here, and registration is now open.

On a trip to the UK just after Christmas I succumbed to temptation and paid a visit to Toys R Us. Minutes later I walked out with this:

The eee PC

Then I headed straight for my hotel, and once in my room I could barely wait to unpack it. I’d heard it was small, but I was still staggered at just how small and light it is. I switched it on, and it booted in 15 seconds, as advertised. I ran the “First run wizard” and once that was done I clicked on “Wireless networks” and without further ado it picked up the hotel’s WiFi hotspot. Unbelievably simple; I hot-footed it to reception for a card, and within minutes was checking my email.

This is a tiny, cheap sub-notebook that runs Linux and does everything I’m likely to want to do on the move: web, email, word-processing, seamless networking. The interface is a bit Playschool, but that is clearly a deliberate choice; the machine is aimed at the educational market as a cheap, easy-to-use laptop that children can carry around with them. In any case, a browse around one of the burgeoning eee fansites quickly revealed a simple fix to enable “Advanced desktop” mode, which turns out to be exactly the same as my Xandros desktop, so no complaints there. Having said that, 90% of the time I use it in “Easy” mode.

In practice of course, many buyers seem to be geeks delighted to find a cool device that runs Linux and can be hacked to do all sorts of useful things. The result is an increasing number of sites dedicated to the eee and detailing various hacks and improvements. Always a good sign when a community builds up round something like this.

Edit: interestingly, the Xandros website states:

The Eee PC is an ASUS product and is solely supported by them, including Operating system issues. The Operating System on the Eee PC is not a Xandros Product. While Xandros may have aided in the development of the Eee PC OS, it is owned and supported by ASUS.

… but the Advanced Destop mode looks indistinguishable from Xandros.

This device really suggests that the operating system is becoming an irrelevance as long as you have network connectivity. Many users of the eee PC will not know or care what the operating system is; they’ll just use it to accomplish tasks. Microsoft must be a wee bit worried, because the eee has just launched in Japan with Windows XP pre-installed (the original model comes with instructions for installing XP, but you need a valid installation disk and another PC with a CD drive to do so). I don’t really understand why anyone would want to; as delivered the machine only has 512Mb of RAM, and runs very nicely with Linux, whereas if you want anything like acceptable performance with XP you are going to have to void the warranty by installing more memory.

But some people seem to think they should be able to do everything they could do on a heavy, bulky, 15″ notebook PC on this. It’s only got a 7″ screen for heaven’s sake; what on earth is the point of trying to run Photoshop on it? For me its role is definitely that of a supplementary PC, not a desktop replacement. It’s a huge improvement on the slow, clunky Dell laptop we lug around whenever we travel. The 15-second boot time is particularly appreciated; it means you can quickly switch it on to check something, then switch it off again to conserve the battery (battery life without wifi switched on is about three hours; slightly disappointing but over twice as long as the Dell manages). Resuming from sleep mode is even faster. Plenty of thought has been put into keeping the weight down; it also has a relatively small power adapter, similar to a mobile phone one, not the “brick” you usually get with laptops. And it’s surprisingly robust; you’d expect something as cheap as this to feel flimsy, but it doesn’t.

The one thing I don’t like about it is the small trackpad and very stiff mouse button. I don’t like trackpads much anyway, and even increasing the sensitivity doesn’t seem to help. It feels as if it’s going to be the first thing to break. Using a mouse or trackball that weighs half as much as the PC doesn’t seem to make sense, so I’ve ordered a dinky little Targus mouse for it.

We built Corbières Web almost exactly ten years ago, when we first moved to France. The primary aim was to have a site we could put in the portfolio of our budding web development company. We had a wonderful time travelling around the area taking hundreds of photos and discovering all sorts of out-of-the-way places. And we landed our first large contract as a direct result of someone seeing Corbières Web. As the first website dedicated to the area, it built up a fair amount of traffic and even won an award from the Comité Régional de Tourisme. So it certainly wasn’t a waste of time.

Then we got busy and the site got pushed so far away from the stove it wasn’t even anywhere near the back burner. I added links to it occasionally, when people emailed me and asked, and we added a few pages to it for local businesses, for a small charge. But the last time the design was touched was in 1999, and it was beginning to look a bit embarrassing. It wasn’t just the surface appearance that was old-fashioned; the code was a mess of font tags, nested tables, and invalid HTML. And this mass of 150 or so static pages was time-consuming to update, so it just didn’t get done.

I started converting it to use a CMS about a year ago in order to make updates easier, but once again didn’t have the time to complete the job. But then thanks to an online CSS workshop class he was taking, Steve picked it up as a challenge for his final project. The old design was completely scrapped and he came up with a classy new design that is valid XHTML Strict. We merged this with my work on the CMS and were able to launch the converted site within a week.

One of the challenges of the site was that it is bilingual English-French, and each page linked to its equivalent in the other language. Using SPIP for the content management means that you can easily link different language versions of the same content so that links to translations appear automatically, and when visitors choose which language they want to view the site in, that choice is automatically retained. This is the third SPIP site we’ve done, and the more I use SPIP the more impressed I am with it. Its syntax for “squelettes” (templates) and “boucles” (loops) takes a bit of getting used to, but it’s very powerful and I haven’t yet found anything I couldn’t do — even if some things require a fair amount of fiddling to get right. The documentation is superb, some of the best I’ve seen for an open-source web application, and spip-contrib is a good source of extra tips.

It’s always a real headache manipulating dates between PHP and MySQL, because PHP’s date functions assume Unix timestamps, while MySQL has its own internal date format. They both have excellent built-in functions for handling dates, but they are fundamentally incompatible. I’ve torn my hair out before now trying to manipulate dates between the two, because pretty well every application I write needs to do date arithmetic.

Well, duh, I don’t know why I didn’t think of this before, but MySQL has a UNIX_TIMESTAMP function which sorts it all out for you by converting a MySQL date to a timestamp. Simon Willison explains it, so I don’t need to. So easy when you know how!

About the only reason I ever boot into Windows on the spare PC nowadays is because I need to use Enterprise Manager or Query Analyser to manage a SQL Server database. Today it was inconvenient to reboot, because I was in the middle of doing a lot of printing. So I googled “Linux SQL Server client” and came across sqsh. Installation and set up sounded a wee bit complicated (required compiling from source), but doable, so I put it on … the back burner, with a reminder to myself to do it sometime over the next week or so.

Then later on I happened to be sitting at the Mepis PC, so I pulled up Synaptic and typed sqsh into the search field. Hey presto! Two clicks and it was installed. “Still,” I thought, “I’m bound to have to fiddle about configuring it.”

Undeterred, I typed
sqsh -Umyusername -Pmypassword -Smyservername
at the shell prompt, and a sqsh prompt appeared. If Linux doesn’t give you an error message then nothing has gone wrong. So:
use mydatabasename
go

Still no error!
SELECT * FROM mylittletable
and there were the results! Fantastic — if possibly not all that secure when used remotely :-) Highly recommended if you need occasional access to a SQL Server or Sybase database from Linux.

Next Page »