23rd May 2007
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 about 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; this consideration of content is the sort of thing on which a posting on The Blog Herald has been musing.
22nd May 2007
Over the history of the internet, I have seen halcyon online dreams turn sour, with the world of Web 2.0 suffering the same lurch. 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 antivirus 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, only for it to resurface 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. 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 a high fever. Everything was going well until someone poked a hole in another poster's grammar, yet it was the 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. While it was all unnecessary, it shows how people can mess up with technology: to realise those optimistic dreams that I mentioned earlier, we have to change to make it happen. For now, I suppose that we’ll have to live in hope…
21st May 2007
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 whether this is a definite trend, yet it is an intriguing one: fewer 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 my day job, and it appears that others are looking for the same stuff too if the blog statistics are to be believed. Couple that with the fact that technology news announcements peak during the week, making it appear that the weekday upsurge is real. I’ll continue to keep an eye on things to see if my theorising is right or mistaken…
19th May 2007
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.
18th May 2007
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...
17th May 2007
WordPress 2.2 made its debut 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 of JavaScript snagging on occasions in Firefox, all seems well. I am still sitting on the fence as regards those widgets, though...
16th May 2007
There are a number of ways of finding out the number of observations (also known as records or rows) in a SAS data set and, while they are documented in a number of different places, I have decided to collect them together in one place. At the very least, it means that I can find them again.
First up is the most basic and least efficient method: read the whole data set and increment a counter to pick up its last value. The END option allows you to find the last value of count without recourse to FIRST.x/LAST.x logic.
data _null_;
set test end=eof;
count+1;
if eof then call symput(”nobs”,count);
run;
The next option is a more succinct SQL variation on the same idea. The colon prefix denotes a macro variable whose value is to be assigned in the SELECT statement; there should be no surprise as to what the COUNT(*) does…
proc sql noprint;
select count(*) into :nobs from test;
quit;
Continuing the SQL theme, accessing the dictionary tables is another route to the same end and has the advantage of needing to access the actual data set in question. You may have an efficiency saving when you are testing large datasets, but you are still reading some data here.
proc sql noprint;
select nobs into :nobs from dictionary.tables where libname=”WORK” and memname=”TEST”;
quit;
The most efficient way to do the trick is just to access the data set header. Here’s the data step way to do it:
data _null_;
if 0 then set test nobs=nobs;
call symputx(”nobs”,nobs);
stop;
run;
The IF/STOP logic stops the data set read in its tracks so that only the header is accessed, saving the time otherwise used to read the data from the data set. Using the SYMPUTX routine avoids the need to explicitly code a numeric to character transformation; it’s a SAS 9 feature, though.
To finish, here is the most succinct and efficient way of all: the use of macro and SCL functions. It’s my preferred option, and you don’t need a SAS/AF licence to do it, either.
%let dsid=%sysfunc(open(work.test,in));
%let nobs=%sysfunc(attrn(&dsid,nobs));
%if &dsid > 0 %then %let rc=%sysfunc(close(&dsid));
The first line opens the data set, and the last one closes it; this is needed because you are not using data step or SCL and could leave a data set open, causing problems later. The second line is what captures the number of observations from the header of the data set using the SCL ATTRN function called by %SYSFUNC.
13th May 2007
The theme that I am using for this blog, Andreas09, allows me to add widgets to the sidebars. And most of these are customisable to varying extents. While I have selected a few for mention here, there are others like Tag Clouds (very Web 2.0 and, I think, very inelegant) available too.
The most customisable of all is the Text widget; you can add practically any (X)HTML to it, which is how added my online photo gallery teaser. Don’t try adding any scripting, though, or it will be removed for security reasons. Even JavaScript suffers this inglorious fate, and I wouldn’t be surprised if it was the same for PHP.
Next up in usefulness, at least from the content point of view, are RSS feeds (just look for the headings with the orange logos beside them). The ability to show shared items from your Google Reader account is a nice piece of convergence. Speaking of convergence, I also added the feed from my hillwalking blog too. Taking things further again, I have added ones for InternetNews, A List Apart and The Blog Herald and I wonder if RSS feeds will not replace email newsletters now that we have tools like Google Reader.
Moving to the navigation side of things, the Categories widget can be collapsed to a dropdown menu, like I have for the Archives one. I prefer things to be the way that I have them because I want people to see what’s here. The Calendar widget makes up for visitors not spotting what the dropdown represents; that’s why the Archives widget can be a dropdown menu rather than a list.
11th May 2007
When I have been tweaking the widgets in this blog, the thought crossed my mind that purveyors of open source blogging and CMS's may be overcomplicating matters with the CSS that they are writing. Using inheritance without much thought as to others having to pick it up is one irritation, but bunching styles together can confuse too. For instance, you can draw from two different styles for the same HTML element (it's what's going when you see class="class1 class2"
in a tag definition), which is OK if done simply but can confuse matters when customisation is attempted later. Drupal particularly suffers from this bugbear, but it's there on WordPress too, though not to the same extent. Using a hierarchy to define and attach your styles (#id1 .class2 tag1 {style definition...}
is the kind of thing that I have in mind), can also confound, even if I admit to finding the approach very useful for myself. I think that I know what's driving this: the need to cut down the bulk of CSS files but using the advanced features that I mentioned above without clear commenting and other documentation hampers later efforts. It would be nice if every developer of a theme to use in blogging or CMS software was forced to document their work extensively and share that documentation with interested users. After all, sharing is the whole purpose of their endeavours...
10th May 2007
What we call walking or hillwalking in the U.K. goes under the banners of hiking, tramping and yomping in other parts of the world. One term that we share with other parts is backpacking and this is much bigger in the U.S. than it is in the U.K. My hillwalking blog has come to the attention of members of the hillwalking and backpacking community and WordPress’s logging of who visited my blog has alerted me to this and allowed to find other similar blogs.
Why have I mentioned this here? The reason is that it has allowed me to see what blogging software others have been using. Blogger seems to be a very popular choice with a number using Windows Live Spaces, in the process making me aware that Microsoft has dipped its toes into the hosted blogs space. Other than this, I have also seen Typepad being used and one or two self-hosted operations to boot, mine included. Intriguingly, I have yet to encounter a fellow hillwalking fan in the U.K. using WordPress.com to host a hill blog, but I do know of a German backpacker having one. Video blogging is used by some, with the ever pervasive YouTube becoming a staple for this, at least for the ones that I have seen.
It’s an intriguing survey that leaves me to wonder how things develop…