I got the idea recently that I’d upgrade a feedback form that I have on my photo gallery so that it would email me me comments left by visitors rather than just storing them on the web server for later perusal. I opened up my copy of PHP Unleashed (John Coggeshall, SAMS), turned to the relevant chapter and it all started to look rather daunting. Then, another suggestion popped into my head: potter over to PEAR and see what they have there. In the light of my reading, I knew what I wanted and downloaded the Mail and Mime-Mail packages. Another spot of perusal led me to some sample code that I could use with these and I modified that to suit. Within 30 minutes, the results of my labours were in place and it all works very nicely too. I still need to learn more about the code that I am using, though.
Archive for July, 2007
FCKEditor for WordPress
The standard WordPress post editor got broken on this blog so my mind turned to replacing and I spied plugins for adding FCKEditor to the thing. Dean Lee’s is the one that I am using and it seems to work well so far too. As this is FCKEditor, there are more editing options than those offered by the WordPress standard and that’s even with the advanced options made visible with the Alt+V/Alt+Shift+V keyboard shortcuts; the former is for IE and the latter for Firefox. We’ll see how it goes from here…
Taking a camera on a walk…
On Saturday, I happened to be in Jessops and overheard a salesman emphatically state that you don’t buy a camera for its specifications but for the photos that it produces. While his tone of voice was a touch condescending and he seemed to be putting down a DSLR, he was essentially right. Nevertheless, the specifications do help you get the images and they have to be seen in that light. For instance, having on-board sensor cleaning may save you from having either to clean the thing yourself or send the camera away for the professionals to do the needful, a much safer option in my view. And there may be occasions where image stabilisation is very useful, low light wildlife photography for instance. Yes, there are features that I consider surplus to requirements like live viewing and movie capture and that is very much due to my buying cameras to make photos. The salesman in question would surely have agreed…
Sunday saw me head to the Lakeland Fells for some walking and a spot of testing of my new Pentax K10D. The details of the walk itself are not for here but for my hillwalking blog and that is where you will find them. While making my way from Crewe to Windermere, I perused the manual looking particularly for information pertaining to functions that I actually use (I should really have done this beforehand but distractions meant that I hadn’t got around to it). I had to wade through something designed for a new SLR user before I got to what I consider the important stuff. Though this may be a bit irritating, I can understand and accept why they do it this way; we were all new users once and they are hardly likely to want to know about things like aperture priority, raw file capture, ISO control and such like straight away.
What do I think of it then? Let’s start with first impressions. It is definitely smaller than the Canon EOS 10D it accompanies in my possession. That said, it is not too small and there is a decent grip hosting the shutter release button and the camera on/off switch. It also feels well-assembled and reassuringly weighty, an important consideration given that it will see the outdoors a lot. A discussion of the features most relevant to me follows.
On the subject of switching on and off, the camera is set to go into a sleep mode after a second of inactivity but it reawakens quickly when needed, the trigger being half-depression of the shutter release button. In fact, the camera does reawaken much faster than my Canon as it happens and where the delay is a constant source of some irritation. It might sound strange but the on/off switch is also used to activate the depth of field preview, something that no SLR should not have. The location may be unusual but maybe the designers thought that having shutter release and depth of field preview next to each was a logical way to do it. From a camera operation point of view, there is certainly something to that way of thinking. Behind the shutter release, you’ll find the a screen that is a reminder of film SLR’s and it conveys information such as battery life, number of exposures remaining on the card and exposure details (aperture & shutter speed).
Staying on the subject of screens, the one on the back of the camera is larger than that on the Canon. As is customary for these, it allows replay of photos taken and access to the various menus required to control the camera’s operation. In comparison to the Canon, which is essentially a one menu affair with a thumbwheel controlling scrolling and an OK button at its centre to perform operations, the Pentax has a more elaborate system of submenus: one each for recording, playback and set-up. The playback menu is where I found the setting that makes the camera highlight areas of underexposure and overexposure during image playback. This is something that I missed with respect to the Canon until I happened upon it. Camera cleaning is located on the set-up menu and the camera is now set to clean the sensor every time that it is turned on. Why this is not enabled by default is a little beyond me but the designers might have thought that a vibration from the camera on turning it on could have resulted in a load of support calls. The same submenu also hosts memory card formatting. The recording submenu is where I set the camera to deliver RAW DNG files, an Adobe innovation, rather than the default JPEG’s. There are other opitons like RAW PEF files, Pentax’s own format, or RAW and JPEG simultaneously but my choice reflects my workflow in Photoshop Elements; I have yet to stop the said software editing the DNG files, however. With all these options, it is fortunate that there is a navigation wheel whose operation uses arrow buttons to get about. While on the subject of the back screen, there are further settings that are accessed with the Fn button rather than the Menu one. These include ISO, white balance, shooting mode (single, continuous, timed and so on) and flash. The only setting that I changed out of this lot was to set the ISO to 400; I prefer to feel that I am in control.
Returning to the camera’s top plate, the exposure mode dial is on the left hand side, which is no hardship to me as this is in the same place as on the Canon. There are no scene modes but the available exposure modes are more than sufficient: fully automatic, program, sensitivity priority, shutter priority, aperture priority, shutter and aperture priority, manual, bulb and external flash synchronisation. A few of these need a spot of explaining. Sensitivity priority is no one on me but it is a consequence of the ability of DSLR’s to offer a range of ISO settings; the aperture and the shutter speed are varied according to the ISO setting. Shutter and aperture priority is like manual exposure and is the inverse of sensitivity priority: set both aperture and shutter speed, and the camera will vary the ISO setting. Both of the foregoing assume that you let the camera set the ISO but my setting the thing myself may have put put paid to these functions. Shutter priority and aperture priority are, as far as I can tell, their usual selves. For all exposure modes, the thumbwheels at the front and back of the shutter release handgrip set apertures and shutter speeds where appropriate and this arrangement works well.
Mounting on the same column as the exposure dial the metering mode selector and here is where I see more options than my Canon, which has only full and partial multi-segment metering. With the Pentax, you get spot and centre-weighted metering in addition to the default multi-segmented variety. spot metering is definitely very useful but capturing the reading is a multitasking affair: half pressing the shutter button and fulling pressing the AE lock one at the same time. In contrast, Canon’s partial metering is a more convenient single button operation meter and retain facility. Pentax would do well to learn from this.
The focussing mode selector is found on the left of the body next to the lens coupling. I am used to having this on the lenses themselves so this is a new arrangement for me and one to which I can easily become accustomed. In fact, it is easy to find it while composing a picture. The modes themselves are manual focus, one-time autofocus and continuous autofocus; the last of these is for focussing on moving objects.
I could go further, perhaps overboard, with a discussion of the features of this camera but I draw a line at what’s here. Yes, it is useful to set the focussing point and activate image stabilisation but the above are what matter to me and its performance in the photo making department is the most important aspect. That neatly brings me to my appraisal of how it performs. With inspection of the first few images on the review screen, I was a little disappointed to see how dark the foreground was in comparison to the sky. When I brought everything home as I always do, I found that things weren’t necessarily as they appeared in the field. The Pentax more usefully offers histogram review and highlighting of any areas that are either underexposed or overexposed. It is these functions that I will be using in reshooting decisions while out and about with the Pentax and the same can be said for how I currently use the Canon. In fast changing lighting, the AE lock technique was a bit irritating but I am sure that I will get better at it. The autofocus doesn’t always lock onto the subject, especially in tricky lighting, so manual focussing is a definite necessity and is more useful more for landscape photography, in fact. Nevertheless, the autofocus did do well most of the time and my Sigma lenses have done worse things on me. All in all, I am happy with the K10D and will continue to use it. I have got some decent photos from my excursion and that, as that Jessops salesman would agree, is the main point of a camera.
SAS9 SQL Constraints
With SAS 9, SAS Institute have introduced the sort sort of integrity constraints that have been bread and butter for relational database SQL programs but some SAS programmers may find them more restrictive than they might like. The main one that comes to my mind is the following:
proc sql noprint;
create table a as select a.*,b.var from a left join b on a.index=b.index;
quit;
Before SAS 9, that worked merrily with nary a comment but you now will see a warning like this:
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity problem.
In data step, the following still runs without a complaint:
data a;
merge a b(keep=index var);
by index;
run;
On the surface of it this does look inconsistent. From a database programmer’s point of view having to use different source and target datasets is no hardship but seems a little surplus to requirements for a SAS programmer trained to keep down the number of temporary datasets in an effort to reduce I/O and keep things tidy, an academic concept perhaps in these days of high processing power and large disks. Adding UNDO_POLICY=NONE to the PROC SQL line does make everything consistent again but I see this as being anathema to a database programming type. I do admit to indulging in the override for personal quick and dirty purposes but abiding by the constraint is how I do things for formal purposes like inclusion in an application.
Using external JavaScript files? Just don’t load them at the bottom of the page…
Looking through Google Analytics for my websites, I have always been struck by the lack of IE7 uptake seemingly apparent from the statistics. However, I recently discovered that there may be a reason for this. I use the Ultimate GA plugin with my WordPress blogs and that adds the JavaScript code block near the bottom of the page. However, I recently saw that giving me scripting errors in IE7 and a spot of manual coding saw it travel to the header section of the web page. That, and the deactivation of the said plugin, was sufficient to rid of the errors in question. Seeing the effect of my changes on the reported share of visitors using IE7 could be interesting. It might even boost the Vista numbers as well.
A change of theme…
After sticking with Andreas09 for so long, I have been lured into using Prosumer instead. A spot of tweaking has turned it from a fixed width layout into something a spot more fluid. It’s more edgy than its predecessor but I hope to make things appear a touch more harmonious, to my eyes anyway, over time. The level of personalisation might be even greater too, never a bad thing when it comes to standing out from the crowd. While on WordPress.com, I did try with Andreas09 but the greyness that I added got to me in the end and I stuck with a brighter scheme after moving the blog. We’ll see how it all goes on from here…