With the increase of contactless payment in the UK, I’m finding that increasingly often when paying by contactless card that the person at the till takes the card out of my hand and places it on the contactless reader for me. Surely this removes all ‘security’ of contactless payment?
In summary the process works as follows:
1. You’re issued with a contactless compatible card which features a logo similar to the Wi-Fi logo on the card: http://productreviewsuk.co.uk/wp-content/uploads/2011/01/barclayscard.jpg
2. The contactless compatible reader prompts you with a price, green light and if the purchase is less than £15 asks you to present your card for contactless, else insert it as usual
3. You hold the card on the reader, wait for all the green lights to fill and then wait for an approved message
4. Leave with your shiny new item (or in my case lunch!)
Here’s a YouTube video showing how it works if you haven’t had a chance to use contactless http://www.youtube.com/watch?v=JBQjxY-3_uU&feature=player_detailpage#t=34s
I know how to use these readers, I actually think it’s very clear and easy to use. I’ll wait for the prompt, check the price and then present the card for payment. However, as mentioned in my introduction, the person at the checkout keeps on taking the card from my hand and placing it on the reader, meaning I don’t have a chance to confirm the price, I could be paying up to £15 without my direct consent.
The problem however is that this is becoming the social norm, and when I’ve mentioned I’d prefer not to handover my card to the cashier I’ve been made to feel like I’m being deliberately awkward or taking control for the sake of it!
What do you think? Have you experienced the same thing? Is there anything that could be done to ‘fix’ this? Should cashiers be given extra training and guidelines on specifically not doing this?
I’ve often wanted to display a progress indicator to let a user know something is happening while a program is doing its work. It’s surprisingly simple to add a little notification.
In this example using SCP, I’m demonstrating how to grab the process id (pid) and then do something while that process is running.
This displays a simple spinning icon.
/usr/bin/scp me@website.com:file somewhere 2>/dev/null
pid=$! # Process Id of the previous running command
spin[0]="-"
spin[1]="\\"
spin[2]="|"
spin[3]="/"
echo -n "[copying] ${spin[0]}"
while [ kill -0 $pid ]
do
for i in "${spin[@]}"
do
echo -ne "\b$i"
sleep 0.1
done
done
Hope this is of use!
It’s surprisingly easy to add syntax highlighting to your blog (or any website):
Google has a javascript library called Prettify that does all the hard work for you: Google’s Prettify
Prettify is simply to install. The code below automatically adds the prettyprint class to any <code> tag. Alternatively, you can leave out the script and add the class manually.
<!-- For Syntax Highlighting -->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css"></link>
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></script>
<script>
function styleCode() {
if (typeof disableStyleCode != 'undefined') { return; }
var a = false;
$('code').each(function() {
if (!$(this).hasClass('prettyprint')) {
$(this).addClass('prettyprint'); a = true;
}
});
if (a) { prettyPrint(); } } $(function() {styleCode();});
</script>
This assumes you don’t already have jQuery.
When posting code, use a text editor to change all the angle brackets to < and > and enclose it in <pre><code></code></pre> tags. The <pre></pre> is necessary to keep the formatting.
Note: The highlighting won’t show up in RSS feeds or the dashboard.
If working with Sybase, having got used to MySQL which more database users have experience you may soon discover you are unable to escape single quotes with backslash in.
So how do you escape quotes in Sybase? In fact, in Sybase SQL the single quote acts as the escape character.
See below for an example UPDATE statement in both “languages”:
MySQLUPDATE Animals SET NAME = 'Dog\'s friends' WHERE uid = 12
SybaseUPDATE Animals SET NAME = 'Dog''s friends' WHERE uid = 12
I’m not entirely sure this makes sense to me (especially as it looks like a double quote) but there you go!

Yesterday, to my dismay, a colleague told me about a new website they’d found called Student Gems (http://www.studentgems.com).
I went to look it up, only to discover that it matched (almost feature for feature) a functional spec I wrote back in 2009 when I’d first started University.
Back then I was getting freelance web design/programming work at freelancer.co.uk and making a pretty decent hourly wage.
It then struck me that at my University there was an entire pool of expertise and experience in these fields that had yet to be tapped into. A pool of people who were mostly looking for additional income (we were students after all).
It was going to be easy, I’d build a website that would allow companies to post jobs (spec sheets), and students would bid on jobs they felt like doing. The company would get to choose who they “awarded” the job to and would get high quality work at a low cost and the student would get some experience or work to add to their portfolio along with some extra cash.
However it’s not all that easy, as I was studying (or organising society events) I never got round to building the website and only wrote up a functional spec.
This is where the title of the post comes in, at the time I was researching outsourcing the bulk of the work to another freelancer who has the time to work on it, but I simply didn’t have the funds to pay someone to build such a project. Perhaps if I had some extra money, I could be the owner of StudentGems and be making a tidy profit.
So, good on you Student Gems, I wish you every success in your growth and just wish I could have been a part of it!
So what have I learnt? If you have an idea, pool the resources you have (for example I could have pooled the resources of my web designing buddies for a share of the ownership); keeping an idea to yourself isn’t the necessarily going to keep it safe and if you want to make something good you have to make it happen, whatever the cost (within reason of course)!
TLDR takeaways:
- If you have a great idea jump on it
- Time is money, it’s likely someone else has also has your idea!
- Use your network to your advantage

Recently someone made a change to an API I use extensively, changing one of the calls from .save() to .saveAll(). I had to find every use of the API and change it, literally hundreds of instances.
After some man on sed and some Googling for how to use sed to to a mass find and replace across many files; I found you can use Grep to seach, xargs to pass and sed to change the content.
grep ".save()" . -Rl | xargs sed -i 's; .save();.saveAll();g'
Where:
grep “.save()” .Search for all files with .save() in. -Rl Only return the file name| xargs Pipe to xargs xargs sed -i Run the command sed’s; .save();.saveAll();g’Search (and replace); looking for .save();
replacing with .saveAll(); globally
Hope this is of help to you!

I ran into some problems this morning with not being able to insert multiple lines using sed. My objective was to insert multiple lines before a search pattern in a group of text files
Errors like
In the end the following code did the trick
line=$(sed -n '/SearchPattern/=' fileName.sp);
line=$(echo $line | cut -d " " -f 1)
sed -i "${line} i \\
/* Comment */ \\
Line 1 \\
Line 2 \\
" fileName.sp
Where in the first line:
Line=$(assign a variable
Sed -n get me the line number
‘/SearchPattern/matching the search pattern
=’ fileName.sp);
in the file filename.sp
In the second line:
line=$(assign a variable
echo $lineecho the line number from before (could be multiple)
| cut -d ” ” -f 1)
take only the first number (cut on space and take the first field)
And in the third set of lines:
sed -Isearch
using sed “in place”
${line} i at line number $line insert
\ new line
/* Comment */ \ line one of insert
Line 1 \ line two of insert
Line 2 \ line two of insert
” fileName.spIn the file fileName.sp
Hope you find this of use!

The new Twitter app for iPhone is pretty good, however it is not without its pitfalls.
I’ve been meaning to write about this for a while because I often stumble across a problem with one of its new features.
In the new app the application itself takes control of the status bar of the iPhone (with the black bar), while this is a great space saving way to show me information it also provides inconsistency with the rest of the phone.
As Ben Shneiderman outlined in his text Designing the User Interface; consistency is one of the “Eight Golden Rules of Interface Design” [1], he specified consistency as: “Consistent sequences of actions should be required in similar situations; identical terminology should be used in prompts, menus, and help screens; and consistent commands should be employed throughout.” However in summary this is simply, the interface should work how you expect it to work.
An interesting example of this being ignored that we encounter in everyday life is door handles, we all know that a flat surfaced door is a “push” door and the one with handles are pull doors; why is it then that so many shopping centres and offices have handles on their push doors? I’m sure you’ve been caught out by this before.
To return to the Twitter app; often I’ll send a tweet (perhaps about an amazing new band no one else has heard of I saw on the way to work) and it will stall at the sending tweet stage.
In other apps I’d check the status bar and see my phone is connected to a Wi-Fi hotspot (one of those “free” ones around London) so it can’t get past the advert page; or perhaps my phone doesn’t have 3G so the tweet will take longer than usual to send; perhaps I don’t have any signal at all?
In the new app I cannot get any of this information without returning to the home screen, and must wait around 1/2 minutes for the tweet to fail and move to drafts. This is inconsistent and makes the application harder to use.
In summary; I hope in a new update they’ll return the info bar to its original state or come up with another way of displaying the information.
Do you find the same? Do you have any other apps that provide a slightly confusing UX? Let me know!
If you are getting errors such as the below when trying to rsync with the -p flag (often included by mistake as part of -a) then you need to use a slightly different rsync command.
root@tent:~$ rsync -av —delete /backup/ user@mywebsite.com:~/folder/
building file list … done
03-05-11/apache/
rsync: recv_generator: mkdir “/home/tentbackup/dabackup/03-05-11/apache” failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
03-05-11/bind/
rsync: recv_generator: mkdir “/home/tentbackup/dabackup/03-05-11/bind” failed: Permission denied (13)
The correct way to do this (though it does change the permissions so you can’t just restore from backup if these were important) is to add the following to your rsync command
--no-p --no-g --chmod=ugo=rwX
So it looks like
rsync -av --no-p --no-g --chmod=ugo=rwX --delete /backup/ user@mywebsite:~/folder/
Where
--no-p disables permissions copying
--no-g disables group copying and
--chmod=ugo=rwX ensures that all non-masked bits get enabled

(Source: serverfault.com)
Theme by Simon Fletcher. Powered by Tumblr.
© Copyright Pez Cuckow 2012