Re: Dear Dr Who experts...

2014-10-08 Thread David Matthewman
The hatch isn't in the TARDIS ceiling,  but it's from Destiny of the Daleks 
towards the end of episode 2. I don't have a link, but there might be one.

In 'Dalek' (6th story of season 1 of the new series), a Dalek says 'elevate' 
and then does so. Don't know of a linkable clip, but there might be one. They 
routinely hover in later stories.

Note that a Dalek hovers up stairs at the end of episode 1 of Remembrance of 
the Daleks, and rises with the aid of an anti-gravity disc in episode 4 of 
Planet of the Daleks. It's strongly implied that stairs aren't actually a 
problem for them in other stories - e.g. The Chase, where one appears on the 
upper deck of a boat where the only sensible way for it to have got there is 
hovering up stairs. 

Hope this helps. Am at work, so less able to track down clips.

On 8 October 2014 11:19:04 BST, Nicholas Clark n...@ccl4.org wrote:
Dear Dr Who experts (I'm sure that there are many here)...

IIRC there's a scene in an episode of Dr Who (in Tom Baker's time)
where
the Doctor escapes by climbing up through a hatch in the TARDIS
ceiling,
calling down a one liner to the Daleks stuck below just before he
closes it

1) Am I remembering this correctly?
2) If so, is a clip of this online somewhere, in an easily linkable
form? *


Further, my understanding is that in the more recent episodes, the
Daleks
have figured out how to overcome their previous inability to cope with
stairs, ladders, etc, uttering levitate before doing exactly that.

3) Is there a representative clip of this online?

Nicholas Clark

* please don't post links to places that would make Auntie upset.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


Re: Cool/useful short examples of Perl?

2011-06-09 Thread David Matthewman

On 9 Jun 2011, at 15:16, David Landgren wrote:

 I had all the parts lying around, but didn't realise they were germane to the 
 problem. So, thanks for the cogent explanation.

You're welcome. ;-)

This effect means that:

  if (!something)

and

  unless(something)

don't do the same thing either, whereas from the 'overloaded operator' 
point-of-view *as far as I can tell* they do the same thing. The 'unless' 
statement runs the overloaded '!' subroutine of the class in question, as 
opposed to doing a 'bool' conversion on the class and doing a logical NOT on 
the result of that, which is the other thing it *might* be expected to do.

I just wrote a class to check this. It claims that everything is true 
(especially the lies), and is called 'Garak', ;-)

-- 
David Matthewman


Re: Cool/useful short examples of Perl?

2011-06-08 Thread David Matthewman

On 8 Jun 2011, at 13:17, Tom Hukins wrote:

 On Wed, Jun 08, 2011 at 02:00:41PM +0200, Abigail wrote:
 I'd rather go for sacking people that don't know the difference 
 between 
 
if (something) { ... }
 
 and
 
unless (!something) { ... }
 
 It's sunny outside and pubs are open:  I can think of worse times to
 lose my job.
 
 Or does everyone think they are always equivalent?
 
 I'm not everyone, and with a language as flexible as Perl I hesitate
 to make strong statements involving words like always, but I don't
 recall encountering a situation where they differ.

Their side effects are different. There may be a simpler way to demonstrate 
this, but for instance:

#! /usr/bin/env perl

print unless: ;
print use_unless() . \n;
print if: ;
print use_if() . \n;

sub use_unless {
  my $value = 1;
  unless ($value) {
# nop  
  }
}

sub use_if {
  my $value = 1;
  if (!$value) {
# nop
  }
}

-- 
David Matthewman


Re: Cool/useful short examples of Perl?

2011-06-08 Thread David Matthewman

On 8 Jun 2011, at 13:41, Paul Makepeace wrote:

 On Wed, Jun 8, 2011 at 13:17, Tom Hukins t...@eborcom.com wrote:
 On Wed, Jun 08, 2011 at 02:00:41PM +0200, Abigail wrote:
 I'd rather go for sacking people that don't know the difference
 between
 
 if (something) { ... }
 
 and
 
 unless (!something) { ... }
 
 It's sunny outside and pubs are open:  I can think of worse times to
 lose my job.
 
 Or does everyone think they are always equivalent?
 
 I'm not everyone, and with a language as flexible as Perl I hesitate
 to make strong statements involving words like always, but I don't
 recall encountering a situation where they differ.
 
 $ perl -le 'print $_ == !!$_ ? , $_ == !!$_ ? yes : no for (-1,
 0, 1, 2, undef)'
 -1 == !!-1 ? no
 0 == !!0 ? yes
 1 == !!1 ? yes
 2 == !!2 ? no
 == !! ? yes

Well, -1 may not equal !!-1, but truthwise it's the same, so it's the same to 
an if or unless statement.

I realise this is getting a bit silly, but:


foreach my $test_item (-1, 0, 1, 2, undef, '') {
print $test_item:\t 
. return_truth_by_if_not($test_item) . ', '
. return_truth_by_unless($test_item) . ', '
. return_truth_by_if_not(!$test_item) . ', '
. return_truth_by_unless(!$test_item) . ', '
. return_truth_by_if_not(!!$test_item) . ', '
. return_truth_by_unless(!!$test_item) . \n;
}

sub return_truth_by_if_not {
  my $value = shift;
  if (!$value) {
  return 'non';
  }
  else {
  return 'oui';
  }
}

sub return_truth_by_unless {
  my $value = shift;
  unless ($value) {
  return 'non';
  }
  else {
  return 'oui';
  }
}

-- 
David Matthewman




Re: Cool/useful short examples of Perl?

2011-06-08 Thread David Matthewman

On 8 Jun 2011, at 13:17, Tom Hukins wrote:

 On Wed, Jun 08, 2011 at 02:00:41PM +0200, Abigail wrote:
 I'd rather go for sacking people that don't know the difference 
 between 
 
if (something) { ... }
 
 and
 
unless (!something) { ... }
 
 It's sunny outside and pubs are open:  I can think of worse times to
 lose my job.
 
 Or does everyone think they are always equivalent?
 
 I'm not everyone, and with a language as flexible as Perl I hesitate
 to make strong statements involving words like always, but I don't
 recall encountering a situation where they differ.

If 'something' is 'something  something_else' then you *really* want to put 
brackets around it before adding a '!' at the start.

But that's so trivial it barely needs saying, yes?

-- 
David Matthewman




Re: Cool/useful short examples of Perl?

2011-06-07 Thread David Matthewman

On 31 May 2011, at 15:02, David Cantrell wrote:

 On Mon, May 30, 2011 at 04:27:30PM +0100, Denny wrote:
 On Mon, 2011-05-30 at 15:36 +0100, David Precious wrote:
 if (! Email::Valid-address($email_address) ) {
 Something wrong with 'unless'?
 
 Yes.  Most of the time you'll either have an 'else' or want to add it
 later, and unless ... else is Just Wrong.

Well, in that case, it should be:

  if (Email::Valid-address($email_address) ) {
# Code for if the e-mail address is valid.
...
  }
  else {
# Code you were going to write in the block above.

  }

Otherwise your 'else' block is basically a double negative, and (IMAO) just as 
confusing for an 'else' block for an 'unless'.

OK, I admit, I've found myself wanting to add an 'else' block to an 'unless' 
statement. And it's awkward, but only for the short period of time it takes for 
me to rewrite it as an 'if' with the original code in the new 'else' block.

-- 
David Matthewman