Mostly Bollogs, I'm afraid

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



Monday, 31 March 2014

Friend

A friend is someone who'd probably visit you in prison.

A real friend is someone who'd send you a cake in prison, with a file in it.

A true friend is someone who'd prop himself up on that bunk and say to you "we really fucked up there, didn't we?"


Due

Help me out.

Some time ago, I was born. I'm guessing (as it was a while ago) it's because my parents had sex, or something.

I am told that my taxes are due.

DUE.

I have had the shiteist education in the world, from the state, and fuckall else. It seems to me that DUE means that I pull myself together, get up at 5 a.m., go 75 miles at about 90% tax on diesel, earn what I can screw out of someone, and that taxes are DUE.

I have googled "DUE". It says nothing like why I need to pay anything into a huge slushpot so it can go to administration of the NHS, paying for suits to strut about, talking shit, and fund the sort of arsebuckets who get on Jeremy Kyle.

Help me. I'm going postal.

Tuesday, 18 March 2014

Crapiler

I have a compiler which won't compile this. The error is at the bottom.  It's perfectly valid ANSI C, apart from possibly the undeclared array sizes (but it makes no difference if I declare those).

So, C folk, how do I address these without incurring the compilers wrath? I have six other compilers which accept this, but this one won't. The dog.

typedef struct {
    BYTE preamble;
    BYTE packsize[2];
    BYTE target;
} sPacketHeader;

typedef struct {
    BYTE size;
    BYTE Origin;
    BYTE module;
    BYTE version;
    BYTE sub;
} sDCUheader;

typedef struct {
    struct {
        BYTE ADH;
        BYTE ADL;
    } sAD[3];

    unsigned FAN_INITIATE : 1;
    unsigned CLOCK : 1;
    unsigned PLA16D : 1;
    unsigned OVERLOAD : 1;
    unsigned GROUP_FAULT_REPORT : 1;
    unsigned SHUTDOWN : 1;
    unsigned EXCESS_TEMP : 1;
    unsigned FILLER1 : 1;

    unsigned HOT_STANDBY : 1;
    unsigned EARTH_FAULT : 1;
    unsigned OVERRIDE : 1;
    unsigned ENGAGED : 1;
    unsigned LINE_FAULT : 1;
    unsigned AMP_FAULT : 1;
    unsigned MODE_D : 1;
    unsigned HIGH_TEMP : 1;

    // inhibit bits are inverted
    unsigned INHIBIT_AMP_FAULT : 1;
    unsigned INHIBIT_EXCESS_TEMP : 1;
    unsigned INHIBIT_EARTH_FAULT : 1;
    unsigned INHIBIT_EOL : 1;
    unsigned filler2 : 4;
} sAmpData;

typedef struct {
    unsigned ROTARY :4;
    unsigned SELECTED :4;
    unsigned PERMANENT :1;
    unsigned HEALTHY :1;
    unsigned MUX_ON :1;
    unsigned JUMPER :1;
    unsigned filler :4;
} sCageData;

typedef struct {
    sPacketHeader packetheader;
    sDCUheader DCUheader;
    struct {
        BYTE length;
        union {
            BYTE payload[1];
            struct sBits {
                BYTE version;
                sAmpData ampData;
            } bits;
        } u;
    } DCUdata;
    BYTE subcount;
    BYTE checksum[2];
} AmpIn;

typedef struct {
    sDCUheader DCUheader;
    struct {
        BYTE length;
        union {
            BYTE payload[1];
            struct sBits {
                BYTE version;
                sAmpData ampData;
                sCageData cageData;
            } bits;
        } u;
    } DCUdata;
    BYTE subcount;
} sAmpOut;

sAmpOut sao[2];


int main() {
sao[1].DCUdata.u.bits.cageData.ROTARY=1;

// error: unknown member "cageData" in sBits

}

Tuesday, 11 March 2014

Obituary

I'm writing this because I've not heard so much sycophantic bollocks in my life.

Bob Crow died.

He was a trade unionist, and a communist, who never did any good for anyone (apart from himself and his immediate family) in his whole life.

He believed in what he thought was right, because he came from a shit background. He was thick as planks.

To further his members' glorious pay cheques, he worked at least a dozen strikes of the tube service since 2006, making sure that the ordinary workers of London had to pay through the nose for their service, whilst tube drivers (who need no qualifications other than a heartbeat) took away the fat end of £50k p.a. each. And he took the fat end of £150k p.a. and spunked a council house.

The reason they tried to (and hopefully do) lay off the "ticket officers" is because the rest of the fucking union have milked the system for so much that it's unsustainable.

Bob Crow was a cunt in life, and remains so in death.

If you have a problem with that, like this bullshit about "he did what he believed in", read Mein Kampf or Stalin's memoirs.

Fuckwits.

Here is the apology you asked for >.<

I'm desperately searching this bucket of fucks for one that I give, in vain.

No, YOU fuck off.

Tuesday, 4 March 2014

I have written

A blog. I hope you like it.

Friday, 14 February 2014

SQL - the final solution

Two blogs ago, there was a problem. Now there is not. Thanks to Clive Eisen for telling me I was being a wanker.

Here is said solution:

Table:

DROP TABLE MAPELEMENTS;
CREATE TABLE MapElements (Auto int, Element int);
Insert into MapElements values(1,2);
Insert into MapElements values(1,3);
Insert into MapElements values(1,4);
Insert into MapElements values(1,5);
Insert into MapElements values(1,6);
Insert into MapElements values(2,7);
Insert into MapElements values(2,8);
Insert into MapElements values(2,9);
Insert into MapElements values(7,10);
Insert into MapElements values(7,11);
Insert into MapElements values(10,12);
Insert into MapElements values(10,13);
Insert into MapElements values(4,12);
Insert into MapElements values(5,13);

Procedure:

DROP PROCEDURE AlarmHierarchy
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:
-- Create date: <14>
-- Description:
-- =============================================
CREATE PROCEDURE AlarmHierarchy
-- Add the parameters for the stored procedure here
@p1 int
AS
BEGIN
SET NOCOUNT ON;

with cte as (

select auto, element from MapElements where
element = @p1 
union all
select a.auto, a.element from MapElements a
INNER JOIN cte r
on a.Element = r.Auto 
)
select * from cte order by auto, element;
END
GO

C Code (to get hierarchy containing Element 12):

SQLINTEGER iAuto, iElement, dw;
sqlRet=SQLAllocStmt(hDBC, &hStmt);
if (sqlRet!=SQL_SUCCESS&&sqlRet!=SQL_SUCCESS_WITH_INFO)
SQLError(hEnv, hDBC, hStmt, wszSqlState, &pfNativeError, wszErrorMsg, sizeof wszErrorMsg, &howBigIsItThen);
swprintf_s(TSQL, L"alarmHierarchy 12");
sqlRet=SQLPrepare(hStmt, TSQL, SQL_NTS);
if (sqlRet!=SQL_SUCCESS&&sqlRet!=SQL_SUCCESS_WITH_INFO)
SQLError(hEnv, hDBC, hStmt, wszSqlState, &pfNativeError, wszErrorMsg, sizeof wszErrorMsg, &howBigIsItThen);
sqlRet=SQLBindCol(hStmt, 1, SQL_C_LONG, &iAuto, sizeof(iAuto), &dw);
if (sqlRet!=SQL_SUCCESS&&sqlRet!=SQL_SUCCESS_WITH_INFO)
SQLError(hEnv, hDBC, hStmt, wszSqlState, &pfNativeError, wszErrorMsg, sizeof wszErrorMsg, &howBigIsItThen);
sqlRet=SQLBindCol(hStmt, 2, SQL_C_LONG, &iElement, sizeof(iElement), &dw);
if (sqlRet!=SQL_SUCCESS&&sqlRet!=SQL_SUCCESS_WITH_INFO)
SQLError(hEnv, hDBC, hStmt, wszSqlState, &pfNativeError, wszErrorMsg, sizeof wszErrorMsg, &howBigIsItThen);
sqlRet=SQLExecute(hStmt);
if (sqlRet!=SQL_SUCCESS&&sqlRet!=SQL_SUCCESS_WITH_INFO)
SQLError(hEnv, hDBC, hStmt, wszSqlState, &pfNativeError, wszErrorMsg, sizeof wszErrorMsg, &howBigIsItThen);
while(true)
{
sqlRet=SQLFetch(hStmt);
if (sqlRet!=SQL_SUCCESS&&sqlRet!=SQL_SUCCESS_WITH_INFO&&sqlRet!=SQL_NO_DATA)
{
SQLError(hEnv, hDBC, hStmt, wszSqlState, &pfNativeError, wszErrorMsg, sizeof wszErrorMsg, &howBigIsItThen);
break;
}
if (sqlRet==SQL_NO_DATA)
break;
}
SQLFreeStmt(hStmt, SQL_DROP);

Gratuitous picture of Norks :


Thursday, 13 February 2014

Train

Here's another thing.

I used to have a house, once. It was near a railway.

Because some fuckwit decided to top themselves (and I don't offer sympathy, because he was a fuckwit), he decided to do the deed a mile down the line.

So, the Health and Safety Executive thus decided to knee-jerk and insist that the train should blast its fucking abominable horn right outside my house, just in case the next jumper didn't know when to throw his worthless body on the line.

The house was therefore worthless.

This is what the state can do to you, with not a worry, nor a jot of compensation.

Fuck the state.

I now live on a worthless boat having been made skint by them. Fuck them. FUCK THEM.

I have hundreds of stories like this. Yet you still vote. You fucking idiots.