Re: DBD::SQLite confusion

2002-12-09 Thread Leon Brocard
Kate L Pugh sent the following bits through the ether:

 Hello.

Hello.

 Is there a way of making SQLite behave in the same way as MySQL?

The problem is that SQLite uses C strings, so you can't store NULL
characters in them:
http://www.hwaci.com/sw/sqlite/faq.html#q12

I've attached a test script which works by base-64 encoding and
decoding it. Isn't this a pain? ;-)

% perl sql.pl 
Before: 8
Before: cafebeefbabe, 2
After: 8
After: cafebeefbabe, 2

Apart from this little issue, I really like SQLite, Leon
-- 
Leon Brocard.http://www.astray.com/
scribot.http://www.scribot.com/

... This is only a test



sql.pl
Description: Perl program


Party invite on behalf of Gordon Tytler

2002-12-09 Thread Ivor Williams
Hi all,

Gordon (who was around at last Thursday's social meet) has asked me to post an 
invite to the list, for his party on Saturday. He's not subscribed himself 
(shame!)

===

Saturday 14th December 7pm
14 Mayfield Gardens, Hanwell, W7
Ealing Broadway Tube - E1 bus

Shake your floor subwoofer
Loud RB dancing, Auzzie ex-patriot and geek party with posh nibbles and nice 
booze.
===







Re: Crazy maths proof

2002-12-09 Thread Jonathan Peterson


Chris Ball wrote:

So, another maths exercise.  I'll award a pint at the January social
meet for the first correct post with the next number in the sequence,
and another for an explanation of the sequence itself.

   2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 60


The next number is 61, then 67

These are orders of simple groups, only a newbie would be sidetracked by 
the whole prime numbers thing.

I don't know what I'm talking about but the sequence appears in google, 
so it must be right. See:

http://www.google.com/search?hl=enlr=ie=ISO-8859-1q=%2237+41+43+47+53+59+60%22

I love google and it loves me.





--
Jonathan Peterson
Technical Manager, Unified Ltd, +44 (0)20 7383 6092
[EMAIL PROTECTED]




Re: Perl and Time zones.

2002-12-09 Thread Lusercop
On Mon, Dec 09, 2002 at 02:23:52AM +, David M. Wilson wrote:
 On Sun, Dec 08, 2002 at 11:27:09PM +, Lusercop wrote:
  6 - Games
 The maddest bit of it all is that games have their own man page section
 -- even on commercial unixes. What the hell?

I don't suspect it was a particularly thick section in the original UPM.

 I mean, take section 2 for instance, it could be split up. Then take 3,

OK, I'm going to bite, what do you think the split should be for section
2? I can think of a few, but they'd end up with stupid little sections,
and I'm not sure that that's helpful. After all, where do you put functions
like select(2) which have been used variously as an alternative to
nanosleep(2), and obviously is often used in non-blocking sockets, and is
occasionally used with blocking systems too. It's certainly better than
alarm(2) for doing sub-second timeouts. Bear in mind also that the original
UNIXes (certainly my copy of Lions' v6), from which the UPM derives had
many fewer syscalls than we see in modern UNIXes. A lack of networking
significantly reduces them, and you can forget all the SysVSHM stuff.

 it _needs_ split up, but oooh no, we hvae man(6), using up 10% of the

Section 3 I'd definitely agree with, but we already have that to some
extent. There's 3x for X functions, for example, and n for Tcl. The
question really is how you arrange it: after all, on platforms where
libresolv is not a part of the libc, should res_init(3) and friends go
in some subsection of 3 or 3 itself. This becomes more and more difficult,
and has become worse as people have been adding more and more to the
libc core functionality. (Again brought about to a large extent by the
advent of BSD networking).

 namespace for games !

I don't think it really is 10%, though. It's a lot smaller than that,
perhaps 1/62 or so.

-- 
Lusercop.net - LARTing Lusers everywhere since 2002




Re: Crazy maths proof

2002-12-09 Thread the hatter
On Sun, 8 Dec 2002, Chris Devers wrote:

 Consider the word wored 'chewed'. It has two personal pronouns in it --
 'he' and 'we'. Can you find a six letter word that has six pronouns it it?

I figured out 'ushers' for myself, with the list provided from kake's
link.  Then I tried a few other things, but no luck, couldn't see any
suitable runs/subsets (which is obviously necessary if you're to fitting 6
letter pairs into 6 spaces)  So I asked the search engines.  And
http://users.tinyonline.co.uk/gswithenbank/wordtriv.htm reckons that :

  Ushers contains the most personal pronouns spelled consecutively within
   it: he, her, hers, she, and us, totalling five pronouns.

Lots of other hits, only a few that are vaguely related to this problem,
and nothing about 6 pronouns (personal or otherwise) in 6 letters.


the hatter






Re: Crazy maths proof

2002-12-09 Thread Paul Makepeace
On Sun, Dec 08, 2002 at 09:37:51PM -0500, Chris Devers wrote:
 On Mon, 9 Dec 2002, Mark Fowler wrote:
 
  I don't know, showing this to a load of Perl coders.  Of course we're
  not going to try and work it out, we're going to try and hack the
  system.  This is such an incitement for a script that sends all the
  numbers from one to hundred thousand to the list ;-)
 
 Surprisingly good word puzzle heard on pop radio this weekend:
 
 Consider the word wored 'chewed'. It has two personal pronouns in it --
 'he' and 'we'. Can you find a six letter word that has six pronouns it it?

Best I can find is ushers which has five.

#!/usr/bin/perl -w
use strict;

my @pronouns = qw(
I you he she we they it
me him her us them
mine yours his hers its ours theirs
);

=for repeated pronouns, which give more but still not a six

my @pronouns = qw(
Iyou   he  she  it  we   you   they
me   you   him her  it  us   you   them
mine yours his hers its ours yours theirs
);

=cut

my $pronoun_letters = join '', @pronouns;
my $words = q[/usr/share/dict/words];
my %count;
open WORDS, $words or die Couldn't find words '$words': $!\n;
while (WORDS) {
next unless /^[$pronoun_letters]{6}$/;
chomp; $count{$_} = 0;
for my $p (@pronouns) {
$count{$_}++ if /$p/i;
}
print Ding! Ding! Ding!\n$_\n, last if $count{$_}  5;
}
close WORDS;

for my $w (sort {$count{$b} = $count{$a}} keys %count) {
print Found $count{$w} in $w\n;
}

__END__

I haven't looked at Kake's code so I might've missed something.

Paul

-- 
Paul Makepeace ... http://paulm.com/

If a tree falls in the forest, then be careful about the slippery
 slope.
   -- http://paulm.com/toys/surrealism/




RE: Crazy maths proof

2002-12-09 Thread Ivor Williams


On Monday, December 09, 2002 10:11 AM, Jonathan Peterson 
[SMTP:[EMAIL PROTECTED]] wrote:


 Chris Ball wrote:
  So, another maths exercise.  I'll award a pint at the January social
  meet for the first correct post with the next number in the sequence,
  and another for an explanation of the sequence itself.
 
 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 60

 The next number is 61, then 67

 These are orders of simple groups, only a newbie would be sidetracked by
 the whole prime numbers thing.

 I don't know what I'm talking about but the sequence appears in google,
 so it must be right. See:

In case anyone is interested in what a simple group is, check out 
http://www.wikipedia.org/wiki/Simple_group. Google is my friend to.






Sysadmin story: Cannot send mail over more than 500 miles

2002-12-09 Thread Ivor Williams
http://www.robotthoughts.com/print.php?sid=107

Enjoy.

Apologies if this one has already done the rounds.

Ivor.





Re: Look ma, no barewords!

2002-12-09 Thread Paul Johnson

Kate L Pugh said:

   [hummous: kake]$ perl -MData::Dumper -we 'use strict; my $foo = [ -foo
 ]; print Dumper $foo' $VAR1 = [
 '-foo'
   ];
   [hummous: kake]$

 Where's this documented?

I think the whys and wherefores of this have now been established.  This
is just a postscript to mention that I need to use this construct most
often when using the Tk and Pod::Usage modules and, if I may show my
prejudices for a moment, I find it to be ugly in the extreme, and I have
yet to find a compelling argument for its existence.

Actually, its possible that it might exist for a good reason, but don't
try telling me it's not ugly.

Wow, I didn't realise I felt that strongly about it.  I must have been
reading too much perl6-*  ;-)

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net







Re: Look ma, no barewords!

2002-12-09 Thread Graham Barr
On Sun, Dec 08, 2002 at 11:13:17AM +, Dave Cross wrote:
  It's commonly used to pass named arguments:
  
  set_lang( -name='Perl', -paradigm='hybrid', -motto='TMTOWTDI' );
 
 I thought that was using = quotes its left-hand operand magic
 quoting, not unary - quotes its operand magic quoting :)

IIRC, way back in the early days of perl5 = was just a different
way to write , it did not have auto-quoting properties. The leading
- to the word did though. Although I think that was added after the
original perl5 release. It may have been push for by Nick in the
early days of Tk development.

Graham.




Re: Perl and Time zones.

2002-12-09 Thread Dominic Mitchell
the hatter wrote:

Yes, you're only setting the environment for the process that's executing.
System picks a default $TZ that it hands to all processes spawned.  If one
of these is your shell, it'll inherit it, though you may have a login
profile that changes it to something else before you see it.  You can
change $TZ in your shell, without affecting the parent.  You run perl, it
inherits the environment (and thus $TZ) from your shell, or if you've not
tinkered with it, from the system.  You can change $TZ in perl, when the
program finishes, its enviroment is discarded.  While you program is
running, the shell still keeps its original $TZ, regardless of what the
program changes (and thus any oter programs it starts while your perl one
is running will also get the shells settings, not those of the perl
process)


This leads to some very handy shell aliases for finding out the time in 
new york / california.

% alias | grep date
estdate='TZ=EST5EDT date'
pstdate='TZ=PST8PDT date'

-Dom

--
| Semantico: creators of major online resources  |
|   URL: http://www.semantico.com/   |
|   Tel: +44 (1273) 72   |
|   Address: 33 Bond St., Brighton, Sussex, BN1 1RD, UK. |



Re: Perl CGI and PHP - with some TT thrown in

2002-12-09 Thread David M. Wilson
On Mon, Dec 09, 2002 at 03:11:06PM +, Simon Dick wrote:

  I've been asked a to build in someones php application into our
  website. The website is all perl/cgi/template toolkit

  This actually worked ok apart from apache treating the resulting
  page as just html and printing it php tags and all.

  So my question is, is there any way I can tell apache (maybe with
  headers) that this is php output and needs to be processed through
  php?

 Does setting Content-Type to application/x-httpd-php help?

If this is output coming from a CGI or mod_perl, that won't do the
trick.. Under Apache 2, filters can be stacked, and it should be
possible to get mod_php to process the output of your CGI.

Try:

   AcceptPathInfo on
   AddOutputFilterByType PHP application/x-httpd-php

in your .htaccess, followed by setting the Content-Type as above. This
is all under Apache 2 of course, it wouldn't work on that old dog Apache
1..

Dave.




Re: Perl CGI and PHP - with some TT thrown in

2002-12-09 Thread Andy Williams

- Original Message - 
From: Simon Dick [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 09, 2002 3:11 PM
Subject: Re: Perl CGI and PHP - with some TT thrown in
 
 Does setting Content-Type to application/x-httpd-php help?
 

I've just tried that and it hasn't helped that would be way too easy :)

Andy




Re: Perl CGI and PHP - with some TT thrown in

2002-12-09 Thread Andy Williams

- Original Message - 
From: David M. Wilson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 09, 2002 3:28 PM
Subject: Re: Perl CGI and PHP - with some TT thrown in


 On Mon, Dec 09, 2002 at 03:11:06PM +, Simon Dick wrote:
 
   I've been asked a to build in someones php application into our
   website. The website is all perl/cgi/template toolkit
 
   This actually worked ok apart from apache treating the resulting
   page as just html and printing it php tags and all.
 
   So my question is, is there any way I can tell apache (maybe with
   headers) that this is php output and needs to be processed through
   php?
 
  Does setting Content-Type to application/x-httpd-php help?
 
 If this is output coming from a CGI or mod_perl, that won't do the
 trick.. Under Apache 2, filters can be stacked, and it should be
 possible to get mod_php to process the output of your CGI.
 
 Try:
 
AcceptPathInfo on
AddOutputFilterByType PHP application/x-httpd-php
 
 in your .htaccess, followed by setting the Content-Type as above. This
 is all under Apache 2 of course, it wouldn't work on that old dog Apache
 1..
 
 Dave.
 

You are probably right stuck with Apache 1.x for now though... shame.

Andy




Re: Perl CGI and PHP - with some TT thrown in

2002-12-09 Thread Simon Wilcox
On Mon, 2002-12-09 at 14:47, Andy Williams wrote:
 Hi,
 
 I've been asked a to build in someones php application into our website. The
 website is all perl/cgi/template toolkit

Unlucky :)
 
 So my question is, is there any way I can tell apache (maybe with headers)
 that this is php output and needs to be processed through php?

As others have pointed out, you can't stack handlers in Apache 1.x

Two approaches you might use are these:

1. Map a url path onto the php application so that TT doesn't have
anything do do with it and leaves php to handle it.

This can be a bit fiddly if you currently serve all your url space from
one mod_perl handler.

It also suffers if you want to impose the same look and feel on the php
application as you'll have to maintain two sets of templates.

2. You could set up the php on a separate server (or virtual server) and
proxy it through a set of TT templates. Not sure if there is a plugin to
do that but if there isn't, there should be :)

Strip the php down to just the html for the main content and you end up
with a site that is predominately TT and you will be able to port the
php to perl without the users noticing.

Never actually tried this though, so YMMV.

Simon.




Re: Perl and Time zones.

2002-12-09 Thread Steve Keay
On Mon, Dec 09, 2002 at 02:47:15PM +, Dominic Mitchell wrote:
 
 This leads to some very handy shell aliases for finding out the time in 
 new york / california.
 
 % alias | grep date
 estdate='TZ=EST5EDT date'
 pstdate='TZ=PST8PDT date'

...and if you have gnu date, you can find out what time it will be in
New York when it's Teatime on Wednesday over here:

estdate -d 'wednesday 5PM GMT'




Re: Perl CGI and PHP - with some TT thrown in

2002-12-09 Thread Christof Damian
On Mon, 09 Dec 2002, Andy Williams wrote:
 So my question is, is there any way I can tell apache (maybe with
 headers) that this is php output and needs to be processed through
 php?

as you are stuck with apache 1.x i only can think of two evil ways to
do that. 

- pipe your Perl output in your script through the php command line
  interpreter.

- use the php3 include() command (which works with URLs), with a
  script which basically doing 

  ?php
  include http://xxx/perlscript.cgi?some=$some;args=$args;;
  ?

  some way of passing the script name and maybe some mod_rewrite magic
  you could make this pretty transparent.

you probably should also watch your security on this :-)

christof
-- 
Christof Damian 
Technical Director, guideguide ltd. 




Re: Perl CGI and PHP - with some TT thrown in

2002-12-09 Thread Randal L. Schwartz
 Andy == Andy Williams [EMAIL PROTECTED] writes:

Andy So my question is, is there any way I can tell apache (maybe with headers)
Andy that this is php output and needs to be processed through php?

Apache2 can stack content-handlers.  Apache1 can't.

Why not just say that the URLs that belong to that PHP application
are PHP, not yours?  Stacking templating engines will lead to nightmares,
anyway. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!




Re: Perl CGI and PHP - with some TT thrown in

2002-12-09 Thread Dave Wilson
On Mon, Dec 09, 2002 at 05:30:22PM +, Simon Wistow wrote:
 On Mon, Dec 09, 2002 at 02:59:29PM +, the hatter said:

 This got me wondering bad an evil thoughts about wrapping PHP as a
 Perl module.

 IIRC correctly the actual interface to the parser isn't all that
 complicated - something like ...

I smell a trigger-happy hacker :). Maybe I'm just really thick, but would
it be a better idea to run a backend PHP application server, cutting the
problem into two nice, simple, easy to maintain layers.

Have all the frontend in perl -- with maybe a namespace dedicated to the
PHP backend via. mod_rewrite. PHP requests that need wrapped with header/
footers, etc. can be parsed by the intermediary perl.

If it's the other way aronud, with perl output being fed into the PHP
interpreter, I'm sure a setup similar to this could work too. Your problem
sounds a bit icky though - is there no nicer way around it? Merging a PHP
package into a perl app sounds minging..

David.




UNIX man sections was Re: Perl and Time zones.

2002-12-09 Thread Steve Mynott
On Sunday, Dec 8, 2002, at 23:27 Europe/London, Lusercop wrote:


The name(number) specification is a reference to the manual entry for a
command. It derives from the Unix Programmers Manual (what is now 
contained
in the man(1) command) which also came in a printed version. The 
section
numbers denote various things:

Section 1 is basically the User's Reference Manual (URM).

The Programmer's Reference Manual (PRM) is basically sections 2 and 3.

Generally you will get better man pages with real UNIX (Solaris and 
BSD) than with Linux since the FSF/GNU way is to use 'info' rather than 
man pages.

Most Linux man pages will tell you not to use them.

http://www.freebsd.org/cgi/man.cgi

is an excellent resource since it allows web browsing of a very large 
number of UNIX and UNIX-like manuals for current (including Plan 9, 
Solaris and most linux distributions) and historic systems (Minix etc) 
and not just FreeBSD.

1 - General commands
2 - System calls
3 - libc library functions
4 - System driver descriptions
5 - Configuration files
6 - Games
7 - Conventions
8 - Systems administration commands


Also modern BSD systems have a section 9 for kernel documentation 
(traditionally not available on UNIX systems).

There have since been extensions. So zic(8) refers to the zic 
command
for which you'll find documentation in section 8 of the UPM. In 
reality,
however, you'd type:
man 8 zic
to get the documentation these days (the UPM is a bit too big to print 
out
in full).

That's the BSD form of the man command (which is also supported by 
Linux).

On a System V Release 4 system like Solaris you need man -s and zic is 
in section 1M

--
Steve Mynott [EMAIL PROTECTED]




Re: Perl and Time zones.

2002-12-09 Thread Mark Blackman
I've confirmed that theoriginal snippet works on OS X (10.2.2)
(minus transcription error in gmttime)

- Mark

On Monday, December 9, 2002, at 12:35  pm, Tamsin wrote:


that's odd. I developed and tested this on OSX, i think..
maybe it was the FreeBSD box.


Are you running Jaguar?  or 10.2?  I have 10.2,  but it is always 
possible that somewhere
along the line I've broken the Macs time zones by tinkering with 
things I don't understand.

Elegant it ain't.. In fact, there is a much nicer way via
C and the localtime libc function (at least in FreeBSD) where
localtime returns a tm struct with the final member
'gmtoff', GMT offset in seconds, but for some reason perl refuses to 
expose this
in localtime or POSIX::localtime. Probably due to cross platform
variation.

The changing of the environment variable only affects what happens in 
that script not the whole of the machine?I have visions of 
confusing the server for ever more...

To be honest I'm doing this in Perl because I can't see a way of doing 
it in PHP,  so we now have a kludge sitting on a kludge...
But hey it works.

T,


--
The future's bright,  the future's orange!

http://www.tamsin.com







Re: Perl and Time zones.

2002-12-09 Thread Tamsin
On Sun, Dec 08, 2002 at 05:17:19PM +, Tamsin wrote:

 Does anyone know how I'd go about finding out the time zone offset
 for a given time zone name?


Yes, there have been mine  Mark's solution. What do you need it for?


Yep,  I've got the data I want now!  I am surprised however that no
ones written a neat little module to do this...

I have a silly weather website - weatherpixie.com.  People keep mailing
me and asking me why I can't put local time on there cos its really easy
to do (ha!).

So I'm doing this because I'm fed up with explaining to people that
its not actually that easy and have better things to do than to work out
the time zones for 6000 places for which I only have a longitude
and latitude and a place name that may or may not match with other
place name/time zone databases.

So basically I'm doing this to stop an extremely helpful Belgian mailing
me with links to windows .exe files that tell you time zones for places...


Does the info need to stay extremely current? If not, you could just
batch process the results and get a list of places  offsets rather than
polluting your code employing some horrid hack in real time.


What I suspect I'm going to do is make a a Perl script that runs 1/2 hourly or
hourly and gets the offsets for all the times zones I use.  It'll 
then write those
out to a MySQL table with the offset in either hours or seconds and perhaps
the abbreviation code too.  I can then use this in PHP to work out the
local time for each location as and when I need it...

Long term the plan is to make Perl parse the weather data so I will 
probably write
the local time out with the parsed weather data

Its not a complete disaster if its wrong,  it would just be nice to do the
time of reading and sunset/sunrise in local time as well as GMT... 
I'm guessing
I probably don't need to do it every half hour,  but I suspect if I 
don't I'll run into
issues where the clocks have gone back/forward somewhere and my code
doesn't catch up till the next day

T.

--
The future's bright,  the future's orange!

http://www.tamsin.com



Re: Perl and Time zones.

2002-12-09 Thread David Cantrell
On Mon, Dec 09, 2002 at 08:24:32PM +, Tamsin wrote:

 So basically I'm doing this to stop an extremely helpful Belgian mailing
 me with links to windows .exe files that tell you time zones for places...

You could procmail him to the bit-bucket ...

 What I suspect I'm going to do is make a a Perl script that runs 1/2 hourly 
 or
 hourly and gets the offsets for all the times zones I use.  It'll 
 then write those
 out to a MySQL table with the offset in either hours or seconds ...

I strongly recommend using seconds.  You'll have to convert to seconds
anyway if you want your calculations involving dates and times to be sane.

-- 
David Cantrell|Reprobate|http://www.cantrell.org.uk/david

  engineer: n. one who, regardless of how much effort he puts in
to a job, will never satisfy either the suits or the scientists




Re: Perl and Time zones.

2002-12-09 Thread Tamsin
You could procmail him to the bit-bucket ...


I could,  but it would actually be nice to have local time ..

It one of those situations where I wrote back being polite, and then realized
that he was the same guy who mailed me back in April


I strongly recommend using seconds.  You'll have to convert to seconds
anyway if you want your calculations involving dates and times to be sane.


Well at the moment the project is at the stage where I've just discovered that
time zone borders do not follow US state boundaries.  G.

T.


--
The future's bright,  the future's orange!

http://www.tamsin.com




Re: Perl and Time zones.

2002-12-09 Thread Nicholas Clark
On Mon, Dec 09, 2002 at 09:06:38PM +, Tamsin wrote:

 Well at the moment the project is at the stage where I've just discovered that
 time zone borders do not follow US state boundaries.  G.

Beware. I believe one US state (Montana IIRC) also stands out by only
partially adopting daylight saving time. ie half of Montana does, half does
not. Or maybe this is what you meant by the above comment.

 The future's bright,  the future's orange!

I find the thought of orange in stereo scary...

Nicholas Clark




Re: Perl and Time zones.

2002-12-09 Thread Tamsin
Beware. I believe one US state (Montana IIRC) also stands out by only
partially adopting daylight saving time. ie half of Montana does, half does
not. Or maybe this is what you meant by the above comment.



Montana seems to be mostly MST,  except for one bit in the corner 
that is PST ...
Maybe MST does daylight saving and PST doesn't?

Ever got the feeling you've opened a can of worms...

My solution to this might just be its in this time zone until someone 
tells me otherwise...

  The future's bright,  the future's orange!

I find the thought of orange in stereo scary...


evil grin  My computer is orange.

T.



--
The future's bright,  the future's orange!

http://www.tamsin.com




Re: Perl and Time zones.

2002-12-09 Thread Paul Mison
On 09/12/2002 at 21:43 +, Tamsin wrote:

Beware. I believe one US state (Montana IIRC) also stands out by only
partially adopting daylight saving time. ie half of Montana does, half does
not. Or maybe this is what you meant by the above comment.


Montana seems to be mostly MST,  except for one bit in the corner 
that is PST ...
Maybe MST does daylight saving and PST doesn't?

MST is Mountain Standard, PST is Pacific Standard. PDT is PST+1, or 
MST. I expect. You'd be best checking.

As to the divided state, it's Indiana.

The US doesn't say everyone has to do DST, but it does say that if 
you do, you have to swap at the same dates.

About six or seven counties (ie smaller than states) in Indiana 
choose not to use DST at all.

Ah, badly designed web page with facts:

http://www.mccsc.edu/time.html

I believe the EU not only mandates a date but also the fact that 
countries must observe the change, but I'd have to check.

Ever got the feeling you've opened a can of worms...


Oooh, yes.

My favourite (because it's in dipsy's time feed) is the fact that 
Adelaide and Brisbane have, for no particularly obvious reason, a 
half-hour offset from each other.

I read Time Lord: Sandford Fleming and the Creation of Standard Time 
on the way back from YAPC::NA. It's an interesting book, although I 
think it may still be lacking a UK publisher. It's an interesting 
book, although it doesn't tackle DST, which is a later innovation.

http://www.spikemagazine.com/0601timelord.htm

--
:: paul
:: we're like crystal



Re: Crazy maths proof

2002-12-09 Thread Adam Spiers
Jonathan Peterson ([EMAIL PROTECTED]) wrote:
 Chris Ball wrote:
 So, another maths exercise.  I'll award a pint at the January social
 meet for the first correct post with the next number in the sequence,
 and another for an explanation of the sequence itself.
 
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 60
 
 The next number is 61, then 67
 
 These are orders of simple groups, only a newbie would be sidetracked by 
 the whole prime numbers thing.
 
 I don't know what I'm talking about but the sequence appears in google, 
 so it must be right. See:
 
 http://www.google.com/search?hl=enlr=ie=ISO-8859-1q=%2237+41+43+47+53+59+60%22
 
 I love google and it loves me.

This site is better than google for number sequences:

http://www.research.att.com/~njas/sequences/




Re: Perl and Time zones.

2002-12-09 Thread Lusercop
On Mon, Dec 09, 2002 at 09:06:38PM +, Tamsin wrote:
 Well at the moment the project is at the stage where I've just discovered 
 that time zone borders do not follow US state boundaries.  G.

Does the rotation of the earth follow US state boundaries?

Why should they? Timezones are artificial, sure, but it's up to the locals
what time they feel they should follow.

[and on a side note, your mails are coming out looking really ugly, please
 can you do something about the formatting]

-- 
Lusercop.net - LARTing Lusers everywhere since 2002




Re: Perl and Time zones.

2002-12-09 Thread Belden Lyman


Paul Mison wrote:


On 09/12/2002 at 21:43 +, Tamsin wrote:


Beware. I believe one US state (Montana IIRC) also stands out by only
partially adopting daylight saving time. ie half of Montana does, 
half does
not. Or maybe this is what you meant by the above comment.


Montana seems to be mostly MST,  except for one bit in the corner that 
is PST ...
Maybe MST does daylight saving and PST doesn't?




There's a few states that are in two different timezones-
but that's different from states that don't follow daylight saving.
(As far as I can tell, the only state that is state-wide non-
daylight saving is Hawaii.)



MST is Mountain Standard, PST is Pacific Standard. PDT is PST+1, or MST. 
I expect. You'd be best checking.

As to the divided state, it's Indiana.


Depends on what you mean by divided: divided by being in more than
one timezone? There's a few; most notable[0] among them is North
Dakota.

Divided by some portions following daylight saving, and other portions 
of the state not? Better add the Non-Navajo portions of Nevada.

Information is parroted to you from my addled interpretation of
the purty pictures at http://www.time.gov

Belden

[0] - most notable, least notable - it's a fine line :)





Re: Perl and Time zones.

2002-12-09 Thread Mark Fowler
Tamsin wrote:

 Ever got the feeling you've opened a can of worms...

At one point we thought it would be a good idea to teach dipsy, the
infobot on #london.pm, to tell the time in various places.  This is useful
when you've got friends at conferences and you want to know what time
they'll be awake, or you've working with someone in another time zone and
you want to know what time they'll probably be at their desk.

Lots of people suggested lots of ways of doing it, and I ignored them all.
Time and date stuff is hard.  This is why whenever dipsy needs to know the
time it makes no attempt to work it out itself - it scrapes the results
from http://www.timeanddate.com.  This also means it's someone else's
problem when the aussies decide to change their clocks randomly when
they're hosting the Olympics.

The source is here:

  http://2shortplanks.com/temp/time2.txt

And you can have a go at getting the time in a city by doing this:

  http://2shortplanks.com/temp/time2.cgi?w=New+York

Note that it'll output it in a bastardised form of an RSS feed - since
infobots have viewers built in for those.

Mark.

-- 
  Mark Fowler
  http://www.twoshortplanks.com/  The 2002 Perl Advent Calendar
  [EMAIL PROTECTED]   http://www.perladvent.org/2002/
 a different perl module featured every day