No disruption here
12th November 2008It was just over a year ago that I gave Linux a go after Windows XP gave me a torrid time of it. Since then, I have been able to work more than happily with it and have picked a few new and useful tricks along the way too. All in all, it has been a good experience and I have been able to resolve most of the issues that I have seen. The various Ubuntu upgrades along the way have been taken in their stride, too. Version 7.04 was the first one, with version 7.10 coming immediately afterwards. 8.04 went in equally seamlessly as did 8.10. Some may decry what they might perceive as the glacial nature of any changes, but the flip-side is that change can cause disruption, so my vote is for the more gradual approach, whatever others might think. In line with this, I haven't noticed too many changes in Ubuntu's latest release, and any that I have seen have been of the pleasant kind. Saying that, it's so much better than the contortions surrounding Windows upgrades. All in all, Linux is being kind to me and I hope that it stays that way.
On Photoshop Elements 7
10th November 2008Lately, I have been playing around with Photoshop Elements 7, doing the same sort of things that I have been doing with Elements 5. Reassuringly, I can still find my way around, even if the screen furniture has been moved about a little. My Pentax K10D is recognised, and I am able to set the white balance to get sensible results. On the images that I was testing, things started to look too warm in the Cloudy and Shade settings, but that's all part and parcel of processing photos taken in early November. The results of my exertions look decent enough, and you can see them in a post on my hillwalking blog.
While I realise that Adobe has been promoting the ability to easily airbrush unwanted objects from images and enhance blue skies, there's no point having all of that if functionality available in previous versions does not work as expected. Thankfully, this is largely the case, albeit with a few niggles. Since I have been working with the new Elements on a Windows XP SP3 virtual machine running in VirtualBox 2.04 on Ubuntu 8.10, I wonder if that contributed in any way to what I encountered. One gigabyte of memory is allocated to the VM. The files were stored in the Ubuntu file system and accessed using VirtualBox's functionality for connecting through to the host file system. File access was fine, apart from the inability to directly open a file for full editing from the Organiser, something that I have doing very happily with Elements 5. In addition, I noted a certain instability in the application and using the hand tool to get to the top left-hand corner of an image sent the thing into a loop, again something that Elements 5 never does. Otherwise, things work as they should, even if I saw points to the need for an update to correct any glitches like these, and I hope that there is one. For now, I will persevere and see if I can make use of any additional functionality along the way.
Remove Revisions 2.2
3rd November 2008There is already a post on here devoted to version 1.0 of this plugin, which clearly tells you what it does. The new version will work with the forthcoming WordPress 2.7 (itself a release that's had a development cycle with such upheavals that it would make you want to watch from the relative safety of the sidelines) and has been made to be a little more user-friendly in its actions; in fact, it behaves more like any other plugin now.
SAS Macro and Dataline/Cards Statements in Data Step
28th October 2008Recently, I tried code like this in a SAS macro:
data sections;
infile datalines dlm=",";
input graph_table_number $15. text_line @1 @;
datalines;
"11.1 ,Section 11.1",
"11.2 ,Section 11.2",
"11.3 ,Section 11.3"
;
run;
While it works in its own right, including it as part of a macro yielded this type of result:
ERROR: The macro X generated CARDS (data lines) for the DATA step, which could cause incorrect results. The DATA step and the macro will stop executing.
A bit of googling landed me on SAS-L where I spotted a solution like this one that didn't involve throwing everything out:
filename temp temp;
data _null_;
file temp;
put;
run;
data sections;
length graph_table_number $15 text_line $100;
infile temp dlm=",";
input @;
do _infile_=
"11.1 ,Section 11.1",
"11.2 ,Section 11.2",
"11.3 ,Section 11.3"
;
input graph_table_number $15. text_line @1 @;
output;
end;
run;
filename temp clear;
The filename statement and ensuing data step creates a dummy file in the SAS work area that gets cleared at the end of every session. That seems to fool the macro engine into thinking that input is from a file and not the CARDS/DATALINES
method, to which it takes grave exception. The trailing @'s hold an input record for the execution of the next INPUT statement within the same iteration of the DATA step so that the automatic variable _infile_
can be fed as part of the input process in a do block with the output statement ensure that all records from the input buffer reach the data set being created.
While this method does work, I would like to know the underlying reason as to why SAS Macro won't play well with included data entry using DATALINES
or CARDS
statements in a data step, particularly when it allows other methods that using either SQL insert statements or standard variable assignment in data step. I find it such a curious behaviour that I remain on the lookout for the explanation why it is like this.
Harnessing the power of ImageMagick
26th October 2008Using the command line to process images might sound senseless, only for the tools offered by ImageMagick certainly prove that it has its place. I have always been wary of using bulk processing for my digital photo files (some digitised from film prints with a scanner) but I do agree that some of it is needed to free up some time for other more necessary things. With this in mind, it is encouraging to see the results from ImageMagick and I can see it making a major difference to how I maintain my online photo gallery.
For instance, making thumbnail images for the gallery certainly seems to be one of those operations where command line bulk processing comes into its own, and ImageMagick's own convert command is heaven sent for this one. For resizing images, all that's needed is the following:
convert -resize 40% input.jpg output.jpg
Add a spot of further shell scripting and even a dash of Perl and the possibilities for this sort of thing become clearer, and this is but the pinnacle of the proverbial iceberg. The -rotate
switch will do what the name suggests, while there are a whole plethora of other options on tap. So long as you have Ghostscript on your system, conversion of graphics to Postscript (and Encapsulated Postscript too) and PDF files is possible with the -page
option controlling the margin around the image itself in the resulting outputs. Unfortunately, portrait is the sole orientation on offer, yet a bit of judicious post-processing will turn things around. Here's a command that'll do the trick:
convert -page 792x612+72+72 input.png ps2:output.ps
For retrieving image metadata like its resolution and size, the identify command comes into play. The -verbose
option invokes the output of all manner of image metadata, so using grep
or egrep
is perhaps advisable, especially for bulking processing with the likes of Perl. Having the ability to stream image metadata makes loading databases like MySQL less of a chore than the manual data entry that has been my way of doing things until now.
Alt-Click problems in Ubuntu-hosted VirtualBox Windows guests
24th October 2008The Alt-Click keyboard-mouse combination is a very common way of working with various flavours of Adobe Photoshop. So, it was with some frustration that I couldn't use it while working in Photoshop Elements (still on version 5, by the way; the temptation of newer versions has not struck) on a Windows XP guest in VirtualBox on my main Ubuntu system. A quick google later and a proposed solution was for me a surprising one: going to System -> Preferences -> Windows
on the host OS and changing the setting of the Movement Key from Alt to Super (Windows key on many keyboards). That was enough to set all in order. It appears that a setting on the host operating system was preventing a piece of software running on the guest from behaving as expected. That's all in the past now that I have got my clone brush functionality back and can work as normal again.
Another way to control line breaks in (X)HTML
22nd October 2008While you can use <br /> tags, there is another way to achieve similar results: the or non-breaking space entity. Put one of them between two words, and you stop them getting separated by a line break; I have been using this in the latest design tweaks that I made to my online photo gallery. Turning this on its head, if you see two words together acting without regard to normal wrapping conventions, then you can suspect that a non-breaking space could be a cause. There might be CSS options too, but their effectiveness in different browsers may limit their usefulness.
Copying only updated and new files
20th October 2008With Linux/UNIX, the command line remains ever useful and allows you to do all manner of things, including file copying that only adds new files to a destination. Here's a command that accomplishes this on Linux:
cp -urv [source] [destination]
The u
switch does the update while r
ensures recursion (by default, cp
only copies files from a source directory and not anything sitting in subfolders) and v
tells the command to tell the user what is happening.
Though buried and hardly promoted, Windows also has its command line and here's what accomplishes a similar result:
xcopy /d /u [source] [destination]
Anything's better than having to approve or reject every instance where source and destination files are the same or, even worse, to overwrite a file when it is not wanted.
Getting VirtualBox 2.02 working on Ubuntu 8.04
10th October 2008Having run VirtualBox OSE (1.5.6) for a while now, I succumbed to the idea of grabbing the latest version from the VirtualBox website and putting it on my main Linux box. The idea of having 64-bit support proved irresistible, and I did get OpenSolaris to start, even if its installation on a VMware VM meant that it stalled along the way.
To accomplish this, I needed to rid my system of all traces of the old version before 2.02 would install, with a system reboot being needed before the process of installation fully completed. Then, I fired up a Windows XP virtual machine, only for it to completely freeze. The hint as to the cause came when I opened up the VM's settings for the following message to greet me:
Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND). The service might be not installed on the host computer.
While it didn't stop things in their tracks when it came to accessing and changing those settings, it was a vital hint for working out what was happening. It now seems that a problem with USB port support was the cause. The fact that issuing the following command got things going for me appeared to confirm the prognosis.
sudo mount -t usbfs /sys/bus/usb /proc/bus/usb/
Of course, not wanting to have to issue the same command over and over again, I was after a more permanent solution. That involved adding the following lines to /etc/fstab
:
#usbfs
none /proc/bus/usb usbfs devgid=46,devmode=664 0 0
A reboot later, that change apparently was enough to settle the matter, and I am now able to run VM's as before. Seamless application mode is going well (the host key - right Ctrl by default - + L key combination is sufficient to toggle the setting on and off), even if it has a few quirks. Two that I have spotted include the usual Ubuntu screen furniture disappearing when maximised windows are displayed, and the Windows taskbar appearing when two or more applications are running. That last one may be just as well because individual applications don't get an Ubuntu taskbar icon each, which is perhaps an idea for a future enhancement. Updating Guest Additions in a VM's doesn't seem to change the behaviour, but any imperfections are curiosities rather than complaints given how well things run anyway, unless you decide to confound matters by closing and minimising windows, but resolving that is just a toggle away. It's all looking good so far...
Forcing Ubuntu (and Debian) to upgrade to a newer distribution version
8th October 2008Ubuntu is usually good at highlighting the existence of a new version of the distribution through its Update Manager. That means that 8.10 should be made available to you at the end of the month, so long as you have sorted the relevant setting for 8.04 to realise what has happened. That lives in System > Administration > Software Sources > Updates. If you haven't done that, then 8.04 will continue regardless, since it is a long term supported release.
Otherwise, it's over to the command line to sort you out. One of the ones below will do, with the first just carrying out a check for a new stable version of Ubuntu and the second going all the way:
sudo update-manager -c
sudo update-manager -p
if you are feeling more adventurous, you can always try the development version and this checks for one of those (I successfully used this to try out the beta release of Intrepid Ibex from within a Wubi instance on my laptop):
sudo update-manager -d
Neither of the above are available on Debian, so they seem to be Ubuntu enhancements. That is not to imply that you cannot force the issue with Debian; it's just that the more generic variant is used and, unless, you have gone fiddling with visudo
, you will need to run this as root (it works in Ubuntu too):
update-manager --dist-upgrade