Dealing with variable length warnings in SAS 9.2
11th January 2012A habit of mine is to put a LENGTH
or ATTRIB
statement between DATA and SET statements in a SAS data step to reset variable lengths. By default, it appears that this triggers truncation warnings in SAS 9.2 or SAS 9.3 when it didn't in previous versions. SAS 9.1.3, for instance, allowed you to have something like the following for shortening a variable length without issuing any messages at all:
data b;
length x $100;
set a;
run;
In this case, x could have a length of 200 previously and SAS 9.1.3 wouldn't have complained. Now, SAS 9.2 and 9.3 will issue a warning if the new length is less than the old length. This can be useful to know, but it can be changed using the VARLENCHK
system option. Though the default value is WARN, it can be set to ERROR if you really want to ensure that there is no chance of truncation. Then, you get error messages and the program fails where it normally would run with warnings. Setting the value of the option to NOWARN
restores the type of behaviour seen in SAS 9.1.3 and versions before that.
The SAS documentation says that the ability to change VARLENCHK
can be restricted by an administrator, so you might need to deal with this situation in a more locked down environment. Then, one option would be to do something like the following:
data b;
drop x;
rename _x=x;
set a;
length _x $100;
_x=strip(x);
run;
While It's a bit more laborious than setting the VARLENCHK
option to NOWARN
, the idea is that you create a new variable of the right length and replace the old one with it. That gets rid of warnings or errors in the log and resets the variable length as needed. Of course, you have to ensure that there is no value truncation with either remedy. If any is found, then the dataset specification probably needs updating to accommodate the length of the values in the data. After all, there is no substitute for getting to know your data and doing your own checking should you decide to take matters into your hands.
There is a use for the default behaviour, though. If you use a specification to specify a shell for a dataset, then you will be warned when the shell shortens variable lengths. That allows you to either adjust the dataset or your program. Also, it provides additional information when you get variable length mismatch warnings when concatenating or merging datasets. There was a time when SAS wasn't so communicative in these situations and some investigation was needed to establish which variable was affected. Now, that has changed without leaving the option to work differently if you so do desire. Sometimes, what can seem like an added restriction can have its uses.
Trying out Irish Mobile Broadband
2nd January 2012Over the course of a year, I end up visiting Ireland a few times, so I decided to invest in a Meteor PAYG broadband stick to see how I'd get on with it. For €20, you can get a 30-day pass with 7.5 GB downloading capacity, a more generous offer than you'd get with some UK mobile networks (T-Mobile really comes to mind here). Signal strength was strong wherever I tried it too with 3G being available so long as you are in the right place with EDGE being the lowest that I got otherwise. Download speeds are good too so it turned out to be a good investment of €30 to get the Huawei E173 USB dongle (I had a T-Mobile one of these before that no longer works, so I am keeping an eye on reliability with this one; though the design seems a little different, I am getting OK so far) and €20 of credit that comes with it. After all, anything's better than the punitive roaming rates that UK providers charge.
Yet another useful Windows shortcut
11th December 2011During the week, I needed to go to a client to upgrade the laptop that they'd given me for doing work for them. The cause was their migration from Windows XP to Windows 7. Office 2010 also came with the new set-up, and they replaced the machines with new ones too. As part of doing this, they carried out upgrade training and this is when I got to learn a thing or two.
While I may have been using Windows 7 since the beta releases first were made available, I am under no illusions that I know all there is to be known about the operating system. Included among the things of which I wasn't aware was a shortcut key combination for controlling display output from the HP laptop that I'd been given. This is the Windows key + P. This brings up a dialogue screen from which you can select the combination that you need and that includes extending the display across two different screens, such as that of the laptop and an external monitor. Going into the display properties will fine tune things such as what is the main display and the placement of the desktops; there's no point in having Windows thinking that the external screen is to your left when in fact it is on the right.
Another interesting shortcut is the Windows key + TAB. This affects the Aero application view and repeating the combination cycles through the open applications, or you can use a mouse wheel to achieve the same end. With ALT + TAB and the taskbar still about, this might appear more of a curiosity, but some may still find it handy, so I've shared it here too.
All in all, it's best never to think that you know enough about something because there's always something new to be learned, and it's always the smallest of things that proves to be the most helpful. With every release of Windows, that always seems to be the case and Windows 8 should not be any different, even if all the talk is about its Metro interface. A beta release is due in the spring of 2012, so we'll have a chance to find out then. You never can stop learning about this computing business.
A little more freedom
10th December 2011A few weeks ago, I decided to address the fact that my Toshiba laptop have next to useless battery life. The arrival of an issue of PC Pro that included a review of lower cost laptops was another spur for looking on the web to see what was in stock at nearby chain stores. In the end, I plumped for an HP Pavilion dm4 from a branch of Argos. In fact, they seem to have a wider range of laptops than PC World!
The Pavilion dm4 seems to come in two editions and I opted for the heavier of these, though it still is lighter than my Toshiba Equium as I found on a recent trip away from home. Its battery life is a revelation for someone who never has got anything better than three hours from a netbook. Having more than five hours certainly makes it suitable for those longer train journeys away from home, and I have seen remaining battery life being quoted as exceeding seven hours from time to time, though I wouldn't depend on that.
Of course, having longer battery life would be pointless if the machine didn't do what else was asked of it. It comes with the 64-bit of Windows 7 and this taught me that this edition of the operating system also runs 32-bit software, a reassuring discovering. There's a trial version of Office 2010 on there too and, having a licence key for the Home and Student edition, I fully activated it. Otherwise, I added a few extras to make myself at home, such as Dropbox and VirtuaWin (for virtual desktops as I would in Linux). While I was playing with the idea of adding Ubuntu using Wubi, I am not planning to set up dual booting of Windows and Linux like I have on the Toshiba. Little developments like this can wait.
Regarding the hardware, the CPU is an Intel Core i3 affair and there's 4 MB of memory on board. The 14" screen makes for a more compact machine without making it too diminutive. The keyboard is of the scrabble-key variety and works well too, as does the trackpad. There's a fingerprint scanner for logging in and out without using a password, but I haven't got to check how this works so far. It all zips along without any delays, and that's all that anyone can ask of a computer.
There is one eccentricity in my eyes though: it appears that the functions need to be used in combination with the Fn
key for them to work like they would on a desktop machine. That makes functions like changing the brightness of the screen, adjusting the sound of the speakers and turning the Wi-Fi on and off more accessible. My Asus Eee PC netbook and the Toshiba Equium both have things the other way around, so I found this set of affairs unusual, but it's just a point to remember rather than being a nuisance.
Though HP may have had its wobbles regarding its future in the PC making business, the Pavilion feels well put together and very solidly built. The premium paid over the others on my shortlist seems to have been worth it. If HP does go down the premium laptop route as has been reported recently, this is the kind of quality that they would need to deliver to just higher prices. Saying that, is this the time to do such a thing with other devices challenging the PC's place in consumer computing? It would be a shame to lose the likes of the Pavilion dm4 from the market to an act of folly.
A new repository for GNOME 3 Extensions
6th December 2011Not before time, the GNOME project has set up a central website for GNOME Shell extensions. It seems to be in the hands of extension developers to make GNOME 3 more palatable to those who find it not to their taste in its default configuration. If you are using Firefox, installation is as easy as clicking the ON/OFF icon for a particular plugin on its web page and then selecting install in the dialogue box that pops up. Of all the browsers that you can use on GNOME, it seems to be Firefox that is the only one that has this ability at the moment.
Though the website may have the alpha legend on there at present, it works well enough so far, so I have had no hesitation in using it for those extensions that are of interest to me. This is an interesting development that deserves to stay, especially when it detects that a plugin is incompatible with your version of GNOME.
Currently, I use GNOME 3.2, and it pops up a useful menu for deactivating extensions when the desktop fails to load. That's a welcome development because I have had extensions crashing GNOME 3.0 on me and running the GNOME Tweak Tool on the fallback desktop often was the only alternative. GNOME 3 seems to be growing up nicely.
Getting Gnome Shell going for Fedora 16 running in VirtualBox
5th December 2011There are a number of complaints out there about how hard it is to get GNOME Shell running for a Fedora 16 installation in a VirtualBox virtual machine. As with earlier versions of Fedora, preparation remains a matter of having make
, gcc
and kernel-devel
(kernel headers, in other words). While I have got away with just those, adding dkms
(dynamic kernel module support) to the list might be no bad idea either. To get all of those instated, it is a matter of running the following command as root or using sudo
:
yum -y install make gcc kernel-devel dkms
The -y
switch ensures that any Y/N prompts that usually appear are suppressed and that the installation is completed. Just leave it out if you are inclined to get second thoughts. Another item that has been needed with a previous release of Fedora is libgomp
, but I haven't had to add this for Fedora 16 if I recall correctly.
Once those are in place, it is time to install the VirtualBox Guest Additions. Going to Devices > Install Guest Additions... mounts a virtual CD that can be used for the installation of the various drivers that are needed. To do the installation, first go to where the installer is located using the following command:
cd /media/VBOXADDITIONS_4.1.6_74713/
Note that this location will change according to the release and build numbers of VirtualBox, yet the process essentially will be the same aside from this. Once in there, issue the following command as root or using sudo:
./VBoxLinuxAdditions.run
Hopefully, this will complete without errors now with the precursor software that has been added beforehand. However, there is one more thing that needs doing, or you will get the GNOME 3 fallback desktop instead. It pertains to SELinux, an old adversary of mine that got in the way when I was setting up a web server on a machine running Fedora. It doesn't recognise the new VirtualBox drivers as it should, so the following command needs executing as root or using sudo
:
restorecon -R -v /opt
Doing this restores the SELinux contexts for the /opt
directories within which the VirtualBox software directories are found. The -R
switch tells it to act recursively and -v
makes it verbose. When it has done its work, hopefully successfully, it is time to reboot the virtual machine, and you should have a GNOME Shell desktop interface when you log in.
An in situ upgrade to Linux Mint 12
4th December 2011Though it isn't the recommended approach, I have ended up upgrading to Linux Mint 12 from Linux Mint 11 using an in situ route. Having attempted this before with a VirtualBox hosted installation, I am well aware of the possibility of things going wrong. Then, a full re-installation was needed to remedy the situation. With that in mind, I made a number of backups in the case of an emergency fresh installation of the latest release of Linux Mint. Apache and VirtualBox configuration files together with MySQL backups were put where they could be retrieved should that be required. The same applied to the list of installed packages on my system. So far, I haven't needed to use these, but there is no point in taking too many chances.
The first step in an in-situ Linux Mint upgrade is to edit /etc/apt/sources.list. In the repository location definitions, any reference to katya
(11) was changed to lisa
(for 12) and the same applied to any appearance of natty (Ubuntu 11.04) which needed to become oneiric (Ubuntu 11.10). With that done, it was time to issue the following command:
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
Once that had completed, it was time to add the new additions that come with Linux Mint 12 to my system using a combination of apt-get, aptitude and Synaptic; the process took a few cycles. GNOME already was in place from prior experimentation, so there was no need to add this anew. However, I need to instate MGSE to gain the default Linux Mint customisations of GNOME 3. Along with that, I decided to add MATE, the fork of GNOME 2. That necessitated the removal of two old libraries (libgcr0 and libgpp11, if I recall correctly, which will tell you what is causing any conflict) using Synaptic. With MGSE and MATE in place, it was time to install LightDM and its Unity greeter to get the Linux Mint login screen. Using GDM wasn't giving a very smooth visual experience and Ubuntu, the basis of Linux Mint, uses LightDM anyway. Even using the GTK greeter with LightDM produced a clunky login box in front of a garish screen. Configuration tweaks could have improved on this, but it appears that using LightDM and Unity greeter is what gives the intended setup and experience.
With all of this complete, the system seemed to be running fine until the occasional desktop freeze occurred with Banshee running. Blaming that, I changed to Rhythmbox instead, though that helped only marginally. While this might be blamed on how I upgraded my system, things seemed to have steadied themselves in the week since then. As a test, I had the music player going for a few hours and there was no problem. With the call for testing of an update to MATE a few days ago, it now looks as if there may have been bugs in the original release of Linux Mint 12. Daily updates have added new versions of MGSE and MATE, so that may have something to do with the increase in stability. Even so, I haven't discounted the possibility of needing to do a fresh installation of Linux Mint 12 just yet. However, if things continue as they are, then it won't be needed and that's an upheaval avoided should things go that way. That's why in situ upgrades are attractive, though rolling distros like Arch Linux (these words are being written on a system running this) and LMDE are more so.
Adding Software to Arch Linux from the AUR
3rd December 2011There are packages absent from the Arch Linux repositories that could come in useful. When you are after one of these, then it's time to search the Arch User Repository (AUR). In here, I have found the likes of Microsoft Core Fonts, Adobe Reader and Dropbox. While there may be others, these examples are what comes to mind as I write this. In time, it may be that packages make if from the AUR into the Arch community repository, but you have to use the former if you cannot wait.
Just search the AUR for what you want and download the compressed tarball (tar.gz
file) from the webpage where you find it. Then, I recommend extracting it to /tmp
where clearance at boot time means that you don't need to do it yourself. Then, go into the appropriate subfolder in /tmp
(acroread
for Adobe Reader, for instance) and issue the following command:
makepkg
This will attempt to create a package file where you are working for installation by pacman. If dependencies are absent, you will be told and these may need another AUR search in some cases, though most are included in the repositories. Once dependencies, have been sorted, just issue the makepkg
command again to create the xz
file that pacman needs to perform the installation. To do so, issue the following command from the same directory either as root or by using sudo if your user account has such privileges:
pacman -U *.xz
There is usually just one xz
archive in a package folder, so I have been taking the easy route of not looking up the name all the time. Of course, you can do that for safety if you like.
With pacman not looking at the AUR, you have to do more work to get upgrades to happen should you want to avoid without having to repeat the above process all the time. There is a package in the AUR called yaourt
that needs package-query from the same place as well. Before any of these, yajl
needs to be installed from one of the default repositories. Once yaourt
is in place, then the following does the updates for you:
yaourt -Syu --aur
Again, it might be best to run this as root or using sudo
though that gives messages from makepkg
about not running it as a privileged user. However, I reckon that those might need to be ignored. When I tried it, the Citrix update failed, though the Dropbox one succeeded. This experience might be worth bearing in mind. Saying that, I have found installing and updating software from the AUR not to be too onerous a process so far. Anything that gives a little more freedom only can be a good thing.
Removing the Guest Account Entry from Ubuntu 11.10 and Linux Mint 12 Login Screens
2nd December 2011Another feature of Ubuntu 11.10 and Linux Mint 12 is the appearance of a Guest Account entry on their login screens. Windows has had this feature for a while now, but it is easy to turn it off if you know where to look. Somehow, Ubuntu and Linux Mint haven't made it obvious as it could be. In both cases, you have to edit /etc/lightdm/lightdm.conf
and add the following line to the bottom of the file:
allow-guest=false
That removes the entry in question and could a little more security. On Ubuntu, there are lines in the file controlling the background image that you have for your login screen. In my experience, Linux Mint stores this in the greeter file referenced in lightdm.conf
and that's unity-greeter in my case, though, I mostly use GNOME 3 with only the occasional stint using the MATE desktop environment.
A little look at Windows 8
6th November 2011Even if it has been a little while, I have managed to set up a VirtualBox virtual machine to have a look at the Developer Preview of the next version of Windows, something that I and others continue to call Windows 8 though Microsoft has yet to confirm the name. When I tried the installation before, it failed on me, though that may have been due to having an earlier release of VirtualBox on my machine at that time. 4.1.14 has a preset for Windows 8 and I also happened to notice that it can create virtual hard disks that can be used with competitors like VMWare, Parallels and Virtual PC too. It's an interesting development, even if I am left wondering why you'd need to do that when VirtualBox runs on most platforms anyway.
To get back to Windows 8, the installation ran near enough without any intervention apart from stating the language you wanted to use, U.K. English in my case. On startup, the operating system presents you with a lock screen that you need to get out of the way so you can log in. It can be dragged out of your way, or you can double-click on it or use the carriage return key to get rid of it. Quite why someone thinks it's a good extra is a little beyond me, when a log in screen would suffice. Logging in gets you the new start menu or, as I prefer to think of it, screen. By default, there are a good few Metro apps installed, though I decided to rid myself of most of them.
Regarding those apps, one irritation could be that there isn't that obvious a way to switch away from them to something else. Thankfully, ALT+TAB does seem to work and it has the most instantaneous effect. Otherwise, using the Windows key or hovering over the bottom-left corner of the screen to get the menu that brings up the start screen. From the PC user's point of view, I could see this needing a little more thought because it took a little while for me to figure out what to do. Closing Metro apps isn't an option either unless you resort to the Task Manager to do so. Microsoft appears to want to leave them open from the point at which you start them until the PC is shut down. It's a design decision that leaves me unconvinced, though; thoughts of rogue apps running riot on a system come to mind. Then, a stop button could be handy.
There is no start menu as we have come to know it any more with the start screen replacing it. However, it is possible to limit what's on there to the software that you use most often and rearrange panels as you'd like them to be. Apart from hosting shortcuts for starting applications, it also acts as a task switcher like the task bar in Windows 7 and there is one of those in Windows 8 too when you jump to the desktop; handily, there's a panel for that too. Installing Firefox added a panel to the start screen, so a little thought has gone into such a common situation, and that's just as well. Still, there's more work to be done because, currently, there's no way of changing the background colour of the start screen without resorting to a hex editor or third party tools. Still, since you can pick your own picture for the lock screen, things are not all locked down on you.
A preview of IE 10 is included and, apart from the occasional artifact when displaying one of my websites, it seems to work well enough, as does Windows Explorer. However, aside from these and a smattering of Metro apps, the Developer Preview does feel barer than previous versions of Windows. However, it does appear that applications like Notepad, PowerShell and the Command Prompt are on there, yet you need to search for these. That also means that you need to know about them too, so I'd suggest a better way of browsing the applications that are available too. This is one of the weaknesses of Ubuntu's Unity interface, and you need to search in the Dash to find them. Just starting to type in the Metro start screen (and other screens too, it seems) in Windows does trigger the completion of a search box, much like what happens in the GNOME Shell Activities screen on systems with GNOME 3. While it's good to see good ideas being reused from elsewhere, Microsoft might do well to note that you still can browse lists of applications in GNOME 3 too.
Shutting down Windows 8 also is seemingly more convoluted than is the case with Windows 7. Logging off and then powering off from the log in screen is one approach, and that was my early impression of GNOME 3 too. With the latter, I later discovered a status menu plugin that added in the option where it was accessible or that using the ALT key when clicking the status menu when the plugin wouldn't work would do what I needed. Without logging off from Windows 8, you can do a shutdown using the sidebar that appears on selecting Settings from the menu that pops up on hovering near the bottom-left corner of the start screen or the Start button of the task bar of the desktop. Then, look for the power icon and select what you need from the menu that clicking on this icon produces. Of course, you may find that the ALT+F4 key combination when issued while on a clean desktop is the cleanest of all.
All in all, the Developer Preview of the next release of Windows looks fairly usable. That is not to imply that there aren't things that need changing. Aside from this being an early sight of what may be coming to us Windows users, it isn't unknown for Microsoft to roll back on a radical move to make it more palatable to the user community. After all, it has to watch how it treats the corporate market too. The strong possibility of there being alterations is one thought that needs to be shared with those who are inclined to lose their tempers at the moment and I have seen comments with unpleasant language out there on the web (none of that here, please, by the way). As for me, I like to look ahead to be forewarned about what's coming my way in the world of computing. What I have seen so far of the next Windows release is reassuring, though there are rough edges such as PC shutdown and Metro app switching, yet Microsoft cannot commit commercial suicide either, so these have to be fixed. It appears that the world of Microsoft operating systems is in flux, with the company's keeping a firm eye on the world of mobile computing, with tablets being a major concern. While others may disagree, I can see Windows 8 working well on conventional PC's and that's no bad thing.