Re: Bottom End Contractor Rates

2003-08-19 Thread Alex McLintock
At 20:07 18/08/03, Greg wrote:
Someone has just posted a 3k/mth job for 3mths to this list, and
while getting paid anything is better than being on the dole,


I nearly applied for this work, but didn't just because of the low rate.

I can't be bothered to argue with the original poster but I think
he should read Greg's email in full. This isn't sarcasm - but the stark 
reality
for anyone he attempts to contract in that way.



of course as a contractor you are expected to run a limited company, but
the advantage of that is you can take expenses off before tax,


Um, this looks to be an IR35 caught contract which means that the expenses
claimable would be up to 5% of the income - where appropriate.

of course the advantage of being a contractor is being your own boss,
which means that you get to contribute your own national insurance,
its 11% now (thanks tony), but lets say 10% to keep the maths simple
-2,875
I believe this is more than for a straight employee who only pays Emploee's NI
whereas a contractor caught this way pays for both Employer and Employee;'s NI.

ah well, maybe its time to be a plumber,


Doom sayers are predicting a flood of electricians and plumbers who were
ex-IT people. Expect rates to drop in a few years. Hmmm.
Congrats to Paul on doing his Physical Trainer course.

Alex



Available for java/perl/C++/web development in London, UK or nearby.
Apache FOP, Cocoon, Turbine, Struts,XSL:FO, XML, Tomcat, JSP
http://www.OWAL.co.uk/



SVG::Graph - online first draft

2003-08-19 Thread Leo Lapworth
Hi again all...

I'm still going for the SVG::Graph name space, unless
someone can convince me otherwise (I'm quite happy to
change it, but to me it does seem to fit). There seemed 
to be a bit of confusion over what the module was so I've
thrown together the first version and put it up for
your perusal:

http://leo.cuckoo.org/projects/SVG-Graph/

With some example results at:

http://leo.cuckoo.org/projects/SVG-Graph/examples/

This still needs some work, there is very little
validation at the moment but most things work fine.

This shows the line graph, we're just working on the
Bar graph now and Pie chart after that.

This module creates high quality, hightly configurable
SVG Graphs (many many options, and can choose to use
an external style sheet rather than the default one). 

Any feedback would be much appreciated (more on the
overall concept - the code is just a first draft).

Cheers

Leo





Re: perl and marketing

2003-08-19 Thread Merijn Broeren
Quoting Elaine -HFB- Ashton ([EMAIL PROTECTED]):
 
 Just like MIT to overengineer something :) If little kids in Finland can 
 master Finnish, Swedish and English by the time they are 10, a programming
 language surely couldn't be that big of a deal. Learning Finnish much,
 much later in life isn't quite so easy :)
 
I was very impressed one day when I learned that kids on Holland
nowadays learn about the land of Oct in primary school, age 9-10. Where
the people only count to 7. So they learn counting 0..7, oct, oct plus
one, etc. Which is written down as 0..7, 10, 11, etc. So they learn to
count in different bases. I think I only learned that at university.
Teach 'm young. 

Cheers,
-- 
Merijn Broeren | Sometime in the middle ages, God got fed up with us 
Software Geek  | and put earth at sol.milky-way.univ in his kill-file.
   | Pray all you want, it just gets junked.



Re: OSX - 'the real question'

2003-08-19 Thread muppet
On Monday, August 18, 2003, at 05:50  PM, Alex Brewer wrote:

The real question was why the STDOUT doesn't appear in the terminal 
window, so the famous 'hello world' script runs OK but puts the output 
somewhere else. I can pipe it to a second script to put the output in 
a file but that's no use if I want to build an interactive script.
sorry to ask a stupid question, but are you running the command from 
inside a terminal or are you double-clicking the script in finder?

well, actually i just tried it on the example program from below, and 
it launched a new terminal with the program in it, which was stopped 
because my program finished very quickly.

i have no idea what you're talking about.

perhaps you've unwittingly redirected the output somehow?

A related question. I have chmod 755'ed the file (called foo.command) 
so that it is executable, but when I type the command name in the 
terminal (have checked the path), the response is 'Command not found', 
so I have to type 'perl foo.command' then the script runs. I have the 
'#!/usr/bin/perl -w' as line one.
you checked the path.  did you find '.' in it?  i wager not.

% cat EOF  foo.command
? #!/usr/bin/perl -w
? print hello, world\n;
? EOF
% chmod 755 foo.command
% foo.command
foo.command: Command not found.
% echo $path
/bin /sbin /usr/bin /usr/sbin
% set path = ($path .)
% echo $path
/bin /sbin /usr/bin /usr/sbin .
% foo.command
hello, world
%
generally, the current directory (.) is not in the path for security 
reasons.  the seasoned unix hack's idiom is thus ./foo.command .   perl 
foo.command worked because perl was in your path and looked for the 
script in the current directory.




Re: OSX - 'the real question'

2003-08-19 Thread David Wright
Once you've got the developer's tools installed, you have everything 
you
need to upgrade Perl. However, you may want to try the Fink package
manager, which is based on Debian's dpkg/apt-get/dselect toolkit. If 
you
install Fink, then installing Perl 5.8.0 is just a matter of running

sudo fink install perl580

and waiting half an hour or so for it to compile.

Alternatively, you may prefer to just follow David Wheeler's 
instructions
for this kind of thing at http://david.wheeler.net/osx.html.
Alternatively (3), if you're happy replacing rather than supplementing 
the existing perl, there are some foolproof installers here: 
http://serverlogistics.com/downloads-jag.php. (not just perl.)

Alternatively, if you don't *need* 5.8.x just yet, and you can make do
with 5.6.0 for now, then the next version of OSX is planned to come 
with a
copy of Perl 5.8.1; it should be out by the end of the year
Ach. I paid for the last one and felt burnt. Next time I'll get it 
somewhere ... cheaper. That should make up for the ludicrous price I 
paid for their RAM.

dave




Re: Exporting Symbols

2003-08-19 Thread Dan Sugalski
At 7:11 PM +0100 8/17/03, Nigel Rantor wrote:
So, I've been talking to someone about a module they wrote.

The modules do not export symbols even though the whole point of the 
module is to define some subs for you to be able to use.

His rationale for not exporting symbols is because it 'eats up a lot 
of memory'.

I don't know enough Perlguts to be able to agree or disagree with this.

I would export symbols anyway since I go for deisng first and then 
speed/size/ other optimisations.

Can anyone provide me with any info as to whether or not he is correct?
He's incorrect. Symbols only take up space when they're imported, not 
when they're made available for export. If the name being imported 
doesn't exist in the importer's namespace in any form (which is to 
say, if they're importing $foo, and no *foo exists) it'll take up 
about 100 bytes. While definitely memory usage, I'd be hard pressed 
to call it significant unless you've got a zillion or so symbols 
you're yanking in, and in that case the size of the optree for the 
code being used likely outstrips the symbol memory usage by an order 
of magnitude or so.
--
Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk


Re: OSX - 'the real question'

2003-08-19 Thread Chris Heathcote
On Monday, August 18, 2003, at 11:16  pm, Chris Devers wrote:

Alternatively, you may prefer to just follow David Wheeler's 
instructions
for this kind of thing at http://david.wheeler.net/osx.html.
There's a good guide to installing 5.8.0 at:
http://developer.apple.com/internet/macosx/perl.html
c.




Re: Extending Other Packages

2003-08-19 Thread Peter Haworth
On Sun, 17 Aug 2003 18:29:01 +0100, Nigel Rantor wrote:
 Mark Fowler wrote:
  You shouldn't. Really. You should subclass the other method.

 Well, I agree, but I also wanted to get on to the multiple inheritence
 angle to see what you lot thought about it. So in a sense, I would like to
 force you to do what you don't want to. :-)

 If you don't pollute their name space then do you have to release a
 class that has the extensions in it and make people instantiate that
 class?
 
  Yes, this is the normal thing to do.

 Yep, leading on to the MI problem...

What MI problem? As far as I remember, C++ people don't like diamond
inheritance, but it didn't sound like that was going to be a problem here,
even if you do end up with diamonds.

-- 
Peter Haworth   [EMAIL PROTECTED]
All those who believe in psychokinesis, raise my hand!



Re: SVG::Graph - online first draft

2003-08-19 Thread Robin Berjon
Leo Lapworth wrote:
With some example results at:

http://leo.cuckoo.org/projects/SVG-Graph/examples/
Very nice :) I am right now working on a long series of benchmarks, which need 
to be presented in SVG and PNG. You are saving me from having to write this 
module ;)

This shows the line graph, we're just working on the
Bar graph now and Pie chart after that.
Any idea of how soon those will come? I'd be happy to help with various things, 
so long as I don't have to do too much TT (*ducks*).

--
Robin Berjon [EMAIL PROTECTED]
Research Engineer, Expwayhttp://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488



Re: IPC::Shareable: fixed

2003-08-19 Thread Andy Ford
This is just in case someone is reading this post through interest!!
I have sorted where the problem is. If you are interested, please read
on...

The program I wrote was the following...

-  snip  -
my %myhash;
tie %myhash, 'IPC::Shareable', hashkey, {create = 1, exclusive = 0,
mode = 0666, destroy = 1, size = 262144 };

while($dstIP = $sth1-fetchrow())
{
   $myhash{$dstIP}{dispatched} = time();
   $myhash{$dstIP}{response}   = 0;
   $myhash{$dstIP}{num_polls}  = 1;
   $myhash{$dstIP}{action} = 0;
}   
- end snip ---

From the perldoc (I know - I should have RTFM!!) it says this

-
When a reference to a non-tied scalar, hash, or array is assigned to a
tie()d variable, IPC::Shareable will attempt to tie() the thingy being
referenced. This allows disparate processes to see changes to not only
the top-level variable, but also changes to nested data.  This feature
is intended to be transparent to the application, but there are some
caveats to be aware of.

First of all, IPC::Shareable does not (yet) guarantee that the ids
shared memory segments allocated automagically are unique.  The more
automagical tie()ing that happens, the greater the chance of a
collision.

Secondly, since a new shared memory segment is created for each thingy
being referenced, the liberal use of references could cause the system
to approach its limit for the total number of shared memory segments
allowed.
-

Of course, I had tied %myhash. The nested hash $myhash{$dstIP} is not
tied to shared memory. Therefore the value $myhash{$dstIP} will have a
new segment/semaphore created for each one I create. Well, once I
reached the maximum number of semaphores set for my Solaris box...

sysdef -i gave me '10  semaphore identifiers (SEMMNI)'

my perl script core dumped!!

Anyway, I did RTFM, just not closely enough!! I haven't fixed the
problem however, although someone mentioned Storable which I haven't
looked into yet!!

Andy

On Fri, 2003-08-15 at 14:30, Andy Ford wrote:
 I am getting somewhere now!!
 
 If I call 'tie' after I have created the hash, all is fine. 
 Surely I should be able to create the shares memory and then add/remove
 entries in the hash at will!?
 
 Andy
 
 
 On Fri, 2003-08-15 at 14:12, Andy Ford wrote:
  This is the output of ipcs -A...
  
  IPC status from running system as of Fri Aug 15 13:10:04 UTC 2003
  T ID  KEYMODEOWNERGROUP  CREATOR  
  CGROUP CBYTES  QNUM QBYTES LSPID LRPID   STIMERTIMECTIME 
  Message Queues:
  T ID  KEYMODEOWNERGROUP  CREATOR  
  CGROUP NATTCH  SEGSZ  CPID  LPID   ATIMEDTIMECTIME  ISMATTCH
  Shared Memory:
  m610   0xbc054--rw-rw-rw- rootother root   
  other  0  65536  7680 0 no-entry no-entry 13:10:010
  T ID  KEYMODEOWNERGROUP  CREATOR  
  CGROUP NSEMS   OTIMECTIME 
  Semaphores:
  
  before running the script, ipcs -A was clear so the shared memory was
  created with ID 610
  
  Andy
  
  On Fri, 2003-08-15 at 13:44, Andy Ford wrote:
   Hello
   
   I have had a good look round at what may be causing the error..
   Could not create semaphore set: No space left on device
   
   What I am basically doing is the following...
   
   tie %myhash, 'IPC::Shareable', hashkey, {create = 1, exclusive = 0,
   mode = 0666, destroy = 1, size = 262144 };
   
   while($dstIP = $sth1-fetchrow())
   {
  print $dstIP\n;   
  $myhash{$dstIP}{dispatched} = time();
  $myhash{$dstIP}{response}   = 0;
  $myhash{$dstIP}{num_polls}  = 1;
  $myhash{$dstIP}{action} = 0;
  
   }   
   
   When I start up the process, I manage to print out 10 $dstIP addresses
   and then I get the error. This is rather a small amount of data to fit
   into 262144 bytes. Even if I increase this size, I get the same error at
   the same point. Without setting SHM fetchrow returns 20 $dstIP addresses
   and they print fine.
   
   Any ideas
   
   Andy
   
  
 




Re: Exporting from .mdb Access files

2003-08-19 Thread Marcel Gruenauer
On Thu, Aug 14, 2003 at 03:01:18AM +0100, Paul Makepeace wrote:

 Are there any free tools for extracting tables etc from MS Access
 databases? I'm not looking for ODBC connections to Access installations,
 rather actual parsing+dumping tools so I can re-import into say Pg.
 Closest I've found is http://www.csrobins.com/mdb2txt.htm which
 unfortunately is a closed Windows program. It doesn't quite seem to
 work with Wine, popping up a usage dialog each time it's run (mailed
 the author).

I have similar needs: to export data from an access database and generate
web pages with that data using perl on a Unix. I've found XML Converter
from http://rustemsoft.com that can export a whole Access database to XML,
which I've then copied to the Unix host and parsed using Perl and XML.

It might not fit your needs, but I've found the approaach good enough.

Marcel

-- 
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
 -- London.pm strategy aka embrace and extend aka mark and sweep



Re: SVG::Graph - online first draft

2003-08-19 Thread Leo Lapworth
On Tue, Aug 19, 2003 at 12:18:22PM +0200, Robin Berjon wrote:
 http://leo.cuckoo.org/projects/SVG-Graph/examples/
 
 Very nice :) I am right now working on a long series of benchmarks, which 
 need to be presented in SVG and PNG. You are saving me from having to write 
 this module ;)

Great :)

I've found that batik (http://xml.apache.org/batik/) converts SVG to 
 PNG very well, all the Perl (ImageMagick for example) conversions
don't give you anything like the quality (loose a lot of the style
sheet info) of the origional.

Bar graphs will be ready sometime later today or tomorrow.

I'll post to the list when they are done.

I've got to double check with da' management about putting the
module on CPAN (don't think it'll be a problem) and want to give others 
more time for feedback about the name space, but I'll keep the version on 
my site up to date.

Cheers

Leo



Re: Bra

2003-08-19 Thread Marcel Gruenauer
On Fri, Aug 15, 2003 at 04:05:22PM +0100, Nicholas Clark wrote:

 This counts as art rather than debauchery? On the basis that debauchery
 is frowned on at social meetings?

/me smells a what is art? debate coming on...

Marcel

-- 
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
 -- London.pm strategy aka embrace and extend aka mark and sweep



Re: perl and marketing

2003-08-19 Thread Andy Wardley
Merijn wrote:
 I was very impressed one day when I learned that kids on Holland
 nowadays learn about the land of Oct in primary school, age 9-10. 

aolMe too!/aol

I was telling my wife about this just the other day.  I was in the 
last year of junior school so also must have been about 9.  Our 
teacher took us off on an imaginary rocket ship journey to a planet
where the aliens only had 8 fingers.

We learnt how to count in octal and convert between octal and decimal.
I don't think too many of us really understood it in depth and only 
learnt to count/convert by rote.  But I do remember being fascinated
by the idea that 10 was an entirely arbitrary base for a number system.

A




Re: Bra

2003-08-19 Thread Marcel Gruenauer
On Fri, Aug 15, 2003 at 11:55:39PM +1000, Andrew Savige wrote:

 Victoria Bra, Secret Tango (2003)
 =
 
 L.A.B. Brocard 1976-
 
 This, the third work in Brocard's acclaimed Orange sequence,
[deletia]
 This work is extremely fragile. Please do not touch.

Magnificent. Are you for hire as an art critic? :)

(Assuming you didn't generate this with some Parse::RecDescent grammar. In
which case I'd like a copy of said grammar...)

Marcel

-- 
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
 -- London.pm strategy aka embrace and extend aka mark and sweep



Re: [OT] Decompiling perl2exe apps

2003-08-19 Thread Marcel Gruenauer
On Fri, Aug 15, 2003 at 12:46:44PM +0100, James Campbell wrote:

 I have managed to lose some source code (ahem) for a script that I packaged
 with perl2exe on a Windows 2000 PC.

One of the better arguments against perl2exe and its ilk.

 I have seen a few hints that perl2exe
 applications can be cracked to reveal the source code.

Another argument against it...

Marcel

-- 
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
 -- London.pm strategy aka embrace and extend aka mark and sweep



Re: perl and marketing

2003-08-19 Thread Chris Bannister
Andy Wardley wrote:

Merijn wrote:

I was very impressed one day when I learned that kids on Holland
nowadays learn about the land of Oct in primary school, age 9-10. 


aolMe too!/aol

aolMe three/aol

I remeber being taught about conversion to and from HEX, Binary and 
Octal during my last year or so at Primary school.  I'm sure our end of 
term production even included people who counted in a different base.

Still remember the awful joke about having 1023 fingers. :|

--
Chris Bannister
[EMAIL PROTECTED]



hash lookup with regex

2003-08-19 Thread Martin Bower
apologies for perl content :-)

I have 2 hashes,  one with 10,000 entries and the other with 5,000,  and 
these are loaded  from a database table(sybase).

%hash1  contains values such as 111.666.fff.jjj.ccc.222
%hash2 contains values such as 111.666.fff.___.ccc.222   (where the ___ 
can eixst in any position)

is there a quick way for me to see if a value contained in %hash2 exists in 
%hash1  ? without resorting to as nested loop foreach hash, as below ?

foreach my $key ( keys %hash1 ) {
   foreach my $check ( keys %hash2 ) {
   $check =~ s/_/\./g;
   if ($key =~ $check) {
   print $key matches $check\n;
   }
   }
}
_
On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile



Re: SVG::Graph..

2003-08-19 Thread ronan
Quoting Andy Wardley [EMAIL PROTECTED]:

 At present the Template::* namespace is effectively reserved[*] for the 
 Template Toolkit.  I plan to change that in version 3 to allow it to
 be opened up for other templating modules.  However, that will take
 careful planning to avoid trampling on existing Template::* modules.
 

That's essentially the same issue in the SVG namespace. So far, we've managed 
to preserve SVG:: to include modules that implement an optimized, streamlized 
DOM. It would be a shame to confuse things with SVG::Graph. What do we do when 
we want to implement an SVG.pm-based graphing module using SVG::Parser, which 
uses SVG.pm?

Do we call it SVG::Grapher::NoTemplate ?  This is a problem.

 If you want to go this route then email me off list and I'll commit to
 a particular Template::* namespace for this purpose.  But I think in this
 case, a non-TT specific version of SVG::Graph would be better.
 

I would second this alternative, or the use of SVG::TT::Graph namespace to 
identify a template-based system.

The problem that I have with SVG::Graph::* is that the system is not related to 
the SVG base module, and is not a generic graphing implementation. It is a 
templating implementation that happens to generate SVG because the chosen 
template happens to be SVG. 

A generic use of the SVG::Graph namespace, imho, would be relyant on SVG.pm and 
would be a graphing template. In the same way that SVG::Parser is a parser that 
generates the SVG.pm DOM (which, by the way, you could conceptually use in 
SVG::Graph to generate your graphs - many ways to do this...).

To use the SVG::Graph namespace will unnecessarily confuse the existing user 
base. I therefore recommend you use SVG::TT::Graph or something like that which 
identifies the fact that you are using templates.

Ronan

 A
 
 
 






Re: Exporting Symbols

2003-08-19 Thread Dominic Mitchell
On Mon, 18 Aug 2003 19:49:42 -0400, Dan Sugalski [EMAIL PROTECTED] wrote:
 He's incorrect. Symbols only take up space when they're imported, not 
 when they're made available for export. If the name being imported 
 doesn't exist in the importer's namespace in any form (which is to 
 say, if they're importing $foo, and no *foo exists) it'll take up 
 about 100 bytes. While definitely memory usage, I'd be hard pressed 
 to call it significant unless you've got a zillion or so symbols 
 you're yanking in, and in that case the size of the optree for the 
 code being used likely outstrips the symbol memory usage by an order 
 of magnitude or so.

I think that all this stems from the mod_perl quest for speed, at any
cost.  I often see micro-optimisations[1] discussed in the context of
mod_perl that would make exceedingly little difference in practise
unless you were doing many thousands of transactions per minute.

What's more worrying is that both of the mod_perl books that I possess
go down this same route.  Do things this way because it's faster.  No
explanation of why you might want to do this.  Worse, no disclaimer
saying that you should run your code under the profiler first, to see if
that bit of code you've just tried to speed up is actually causing you
any speed problems in the first place.

I stand by Don Knuth -- Premature optimisation is the root of all evil.

I'm not saying that discussing optimisation is bad.  Just that the
caveats need to be spelled out very clearly.

-Dom

[1] Such as symbol exports being one of them.

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



Re: hash lookup with regex

2003-08-19 Thread Andy Ford
You could cast them both to arrays and use the perl module
Algorithm::Diff to calculate the differences between them.

This will check if the entry is in array1 and not in array2 and
vice-versa - wonderful

Andy

 On Tue, 2003-08-19 at 12:31, Martin Bower wrote:
 apologies for perl content :-)
 
 I have 2 hashes,  one with 10,000 entries and the other with 5,000,  and 
 these are loaded  from a database table(sybase).
 
 %hash1  contains values such as 111.666.fff.jjj.ccc.222
 %hash2 contains values such as 111.666.fff.___.ccc.222   (where the ___ 
 can eixst in any position)
 
 is there a quick way for me to see if a value contained in %hash2 exists in 
 %hash1  ? without resorting to as nested loop foreach hash, as below ?
 
 foreach my $key ( keys %hash1 ) {
 foreach my $check ( keys %hash2 ) {
 $check =~ s/_/\./g;
 if ($key =~ $check) {
 print $key matches $check\n;
 }
 }
 }
 
 _
 On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile
 




Re: SVG::Graph - online first draft

2003-08-19 Thread Robin Berjon
Leo Lapworth wrote:
I've found that batik (http://xml.apache.org/batik/) converts SVG to 
 PNG very well, all the Perl (ImageMagick for example) conversions
don't give you anything like the quality (loose a lot of the style
sheet info) of the origional.
Yes, Batik has by far the best rendering that is currently known, if at the cost 
of being atrociously slow. It is what the SVG WG uses to do its test rendering. 
However I've heard good stuff about kSVG and svgl, both of which could probably 
be bridged from Perl. I need to test that. Also, at some point there should be a 
new version of XML::LibRSVG but I haven't heard about it in a while.

Bar graphs will be ready sometime later today or tomorrow.
Wonderful! Please keep us|me posted.

--
Robin Berjon [EMAIL PROTECTED]
Research Engineer, Expwayhttp://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488



Re: perl and marketing

2003-08-19 Thread Paul Makepeace
On Tue, Aug 19, 2003 at 12:16:31PM +0100, Chris Bannister wrote:
 I remeber being taught about conversion to and from HEX, Binary and 
 Octal during my last year or so at Primary school.  I'm sure our end of 
 term production even included people who counted in a different base.
 
 Still remember the awful joke about having 1023 fingers. :|

I remember sitting with my dad learning binary aged 9/10 and how to
count on my fingers to 1023. Being able to count, fast[1], to 31 on one
hand is surprisingly useful. Then there's all the jokes about the number
six (UK), four (US), ...

Paul

[1] 0 to 31 in about 6s

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

What is the time of your life? To move with certainty and purpose.
   -- http://paulm.com/toys/surrealism/



Re: perl and marketing

2003-08-19 Thread Dave Cross

From: Merijn Broeren [EMAIL PROTECTED]
Date: 8/19/03 8:53:49 AM

 I was very impressed one day when I learned that kids on 
 Holland nowadays learn about the land of Oct in primary 
 school, age 9-10. Where the people only count to 7. So 
 they learn counting 0..7, oct, oct plus one, etc. Which is
 written down as 0..7, 10, 11, etc. So they learn to
 count in different bases. I think I only learned that at 
 university.
 Teach 'm young. 

I'm sure I did stuff in different bases pretty early on in school.
In fact, I _know_ that we much have at least touched on base
12 so that we could deal with the monetary system[1].

Dave...

[1] Yes, I _am_ that old.
-- 
http://www.dave.org.uk

Let me see you make decisions, without your television
   - Depeche Mode (Stripped)







Re: perl and marketing

2003-08-19 Thread Chris Benson
On Tue, Aug 19, 2003 at 11:53:42AM +0100, Andy Wardley wrote:
 Merijn wrote:
  I was very impressed one day when I learned that kids on Holland
  nowadays learn about the land of Oct in primary school, age 9-10. 
 
 aolMe too!/aol
 
 I was telling my wife about this just the other day.  I was in the 
 last year of junior school so also must have been about 9.  Our 
 teacher took us off on an imaginary rocket ship journey to a planet
 where the aliens only had 8 fingers.

All I got to do last year of primary school was sit in a corner with a
copies of Martin Gardner's (More) Mathmatical Puzzles and Diversions.
I'm feeling fantasy-deprived :-)

The teacher had a story about the leprechauns that could count up to
1023 on their fingers, so I might have known what binary was too (though
I don't remember binary being mentioned).
-- 
Chris Benson



Re: perl and marketing

2003-08-19 Thread Robin Berjon
Dave Cross wrote:
I'm sure I did stuff in different bases pretty early on in school.
In fact, I _know_ that we much have at least touched on base
12 so that we could deal with the monetary system[1].
In France I remember doing bases 12, 24 and 60 quite young. I'll let you figure 
out for what it was used :)

--
Robin Berjon [EMAIL PROTECTED]
Research Engineer, Expwayhttp://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488



Re: SVG::Graph..

2003-08-19 Thread Robin Berjon
[EMAIL PROTECTED] wrote:
That's essentially the same issue in the SVG namespace. So far, we've managed 
to preserve SVG:: to include modules that implement an optimized, streamlized 
DOM. It would be a shame to confuse things with SVG::Graph. What do we do when 
we want to implement an SVG.pm-based graphing module using SVG::Parser, which 
uses SVG.pm?

Do we call it SVG::Grapher::NoTemplate ?  This is a problem.
I don't believe this is an issue any more than in any other CPAN TLNS. In the 
same way that Andy said he's working on TT3 so that other templating engines can 
use the Template::* TLNS, there is no good reason to restrict SVG::* to things 
that revolve around SVG.pm. There's a lot that one can do with SVG, and all uses 
of the namespace for things that are close to SVG are legitimate.

For instance, the wrapper around librsvg has thus far been called XML::LibRSVG, 
but I intended to ask the author (before he releases it) if he didn't prefer 
moving to SVG::LibRSVG, as it has little to do with XML proper.

SVG.pm doesn't own the SVG::* namespace any more than CGI.pm owns CGI::*.

The problem that I have with SVG::Graph::* is that the system is not related to 
the SVG base module, and is not a generic graphing implementation. It is a 
templating implementation that happens to generate SVG because the chosen 
template happens to be SVG. 
It more than just happens to use SVG. A number of its options are SVG specific 
and wouldn't mean much in other contexts (eg the stylesheet). It is an SVG 
producer in its own right, and the only thing I find non-SVGish about it is that 
it only writes to a file (it seems) when returning a string would be very useful 
(it'd allow one to hide it behind a simple wrapper that'd output SAX in order to 
merge the graph more easily into a larger document. I wouldn't be surprised if 
it evolved to use RCC in the future.

The only sensible alternative I see to SVG::Graph would be Chart::SVG (the usual 
permutation that applies to many modules).

--
Robin Berjon [EMAIL PROTECTED]
Research Engineer, Expwayhttp://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488



Re: Bra

2003-08-19 Thread Sam Vilain

 This counts as art rather than debauchery? On the basis that
 debauchery is frowned on at social meetings?
/me smells a what is art? debate coming on...

/me farts in order to mask any such smell before things get out of
hand.
-- 
Sam Vilain, [EMAIL PROTECTED]

A seeming ignorance is often a most necessary part of worldly
knowledge.
 - anon.




Re: SVG::Graph..

2003-08-19 Thread Leo Lapworth
Thanks for all the feedback everyone.

I'm going to rename the module SVG::TT::Graph so we'll have:

SVG::TT::Graph
SVG::TT::Graph::Line
SVG::TT::Graph::Pie
etc..

I don't see any point keeping the burner seperate now (the base
object really doesn't do much, it's all in the template, if someone
really wants to use another template language they can always
overload the burn method).

Most kudos to Stephen Morgan the guy who actually created the
templates.

Thanks again.

Leo

p.s. will post when we have a new version up.



Re: hash lookup with regex

2003-08-19 Thread Mark Fowler
On Tue, 19 Aug 2003, Martin Bower wrote:

 is there a quick way for me to see if a value contained in %hash2 [after
 being mutated someway] exists in %hash1 ? without resorting to as nested
 loop foreach hash.

If you've got the memory (and looking at it, you're not dealing with too
many items yet, so you should have) it'd make more sense to precompute
each possible key from the keys in %hash1 once and store that in a
seperate hash, then all you'll need to do is look up the key from hash2 in
that hash.

Keep making the hashes bigger and bigger till you run out of physical
memory[1].  Hashses are fast.

Mark.

[1] Though if you run out of physical memory then everything suddenly gets
very very very very slow.

-- 
#!/usr/bin/perl -T
use strict;
use warnings;
print q{Mark Fowler, [EMAIL PROTECTED], http://twoshortplanks.com/};



Re: hash lookup with regex

2003-08-19 Thread Martin Bower
Andy Ford wrote:
You could cast them both to arrays and use the perl module
Algorithm::Diff to calculate the differences between them.
hmm. had a quick look and I don't think the MATCH function will match the 
regex either,  the code below (taken from 
http://www.stonehenge.com/merlyn/UnixReview/col35.html ) doesnt produce any 
matches at all.

maybe I'm missing something ( go easy on the responses to that one )

Martin

my @mapping1 = 
(111.222.333.444,222.333.444.555,555.666.444.333,333.444.666.777);
my @mapping2 = (111.222.444,222.333.444);

 traverse_sequences([EMAIL PROTECTED], [EMAIL PROTECTED], {
   MATCH = sub { show(MATCH,$mapping1[$_[0]], $mapping2[$_[1]]) },
   DISCARD_A = sub { show(NO,$mapping1[$_[0]], ---) },
   DISCARD_B = sub { show(NO, ---, $mapping2[$_[1]]) },
 });
 sub show {
   printf %5s %10s %10s\n, @_;
 }
_
MSN - More Useful Every Day  http://www.msn.de



Re: hash lookup with regex

2003-08-19 Thread Steve Keay
On Tue, Aug 19, 2003 at 11:31:16AM +, Martin Bower wrote:
 %hash1  contains values such as 111.666.fff.jjj.ccc.222
 %hash2 contains values such as 111.666.fff.___.ccc.222   (where the ___ 
 can eixst in any position)

If there is only ever one ___ in a value you could generate all 6
possibilities from hash1 and look them up directly in hash2.

if ($hash2{'___.666.fff.jjj.ccc.222'} or
$hash2{'111.___.fff.jjj.ccc.222'} or
$hash2{'111.666.___.jjj.ccc.222'} or
$hash2{'111.666.fff.___.ccc.222'} or
$hash2{'111.666.fff.jjj.___.222'} or
$hash2{'111.666.fff.jjj.ccc.___'}
){ warn found it! }



Re: hash lookup with regex

2003-08-19 Thread Dave Cross

From: Martin Bower [EMAIL PROTECTED]
Date: 8/19/03 11:31:16 AM

 apologies for perl content :-)

 I have 2 hashes,  one with 10,000 entries and the other 
 with 5,000,  and these are loaded  from a database 
 table(sybase).

 %hash1  contains values such as 111.666.fff.jjj.ccc.222
 %hash2 contains values such as 111.666.fff.___.ccc.222  
 (where the ___ can eixst in any position)

 is there a quick way for me to see if a value contained in
 %hash2 exists in %hash1  ? without resorting to as nested 
 loop foreach hash, as below ?

 foreach my $key ( keys %hash1 ) {
 foreach my $check ( keys %hash2 ) {
 $check =~ s/_/\./g;
 if ($key =~ $check) {
 print $key matches $check\n;
 }
 }
 }

Can't you get the keys of both hashes into arrays then find the
intersection using the algorithms in the FAQ?

Dave...

-- 
http://www.dave.org.uk

Let me see you make decisions, without your television
   - Depeche Mode (Stripped)







Re: SVG::Graph - online first draft

2003-08-19 Thread Ian Brayshaw
Robin Berjon wrote:

 Also, at some point there should be a 
 new version of XML::LibRSVG but I haven't heard about it in a while.

... That would be because I have not been in communication about it. My bad.

I have nearly completed the next release of XML::LibRSVG which will
allow you to generate JPEG and PNG images from SVGs using the GNOME
librsvg library. It will also integrate with XML::LibXML and (hopefully)
Gtk-Perl.

Apologies for not having this out sooner. I have just had a death in the
family and have been snowed under with a new job. I'll get it out as
soon as I can. If people are desparate to try it, mail me off list and
I'll send you the lastest alpha release.


Ian



-- 
s@[EMAIL PROTECTED]@##@@#y^#@712($;='z')s(..)0$1gs$0s(.)([^01])
$1x$2xge($.='a')s$d4823604df80d7e51d7018b9(@_=$...$;)undef$.;do
{s(.)(.*)(.)$..=$1.$3,$2e}while(length);s$.;$*=0;undef$.;$..=($_?$_[(
$*+=$_)[EMAIL 
PROTECTED]:$)foreach(map{hex}m(..)g);s.*$.$/s(\b.)\U$1goprint



SVG::TT::Graph - now with Bar Graphs.

2003-08-19 Thread Leo Lapworth
Hi All,

Ok, we've got first versions of bar graphs as requested,
Pie charts on the way.

Examples: 

http://leo.cuckoo.org/projects/SVG-TT-Graph/examples/

Code:

http://leo.cuckoo.org/projects/SVG-TT-Graph/

The API isn't likely to change much, but I won't
promise anything at this stage.

Still more validation to do, tests and a bit more
documentation.

Got a few ideas, such as being able to clear the data
so you can reuse the object to create multipul graphs etc,
but these will get added once we've got the Pie
graph done.

Cheers

Leo



Re: perl and marketing

2003-08-19 Thread David H. Adler
On Tue, Aug 19, 2003 at 05:00:59AM -0700, Dave Cross wrote:
 
 I'm sure I did stuff in different bases pretty early on in school.
 In fact, I _know_ that we much have at least touched on base
 12 so that we could deal with the monetary system.

Speaking of which, the aforementioned Schoolhouse Rock had a segment on
base twelve, so although school may not have done it, my generation did
have an early introduction to bases other than 10.

dha

-- 
David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/
Barter is if he asked someone to look at his program in exchange for a
cow or something.   - Mark-Jason Dominus



OSX - Thanks everyone

2003-08-19 Thread Alex Brewer
Dear Perl Mongers

Many thanks for your observant comments. I am happy to prepend ./ to my 
commands, it seems to work. I didn't realise that the current path 
wasn't included by default as it is in NT (= MS-DOS - an operating 
system only as good as it resembles Unix in my opinion).

echo $PATH yields /bin:/sbin:/usr/bin:/usr/sbin so no wonder I 
can't run the commands per se.

I'm using the default OSX shell which is the TCSH, I think.

 What results are you seeing that suggest OSX  Perl behave at all
 strange as far as the standard file streams? Can you provide
 sample code?
No results or code. I assumed that the failure of the program to 
display was the redirection of STDIN, however one reason was the path, 
and the other was a bug in a perl tutorial file which I found using 
'use diagnostics'. So my mistake!

A nasty moment when I saved the default prefs and found that the script 
running in the window was also saved, so terminal windows were closed 
before I could type anything. So no Terminal for a while. However I 
tracked down the terminal prefs file (com.apple.Terminal.plist) and 
removed the string from there.

As for Perl 5.8 I'll wait until I need the new functions. I'll probably 
use the installers when I do. As a beginner that's some way off I 
should think!

You may be interested to know that I am using the 'Data Munging' Book 
by David Cross, a good bit of work by one of your number.

Best wishes to you all

Alex Brewer




Re: OSX - 'the real question'

2003-08-19 Thread Chris Devers
On Tue, 19 Aug 2003, David Wright wrote:

 Alternatively (3), if you're happy replacing rather than supplementing
 the existing perl, there are some foolproof installers here:
 http://serverlogistics.com/downloads-jag.php. (not just perl.)

This option seems to be unpopular among a lot of people, on grounds that a
lot of system software (installers etc) depend on having a particular copy
of Perl at /usr/bin/perl, and can't be guaranteed to work if you replace
that with a better version. This isn't just an OSX idea: the same people
also seem to prefer to leave the stock Perl alone on Debian, FreeBSD,
Solaris, etc.

The consensus seems to be to *always* leave the system software (Perl et
al) alone, and put your stuff in a custom directory such as /usr/local,
/opt, or /sw. Tinkering with the contents of /{usr,}/{bin,sbin} is
generally seen as something that shouldn't be done in most cases.

 Ach. I paid for the last one and felt burnt. Next time I'll get it
 somewhere ... cheaper. That should make up for the ludicrous price I
 paid for their RAM.

Ouch, you bought ram from the vendor? Bummer... :)


-- 
Chris Devers[EMAIL PROTECTED]
http://devers.homeip.net:8080/resume/

algorism, n.
A pre-LISP ALGORITHM devised by abu-Ja'far Mohammed ibn-Musa
al-Khuwarizmi (Persian mathematician fl. ce 825) who wrote the first
BASIC substring modifier in a vain attempt to shorten his name.

-- from _The Computer Contradictionary_, Stan Kelly-Bootle, 1995



Re: OSX - Thanks everyone

2003-08-19 Thread Randal L. Schwartz
 Alex == Alex Brewer [EMAIL PROTECTED] writes:

Alex Dear Perl Mongers
Alex Many thanks for your observant comments. I am happy to prepend ./ to
Alex my commands, it seems to work. I didn't realise that the current path
Alex wasn't included by default as it is in NT (= MS-DOS - an operating
Alex system only as good as it resembles Unix in my opinion).

In the Old Days of Unix, dot was in path, and people figured out how
to exploit that, so no person who is seriously concerned about
security includes it any more.

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



Re: hash lookup with regex

2003-08-19 Thread James E Keenan
 Message: 9
 From: Martin Bower [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: hash lookup with regex
 Date: Tue, 19 Aug 2003 11:31:16 +

 I have 2 hashes,  one with 10,000 entries and the other with 5,000,  and

 %hash1  contains values such as 111.666.fff.jjj.ccc.222
 %hash2 contains values such as 111.666.fff.___.ccc.222   (where the ___
 can eixst in any position)

Given your code below, I assume you mean:  %hash1 contains *keys* such as
111.666.fff.jjj.ccc.222.  If so, then the *values* of %hash1 and %hash2 are
either irrelevant or need only be a true value.  If so, ...


 is there a quick way for me to see if a value contained in %hash2 exists
in
 %hash1  ? without resorting to as nested loop foreach hash, as below ?


... then in addition to Algorithm::Diff (as suggested by Andy Ford
[EMAIL PROTECTED]), you might also consider
List::Compare::SeenHash:

use List::Compare::SeenHash;
my %hash1  = (
'111.666.fff.jjj.ccc.222' = 1,
'111.666.fff.jjj.ccc.333' = 22,
'111.666.fff.jjj.ccc.444' = 72,
'111.666.fff.jjj.ccc.666' = 57,
);
my %hash2 = (
'111.666.___.fff.jjj.ccc.222' = 1,
'111.666.fff.jjj.ccc.___.333' = 73,
'111.666.___.fff.jjj.ccc.333' = 57,
'111.666.fff.jjj.ccc.555' = 602,
'111.666.___.fff.___.jjj.ccc.666' = 79,
);
my (%hash2plus, @intersection);
foreach my $check (keys %hash2) {
$check =~ s|_+\.||g;
$hash2plus{$check}++;
}
my $lcsh = List::Compare::SeenHash-new(\%hash1, \%hash2plus);
@intersection = $lcsh-get_intersection;
print After stripping underscores, found in both:  $_\n foreach
@intersection;

As the author of this CPAN module, I would appreciate feedback on its
usefulness with hashes of your size.

Jim Keenan




Re: hash lookup with regex

2003-08-19 Thread James E Keenan

Eeek!  I cut-and-pasted the wrong text as part of my last post.  I should
have stated:

Given your code below, I assume you mean:  %hash1 contains *keys* such as
111.666.fff.jjj.ccc.222.  If the *values* of %hash1 and %hash2 are strictly
numeric (as would be the case if these are seen-hashes), then ...
[snip]
... then in addition to Algorithm::Diff  ..., you might also consider
List::Compare::SeenHash:
[snip code example]

Jim Keenan