We've heard of it!
Welcome again to “Who, me?”, The Register’s Monday muck-up in which readers recount their worst mistakes. This week meet “Paul”, who managed to mess up the global insurance industry with a virtual currency. Here’s how. “The year was 1988,” Paul told Who, me? “I had just left school at 16 and started my first job as a …
There's a sadly now departed friend of mine who was ripped off by a local bureau de change. The holiday money he'd changed back into pounds had been done at well above the advertised rates. So instead of getting 75p per unit of foreign currency he got 50p. The "printer has run out of ink/paper" excuse was used so as not to give him a receipt. He was still jet lagged and didn't spot the mistake until a day or so later when he was very annoyed. He went back and complained but with no record of the transaction it was a losing game.
So he went armed with a learning remote control and copied the infra red signals used to change the LED currency display board in the window. Over the next few days he would alter the prices of all the currencies whenever he could. They were offering $3 to the £ one morning and a queue had formed of people wanting to take advantage of this.
@AC Taken from:
In the UK, manufacturing makes up 11% of GVA, 44% of total UK exports, 70% of business R&D, and directly employs 2.6 million people.
The UK does manufacture a lot of stuff. It's all forigen owened or so heavily automated that it employs far fewer people than it did before but don't foget the pound has already been devalued since the vote and depending on what the Brexit terms are it could fall further still.
The UK does manufacture a lot of stuff
Yes, it's now the 8th largest manufacturing nation, just a shade behind France (and the UK is going up, while France is going down). Unsurprisingly the big nations are China, USA, Japan, S. Korea, India, but to claim the UK doesn't have a manufacturing industry is complete nonsense.
@James51 - I think the AC has the usual issue with economic and political facts. You can't trust what politicians appear to be saying, as the actual facts will screw with them.
The most common fallacy is the relating of jobs to industry. Obviously all industries involve some amount of labour, but the major gains in productivity and efficacy involve automating many tasks.
Thus UK industry is about average for a country of it's size, albeit without any specilised industry. The only reason Germany and the Netherlands have "extra" manufacturing is because they make a lot of the tools that go into factories. If you don't include them, then the UK, France, Germany, Italy et al are about the same.
The biggest shift, and this goes for the USA too, is that there is a lot less manufacturing jobs. Hence the perception "we don't make anything anymore" rather than "we make what we used to with ten people instead of 300".
There's also a difference in perception of what "manufacturing" is. Many people don't consider component manufacturing to be "proper" making stuff. Even when it's a moderately complex component, people will often equate assembly with manufacture. Hence the idea that China makes everything, rather than stuff is made everywhere, and then assembled in China.
'The only reason Germany and the Netherlands have "extra" manufacturing is because they make a lot of the tools that go into factories.'
I thought the 'tools' went into Parliament and only occasionally went into factories when publicity was required, like that Gideon character. He certainly looked as out of place as a Politician. At an Olympic Award Ceremony. Watching our politicians at the moment they seem to be behaving as designed, German tools, making a right fist of Brexit.
"The UK does manufacture a lot of stuff."
We had the ridiculous slogan in the 1980s that we live in a "post-industrial age". It was a deliberate distortion of the reality that there would be less manufacturing jobs, to pretend that decline in manufacturing did not matter. it was cynically used to justify the deliberate destruction of the economy outside the south east. It was part of a social engineering policy along with the forced sale of council houses with legislation that prevented councils using the proceeds to build new houses. The goal was to undermine communities which were traditionally non-conservative. The result we have a lopside economy geographically, artifically concentrated in a pampered and subsidised south east and a disfunctional housing market with a catastrophic shortage of housing causing ridiculously high prices and rents. Nothing will change because those in charge benefit from high house prices and simply don't care about anything outside the south east.
@AC - the destruction of the north -- Thatcher's scythe fo destruction over northern England has been likened to the Norman onslaught. That first one crushed the north for centuries, and it was only the Industrial Revolution that made the northern counties fourish again. How long will Thatcher's blight last?
"Come and visit Hastings, then tell me exactly what is 'pampered and subsidised' about it."
The corner of the UK nearest the EU is a relatively poor one. I remember once on a Parliamentary lobby an MP for one of the constituencies there complaining that he kept trying to draw government attention to the fact, but they regarded the entire SE corner of the UK as if it was homogeneous. Of course, it's really London and the Home Counties with a spur to Cambridge, the M4 corridor, Hampshire and Dorset. Bath is part of the South-East nowadays.
In the Soviet Union they had different working currencies for different parts of the country. Workers in military factories got paid in special currency that could buy things ordinary workers couldn't; spivs and high officials could use dollar shops. I wonder if we're headed for the same post-Brexit?
Come to Portsmouth and say that in Paulsgrove/Somerstown areas... or Southampton's St Mary's district for example....
And as for "whaaa northern rail does'nt get any money" come to waterloo and try the pompey express... 1 hour 25 mins to go 65 miles........ that is if the infrastructure/trains does'nt fall over somewhere and block the system up (usually in south London).
Anyway , back to the topic of the mis-placed decimal point, one of my former collegues at a previous employer did that.... moved the robot's reference point 150mm instead of 15mm....
Only did £25 000 of damage ...... with a very loud bang.... the machine was going 2500rpm when the arm hit....
It's an interesting claim but to what extent is it based on the notional heads of companies being there when the profitable work is done elsewhere?
My funds are based in Leadenhall Street and Edinburgh, but I live in neither place and the money was earned from businesses based in the Southwest. In fact, recently I've started moving money to be managed closer to home.
Re: London and the South East subsidise the rest of the country,
Rather depends how you define that. Some might say that London drains investment opportunities way from the rest of the country and gets a disproportionate share of infrastructure investment. It's Cross Rail versus electrification.....
so heavily automated that it employs far fewer people than it did before
This, in large part. In 1994 I worked for a company that made industrial process automation equipment. Not PLCs as such, but loop controllers and process supervision machines, the sort of thing we might call SCADA today. (Some of it was SCADA, but other parts were much closer to the process.
Anyway, I had to go on-site at a British Steel (as it was then) plant at Port Talbot in South Wales, and during that trip, I got to talking with my company's guys in the local office up there. They both had formerly worked at the Port Talbot plant, and they remarked on how at its height, the plant had employed 27000 people(1), and when I went there, it was just 8000.
(1) The site was big enough that I drove in one entrance to the main site offices, from there to the actual building where the problem devices were, and from there to the exit at the other end of the plant, and clocked up eight miles of driving.
Back then there were plans to crate an "heavy Lira" and remove two or three zeros, like France did with the Franc years ago. Then came the Euro and it wasn't needed.
Just if our new government achieve its not-so-hidden plan to leave the Euro, be ready to add again space for a large number of digits... and exchanges rates changing by the minute.
They actually done this with the Romanian currency years ago (LEU/RON).
They took off the 4 trailing zeros, so 50,000 became 5.
When I was over there, both sets of notes were still in use, actually, was fairly straightforward to use, don't know about behind the scenes though I think the currency name changed as well to make it easier to deal with, think RON became LEU
Think I still have a 50,000 note around here somewhere.
Right, they officially dropped 4 zeros and then, to confuse the innocent tourists, they continued to give prices in thousands of Ron. Pleasant surprise, when you pull the big bill to pay the totally overpriced soft drink, just to receive 90% back as your change. Or not, because as a stupid tourist you totally deserve to overpay.
I was, accidentally, there for the changeover; all the banks and ATMs were closed for a couple of days, which was somewhat irritating since I'd turned up without any cash because Romanian lei are hard to come by.
Particularly irritating was that, when the ATMs reopened, they were still dispensing the old notes!
But in currency futures saw an accountant I know put an extra zero in an order for Yennfornthebyear for a large business. Ordering hundreds of millions of pounds worth instead of tens of millions.
By the time he spotted it (end of the day) and it could be corrected (start of the next day) the currency markets had moved.... fortunately they had moved in his favour.
We had a guy once who inserted a new row into a table, offsetting the others. That month we accidentally billed all of our customers using the timestamp field instead of their total charge.
If only one of them had just paid the bill without looking we could all have retired, but no. We had to recall and reissue all those £1.3 billion invoices.
"Old code only referred to the fields by number, $row, $row, so a new column in the middle offset all the subsequent ones."
There's your problem right there. It's an SQL system so nobody of any competence should do that. Had the code been
adapted reused without changes from something older?
I do recall working on a system that took a series of rent payments for a period, stored them in an array and then put them into a series of columns in a single row on the basis that it would be more efficient - not when you had to search all the columns to find out which payment had been missed rather than look for the row with a zero in it.
>> Old code only referred to the fields by number, $row, $row, so a new column in the middle offset all the subsequent ones."
> There's your problem right there. It's an SQL system so nobody of any competence should do that. Had the code been adapted reused without changes from something older?
I've seen plenty of similar examples, written in the last decade or so. Sometimes it's because people aren't experienced developers, but it's also sometimes because people think they're being clever.
As the second comment here notes, in the legacy libraries used by PHP (and presumably, Perl, etc) indexing by the numeric column ID is measurably faster:
(And it's probably still true today, but with modern hardware, I'm guessing the elapsed-time delta is significantly smaller. I've not had enough caffeine, nor do I have enough interest to knock up a test script!)
Personally, I value readability over "optimisations" like this - if you're reading and writing to a database, then disk and network I/O are the biggest factors when it comes to performance issues, usually by several orders of magnitude.
indexing by the numeric column ID is measurably faster
If you only need a few columns but SELECT * then you're losing performance in the amount of surplus data you're cramming into the pipeline from the database.
Personally, I value readability over "optimisations" like this
It's not just readability. It's the fact that such "optimisations" are just errors waiting to happen - as in this example.
Interactively I might write a SELECT *, but that's only the first step to putting together a proper script to get out the data I want. More years ago than I care to think of I wrote a few little programs which would delve into the Informix system catalogs to write code snippets of SELECT, variable declarations & the like which could be incorporated into a program (!! in vi lends itself to that) which would then be edited down to what was needed; just as
effortless lazy as SELECT * but a good deal safer.
>> indexing by the numeric column ID is measurably faster
> If you only need a few columns but SELECT * then you're losing performance in the amount of surplus data you're cramming into the pipeline from the database.
Not to mention what happens under the hood if one of those columns in * is a blob of some form. The expression is "penny wise, pound foolish". Obviously a field index directly converts to a memory address offset so will be faster than an abstraction like a field name, but even that abstraction will likely use some sort of hash lookup internally or otherwise cache on first access, so you can bet your bottom dollar that the difference in almost any real world scenario is too small to reliably measure.
There are occasions to use column numbering, such as computing a row total at runtime for an arbitrary number of columns, but if you're in a position where you need to eek a bit more performance out of your system, there will almost certainly be lower hanging fruit to pick which carries much less risk and gives an order of magnitude benefit over this.
That doesn't even get into the find references to field X in table Y type problems which comes up in the real world quite a lot.
Now, the proper way to have done this, would have been to create a class -- or, since it looks like Perl, a package -- defining an object that matches a single record in the database; with a constructor method to create a new record from an array, and accessor methods which allow you to retrieve one record object or an array of record objects matching a particular key, and retrieve and modify the individual fields within a record object. And so you hide all the ugly SQL plumbing away in methods.
Meanwhile, in the real world, when some tie-wearer who regards writing future-proof, reusable code as mere prettification asked you to make "just a quick change" that you asked them about -- knowing that if they wanted such a thing, you would have to write the program differently than if they didn't -- before you started and they promised categorically that they absolutely would not ask for, and which is going to require you to rewrite the whole lot from scratch to implement, all you can really do is sob quietly into your coffee for a few minutes and then bang something quick out before the next change-of-mind.
> Presumably this wasn't an RDBMS
I can't see how you came to that assumption. SELECT * will include all columns that get added in the future. Many also have the misguided understanding that addressing a field by name is more expensive than by number. One of those premature optimisation consequences.
You can do this sort of nonsense with MS SQL, Oracle, postgres, mysql, and pretty much anything that would term itself as a rdbms and paired with any modern languages like c#, Java, .....
The thing that you can definitely conclude is that pretty much any test case coverage (even manual) would have prevented it from being released.
"Apart from anything else one would hope that columns are being selected into typed variables and that this would likely throw an error if they get out of line. Of course if everything's a string"
SELECT * is fine where you have a properly designed schema and views. It's making things Strings that are not that used to cause me to go librarian-poo with the bounce on the head routine.
Then there are the "programmers" who when not tearing the wings off beetles use things like Hibernate and set it up so that the variable names in Java are different from those in the tables, with slews of XML. Now the schema can't be modified, even if trivially, without modifying the XML...so what was the gain exactly? More maintenance and all so some unfortunate guy in Bangalore doesn't get to learn how to use JDBC.
Hey, I'm retired. Pulse rate down to 58 again, all well.
Biting the hand that feeds IT © 1998–2019