12 Nov 2008, 1:00am
Miscellaneous:
by

2 comments

Adventures with Twitter

I decided to try out Twitter at the end of last week, mostly as I’d heard so much about it but not really looked into it seriously more than a quick glance over the demo page.  I don’t know what made me suddenly sign up for the service I think I was wanting to more quality information.  This is a common occurrence for me as I read very quickly and even with search engines as good as they are it is still hard to find quality sties to read on any given subject.  So I decided to jump into Twitter with both feet and see what it is like…

You can find my Twitterings on this page, I should probably add a link on the side bar at some point.

So the first thing I noticed after signing up and getting my account activated was that the ‘Find People’ search seems to be disabled, which makes find other people to listen to hard.  Fortunately for me I knew Jeff Atwood of Coding Horror and StackOverflow was an keen twitter user so I managed to find him and Joel Spolsky of Joel on Software via some Google searching.  I also found some more interesting people to follow by looking through who they were following.  But the lack of a working search feature had me stunned for a while that a service could be so popular and yet be missing such a fundamental feature.

Needless to say I eventually discovered search.twitter.com.  Although I can’t remember how I found it, I think it may have been a link I followed after searching through some blog posts regarding finding people on twitter.  I find it bizarre that the link to their main search page is not more prominent than it is: I had to search through the html source of the homepage to find it (its in the footer on the right side).  Unless the developers are actively trying to lower the hits on the search pages for performance reasons: maybe their server was getting swamped?.  Why else would they place the link to their search page (a key feature) in such an obscure location?

Anyway enough about the search page being not obvious to find.  So far I have found twitter fairly useful in terms of content and information: I would not have found Cal Henderson’s excellant ‘Why I hate Django’ presentation from DjangoCon 2008 if I hadn’t seen a link to it on twitter.  I also like reading some of the updates from bloggers I respect allot like Jeff, Joel and Rands as well as watching the flow of information from people talking to those guys.  I’ve also found some more interesting people to follow about web development, php, django and a few other topics via the search page now.

The last thing I’m going to mention is the apparent use of some sort of informal keyword/tag system that seems to be being employed by people, it is as simple as putting a hash (#) in front of the word you want to have as a keyword or tag.  Judging from the amount of times I’ve seen tags like #webdev, #php, #django this seems to be getting used allot by the more technical members of the twitter community.  It would be interesting to see if there is anyway of filtering these posts by their keywords into channels for each keyword, that would make very interesting reading indeed.  And I’m sure someone has probably already done it, I’ve just not found the link yet.

11 Nov 2008, 1:00am
Programming:
by

3 comments

Configuring Perforce command line client P4 on Mac OS X

I wrote a post yesterday about setting up the Perforce server P4D on Mac OS X once you’ve done that all that is left is to configure P4V the visual client and P4 the command line client. Fortunately P4V has a helpful set-up wizard to help you configure it for the first time: connect to the server, create your new user account, new client spec and sync up for the first time.

The command line utility P4 takes a little bit more configuration via environment variables which is not quite as simple as setting up P4V, so I thought I would document it. The first thing I did was run P4V and configured it, this has the side effect of working out the perforce port, creating a user account and associated client spec.  Take a note of the username, clientspec and perforce port as you setup P4V, you’ll use those values to configure P4.

Note for this to work you need to have P4 already set-up in your system’s path variable. If you don’t have P4 in your path when you type ‘p4‘ and hit enter in a terminal window you will get a response along the lines of ‘-bash: p4: command not found‘. If you don’t have this already set-up and you are using the default bash terminal on Mac OS X, then you can add P4 to your path by doing the following:

  1. Open a Terminal window, (its in the utilities folder in the application folder).
  2. Type vi .bash_profile this will open the hidden file that defines your bash profile file in the vi text editor.
  3. Edit the line (press i to start editing and esc to stop) that starts with path=, insert the path to where you put p4 (in red) followed by a : right after path= e.g. PATH=”/Developer/Perforce/:…:${PATH}”.
  4. Save the file (with :s then enter) and then exit vi (with :q then enter).
  5. Quit Terminal.
  6. Reopen Terminal.
  7. Type p4 and hit enter, you should now get a response from the p4 application, although this will most likely get an error response unless you’ve already set-up your Perforce environment variables.

Now we can configure the three environment variables that the P4 application requires to work, these are $P4PORT, $P4USER and $P4CLIENT. These variables tell the P4 application how to connect to the server and the user to connect as and clientspec to connect with for that user. As I mentioned above the values of these three variables are the same as the perforce port, username and clientspec you used in P4V. To setup these environment variables we are going to add them to a hidden system file which is run every time you login to set-up the environment variables for your user profile (from this guide).

  1. Open a Terminal window.
  2. Type mkdir .MacOSX and hit enter to create the hidden directory the file resides in, the dot at the start means it is a hidden file.
  3. Type echo “” > .MacOSX/environment.plist and hit enter to create an empty file called environment.plist in your user directory directory, which is hidden.
  4. Type open .MacOSX/environment.plist and hit enter to open the file we just created in the plist editor.
  5. Add a child value with name P4PORT and the value from P4V e.g. localhost:1666.
  6. Add a sibling value with name P4USER with the value of your user from P4V e.g. daniel.
  7. Add a sibling value with name P4CLIENT with the value of the clientspec for your user in P4V e.g. daniels_clientspec.
  8. Save the file and exit the editor.
  9. Quit terminal.
  10. Logout and log back in.
  11. Open terminal and type P4 and hit enter, you should now get a non-error response from P4.

It is worth configuring the P4 command line application as it is the main way to administer a perforce server, so if you want add, delete or manage users, depots etc then you need to have P4 configured.

10 Nov 2008, 1:00am
Programming:
by

1 comment

Setting up Perforce Server (p4d) on Mac OS X

This morning I have been attempting to get p4d running on my intel iMac (running MacOS 10.5.5) so I can do some proper development at home.  I easily found the official Perforce guide to launching p4d at start-up with Launchd here, which seemed helpful and simple enough.  But it would seem I am now bogged down in file permission hell, which is something I don’t know allot about as I mainly work on Windows systems…

When I login I get the following message in my Console log and no p4d instance started:
“10/11/08 2:56:59 PM com.apple.launchctl.System[2] launchctl: Dubious ownership on file (skipping): /Library/LaunchDaemons/com.perforce.plist”
The permissions for the plist file are:
-rw-r–r–@ 1 Daniel  staff  700 10 Nov 11:58 /Library/LaunchDaemons/com.perforce.plist
And the permissions for p4 and p4d are:
-rwxr-xr-x@  1 Daniel  staff   580272 10 Nov 11:25 /Developer/Perforce/p4
-rwxr-xr-x@  1 Daniel  staff  1695008 10 Nov 11:25 /Developer/Perforce/p4d

The rest of the perforce files are set to:
-rw-r–r–  1 Daniel  staff   * 10 Nov 13:14 *

I used the example plist file from the perforce website and filled in the details specific for my installation:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Debug</key>
<false/>
<key>Label</key>
<string>com.perforce</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Developer/Perforce/p4d</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>P4LOG</key>
<string>/Developer/Perforce/p4log.log</string>
<key>P4PORT</key>
<string>1666</string>
<key>P4ROOT</key>
<string>/Developer/Perforce/p4root</string>
</dict>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>Launches Perforce Server</string>
</dict>
</plist>

This plist file works if I use the following command:
launchctl unload /Library/LaunchDaemons/com.perforce.plist

Any help on resolving this would be greatly appreciated, I can start the server manaually for now but it would be great to have it running at start-up or login!  I’ve tried using the same plist file in the /Library/LaunchedAgents/ folder but I get the same results :(

Solution!

The following solution is from Perforce technical support, the owner and group of the plist file should be root:wheel which can be achieved by the following command:
sudo chown root:wheel /Library/LaunchDaemons/com.perforce.plist
The file should look like this after the change:
-rw-r–r–  1 root  wheel  797 11 Nov 11:01 com.perforce.plist

DjangoCon 2008: Why I hate Django.

This amusing keynote speech from DjangoCon 2008 by Cal Henderson is well worth a watch.

The great contacts shuffle

It took me a while to figure out the exact steps required to get my contacts on my mobile phone onto my Blackberry and to first wipe the current contacts off the Blackberry.  Thankfully the task was not as complex as I first feared or as tedious as sending each vCard between each device manually (which I’ve had to do in the past when upgrading phones)!  The only extra software that was required was the excellent Blackberry Desktop software for the Mac which you can find here, as iSync is included with Mac OS X.

  1. Syncing the Blackberry’s contacts to my iMac’s Address Book and then deleting all the contacts from Address Book.  The contacts on the Blackberry were all old contacts from Outlook at work which were  originally from my old Palm PDA, so I did not need them any more.
  2. Syncing the Blackberry to the iMac Address Book to wipe the contacts off the Blackberry.
  3. Syncing contacts from my old mobile phone to iMac’s Address book and then syncing the Blackberry to the newly populated Address Book on the iMac was very easy as iSync automatically recognised my Motorola Razr phone and set-up syncing with address book automaticallly.

My PDAs over the years

It is interesting to see how the personal organiser has morphed into the PDA which then morphed into a media device and now into a phone. Over the years I’ve lusted after and I’ve owned a number of PDA devices ranging from the sleek Palm Vx to the basic Palm Zire and now I’ve finally caught up a bit with the trend and have a mobile phone / PDA hybrid device: a Blackberry. I can remember being fascinated by devices like the Psion 3, Psion 5 and Psion Revo series of PDAs which all featured a miniature computer style form factor with monochrome screens and keyboards.  Then PDAs embraced touch screens with devices like the original Palm Pilot, Apple Newton and various Microsoft offerings.

The first PDA I owned was the super slick Palm Vx pictured on the left, it had 8mb of memory, a gorgeous aluminum body and the latest PalmOS.  I can remember working through various add-ons for this PDA over the years including USB syncing, OS upgrades and various carrying cases.  This device really cemented my love of Palm devices as they always performed their main function brilliantly: keeping you organised.  Other devices could connect to the internet, play music or videos but nothing I tried came close to the Palm organiser software or its PC counterpart: Palm Desktop.  From the get go Palm organisers could also sync with Microsoft Outlook but Outlook and Palm did not share the same organisation model so syncing could be a bit hit or miss.

I eventually sold my beloved Palm Vx in favor of upgrading to an HP Jordana 710 as I was seduced by its keyboard, storage options and the potential of a Wireless network card for mobile browsing.  However on taking delivery of the unit and some initial experimentation I sent it back for a refund as several things including the lack of a screen catch made it not a particularly well thought out piece of hardware.  Unfortunately as I’d already sold my Palm Vx to afford the Jordana I was left without a PDA for a while until Palm released the original super cheap Palm Zire which for a bargain 50 GBP I could not resist and it let me pick up the latest version of my favorite mobile operating system.

One of the best things about the Zire series was that they charged and synced by USB by default unlike the Palm Vx which was a serial device which you could upgrade to use USB, although it never worked great over USB in my experience.  I eventually outgrew the mere 2mb of memory the original Zire came with so upgraded to its bigger brother the Zire 21 with a whole 8mb of memory.  This device lasted for a long time until I started to outgrow it too and started looking around for something with more memory and a faster CPU than the Zire 21.

My next upgrade was to the new Palm Z22 which was the successor for the Zire 31 but they shortened the Zire title down to Z.  This model featured a faster processor, colour screen and 32mb of memory which for a Palm at the time was huge.  My only real gripe with this model and indeed the whole Zire series was the move away from the four application buttons that the original palms had: calender, contacts, tasks and memos to just two application buttons: calender and contacts (which I always changed to tasks).  One of the best new features on the Z22 was the new Agenda view in the calender application that showed both your next couple of appointments and the tasks at the top of your task list.

And now I have another new PDA device that is not a Palm for the first time in years. I’ve just recieved a Blackberry 8700v from a family member in the UK who just got a newer model.  My main desire for getting a Blackberry was to combine my mobile phone and PDA into one device. I had been looking at getting a Palm smartphone but then the offer of a free Blackberry came up.  I’m looking forward to getting to grips with a Blackberry after hearing so much about them.  As I’ve never really used a mobile phone for web browsing or email due to text input being so painful, I’ll be interested to see how it is on a device like a Blackberry with a miniature QWERTY keyboard.  I’m also interested to see if the Blackberry works better syncing against Outlook than a Palm device typically does.