Posterous theme by Cory Watilo

Python - passing objects to functions...

Bearing in mind that everything in Python is an object - this code:

# immutable object passed to function
def foo(bar):
    g = bar
    g += '44'
    
moo = 'I am '
foo(moo)
print moo    


# mutable object passed to function
def goo(bar):
    g = bar
    g.append('48')
    
boo = ['I am ',]
goo(boo)
print boo


"""
#Outcomes:
I am 
['I am ', '48']
"""

I learnt today that I need to check whether or not an object is actually immutable before passing it off to some strange function out there... otherwise it may never come back the same!

(And if you really want a very long and rambling discussion on why this is so, and how to talk about using the correct terminology, read: http://bytes.com/topic/python/answers/37219-value-reference )

 

Genre Fiction Book Meme

This 'meme' is posted here from Head On A Stick - http://einekleinerob.livejournal.com/5486.html

One for the readers of SF (fiction/fantasy) , "who dunnits" and spy novels (of which I am an occasional fan).  Most of these are series or form parts of loosely-related sets.

If you want to continue the meme:

  1.  Look at the list, copy and paste it into your own journal (removing all the '*'s and '+'s)
  2.  Mark those you have read however you want.
  3.  Feel free to tell your friends what you thought of them.
  4. Add your own favourites...
I've put a star next to the ones I've read, a double-star beside particular favourites, and a plus next to ones where I have read at least one book of the series.

1. **The Lord of the Rings, J.R.R. Tolkien
2. *The Hobbit, J.R.R. Tolkien
3. *The Silmarillion, J.R.R. Tolkien
4. *Foundation series, Isaac Asimov
5. *Robot series, Isaac Asimov
6. **Dune, Frank Herbert
7. *Stranger in a Strange Land, Robert Heinlein
8. ***The Earthsea series, Ursula le Guin
9. **Neuromancer, William Gibson
10. *Fahrenheit 451, Ray Bradbury
11. *The Day of the Triffids, John Wyndham
12. *Book of the New Sun series, Gene Wolfe
13. *Discworld series, Terry Pratchett
14. Sandman series, Neil Gaiman
15. *The Hitchhiker's Guide to the Galaxy, Douglas Adams
16. +Dragonriders of Pern series, Anne McCaffrey
17. Interview with the Vampire series, Anne Rice
18. The Shining, Stephen King
19. *The Left Hand of Darkness, Ursula le Guin
20. *The Chronicles of Amber, Roger Zelazny
21. *2001: A Space Odyssey, Arthur C. Clarke
22. *The Rama sequence, Arthur C. Clarke
23. *The Ringworld series, Larry Niven.
24. +Elric of Melnibone series, Michael Moorcock
25. +The Dying Earth series, Jack Vance
26. +Lyonesse series, Jack Vance
27. *The Chronicles of Thomas Covenant, Unbeliever, Stephen Donaldson
29. The Worm Ourobouros, E.R. Eddison
30. +Conan series, Robert E. Howard
31. +Lankhmar series, Fritz Leiber
32. *Do Androids Dream of Electric Sheep?, Philip K. Dick
33. *The Time Machine, H.G. Wells
34. *The Invisible Man, H.G. Wells
35. *The War of the Worlds, H.G. Wells
36. *Eon, Greg Bear
37. Book of the First Law series, Joe Abercrombie
38. Miss Marple stories, Agatha Christie
39. +Hercule Poirot stories, Agatha Christie
40. Lord Peter Wimsey stories, Dorothy L. Sayers
41. The Maltese Falcon, Dashiell Hammett
42. *The Thirty-Nine Steps, John Buchan
43. **Sherlock Holmes stories, Sir Arthur Conan Doyle
44. +Cthulhu Mythos, H.P. Lovecraft.
45. Inspector Wexford stories, Ruth Rendell
46. Adam Dalgliesh stories, P.D. James
47. Philip Marlowe stories, Raymond Chandler
48. The Godfather, Mario Puzo
49. *The Day of the Jackal, Frederick Forsyth
50. *The Fourth Protocol, Frederick Forsyth
51. +Smiley series, John le Carre
52. Gentleman Bastard series, Scott Lynch
53. The Malazan Book of the Fallen, Steven Erikson
54. Watchmen series, Alan Moore
55. Maus, Art Spiegelman
56. Batman: The Dark Knight Returns, Alan Miller
57. Persepolis, Marjane Satrapi
58. *Harry Potter series, J.K. Rowling
59. Chrestomanci series, Diana Wynne-Jones
60. *Ryhope Wood series, Robert Holdstock
61. +Wilt series, Tom Sharpe
62. *Riftwar Cycle, Raymond E. Feist
63. Temeraire series, Naomi Novik
64. *Chronicles of Narnia, C.S. Lewis
65. His Dark Materials series, Phillip Pullman
66. *Dragonlance series, Margaret Weis & Tracy Hickman
67. Twilight saga, Stephanie Meyer
68. *The Night's Dawn trilogy, Peter F. Hamilton
69. Artemis Fowl series, Eoin Colfer
70. +Honor Harrington series, David Weber
71. Hannibal Lecter series, Thomas Harris
72. +The Dark Tower series, Stephen King
73. It, Stephen King
74. The Rats series, James Herbert
75. *Dirk Gently series, Douglas Adams
76. *Jeeves and Wooster stories, P.G. Wodehouse
77. *The da Vinci Code, Dan Brown
78. **The Culture Series, Iain M. Banks
79. +The Duncton series, William Horwood
80. +The Illuminatus! trilogy, Robert Shea & Robert Anton Wilson
81. The Aberystwyth series, Malcom Pryce
82. Morse stories, Colin Dexter
83. Navajo Tribal Police stories, Tony Hillerman
84. *The Ipcress File, Len Deighton
85. *Enigma, Robert Harris
86. *Fatherland, Robert Harris
87. The Constant Gardener, John le Carre
88. The House of Cards trilogy, Michael Dobbs
89. **The Dark is Rising saga, Susan Cooper
90. Psychotechnic League and Polesotechnic League series, Poul Anderson
91. *Jurassic Park, Michael Crichton
92. Star Wars: Thrawn trilogy, Timothy Zahn
93. **Ender's Game series, Orson Scott Card
94. +Gormenghast series, Meryvn Peake
95. +Miles Vorkosigan saga, Lois McMaster Bujold
96. +The Once and Future King, T.H. White
98. *The Stainless Steel Rat series, Harry Harrison
99. *The Lensman series, E.E. 'Doc' Smith
100. *The Cadfael stories, Ellis Peters

And some personal favourites which were not included but should be:

101. **The Dorsai series, Gordon R. Dickson
102. *The Revelation Space sequence, Alastair Reynolds
103. *Snow Crash, Neal Stephenson
104. *The Chanur series, C.J. Cherryh
105. *The Merchanters series, C.J. Cherryh (Downbelow Station, Cyteen etc.)
106. *Stand On Zanzibar/The Sheep Look Up, John Brunner
107. *The Dancers at the End of Time (series?), Michael Moorcock
108. ** The Modesty Blaise series, Peter O'Donnell
and last (but not least)
109. **The Quiller series, Adam Hall

On being a grown-up

Its a strange word that - "grown-up". Most of us who are older would
use the more common term "adult". But that term seems to be used as
an adjective as well which is not what I am addressing.

Children use the term "grown-up" to refer to someone who is bigger
than them; bigger physically, certainly, but perhaps also meaning
someone is older, wiser and more capable than them. Someone who has
learnt what to do and what not to do; who can make decisions and act
for themselves.

Its hard to really define at what point someone becomes "grown-up".
Is it when you leave school (at whatever age that is)? When you're
old to enough to vote? Old enough to be sanctioned to kill on behalf
of the state? Some societies or cultures have specific rituals that
are carried to mark a passage into adulthood ("grown-up-ness") and
usually the new adult has access to new privileges and new
responsibilities.

I do not think there is a specific cut-off point. I do think that
there are characteristics which mark one as being "grown-up" and I
also think that some people never exhibit these (regardless of age).
The broad - well, very broad - definition that I have been thinking
about recently goes like this:

"A grown-up is someone who can see for themselves what needs to be
done and does it (as capably as possible), regardless of whether
anyone else even knows it has to be done."

A simple illustration. Imagine you driving along a quiet country
road, through some wooded area, late in the day, with the sun about to
set. You are away from the suburban areas, and there is no artificial
source of light around. Just as you approach a bend, you see that an
old tree trunk has fallen over and is lying across the other side of
the road. After a moments thought, you pull over and, after some
effort, manage to push and pull the trunk, which is not as heavy as it
appeared, into the ditch. You get back in your car and drive away.
The sun has set now, so you switch on your car-lights. After a while
your thoughts drift back to the friend you are on your way to visit.

A somewhat contrived situation to be sure, but we encounter smaller
versions of this almost every day. There are those who are oblivious
to anything except that which is directly in their path. There are
those who might notice but would just drive by, muttering complaints
about the poor state of road maintenance and the incompetence of the
workers. Still others who might think about helping but convince
themselves that it was not their problem or that could not manage the
task, or perhaps that they don't want to keep their friend waiting. I
could go on, but I hope I have made my point.

Its the actions we take every day, along our journey, that determine
whether we are becoming more grown-up or choosing to remain like a
child.

Letter to my 16 year old self...

Dear Derek

Some thoughts and insights from your 30-years-older self.

You

Enjoy what you doing when you doing it.  It does not get any better in hindsight.  You do not have to justify who are.

Expectations are really bad for you.  Trying to live up to what you think are other people's expectations is even worse; especially as every one is different!

You can and will change.  That is the basis for life.  There is no fixed "you forever" - just a series of "yous" that are each different in some way.

Love God. He does not have expectations and He loves you in ways that will take a long time to understand.  He cares much much more about who are than what you do.  Talk to Him first.

Your Relationships

Love the person you are with.  You cannot guarantee their love in return (and sometimes that will hurt - a lot) but you will be true to yourself and your feelings.

Be honest. Even more - be honest and open (with love) in your relationships.  This is hard; especially when you have messed up.

Communication in a relationship is just about the hardest thing there is.  It will get better if you listen first, try and understand, and then communicate that understanding back (with as little judgement and assumptions as possible).  Always bear in mind that others are far more fragile than they appear; you cannot avoid hurting them and you cannot "fix" them afterwards; but you can listen and work on changing.

Your Circumstances

Its easy to spend money but hard to save it.  But saving it will have such huge benefits in your future that you must just do it.  Be accountable to someone about your finances.

Things will go wrong from time-to-time.  That is just "the way it is".  The real issue is not that they went wrong but how you dealt with them.

And remember - you're OK!
Derek

PS Post inspired by http://www.dearme.org/excerpt/ (and links to it...)

Thought of the day: Perfection

Shamelessly copied from http://www.business-strategy-innovation.com/2009/12/my-own-tigers-tale.html

The pursuit of perfection is not focused on achieving perfection, it's focused on chasing it. Approached as a process, it can drive breakthroughs. Approached as goal, it can actually block innovation. Perfection is unachievable...it'll never happen. Unless you're Buddha I guess. That's what throws people, at least in our Western culture. We've become impatient with mastery.
Question:If you can't achieve perfection, why bother pursuing it? 
Answer: because you have to. Otherwise you'll always be a follower.

A Hexiles Game: Hex Match Up

"A Simple Game for Two"

Hex Match Up is based on the well-known children's game "Concentration", and uses the Hexiles gameset (see: http://headspace.posterous.com/hexiles-a-gameset-design).

Setup

All the tiles are shuffled and then placed face down and spread out over a flat surface, except for the Joker which is given to one person.  None of the tiles must touch each other.

Play

Each turn, a player turns over three different tiles.  If all tiles are part of a set, i.e. they have matching colors and the same type of symbols, then the player picks them up and keeps them, otherwise they all turned face down again.

The Joker can be used to change one tile after all three are turned over i.e. one tile is turned face down again, and then another flipped over.  As soon as the player does this, they must give the Joker to their opponent.  As before, the player keeps a matching set.

Tiles turned face down must be left in their original location.

Winning

The game stops when only three tiles are left.  The winner is the one who has collected the most sets (out of the 19 available).

Variants

For young children, the game can be simplified as desired. 

For example, players only have to match colors or only have to match symbols.  They could turn four tiles over and see if any three match.  To simplify the game even further, remove one or even two sets of colors.  The Joker could also be omitted from play.

 

Click here to download:
HexMatchUp.pdf (6 KB)
(download)

Hexiles: Sample Tiles

The Thousand-Year Game Design Challenge - see my entry at http://headspace.posterous.com/hexiles-a-gameset-design - requires that at least one image or graphic for the game in question be available.

Hexiles_tiles

 

The image above shows what four tiles from the Hexiles gameset could look like (bearing in mind that the specifications are fairly general). From top left and moving clockwise:
  • One of water eyes
  • Three of light eyes
  • Two of light diamonds
  • One of water diamonds

Hexiles: A Gameset Design

Many experts point to the date of a weblog entry from the year TC.2011 as the first mention of the Hexiles gameset but others dispute this, pointing to earlier, albeit fragmented, records which mention similar concepts. Nonetheless, over a number of centuries, the gameset has gained widespread adoption across multiple systems as a universal gaming tool, in the same way as the so-called "standard" deck of fifty-two playing cards [uniwiki.terra.52CardDeck] was on Terra during the period approximately TC.1300 to TC.2200.  One reason for this adoption could be the multiplicity of ways in which the set can be constructed - there are extant examples dating as far as back as TC.2420 of DuraSteele(tm)-constructed versions (arguably the first application of DS outside of a laboratory); the single-use sets from the ice-bars of Rura IV; and, of course, the renowned jewel-encrusted set, presented to New China royalty in TC.2530, which is on display in the AlphaOmega museum on Cylon III [uniwiki.cylon.NewChinaRoyalty].  Many gamers prefer sets constructed of locally-available, renewable materials.  Beyond the physical construction however, the patterned elegance of the concept and the sheer flexibility of the pieces has allowed them to be adapted to a multitude of uses. Creation of games has engaged the imagination of numerous game designers, players and AIs through the centuries. Specialised games have come and gone - most lost to the mists of history - but Hexiles continues to be used in new situations; the recent "Worlds Of Man" game [uniwiki.hydra.WorldsOfMan] being a case in point.

    Simplified Plain Text Extract from uniwiki (TC.3011.08.01)

 
1000yeargamedesignchallenge

The above forms an introduction to Hexiles, a gameset I developed in response to Daniel Solis "Thousand Year Game Design Challenge".  Read more about this here:  http://www.thousandyeargame.com 

My official entry is attached as a PDF file in order to comply with the competition rules.

For those with some interest, I have a more expanded version (also as a PDF file) which contains my design notes and some other bits.

In time, I hope to create a printable version of the playing pieces and describe some games that can be played with them.

 

Click here to download:
hexdeck_1000.pdf (15 KB)
(download)
Click here to download:
hexdeck_over.pdf (46 KB)
(download)

Getting started with GTD

Just recently, there has been a resurgence of interest in GTD in our company.  Once you decide that its a Good Idea, what do you do next?

There are three key elements to getting started with GTD:

1. Understand the core principles
2. Apply the method on a daily basis
3. Find the tools that best support you

At its heart, GTD is a process - not a set of rules or tools.  Each person will apply this process according to their own situation.  A master craftsman, restoring the Sistine Chapel, will apply it in a different way, using different tools, from someone who is a manager of a large software company.  

The three elements I have noted above should be applied in order to start off with; but you will most likely end up iterating between them as time goes on.

1. Understand the core principles

The core principles of GTD are best understood by reading the book.  Really.  You can attend talks or watch slideshows or read short blog entries, but an immersion in the detail is, I think, essential. Borrow a copy, if needed, but get the full and complete picture.

2. Apply the method on a daily basis

Until you actually start applying the method to your own situation you may not see how it can be useful or relevant.  But it is in using it, as with so many other things you try, that you find out how best to make it work for you.  As time goes by, some aspects will become more important and others less so, but GTD is designed to cover the full spectrum.

3. Find the tools that best support you

This is the one element that many people seem to get stuck in.  I would highly reccomend that you don't start by investing time, money and effort in a particular tool (expensive software or new smart phone or fancy notebooks), but rather make use of what you have.  

GTD has not been developed with a specific toolset in mind; and so you have the freedom to choose what works best for you.  Its likely that you will try (and discard) different ones over time.  Start with something simple, that you already know how to use, and only 'experiment' once you already a firm grasp of the principles and are comfortable in applying the methodology.

I am great believer in the value of paper and pen/pencil as a highly flexible (and very affordable) "starter system".  However, if you use your computer/mobile intensively, its likely that you already have packages that can be easily adapted to support GTD.  A number of people also find that these work well in tandem; read http://www.gtdtimes.com/2011/04/03/the-case-for-paper-based-productivity/ and the accompanying discussion for some very useful tips and insights.

A Final Note

If you really want to get into using paper as the basic GTD tool, there are some very advanced tools and techniques at  http://www.diyplanner.com/templates/official/beginner or potentially useful forms at http://davidseah.com/productivity-tools/ - again, though, don't start here.  Understand the principles and apply them first using an approach that works for you.