From grant at mclean.net.nz Tue Mar 1 10:10:54 2005 From: grant at mclean.net.nz (Grant McLean) Date: Tue Mar 1 10:11:45 2005 Subject: [Wellington-pm] SEND + MORE = MONEY Message-ID: <1109700654.4261.11.camel@localhost> Can anyone come up with creative solutions for this? Given the equation: SEND +MORE ===== MONEY Where each letter represents a digit (0-9) and neither S nor M can be zero. Find the values for the letters which satisfy the equation. There is only one solution. I came up with a brute force approach (below) which takes nearly two minutes (1:50) on my workstation to check all possible answers and prove the assertion that there is only one answer. Cheers Grant Spoiler follows ... #!/usr/bin/perl -w use strict; my $message = 'SEND + MORE = MONEY'; my @letters = sort keys %{{ map { $_, $_} ($message =~ /([A-Z])/g) }}; print "$message\n"; solve($_) foreach (0..9); sub solve { my %d = map { $_, undef} (0..9); delete $d{$_} foreach(@_); if(@_ == @letters) { my $tr = join('', 'tr/', @letters, '/', @_, '/'); $_ = $message; eval "$tr"; return if(/\b0/); if(/^(....)...(....)...(.....)/) { print "$_\n" if($1 + $2 == $3); } return; } solve(@_, $_) foreach keys %d; } From finlay at catalyst.net.nz Tue Mar 1 12:15:30 2005 From: finlay at catalyst.net.nz (Finlay Thompson) Date: Tue Mar 1 12:15:49 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <1109700654.4261.11.camel@localhost> References: <1109700654.4261.11.camel@localhost> Message-ID: <4224CD62.4030206@catalyst.net.nz> Grant I did some guesses on paper and got 10 solutions: 9900 + 1199 -------- 11099 Which corresponds to { S => 9, E => 9, N=> 0, D => 0, M => 1, O => 1, R => 9, Y => 9 } However what ever we put in for D can still work, with appropriate changes to Y and R eg : 990x +1189 -------- 1109y where y = (x+9)-10 for any x in [1,9] However I think you meant that no two of the numbers {S,E,N,D,M,O,R,Y} should be the same ? In wich case the above solutions would not apply. Finlay Grant McLean wrote: >Can anyone come up with creative solutions for this? > > >Given the equation: > > SEND > +MORE > ===== > MONEY > >Where each letter represents a digit (0-9) and neither S nor M can be >zero. Find the values for the letters which satisfy the equation. >There is only one solution. > > >I came up with a brute force approach (below) which takes nearly two >minutes (1:50) on my workstation to check all possible answers and prove >the assertion that there is only one answer. > >Cheers >Grant > > > >Spoiler follows ... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >#!/usr/bin/perl -w > >use strict; > >my $message = 'SEND + MORE = MONEY'; > >my @letters = sort keys %{{ map { $_, $_} ($message =~ /([A-Z])/g) }}; > >print "$message\n"; >solve($_) foreach (0..9); > >sub solve { > my %d = map { $_, undef} (0..9); > delete $d{$_} foreach(@_); > > if(@_ == @letters) { > my $tr = join('', 'tr/', @letters, '/', @_, '/'); > $_ = $message; > eval "$tr"; > return if(/\b0/); > if(/^(....)...(....)...(.....)/) { > print "$_\n" if($1 + $2 == $3); > } > return; > } > > solve(@_, $_) foreach keys %d; >} > > > >_______________________________________________ >Wellington-pm mailing list >Wellington-pm@pm.org >http://mail.pm.org/mailman/listinfo/wellington-pm > > > From grant at mclean.net.nz Tue Mar 1 13:19:41 2005 From: grant at mclean.net.nz (Grant McLean) Date: Tue Mar 1 13:19:52 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <4224CD62.4030206@catalyst.net.nz> References: <1109700654.4261.11.camel@localhost> <4224CD62.4030206@catalyst.net.nz> Message-ID: <1109711981.15686.4.camel@localhost> On Wed, 2005-03-02 at 09:15 +1300, Finlay Thompson wrote: > Grant > > I did some guesses on paper and got 10 solutions: ... > However I think you meant that no two of the numbers {S,E,N,D,M,O,R,Y} > should be the same ? Umm yes, sorry I did omit to say each digit can only be assigned to one letter. I came up with a less complicated solution that runs in a little over half the time of my original ... #!/usr/bin/perl -w use strict; my $message = 'SEND + MORE = MONEY'; my $letters = join '', sort keys %{{ map { $_, 1} ($message =~ /([A-Z])/g) }}; my $required = length $letters; print "$message\n"; solve('', 0..9); sub solve { my $digits = shift; if(length $digits == $required) { $_ = $message; eval "tr/$letters/$digits/"; return if(/\b0/); if(/^(....)...(....)...(.....)/) { print "$_\n" if($1 + $2 == $3); } return; } foreach (1..@_) { my $next = shift; solve($digits . $next, @_); push @_, $next; } } From douglas at paradise.net.nz Tue Mar 1 17:24:37 2005 From: douglas at paradise.net.nz (Douglas Bagnall) Date: Tue Mar 1 17:25:23 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <1109700654.4261.11.camel@localhost> References: <1109700654.4261.11.camel@localhost> Message-ID: <422515D5.5060102@paradise.net.nz> Grant McLean wrote: > SEND > +MORE > ===== > MONEY I've got a longer, quicker, but guarantee-free solution below. It uses a simple darwinian approach (betterment through iterative selection and mangling). It's an interesting problem where the human approach, combining heuristics and baffled staring, doesn't translate into perl very well at all. douglas #!/usr/bin/perl -w use strict; my $message = 'SEND + MORE = MONEY'; my $POOL = 100; my $CUTOFF = 50; my $ITERATIONS = 500; my $INF = 1e999; my @letters = keys %{{ map { $_ => 1} ($message =~ /([A-Z])/g)}}; my $letters = join('', @letters); my $len = @letters; my $equation = $message; $equation =~ s/=/-/; my %candidates; foreach (1..$POOL){ my %attempt; my $nums = [0..9]; # shuffle... for (my $i = 10; -- $i;) { my $r = int rand ($i + 1); ($nums -> [$i], $nums -> [$r]) = ($nums -> [$r], $nums -> [$i]); } # and truncate my $digits = substr(join('', @$nums), 0, $len); $candidates{$digits} = $INF; } foreach my $i (1..$ITERATIONS){ my ($digits, $score); foreach $digits (keys %candidates) { $_ = $equation; eval "tr/$letters/$digits/"; next if(/\b0/); my $score = abs int(eval $_); if ($score == 0){ s/-/=/; print "$_\n$message\n$letters\n$digits\n"; print "took $i iterations\n"; exit; } $candidates{$digits} = $score; } my @scores = sort {$a <=> $b} (values(%candidates)); my $cutoff = $scores[$CUTOFF]; # print "iteration $i\nbest is $scores[0]\n cutoff is $cutoff\n"; my %new_candidates; while (($digits, $score) = each %candidates) { next if ($score > $cutoff); $new_candidates{$digits} = $score; my $pos = int(rand($len)); my $new_n = int(rand(10)); my $old_n = substr($digits, $pos,1); $digits =~ s/$old_n/x/; $digits =~ s/$new_n/$old_n/; $digits =~ s/x/$new_n/; $new_candidates{$digits} = $INF; last if (keys(%new_candidates) > $POOL); } %candidates = %new_candidates; } From douglas at paradise.net.nz Tue Mar 1 18:04:10 2005 From: douglas at paradise.net.nz (Douglas Bagnall) Date: Tue Mar 1 18:04:20 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <422515D5.5060102@paradise.net.nz> References: <1109700654.4261.11.camel@localhost> <422515D5.5060102@paradise.net.nz> Message-ID: <42251F1A.6010406@paradise.net.nz> To halve the number of evals: foreach my $i (1..$ITERATIONS){ my ($digits, $score); foreach $digits (keys %candidates) { + next if ($candidates{$digits} ne $INF); $_ = $equation; eval "tr/$letters/$digits/"; (there's no need to reevaluate when the conditions aren't changing. Whether the known failing candidates should be kept at all is another question). I'm sure there must be a better way to do this: my $pos = int(rand($len)); my $new_n = int(rand(10)); my $old_n = substr($digits, $pos,1); $digits =~ s/$old_n/x/; $digits =~ s/$new_n/$old_n/; $digits =~ s/x/$new_n/; that is, randomly replace one of a short string of unique digits, without creating duplicates. Anyway, I the best solution will recognise the letters as representing powers of ten, and use some kind of modulus and division trickery. cheers, douglas > Grant McLean wrote: > >> SEND >> +MORE >> ===== >> MONEY > From jarich at perltraining.com.au Tue Mar 1 18:27:13 2005 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Tue Mar 1 18:27:25 2005 Subject: [Wellington-pm] Invitation to participate in perl.net.au Message-ID: <42252481.1080702@perltraining.com.au> G'day Wellington PMers, Last year Paul Fenwick and I were privileged enough to be involved in many different facets of the Australiasian Perl community. We were able to attend Perl Mongers meetings across Australia, encouraging the reformation of a few, and teach both beginner and experienced programmers in Australia and New Zealand. We became involved with businesses that either specialised in providing Perl services, or who use Perl for internal development and who regularly seek programmers. Between all these groups, we discovered there was a common desire, for there to be more connections in the Australiasian Perl community. "Where can I find a job working with Perl?" "Where can I find Perl developers or consultants?" "Who else in Australia are using Perl, and what for?" "How can I show my clients that there is plenty of Perl support in Australia?" "Does Perl exist in New Zealand?" "I want to help with a local Perl project, where do I start?" Having a more active and more interconnected Perl community is something that we feel would be of great benefit to us all. As such, we have registered the domain perl.net.au, installed MediaWiki, and placed upon it the skeleton of a portal site. It's our hope that perl.net.au will become a central meeting point for the Perl community in Australia and New Zealand. PerlNet is at the very start of its life, and in order for it to become a success it needs the input and attention of the community. I'm writing to you to ask for feedback, ideas, and contributions to PerlNet. We're only notifying select groups to begin with, and this is intentional. Many people will not return to PerlNet if their first experience is a bad one, and currently the site is very much under construction. We want to be able to bring it up to speed before announcing it to the world. If you have the time, I would appreciate it if you could go to http://perl.net.au/ and give your contributions, feedback, and ideas. I also ask in particular that you read and respect the requests at: http://perl.net.au/wiki/PerlNet:Beta_phase We especially want you to write about Wellington PM, Perl in Wellington, your businesses, your experiences with Perl and New Zealand in general. While you may tell other *individuals* to whom you feel PerlNet has value, we ask that you do not otherwise publicise PerlNet. Please do not mention PerlNet at (other) user groups, in your journal/blog, or in other media outlets. Once the site has grown further with your help; we will be able make a proper announcement to the world. I sincerely look forward to your feedback and contributions. I would encourage you to provide these using the facilities on the site itself, in order to promote an open and transparent discussion. However, if there are matters that you wish to communicate to me personally, feel free to do so by return e-mail. All the very best, Jacinta and Paul -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact@perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From kirk at mcs.vuw.ac.nz Tue Mar 1 18:49:50 2005 From: kirk at mcs.vuw.ac.nz (Kirk Jackson) Date: Tue Mar 1 18:50:05 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <42251F1A.6010406@paradise.net.nz> Message-ID: <200503020249.j222nrpU013656@kaukau.mcs.vuw.ac.nz> > > Grant McLean wrote: > > > >> SEND > >> +MORE > >> ===== > >> MONEY Hmmm... Procrastination got the better of me, I should be studying today. I was interested to see how slow a brute-force solution would be (27sec on a P4 2.6). Not using eval probably helps things (scroll down). Kirk > time ./puzzle.pl Success: SEND + MORE = MONEY 7316 + 0823 = 08139 27.222u 0.000s 0:27.26 99.8% 0+0k 0+8io 0pf+0w #!/usr/bin/perl -Tw foo([],[0..9]); sub foo { my (@curr) = @{ $_[0]}; my (@left) = @{ $_[1]}; if (@left) { for (my $i = 0; $i <= $#left; $i++) { push @curr, splice(@left, $i, 1, ()); foo(\@curr, \@left); splice(@left, $i, 0, pop @curr); } } else { my ($e, $n, $m, $o, $y, $d, $r, $s) = @curr; if (((1000*$s + 100*$e + 10*$n + $d) + (1000*$m + 100*$o + 10*$r + $e) - (10000*$m + 1000*$o + 100*$n + 10*$e + $y)) == 0) { print "Success:\n"; print "SEND + MORE = MONEY\n"; print "$s$e$n$d + $m$o$r$e = $m$o$n$e$y\n"; exit; } } } From michael at diaspora.gen.nz Tue Mar 1 18:54:15 2005 From: michael at diaspora.gen.nz (michael@diaspora.gen.nz) Date: Tue Mar 1 18:54:29 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: Your message of "Wed, 02 Mar 2005 15:04:10 +1300." <42251F1A.6010406@paradise.net.nz> Message-ID: Douglas Bagnall writes: >Anyway, I the best solution will recognise the letters as representing >powers of ten, and use some kind of modulus and division trickery. For the modulus trickery, one can observe that we have multiple equations that can be used to filter a brute force search space; eg, in the example 'SEND + MORE = MONEY', the following equations must hold: (D + E) % 10 == Y (N + R) % 10 == E (E + O) % 10 == N (S + M) % 10 == O (there are probably more based on remainders; for example, if D + E is > 10, then that implies something about N, R, and E, because of the carry.) A quick hack on Grant's code (below) checks the first equation, and uses that to prune the search space. It seems to work; drops the time on my workstation from over 60 seconds (I got bored waiting) to ~ 13 seconds. The next step would be to change the $letters generation to carefully preserve significance order in the sort of the letters (as I have done for the least significant three), and then change the elsif clause in the solve function to look for equivalances to solve, rather than just checking for the least significant one as at present. It'd still be a brute force, depth first search though. -- michael. spoilers below ^L^L^L #!/usr/bin/perl -w use strict; my $message = 'SEND + MORE = MONEY'; my $letters = join '', sort keys %{{ map { $_, 1} ($message =~ /([A-Z])/g) }}; my $required = length $letters; my $remove = join '', $message =~ /(\w)\b/g; $letters =~ s/[$remove]//g; $_ = $remove; # remove duplicated letters while preserving order s/(.)\1\1/$1/; s/(.)\1/$1/g; s/(.)(.)\1/$1$2/; $letters = $_ . $letters; print "$message\n"; solve('', 0..9); sub solve { my $digits = shift; $_ = $message; eval "tr/$letters/${digits}b/"; return if(/\b0/); # hope that we can find a partial equation if (length $digits == $required) { if(/^(\d+) \+ (\d+) = (\d+)/o) { print "$letters $_\n" if($1 + $2 == $3); } return; } elsif (/^\w+(\d) \+ \w+(\d) = \w+(\d)$/o) { return unless ($1 + $2) % 10 == $3; } foreach (1..@_) { my $next = shift; solve($digits . $next, @_); push @_, $next; } } From jarich at perltraining.com.au Tue Mar 1 18:54:33 2005 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Tue Mar 1 18:54:42 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <200503020249.j222nrpU013656@kaukau.mcs.vuw.ac.nz> References: <200503020249.j222nrpU013656@kaukau.mcs.vuw.ac.nz> Message-ID: <42252AE9.7080200@perltraining.com.au> Kirk Jackson wrote: >>>Grant McLean wrote: >>> >>> >>>> SEND >>>> +MORE >>>> ===== >>>> MONEY > Success: > SEND + MORE = MONEY > 7316 + 0823 = 08139 > 27.222u 0.000s 0:27.26 99.8% 0+0k 0+8io 0pf+0w Unfortunately the rules usually say that neither S or M can be 0, so whilst this is a solution, it's not usually the one that's sought. ;) All the best, Jacinta -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact@perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From don at dis.org.nz Tue Mar 1 18:58:24 2005 From: don at dis.org.nz (Donald Gordon) Date: Tue Mar 1 18:58:34 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: References: <42251F1A.6010406@paradise.net.nz> Message-ID: <20050302155824.08a16064.don@dis.org.nz> On Wed, 02 Mar 2005 15:54:15 +1300, michael@diaspora.gen.nz wrote: > For the modulus trickery, one can observe that we have multiple equations > that can be used to filter a brute force search space; eg, in the example > 'SEND + MORE = MONEY', the following equations must hold: > > (D + E) % 10 == Y > (N + R) % 10 == E > (E + O) % 10 == N > (S + M) % 10 == O Is that the case, though? if D+E >= 10, then (N + R + 1) % 10 == E... donald From michael at diaspora.gen.nz Tue Mar 1 19:02:51 2005 From: michael at diaspora.gen.nz (michael@diaspora.gen.nz) Date: Tue Mar 1 19:03:02 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: Your message of "Wed, 02 Mar 2005 15:58:24 +1300." <20050302155824.08a16064.don@dis.org.nz> Message-ID: Donald Gordon writes: >On Wed, 02 Mar 2005 15:54:15 +1300, michael@diaspora.gen.nz wrote: > >> For the modulus trickery, one can observe that we have multiple equations >> that can be used to filter a brute force search space; eg, in the example >> 'SEND + MORE = MONEY', the following equations must hold: >> >> (D + E) % 10 == Y >> (N + R) % 10 == E >> (E + O) % 10 == N >> (S + M) % 10 == O > >Is that the case, though? if D+E >= 10, then (N + R + 1) % 10 == E... You're right. Good thing I just checked the least significant digit, eh? I'll post some test cases tonight, based on the perlgolf testing scripts. -- michael. From daniel at dev-zone.org Tue Mar 1 19:10:48 2005 From: daniel at dev-zone.org (Daniel) Date: Tue Mar 1 19:11:02 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <42252AE9.7080200@perltraining.com.au> References: <200503020249.j222nrpU013656@kaukau.mcs.vuw.ac.nz> <42252AE9.7080200@perltraining.com.au> Message-ID: <42252EB8.30304@dev-zone.org> Sorry to bust any bubbles but M cannot equal 0. "and neither S nor M can be zero" Daniel Many people would sooner die than think. In fact they do. Bertrand Russell --Quoted in Antony Flew's Thinking About Thinking Jacinta Richardson wrote: > Kirk Jackson wrote: > >>>> Grant McLean wrote: >>>> >>>> >>>>> SEND >>>>> +MORE >>>>> ===== >>>>> MONEY > > >> Success: >> SEND + MORE = MONEY >> 7316 + 0823 = 08139 >> 27.222u 0.000s 0:27.26 99.8% 0+0k 0+8io 0pf+0w > > > Unfortunately the rules usually say that neither S or M can be 0, so > whilst this is a solution, it's not usually the one that's sought. ;) > > All the best, > > Jacinta > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: OpenPGP digital signature Url : http://mail.pm.org/pipermail/wellington-pm/attachments/20050302/1708b2bc/signature.bin From daniel at dev-zone.org Tue Mar 1 19:13:32 2005 From: daniel at dev-zone.org (Daniel) Date: Tue Mar 1 19:13:45 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <42252EB8.30304@dev-zone.org> References: <200503020249.j222nrpU013656@kaukau.mcs.vuw.ac.nz> <42252AE9.7080200@perltraining.com.au> <42252EB8.30304@dev-zone.org> Message-ID: <42252F5C.3020804@dev-zone.org> Doh. Sorry Dup. Daniel Many people would sooner die than think. In fact they do. Bertrand Russell --Quoted in Antony Flew's Thinking About Thinking Daniel wrote: > Sorry to bust any bubbles but M cannot equal 0. > > "and neither S nor M can be zero" > > Daniel > > Many people would sooner die than think. In fact they do. > > Bertrand Russell > --Quoted in Antony Flew's Thinking About Thinking > > > Jacinta Richardson wrote: > >> Kirk Jackson wrote: >> >>>>> Grant McLean wrote: >>>>> >>>>> >>>>>> SEND >>>>>> +MORE >>>>>> ===== >>>>>> MONEY >> >> >> >>> Success: >>> SEND + MORE = MONEY >>> 7316 + 0823 = 08139 >>> 27.222u 0.000s 0:27.26 99.8% 0+0k 0+8io 0pf+0w >> >> >> >> Unfortunately the rules usually say that neither S or M can be 0, so >> whilst this is a solution, it's not usually the one that's sought. ;) >> >> All the best, >> >> Jacinta >> > > ------------------------------------------------------------------------ > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm@pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: OpenPGP digital signature Url : http://mail.pm.org/pipermail/wellington-pm/attachments/20050302/cfbfdd8e/signature.bin From ewen at naos.co.nz Tue Mar 1 21:41:05 2005 From: ewen at naos.co.nz (Ewen McNeill) Date: Tue Mar 1 21:42:13 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: Message from Grant McLean of "Wed, 02 Mar 2005 07:10:54 +1300." <1109700654.4261.11.camel@localhost> Message-ID: <20050302054105.BBCD63C4877C@basilica.la.naos.co.nz> In message <1109700654.4261.11.camel@localhost>, Grant McLean writes: >Given the equation: > > SEND > +MORE > ===== > MONEY Proof that there's a CPAN module for everything. It's a brute force approach which does 10!/(10-$unique)! iterations (1814400 here), so it's painfully slow (4:39 on a 700MHz Pentium III). Ewen -=- cut here -=- #! /usr/bin/perl -w # Solve word number puzzles, through brute force: 10!/(10-$unique)! iterations # # Rules: 1. Each letter always corresponds to the same digit # 2. A digit is only used once # 3. Most sigificant digit in values in the equation is never zero # Written by Ewen McNeill , 2005/03/02 use strict; use Math::Combinatorics; my $message = 'SEND + MORE = MONEY'; my $letters = join '', sort keys %{{map {$_,1} ($message =~ /([A-Z])/g)}}; my $unique = length $letters; die "Too many unique letters\n" if ($unique > 10); my $combinations = Math::Combinatorics->new(count => $unique, data => [0..9]); while (my @testset = $combinations->next_combination()) { my $permutations = Math::Combinatorics->new(count => $unique, data => \@testset); while(my $digits = join('', $permutations->next_permutation())) { $_ = $message; eval "tr/${letters}/${digits}/"; next if(/\b0/); # eliminate violations of rule 3 if(/^(....)...(....)...(.....)/ && ($1 + $2 == $3)) { print "Success: $message is $_\n"; } } } -=- cut here -=- From douglas at paradise.net.nz Tue Mar 1 22:59:50 2005 From: douglas at paradise.net.nz (Douglas Bagnall) Date: Tue Mar 1 23:00:00 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <42251F1A.6010406@paradise.net.nz> References: <1109700654.4261.11.camel@localhost> <422515D5.5060102@paradise.net.nz> <42251F1A.6010406@paradise.net.nz> Message-ID: <42256466.3050807@paradise.net.nz> well, I couldn't avoid dubious optimisation efforts, and now it may or may not be a bit quicker. It usually takes less than a second on the via C3. I thought to add some @ARGV shifts, eg: my $message = shift || 'SEND + MORE = MONEY'; which enables you to try out lines like ./sum.pl 'PERL / PL = POD' ./sum.pl 'BEE + CAT + DOG = BIRD' ./sum.pl 'POTATO % PEEL = MEAL' scroll down. #!/usr/bin/perl -w use strict; my $message = shift || 'SEND + MORE = MONEY'; my $ITERATIONS = shift || 1500; my $POOL = shift || 120; my $CUTOFF = shift || 60; my $INF = 1e999; my @letters = keys %{{ map { $_ => 1} ($message =~ /([A-Z])/g)}}; my $letters = join('', @letters); my $len = @letters; my $equation = $message; $equation =~ s/=/-/; # should check for bad chars, # put () around each side. my @nums = (0..9); my %candidates = map { for (my $i = 10; --$i;) { my $r = int(rand($i + 1)); ($nums[$i], $nums[$r]) = ($nums[$r], $nums[$i]); }; substr(join('', @nums), 0, $len) => $INF; }(1..$POOL); foreach my $i (1..$ITERATIONS){ my @scores = sort {$a <=> $b} (values(%candidates)); my $cutoff = $scores[$CUTOFF]; my %new_candidates; while (my ($digits, $score) = each %candidates) { if ($score eq $INF){ $_ = $equation; eval "tr/$letters/$digits/"; next if(/\b0/); $score = abs (eval $_); next if ($score > $cutoff); if ($score == 0){ s/-/=/; print "$_\n$message\n$letters\n$digits\n"; print "took $i iterations\n"; exit; } } $new_candidates{$digits} = $score if ($score <= $cutoff); } %candidates = %new_candidates; my @mutatees = keys(%candidates); my $c = @mutatees; while ($c < $POOL){ foreach my $digits (@mutatees){ my $pos = int(rand($len)); my $new_n = int(rand(10)); my $old_n = substr($digits, $pos, 1, 'x'); $digits =~ s/$new_n/$old_n/; $digits =~ s/x/$new_n/; $candidates{$digits} = $INF; last if (++$c >= $POOL); } } } print "No solution found after $ITERATIONS iterations!\n"; From ewen at naos.co.nz Tue Mar 1 23:54:02 2005 From: ewen at naos.co.nz (Ewen McNeill) Date: Tue Mar 1 23:55:11 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: Message from Ewen McNeill of "Wed, 02 Mar 2005 18:41:05 +1300." <20050302054105.BBCD63C4877C@basilica.la.naos.co.nz> Message-ID: <20050302075403.0563D3C4877C@basilica.la.naos.co.nz> In message <20050302054105.BBCD63C4877C@basilica.la.naos.co.nz>, Ewen McNeill wr ites: >In message <1109700654.4261.11.camel@localhost>, Grant McLean writes: >>Given the equation: [SEND + MORE = MONEY] > >Proof that there's a CPAN module for everything. [4:39 brute force solution] Proof that what you need is a better algorithm, not a faster computer. It still feels more complicated than it should be, but it exhausts the search space in 4.2 seconds on a 700MHz Pentium III (and 1.4 seconds on a 2.1GHz AMD Athlon XP 2700+; both figures "user" time from "time" in bash). AFAICT Douglas's sub-1-second program may or may not find the answer, so it's not a completely fair comparision. I'd like to make the recursion go away (recursion feels "wrong" -- I guess that means I didn't grow up a LISP programmer), but it's already complicated enough without doing explicit stack management. Ewen #! /usr/bin/perl -w # Intelligently solve word number addition puzzles # # Rules: 1. Each letter always corresponds to the same digit # 2. A digit is only used once # 3. Most sigificant digit in values in the equation is never zero # Written by Ewen McNeill , 2005/03/02 use strict; my $message = 'SEND + MORE = MONEY'; solve($message); # (@list) = do_substs($from, $to, @list) sub do_substs { my ($from, $to, @list) = @_; for (0..$#list) { $list[$_] =~ s/${from}/${to}/g; } return @list; } # $bool = is_digit($val) sub is_digit { return $_[0] =~ /\d/; } # $bool = is_available($digit, @list) sub is_available { my ($digit, @list) = @_; return ($list[$digit] eq $digit); } # @list = reserve($letter, $digit, @list) sub reserve { my ($letter, $digit, @list) = @_; unless ($list[$digit] eq $digit) { die "Attempt to re-reserve $digit for $letter in ", join(",", @list), "\n" } $list[$digit] = $letter; return @list; } # try_substs($a, $b, $sum, $carry, @available) # $carry is 1 iff next least signifant pair caused a carry sub try_substs { my ($a,$b,$sum,$carry,@available) = @_; my ($lena,$lenb,$lensum) = (length $a, length $b, length $sum); die "Sum doesn't make sense\n" if ($lensum < $lena || $lensum < $lenb); # warn "try_substs($a,$b,$sum,$carry,", join(",",@available), ")\n"; # All substituted? if ($a !~ /\D/ && $b !~ /\D/ && $sum !~ /\D/) { print "Success: $message is $a + $b = $sum\n" if ($a + $b == $sum); return; # No more substitutions possible on this search branch } # Sum has more digits than components? If so, MSD of sum must be 1. if ($lensum > $lena && $lensum > $lenb && ! is_digit(substr($sum,0,1))) { die "Someone stole 1\n" unless is_available(1, @available); my $letter = substr($sum,0,1); try_substs(do_substs($letter, 1, $a,$b,$sum), $carry, reserve($letter, 1, @available)); return; # All possibilities tried in recursive call } # Look for a good subsitution, working backwards from LSDs # - if Nth last digit in $a and Nth last digit in $b are substituted # then Nth last digit in their sum _must_ be ($a + $b + $carry) % 10 # - if Nth last digit in $a is not substituted, try all available # values for that # - if Nth last digit in $a is substituted, and Nth last digit in $b # is not substituted, try all available values for that. for my $offset (0 .. ($lensum-1)) { my $a_char = ($offset > $lena ? '#' : substr($a,($lena-$offset-1),1)); my $b_char = ($offset > $lenb ? '#' : substr($b,($lenb-$offset-1),1)); my $sum_char = (substr($sum,($lensum-$offset-1),1)); # warn "offset = $offset; a_char = $a_char; b_char = $b_char; sum_char = $sum_char\n"; if ((($offset > $lena) || is_digit($a_char)) && (($offset > $lenb) || is_digit($b_char)) && (! is_digit($sum_char))) { my $wanted = ($a_char + $b_char + $carry) % 10; if (is_available($wanted,@available)) { $carry = (($a_char + $b_char + $carry) >= 10); try_substs(do_substs($sum_char,$wanted,$a,$b,$sum), $carry, reserve($sum_char,$wanted,@available)); } return; # Either impossible, or all tried in recursive call } if ($offset < $lena && ! is_digit($a_char)) { for my $possibility (0..9) { if (is_available($possibility,@available)) { try_substs(do_substs($a_char,$possibility,$a,$b,$sum), $carry, reserve($a_char,$possibility,@available)); } } return; # All possibilities tried in recursive call } elsif ($offset < $lenb && ! is_digit($b_char)) { for my $possibility (0..9) { if (is_available($possibility,@available)) { try_substs(do_substs($b_char,$possibility,$a,$b,$sum), $carry, reserve($b_char,$possibility,@available)); } } return; # All possibilities tried in recursive call } } die "Implementation error: fell through search for substitutions\n"; } sub solve { my $addition = shift; if ($addition =~ /^(\S+)\s*\+\s*(\S+)\s*=\s*(\S+)$/) { try_substs($1,$2,$3,0, 0 .. 9); } else { die "Malformed addition problem: $addition\n"; } } From ewen at naos.co.nz Wed Mar 2 00:11:21 2005 From: ewen at naos.co.nz (Ewen McNeill) Date: Wed Mar 2 00:12:14 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: Message from Ewen McNeill of "Wed, 02 Mar 2005 20:54:02 +1300." <20050302075403.0563D3C4877C@basilica.la.naos.co.nz> Message-ID: <20050302081121.1DB1D3C4877C@basilica.la.naos.co.nz> In message <20050302075403.0563D3C4877C@basilica.la.naos.co.nz>, Ewen McNeill writes: >>In message <1109700654.4261.11.camel@localhost>, Grant McLean writes: >>>Given the equation: [SEND + MORE = MONEY] > >Proof that what you need is a better algorithm, not a faster computer. >[...] I've just realised that there's an implementation error in the script I posted, which means that it doesn't reinforce one of the rules (although conincidentally it doesn't violate it in the answer it produces on the test case). Exercises for the readers at home: - what was the implementation error - why wasn't the rule violated in the test case? Ewen From srdjan at catalyst.net.nz Wed Mar 2 14:25:30 2005 From: srdjan at catalyst.net.nz (Srdjan) Date: Wed Mar 2 14:25:45 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <20050302075403.0563D3C4877C@basilica.la.naos.co.nz> References: <20050302075403.0563D3C4877C@basilica.la.naos.co.nz> Message-ID: <42263D5A.6090407@catalyst.net.nz> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I just couldn't help when I saw Ewen taking on this. Ewen McNeill wrote: | | I'd like to make the recursion go away (recursion feels "wrong" -- I | guess that means I didn't grow up a LISP programmer), but it's already | complicated enough without doing explicit stack management. Au contraire mes amis, I just love recursion. And I did not really bother with managing stacks - I just make a copy of everything that will be discarded if unsuccessful. I am a wasteful pig, but it could be improved by detecting places where copying is not necessary because no changes that may need reversing are made. Bonuses: 1. More than two words can be summed 2. Switch for allowing two letters to represent the same digit use strict; use POSIX qw(floor); use Storable qw(dclone); use Data::Dumper; use constant SCRAPPED => 'SCRAPPED'; use constant CURRENT => 'CURRENT'; my $ALLOW_DUPS = 0; my @summands = qw(SEND ME MORE); my $sum = 'MONEY'; my @reversed_split_summands; my $max_len = length($sum); foreach (@summands) { ~ my $len = length($_); ~ $max_len = $len if $len > $max_len; ~ my @reversed_split = reverse($_ =~ /(\w)/g); ~ push @reversed_split_summands, \@reversed_split; } my @reversed_split_sum = reverse($sum =~ /(\w)/g); my $sum_len = length($sum); my %init_ctrl; foreach ($sum, @summands) { ~ my $first_letter = substr($_, 0, 1); ~ $init_ctrl{$first_letter}{SCRAPPED()}{0} = 1; } my $solution_ctrl = try(\%init_ctrl, 0, 0, @reversed_split_summands); $solution_ctrl or print "No solution\n", exit; print "The solution\n"; traverse_ctrl($solution_ctrl, sub { ~ my ($letter, $letter_ctrl) = @_; ~ printf "%s => %d\n", $letter, $letter_ctrl->{CURRENT()}; }); sub traverse_ctrl { ~ my ($ctrl, $sub) = @_; ~ while ( my ($letter, $letter_ctrl) = each %$ctrl) { ~ $sub->($letter, $letter_ctrl); ~ } } sub try { ~ my ($ctrl, $pos, $carry, $my_element, @rest_of_the_summands) = @_; ~ $ctrl or die "No ctrl"; ~ my $my_ctrl = dclone($ctrl); ~ unless ($my_element) { ~ my $new_carry = sum($my_ctrl, $pos, $carry); ~ return unless defined $new_carry; ~ if ($pos == $sum_len - 1) { ~ return $new_carry == 0 ? $my_ctrl : undef; ~ } ~ return try($my_ctrl, $pos + 1, $new_carry, @reversed_split_summands); ~ } ~ my $curr_letter = $my_element->[$pos]; ~ unless ($curr_letter) { ~ debug ("No letter on pos $pos"); ~ return try( $my_ctrl, $pos, $carry, @rest_of_the_summands ); ~ } ~ my $letter_ctrl = $my_ctrl->{$curr_letter} ||= {}; ~ if ( my $curr_val = $letter_ctrl->{CURRENT()} ) { ~ debug ("Value for $curr_letter already set - $curr_val"); ~ return try( $my_ctrl, $pos, $carry, @rest_of_the_summands ); ~ } ~ my $scrapped = $letter_ctrl->{SCRAPPED()} ||= {}; ~ unless ($ALLOW_DUPS) { ~ traverse_ctrl($my_ctrl, sub { ~ my ($other_letter, $other_letter_ctrl) = @_; ~ return if $other_letter eq $curr_letter; ~ my $other_curr_val = $other_letter_ctrl->{CURRENT()}; ~ return unless defined $other_curr_val; ~ $scrapped->{$other_curr_val} = 1; ~ debug ("Scrapping $other_curr_val for $curr_letter - already used for $other_letter"); ~ }); ~ } ~ for (0..9) { ~ next if $scrapped->{$_}; ~ debug( "Letter $curr_letter - will try $_" ); ~ $letter_ctrl->{CURRENT()} = $_; ~ my $new_ctrl = try( $my_ctrl, $pos, $carry, @rest_of_the_summands ); ~ return $new_ctrl if $new_ctrl; ~ $scrapped->{$_} = 1; ~ } ~ return; # no good digit found } sub sum { ~ my ($ctrl, $pos, $carry) = @_; ~ $ctrl or die "No ctrl"; ~ my $s = $carry; ~ foreach (@reversed_split_summands) { ~ my $letter = $_->[$pos] or next; ~ my $value = $ctrl->{$letter}{CURRENT()}; ~ die "No value for $letter" unless defined $value;; ~ $s += $value; ~ } ~ my $new_sum_value = $s % 10; ~ my $new_carry = floor($s/10); ~ debug ("New sum and carry: $new_sum_value $new_carry"); ~ my $sum_letter = $reversed_split_sum[$pos] ~ or die "No sum letter on pos $pos"; # debug ("Sum letter $sum_letter", Dumper($ctrl)); ~ my $curr_sum_value = $ctrl->{$sum_letter}{CURRENT()}; ~ if ( defined $curr_sum_value ) { ~ unless ($new_sum_value == $curr_sum_value) { ~ debug ("New value for sum letter $sum_letter $new_sum_value conflicts with previously set $curr_sum_value"); ~ return; ~ } ~ } else { ~ unless ($ALLOW_DUPS) { ~ my $already_used; ~ traverse_ctrl($ctrl, sub { ~ my ($other_letter, $other_letter_ctrl) = @_; ~ return if $other_letter eq $sum_letter; ~ my $other_curr_val = $other_letter_ctrl->{CURRENT()}; ~ $already_used = $other_letter if $other_curr_val == $new_sum_value; ~ }); ~ if ($already_used) { ~ debug ("Cannot set sum letter to $new_sum_value - already used for $already_used"); ~ return; ~ } ~ } ~ $ctrl->{$sum_letter}{CURRENT()} = $new_sum_value; ~ debug ("Setting sum letter $sum_letter to $new_sum_value"); ~ } ~ return $new_carry; } sub debug { # print map "$_\n", @_; } -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCJj1aZtcHxCitRpgRApk7AJ4of2rHe2QHgKU9mVVH/HRe1TLKZgCgudBJ +YI3I52bjv/rZaBBDTSy/HE= =w6AE -----END PGP SIGNATURE----- From grant at mclean.net.nz Wed Mar 2 16:50:41 2005 From: grant at mclean.net.nz (Grant McLean) Date: Wed Mar 2 16:50:51 2005 Subject: [Wellington-pm] Listen up slackers! Message-ID: <1109811041.26369.20.camel@localhost> We need more people to 'sign up' for the lightning talk meeting on Monday the 14th of March (11 days from today). The evening will be fun for all, but it will be even more fun for those people who participate. 'Signing up' merely involves committing to giving a 5 minute talk. You don't need to be a subject expert or a gifted presenter - this is a great opportunity for first-timers. There are plenty of ideas for what you could talk about here: http://wellington.pm.org/lightning_talks.html You can sign up for more than one talk. Reply direct to me to book your slot. Regards Grant From michael at diaspora.gen.nz Wed Mar 2 17:13:29 2005 From: michael at diaspora.gen.nz (michael@diaspora.gen.nz) Date: Wed Mar 2 17:13:48 2005 Subject: [Wellington-pm] Listen up slackers! In-Reply-To: Your message of "Thu, 03 Mar 2005 13:50:41 +1300." <1109811041.26369.20.camel@localhost> Message-ID: Grant McLean writes: >We need more people to 'sign up' for the lightning talk meeting on >Monday the 14th of March (11 days from today). The evening will >be fun for all, but it will be even more fun for those people who >participate. How many people have signed up, and how many more do you need? (I, of course, *have* signed up for one slot, but I've learnt from last time I gave a talk -- until the first talk is plotted out, don't sign up for a second one!) -- michael. From jarich at perltraining.com.au Wed Mar 2 17:20:23 2005 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Wed Mar 2 17:20:38 2005 Subject: [Wellington-pm] Listen up slackers! In-Reply-To: <1109811041.26369.20.camel@localhost> References: <1109811041.26369.20.camel@localhost> Message-ID: <42266657.9050604@perltraining.com.au> Grant McLean wrote: > We need more people to 'sign up' for the lightning talk meeting on > Monday the 14th of March (11 days from today). The evening will > be fun for all, but it will be even more fun for those people who > participate. I wish I could make it over to Wellington to give a talk. I've recently had such good experiences with Class::DBI and HTML::FillInForm that I'd love an opportunity to sing their praises and show you all how much code you can get rid of just by using these two excellent modules. Unfortunately I don't have passport yet, and also, noone in Wellington has hired me to come over and do training. We've been invited to Auckland a few times though; Paul's gone each time. It seems that NCR/Teradata are very interested in Perl. :) All the best, Jacinta -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact@perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From sam at vilain.net Wed Mar 2 20:38:25 2005 From: sam at vilain.net (Sam Vilain) Date: Wed Mar 2 20:38:49 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <1109700654.4261.11.camel@localhost> References: <1109700654.4261.11.camel@localhost> Message-ID: <422694C1.7010600@vilain.net> Grant McLean wrote: > Can anyone come up with creative solutions for this? > > Given the equation: > > SEND > +MORE > ===== > MONEY > > Where each letter represents a digit (0-9) and neither S nor M can be > zero. Find the values for the letters which satisfy the equation. > There is only one solution. > > I came up with a brute force approach (below) which takes nearly two > minutes (1:50) on my workstation to check all possible answers and prove > the assertion that there is only one answer. OK, so I started a solution based on Quantum::Superpositions. The idea is to build up an expression that forms the thing you want to test, then let the system collapse to the superposition of the possible states. However, it seems that the objects returned by any() and all() in that distribution aren't `entangled' when used twice in an expression; that is, use Quantum::Superpositions; $\="\n"; my $a = any(1,0); print ($a + $a == 1); # prints 1, actually impossible print (2 * $a == 1); # prints any() (ie, none) This is something of a shame, otherwise, the below script might have stood some chance of working, though no doubt it would take the longest of all :-) Until we figure out how to link the quantum computers that control our wetware to Quantum::Superpositions, that is. Then it will take constant time, of course. #!/usr/bin/env perl -w use strict; use utf8; use Scriptalicious; # logical && can't be overloaded in Perl :-( sub And { $_[0] && $_[1]; } use Quantum::Superpositions BINARY_LOGICAL => [ "main::And" ]; my $no_dups; getopt("nodups|n" => \$no_dups); my $message = @ARGV ? (join " ", @ARGV) : 'SEND + MORE = MONEY'; # first, convert the input to a closure my %q; my $expr = "sub { "; while ( $message =~ m{\G(?: ([A-Z]+) | ([\(\)\+\-=/?]) | \s+ | (.) )}gx ) { my ($word, $oper) = ($1, $2); barf "bad character $3 in input" if $3; if ( $word ) { $expr .= "("; my $digit = 1; my $length = length $word; for my $letter ( split //, $word ) { $expr .= "+" if $digit > 1; $expr .= (" \$q{$letter}" .($length-$digit ? (" * ".(10**($length-$digit))." ") : " ")); # RULE: leading digits cannot be 0 $q{$letter} ||= ($digit == 1 ? any(1..9) : any(0..9)); $digit++; } $expr .= ")"; } elsif ( $oper ) { $expr .= "\n\t"; if ($oper eq "=") { $expr .= " == "; } elsif ($oper eq "?") { $expr .= " * "; } else { $expr .= " $oper " } $expr .= "\n\t"; } } $expr .= " }"; say "Sub is: $expr"; my $coderef = eval $expr; $@ and barf "sub built badly; GIGO? \$\@: $@"; start_timer; my $superpos = $coderef->(); say "Constructed superposition in ".show_delta; if ( $no_dups ) { say "now adding letters != each other restrictions"; my %seen; my @list = sort keys %q; while ( my $key = shift @list ) { mutter("$key != $_"), ($superpos = And($superpos, ( $q{$key} != $q{$_} ))) foreach @list; } } say "now computing eigenstates"; my @states = eigenstates( $superpos ); say "Completed in ".show_delta.", eigenstates are:"; print "$_\n" foreach @states; -- Sam Vilain, sam /\T vilain |><>T net, PGP key ID: 0x05B52F13 (include my PGP key ID in personal replies to avoid spam filtering) From ewen at naos.co.nz Wed Mar 2 20:55:15 2005 From: ewen at naos.co.nz (Ewen McNeill) Date: Wed Mar 2 20:56:13 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: Message from Sam Vilain of "Thu, 03 Mar 2005 17:38:25 +1300." <422694C1.7010600@vilain.net> Message-ID: <20050303045516.1DED23C4877C@basilica.la.naos.co.nz> In message <422694C1.7010600@vilain.net>, Sam Vilain writes: > use Quantum::Superpositions; > $\="\n"; > > my $a = any(1,0); > print ($a + $a == 1); # prints 1, actually impossible > print (2 * $a == 1); # prints any() (ie, none) $a + $a == 1 is possible if the first $a is taken as 1, and the second $a is taken as 0 (or vice versa). Where as there is no value in $a which can be multiplied by 2 and yeild 1 (you get 2 or 0). Seems to me that it's working the way that it should there. So your solution using Quantum::Superpositions may well work. Just be prepared for it to take a while. (Some of my early test runs of my brute force method took around 12 minutes; a bit of tuning got that down to the 4 minutes something that I posted.) Ewen From Malcolm.Allison at computerland.co.nz Wed Mar 2 20:58:44 2005 From: Malcolm.Allison at computerland.co.nz (Malcolm Allison) Date: Wed Mar 2 20:58:55 2005 Subject: [Wellington-pm] SEND + MORE = MONEY Message-ID: so $a + $a == 1 if $a != $a? this seems a little like cheating to me ;) Malcolm Allison Enterprise Systems Management Bureau Computerland NZ -----Original Message----- From: wellington-pm-bounces@pm.org [mailto:wellington-pm-bounces@pm.org] On Behalf Of Ewen McNeill Sent: Thursday, 3 March 2005 5:55 p.m. To: Wellington Perl Mongers (Perl user group) Subject: Re: [Wellington-pm] SEND + MORE = MONEY In message <422694C1.7010600@vilain.net>, Sam Vilain writes: > use Quantum::Superpositions; > $\="\n"; > > my $a = any(1,0); > print ($a + $a == 1); # prints 1, actually impossible > print (2 * $a == 1); # prints any() (ie, none) $a + $a == 1 is possible if the first $a is taken as 1, and the second $a is taken as 0 (or vice versa). Where as there is no value in $a which can be multiplied by 2 and yeild 1 (you get 2 or 0). Seems to me that it's working the way that it should there. So your solution using Quantum::Superpositions may well work. Just be prepared for it to take a while. (Some of my early test runs of my brute force method took around 12 minutes; a bit of tuning got that down to the 4 minutes something that I posted.) Ewen _______________________________________________ Wellington-pm mailing list Wellington-pm@pm.org http://mail.pm.org/mailman/listinfo/wellington-pm From stevew at catalyst.net.nz Wed Mar 2 21:14:39 2005 From: stevew at catalyst.net.nz (Steve Wray) Date: Wed Mar 2 21:14:51 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: References: Message-ID: <42269D3F.5030007@catalyst.net.nz> Malcolm Allison wrote: > so $a + $a == 1 if $a != $a? > > this seems a little like cheating to me ;) Depends on how well-behaved the arithmetic operators are with respect to side-effects: operators changing their operands 'behind your back' like some sort functions that don't *return* a sorted list; they change the list argument you give them into a sorted list. Since side-effects are allowed in some languages, like perl, and since it may be possible in a sufficiently ill-designed language, , to have an arithmetic operator 'side-effect' in a really disastrous way, and indeed $a + $a may come to == 1 when $a starts as 1 and the + operator decrements it by 1 part way through the operation. $a + $a == 1 is only guaranteed in languages that don't allow side-effects, eg prolog, haskell, caml, maybe even lisp. It can really help when trying to figure out what a program does, because you can always be sure that whatever happens, happens 'in front' of you and that no operators or functions will make any state changes which don't involve their return values. This gets just a little messy when it comes to IO :) > In message <422694C1.7010600@vilain.net>, Sam Vilain writes: > >> use Quantum::Superpositions; [snip] > > $a + $a == 1 is possible if the first $a is taken as 1, and the second > $a is taken as 0 (or vice versa). Where as there is no value in $a > which can be multiplied by 2 and yeild 1 (you get 2 or 0). From Malcolm.Allison at computerland.co.nz Wed Mar 2 21:20:21 2005 From: Malcolm.Allison at computerland.co.nz (Malcolm Allison) Date: Wed Mar 2 21:20:32 2005 Subject: [Wellington-pm] SEND + MORE = MONEY Message-ID: of course you could always break out of integer math and then there is a very simple value that means both $a + $a == 1 and $a * 2 == 1 are resolvable. Malcolm. -----Original Message----- From: wellington-pm-bounces@pm.org [mailto:wellington-pm-bounces@pm.org] On Behalf Of Steve Wray Sent: Thursday, 3 March 2005 6:15 p.m. To: Wellington Perl Mongers (Perl user group) Subject: Re: [Wellington-pm] SEND + MORE = MONEY Malcolm Allison wrote: > so $a + $a == 1 if $a != $a? > > this seems a little like cheating to me ;) Depends on how well-behaved the arithmetic operators are with respect to side-effects: operators changing their operands 'behind your back' like some sort functions that don't *return* a sorted list; they change the list argument you give them into a sorted list. Since side-effects are allowed in some languages, like perl, and since it may be possible in a sufficiently ill-designed language, , to have an arithmetic operator 'side-effect' in a really disastrous way, and indeed $a + $a may come to == 1 when $a starts as 1 and the + operator decrements it by 1 part way through the operation. $a + $a == 1 is only guaranteed in languages that don't allow side-effects, eg prolog, haskell, caml, maybe even lisp. It can really help when trying to figure out what a program does, because you can always be sure that whatever happens, happens 'in front' of you and that no operators or functions will make any state changes which don't involve their return values. This gets just a little messy when it comes to IO :) > In message <422694C1.7010600@vilain.net>, Sam Vilain writes: > >> use Quantum::Superpositions; [snip] > > $a + $a == 1 is possible if the first $a is taken as 1, and the > second $a is taken as 0 (or vice versa). Where as there is no value > in $a which can be multiplied by 2 and yeild 1 (you get 2 or 0). _______________________________________________ Wellington-pm mailing list Wellington-pm@pm.org http://mail.pm.org/mailman/listinfo/wellington-pm From ewen at naos.co.nz Wed Mar 2 22:06:24 2005 From: ewen at naos.co.nz (Ewen McNeill) Date: Wed Mar 2 22:07:16 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: Message from "Malcolm Allison" of "Thu, 03 Mar 2005 17:58:44 +1300." Message-ID: <20050303060624.593383C4877C@basilica.la.naos.co.nz> In message , "Malcolm Allison" writes: >Ewen McNeill wrote: >>In message <422694C1.7010600@vilain.net>, Sam Vilain writes: >>> use Quantum::Superpositions; #.... >>> my $a = any(1,0); >>> print ($a + $a == 1); # prints 1, actually impossible >> >>$a + $a == 1 is possible if the first $a is taken as 1, and the second >>$a is taken as 0 (or vice versa). Where as there is no value in $a >>which can be multiplied by 2 and yeild 1 (you get 2 or 0). > >so $a + $a == 1 if $a != $a? >this seems a little like cheating to me ;) $a = any(1,0); $a + $a == 1; corresponds to any(1,0) + any(1,0) == 1 which is true providing you pick 1 from one of them and 0 from the other. I don't really see that as cheating -- it's supposed to be true if there's some way of picking values from each of the quantum superpositions (ie, sets) such that it comes up with the desired result. I suppose you could argue that it's breaking the analogy with quantum physics (where looking at something supposedly resolves its value at which point it is then fixed -- and hence $a should always take on the same value), but the Quantum::Superposition (and the Perl6 equivilent) is really more about set theory AFAICS. You could try complaining to Damian Conway (original author) and/or Steven Lembrak (current maintainer) that it violates the analogy with quantum physics, by not respecting entanglement. But I suspect at this point they probably care more about compatibility with Perl 6 (which is more set theory based I believe). Ewen PS: If the quantum superpositions are anything like all the possible permutations (1.8 million) then expect it to take a lot of time/memory in this situation. (I had to abandon my first attempt to generate a set of all possible permutations and iterate through them, because the memory load was simply too high. Hence the more object-oriented approach I posted, which generates one permutation at a time.) From douglas at paradise.net.nz Thu Mar 3 14:19:59 2005 From: douglas at paradise.net.nz (Douglas Bagnall) Date: Thu Mar 3 14:22:33 2005 Subject: [Wellington-pm] SEND + MORE = MONEY Message-ID: <42278D8F.6070401@paradise.net.nz> Yesterday, I had a go with a hybrid stochastic/ combinatorial approach. I reasoned (or rather, imagined) that when the error is low, the most significant digits would be settled, and permutations of the less significant digits would quickly find the solution. This was not true. While M and O are easily fixed, S could be any manner of things with the sum out by only one. So I gave that up, but seeing that there were these local minima, I imagined again that the evolutionary process was occasionally getting stuck in them, thus not coming up with an answer in any given number of cycles. I borrowed from the natural world and introduced periodic cataclysmic events, so if progress is arbitrarily slow, the entire pool gets jumbled. It seems to work -- it hasn't been stuck since, over thousands of cycles. On an Athlon XP 2800+, it takes about 0.2 seconds per solution -- the script solves it 100 times to get a reasonable average. $ time ./sum4.pl found '9567 + 1085 = 10652' (SONYEMDR => 90625178), 100 times real 0m17.634s For questions with more than one solution, it tends to find them all. For example, Srdjan's sum has 2 solutions: $ ./sum4.pl 'SEND + ME + MORE = MONEY' found '9458 + 14 + 1074 = 10546' (SONYEMDR => 90564187), 52 times found '9346 + 13 + 1073 = 10432' (SONYEMDR => 90423167), 48 times douglas #!/usr/bin/perl -w use strict; my $message = shift || 'SEND + MORE = MONEY'; my $GOES = shift || 100; my $ITERATIONS = shift || 2000; my $POOL = shift || 100; my $CUTOFF = shift || 34; my $CATACLYSMS = shift || 400; my $INF = 1e999; my $MAXMAG = 12; #maximum word length. my @letters = keys %{{ map { $_ => 1} ($message =~ /([A-Z])/g)}}; my $letters = join('', @letters); my $len = @letters; my $equation = $message; $equation =~ s/=/-/; # should check for bad chars, # put () around each side. my %answers; my $noanswer = 0; OUTER: foreach(1..$GOES){ my @nums = (0..9); my %candidates = map { for (my $i = 10; --$i;) { my $r = int(rand($i + 1)); ($nums[$i], $nums[$r]) = ($nums[$r], $nums[$i]); }; substr(join('', @nums), 0, $len) => $INF; }(1..$POOL); foreach my $i (1..$ITERATIONS){ my @scores = sort {$a <=> $b} (values(%candidates)); my $cutoff = $scores[$CUTOFF]; my %new_candidates; while (my ($digits, $score) = each %candidates) { if ($score eq $INF){ $_ = $equation; eval "tr/$letters/$digits/"; next if(/\b0/); $score = abs (eval $_); next if ($score > $cutoff); if ($score == 0){ s/-/=/; #print "found $digits in $i iterations\n"; $answers{$digits} += 1; next OUTER; } } $new_candidates{$digits} = $score if ($score <= $cutoff); } %candidates = %new_candidates; my @mutatees = keys(%candidates); my $c = @mutatees; if ($i % $CATACLYSMS){ while ($c < $POOL){ foreach my $digits (@mutatees){ my $pos = int(rand($len)); my $new_n = int(rand(10)); my $old_n = substr($digits, $pos, 1, 'x'); $digits =~ s/$new_n/$old_n/; $digits =~ s/x/$new_n/; $candidates{$digits} = $INF; last if (++$c >= $POOL); } } } else{ # damage all answers. %candidates = (); $c = 0; #print " * cataclysm after $i cycles\n"; while ($c < $POOL){ foreach my $digits (@mutatees){ foreach(1..3){ my $pos = int(rand($len)); my $new_n = int(rand(10)); my $old_n = substr($digits, $pos, 1, 'x'); $digits =~ s/$new_n/$old_n/; $digits =~ s/x/$new_n/; } $candidates{$digits} = $INF; last if (++$c >= $POOL); } } } } print "No solution found after $ITERATIONS iterations!\n"; $noanswer += 1; } while(my ($digits, $count) = each(%answers)){ $_ = $message; eval "tr/$letters/$digits/"; print "found '$_' ($letters => $digits), $count times\n"; } From grant at mclean.net.nz Thu Mar 3 15:49:27 2005 From: grant at mclean.net.nz (Grant McLean) Date: Thu Mar 3 15:49:39 2005 Subject: [Wellington-pm] SEND + MORE = MONEY In-Reply-To: <42278D8F.6070401@paradise.net.nz> References: <42278D8F.6070401@paradise.net.nz> Message-ID: <1109893767.13872.4.camel@localhost> On Fri, 2005-03-04 at 11:19 +1300, Douglas Bagnall wrote: > > Yesterday, I had a go with a hybrid stochastic/ combinatorial approach. EMAIL - PERL = WTF ?!? I guess the fact that my only contributions to this whole thread have used a brute force approach already reveals just how little I know about maths. From sam at vilain.net Thu Mar 3 18:31:43 2005 From: sam at vilain.net (Sam Vilain) Date: Thu Mar 3 18:32:02 2005 Subject: [Wellington-pm] SQL solution! In-Reply-To: <20050303060624.593383C4877C@basilica.la.naos.co.nz> References: <20050303060624.593383C4877C@basilica.la.naos.co.nz> Message-ID: <4227C88F.5030309@vilain.net> Ewen McNeill wrote: > quantum physics, by not respecting entanglement. But I suspect at this > point they probably care more about compatibility with Perl 6 (which is > more set theory based I believe). This made me realise how similar the tasks of collapsing eigenstates into results is to a set theory expression. So, here's a solution. It seems this one takes the cake for execution time and thoroughness :-) -- MySQL table setup: CREATE TABLE Dx ( X INTEGER(1) ); INSERT INTO Dx (X) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); CREATE TABLE Cx ( X INTEGER(1) ); INSERT INTO Cx (X) VALUES (0),(1); -- Oracle table setup: CREATE TABLE Cx ( X NUMBER(1)); CREATE TABLE Dx ( X NUMBER(1)); INSERT INTO Cx (X) VALUES (0); INSERT INTO Cx (X) VALUES (1); INSERT INTO Dx (SELECT ROWNUM-1 FROM Cx C0, Cx C1, Cx C2, Cx C3 WHERE ROWNUM <= 10); -- actual query: SELECT (S.X * 1000 + E.X * 100 + N.X * 10 + D.X) as SEND, (M.X * 1000 + Oh.X * 100 + R.X * 10 + E.X) as MORE, (M.X * 10000 + Oh.X * 1000 + N.X * 100 + E.X * 10 + Y.X) as MONEY from Dx M LEFT JOIN Dx S ON (M.X != S.X) LEFT JOIN Dx E ON ( (M.X != E.X) AND (S.X != E.X) ) LEFT JOIN Dx Oh ON ( (M.X !=Oh.X) AND (S.X !=Oh.X) AND (E.X !=Oh.X) ) LEFT JOIN Dx N ON ( (M.X != N.X) AND (S.X != N.X) AND (E.X != N.X) AND (Oh.X != N.X) ) LEFT JOIN Dx R ON ( (M.X != R.X) AND (S.X != R.X) AND (E.X != R.X) AND (Oh.X != R.X) AND (N.X != R.X) ) LEFT JOIN Dx D ON ( (M.X != D.X) AND (S.X != D.X) AND (E.X != D.X) AND (Oh.X != D.X) AND (N.X != D.X) AND (R.X != D.X) ) LEFT JOIN Dx Y ON ( (M.X != Y.X) AND (S.X != Y.X) AND (E.X != Y.X) AND (Oh.X != Y.X) AND (N.X != Y.X) AND (R.X != Y.X) AND (D.X != Y.X) ) LEFT JOIN Cx C0 ON ( C0.X = floor( (D.X + E.X) / 10 ) ) LEFT JOIN Cx C1 ON ( C1.X = floor( (N.X + R.X + C0.X) / 10 ) ) LEFT JOIN Cx C2 ON ( C2.X = floor( (E.X + Oh.X + C1.X) / 10 ) ) LEFT JOIN Cx C3 ON ( C3.X = floor( (S.X + M.X + C2.X) / 10 ) ) WHERE ( M.X != 0 ) AND ( S.X != 0 ) AND ( C3.X ) = M.X AND MOD( S.X + M.X + C2.X, 10) = Oh.X AND MOD( E.X +Oh.X + C1.X, 10) = N.X AND MOD( N.X + R.X + C0.X, 10) = E.X AND MOD( D.X + E.X , 10) = Y.X ; -- Sam Vilain, sam /\T vilain |><>T net, PGP key ID: 0x05B52F13 (include my PGP key ID in personal replies to avoid spam filtering) From grant at mclean.net.nz Sun Mar 6 22:22:16 2005 From: grant at mclean.net.nz (Grant McLean) Date: Sun Mar 6 22:22:35 2005 Subject: [Wellington-pm] [Fwd: Newsletter from O'Reilly UG Program, March 3] Message-ID: <1110176536.4347.1.camel@localhost> -------- Forwarded Message -------- > From: Marsee Henon > To: perlmongers@catalyst.net.nz > Subject: Newsletter from O'Reilly UG Program, March 3 > Date: Thu, 03 Mar 2005 17:03:43 -0800 > ================================================================ > O'Reilly News for User Group Members > March 3, 2005 > ================================================================ > ---------------------------------------------------------------- > Book News > ---------------------------------------------------------------- > -Jakarta Struts Cookbook > -Apple I Replica Creation > -Programming Flash Communication Server > -The Linux Enterprise Cluster > -Programming C#, 4th Edition > -Pragmatic Version Control Using Subversion > -PC Hardware Buyer's Guide > -Game Coding Complete, Second Ed. > -Office 2004 for Macintosh: The Missing Manual > -Linux in a Windows World > ---------------------------------------------------------------- > Upcoming Events > ---------------------------------------------------------------- > -Bonnie Biafore ("Online Investing Hacks") San Francisco Investors' > Forum, San Ramon, CA--March 5 > -O'Reilly at PhotoShop World, Las Vegas, NV--March 9 > -Steve Bass ("PC Annoyances") on the Radio with ComputerAmerica > March 7, April 4, May 2, and June 6 > -Steve Bass ("PC Annoyances") on "AirTalk with Larry Mantle," > KPCC (89.3FM), Pasadena, CA--March 15 > -Greg Kroah-Hartman, ("Linux Device Drivers, 3rd Ed."), Powell's Technical > Bookstore, Portland, OR--April 16 > ---------------------------------------------------------------- > Conference News > ---------------------------------------------------------------- > -Register for the 2005 O'Reilly Emerging Technology Conference, > San Diego, CA--March 14-17 > -Register for the 2005 MySQL Users Conference, > Santa Clara, CA--April 18-21 > ---------------------------------------------------------------- > News > ---------------------------------------------------------------- > -How Paris Got Hacked? > -SafariU Revolutionizes the Textbook > -Remixing Culture: An Interview with Lawrence Lessig > -O'Reilly Learning Lab: $200 Instant Rebate > -MAKE Subscriptions Available > -Trouble in the Kernel, VMware, and PostgreSQL > -Building the PostgreSQL BuildFarm > -Display Your Favorite Album Artwork in iTunes > -Build an iTunes Remote Control > -Mac Books in Newsweek > -Understanding Administrative Templates > -Data Binding in ASP.NET 2.0 > -A Look at Commons Chain: The New Java Framework > -Aspect-Oriented Annotations > -Rid Yourself of Digital Media Annoyances > -Build a Simple MP3 Player for Your Site > -Actions for Photoshop Elements 3 > -Yahoo! Web Services > -Not the Usual Suspects: Recruiting Usability Test Participants > -Logs, Browsers and Statistics: The Decline of Internet Explorer 5 > > ================================================ > Book News > ================================================ > Did you know you can request a free book to review for your > group? Ask your group leader for more information. > > For book review writing tips and suggestions, go to: > http://ug.oreilly.com/bookreviews.html > > Don't forget, you can receive 20% off any O'Reilly, No Starch, > Paraglyph, Pragmatic Bookshelf, SitePoint, or Syngress book you > purchase directly from O'Reilly. > Just use code DSUG when ordering online or by phone 800-998-9938. > http://www.oreilly.com/ > > ***Free ground shipping is available for online orders of at > least $29.95 that go to a single U.S. address. This offer > applies to U.S. delivery addresses in the 50 states and Puerto Rico. > For more details, go to: > http://www.oreilly.com/news/freeshipping_0703.html > > ---------------------------------------------------------------- > New Releases > ---------------------------------------------------------------- > ***Jakarta Struts Cookbook > Publisher: O'Reilly > ISBN: 059600771X > "Jakarta Struts Cookbook" is an amazing collection of code solutions to > common--and uncommon--problems encountered when building web applications > with the Struts Framework. With solutions to real-world problems, this > look-up reference is perfect for independent developers, large development > teams, and everyone in between who wishes to use the Struts Framework to > its fullest potential. Plus, it is completely up-to-date with the latest > versions of Framework, so readers can be sure the information is viable. > http://www.oreilly.com/catalog/jakartastrutsckbk/index.html > > Chapter 14, "Tiles and Other Presentation Approaches," is available > online: > http://www.oreilly.com/catalog/jakartastrutsckbk/chapter/index.html > > > ***Apple I Replica Creation > Back to the Garage > Publisher: Syngress > ISBN: 193183640X > Computers like the Apple I are incredibly simple machines. Even if you > have no experience with electronics, this book will teach you how to build > your own replica of the Apple I, show you how to program it yourself, and > introduce you to exciting ways to expand your Apple I to control lights, > motors, and more. > http://www.oreilly.com/catalog/193183640X/index.html > > > ***Programming Flash Communication Server > Publisher: O'Reilly > ISBN: 0596005040 > "Programming Flash Communication Server" not only explains how to use the > pre-built FCS components to construct a simple application, it also > explains the architecture so that developers can program custom components > to make even more advanced applications. In addition, the book explains > how to truly optimize performance and talks about considerations for > networked applications as well as the media issues pertaining to FCS. > http://www.oreilly.com/catalog/progflashcs/index.html > > Chapter 1, "Introducing the Flash Communication Server," is available > online: > http://www.oreilly.com/catalog/progflashcs/chapter/index.html > > > ***The Linux Enterprise Cluster > Publisher: No Starch Press > ISBN: 1593270364 > "The Linux Enterprise Cluster" is a practical guide for building and > installing an enterprise-class cluster for mission critical applications > using commodity hardware and open source software. Includes information on > how to build a high-availability server pair using the Heartbeat package, > how to use the Linux Virtual Server load balancing software, how to > configure a reliable printing system, and how to build a job scheduling > system with no single point of failure. > http://www.oreilly.com/catalog/1593270364/index.html > > > ***Programming C#, 4th Edition > Publisher: O'Reilly > ISBN: 0596006993 > Aimed at experienced programmers and web developers, this fourth edition > of the top-selling C# book focuses on the features and programming > patterns that are new to C# and fundamental to the programming of web > services and applications on Microsoft's .NET platform. This edition has > also been updated to reflect the C# ISO standard as well as changes in > Microsoft's implementation of the language. > http://www.oreilly.com/catalog/progcsharp4/index.html > > Chapter 12, "Delegates and Events," is available online: > http://www.oreilly.com/catalog/progcsharp4/chapter/index.html > > > ***Pragmatic Version Control Using Subversion > Publisher: Pragmatic Bookshelf > ISBN: 0974514063 > Half of all project teams in the U.S. don't use any version control at > all, and many others experience problems. Version control is the lifeblood > of software projects, but it doesn't have to be complicated or time > consuming. This recipe-based book covers the theory behind version control > and shows how it can help developers become more efficient, work better as > a team, and keep on top of software complexity. > http://www.oreilly.com/catalog/0974514063/index.html > > > ***PC Hardware Buyer's Guide > Publisher: O'Reilly > ISBN: 0596009380 > This handy guide is the ideal shopping companion for people who wish to > build their own desktop computer. Loaded with valuable information, the > "PC Hardware Buyer's Guide" helps you choose which parts are best for you > by linking compatibility and performance with your own particular profile. > This book features a component overview, valuable rules of thumb, and a > quick-lookup reference chart with recommended brands and models. > http://www.oreilly.com/catalog/pccbg/index.html > > > ***Game Coding Complete, Second Ed. > Publisher: Paraglyph Press > ISBN: 1932111913 > "Game Coding Complete, Second Ed." is the essential hands-on guide to > developing commercial quality games written by master game programmer Mike > McShaffry. This must-have second edition has been expanded from the > bestselling first edition to include the absolute latest in exciting new > techniques in game interface design programming, game audio development, > game scripting, 3D programming, and game engine technology. > http://www.oreilly.com/catalog/1932111913/index.html > > > ***Office 2004 for Macintosh: The Missing Manual > Publisher: O'Reilly > ISBN: 0596008201 > Whether you're an Office beginner eager to understand the applications in > the suite or a longtime Office user looking for power-user techniques and > detailed coverage of what's new in Office 2004, this book delivers > everything you need to master all four Office 2004 programs for Mac--Word, > Excel, PowerPoint, and Entourage. According to Microsoft, the average > Office user taps into less than 15 percent of the suite's features. Get > 100 percent out of Office 2004 by getting the Missing Manual. > http://www.oreilly.com/catalog/officemactmm/index.html > > > ***Linux in a Windows World > Publisher: O'Reilly > ISBN: 0596007582 > An invaluable companion for any system administrator interested in > integrating Linux into their Windows environment, this book takes an > in-depth look at exactly how Linux can be brought into an organization > that's currently based on Microsoft Windows systems. Featuring a litany of > insider tips and techniques, "Linux in a Windows World" dispenses all the > practical advice you need to migrate to this revolutionary open source > software. > http://www.oreilly.com/catalog/linuxwinworld/index.html > > Chapter 7, "Using NT Domains for Linux Authentication," is available > online: > http://www.oreilly.com/catalog/linuxwinworld/chapter/index.html > > ================================================ > Upcoming Events > ================================================ > ***For more events, please see: > http://events.oreilly.com/ > > ***Bonnie Biafore ("Online Investing Hacks"), San Francisco Investors' > Forum, San Ramon, CA--March 5 > Bonnie will be teaching a workshop at this event. > SBC Center, San Ramon, CA > http://www.better-investing.org/chapter/sanfran/ > > > ***O'Reilly at PhotoShop World, Las Vegas, NV--March 9 > Come by and say hi and check out our latest Digital Media books at our > booth (#220). > Mandalay Bay Resort, Las Vegas, NV. > http://www.photoshopworld.com/ > > > ***Steve Bass ("PC Annoyances") on the Radio with ComputerAmerica > March 7, April 4, May 2, and June 6 > He will be on the radio from 7:00-8:00pm (PST) Call in during the show! > The number is 866-606-8255. > > To listen to the show live, go to: > http://www.computeramerica.com/listen.htm > > To chat while Steve's on the air, go to: > http://www.computeramerica.com/interact.htm > > Check for a local station here on "Business Talk Radio": > http://snipurl.com/computeramerica3 > > > ***Steve Bass ("PC Annoyances") on "AirTalk with Larry Mantle," > KPCC (89.3FM), Pasadena, CA--March 15 > Click "Listen Live" to hear the show 11:00am through 12:00pm (PST): > http://www.kpcc.org > > > ***Greg Kroah-Hartman, ("Linux Device Drivers, 3rd Ed"), > Powell's Technical Bookstore, Portland, OR--April 16 > Come on by and listen to Greg talk about his new book. > Saturday, April 16th at 1:00pm > Powell's Technical Books > 33 NW Park Avenue > Portland, OR 97209 USA > http://www.powells.com/technicalbooks > > ================================================ > Conference News > ================================================ > ***2005 O'Reilly Emerging Technology Conference, > San Diego, CA--March 14-17 > This year's conference theme is "Remix," which infuses ETech's > roll-up-your-sleeves tutorials, to-the-point plenary presentations, and > real world focused breakout sessions. Come to ETech and discover how > applications and hardware are being deconstructed and recombined in > unexpected ways. Learn how users and customers are influencing new > interfaces, devices, business models, and services. For all the scoop on > tutorials, featured speakers, and conference events, check out: > http://conferences.oreillynet.com/etech/ > > User group members use code DSUG when you register, and receive 20% off > the registration price. > > To register for the conference, go to: > http://conferences.oreillynet.com/cs/et2005/create/ord_et05 > > > ***Register for the 2005 MySQL Users Conference, > Santa Clara, CA--April 18-21 > The MySQL Users Conference, co-presented by O'Reilly Media and MySQL AB, > brings together experts, users, and industry leaders with unique MySQL > insights, offering attendees a detailed look into new features in MySQL > 5.0, sessions and workshops designed to teach best practices, and exposure > to new open source technologies. > For more information, go to: > http://www.mysqluc.com/ > > User Group members who register before Febuary 28, 2005 get a double > discount. Use code DSUG when you register, and receive 20% off the > early registration price. > > To register for the conference, go to: > http://conferences.oreillynet.com/cs/mysqluc2005/create/ord_mysql05 > > ================================================ > News From O'Reilly & Beyond > ================================================ > --------------------- > General News > --------------------- > ***How Paris Got Hacked? > Like many online service providers, T-Mobile requires users to answer a > "secret question" if they forget their passwords. For Paris Hilton's > account, the secret question was "What is your favorite pet's name?" By > correctly providing the well-known answer, any internet user could change > Hilton's password and freely access her account. > http://www.macdevcenter.com/pub/a/mac/2005/01/01/paris.html > > > ***SafariU Revolutionizes the Textbook > With SafariU, you can you create and publish your own textbook, selecting > exactly the book chapters, sections, or articles you need from the > impressive Safari database. SafariU costs you nothing to use and offers > your students more focused course content at less cost. Sign up now, get a > jump on your summer and fall course prep, and your first custom textbook > could be ready to print before spring break. Visit SafariU to view a video > demo and sign up for access. > http://academic.oreilly.com/safariu-more.csp > > > ***Remixing Culture: An Interview with Lawrence Lessig > What do you get when you mix P2P, inexpensive digital input devices, open > source software, easy editing tools, and reasonably affordable bandwidth? > Potentially, you get what Lawrence Lessig calls remix culture, which he > explains in this extensive interview. > http://www.oreillynet.com/pub/a/policy/2005/02/24/lessig.html > > The concept of remixing culture is also the topic of his keynote at > O'Reilly's upcoming Emerging Technology Conference, March 14-17 > in San Diego. > http://conferences.oreillynet.com/etech/ > > > ***O'Reilly Learning Lab: $200 Instant Rebate > Learning programming languages and development techniques has never been > easier. Using your web browser and Useractive's Learning Sandbox technology, > the Learning Lab gives you hands-on, online training in a creative > environment. This month, receive a $200 instant rebate (and a Certificate > from the University of Illinois Office of Continuing Education upon course > completion) when you enroll in any Certificate Series. > http://www.oreilly.com/redirector.csp?link=UACert&type=news > > > ***MAKE Subscriptions Available > The annual subscription price for four issues is $34.95. When you > subscribe with this link, you'll get a free issue--the first one plus four > more for $34.95. So subscribe for yourself or friends with this great > offer for charter subscribers: five volumes for the cost of four. > > Subscribe at: > https://www.pubservice.com/MK/Subnew.aspx?PC=MK&PK=M5ZUGLA > > The MAKE blog is available at: > http://www.makezine.com/blog/ > > --------------------- > Open Source > --------------------- > ***Trouble in the Kernel, VMware, and PostgreSQL > Noel Davis looks at problems in the Linux kernel, VMware, PostgreSQL, > Squid, MySQL, mailman, Apple OSX HFS+, movemail with GNU Emacs or XEmancs, > KStars, typespeed, awstats, and synaesthesia. > http://www.linuxdevcenter.com/pub/a/linux/2005/02/28/security_alerts.html > > > ***Building the PostgreSQL BuildFarm > Managing a cross-platform open source project is difficult; how do you > test on all the platforms you support? Leverage the time and resources of > your users! Andrew Dunstan took a tip from the Samba team and recently set > up a build farm for the PostgreSQL project to report build successes and > failures from interested users. Here's how he did it. > http://www.onlamp.com/pub/a/onlamp/2005/02/24/pg_buildfarm.html > > --------------------- > Mac > --------------------- > ***Display Your Favorite Album Artwork in iTunes > Love your iPod but miss the album art? In iTunes 4, you can associate an > album's artwork with a song so it can be displayed while you play the > song. Wei-Meng Lee shows you how to use two free programs, Clutter and > art4iTunes.com, to simplify the task. For more tricks and tips on using > your iPod photo, check out Wei-Meng's latest eDoc, All About Your iPod > Photo. > http://www.macdevcenter.com/pub/a/mac/2005/02/22/albumart.html > > > ***Build an iTunes Remote Control > AirPort Express is great for streaming music from your Mac, except when > you have to change tracks from another room. There are commercial > solutions available, but here's a great evening project using your > web-enabled cell phone and the power of Mac OS X. > http://www.macdevcenter.com/pub/a/mac/2005/03/01/itunes_remote.html > > > ***Mac Books in Newsweek > No Starch's "The Cult of Mac" and O'Reilly's "Revolution in the Valley" > were mentioned in Newsweek's Quick Read, February 21 Issue. > http://www.msnbc.msn.com/id/6934650/site/newsweek/ > > "The Cult of Mac" > http://www.oreilly.com/catalog/1886411832/index.html > > "Revolution in the Valley" > http://www.oreilly.com/catalog/revolution/ > > --------------------- > Windows/.NET > --------------------- > ***Understanding Administrative Templates > Administrative templates are a key management component of Group Policy on > Windows 2000, Windows XP, and Windows Server 2003. Mitch Tulloch, author > of "Windows Server Hacks," shows you how they work and how to use them. > http://www.windowsdevcenter.com/pub/a/windows/2005/03/01/Admin_templates..html > > > ***Data Binding in ASP.NET 2.0 > Not only has Microsoft made radical changes in how data binding is done > between ASP.NET 1.x and 2.0, but it has also created significant > differences between how it is done in Windows Forms and ASP.NET in 2.0. > This keeps life interesting (Jesse Liberty says, gnashing his teeth). In > this new column, he dives into data binding in the new Web Forms. > http://www.ondotnet.com/pub/a/dotnet/2005/02/22/liberty.html > > --------------------- > Java > --------------------- > ***A Look at Commons Chain: The New Java Framework > In part one of a two-part series, Bill Siggelkow covers the basics of > Chain, a promising new framework from the Jakarta Commons subproject that > lets you integrate Chain into the Struts build process. In part two, Bill > will cover how Chain is being applied to Struts and other projects. Bill > is the author of O'Reilly's "Jakarta Struts Cookbook." > http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains.html > > > ***Aspect-Oriented Annotations > Aspect-Oriented Programming (AOP) and attributes are two leading-edge > programming concepts, each with typical applications. By combining them, > using attributes to indicate where AOP code should execute, you can > effectively declare new Java syntax. Bill Burke introduces this new > technique. > http://www.onjava.com/pub/a/onjava/2004/08/25/aoa.html > > --------------------- > Digital Media > --------------------- > ***Rid Yourself of Digital Media Annoyances > Sometimes those little quirks in your favorite digital media toys can take > all the fun out of playing. Preston Gralla offers a baker's dozen fixes to > MP3, iTunes, and QuickTime annoyances, so you can get back to the fun. > Preston is the author of "Internet Annoyances." > http://www.windowsdevcenter.com/pub/a/windows/2005/02/22/internetannoy.html > > > ***Build a Simple MP3 Player for Your Site > You don???t have to monkey with Flash, redundant windows, or unpredictable > plugins to deliver smart-looking audio playback for your visitors. With > this sneaky bit of JavaScript, you can generate pop-up music players on > the fly. > http://digitalmedia.oreilly.com/2005/02/23/mp3_embed.html > > > ***Actions for Photoshop Elements 3 > Want to automate a complicated artistic effect, like making a photo look > like a watercolor, or adding a 3-D frame? Photoshop Elements 3 makes these > tasks easy with actions. Barbara Brundage, author of "Photoshop Elements > 3: The Missing Manual," shows you how to write, install, and troubleshoot > actions in Elements 3, for the Mac or Windows. > http://digitalmedia.oreilly.com/2005/02/23/PSelement3.html > > --------------------- > Web > --------------------- > ***Yahoo! Web Services > Paul Bausch takes a look at the new Yahoo! Web Services interface and > shows how to tap into the API with a sample application. > http://www.oreillynet.com/pub/a/network/2005/02/28/yahoo.html > > > ***Not the Usual Suspects: Recruiting Usability Test Participants > Isn't usability testing a simple matter of getting pals or colleagues to > look over a site in exchange for free pizza? No, it's not... Liz explains > how easy it is to gather suitable, site-relevant test participants using a > number of possible sampling techniques. > http://www.sitepoint.com/article/usability-test-participants > > > ***Logs, Browsers and Statistics: The Decline of Internet Explorer 5 > Individual site logs on browser usage lie, contends Alex Walker. He > says a larger sample size is necessary for data and decision making. > http://www.sitepoint.com/blog-post-view.php?id=226319 > > ================================================ > >From Your Peers > =============================================== > Don't forget to check out the O'Reilly UG wiki to see what user groups > across the globe are up to: > http://wiki.oreillynet.com/usergroups/index.cgi > > Until next time-- > > Marsee From sam at vilain.net Tue Mar 8 21:59:45 2005 From: sam at vilain.net (Sam Vilain) Date: Tue Mar 8 22:00:18 2005 Subject: [Wellington-pm] SQL solution! In-Reply-To: <4227C88F.5030309@vilain.net> References: <20050303060624.593383C4877C@basilica.la.naos.co.nz> <4227C88F.5030309@vilain.net> Message-ID: <422E90D1.8070005@vilain.net> Sam Vilain wrote: > This made me realise how similar the tasks of collapsing eigenstates into > results is to a set theory expression. > So, here's a solution. It seems this one takes the cake for execution > time and thoroughness :-) [snip] But this is a Perl list, so here it is with a Scriptalicious wrapper. You'll need the latest dev. Scriptalicious for this :-} Sam. -------------- next part -------------- A non-text attachment was scrubbed... Name: sendmoremoney.pl Type: text/x-perl Size: 10817 bytes Desc: not available Url : http://mail.pm.org/pipermail/wellington-pm/attachments/20050309/801b318a/sendmoremoney.bin From grant at mclean.net.nz Thu Mar 10 18:01:05 2005 From: grant at mclean.net.nz (Grant McLean) Date: Thu Mar 10 18:01:18 2005 Subject: [Wellington-pm] Lightning Talks Message-ID: <1110506465.28887.22.camel@localhost> Hi Mongers Just a quick reminder that the Lightning Talk meeting is on Monday evening. Speakers who are going to use slides should have them emailed to me by 3:00pm on Monday at the latest. Just to re-cap, formats that should work are: * HTML (will be displayed from Firefox on Linux) * OpenOffice.org Impress presentations * PDF (Acrobat reader is available) DO NOT ASSUME THAT THE PRESENTATION MACHINE WILL HAVE INTERNET ACCESS. Also, don't feel that you have to put slides together. If you feel comfortable talking for 5 minutes without slides then go right ahead. If anyone wants the Perl script I use for generating HTML slides then drop me a line. Cheers Grant From sam at vilain.net Thu Mar 10 23:49:12 2005 From: sam at vilain.net (Sam Vilain) Date: Thu Mar 10 23:49:29 2005 Subject: [Wellington-pm] Lightning Talks In-Reply-To: <1110506465.28887.22.camel@localhost> References: <1110506465.28887.22.camel@localhost> Message-ID: <42314D78.5000907@vilain.net> Grant, The Scriptalicious talk is basically a "take $script and convert it to have a help page, verbose mode, getopt parser, POD etc in less than 5 minutes" demonstration. I can present this as slides if that really is the only option, say if your projector input is fussy. But I thought that was always part of the fun! Has anyone tracked down a gong yet? Grant McLean wrote: > Hi Mongers > > Just a quick reminder that the Lightning Talk meeting is on Monday > evening. Speakers who are going to use slides should have them emailed > to me by 3:00pm on Monday at the latest. > > Just to re-cap, formats that should work are: > > * HTML (will be displayed from Firefox on Linux) > * OpenOffice.org Impress presentations > * PDF (Acrobat reader is available) > > DO NOT ASSUME THAT THE PRESENTATION MACHINE WILL HAVE INTERNET ACCESS. > > Also, don't feel that you have to put slides together. If you feel > comfortable talking for 5 minutes without slides then go right ahead. > > If anyone wants the Perl script I use for generating HTML slides then > drop me a line. > > Cheers > Grant > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm@pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm From sam at vilain.net Thu Mar 10 23:49:12 2005 From: sam at vilain.net (Sam Vilain) Date: Thu Mar 10 23:49:31 2005 Subject: [Wellington-pm] Lightning Talks In-Reply-To: <1110506465.28887.22.camel@localhost> References: <1110506465.28887.22.camel@localhost> Message-ID: <42314D78.5000907@vilain.net> Grant, The Scriptalicious talk is basically a "take $script and convert it to have a help page, verbose mode, getopt parser, POD etc in less than 5 minutes" demonstration. I can present this as slides if that really is the only option, say if your projector input is fussy. But I thought that was always part of the fun! Has anyone tracked down a gong yet? Grant McLean wrote: > Hi Mongers > > Just a quick reminder that the Lightning Talk meeting is on Monday > evening. Speakers who are going to use slides should have them emailed > to me by 3:00pm on Monday at the latest. > > Just to re-cap, formats that should work are: > > * HTML (will be displayed from Firefox on Linux) > * OpenOffice.org Impress presentations > * PDF (Acrobat reader is available) > > DO NOT ASSUME THAT THE PRESENTATION MACHINE WILL HAVE INTERNET ACCESS. > > Also, don't feel that you have to put slides together. If you feel > comfortable talking for 5 minutes without slides then go right ahead. > > If anyone wants the Perl script I use for generating HTML slides then > drop me a line. > > Cheers > Grant > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm@pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm From grant at mclean.net.nz Fri Mar 11 03:48:35 2005 From: grant at mclean.net.nz (Grant McLean) Date: Fri Mar 11 03:48:47 2005 Subject: [Wellington-pm] Lightning Talks In-Reply-To: <42314D78.5000907@vilain.net> References: <1110506465.28887.22.camel@localhost> <42314D78.5000907@vilain.net> Message-ID: <1110541715.6343.7.camel@localhost> On Fri, 2005-03-11 at 20:49 +1300, Sam Vilain wrote: > Grant, > > The Scriptalicious talk is basically a "take $script and convert it to > have a help page, verbose mode, getopt parser, POD etc in less than 5 > minutes" demonstration. > > I can present this as slides if that really is the only option, say if > your projector input is fussy. Trust me, the projector input is fussy. > But I thought that was always part of the fun! Watching people shag around with cables was never my idea of fun. With only 5 minutes, you probably don't want to spend much of it typing. So yes, with my fascist hat on, slides are the only option. > Has anyone tracked down a gong yet? I've tracked down GONG.WAV :-) Cheers Grant From grant at mclean.net.nz Sun Mar 13 15:38:20 2005 From: grant at mclean.net.nz (Grant McLean) Date: Sun Mar 13 15:38:35 2005 Subject: [Wellington-pm] Reminder: Meeting tonight Message-ID: <1110757100.16305.9.camel@localhost> Hi Mongers This is the monthly last minute reminder message - loathed by the organised few and apparently deeply appreciated by many :-) http://wellington.pm.org/ There has been a trickle of presentation files mailed to me. Remember, if you're doing a talk and want to use slides, please have them to me by 3:00pm. We don't have any speakers lined up yet for next month or beyond, so please think of subjects you could talk about. See you there. Grant From grant at mclean.net.nz Mon Mar 14 11:58:58 2005 From: grant at mclean.net.nz (Grant McLean) Date: Mon Mar 14 11:59:11 2005 Subject: [Wellington-pm] Last night's meeting Message-ID: <1110830338.26343.6.camel@localhost> A big thanks to all the speakers at last night's meeting. I think it went pretty well (although a few more talks would have been good). The slides are up on the web site now. http://wellington.pm.org/archive/index.html Next meeting will be on the 11th of April. Sam Vilain will be reporting back from his trip to YAPC::Taipei, and Geoff Cant will be comparing different languages' web development frameworks. Cheers Grant From liam.oboyle at elections.org.nz Mon Mar 14 12:04:11 2005 From: liam.oboyle at elections.org.nz (Liam O'Boyle) Date: Mon Mar 14 12:02:21 2005 Subject: [Wellington-pm] Last night's meeting In-Reply-To: <1110830338.26343.6.camel@localhost> References: <1110830338.26343.6.camel@localhost> Message-ID: <1110830651.5417.133.camel@localhost> My apologies for my lack-of-talk yesterday. I'll post my presentation here when I bring it in from home... On Tue, 2005-03-15 at 08:58 +1300, Grant McLean wrote: > A big thanks to all the speakers at last night's meeting. I think > it went pretty well (although a few more talks would have been good). > The slides are up on the web site now. > > http://wellington.pm.org/archive/index.html > > Next meeting will be on the 11th of April. Sam Vilain will be > reporting back from his trip to YAPC::Taipei, and Geoff Cant will be > comparing different languages' web development frameworks. > > Cheers > Grant > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm@pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm -- Cheers, Liam O'Boyle Electoral Enrolment Centre Telephone: (04) 801 0705 Fax: (04) 801 0709 This communication is confidential and may be legally privileged. If you have received it by mistake you must not use, disclose, copy or retain it. Please immediately notify us by return e-mail and then delete the e-mail you received in error. Views expressed in this communication may not be those of the organisation. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/wellington-pm/attachments/20050315/62023503/attachment.bin From grant at mclean.net.nz Mon Mar 14 12:41:21 2005 From: grant at mclean.net.nz (Grant McLean) Date: Mon Mar 14 12:41:33 2005 Subject: [Wellington-pm] Last night's meeting In-Reply-To: <1110830651.5417.133.camel@localhost> References: <1110830338.26343.6.camel@localhost> <1110830651.5417.133.camel@localhost> Message-ID: <1110832881.26343.8.camel@localhost> On Tue, 2005-03-15 at 09:04 +1300, Liam O'Boyle wrote: > My apologies for my lack-of-talk yesterday. I'll post my presentation > here when I bring it in from home... No worries, when I heard you'd gone home sick from work I didn't expect you to turn up at Perl mongers :-) Save the talk & slides for a future meeting. Grant From grant at mclean.net.nz Mon Mar 14 15:27:38 2005 From: grant at mclean.net.nz (Grant McLean) Date: Mon Mar 14 15:27:49 2005 Subject: [Wellington-pm] More on XPath Message-ID: <1110842858.26343.16.camel@localhost> In my talk last night on parsing HTML using XML::LibXML, I did a brief 60 second introduction to XPath. If anyone wants to learn more, there's a great set of examples here: http://www.zvon.org/xxl/XPathTutorial/General/examples.html and an interactive XPath lab here: http://www.zvon.org:9001/saxon/cgi-bin/XLab/XML/extras.html?stylesheetFile=XSLT/xpath.xslt&lang=eng I've added both links into the final slide. Cheers Grant From grant at mclean.net.nz Sun Mar 20 13:42:44 2005 From: grant at mclean.net.nz (Grant McLean) Date: Sun Mar 20 13:43:04 2005 Subject: [Wellington-pm] [Fwd: Newsletter from O'Reilly UG Program, March 17] Message-ID: <1111354964.17005.8.camel@localhost> -------- Forwarded Message -------- > From: Marsee Henon > To: perlmongers@catalyst.net.nz > Subject: Newsletter from O'Reilly UG Program, March 17 > Date: Thu, 17 Mar 2005 15:43:37 -0800 > ================================================================ > O'Reilly News for User Group Members > March 17, 2005 > ================================================================ > ---------------------------------------------------------------- > Book News > ---------------------------------------------------------------- > -Aggressive Network Self-Defense > -IPv6 Network Administration > -Windows XP Hacks, 2nd Edition > -QuickBooks 2005: The Missing Manual > -Outlook 2003 Personal Trainer > -Intrusion Prevention and Active Response > -Python Pocket Reference, 3rd Edition > -Word 2003 Personal Trainer > -Learning Windows Server 2003 > -Cyber Spying > -MAKE Magazine > ---------------------------------------------------------------- > Upcoming Events > ---------------------------------------------------------------- > -Tom Stafford and Matt Webb ("Mind Hacks"), Foyles Bookshop, > London, UK--March 23 > -Bonnie Biafore ("QuickBooks: The Missing Manual" & > "Online Investing Hacks"), EduFest, Denver, CO--March 26 > -Bonnie Biafore, the AAII Denver Chapter Meeting, > Denver, CO--April 4 > ---------------------------------------------------------------- > Conference News > ---------------------------------------------------------------- > -Register for the 2005 MySQL Users Conference, > Santa Clara, CA--April 18-21 > -Where 2.0 Conference Debut > ---------------------------------------------------------------- > News > ---------------------------------------------------------------- > -From the Labs: ETech 2005 > -The SafariU Revolution: An Interview with Professor Kent Sandoe > -No Starch Titles Included in MIT Review Article > -O'Reilly Learning Lab: $200 Instant Rebate > -MAKE Subscriptions Available > -Secure Batch Email with UUCP and SSH > -Subversion UI Shootout > -Building Connected Embedded Systems > -Closed Source PHP > -Getting Things Done with Your Mac > -Exploring the Mac OS X Firewall > -Inside StYNCies > -Receive Podcasts Using Your PC > -Enhanced Text Input in Windows Forms 2.0 > -Go Wireless > -Building Modular Applications with Seppia > -Reducing Upgrade Risk with Aspect Oriented Programming > -High Tech Hybrid: The Casio EX-P505 Digital Camera > -Doc Wiley: Master of the 30-Hour Album > -Customizing GMail with Grease Monkey > -Why Consistency is Critical > ---------------------------------------------------------------- > >From Your Peers > ---------------------------------------------------------------- > -Powered by Detroit Flash/ColdFusion Conference, Detroit, MI--April 9-10 > > ================================================ > Book News > ================================================ > Did you know you can request a free book to review for your > group? Ask your group leader for more information. > > For book review writing tips and suggestions, go to: > http://ug.oreilly.com/bookreviews.html > > Don't forget, you can receive 20% off any O'Reilly, No Starch, > Paraglyph, Pragmatic Bookshelf, SitePoint, or Syngress book you > purchase directly from O'Reilly. > Just use code DSUG when ordering online or by phone 800-998-9938. > http://www.oreilly.com/ > > ***Free ground shipping is available for online orders of at > least $29.95 that go to a single U.S. address. This offer > applies to U.S. delivery addresses in the 50 states and Puerto Rico. > For more details, go to: > http://www.oreilly.com/news/freeshipping_0703.html > > ---------------------------------------------------------------- > New Releases > ---------------------------------------------------------------- > ***Aggressive Network Self-Defense > ISBN: 1931836205 > Publisher: Syngress > The name says it all. This is the first book to analyze the technical, > legal, and financial ramifications of revolutionary and controversial > network strike-back and active defense techniques. The authors reveal > tightly guarded secrets to expose your online attackers and provide > valuable information for finding and prosecuting criminal hackers. Learn > how to identify, target, and nullify your adversaries through expert > techniques and real-life examples. > http://www.oreilly.com/catalog/1931836205/ > > > ***IPv6 Network Administration > Publisher: O'Reilly > ISBN: 0596009348 > This essential guide explains what works, what doesn't, and most of all, > what's practical about IPv6. A must-have for network administrators > looking to fix their network's scalability and management problems, this > book also covers other IPv6 benefits, such as routing, integrated > auto-configuration, quality-of-services, enhanced mobility, and end-to-end > security. > http://www.oreilly.com/catalog/ipv6na/ > > Chapter 5, "Installation and Configuration," is available online: > http://www.oreilly.com/catalog/ipv6na/chapter/index.html > > > ***Windows XP Hacks, 2nd Edition > Publisher: O'Reilly > ISBN: 0596009186 > "Windows XP Hacks, 2nd Edition" is an ideal all-in-one resource for XP > beginners as well as experienced power users. Now completely revised and > updated to cover Service Pack 2 (SP2), the second edition of this > bestseller breaks down the new SP2 features, including IE pop-up blocker, > Windows Firewall, and the new wireless client. You'll also find timesaving > hacks for security, file distribution, digital media, web browsing, and > more. > http://www.oreilly.com/catalog/winxphks2/ > > Hack 36, "Surf Anonymously Without a Trace," is available online along > with 9 others hacks: > http://www.oreilly.com/catalog/winxphks2/chapter/index.html > > > ***QuickBooks 2005: The Missing Manual > Publisher: O'Reilly > ISBN: 0596009011 > "QuickBooks 2005: The Missing Manual" is a comprehensive guide that > examines everything the QuickBooks Pro Windows edition has to offer, from > invoices and inventory to assets and accounts payable. By covering details > in a friendly and lighthearted way, the book explains when and why a > feature is useful and then offers indispensable, relevant advice. Each > page provides insightful tips and tricks to help readers become more > efficient, sophisticated users no matter what the extent of their existing > knowledge. > http://www.oreilly.com/catalog/quickbookstmm/ > > > ***Outlook 2003 Personal Trainer > Publisher: O'Reilly > ISBN: 0596009356 > This fully illustrated book takes a modular approach to learning, allowing > you to start with the fundamentals and then work your way up to advanced > topics--at your own pace. Designed to address both beginners and experts, > this handy reference is written in a non-technical style that you're bound > to find engaging and informative. The companion CD tutorial guides you > through each lesson interactively. > http://www.oreilly.com/catalog/outlookpt/ > > Chapter 8, "Advanced E-Mail Features," is available online: > http://www.oreilly.com/catalog/outlookpt/chapter/index.html > > > ***Intrusion Prevention and Active Response > Publisher: Syngress > ISBN: 193226647X > This is the first book-length work that specifically concentrates on the > concept, implementation, and implications of intrusion prevention and > active response. The authors establish a common understanding of the > terminology and then compare the many approaches to intrusion prevention. > In short, this book serves as a reference for next-generation IDS > technology that provides active response and intrusion prevention > functions both at the network and host levels. > http://www.oreilly.com/catalog/193226647X/ > > > ***Python Pocket Reference, 3rd Edition > Publisher: O'Reilly > ISBN: 0596009402 > With its convenient, quick-reference format, this book is the perfect > on-the-job reference that delivers need-to-know information at the flip of > a page. This third edition has been refreshed to cover Python 2.4 and also > includes an easy-lookup index to help developers find answers fast. The > "Python Pocket Reference, 3rd Edition" serves as the perfect companion to > "Learning Python" and "Programming Python." > http://www.oreilly.com/catalog/pythonpr3/index.html > > > ***Word 2003 Personal Trainer > Publisher: O'Reilly > ISBN: 0596009364 > As the most complete and engaging tutorial available for Word, this > invaluable guide details all of the latest advancements to Word 2003, > featuring sections on templates, WordArt, charts, and drawings, plus > advanced topics like how to perform mail merges and create web pages. To > best guide learning, this Personal Trainer includes detailed diagrams, > dozens of task-oriented lessons, and a fully interactive training > simulation CD--everything you need to become a Word pro. > http://www.oreilly.com/catalog/wordpt/index.html > > Chapter 8, "Performing a Mail Merge," is available online: > http://www.oreilly.com/catalog/wordpt/chapter/index.html > > > ***Learning Windows Server 2003 > Publisher: O'Reilly > ISBN: 0596006241 > "Windows Server 2003" is the right server for a world dominated by > enterprise networks and web-based server applications, but getting this > server up and running is a formidable task. Our no-fluff guide gives you > exactly what you need for installing, configuring, securing, and managing > Server 2003, and offers hands-on advice for planning, implementing, and > growing Windows networks without trying to teach you how to be a system > administrator. > http://www.oreilly.com/catalog/lwinsvr2003/index.html > > Chapter 10, "Windows Terminal Services," is available online: > http://www.oreilly.com/catalog/lwinsvr2003/chapter/index.html > > > ***Cyber Spying > Publisher: Syngress > ISBN: 1931836418 > Have you ever wondered about that friend your spouse emails, or who they > spend hours chatting online with? Are you curious about what your children > are doing online, who they meet, and what they talk about? Do you worry > about them finding drugs and other illegal items online, and wonder what > they look at? This book shows you how to monitor and analyze your family's > online behavior. > http://www.oreilly.com/catalog/1931836418/index.html > > > ***MAKE Subscriptions Available > The annual subscription price for four issues is $34.95. When you > subscribe with this link, you'll get a free issue--the first one plus four > more for $34.95. So subscribe for yourself or friends with this great > offer for charter subscribers: five volumes for the cost of four. > Subscribe at: > https://www.pubservice.com/MK/Subnew.aspx?PC=MK&PK=M5ZUGLA > > The MAKE blog is available at: > http://www.makezine.com/blog/ > > ================================================ > Upcoming Events > ================================================ > ***For more events, please see: > http://events.oreilly.com/ > > ***Tom Stafford and Matt Webb ("Mind Hacks"), Foyles Bookshop, > London, UK--March 23 > Spend a mind boggling evening with "Mind Hacks" authors Tom Stafford and > Matt Webb, who will demonstrate happiness, and optical tricks to see how > the brain responds. In the process, you'll learn a little bit more about > how this fearsomely complex organ works. No previous neuroscience > experience necessary! Please bring a pen--and your brain--if you'd like to > play along. The fun begins at 6:30 p.m. Tickets are 4 pounds (redeemable > on the purchase of any O'Reilly title that evening), and can be booked by > calling 0870 4202777, visiting Foyle's site, or dropping by the shop. > 113-119 Charing Cross Road, London, UK > http://www.foyles.co.uk/foyles/events.asp > > > ***Bonnie Biafore ("QuickBooks: The Missing Manual" & > "Online Investing Hacks"), EduFest, Denver, CO--March 26 > Bonnie is a featured speaker at the NAIC Rocky Mountain Chapter EduFest. > http://www.better-investing.org/chapter/denver/events/7571 > > > ***Bonnie Biafore, AAII Denver Chapter Meeting, Denver, CO--April 4 > Bonnie discusses online investing with members of the Denver Chapter of > the American Association of Individual Investors. > http://www.aaii.com/loclchap/aaiichap/denver/ > > ================================================ > Conference News > ================================================ > ***Register for the 2005 MySQL Users Conference, Santa Clara, CA-- > April 18-21 > The MySQL Users Conference, co-presented by O'Reilly Media and MySQL AB, > brings together experts, users, and industry leaders with unique MySQL > insights, offering attendees a detailed look into new features in MySQL > 5.0, sessions and workshops designed to teach best practices, and exposure > to new open source technologies. > For more information, go to: > http://www.mysqluc.com/ > > Use code DSUG when you register, and receive 20% off the registration > price. > > To register for the conference, go to: > http://conferences.oreillynet.com/cs/mysqluc2005/create/ord_mysql05 > > > ***Where 2.0 Conference Debut > Join us at the first O'Reilly Where 2.0 Conference June 29-30 in San > Francisco. Explore the emerging consumer and enterprise ecosystems around > location-aware technologies--like GPS, RFID, WLAN, cellular networks, and > networked sensors--that enable an ever-growing array of capabilities from > local search and mapping to enterprise integration and commercial > applications. Registration opens in April. > http://conferences.oreillynet.com/where/ > > To receive up-to-date conference news and information, sign up for the > conference newsletter on oreilly.com. > > ================================================ > News From O'Reilly & Beyond > ================================================ > --------------------- > General News > --------------------- > ***From the Labs: ETech 2005 > On the opening day of O'Reilly's Emerging Technology Conference, attendees > got a preview of projects that may or may not ever be released as full > scale products from Microsoft, Yahoo!, and Google. > http://www.oreillynet.com/pub/a/network/2005/03/16/etech_2.html > > For more ETech coverage: > http://www.oreillynet.com/et2005/ > > > ***The SafariU Revolution: An Interview with Professor Kent Sandoe > Professor Kent Sandoe of the Information Systems Department of Chico State > University wanted to produce a textbook on information security for his > Systems Management course this semester, but at the last minute, those > plans fell through. He turned to SafariU, O???Reilly???s new web-based > platform for creating, publishing, and sharing textbooks. Read about his > experience in this interview. > http://www.oreilly.com/news/safariusandoe.html > > Visit SafariU for a video demo > http://academic.oreilly.com/safariu-more.csp > > > ***No Starch Titles Included in MIT Review Article > "Hack License," by Simson Garfinkel ("Database Nation"), includes No > Starch's "Hacking: The Art of Exploitation" and "Hacking the XBox." > http://www.technologyreview.com/articles/05/03/issue/review_hack.asp > > > ***O'Reilly Learning Lab: $200 Instant Rebate > Learning programming languages and development techniques has never been > easier. Using your web browser and Useractive's Learning Sandbox technology, > the Learning Lab gives you hands-on, online training in a creative > environment. This month, receive a $200 instant rebate (and a Certificate > from the University of Illinois Office of Continuing Education upon course > completion) when you enroll in any Certificate Series. > http://www.oreilly.com/redirector.csp?link=UACert&type=news > > --------------------- > Open Source > --------------------- > ***Secure Batch Email with UUCP and SSH > Not everyone has reliable, always-on Internet access. For some, > reliability has to come through software, not hardware. Fortunately, > protocols designed to work around slow and unreliable networks still work. > Christophe Prevotaux demonstrates how to set up FreeBSD, Postfix, and SSH > to send and receive email via UUCP. > http://www.onlamp.com/pub/a/bsd/2005/03/10/uucpmail.html > > > ***Subversion UI Shootout > As Subversion continues to take over from CVS, more advanced interfaces > have started to appear. How do they compare to each other? How do they > compare to the svn CLI tool? Jeremy Jones puts svn, RapidSVN, and > TortoiseSVN though their paces and draws out UI principles along the way. > http://www.onlamp.com/pub/a/onlamp/2005/03/10/svn_uis.html > > > ***Building Connected Embedded Systems > Embedded systems aren't all Linux; microcontrollers still dominate the > scene. Erstwhile hardware hackers, rejoice! The tools for programming > microcontrollers work just fine under Linux. George Belotsky starts a > series on embedded development by demonstrating what you have to do to > make Hello World run. > http://www.onlamp.com/pub/a/onlamp/2005/03/10/microcontrollers.html > > > ***Closed Source PHP > A look at the many different options PHP Developers have for protecting > their source code from prying eyes when creating commercial PHP > Applications. > http://www.sitepoint.com/blog-post-view.php?id=238739 > > --------------------- > Mac > --------------------- > ***Getting Things Done with Your Mac > Even the most savvy Mac user can have problems staying organized. A number > of tips for using a Mac to help organize your life are available from 43 > Folders and other sources. This article takes a look at them with the help > of Merlin Mann himself. > http://www.macdevcenter.com/pub/a/mac/2005/03/08/productivity.html > > > ***Exploring the Mac OS X Firewall > Like so many tools built in to Mac OS X, the firewall just works. But > what's really going on inside it? Peter Hickman explains why the firewall > works so well, and then takes you inside and shows you how to fiddle with > things. In the end, he returns you safely to the default settings. > http://www.macdevcenter.com/pub/a/mac/2005/03/15/firewall.html > > > ***Inside StYNCies > Stickies is one of the handiest little apps out there. It's been bundled > with Apple's operating systems for ages, but Apple hasn't yet taken > advantage of the new possibilities for it. This first installment of a > two-part series works through building a partial implementation of > StYNCies, a neat little utility that synchronizes your Stickies to your > iPod and/or iDisk. > http://www.macdevcenter.com/pub/a/mac/2005/03/11/cocoa.html > > --------------------- > Windows/.NET > --------------------- > ***Receive Podcasts Using Your PC > Receiving podcasts using free software, your PC, and a portable music > player is a snap. Jake Ludington shows you how to do it in a few easy > steps. > http://www.windowsdevcenter.com/pub/a/windows/2005/03/15/podcasting_pc.html > > > ***Enhanced Text Input in Windows Forms 2.0 > Visual Studio 2005 provides enhanced controls for managing data input in > Whidbey. In this new column by Jesse Liberty, he discusses the advanced > WinForms Text Input control. > http://www.ondotnet.com/pub/a/dotnet/2005/03/14/liberty.html > > > ***Go Wireless > Here's an excerpt from "Windows XP Annoyances for Geeks, 2nd Edition," > that shows you how to set up a simple wireless network, connect that > network to the Internet, connect your wireless devices to other people's > wireless networks, and prevent others from sneaking onto your network. All > without wires, and the most amazing thing is that it actually works. > http://www.windowsdevcenter.com/pub/a/windows/excerpt/winxpannoy2_ch07_05/index.html > > --------------------- > Java > --------------------- > ***Building Modular Applications with Seppia > Isn't object-oriented programming supposed to be about code reuse? The > Seppia framework encourages reuse by allowing you to combine functionality > collected in multiple .jar files, stitching the behavior together with > JavaScript. Lorenzo Puccetti has an introduction to this interesting > framework. > http://www.onjava.com/pub/a/onjava/2005/03/16/seppia.html > > > ***Reducing Upgrade Risk with Aspect Oriented Programming > Upgrading code in the field is usually frowned upon, if not prohibited > outright, because of the risk and expense of pushing code changes through > a release cycle. But could you just insert the tiny bit of code you need > with AOP? Stephen B. Morris looks at how careful design and separation of > responsibilities can make this less risky. > http://www.onjava.com/pub/a/onjava/2005/03/16/aop-mgmt.html > > --------------------- > Digital Media > --------------------- > ***High Tech Hybrid: the Casio EX-P505 Digital Camera > The Casio EX-P505 is a smart-looking, 5-megapixel camera that fits in the > palm of your hand. It captures full-frame, full-motion digital movies with > ease, and it's packed with creative features sure to stir the imagination > of fun-loving photographers. Derrick Story helps you decide if this is a > high-tech toy or a real photographic tool. > http://digitalmedia.oreilly.com/2005/03/09/casio_p505.html > > > ***Doc Wiley: Master of the 30-Hour Album > Pro Tools wiz Doc Wiley combines studio psychology and cutting-edge > technology to coax the best performances out of artists ranging from U2 to > Whitney Houston. Here are some of his favorite approaches. > http://digitalmedia.oreilly.com/2005/03/16/doc.html > > --------------------- > Web > --------------------- > ***Customizing Gmail with Grease Monkey > Learn about using Firefox Extensions to customize Gmail, or any other web > site you visit, thanks to the power of the Document Object Model and > JavaScript. > http://www.sitepoint.com/blog-post-view.php?id=239170 > > > ***Why Consistency is Critical > Consistency is the cornerstone of a positive user experience. But > consistency means more than simply putting your nav at the top left, your > search on the right. Gerry explores consistency, explaining what it is, > why it's important, and the areas where consistency counts. > http://www.sitepoint.com/article/why-consistency-is-critical > > ================================================ > >From Your Peers > =============================================== > ***Powered by Detroit Flash/ColdFusion Conference, Detroit, MI-- > April 9-10 > The conference will feature expert speakers on Flash, ColdFusion, Flex, > Dreamweaver, and more, with emphasis on development of Rich Internet > Applications. Participants will engage in two days of cutting-edge > seminars, talks, and discussions on the latest web development tools and > techniques, while also enjoying the company of like-minded professionals. > The event features Macromedia's Greg Rewis and Ben Forta as keynote > speakers, and other top experts, including Kevin Hoyt, Michael Dinowitz, > Hal Helms, Simon Horwith, Jeffry Houser, Charlie Arthart, Shlomy Gantz and > Alexandru Costin. > http://poweredbydetroit.org/ > > Don't forget to check out the O'Reilly UG wiki to see what user groups > across the globe are up to: > http://wiki.oreillynet.com/usergroups/index.cgi > > Until next time-- > > Marsee From philip at xinqu.net Mon Mar 28 02:49:20 2005 From: philip at xinqu.net (Philip Plane) Date: Mon Mar 28 02:49:39 2005 Subject: [Wellington-pm] Perl/Tk Message-ID: Hi all, I have written a simple Perl/Tk program that provides a front end to a database. This is really just a template for me to learn how to use Tk. I'd be happy for others to use it as they feel fit. I'd be especially happy if people want to fiddle with it and suggest better ways of doing things. It's available at http://philip.xinqu.net/logbook/logbook.html Feedback welcome. -- Philip Plane _____ philip@xinqu.net | ---------------( )--------------- Glider pilots have no visible means of support From grant at mclean.net.nz Thu Mar 31 17:00:38 2005 From: grant at mclean.net.nz (Grant McLean) Date: Thu Mar 31 17:00:57 2005 Subject: [Wellington-pm] [Fwd: Newsletter from O'Reilly UG Program, March 31] Message-ID: <1112317238.4299.11.camel@localhost> Did anyone who picked up a copy of Make magazine at last month's meeting want to send me a brief review? Please. Also is there anyone who didn't pick up a copy that wants one? I don't have any spares but perhaps people could pass them around if they're finished with them. Cheers Grant -------- Forwarded Message -------- > From: Marsee Henon > To: perlmongers@catalyst.net.nz > Subject: Newsletter from O'Reilly UG Program, March 31 > Date: Thu, 31 Mar 2005 16:45:25 -0800 > ================================================================ > O'Reilly News for User Group Members > March 31, 2005 > ================================================================ > ---------------------------------------------------------------- > Book News > ---------------------------------------------------------------- > -Firefox Hacks > -iPhoto 5: The Missing Manual > -Python Cookbook, 2E > -Silence on the Wire > -Windows Server Cookbook > -Degunking Your PC > -Java in a Nutshell, 5th Edition > -Access 2003 Personal Trainer > -SharePoint User's Guide > -Apache Security > -MAKE Subscriptions Available > ---------------------------------------------------------------- > Upcoming Events > ---------------------------------------------------------------- > -MAKE Editor Phillip Torrone on Science Friday--April 1 > -Greg Kroah-Hartman, ("Linux Device Drivers, 3rd Ed"), > PDXLUG, Portland, OR--April 14 > -Greg Kroah-Hartman at Powell's Tech Books--April 16 > -Bonnie Biafore ("QuickBooks: The Missing Manual" & "Online Investing > Hacks"), Kansas City Investor Fair--April 29-30 > ---------------------------------------------------------------- > Conference News > ---------------------------------------------------------------- > -Register for the 2005 MySQL Users Conference, > Santa Clara, CA--April 18-21 > -Where 2.0 Conference > -OSCON Is Coming > ---------------------------------------------------------------- > News > ---------------------------------------------------------------- > -Tax Time: A Year-End Checklist of Accounting Tasks > -Opting in to Privacy Problems > -SafariU Revolutionizes the Textbook > -Automating Windows (DNS) with Perl > -make for Nonprogrammers > -Closed Source PHP > -Movies Made Easy in iPhoto 5 > -Exploring the Mac OS X Firewall > -Owen Linzmeyer ("Apple Confidential 2.0") on MacRadio > -Five More Annoying PC Annoyances > -Microsoft, Blogging, and Transparency > -Miguel de Icaza Explains How to "Get" Mono > -Flexible Event Delivery with Executors > -Java Component Development: A Conceptual Framework > -HDTV on Your Mac > -Resurrect Your Old PC for Music--with Linux > -Ajax: New for 2005 > ================================================ > Book News > ================================================ > Did you know you can request a free book to review for your > group? Ask your group leader for more information. > > For book review writing tips and suggestions, go to: > http://ug.oreilly.com/bookreviews.html > > Don't forget, you can receive 20% off any O'Reilly, No Starch, > Paraglyph, Pragmatic Bookshelf, SitePoint, or Syngress book you > purchase directly from O'Reilly. > > Just use code DSUG when ordering online or by phone 800-998-9938. > http://www.oreilly.com/ > > ***Free ground shipping is available for online orders of at > least $29.95 that go to a single U.S. address. This offer > applies to U.S. delivery addresses in the 50 states and Puerto Rico. > For more details, go to: > http://www.oreilly.com/news/freeshipping_0703.html > > ---------------------------------------------------------------- > New Releases > ---------------------------------------------------------------- > ***Firefox Hacks > Publisher: O'Reilly > ISBN: 0596009283 > This highly focused book offers all the valuable tips and tools you need > to maximize the effectiveness of this hot web browser. It's all covered, > including how to customize its deployment, appearance, features, and > functionality. You'll even learn how to install, use, and alter extensions > and plug-ins. Aimed at clever people who may or may not be savvy with > basic programming tasks, this convenient resource describes 100 techniques > for 100 strategies that effectively exploit Firefox. > http://www.oreilly.com/catalog/firefoxhks/ > > Sample Hack 69, "Make New Tags and Widgets with XBL," is available online > (along with five others): > http://www.oreilly.com/catalog/firefoxhks/chapter/index.html > > > ***iPhoto 5: The Missing Manual > Publisher: O'Reilly > ISBN: 0596100345 > Updated to cover Apple's newest release, "iPhoto 5: The Missing Manual" > comes fully loaded--and in full color--so you can exercise all the power, > flexibility, and creativity of the stunning new iPhoto 5. This witty and > authoritative guide starts out with a crash course on digital photography > and then explores every aspect of iPhoto 5, from camera-meets-Mac basics > to sharing your digital photography with the world. > http://www.oreilly.com/catalog/iphoto5tmm/ > > > ***Python Cookbook, 2E > Publisher: O'Reilly > ISBN: 0596007973 > Like its predecessor, the new edition offers a collection of solutions to > problems that Python programmers face every day. Updated for Python 2.4, > it now includes over 200 recipes that range from simple tasks, such as > working with dictionaries and list comprehensions, to complex tasks, such > as monitoring a network and building a templating system. > http://www.oreilly.com/catalog/pythoncook2/ > > > ***Silence on the Wire > Publisher: No Starch Press > ISBN: 1593270461 > Author Michal Zalewski is respected in the hacking and security > communities for his intelligence, curiosity and creativity, and this book > is truly unlike anything else. "Silence on the Wire" is no humdrum white > paper or how-to manual for protecting one's network. Rather, this > narrative explores a variety of unique, uncommon and often elegant > security challenges that defy classification and eschew the traditional > attacker-victim model. > http://www.oreilly.com/catalog/1593270461/index.html > > > ***Windows Server Cookbook > Publisher: O'Reilly > ISBN: 0596006330 > Written for all levels of users, this practical reference guide offers > hundreds of useful tasks for managing Windows 2000 and Windows Server > 2003. The concise, on-the-job solutions to common problems are certain to > save you many hours of time searching through Microsoft documentation. > Each recipe also includes a detailed discussion that explains how and why > it works. Topics discussed include files, event logs, security, DHCP, DNS, > backup/restore, and more. > http://www.oreilly.com/catalog/windowsvrckbk/ > > Chapter 6, "Processes," is available online: > http://www.oreilly.com/catalog/windowsvrckbk/chapter/index.html > > > ***Degunking Your PC > Publisher: Paraglyph Press > ISBN: 1933097035 > Do your programs seem sluggish or refuse to run properly? Are you tripping > over a viper's nest of cords and cables at every turn? Do you have printer > drivers installed that date back to the Eisenhower administration? Is it > impossible to vacuum under your desk? Still using dial up? If so you have > PC gunk! "Degunking Your PC" will show you the way to get out of the rat's > maze of cables and old plug-and-play devices and onto the road of perfect > PC organization. Joli Ballew, the author of the bestselling "Degunking > Windows" will show you simple, fast and effective ways to manage your PC > hardware. > http://www.oreilly.com/catalog/1933097035/index.html > > > ***Java in a Nutshell, 5th Edition > Publisher: O'Reilly > ISBN: 0596007736 > "Java in a Nutshell, 5th Edition" covers all the extensive changes in Java > 5.0. This classic remake has undergone a complete editorial makeover in > order to more closely meet the needs of the modern Java programmer. > Included among the improvements are more discussion on tools and > frameworks and new code examples to illustrate the working of APIs. And, > as in previous editions, the fifth edition is chock-full of poignant tips, > techniques, examples, and practical advice. > http://www.oreilly.com/catalog/javanut5/ > > > ***Access 2003 Personal Trainer > Publisher: O'Reilly > ISBN: 0596009372 > Written in a non-technical and engaging style, this book lets people of > any technical level learn exactly what they need to know at their own > pace. The book starts with Access fundamentals and then moves up to > tables, fields, queries, forms, reports, and advanced topics, like linking > information from an external source. Included are detailed diagrams, > dozens of task-oriented lessons, and a fully interactive training > simulation CD. > http://www.oreilly.com/catalog/accesspt/ > > > ***SharePoint User's Guide > Publisher: O'Reilly > ISBN: 0596009089 > This straightforward guide shows SharePoint users how to create and use > web sites for sharing and collaboration. Learn to use the document and > picture libraries for adding and editing content, add discussion boards > and surveys, receive alerts when documents and information have been added > or changed, and enhance security. Designed to help you find answers > quickly, the book shows how to make the most of SharePoint for > productivity and collaboration. > http://www.oreilly.com/catalog/sharepoint/ > > Chapter 1, "Working with Sites and Workspaces," is available online: > http://www.oreilly.com/catalog/sharepoint/chapter/index.html > > > ***Apache Security > Publisher: O'Reilly > ISBN: 0596007248 > This all-purpose guide for locking down Apache arms readers with all the > information they need to securely deploy applications. Administrators and > programmers alike will benefit from a concise introduction to the theory > of securing Apache, plus a wealth of practical advice and real-life > examples. Topics covered include installation, server sharing, logging and > monitoring, web applications, PHP and SSL/TLS, and more. > http://www.oreilly.com/catalog/apachesc/ > > Chapter 2, "Installation and Configuration," is available online: > http://www.oreilly.com/catalog/apachesc/chapter/index.html > > > ***MAKE Subscriptions Available > The annual subscription price for four issues is $34.95. When you > subscribe with this link, you'll get a free issue--the first one plus four > more for $34.95. So subscribe for yourself or friends with this great > offer for charter subscribers: five volumes for the cost of four. > Subscribe at: > https://www.pubservice.com/MK/Subnew.aspx?PC=MK&PK=M5ZUGLA > > The MAKE blog is available at: > http://www.makezine.com/blog/ > > ================================================ > Upcoming Events > ================================================ > ***For more events, please see: > http://events.oreilly.com/ > > ***MAKE Editor Phillip Torrone on Science Friday--April 1 > Philip will be talking about DIY technology on NPR's "Science Friday" with > Ira Flatow. Visit the Science Friday site and look for your local NPR > station and broadcast times. Feel free to call in and ask questions from 2 > to 4 p.m. Eastern at 1-800-989-8255. > http://www.sciencefriday.com/ > > > ***Greg Kroah-Hartman, ("Linux Device Drivers, 3rd Ed"), > PDXLUG, Portland, OR--April 14 > Join O'Reilly author Greg for a Linux chat at 7pm. > Fireside Coffee Lodge > 1223 SE Powell Blvd, > Portland, OR 97202 > http://www.pdxlug.org/ > > > ***Greg Kroah-Hartman at Powell's Tech Books--April 16 > Greg will also be at Powell's Technical Books beginning at 1:00pm > April 16. > Powell's Technical Books > 33 NW Park Avenue, > Portland, OR 97209 > http://www.powells.com/calendar.html#489 > > > ***Bonnie Biafore ("QuickBooks: The Missing Manual" & "Online Investing > Hacks"), Kansas City Investor Fair--April 29-30 > Bonnie is a featured speaker at the NAIC Kansas City Investor Fair. She'll > be signing books there on both days, so be sure to stop by and say hello. > Doubletree Hotel, Overland Park, KS > http://www.better-investing.org/chapter/kansas/events/4875 > > ================================================ > Conference News > ================================================ > ***Register for the 2005 MySQL Users Conference, > Santa Clara, CA--April 18-21 > The MySQL Users Conference, co-presented by O'Reilly Media and MySQL AB, > brings together experts, users, and industry leaders with unique MySQL > insights, offering attendees a detailed look into new features in MySQL > 5.0, sessions and workshops designed to teach best practices, and exposure > to new open source technologies. > For more information, go to: > http://www.mysqluc.com/ > > Use code DSUG when you register, and receive 20% off the registration > price. > > To register for the conference, go to: > http://conferences.oreillynet.com/cs/mysqluc2005/create/ord_mysql05 > > > ***Where 2.0 Conference > Join us at the first O'Reilly Where 2.0 Conference June 29-30 in San > Francisco. Explore the emerging consumer and enterprise ecosystems around > location-aware technologies--like GPS, RFID, WLAN, cellular networks, and > networked sensors--that enable an ever-growing array of capabilities from > local search and mapping to enterprise integration and commercial > applications. Registration opens in April. > http://conferences.oreillynet.com/where/ > > To receive up-to-date conference news and information, sign up for the > conference newsletter on oreilly.com. > > > ***OSCON Is Coming > Join us at the O'Reilly Open Source Convention in beautiful Portland from > August 1-5. OSCON 2005 will be at the Oregon Convention Center, where > we'll have tutorials, sessions, parties, BOFs, and a huge exhibit hall. > The Call for Proposals is closed, but registration and hotel information > will be available soon. > http://conferences.oreillynet.com/os2005/ > > To get the latest details as soon as we have them, sign up for the OSCON > newsletter on oreilly.com. > > ================================================ > News From O'Reilly & Beyond > ================================================ > --------------------- > General News > --------------------- > ***Tax Time: A Year-End Checklist of Accounting Tasks > Whether you handle your company's accounting yourself or hand off the > major accounting tasks to an accountant, Bonnie Biafore provides a > checklist of eight accounting tasks you'll want to complete shortly after > the end of your fiscal year. Bonnie is the author of "QuickBooks 2005: > The Missing Manual." > http://www.oreillynet.com/pub/a/network/2005/03/28/quickbooks.html > > > ***Opting in to Privacy Problems > Brian McWilliams looks at yet another way internet users may be putting > their privacy at risk. With list brokers now cutting deals with e-commerce > sites and internet marketing firms for data that includes home addresses, > phone numbers, and corresponding IP addresses, you may be opting in for > more than you bargained for when you shop online. Brian is the author of > "Spam Kings." > http://www.oreillynet.com/pub/a/network/2005/03/17/optin.html > > > ***SafariU Revolutionizes the Textbook > With SafariU, educators and trainers can create and publish their own > textbooks, selecting exactly the book chapters, sections, or articles they > want from a wealth of information resources. SafariU costs nothing to use > and offers students more focused course content at less cost. Visit > SafariU to view a video demo and sign up for access: > http://safariu.oreilly.com > > --------------------- > Open Source > --------------------- > ***Automating Windows (DNS) with Perl > Perl is a fantastic tool for system administrators--even on Windows. > Though the shiny GUI is astonishingly useless (or at least too > mouse-friendly) for all but the simplest changes, there's plenty to > automate under the shell. Thomas Herchenroeder explains how he > wrapped dnscmd with Perl to make changes easily. > http://www.perl.com/pub/a/2005/03/24/perl_dns.html > > > ***make for Nonprogrammers > If you're a typical FreeBSD user, you may never have compiled C source > code on your own. Yet if you've ever issued a make command, it's compiled > code for you. How does it do that? What does it do, anyway? And what else > can it do? Dru Lavigne answers all of these questions. > http://www.onlamp.com/pub/a/bsd/2005/03/24/FreeBSD_Basics.html > > > ***Closed Source PHP > A look at the many different options PHP Developers have for > protecting their source code from prying eyes when creating > commercial PHP Applications. > http://www.sitepoint.com/blog-post-view.php?id=238739 > > --------------------- > Mac > --------------------- > ***Movies Made Easy in iPhoto 5 > One of the best features in the current crop of consumer digital still > cameras is their ability to capture high-quality video. iPhoto 5 is in > step with this evolution and provides a great environment for taking those > snippets and creating real movies. Derrick Story shows you how. > http://www.macdevcenter.com/pub/a/mac/2005/03/22/iphoto_movies.html > > > ***Exploring the Mac OS X Firewall > Like so many tools built in to Mac OS X, the firewall just works. But > what's really going on inside it? Peter Hickman explains why the firewall > works so well, and then takes you inside and shows you how to fiddle with > things. In the end, he returns you safely to the default settings. > http://www.macdevcenter.com/pub/a/mac/2005/03/15/firewall.html > > > ***Owen Linzmeyer ("Apple Confidential 2.0") on MacRadio > Listen to No Starch's author Owen on the Mac Night Owl Radio on the March > 24 show. > http://www.macradio.com/thursday/nightowl/index.php > > --------------------- > Windows/.NET > --------------------- > ***Five More Annoying PC Annoyances > After his first "PC Annoyances" was released, Steve Bass was surprised by > the barrage of email he received with yet more annoyances to fix. That led > to the just-released second edition of "PC Annoyances," where he added 150 > more fixes to irritating PC quirks. And if that's not enough, he offers > five more here. > http://www.windowsdevcenter.com/pub/a/windows/2005/03/28/pcannoyances.html > > > ***Microsoft, Blogging, and Transparency > Author James Avery recently wrote about his experiences publishing his > latest book and how Microsoft bloggers helped him immensely. To James, the > benefits of increased transparency through the use of blogs cannot be > understated. James is the author of "Visual Studio Hacks." > http://dotavery.com/blog/archive/2005/03/28/2767.aspx > > > ***Miguel de Icaza Explains How to "Get" Mono > It's perhaps the most controversial project in the open source world, but > this mostly stems from misunderstanding: Mono, the open source development > platform based upon Microsoft's .NET framework. Immediate reactions from > many dubious Linux developers have ranged from confusion over its > connection with .NET to wondering what the benefits of developing under it > are. Throughout the course of its four years of intense development, > sponsored by Novell, Mono founder Miguel de Icaza has had to frequently > clarify the .NET issue and sell the community on it. In this new > interview, Howard Wen asks Miguel to explain himself one more time. > http://www.ondotnet.com/pub/a/dotnet/2005/03/21/interviewmiguel.html > > --------------------- > Java > --------------------- > ***Flexible Event Delivery with Executors > Event-handling is critical to any GUI application, and many developers > know the hazards of making a method call to unknown or poorly behaved code > from the event-dispatch thread. J2SE 5.0's concurrency utilities offer > more fine-grained control over how code executes. Andrew Thompson applies > that to offer better ways to handle events. > http://www.onjava.com/pub/a/onjava/2005/03/23/executors.html > > > ***Java Component Development: A Conceptual Framework > In general terms, a component is one or more classes with an external API > that satisfy some requirement. But how do you build components that are > really practical--that handle configuration changes or third-party > integration well? Palash Ghosh has some ideas about the concepts behind > components. > http://www.onjava.com/pub/a/onjava/2005/03/23/components.html > > --------------------- > Digital Media > --------------------- > ***HDTV on Your Mac > Even though the Mac is a little late to the HDTV party, you can roll your > own setup for not too much time or money. Erica Sadun shows you how. > http://www.macdevcenter.com/pub/a/mac/2005/03/29/hdtv.html > > > ***Resurrect Your Old PC for Music--with Linux > Dig that clunker out of the closet! This step-by-step guide explains how > to upgrade even a 486-based PC to an efficient, Linux-powered music > machine. Total cost? About ten cents for a blank CD. > http://digitalmedia.oreilly.com/2005/03/23/linuxmusic.html > > --------------------- > Web > --------------------- > ***Ajax: New for 2005 > Ajax is a term coined for an approach that utilizes the Document > Object Model, JavaScript, and XMLHTTPRequest to allow web > developers to create applications that don't require constant > page-refreshes to be used. > http://www.sitepoint.com/blog-post-view.php?id=238333 > > ================================================ > >From Your Peers > =============================================== > Don't forget to check out the O'Reilly UG wiki to see what user groups > across the globe are up to: > http://wiki.oreillynet.com/usergroups/index.cgi > > Until next time-- > > Marsee From greens at maf.govt.nz Thu Mar 31 19:03:40 2005 From: greens at maf.govt.nz (greens@maf.govt.nz) Date: Thu Mar 31 19:03:56 2005 Subject: [Wellington-pm] Batch processing Excel spreadsheets on Win32 Message-ID: <200504010303.j3133efe002341@majordomo.maf.govt.nz> Hi Mongers, At the end of the last meeting there was some discussion about working with M$ Excel spreadsheets with as little user interaction as possible. While some may consider not using Excel is the best way to achieve this, we don't all have that luxury. The issue when using Win32::OLE is the dialog boxes thrown up by Excel itself. Note: Win32::OLE requires the application to be installed so it won't work on a *nix box. I've not tried so feel free to prove me wrong. Lets start by getting an Excel object use Win32::OLE::Const 'Microsoft Excel'; use Win32::OLE qw(in with); my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); some dialogs can be killed like this $Excel->{DisplayAlerts} = 0; $Excel->{EnableEvents} = 0; my $Book = $Excel->Workbooks->Open("$some_dir/$some_file"); # do stuff... but if the file contains links to other spreadsheets you will still be asked if you want to update the links. I recently discovered how to stop that annoyance: (ref http://www.perlmonks.org/?node=185754) my $Book = $Excel->Workbooks->Open("$some_dir/$some_file",0,1); The key here is the second and third parameters passed to Open(). They are interpreted as boolean expressions for UpdateLinks and ReadOnly. Now it is possible batch process a bunch of files without having to watch and accept or reject updates. Another useful tidbit is how to iterate through all the used cells in a sheet: (ref http://www.perlmonks.org/?node=10799) foreach my $Sheet (in $Book->{Worksheets}) { print "<<$Sheet->{Name}>>\n"; my $everything = $Sheet->UsedRange()->{Value}; ## the Magic ## foreach my $row (@$everything) { my $tab = ''; foreach my $cell (@$row) { print $tab, defined($cell) ? $cell : ''; $tab = "\t" unless ($tab); } print "\n"; } print "\n\n"; } -- Simon Green [simon.green@maf.govt.nz] ##################################################################################### This e-mail message has been scanned for Viruses and Content and cleared by NetIQ MailMarshal ##################################################################################### ######################################################################## This email message and any attachment(s) is intended solely for the addressee(s) named above. The information it contains is confidential and may be legally privileged. Unauthorised use of the message, or the information it contains, may be unlawful. If you have received this message by mistake please call the sender immediately on 64 4 4744 100 or notify us by return email and erase the original message and attachments. Thank you. The Ministry of Agriculture and Forestry accepts no responsibility for changes made to this email or to any attachments after transmission from the office. ########################################################################