Tuesday 31 August 2010

beating the game

According to this post on the googlereader blog I'm beaten the game by reading more than 300,000 posts. YAY!

Older Men Scam

(Thanks to this post on uk.rec.waterways - I'm pretty sure that this has made it's way across the pond but I found it funny ;-))

Women often receive warnings about protecting themselves at the mall and in dark parking lots, etc. This is the first warning I have seen for men.

A 'heads up' for men who may be regular customers at Sainsburys, Tesco, Costco, or even Asda. A man can become a victim of a clever scam while out shopping. Simply going out to get supplies has turned out to be quite traumatic.

Here's how the scam works:

  • Two nice-looking, college-aged girls will come over to your car or truck as you are packing your purchases into your vehicle. Both start wiping your windshield with a rag and squeegee, with their breasts almost falling out of their skimpy T-shirts.
  • When you thank them and offer them a tip, they say 'No' but instead ask for a ride to McDonald's.
  • You agree and they climb into the vehicle. On the way, they start undressing. Then one starts crawling all over you, while the other steals your wallet.

I had my wallet stolen May 4th, 9th, 10th, twice on the 15th, 17th, 20th, 24th, & 29th. Also June 1st & 4th, twice on the 8th, 16th, 23rd, 26th & 27th, and very likely again this upcoming weekend.

So tell your friends to be careful. What a horrible way to take advantage of us older men. Warn your friends to be vigilant. Asda has wallets on sale for £2.99 each. I found even cheaper ones for £0.99 at the pound shop. Also, you never get to eat at McDonald's. I've already lost 11 pounds just running back and forth from Sainsburys, to Tesco, to Asda, Etc.

Please send this on to all the older men that you know and warn them to be on the lookout for this scam. (The best times are just before lunch and around 4:30 in the afternoon.)

JavaScript trim functions

These are from: Shailesh N. Humbad, and they are really rather cool, check out his site.

function trim(stringToTrim) {
  return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
  return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
  return stringToTrim.replace(/\s+$/,"");
}

arrayValueExistsAdapted(anArray, aValue) JavaScript

/**
 * Tests to see if aValue exists in anArray. Doesn't check to see if the whole of aValue exists but instead looks at the 
 *   string which comes before a colon punctuation mark (":") within each string element within the array.
 * @param anArray - an string array which is parsed, the element which is tested is anything before a colon in each 
 *   element of the array.
 * @param aValue - a value which is compared to the part of the element of anArray which comes before the colon 
 *   punctuation mark.
 * returns true if aValue is found within anArray, else return false. 
 */
function arrayValueExistsAdapted(anArray, aValue){
  var found = false;
  for (var i = 0; i < anArray.length; i++){
    var crumb1 = anArray[i].split(":");
    if (crumb1[0] == aValue){
      found = true;
    }
  }
  return found;
}

Adapted from arrayValueExists(anArray, aValue):

/**
 * Test to see if aValue is present within the elements of anArray, returns true if it does, 
 *   else returns false.
 * @param anArray
 * @param aValue
 */
function arrayValueExists(anArray, aValue){
  var found = false;
  for (var i = 0; i < anArray.length; i++){
    if (anArray[i] == aValue){
      found = true;
    }
  }
  return found;
}

valueToInt(value, up) JavaScript

/**
 * Function which accepts two parameters.
 * @param value - value passed into the function either a float, int or string (containing a number).
 * @param up - boolean value which defines whether returned integer should be rounded rounded up or rounded down
 * 
 * If "up" isn't present then the number is rounded, if "up" is true then the number is rounded up 
 * else it's rounded down.
 */
function valueToInt(value, up){
  var returnValue;
  // From: http://joeyjavas.com/2007/06/25/javascript-how-to-remove-all-commas-from-a-number/
  // If we have a number that's in the format 123,456.00 this removes the commas and gives us 123456.00 
  // which can subsequently be parsed as a float.
  if(typeof(value) == "string"){
    value = value.replace(/\,/g,'');
    try{
      returnValue = parseFloat(value)
    }catch(e){
      returnValue = 0;
    }
  }
  if(typeof(value) == "number"){
    returnValue = parseFloat(returnValue)
  }
  if(!up){
    returnValue = parseInt(Math.round(returnValue));
  }else{
    if(typeof(up) == "boolean"){
      if(up){
        returnValue = parseInt(Math.ceil(value));
      }else{
        returnValue = parseInt(Math.floor(value));
      }
    }else{
      returnValue = parseInt(Math.round(returnValue));
    }
  }
  return returnValue;
}

And to add them back:

function commaFormat(amount){
  var number = '' + amount;

  if (number.length > 3) {
    var mod = number.length % 3;

    var output = (mod > 0 ? (number.substring(0,mod)) : '');

    for (i=0 ; i < Math.floor(number.length / 3); i++) {

      if ((mod == 0) && (i == 0)){

        output += number.substring(mod+ 3 * i, mod + 3 * i + 3);

      }else{
        output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);

      }
    }
    return (output);
  }

  else return number;
}

As per CodeColorizer or here.

Tuesday 24 August 2010

Burnt ankles

On Saturday (21/08/2010) we went kayaking, and it was top - what wasn't top was that we/I went without sun-cream!

Now, #3 had been in the water for much of the previous week so he was reasonably protected, that and him jumping in the water regularly meant that he was perhaps the least affected.

#2 had been wandering around outside a lot and had been at the beach as well so he was a little more burnt, especially on his legs.

#1 was more burnt especially on his shoulder, but what with him being 17 we didn't insist that he keep his shirt on... figuring that he was old enough to make his own decisions about his skin... like his Dad!

After trying to ram another boat we (me and #3), smacked right into a canyon wall and he nearly discovered what it would be like to be crushed by his Dad... whereas I discovered what it'd be like to run my bum down a funnel-shaped, blunt, plastic cheese-grater! Just as well it was funnel shaped though or the last thing going through his head as he smacked into stone wall would of been my arse!

And after catching a glancing blow from another canyon wall to the left of my head and capsizing a treat (lost me trousers, sunglasses and shoes - though managed to get my shoes back!) I started to smell an odd burning smell... little realising that it was the smell of my inner legs burning due to the configuration of the kayak.

I've got a cracking set of blisters on my ankles now... I'll have a wee dram later on in order to work up enough courage to lance them and finally be able to walk properly:

Update:

Just been told to call NHSDirect by her-indoors and they said that I need to raise my legs until the swelling in my ankles goes down (I feel bloody ridiculous... and pregnant!) and pop the blisters (YUCK! I WAS the wrong sort of nurse to be happy about that!) and dress the burns with non-lint dressings (It's not for nothing that I WAS the wrong sort of nurse! I'm going to end up looking like a B movie Mummy dressed by half a dozen kids suffering from ADHD and wired on Caffeine enriched beverages!).

Sunday 8 August 2010

Lucky Boy

I am ever such a lucky boy!

Got my birthday present early and it's a PRS-300. How cool!

I tried the Sony software but I've gone over to Calibre as I really, really don't want DRM content on anything that I own, I now have to find a decent store where I can buy content though...? I tried Diesel for some stuff but they didn't have what I wanted for sale in the UK, arse!

Seems like even if you can find content legally the powers-that-be get all twitched about licensing issues and things go pear-shaped. I know that licensing and DRM are something of a hot-potato (I seriously considered joining the UK Pirate Party) but I now work within the field of sculpting bits to do what I want and I wouldn't want someone to take the code that I write and make money from it without recompense, but all the same...

I read TeleRead regularly and I know that slowly things are getting straightened out but it can't come quick enough for me.

Wednesday 4 August 2010

Anthony & Ashley's Wedding

Had a cracking time on Saturday (31sy July 2010) at the wedding of Anthony and Ashley, we'd like to thank them for a cracking afternoon and evening, just wish I'd not drank enough to sink a battleship so that I could remember getting to bed.

Will have to look around Clacton properly though... ;-)

Was a nice Church as well, especially a having a Reverend who was a Yorkshireman!