Recently James Grime of numberphile-fame posted a puzzle on YouTube. The video is right here but the question is (if you don’t care to watch): „How many ways are there to completely fill a Noughts and Crosses (tic-tac-toe) board, with four noughts and five crosses? Not including rotations and reflections.“
So I am not much of a mathematician and I also did not really care for fopping about much so I wrote a small program in python to find the solution. And I took the chance to make a post about generator expressions in python as well.
A generator expression can take two general forms:
c = 10
while c > 0:
c = c - 1
Here the yield keyword is what it’s all about. This will generate an iterable object that returns the yielded items. The cool thing is, that computation of this method is suspended until the next item is needed.
If you already have an iterable you can create a new generator expression from it:
g = (x for x in gen(10))
Here you can filter or map the value of x as you will see. And again, this is only a generator. No computation happens unless you actually want to print any values or you manifest them into a list.
you will find the source code of my solution below the fold
There are more films coming where a bad actor’s daughter gets taken.
But this one seems like it might be fun. I think Stalone is way too bad an actor to take himself very seriously and I like the idea that he does what needs to be done and the cop with him can do nothing because he needs it done as well.
I see lots of comedic potential. Will make for an average but lighthearted movie. I approve.
I think Nicolas Cage might have a particular set of skills. For example: having only two facial expressions which sets this film up to be hilariously bad. But the craziest thing about this trailer must be the ridiculous 90s-style narrator telling us the story of how Liam Neeson’s daugther gets taken (or that is what you could easily assume, if you weren’t watching the incredibly bad performance Cage displays – even in this cut-together piece of cinematic non-history).