Just another WordPress.com site

Archive for April, 2006

When Syntax attacks.

Ok, so I’ve got a bizarre situation in C++, whereby two objects on two different threads want to run methods on each other.
 
My solution is to have a public interface which packages up the details of the function call in a struct and sends a message to the thread asking to invoke the function.
 
So I’ve got a nice struct with a function pointer in and all the arguments in. I wanted to have a vector or a queue or some-such so that I could have a generic container and put the function pointer in first and the arguments in in order – but C++ doesn’t like so many different types in an array so I’ve got a struct for each combination of arguments. Fortunately they’re all void func(void) functions so no worries.
 
However, calling the function at the other end is a marvellous example of syntax gone mad. Here’s the call. The pointer to the Invocation object has to be passed as an LPARAM, as windows messages suck.
 
(this->*((Invocation*)pL)->pFunc)();
 
I ended up almost moving brackets and asterisks around at random to get the correct line. I had assumed it would be:
 
(*(this->((Invocation*)pL)->pFunc))();
 
But that didn’t seem to work. Sigh…
 
And for the curious, can you tell me why this won’t work if it’s ported to windows x64 (it’ll work on Win64 as it is though).

Inspiring?

I need the loo.
 
But that’s not going to keep me away – oh no. Nothing so simple. What’s going to prevent me from posting is the fact that I’ve got nothing to say. Well, it would – but now I’ve found a subject.
 
Inspiration:
 
What exactly is it?
Where does it come from?
How can you be "more inspired"?
 
And the answer to all of the above – no idea.
 
I’ve always been good at giving flesh to an idea. Which I’m guessing is where inspiration comes in. I believe that we all have roughly the same number of ideas a day – the people who are better at picking up inspiration are the ones that flesh out their flimsy ideas enough so that they don’t dismiss them. Everyone else just dismisses their ideas, and wonders why their friends are all so creative.
 
So how can you be more inspired? Try this simple brain exercise – take the following ideas and try to flesh them out enough so that you actually give them a chance to be examined properly:
 
  • Ranking blogs
  • Inspiration generator
  • Goat Jackets
  • Toilet entertainment
  • Overflow bladders.

Ok, I’m stopping now – it’s hard to come up with ideas like this because – according to my theory everyone has these sorts of ideas at the same rate, and secondly I really need the loo.

 

Let me know how you get on.

Who stands to gain?

This is the big question you need to ask yourself.
 
And I was asking it this morning. Except I couldn’t remember what I was asking about. Which is a shame because it was a good question. Oh, it’s just come to me.
 
Who stands to gain from Crime?
 
Is it the criminals? Not much crime pays so well that the same skills couldn’t be applied to getting a job – so I’m guessing that a criminal, given the chance, could earn the same money in an easier job. I don’t think it’s the criminals.
 
I could be cynical and say it’s the government. Because they get to terrify us into staying at home, so we can’t get together to organise anything, and then we’ll vote for them because they’ll promise to fight crime.
 
But I’m guessing it’s the porn industry – without crime people would hang around on street corners and meet other people and develop healthy and happy relationships. Which would obviously be bad for the porn industry – so they’re subsidising crime to keep the levels up. Hell, they’re probably shipping porno DVDs to security guards and policemen the world over to ensure they’re distracted and ineffective.
 
Yeah – I could blame a lot on the porn industry.

It’s been a while

So what’s happened recently?
 
Well – apart from the usual "going to work" nonsense. Not a great deal. The insurance company have agreed to replace the GameCube with cash – as they couldn’t source a direct replacement. Which is nice because I’m not sure I really want a GameCube anymore, and I think I may just hang around patiently and wait for the PS3 or Revolution (or whatever it’s called).
 
Apart from that we bought a lovely hand-made book from a stall in the market and we’re making a scrap-book of Cuba. So there’ll be extra photos in there that ellie took on her olde-worlde 35mm camera.
 
I’m going to be starting my new job in July – and I’ve decided to start working on a game demo to show off my masterful skillz (ahem). Me being me however I’ve chosen a whole slew of technologies I’m not familiar with to try to develop it though – so that’ll be fun.
 
There’s not a lot of other news at the moment, but I’m sure I’ll update y’all the moment I think of something.
Design a site like this with WordPress.com
Get started