PDA

View Full Version : OK, I am officially Freaked Out



Marc J
07-09-2017, 02:58 PM
For perfectly valid reasons, I was trying to generate random, valid UK postcodes and came across Random Postcode Generator (https://www.doogal.co.uk/PostcodeGenerator.php) 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 :beer1:

Excalibur
07-09-2017, 04:16 PM
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? :daft::)

Marc J
07-09-2017, 04:51 PM
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? :daft::)

Short answer: MYOB :p

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

rth_discos
07-09-2017, 06:11 PM
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!

Marc J
07-09-2017, 06:27 PM
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! :eek:

yourdj
07-09-2017, 07:22 PM
Nope loads of random postcodes for me.

Imagine
07-09-2017, 07:35 PM
And to a Man, Woman and Child, the entire MDD are wondering-

For heavens sake why? :daft::)

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)

Excalibur
07-09-2017, 08:36 PM
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. :)

Imagine
07-09-2017, 09:36 PM
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 ;)

Marc J
08-09-2017, 08:09 AM
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: -


^(([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/164979/uk-postcode-regex-comprehensive :rolleyes:


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? ;) :)

DazzyD
08-09-2017, 09:32 AM
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! :eek:

When did you last play the National Lottery??? The 1 in 14m (or 1 in 13,983,816 to be precise!) was the odds of matching all 6 six numbers when the lottery first started and there were only 49 numbers! They've added ten more numbers since then (1-59 now) and the odds of winning are now 1 in 45,057,474! :eek:

Compare this to the odds of being "at least hospitalised after being struck by lightning in the UK" which is only 1 in 883,000 which is still more than twice as likely as you randomly generating your own postcode!

Excalibur
08-09-2017, 09:44 AM
. If anyone's interested, lots of good postcode related code tips here:

:Sleeping:

Marc J
08-09-2017, 09:55 AM
When did you last play the National Lottery??? The 1 in 14m (or 1 in 13,983,816 to be precise!) was the odds of matching all 6 six numbers when the lottery first started and there were only 49 numbers! They've added ten more numbers since then (1-59 now) and the odds of winning are now 1 in 45,057,474! :eek:
I do still do the lottery....but always do it online and always a lucky dip, so never noticed! :eek: :muppet:


:Sleeping:
What are you trying to say? That this stuff is boring? :daft:

Imagine
08-09-2017, 10:25 AM
What are you trying to say? That this stuff is boring? :daft:

You've got to admit it Marc (especially after 20 years in the game as in my case)....it IS boring! That's why we get paid so well to do it in the first place ;)

Marc J
08-09-2017, 10:30 AM
You've got to admit it Marc (especially after 20 years in the game as in my case)....it IS boring! That's why we get paid so well to do it in the first place ;)

Fair point! ;)

Excalibur
08-09-2017, 10:40 AM
What are you trying to say? That this stuff is boring? :daft:

One man's boring is another man's fascinating/ compelling/meal ticket, so no I'm not saying it's boring. :)


Just that I think I've got some paint I need to watch drying. :Laugh:

mattydj50
08-09-2017, 11:18 AM
:Sleeping:

Have you seen a "will to live" heading over your way? :whiteflag:

Marc J
08-09-2017, 12:48 PM
Just that I think I've got some paint I need to watch drying. :Laugh:

How interesting! Did you know, pivotal to its application, the drying mechanism of paint tells us much about its formulation.

The majority of paints dry through evaporation, a process that allows its pigmentation to be set onto a chosen surface purely by being exposed to the surrounding atmosphere. However, the drying process can vary and is often complicated and altered between different paint types.

Paints usually contain three key components: pigments, binders and additives. Pigments are dry, insoluble powders that by wave length-selective absorption (ie they only reflect certain wavelengths) change the colour of reflected or transmitted light, giving paint its colorization. They can be ascertained either naturally or produced synthetically.

The pigments of paint are given their paint structure by binders, synthetic or natural resins such as acrylics, polyesters or oils that impart adhesion and influence durability and flexibility. Crucially, though, binders can also play a role in how paint dries, curing it as well as supplying it with adhesion.

It is important to note that curing is a different process to drying – which, as mentioned before, is caused by evaporation of a solvent – with cure adhesion attained by polymerisation (molecules bonding together in a chemical reaction). Binders are arguably the key component of paint, as without them it would never stick to a surface long enough to dry.

Finally, paint additives help to conjoin the other components and aid application, structure and drying. Certain additives are often used as catalysts for polymerisation, while others are included to prevent the clumping of paint or in order to alter its viscosity.

Riveting stuff!