Re: [Boston.pm] UPDATE: Tech Meeting tomorrow, Tuesday, April 11, at MIT

2006-04-12 Thread Bill Ricker
> Will you guys be posting slides/notes somewhere soon?


As the warm-up while folks were filtering in, I  walked through a bruteforce
Obfu soduko that I found linked in the YAPC:Japan proceedings.
 http://www.ecclestoad.co.uk/blog/2005/05/

I had no slides. Just code and examples.  And the code ... it's so garbage,
I'm embarrassed I haven't finished refactoring, I was only showing the key
lines to answer the open GD quesitons.  You'd have recognized the code
layout, I used the same tidy/css combo as for the Advent.

Extra lines/text on GD:Chart - The key item from my presentation was on the
mailing list in February -- to draw lines and letters on top of a GD::Chart,
request an Image Map before plotting and dump it after, request the GD
object, and knock yourself out.
Example (different than shown) -
  http://ema.arrl.org/fd/ducting/Fc_e_etam2718.png

Data-on-map --  Prime example is
  http://ema.arrl.org/fd/ ,
see the About page for credit on maps. Browse around the History section for
lines on maps. Key is to encapsulate Lat-Lon <-> XY mapping for your
base-map.
Numeric data on map -
  http://ema.arrl.org/fd/ducting/prog28_00.png
Lines on Map -
  http://ema.arrl.org/fd/history/tour2005.html
and alternate maps.

I also did a quick review of using XML::Twig
  http://search.cpan.org/~mirod/XML-Twig-3.23/Twig.pm
to extract the flagged items from my feed-reader's cache to generate a
cheesy, private RSS file for a couple friends to see my latest science news
-- different but not so very different from what we did for Advent. Code
attached.


--
Bill
[EMAIL PROTECTED] [EMAIL PROTECTED]

=
Sorry, no comments ... it's just a hack ...

#! /bin/perl

use POSIX qw(strftime);
use XML::Twig;

my $time  = POSIX::strftime( "%a, %d %b %Y %X %Z GMT", gmtime());
my $copyyy= POSIX::strftime("%Y",gmtime());
my $home_url="http://tropo.harvee.org/~wdr/news.html;;

my $header = <




Bill's Interesting News Items
$home_url
Personal digest of science and technology RSS feeds that
were interesting today.
en-us
news
Compilation Copyright $copyy only -- fair use compilation
of copyright items. 
720 

EOF

my $image=<
Bill's Science News
150
60
http://$home_url
http://$home_root/images/logo.gif

EOF

my $footer=<

EOF

print "$header \n";
# print $image,"\n";

while (@ARGV) {
   #  my $LIFEREA; ## File Handle
my $fn = shift @ARGV;
# open $LIFEREA, $fn or die "Can't open input file $fn: $!";

my $t= XML::Twig->new(
   # the twig will include just the root and selected 
titles
   twig_roots   => {
'item' => \_n_purge,
 'feedTitle' => \_title,
 'feedSource' =>  \_link,

 # 'annex/title'   => 
\_n_purge
 },
   pretty_print => 'indented',
  );

  $t->parsefile( $fn);



}
print $footer,"\n";

{
my ($channel_title, $channel_link);

sub channel_title
{
my( $t, $elt)= @_;
$channel_title=$elt->text;
};

sub channel_link
{
my( $t, $elt)= @_;
$channel_link=$elt->text;
}

 sub print_n_purge
{
my( $t, $elt)= @_;
# $elt->print;
my $mark=$elt->first_child('mark');
unless ($mark && $mark->text eq '1') { $t->purge; return};

my $src =$elt->first_child('source');

if ($src) {
$elt->insert_new_elt (link=>{},$src->text);

}
else {warn "source missing for item...";
  }
my $desc=$elt->first_child('description');
if ($desc) {
my $text=$desc->text;
if ($text && $text =~ /[<>]|/){
# warn "DESC with <>";
my $tt=XML::Twig->new() or die "Can't make second Twig?";
$tt->parse_html($text);
my $text2=$tt->root->text;
if (length $text2 > 1024) { substr($text2,1020)=" ..."; }
# warn "Setting to $text2";
$desc->set_content($text2);
}
$desc->prefix("From $channel_title: \"");
$desc->suffix('" --  .');
}
else {
$elt->insert_new_elt(description=>{},"From $channel_title");
}

$elt->cut_children( qr{ (?: new | read | update) Status | mark | time
| attributes | id | source |nr }x );
$elt->print; # print $elt ->text;# print the text (including
sub-element texts)
$t->purge;   # frees the memory
}

}
 
___
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] UPDATE: Tech Meeting tomorrow, Tuesday, April 11, at MIT

2006-04-12 Thread Jerrad Pierce

Ach! The meeting completely slipped my mind!

Will you guys be posting slides/notes somewhere soon?

Thanks!
-- 
H4sICNoBwDoAA3NpZwA9jbsNwDAIRHumuC4NklvXTOD0KSJEnwU8fHz4Q8M9i3sGzkS7BBrm
OkCTwsycb4S3DloZuMIYeXpLFqw5LaMhXC2ymhreVXNWMw9YGuAYdfmAbwomoPSyFJuFn2x8
Opr8bBBidcc=
--
MOTD on Boomtime, the 29th of Discord, in the YOLD 3172:
In the Begining the Universe was created, This has made alot of people very 
angry, and been widly regarded as a bad move.
 
___
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm