Skip to content

Blog

Preventing numeric overflow in SAS

An interesting problem at work a while ago came about when a colleague was trying to perform a calculation on two numbers but instead of getting back the result the program was returning a NULL value. It turns out that the reason for this is that the number was so big that his machine was not able to handle it. Not ideal. So how can we pre-empt this and ensure that the calculation that we want to do is achievable within our environment?

Extract all machines associated with a SAS environment

Something that, certainly for large SAS deployments, may be across multiple tiers is having the ability to work out what machines you have in the environment and have been registered in the Metadata Server. This could be useful in a number of circumstances such as for a health check application which uses remote sign-on. It might cycle through all of your hosts to check if a session can be started.

Find libraries of a particular type and reassign them to improve job performance

I recently came across a situation at work where I was getting some performance issues with a program because of the way it had been written to find some libraries that it needed. What was happening was that if you have a number of Teradata libraries assigned in your SAS session and you use sashelp.vslib to query what libraries you have assigned you will see that SAS goes off an queries the Teradata dbc.tables table for information about the tables SAS knows about. If there are lots and/or if these tables are large, then you could see a significant drop in the performance of your job while this exercise takes place.

Raspbmc clock problem

OS cannot seem to access the hwclock:

pi@raspbmc:/etc/init.d$ sudo /sbin/hwclock -r --debug
hwclock from util-linux-ng 2.17.2
hwclock: Open of /dev/rtc failed, errno=2: No such file or directory.
No usable clock interface found.
Cannot access the Hardware Clock via any known method.
pi@raspbmc:/etc/init.d$ ls -l /dev | grep rtc pi@raspbmc:/etc/init.d$

This is what it looks like from my Ubuntu box:

chris@q2server:/media/external-ma/Music$ sudo /sbin/hwclock -r --debug
[sudo] password for chris:
hwclock from util-linux-ng 2.17.2
Using /dev interface to clock.
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2012/07/13 16:38:50
Hw clock time : 2012/07/13 16:38:50 = 1342193930 seconds since 1969
Fri 13 Jul 2012 16:38:50 BST  -0.236127 seconds
chris@q2server:/media/external-ma/Music$ ls -l /dev | grep rtc
lrwxrwxrwx 1 root root           4 2012-02-25 15:38 rtc -> rtc0
crw-rw---- 1 root root    254,   0 2012-02-25 15:38 rtc0
chris@q2server:/media/external-ma/Music$

I am going to write a small script to check a ntp server (probably a few) for current date/time.

TVMonkey 0.4.1 is here!

TV Monkey 0.4.1 is now available to download. You can read more about what the new version contains on the TVMonkey page. This release contains a new feature and a number of bug fixes.

You can download 0.4.1 here.

Linux random number generation: /dev/random vs /dev/urandom

I had a problem at work a while ago which appeared again last week where some stuff was taking ages to run through. I found a useful note which explained that the reason for this slowness is because of the encryption type that I was using and the fact that this was using /dev/random for its random number generation and it suggested instead to use /dev/./urandom. This helped resolve the problem but I had no clue why. In this post I'll explain why /dev/urandom is faster than /dev/random, but not as secure.

TVMonkey 0.4.0 is here!

TV Monkey 0.4.0 is now available to download. You can read more about what the new version contains on the TVMonkey page but a couple of highlights are:

  • TVMonkey can now be setup and configured via the web interface
  • Added support for multiple XBMC libraries
  • TV shows can now be added via the web interface

You can download version 0.4.o here.

Hiding and preventing :2eDS_Store files on Linux

If you have ever accessed your Linux box from a Mac via the finder then you may have seen that when you have subsequently been browsing your linux box via the command line you see that in every folder you visit you find a :2eDS_Store file. These files are created by the finder and store the users preferences for viewing that folder. There are a couple of ways that you can disable/hide the creation of these files.