Archive for July, 2009

Finding new iPhone apps

Friday, July 31st, 2009

To monitor new releases on the iPhone, use this URL:

http://www.macworld.com/appguide/browse.html?sort=new
[ad]

Comcast Are Idiots

Friday, July 31st, 2009

I’ve had comcast cable and broadband for a few months now. The broadband service is fast (when it works) although it seems that DNS services are slow and the overall effect is pretty sluggish. But nothing has been bad enough to make me put in the effort to change providers. Recently we moved house, and the guy who connected us up decided to give us a new cable box and modem, although he left the old ones with us for some reason. I called them last week to get somebody out to pick up the old ones, and to run a new cable while he was there.
I got home last night to find out that neither my cable or broadband service worked. I called comcast and was shuttled between about ten people before reaching a tech support person who told me that he could see that my services had been cancelled by someone in billing because my equipment had been returned. This was almost funny, but he said that since billing was closed he could not do anything about it, I’d have to call back in the morning. A simple database update and he’s be able to turn it back on in five minutes, he said. Thus I got an entire evening without broadband. But then this morning I call billing who tell me that I was the one who cancelled the service, that I have no equipment because their system shows it was returned, and that it will require a technician visit to the house with new boxes to restore service. I protest that I have boxes – please just mark the account as opened and transfer me to somebody with a brain in tech support. Nothing doing. I got nowhere with the guy for five minutes (Him: “Please give me the serial number of your box” me: “I’m at work and can’t give it to you” Him: “So you don’t have a box”). I finally called him an idiot and demanded to talk to a superior, at which point he cut me off. What does it take to get a company to employ reasonable intelligent, or even remotely helpful, people to answer its phones? Anyway, I’m going to calm down a little and try again. But I’m also going to order DSL from speakeasy about whom I hear nothing but good things, so I really will be canceling comcast in about two weeks.
[ad]

Finding cool free on sale iPhone Apps

Thursday, July 23rd, 2009

Here’s a tip – if you’re as in to free iPhone apps as I am, use the following link to find apps that have recently been made free -

http://www.macworld.com/appguide/browse.html#prices=Free&sort=onSale&dir=desc

And here’s one to find recently-released free apps

http://www.macworld.com/appguide/browse.html#prices=Free&sort=new&dir=desc

The AppStore doesn’t make this kind of search very easy, so this is a good work-around.

[ad]

Installing Subversion on CentOS

Monday, July 20th, 2009

I just went through this and it was a little painful due to incomplete documentation, so I’m summarizing the steps I took here – mainly for my own reference but also in case anybody else needs to do the same thing. Note – this does not cover using Apache to serve the repository remotely, this is a local install only. I’ll deal with Apache when I get round to it.

1. Installation
yum install mod_dav_svn subversion

This grabs the basic subversion packages, and resolve any other dependencies you may have.
When complete try typing:
svn -help
to make sure that all is well and that svn runs.

2. Configuration
Now you can create the actual repository from which you will check in and out your files.

mkdir /var/svn
cd /var/svn
svnadmin create repos

3. Creating projects
The recommended repository directory layout is as follows:

|– project1
| |– branches
| |– tags
| `– trunk
`– project2
|– branches
|– tags
`– trunk

To start with, we’re going to create a simple project:

mkdir proj1
cd proj1
mkdir trunk tags branches
vi trunk/main.c

Edit main.c to contain your code. Now we can add this project to svn.

3.1. Importing
To add your code to the repository do this:

cd ..
svn import proj1 file:///var/svn/repos/proj1 -m “Initial checkin for proj1″

3.2 Checking Out
To create a working copy of the project, you need to check it out. To do this, do:

mkdir work
cd work
svn co file:///var/svn/repos/proj1

3.3 Edit and Update
Modify the copy of main.c you just checked out:

vi trunk/main.c — Add or delete something and save.

And then check in your saved file:

svn commit -m “Modified main.c”

Similarly, if you add a new file to the project, this command will add them to the repository. To delete a file use the delete command:

svn delete trunk/main.c

To recover a previous version of a file, co with the revision number:

svn co -r file:///var/svn/repos/proj1

If you’re not sure which revision number, check the logs:

svn log file:///var/svn/repos

or

svn log file:///var/svn/repos

4. And more

This should be enough to get you started, but there are lots more commands to explore, and of course this is just a local install – svn becomes really powerful when it is set up as a remote server. I’m going to wade through the docs to do that myself next and I’ll record the results here. The svn bible is :Version Control with Subversion.
[ad]

Kippers

Monday, July 13th, 2009

I had to post this because right now I’m in a state of gastronomic elation – I just had the best kippers I can ever remember eating. In desperation more than I had a case of frozen kippers shipped from a company on the east coast, not really expecting anything special, but they are amazing. Shipped in a polystyrene box filled with dry ice, thawed and cooked in foil on the barbecue with a little butter – amazing. Kind of expensive but worth it.

Bank Bonuses

Thursday, July 9th, 2009

How many ways can we as tax-payers protest at the payment of any single penny in bonuses to the employees of any institution which received a single penny of bail-out money. It is irrelevant whether they paid that money back or not – the fact is that without that bailout those companies would have closed down, and they would have ceased paying salaries, let alone bonuses. There is no valid argument about staff retention or incentives – the fact is that we should treat each of those companies as if they were bankrupt and their employees as recipients of government hand-outs. I say again – there is no, and indeed there never was one, valid reason to give them a penny of our money.

Google OS

Wednesday, July 8th, 2009

I’ve said before that I’m not really a fan of Google, but it seems to me that a lot of the reaction to their Chrome OS announcement has been overly negative. Much of it centres on the supposed limitations of the OS, especially with regard to running large complex apps. I think this is missing the point. The OS seems to be aimed at the netbook segment of the market – hardly the first choice to run large complex apps anyway. Netbook users want a quick way to access data stored on other machines, across the internet, and dare I use such a cliched term, in the cloud. It seems that the day of the Network Computer (which I was involved in over a decade ago) may yet be dawning. Back then the idea of remote data and applications was a little too revolutionary but now people are used to it. And anyhow – assuming Google base Chrome OS on linux and give it a good UI (the missing piece in all Linux distros to date – cf with what Apple did to BSD with OSX) then that alone may garner it sufficient support in the technical community to make it a success. And with that kind of basis, and a decent effort at a Windows emulator like Wine, it could be at least the start of a credible alternative to the Redmond offering. I’m not denying it’s a tough market to try and break into, but I really wouldn’t write Google’s efforts off at this early stage. The world is changing and Google are as likely as anyone to find a way to take advantage of those changes.
Here’s a prediction – the last remains of Microsoft will be the Exchange server. When their OS monopoly is a dim memory and their applications are treated a legacy apps, the Exchange server will still be serving corporate mail and calendars across the world. I’d say that the clients displaying said mail and calenders will be predominantly non-MS, but the server will still be there.

jQuery for Programmers

Thursday, July 2nd, 2009

As promised, I’ve written a brief overview of jQuery for old farts experienced programmers like me, who just need a brief overview to get them started.

The main function of jQuery is to select elements of the HTML page’s DOM tree. The jQuery function itself does this, and its arguments are selectors to specify which elements to return. The jQuery function also has an alias – the $ sign can be used instead of typing out jQuery.
To select elements based on id, use

jQuery(#id)
or
$(#id)

to return all elements with id id (cf with document.getElementById which returns the first element with the given id.
To select elements based on class name use

jQuery(.className)
or
$(.className)

to find all elements with class name className.

Note how the .id and #className formats borrow from css.

Finally you can select by tag name, thusly:

$(tagName)

where tag name is the name of the HTML tag you’re searching for – $('a') to find all anchors, for example. These can be combined in many ways, for example:

$('a.home')

to find all anchors with the class ‘home’, or

$('div.share')

all divs with the id ’share’. Or even

$('a[@href^="http://www.example.com"]')

which returns all links whose href attribute starts with http://www.example.com. Note that the @ sign is used to represent attributes, in common with XPath.

So far, so simple. Most of this functionality is equivalent to existing JavaScript functions, for example document.getElementById, although in a much simpler and easy to use format, and with a rich query language built in. The result of the query isn’t just the JavaScript object or DOM element though – it is a jQuery object with a lot of additional functionality built in. In fact it can be an array of jQuery objects which can be acted on together, similarly to the resultSet from a SQL select. There are lots of methods that can be used on the result, but here are a few of them:

alert($('a$test').html())

to generate an alert displaying the text of the link element with the id test.

$('a').html('Link1')

to change the text of all links on the page to ‘Link!’.

$('li').css({color: 'red', backgroundColor: 'blue'})

to change the css attributes of all

  • items.

    var c = jQuery('li$id').css('color')

    to save the color of the selected element.

    The most powerful feature of jQuery though, I think, is its support for Ajax. To dynamically change the content of an element with an Ajax call, just do this:

    $('div#placeholder').load('/external/address.html')

    invokes a call to /external/address.html and puts the resulting HTML into the div with id placeholder. How simple is that. And there are event handlers to allow this basic functionality to be modified – for example displaying loading indicators or changinh attributes to indicate success.

    Events are what makes all the magic happen in jQuery – you can hook on to events for clicks, hovers, button presses, etc. and invoke functionality appropriate to that event. The most basic is the document ready event, which is accessed like this:

    $(document).ready()

    This is invoked when the HTML DOM has been loaded. To do something useful on document ready, for example, we could do this:

    $(document).ready(function() {
    $("a#link1").click( function() {
    $("p.vanish").toggle(100);return false;
    });
    });

    And if that weren’t enough there are bunch of additional packages built on top of jQuery that give a lot of great functionality for free – two that I have used recently are a carousel control and a history package that allows the back and forward button to interact with Ajax based pages. I’ve got notes on both of these that I intend to post here sometime.

    This is a very short introductory overview, I hope to be able to expand it in the future, but in conclusion jQuery is a very powerful package, and what’s more it’s actually fun to use. Highly recommended.

    [ad]