Death of a Gadget

I commented on an article about music player technology, saying how much I liked my Packard Bell AudioKey and how simple it was.

Well its died, and the search is on for a replacement (no I can’t wait for Christmas!), So far I’m interested in the iriver players, and the main requirements are 512Mb or more, a USB connection and no drivers needed – since I dock it in all sorts of different places and different operating systems.

I’ll let you know what I choose but suggestions are greatfully received, any ideas?

Intended use of HTTP POST

I read this article from Elliotte Rusty Harold yesterday, and its kind of stuck in my mind [1]. He writes about what the different types of HTTP requests were actually intended for; the difference between the verbs GET and POST. His point is that to view information, GET should be used so that the page can be bookmarked (or indexed, or emailed) and reused. POST is just for actions that shouldn’t be repeated – and he’s right.

His article is here: http://cafe.elharo.com/web/post-considered-inconvenient/ and its well worth the read. I don’t think I’d ever really thought about this before, or not in these terms. Thanks, Elliotte, for a great and thought-provoking article!

1 Possibly because I’m writing a big search form and sorting mechanism for a big set of results at work! Since I work in manufacturing its all dates and partcodes and supplier codes and so on, not terribly exciting but a good illustration of when to use different posting methods.

Super Dooper Opera Search Feature

Opera has sneaked in a fabulous new search feature – and I missed it completely! In looking up how to set up some shortcut searches, I stumbled across this and thought I’d share.

Opera 9 (and I think earlier versions) comes with a preconfigured search function, where you type the letter “g” and then the search terms you would have typed into Google’s search box and the search is performed for you. I have a couple of other searches set up as well, previously it was necessary to work out where in the query string to put your search and hack about with an ini file to get it working.

Not any more! On any site with a search box you can right click in it and choose “Create Search …”, you will then be asked to choose a shortcut letter to use with it. That’s so clever! And very non-techie to use.

Self-promoting example

In opera, go to lornajane and right-click in the Search box on the right-hand bar. Choose “Create Search …” and type “l” into the search box. Now in a new tab, type into the address bar:

l opera search

And guess where you’ll end up??

Usage

I have p for the PHP Website and w for Wikipedia, and am lost without them!

PuTTY from command-line

Following my brush with RSI, I’ve become very mouse-averse, which is difficult on a windows computer! There are a couple of shortcuts that I use to launch programs, mostly revolving around use of the Start->Run dialog (press Windows and R and it just pops up).

PuTTY can have saved sessions which is very useful – for example I use a different coloured background for the production server at work, so I remember which window it is and don’t type into the wrong one. To launch a saved session from the command line (or Run dialog box), use:

<path to putty.exe> -load <saved session

I have to look this up every time I need to change my machine or set this up somewhere else, so its here for safekeeping!

Girls and Gadgets Don’t Mix

My partner asked me the other day if I would like a new watch for Christmas. Actually I would really like a new watch for Christmas and I’m touched that he had thought of such a gift. He asked that I choose, so that he could be sure of getting something that I liked.

As a first step, we grabbed the Argos catalogue and he started to browse. I brought some drinks in and asked how he was getting on. “I’m looking for a ladies watch that actually does something”, he replied. But we didn’t find one.

Why is it that men need dates, alarms, lights and interesting energy solutions on their watches (not to mention ones that are manufactured from interesting stuff, like titanium), when women just need the time (often with no second hand and no accurate markings) and plenty of bling? I don’t get it. I want one with a backlight so I can see the time at night, and an alarm to set in case I fall asleep on the train.

With women being target market for phones, music players, and even games consoles these days, it seems very odd that such a fundamental market hasn’t caught up. I’m not a gadget freak really (not much anyway) and I don’t need something which remote controls my talking entertainment centre and is waterproof to 100m or anything. My current watch was an emergency buy from Next when the last one died and its pretty good – it has minute markings and a second hand – and a diving bezel thing that I use when I’m cooking to remind me when something will be ready.

I suppose the answer is to buy a man’s watch. I’m a big girl after all (at almost six feet tall) and I do have big hands. The trouble is that I have tiny wrists, ladies watches are too big even after I’ve had links taken out – an average man’s watch is big enough for both my wrists at one time, which isn’t practical!

Short of starting my own gadget accessories range, I’m not sure how I’m going to solve this!

PHPWomen: A Community is Born

This post has been a week or so in the making, I just wanted to find the right words to tell the story. I saw a post on the PHP DevZone saying that Ligaya Turmelle wants to hear from women in PHP.

Well I hopped right across to the her blog post and raised my hand, thinking there wouldn’t be too many other people there. How wrong was I? To date there’s 44 responses to that one post.

The dawn of a new group

The new community is now online at www.phpwomen.org and its thriving. The forums are very active and full of people introducing themselves and discovering there are fellow phpwomen nearer to them than they thought. So far I think my nearest is either Belgium or Amsterdam – but there’s a lot more in Europe than I thought and I’m sure there are others in the UK just waiting to emerge. I’m a moderator on those forums as well, which is my first online position of that kind although I did briefly help out with experts-exchange before it went commercial.

The threads on the forums vary widely from “this is me”, through comparing notes on sanitising input variables, and along to who has which dog and a riveting post entitled Work and Babies.

The main site has interviews with both Ligaya and Elizabeth Narramore who had the original idea, announcements of conferences and will include other PHP news updates too, among other additions to numerous to list here.

Looking to the future

Well the community has certainly started with a bang and I hope that everyone continues to contribute as actively as time goes on. For me I hope that I continue to build relationships with the lovely women I’ve met so far, and that we will also be able to contribute to the PHP community as a whole. Here’s to a bright future!

Accidental E-Self-Discovery

Something wierd just happened …. I was trying to do something on the PHP Community Book Site (more about them another day), to get dokuwiki to hyperlink to sections. I was confused about the syntax so I googled for it.

Can you guess what happened next?

My own website was one of the hits

Wow. I was eighth hit for the search term “dokuwiki internal hyperlinks”. That has never happened to me before.

The only downside is that I don’t know the answer to my question and its certainly not on this website – never mind :) The actual way to do dokuwiki’s internal links is by looking on the syntax page that comes with each wiki (hyperlink to it above the box on the edit page, if you have one) – or you can use the syntax page on the dokuwiki homepage, http://wiki.splitbrain.org/wiki:syntax

Cream of the Crop (of editors)

There’s a longer post in the pipeline somewhere about editors and IDEs and developments and stuff as we’ve just changed our setup at work and I’m completely thrown by trying to develop on windows! Anyway to cut a long story short, I’ve found a fabulous Vim wrapper-type-app called cream which I’m now trying out on windows.

There are a couple of instant weird things but perseverance with the dropdown menus of preferences and so on have got me into a state where I can edit. However there are two major oversights:
* files are opened in edit mode
* pressing Esc repeatedly toggles command and insert modes

This makes no sense to a vim user so I trawled the mailing list and came up with this post, showing which lines to add to cream-user.vim to change those defaults. I also found an FAQ entry which describes how to create a cream-user.vim file in the first place. So I thought I’d post it here for others and before I lose it :)

Extending DokuWiki’s Authentication Classes

DokuWiki is a fine product, and its extensibility is a big element of that. I’ve known for a while that it has different authentication classes, and I’ve even used some of the different ones it comes with. Recently I had cause to write my own, to marry up with some user information stored in an Oracle database table, and used to access the company intranet. Working with DokuWiki’s skeleton classes to create my own was much easier than I expected and here’s my experience.

Choosing the class to extend

Since my requirements are pretty simple, my new class extends auth_basic – and I used the plain.class.php that comes with DokuWiki (for plain text authentication) as a template to guide me.

The first step was to chop out most of the functionality. This is done by setting the class’ cando properties to false, which was quick. My system has all its user maintenance and so on done elsewhere so I don’t want users to be able to change passwords or anything. My declaration now reads:

class auth_symphony extends auth_basic {
    var $users = null;
    var $_pattern = array();
    /**
     * Constructor
     *
     * Carry out sanity checks to ensure the object is
     * able to operate. Set capabilities.
     *
     * @author  Christopher Smith <[email protected]>
     */
    function auth_plain() {
  $this->cando['addUser']      = false;
  $this->cando['delUser']      = false;
  $this->cando['modLogin']     = false;
  $this->cando['modPass']      = false;
  $this->cando['modName']      = false;
  $this->cando['modMail']      = false;
  $this->cando['modGroups']    = false;
      $this->cando['getUsers']     = false;
      $this->cando['getUserCount'] = false;
    }

Getting the information to dokuwiki

I included the standard library that we use here with all PHP pages, that handles things like database connection setup and so on. Then I altered the function _loadUserData(), creating a new empty array for $this-users and then then running a select statement and populating the array with the results. I found it useful to get the wiki working with plain text authentication first and just a couple of users set up so I could observe the output of the various functions. Here’s the altered function:

    function _loadUserData(){
    $this->users = array();
	

$L_sql = "
SELECT u.user_name
,u.extranet_pass
, d.dept_code
,u.full_name
,u.email
FROM vis_users u
, vis_subdepts d
WHERE d.subdept_code = u.subdept_code
AND u.extranet_valid = 'Y'
";

$L_bind_in = array();

$L_results = exec_sql($L_sql,$L_bind_in);

foreach($L_results as $L_result) {
$this->users[$L_result['USER_NAME']]['pass'] = md5($L_result['EXTRANET_PASS']);
$this->users[$L_result['USER_NAME']]['name'] = $L_result['FULL_NAME'];
$this->users[$L_result['USER_NAME']]['mail'] = $L_result['EMAIL'];
$this->users[$L_result['USER_NAME']]['grps'] = array('user',$L_result['DEPT_CODE']);
}
}

if anyone can make any suggestions about pasting clean code snippets in textpattern, I’d be grateful! In the meantime, I apologise for the state of the above example

I removed the functions for creating, modifying and deleting users as I had already told my class it couldn’t use those.

The results

All in all this was quite simple to get working, and DokuWiki is designed to have its authentication functions replaced in this way which is invaluable. We also created a new template for the site and hey presto we’re ready to go with no further modifications1 and no hassle when upgrades come around.

1 OK so actually I added some class definition to the breadcrumb hyperlinks because I changed the bar colour, but that’s almost no modification!

Diet Oracle – working with Oracle eXpress Edition

I’m a big oracle fan, which might seem a bit strange in a world dominated with the LAMP stack and its exclusive use of MySQL or, at a push, Postgresql. That’s not the entire world obviously, that’s my world and it is definitely MySQL-orientated. In the world of work however, I’ve had extensive exposure to Oracle and think its great, so I was very excited when I saw the free mini-Oracle be released earlier this year. These are my first experiences of working with it.

Installing Oracle XE on Windows.

OK so I’m not actually going to use this on windows really but when I tried to install this on Linux I had a major problem right at the outset. There is a choice of either a .rpm or a .deb file to install from and since I had sent my sysadmin to the supermarket, I had no idea which I needed! The windows installer promised to be point-and-click and since I’m actually running Windows on one machine at the moment (grr wireless drivers grr) I was tempted by the idiot-proof windows installer so I grabbed that.

Well, idiot-proof was a gross understatement! I ran the installer, it asked me where I’d like the files put and then to input a root password, and the next thing I know its all done and inviting me to log in. I’ve installed Oracle many times on Windows and believe me, its not supposed tobe this easy. Anyway it works, I’ve been chattering to it on command line and everything is cool. The next step is to get it installed under Linux – it turns out that our Ubuntu server would like the .deb file best, so I’ll try that out and keep updating here.