Technology Tales

Adventures in consumer and enterprise technology

An option for when BBC's iPlayer will not allow you to "Listen Again"

14th June 2008

Following my move to Firefox 3, the BBC's iPlayer became problematical again. While I eventually sorted it after a fashion, I am noting an option for the frustrated before talking more about that. Finding the links to the ram files for the BBC's Listen Again service can be a nightmare because of the Beeb's reliance on JavaScript to cloak things up, so it's useful to find somewhere where things have been deconvoluted for us. That's The Beebotron. It's really meant for users of the mobile internet, yet it serves well for those times when a mismatch between Firefox and RealPlayer on Linux derails the more usual way to do things.

Better font display in Firefox 3 on Ubuntu

12th June 2008

Now that all bar one of the Firefox plugins that I use have been updated to work with it, I have finally jumped ship to 3 from 2.0.x. The move wasn't without its travails, though. For one thing, Google Toolbar stopped working, and I resorted to Googlebar Lite instead for my needs. Apart from that, the only other irritation has been the appearance of fonts in the new version.

In Firefox 2, it would seem that I was getting away without tweaking my system settings to be their most optimum. With 3, I could do that no longer because of an irritating and pervasive fuzziness that particularly afflicted k's and w's. The way out of this turned out to involve changing my Appearance Preferences (Preferences > Appearance from the System menu). The required attention was focussed on the Fonts tab, whereupon the Details button was brought into use.

Appearance Preferences

In the resulting dialogue box, smoothing was set to "Subpixel (LCDs)" and hinting to "Slight". Closing down everything after making the required selections and a restart of Firefox was all that was needed to improve matters and more completely make myself at home with Firefox 3.

Font Rendering Details

Useful keyboard shortcuts for managing the window sizes of Windows applications

9th June 2008

Maximising and minimising windows is all part and parcel of using window-based user interfaces, so it's nice to know that there are keyboard shortcuts that reduce the need to use your mouse all the time. Here are a few that work on Windows:

Alt+Space+N   Minimise

Alt+Space+X   Maximise

Alt+Space+R   Restore (set to default)

Transferring data between SAS and R

5th June 2008

A question regarding the ability to transfer of data between SAS and R set me off on a spot of investigation a while back, and I have always planned to share the results of my labours. Once I managed to locate the required documentation, things became clearer with further inspection. Functions from the foreign package seem to offer the most from the data import and export point of view, so they're what I'll be featuring in this posting.

Here, I am starting with importing, and using the read.ssd function makes life so much easier for getting SAS data into R. When I discovered that the foreign package may not be loaded by default, that could be determined easily using the following command:

search()

If package:foreign isn't in the list, then you need to issue the following function call:

library(foreign)

Of course, if the foreign package isn't installed, none of this will work. It should live in the library sub-folder of the main R installation directory, but if it isn't there, then downloading the relevant binary package from CRAN is in order. Assuming that all is installed, then a command like the following will perform the needful:

read.ssd("c:/data","data1",sascmd="C:/Program Files/SAS Institute/SAS/V8/sas.exe")

This creates a temporary SAS program that converts the SAS data set into a transport file for reading by another R function that is called in the background, read.xport. From my experience, it all seems to work fairly seamlessly.

To get data out of R and into SAS is a multi-stage process, even with the foreign package. While there are other ways, using the write.foreign seems more useful than most. Here is an example function call:

write.foreign(data1,"C:/test.txt","C:/test.sas",package="SAS",dataname="data1",validvarname="V7")

While no SAS data sets are created at this stage, a text file is generated along with a SAS program for converting it into a data set. Running the SAS program is a separate step that follows the creation of the two files. Even if it is less streamlined than read.ssd, write.foreign does make it easier to transfer data into SAS than having to write a program from scratch to read in write.table output.

In summary, R can neither read nor write SAS data sets by itself, so you need SAS installed to really make things happen. SAS gets called by read.ssd and I feel that it would be better if was called by write.foreign also rather than a SAS program generated for execution later on. Even so, it is good to see some custom functionality being provided that makes life easier. There's also the hmisc package, but my experiences while working with that on S-Plus have been such that it compares less favourably with foreign on the reliability front. Saying that, things may have changed since I last tried it.

SAS Data Step Hash Objects and Memory

3rd June 2008

Using hash objects in SAS data step code offers some great advantages from the speed point of view; having a set of data in memory rather than on disk makes things much faster. However, that means that you need to keep more of an eye on the amount of memory that's being used. The first thing is to work out how much memory is available, and it's not necessarily the total amount installed on the system or, for that matter, the amount of memory per processor on a multiprocessor system. What you really need is the number, in bytes, that is stored in the XMRLMEM system option and here's a piece of code that'll do just that:

data _null_;
    mem=getoption('xmrlmem');
    put mem;
run;

The XMRLMEM is itself an option that you can only declare in the system call that starts SAS up in the first place, and there are advantages to keeping it under control, particularly on large multi-user servers. However, if your hash objects start to exceed what is available, here's the sort of thing that you can expect to see:

ERROR: Hash object added 49136 items when memory failure occurred.
FATAL: Insufficient memory to execute data step program. Aborted during the EXECUTION phase.
NOTE: The SAS System stopped processing this step because of insufficient memory.
NOTE: SAS set option OBS=0 and will continue to check statements. This may cause NOTE: No observations in data set.

Those messages are a cue for you to learn to keep those hash objects and to only ever make them as large as your memory settings will allow. Another thing to note is that hash objects are best retained for rather fixed data volumes instead of ones that could outgrow their limits. There's a certain amount of common sense in operation here, but it may be that promoters of hash objects don't mention their limitations as much as they should. If you want to find out more, SAS has a useful paper on their website and their Knowledge Base has more on the error messages that you can get.

Cleaning up Ubuntu

1st June 2008

Uninstalling software still leaves any dependencies that came with them in place, so a quick way to get rid of any detritus is always useful. Here's a command that achieves this in a painless manner:

apt-get autoremove

Just say yes to what it suggests, to allow it on its way.

Some nice things coming through...

22nd May 2008

While everyone is making good use of WordPress 2.5.x, development continues apace for future releases of the popular blogging platform and there are some goodies coming through on the functionality front. Google Gears are being brought into play for speeding up the administration dashboard; this started out being more prominent before being made more unobtrusive. The other big change has been an overhaul of the theme gallery and, if the theme is compatible, an overview facility has been added too. So WordPress is being tweaked and improved in the background to make 2.6 an interesting release.

A reasonable requirement of an IDE

20th May 2008

I have been having a play with NetBeans IDE Early Access for PHP and, while it has a lot to offer, one impression remains uppermost in my mind: it is so slow. While I might have a project with many files in it, start-up takes an age because of project checking. Other functionality such as text searching is far from speedy either. The sluggishness probably arises from this release being very early in its life cycle, and it reminds me of how slow older versions of the Java IDE were, even if this is slower. For PHP development, I'll be giving NetBeans a while to mature before taking another look at it.

On a similar note, I recently dispatched Quanta Plus from my system for sluggish start-ups and will not return to it because other alternatives such as Bluefish and Eclipse PDT fit my needs much better. I like my editors to be slick and responsive, and Quanta has been around long enough for any slowness to be knocked out of it. However, I get the feeling that the extras have added bloat, while I expect any additional functionality that I never use not to get in my way. It is for the latter reason that I was always able to get on with Dreamweaver and even run it on Ubuntu using the WINE library. If I really wanted a stripped out yet functional editor, Gedit would do most of what I need - it colour-codes syntax for a variety of languages for a start - but it's always handy to have a file system explorer window incorporated and I value any syntax checking and auto-completion as well. So, it looks as if Eclipse and Bluefish could be serving my needs for a while to come, alongside so use Dreamweaver for online editing of website files.

VMware Workstation in full screen mode hobbles my keyboard

14th May 2008

Recently, I have encountered an odd situation following my recent upgrade to Ubuntu 8.04: when I use VMware Workstation to run Windows XP in full screen mode, the keyboard no longer acts as it should. For instance, the Caps Lock and Num Lock keys stop working, as does the Shift key. Logging out and back in again is the least that's needed to set things right, but there has to be a better way to resolve the problem. While I am not saying that it's limited to the scenario where I saw it happen, it's still very odd behaviour. If you have a solution, please let me know. Of course, I'll keep you posted if I find one. Meanwhile, I'll be avoiding full screen mode with VMware as much as I can.

Update 1:

I have done a spot of digging on this one since and gained the impression that there might be a conflict between VMware and the version of X.org Server that comes with Ubuntu. A restorative trick that I have seen suggested is to issue the following command in a terminal, replacing "gb" with your own locale, but I have yet to see if it works:

setxkbmap -rules xorg -layout "gb"

In any case, it looks as if it is not a permanent fix but just a way to keep working without resorting to system restarts, logging off and back on, etc.

Update 2:

I can now verify that the command quoted above works for me. Of course, it would better to find a permanent fix and even better for the behaviour never to occur at all. For now, though, any fix is better than none whatsoever.

System error codes for Windows

9th May 2008

Windows system error codes can be indecipherable, so it's useful to have a list. Microsoft has one on its Microsoft Learn website that may help. However, the decodes may not as explicit as I would like, but they're better than nothing when you don't get anything other than the number.

  • The content, images, and materials on this website are protected by copyright law and may not be reproduced, distributed, transmitted, displayed, or published in any form without the prior written permission of the copyright holder. All trademarks, logos, and brand names mentioned on this website are the property of their respective owners. Unauthorised use or duplication of these materials may violate copyright, trademark and other applicable laws, and could result in criminal or civil penalties.

  • All comments on this website are moderated and should contribute meaningfully to the discussion. We welcome diverse viewpoints expressed respectfully, but reserve the right to remove any comments containing hate speech, profanity, personal attacks, spam, promotional content or other inappropriate material without notice. Please note that comment moderation may take up to 24 hours, and that repeatedly violating these guidelines may result in being banned from future participation.

  • By submitting a comment, you grant us the right to publish and edit it as needed, whilst retaining your ownership of the content. Your email address will never be published or shared, though it is required for moderation purposes.