Sam Dutton’s blog

C++, Python and other animals

Archive for the ‘Uncategorized’ Category

Eliza lives!

without comments

...in the form of IKEA's Anna!

Nice top

http://193.108.42.79/ikea-uk/cgi-bin/ikea-uk.cgi

Sample conversation below.

You just said : That's a lovely microphone you're wearing.
I have an outfit that my creators made for me, but because
I'm an IKEA Online Assistant, I don't wear real clothes.

You just said : Saucy!
I'm not sure what you're trying to exclaim. Please be a little more detailed if you can.

You just said : You wear virtual clothes?
I think you're confused or trying to ask me a question, but I need more than that
to give you a proper answer. Please try again.

You just said : Do you sell Volvos?
Transport is not something about which I'm programmed to discuss. Sorry.

You just said : Are you Swedish?
Let's talk about IKEA now.

Written by samdutton

6 June, 2009 at 4:22 pm

Posted in Uncategorized

Wolfram Alpha: don’t ask the wrong questions

with 2 comments

I’ve had a go at the Wolfram Alpha ‘knowledge engine’ preview.

Sadly, in my experience, it’s a bit disappointing: US-centric and effective only in specific, limited domains.

It gave no results for many of my queries, for example:

  • ‘What is the population of Adelaide’ (capital of South Australia)
  • ‘Tim Winton prizes’ (Australian writer)
  • ‘where is Kapunda’ (town in South Australia — misinterpreted as an animal, kakunda)
  • ‘where is Wandsworth, London’ (Wandsworth is a London borough — gives a ‘did you mean wadsworth’ response)
  • ‘why is DAB radio delayed’ (and variations — ‘Wolfram|Alpha isn’t sure what to do with your input’)

Alpha is a great project with a lot of potential – to provide well presented, accurate answers to questions asked in natural language.

But they better be quick or the world — or Google – will move on.

Written by samdutton

12 May, 2009 at 11:08 am

Posted in Uncategorized

Treat Yourself Right

without comments

The UK’s National Health Service is running a good and sensible campaign on how best to seek medical treatment.

Thankfully they haven’t wasted any NHS cash on campaign artwork, resorting instead to pictures from a cheap and very cheerful People of Many Lands clip-art collection:

Treat yourself right

Beware the demented dentist

Unfortunately, their miniature ‘healthcare professionals’ don’t really look like real people. Don’t trust them — they’re zombies! Everyone has nice, healthy pink cheeks — even the black man!  The sweet girl with the almond-shaped face and plaits looks like she sprang from some dodgy old Ladybird story with a title like Little Running Bird’s Big Adventure. The guy with the bag (‘You forgot your lunch!’) is meant to be ‘ethnic’ in some way. Is he Turkish or Portuguese, or a bit of both? And what do his triangular hair and big eyebrows signify?

But… It’s the technology that really worries me. The mad, waving dentist who’s been at the nitrous oxide — wild orange hair, Jaws teeth — has on his head one of those old torch things that doctors used to wear in cigarette ads.  What a fun guy, with his green latex hands! Another man is holding up what I think is meant to be a good-news X-ray, but looks like some scary relic of medical history.

If advertisements for the NHS computer department featured floppy disks and men wielding soldering irons, I’d be tempted to go elsewhere. I suspect that younger patients won’t even recognise these objects from a (thankfully) bygone age.

…and not to be picky, given the NHS’s daily miracles, but the dress sense of their mini-zombies leaves a lot to be desired. I can’t believe my National Insurance is funding their terrible wardrobe. Blue-and-green-should-never-be-seen was never more true, Mr Dentist  — and  big trousers, big red trousers, Mr X-ray White Stripes, I don’t think so…

Written by samdutton

9 March, 2009 at 12:32 am

Posted in NHS, Wandsworth

Tagged with

Bad language must be punished

without comments

It’s time to get tough on the jive-talking jargonistas and lecture-circuit logopaths who persist in ****ing up the Queen’s (or President’s) English.

Renditionable words and phrases listed below.


Cute the first time, but not any more

goodness: when used in techy contexts, as in ‘filled with API goodness’ or ‘pure XSLT goodness’

love: as in ‘we’re loving the new desktop’ or ‘that kitten meme is getting a whole lotta love down here in W1′, ‘get a little API loveliness’

stuff: as in ‘cool stuff for your iPod’

-ista: as in Pythonista, Cameronista, jargonista (see above)

play space, sand pit: as in ‘this is the project play space, this is the sand pit’

Down with the subculture

Any phrase like ‘down with my homies!’ or ‘epic fail!’, uttered by people who should know better: sometimes executives, sometimes after consuming stimulants, sometimes even with hand gestures.

Tough-talking Americanisms

barn storming

boil the ocean

chops: as in ‘Steve Jobs didn’t have the chops to stick it with NeXT’

deep pocketed

spin up: as in ‘once we spin up the project’

tie the bow: as in ‘once Google tie the bow on desktop integration’

No idea what these mean, but I don’t like them

bootstrapping

burndown: as in ‘can someone give me a sprint burndown’

business logic

cadence (in an ‘agile’ project management context)

captured all the givens

convergence in terms of delivery

decisioning

ensemble of features

meme

suite: as in ’suite of applications’ or ’suite of resources’

skinnable

tech spikes

thought leaders

tick all our boxes

user journeys

viral email

walled garden

workstreams

… and these are still bad

around: as in ‘issues around resourcing’ (i.e. problems with staff); a tertiary-educated alternative to the prosaic ‘about’ or ‘with’.

issues: see around. (It’s pathetic to whine when language morphs in ways you don’t approve of, but ‘issue’ did used to be useful, as in ‘a number of complex issues’. Now the word is just a posh or euphemistic replacement for ‘problem’ — which itself is now regarded as harsh, almost rude. Similarly, when I was growing up in Australia, the good word ‘got’ was declared non-U, or even taboo: we were taught to say ‘received a letter’ not ‘got a letter’. An English professor told me that in one school, a teacher took his class outside and made them dig a big hole, then they each wrote the word ‘got’ on a piece of paper and buried it.)

offering: as in ‘Channel 4’s VOD offering’ or ‘the Salesforce CMS offering’, for some reason much loved by IT managers

vertical and horizontal: as in ‘a horizontal slice across a vertical market’

Written by samdutton

26 February, 2009 at 6:42 pm

Posted in language

Tagged with

Snowpersons of Balham

with 2 comments

Written by samdutton

3 February, 2009 at 9:54 am

20 ways to debug Qt signals and slots

with 2 comments

Below are some suggestions for troubleshooting signals and slots in the Qt C++ library.

1. Check for compiler warnings about non-existent signals and/or slots.

2. Use break points or qDebug to check that signal and slot code is definitely reached:
- the connect statement
- code where the signal is fired
- the slot code.

3. Check that the parameter types of the signal and slot are exactly correct and, as appropriate, that they match.

4. Make sure you haven’t added a name to the signal or slot argument: for example, use textChanged(const QString &) not textChanged(const QString &text).

5. Check that the connect argument types and syntax are correct. The connect statement should look like this: 

connect(senderObject, SIGNAL(mySignal(const QString&)), receiverObject, SLOT(mySlot(const QString&)));

Check brackets, check that SIGNAL and SLOT are capitalised and that the sender and receiver are both objects, not class names.

6. Check that the signal is being fired as expected. You can do this with code like the following:
connect(this, SIGNAL(mySignal()), qApp, SLOT(aboutQt()));

7. Check that slots are declared correctly in the appropriate public/protected/private slots sections of your class declaration. Check that you’ve used private slots:, for example not slots:. Check for a colon, i.e. private slots: not private slots.

8. If you use custom signals, check that these are declared correctly, with a void return type, in the public/protected/private signals section of your class declaration.

9. Make sure the Q_OBJECT macro is inserted at the beginning of your class declaration.

10. Check that classes using signals and slots inherit QObject or a QObject subclass.

11. Make sure to run qmake after adding the Q_OBJECT macro to a class. You may need to rebuild your project.

12. Use break points or qDebug to check that slots are being called the appropriate number of times: make sure the connection isn’t made repeatedly.

13. Put all connect statements before functions calls that may fire their signals, to ensure that the connections are made before the signals are fired. For example:

   _myObj = new MyClass();
   connect(_myObj, SIGNAL(somethingHappend()), SLOT(doSomething()));
   _myObj->init();

not


   _myObj = new MyClass();
   _myObj->init();
   connect(_myObj, SIGNAL(somethingHappend()), SLOT(doSomething()));

14. Check that your connections aren’t affected by disconnect statements.

15. Don’t add a semi-colon after Q_OBJECT:

   {
   Q_OBJECT
   ...
   }

not

   {
   Q_OBJECT;
   ... 
   }

16. Check the return value of the connect statement: connect returns true if it successfully connects the signal to the slot.

17. Use QErrorMessage::qtHandler() or qInstallMsgHandler() to view connect error warnings.

18. Make sure that your slot function is declared as a slot, e.g. private slots not private.

19. Use QSignalSpy to verify signal arguments.

20. Follow Qt’s naming conventions for signals and slots:

signal: somethingHappened()
slot: doSomething()

In grammatical terms, signal names are usually constructed from a past participle: changed, pressed, etc. They describe an event or change of state that has occurred. Slot names are imperative verbs and describe an action to be done: clear, setDate, etc.

Written by samdutton

3 October, 2008 at 3:07 pm

Posted in Uncategorized

Tagged with , , ,

Great Interface Mysteries #1: unresizable dialog boxes

with one comment

Lots of dialog boxes in Windows that should be resizable, aren’t.

This is very annoying and completely unneccesary: it’s simple to write the code so dialogs are resizable.

How can this be so after decades of Windows development?

This is one of the world’s Great Interface Mysteries.

Unresizable Windows dialog

Here’s the dialog box that pops up when you edit environment variables in Windows.

The box isn’t resizable so you can’t see all the text without copying it and pasting it somewhere else.

D’oh!

Below is the same but different.

I’d like to be able to see all the commands containing the word show, but I can’t because the box isn’t resizable.

Double d’oh!

The Options dialog in Visual Studio, with Keyboard selected

 

 

 

 

Written by samdutton

23 May, 2008 at 2:34 pm