Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker.
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: OK, I am officially Freaked Out

  1. #1
    Web Guru Marc J's Avatar
    Join Date
    Feb 2007
    Location
    Edinburgh
    Posts
    3,340

    Default OK, I am officially Freaked Out

    For perfectly valid reasons, I was trying to generate random, valid UK postcodes and came across Random Postcode Generator which does exactly what it says on the tin.

    So, I hit the button, and got one that differs from my own postcode by only the last two letters, and is only 5 doors away from me. Thankfully the matching phone number was nothing like mine!

    I have everything privacy-wise locked up on my browser so there's no way it could have known where I am, and it's given me plenty further afield since, but the first one was almost spot on! What are the chances????

    Anyway....think I'll try the lottery next

  2. #2
    Dinosaur Excalibur's Avatar
    Join Date
    Jul 2006
    Location
    East Yorkshire
    Age
    68
    Posts
    26,833

    Default

    Quote Originally Posted by Marc J View Post
    For perfectly valid reasons, I was trying to generate random, valid UK postcodes
    And to a Man, Woman and Child, the entire MDD are wondering-

    For heavens sake why?
    Excalibur. Older than the average DJ.

    www.excaliburmobiledisco.co.uk

  3. #3
    Web Guru Marc J's Avatar
    Join Date
    Feb 2007
    Location
    Edinburgh
    Posts
    3,340

    Default

    Quote Originally Posted by Excalibur View Post
    Quote Originally Posted by Marc J View Post
    For perfectly valid reasons, I was trying to generate random, valid UK postcodes
    And to a Man, Woman and Child, the entire MDD are wondering-

    For heavens sake why?
    Short answer: MYOB

    Long answer: I'm writing something that needs to test for valid UK postcodes, and I needed some to test it with!

  4. #4

    Join Date
    Feb 2015
    Location
    Reading, Berkshire
    Age
    40
    Posts
    1,439

    Default

    Quote Originally Posted by Marc J View Post
    So, I hit the button, and got one that differs from my own postcode by only the last two letters, and is only 5 doors away from me. Thankfully the matching phone number was nothing like mine!

    I have everything privacy-wise locked up on my browser so there's no way it could have known where I am, and it's given me plenty further afield since, but the first one was almost spot on! What are the chances????
    Yet many of us spend £2 every week actively trying to get 6 numbers we've picked to match 6 randomly picked numbers!

  5. #5
    Web Guru Marc J's Avatar
    Join Date
    Feb 2007
    Location
    Edinburgh
    Posts
    3,340

    Default

    Quote Originally Posted by rth_discos View Post
    Yet many of us spend £2 every week actively trying to get 6 numbers we've picked to match 6 randomly picked numbers!
    Well, the chances of winning the lottery (jackpot) is something like 1 in 14 million.

    There are apparently 1.8 million UK postcodes, so the chances of the above random postcode generator getting yours exactly is nearly 8 times more likely than winning the lottery. So getting mine to all but the last 2 letters suddenly doesn't seem so spectacular....still freaked me out, though!

  6. #6
    yourdj's Avatar
    Join Date
    Jan 2008
    Location
    The New Forest
    Age
    43
    Posts
    7,110

    Default

    Nope loads of random postcodes for me.
    Your DJ - Mobile DJ The New Forest, Southampton & Hampshire. Toby
    https://yourdj.co.uk/

  7. #7
    Imagine's Avatar
    Join Date
    Feb 2014
    Location
    Ely, Cambridgeshire
    Age
    53
    Posts
    2,450

    Default

    Quote Originally Posted by Excalibur View Post
    And to a Man, Woman and Child, the entire MDD are wondering-

    For heavens sake why?
    Not if you're a software developer for a living.....makes perfect sense to me (been there, seen it, done it....enjoy the London postcodes and the variations in lengths)

  8. #8
    Dinosaur Excalibur's Avatar
    Join Date
    Jul 2006
    Location
    East Yorkshire
    Age
    68
    Posts
    26,833

    Default

    Quote Originally Posted by Imagine View Post
    Not if you're a software developer for a living.....makes perfect sense to me
    Oh, well that's alright then. If I were going to BPM you could have explained it to me, I'm sure it would have been riveting.
    Excalibur. Older than the average DJ.

    www.excaliburmobiledisco.co.uk

  9. #9
    Imagine's Avatar
    Join Date
    Feb 2014
    Location
    Ely, Cambridgeshire
    Age
    53
    Posts
    2,450

    Default

    Quote Originally Posted by Excalibur View Post
    Oh, well that's alright then. If I were going to BPM you could have explained it to me, I'm sure it would have been riveting.
    Nah - that's run of the mill stuff.

    As Marc says in his signature at the moment.....In order to understand recursion you must first understand recursion (now THAT's one to get your head around).

    Polymorphism's always a lot of fun too

  10. #10
    Web Guru Marc J's Avatar
    Join Date
    Feb 2007
    Location
    Edinburgh
    Posts
    3,340

    Default

    Quote Originally Posted by Imagine View Post
    Not if you're a software developer for a living.....makes perfect sense to me (been there, seen it, done it....enjoy the London postcodes and the variations in lengths)
    Not to mention postcodes being added all the time! It would be a lot simpler if I only needed to check for the correct format, something like: -

    Quote Originally Posted by Regex
    ^(([gG][iI][rR] {0,}0[aA]{2})|((([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y]?[0-9][0-9]?)|(([a-pr-uwyzA-PR-UWYZ][0-9][a-hjkstuwA-HJKSTUW])|([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y][0-9][abehmnprv-yABEHMNPRV-Y]))) {0,}[0-9][abd-hjlnp-uw-zABD-HJLNP-UW-Z]{2}))$
    But that would still allow invalid postcodes. Looks like the only solution is a database of valid codes to check against. Or http://postcodes.io/ looks interesting if relying on a 3rd party is OK. If anyone's interested, lots of good postcode related code tips here: https://stackoverflow.com/questions/...-comprehensive

    Quote Originally Posted by Imagine View Post
    As Marc says in his signature at the moment.....In order to understand recursion you must first understand recursion (now THAT's one to get your head around).
    You've noticed my ever-changing signature, then?
    Last edited by Marc J; 08-09-2017 at 09:17 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •