Mostly Bollogs, I'm afraid

But occasionally, a glimmer of truth.
If you find one, please let me know.



Thursday, 20 November 2014

Straight C

I have something that works.

It is GCC and on a 16bit machine, so int is 16 bits.

typedef unsigned int uint16;

#define NO_OF_BATTERIES 2
#define TIME_AVERAGE 5
uint16 aa_timeAverage[NO_OF_BATTERIES][TIME_AVERAGE]={1,2,3,4,5,6,7,8,9,0xa};

uint16* pNewTimeValue;

void main(void) {
    int iBattery=0;
    pNewTimeValue = aa_timeAverage[iBattery]);             // store pointer for new time average value
    memmove(aa_timeAverage[iBattery]+1,                       // destination: element 1
         aa_timeAverage[iBattery],                                         // source: element 0
        sizeof(uint16)*(TIME_AVERAGE-1));                     // shift up Time Values
    *pNewTimeValue=99;
}

If I change it to:

    memmove(aa_timeAverage[iBattery]+1,                      // destination: element 1
        &(aa_timeAverage[iBattery][0]),               // source: element 0
        sizeof(uint16)*(TIME_AVERAGE-1));                          // shift up Time Values

I need to cast as (const uint16 *)&(aa_timeAverage[iBattery[0]) to stop a compiler "suspicious pointer" warning.

Anyone know why?


Thursday, 6 November 2014

Fool

The Government announced today that they are to write to the petrol-selling folk to tell them that the oil price has fallen by 20% and the pump price has only fallen by 5% and that this isn't good enough.

That's a fact.

80% of the price the consumer pays at the pump goes to the Treasury, in Fuel Duty (with VAT compounded on that duty).

That's a fact, too.

Take the price of petrol as £1.25.

80% of that is a quid.

The petrol you're paying for is 25p.

If that falls by 20%, it's now 20p. Add the quid that the Treasury takes, it's £1.20.

Now, 5% off the original £1.25 is 6¼p. So you should be paying £1.25 - 6¼p, which is £1.18¾p.

So you're paying 1¼p per litre too much for fuel, unless you go to TESCO, ASDA, Morrison's. And many others, in which case you're paying less. And you're getting more than 5% off. You can shop around, it's your choice. All petrol is much the same, and there aren't many refiners.

The petrol-selling folk sell a lot of petrol. And they employ a lot of people, who pay tax to the Treasury.

And the government is going to write to the petrol-selling folk to tell them to be fair.

I know who you need to write to.

So now who's a fuel fool?

Any rocket scientists, politicians, mathematicians out there want to argue?



Tuesday, 4 November 2014

Recursion

I'm having trouble getting my head round this.

Monday, 3 November 2014

Those few. Those happy few.

I am humbled by those who fought for our country.

I wasn't there when it was invaded by the Germans, not in the fighting kind of way. I am here now, being invaded by the Germans, whose economy is fucked beyond recognition. Who are now asking us for £1.7Bn to bale them out of the shit in which they've found themselves, because some pillocks thought that joining the EU was a brilliant plan.

Fuck them. Fuck the EU.

Those who fought, against their will, often, for that which we hold dear, who died because we had no choice but to fight the bastards, those good and true men, I hold in the utmost respect. The poor sods.

Those who now fight in silly skirmishes, against brown people with oil, where the MSM report daily if ONE of them has died, no, I don't do that. They would be better off, those happy few, telling the government to stuff their stupid pseudo-patriotic bollocks right up their arses so it brings to mind cancer of the tonsils, and by God I wish they'd have the balls to do so.

Just me. No offence to the proper geezer who did that for the right reasons. I just don't know many of them.

As always, just my opinion.



Wednesday, 1 October 2014

Right

Right, you bastards.

David Cameron was table-thumping today about how he lost a child and how he went to a hospital and how they "loved" him like their own.

I bloody understand that.

I lost a daughter when she was 25, to fucking cancer. You can't blame a party for that.

What you CAN do is to call out some fucking wanker who thinks that going "condolences" to Alice, on fucking Twitter, whose bloody murder was down to inactive, illiterate, fucking stupid Plod and an attitude of Political-Correctness trumps common sense and human fucking decency. Such as Ed "I must extend my Bosh Hizbollah" or whatever shit Jewish pants to all his fucking friends.

If David (yes, he is a fucking poof) Cameron wants to thump a table because he's had enough of this shit, then let him.

I thump the table. Frustrated. Often.

I despise the cunting lot of them.

Don't, just DON'T pan the guy because he has an experience. He has a piece to say.

Yes, they can all fuck off. Labour don't have a monopoly on the fucking NHS.

No, YOU fuck off.

Cameron

On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.

Wednesday, 24 September 2014

Ideal

In an ideal world, everyone would be able to afford everything they wanted, and nobody would ever be ill. The sun would shine in the day and it would rain at night.

There would be no crime, and everybody would be nice to each other.

In the real world, the only way people can afford things is for other people to suffer in order to make them cheaply enough for this to happen. So, unless you stop buying every electronic gadget that comes out, and stop wearing clothes that are so cheap you can throw them away instead of washing them, you're subscribing to that.

The alternative is that everyone earns the same. This would be nice. It used to be the case in East Germany. Unfortunately, the "same" meant that nobody could afford anything, because the world doesn't spin like that. Nobody, apart from Mother Teresa of Calcutta, would want to train for years to work 25 hours a day as a doctor when the bloke whose job it was to pick strawberries for two hours a day in the sunshine earned the same and didn't have any responsibility.

Everyone could have a nice car, but that car would be a Wartburg Tourister. I had one. Trust me, you wouldn't want one.

People get ill because the human is a bit of a shit design, and if God had done a bit more work instead of resting on the seventh day, that might be different too. But it isn't.

Ditto the sunshine. The earth is round, and because of the way it revolves and where the sun is and complicated stuff like that, the Sahara is hot and dry and Norway is dark for half the year. In a few years, Britain will be less wet and more hot, and in yet another few it will be wet and cold again. It always has been and always will be.

Criminals will always be with us because we're not all doctors. Some of us are thick and we don't earn as much as the doctor up the road, so we steal. Especially if we're big and a bit nasty.

I think even the nasty Tory voters would like everything to be wonderful. The difference between the nasty Tory and the idealist Socialist is mainly their view of reality.

I would vote for Miliband, Balls or Hitler if there was even an outside chance that the world would end up with any form of equality, and everyone would live happily ever after.

There is no chance. It can't happen. A pint pot will not hold a quart.

Under any government, you CAN'T afford everything, you WILL get ill, it WILL rain at Glastonbury and there WILL be floods. Some people WILL always hate you, because they can, because they don't understand you.

And you WILL keep buying shit from Primark. You will NOT give a stuff about the Indian who can't afford to feed their kids. Because the iPhone is shiny.

And you WILL go and vote next year, for one lot or the other, because you always do, even though they lie to you, cheat you, then make hollow apologies to match the hollow promises.

I won't. And I've bought a lottery ticket.