Being a Safari subscriber, I found a pleasant surprise awaiting me in this month’s email newsletter: eBooks from SAS Publishing are now available on Safari. Having a quick look, I found a small but useful selection. Topics like the SQL procedure, the Macro language and Enterprise Guide caught my eye but there’s more than this on offer. It’ll be interesting to see where this leads…
Archive for May, 2007
Using SAS FILENAME statement to extract directory file listings into SAS
The filename statement’s pipe option allows you to direct the output of operating system commands into SAS for further processing. Usefully, the Windows dir command (with its /s switch) and the UNIX equivalent ls allow you get a file listing into SAS. For example, here’s how you extract the list of files in your UNIX home directory into SAS:
filename DIRLIST pipe ‘ls ~’;
data dirlist;
length filename $200;
infile dirlist length=reclen;
input buffer $varying200. reclen;
run;
Using the ftp option on the filename statement allows you to get a list of the files in a directory on a remote server, even one with a different operating system to that used on the client (PC or server), very useful for cases where cross-platform systems are involved. Here’s some example code:
filename dirlist ftp ‘ ‘ ls user=’user’ host=’host’ prompt;
data _null_;
length filename $200;
infile dirlist length=reclen;
input buffer $varying200. reclen;
run;
The PROMPT option will cause SAS to ask you for a password and the null string is where you would otherwise specify the name of a file.
Google Analytics
Furthering my excursions into things related to Google, I have been giving Google Analytics a whirl for my hillwalking and photo gallery website. Aside from the fact that it is updated once a day, it could have enabled me to eject WordPress plug-ins like Popularity Contest and FireStats getting the chop. As it happens, I also have a Google Analytics plugin installed but a little editing of the blog template that I have developed would get rid of that too.
That’s enough about WordPress plug-ins; let’s return to Google Analytics. It has all the usual stuff: who’s visiting, from where are they coming, what are they using to see your site, etc. In addition, it captures if they are coming back, how long they are staying on the site and how deep they are going. Bounce rate is another term that features heavily: it is when a user only goes to one page and then leaves. With a blog, this unfortunately seems to come out as a high figure and that is ironic given that the blog was meant to promote the online photo gallery; it has very much taken on a life all of its own. There’s more to the information from Google Analytics but it’s all useful stuff and I plan to make good use of it to improve how my site works.
Going overboard on blog plug-ins and widgets?
This whole Web 2.0 thing is producing an embarrassment of riches for those wanting to share their thoughts on the web without having to go to the effort of developing their own websites from scratch. A decade ago, Geocities was pioneering the idea of web communities but, without the infrastructure and tools that we enjoy today, it and its kind were ahead of their time.
In these blogging days, life is a lot simpler but that means that temptations exist. Temptations like those caused by garish animated GIF’s in the late nineties, a lame attempt to spice up otherwise dull websites. Returning to the present, it is plug-ins and widgets that could convey the excess.
With WordPress, the plug-ins are more “behind-the-scenes” sorts of affairs but it is so easy accumulate several for stopping comment spam and keeping an eye on web traffic, to name just two applications, and so on that you need to be careful that a bag of nails does not result. In fact, I am now considering the rationalisation of what I have got while the number remains in single figures.
WordPress 2.2 adds widgets to the list of temptations; WordPress.com already has these but the number is small and you can be sure that that will explode now that self-hosted WordPress blogs get the functionality. The trouble with these widgets is that you need to be adept with CSS so as not to end up with an eyesore akin to those seen a decade ago, though theme authors can help with this. I am not activating the widgets capability for my hillwalking blog because I have many other (better?) things to be doing.
Another thought on widgets: the tag cloud widget previously held in captivity at WordPress.com surely must now find itself in the wild, a worrying prospect given how rubbish they can appear. However, Jakob Nielsen et al. shouldn’t get too concerned as trends that go too far scar the memory and preclude their return. Just consider those animated GIF’s…
A case of cross-fertilisation
Having two blogs allows me to stream my content; I doubt that many visitors to my hillwalking blog would appreciate seeing posts on, for example, the minutiae of UNIX shell scripting. However, as disparate as these worlds are, there is something shared between them and it has started to cause some cross fertilisation between them: blogging itself. Rather than being too self referential on my hillwalking blog and preaching to the choir, I have taken the decision to muse of blogging and its progress right here. There is also some escape in the opposite direction too: technology does get used on the hill too. Examples include GPS receivers and digital mapping and my hillwalking blog is definitely the place for them. It is all very much audience driven and this consideration of content is the sort of thing on which a posting on The Blog Herald has been musing.
What are we like?
Over the history of the internet, I have seem halcyon online dreams turn sour and the same lurch is happening to the world of Web 2.0. It was only in the mid-nineties that the web was considered a levelling platform and a place for interaction and sharing. It also was a lot safer than it is today, an ironic observation given how e-commerce has taken off until you realise the financial gain from scams like phishing. Human nature does have a habit of spoiling things and the result is the number of patches that Windows has needed over the years, that and the expansion of security software from being all about anti-virus packages to the inclusion of anti-spam, anti-spyware and firewall applications.
You would think that the above would have all but killed off the optimism that abounded in the late nineties but it has resurfaced again with the explosion of the blogosphere and, of course, there is Second Life. But there are signs of slippage even in this brave new world: comment spam has become a scourge for blogs though the likes of Akismet and the WordPress Bad Behaviour plug-in see off most of it for me.
Then, there remains flaming on web forums (should that have read fora?). In fact, what has prompted this post is my observation of the transformation of a friendly forum thread into a hostile exchange. It started out as a communication regarding the welfare of someone who needed to retire from the annual Rab TGO Challenge with high fever. Everything was going well until someone poked a hole in another posters grammar but it was mention of fitness that really turned things sour, especially when someone’s admission of a 20-a-day smoking habit drew the ire from a fitness fanatic. It was all unnecessary but it shows how people can mess up with technology: in order to realise those optimistic dreams that I mentioned earlier, we have to change to make it happen. I suppose that we’ll have to live in hope…
Do we surf the web less at the weekend?
Looking at the visitor statistics for both this blog and for my main website, I have noticed a definite dip in visitor numbers at the weekends, at least over the last few weeks. Time will tell as to whether this is a definite trend but it is an intriguing one: less people are reading blogs and such like when they might have more time to do so. It would also suggest that people are getting away from the web at the weekend, not necessarily a bad thing at all. In fact, I was away from the world of computers and out walking in the border country shared by Wales and England yesterday.
Speaking of walking, it does not surprise me that my hillwalking blog received less attention: many of my readers could have been in the outdoors anyway. And as for this blog, it does contain stuff that I find useful in the day job and it seems that others are looking for the same stuff too if the blog statistics are to be believed. Couple that to the fact that technology news announcements peak during the week and it seems that the weekday upsurge is real. I’ll continue to keep an eye on things to see if my theorising is right or mistaken…
Using Korn shell commands in scripts running under the bash shell
This is actually a fairly simple one: just prefix the relevant command with "ksh" like below (in the example below, bash won’t know what to do with the print command otherwise):
ksh print "Hello, world!"
It’s also useful for running Korn shell scripts under the bash shell as well.
Recalling previous commands in the Korn shell
The default shell on Solaris boxes seems to be Korn and the version that I have encountered doesn’t appear to allow obvious access to the command history. In the bash shell, the up and down cursor keys scroll through your command history for you but Korn doesn’t seem to allow this. Thankfully, there is another way: you can set up the editor vi as the default method for gaining access to the command history by adding the following line to the .profile file in your home directory:
set -o vi
Then, you can use the Vi (it’s pronounced vee-eye, apparently) commands ESC+h and ESC+j to move up and down the list of previous commands. That, or, assuming that you have access to it, just use the bash shell anyway…
WordPress 2.2
WordPress 2.2 made its début yesterday and, after a spot of cautious testing, I upgraded my hillwalking blog to use it. The reason for the testing was that self-hosted WordPress blogs can now have what WordPress.com blogs have had for a while: built-in widget capability. It was this that upped my level of caution but the changes weren’t as drastic as I had feared: you need to amend your theme for widgets to be supported and not having done this causes no untoward effects. Making themes widget compatible is something that Automattic describe in a helpful article on their website. Other than this, Wordpress 2..2 doesn’t cause much upheaval and, apart from pieces JavaScript snagging on occasions in Firefox, all seems well. I am still sitting on the fence as regards those widgets though…
Tags
Adobe Apache Blog Blogging Books Canon Command Line CSS Drupal DSLR Firefox Google Hardware HTML IE7 Installation Internet Explorer JavaScript Linux Microsoft MySQL openSUSE Opera Operating System Oracle Perl Photoshop PHP Safari SAS SQL Ubuntu UNIX Virtualisation Virtual Machine Vista VMware VMware Workstation Web Browsers Windows WordPress WordPress.com WordPress plugins XHTML XP