Re: [Boston.pm] Perl popularity and interview questions

2005-03-07 Thread Darren Chamberlain
* Greg London  [2005/03/07 10:43]:
> 
> Palit, Nilanjan said:
> > $> perl -e '$x=1; $y=$x+++1; print "x=$x, y=$y\n"'
> 
> Bummer. I just got a ding on your interview.
> How do you parse $x+++1 ?

  $ perl -MO=Deparse,p -e '$x=1; $y=$x+++1; print "x=$x, y=$y\n"'
  $x = 1;
  $y = $x++ + 1;
  print "x=$x, y=$y\n";
  -e syntax OK

:)

(darren)

-- 
1. Everything depends.
2. Nothing is always.
3. Everything is sometimes.


pgpp0rvghu7I2.pgp
Description: PGP signature
 
___
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Re: [Boston.pm] GUI builders, support tools

2005-02-28 Thread Darren Chamberlain
* Sean Quinlan  [2005/02/28 18:12]:
> [...] But here's something you basic text
> editor doesn't give you that I think Eclipse does. Function jumping (or
> whatever it's called). I'd _LOVE_ to be able to click (or highlight and
> meta-somthing, whatever) on a function or method call and have the
> editor skip directly to it's definition - even if it is from another
> module and had to go find it!

I can't tell if you're kidding or not, but that's exactly what ctags
(and etags) does.  Exuberant ctags[0] is a popular implementation, and
has this to say for itself:

  Ctags generates an index (or tag) file of language objects found in
  source files that allows these items to be quickly and easily
  located by a text editor or other utility. A tag signifies a
  language object for which an index entry is available (or,
  alternatively, the index entry created for that object).

TAGS files are supported by (at the very least) emacs and various
flavors of vi, and have been around for a long time.

(darren)

[0] 

-- 
I'd crawl over an acre of 'Visual This++' and 'Integrated Development
That' to get to gcc, Emacs, and gdb.
-- Vance Petree


pgpwynnBvxPaw.pgp
Description: PGP signature
 
___
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Re: [Boston.pm] Reminder: Tech Meeting Tues, Jan 13

2004-01-14 Thread darren chamberlain
* Greg London  [2004/01/14 01:52]:
> As the lucky winner of the "Badger Book" prize
> I just wanted to say:
> 
> THANKS FOR THE BOOK!

I hope you enjoy it.

> And I forgot to have Darren autograph it. 

In place of an autograph, I've attached a digital signature.

(darren)

-- 
Never doubt that a small group of thoughtful, committed citizens can
change the world; indeed, it's the only thing that ever has.
-- Margaret Mead


pgp0.pgp
Description: PGP signature
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Re: Reminder: Tech Meeting Tues, Jan 13 (Ronald J Kimball)

2004-01-12 Thread darren chamberlain
*  [2004/01/12 13:11]:
> I will be coming for the first time, is Boston.com's office just the 
> Boston Globe or is there an address I can use and office room? 

Boston.com is at 320 Congress Street, which is not near the Boston
Globe.  The announcement includes directions, which you quoted in your
question:

> Public Transportation Directions: 
> 
> If you take the commuter rail into South Station, exit from the doors
> on the right (near the ticket counter), cross the street to the
> Federal Reserve Building (the large white building with the metal
> sliding panels which hide the gun turrets), take a right, and walk
> along Summer St. down the sidewalk towards South Boston.  At the set
> of lights with the the Post Office towards your right, take a left on
> Dorchester Ave and walk one block towards Congress St.  Once you hit
> Congress St. cross the bridge and pass the Tea Party Museam, the Milk
> Bottle and the Children's Museum.  Boston.com is in the next building
> after the Children's Museum. 
> 
> Directions from the Red Line: 
> 
> Try to navigate through the underground labyrinth to the "Museum
> Wharf/Federal Reserve" exit.  Go up the stairs and stand so you are
> facing South Boston and your back is against the Downtown Crossing
> area.  Once above ground, find the subway entrance that I meant for
> you to leave from and walk towards that one.  (Unless you wind up at
> the one that exits right into South Station itself, if so follow the
> commuter rail directions above.)  Walk down Summer with the Federal
> Reserve building on your left and South Station on your right.  When
> you get to the set of lights at the corner of Summer and Dorchester
> (the Post Office is on your right), take a left and walk one block
> towards Congress St.  Once on Congress St, take a right, walk over the
> bridge and pass the Tea Party Museum, The Milk Bottle, and the
> Children's Museum.  Boston.com is in the next building after the
> Children's Museum. 

(darren)

-- 
Distrust any endeavor requiring an alarm clock.


pgp0.pgp
Description: PGP signature
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Boston.pm Job Posting Policy

2004-01-07 Thread darren chamberlain
* Uri Guttman  [2004/01/07 15:13]:
> with the perl jobs list, why would people want/need to post jobs only to
> boston.pm? you could just state boston as the location and onsite and
> probably get a larger number of applicants. i would expect any boston.pm
> members looking for work (or interested in keeping tabs on the market)
> to be subscribed to that list or peruse the web site regularly.

What about people who didn't know they were looking for work until they
see the job of their dreams on boston-pm?

(darren)

-- 
I have discovered that all human evil comes from this, man's being
unable to sit still in a room.
-- Blaise Pascal


pgp0.pgp
Description: PGP signature
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Why is the mailinglist for Boston-pm Python Powered?

2004-01-07 Thread darren chamberlain
* Steven W. Orr  [2004/01/07 14:03]:
> The best mailinglist manager is Majordomo2 (Not to be confused with 
> Majordomo). It's written in perl and it's absolutely mahvelous.

Actually, the best mailing list manager is siesta
(), which is also written in Perl, and
being actively developed.  Mariachi, the uber-groovy archiver (see, for
an example, ),
is part of the siesta project.

But the question (why Mailman?) is a valid one...

> So what happens when some poor schlub (yeah you Charlie) subscribes to
> the Boston Perl Mongers? He gets a screen that sez that it's all
> python powered!

I agree.

(darren)

-- 
Money is better than poverty, if only for financial reasons.
-- Woody Allen


pgp0.pgp
Description: PGP signature
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] OT:Safari Bookshelf

2003-12-30 Thread darren chamberlain
* James Freeman  [2003/12/30 16:05]:
> Anyone on the list have direct experience with O'Reilly's Safari 
> Bookshelf?

+1

(darren)

-- 
In the fight between you and the world, back the world.


pgp0.pgp
Description: PGP signature
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] [Fwd: perl needs your support]

2003-12-09 Thread darren chamberlain
* Sean Quinlan  [2003/12/09 11:43]:
> ... I also digitally sign my email, which I don't think a virus is
> capable of???

A virus can be capable of *appearing* to sign a message, but only those
who actually verify signatures will tell if the signature was OK.  In
the past, I've had a few messages slip past SpamAssassin (spam, not
viruses) because they included fake PGP signature lines -- SA saw the
presence of a signature -- as opposed to a valid signature -- and upped
the score appropriately.

I haven't seen any spam imitate a detatched signature like yours,
however, only inline signatures.

(darren)

-- 
Hard as it is to believe, sometimes bloody, proletariat revolution
just isn't the answer.  Like in Algebra class, for example.
-- Don Swain


pgp0.pgp
Description: PGP signature
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Request Guidance with LWP newbie???

2003-11-13 Thread darren chamberlain
* Bob Mariotti  [2003-11-13 13:57]:
> Can any of you in the know kindly point me to a good thorough
> reference or perhaps itemize a few pointers to accomplishing this
> and/or working with lwp?

First of all, have you seen Sean Burke's "Perl & LWP" book[0]?  I don't
think it covers SSL and https, but it covers LWP very thoroughly.

(darren)

[0] http://www.oreilly.com/catalog/perllwp/

-- 
I'm astounded by people who want to 'know' the universe when it's hard
enough to find your way around Chinatown.
-- Woody Allen


pgp0.pgp
Description: PGP signature
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Tk question.

2003-08-14 Thread darren chamberlain
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* Timothy Kohl  [2003-08-07 08:17]:
> I am trying to set up an associative array 
> where the values are method calls (specifically 
> widget creation calls) for Tk.

You want a dispatch table, with the keys pointing to subroutine
references.

  %Valid = (
  hostname => sub {
  my $obj = shift;
  $obj->Entry(width => 30,
  background=> 'darkgreen',
  -textvariable => \$curval{'hostname'},
  );
  },
  # and others
  );

You would then invoke them as something like:

  my $sub = $Valid{'hostname'};
  $prop{'hostname'} = $sub->($rightframe)->pack(side => 'right');

This creates references to anonymous subroutines as the values of %Valid
that are expecting a Tk object (a Frame, in this case).  The subrefs
take the object as an argument (that's the $sub->($rightframe) syntax,
which will need to be spelled $($rightframe) if you are using an
pre-5.005 Perl).

In the 'hostname' example, this returns whatever $rightframe->Entry()
returns, which you can then call pack on (presumably).

You could even make it a little more extensible like this:

  %Valid = (
  hostname => sub {
  my $obj = shift;
  $obj->Entry(width => 30,
  background=> 'darkgreen',
  -textvariable => \$curval{'hostname'},
  @_,
  );
  },
  # and others
  );
  
The addition of @_ in the call to $obj->Entry means you can pass extra
arguments to it:

  $prop{'hostname'} =
$sub->($rightframe, other => 'arg')->pack(side => 'right');

And other => 'arg' will be passed to Entry as well (sorry about the
useless example, I don't have Tk installed to find a real argument).

(darren)

- -- 
The higher we soar the smaller we appear to those who cannot fly.
-- Friedrich Nietzsche
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: This message is digitally signed and can be verified for authenticity.

iD8DBQE/Mk2ozsinjrVhZaoRAgC8AJ9ltTbz6yN4kob/Co+2nmDMNmGK+wCfaYIv
kxof0vFBrltFF67PWLxg8zI=
=6U5a
-END PGP SIGNATURE-
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] emacs discussion

2003-07-10 Thread darren chamberlain
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* Erik Price  [2003-07-10 08:24]:
> On Wednesday, July 9, 2003, at 10:20  PM, Chris Devers wrote:
> > I wish I could think of better metaphors for this, because
> > intuitively it seems clear to me that there are plenty of examples
> > of things that are very complex and yet still not necessarily
> > challenging.
> 
> Python?

I would disagree with that -- Python is not complex, Python is
almost pathologically simple-minded.  It's this simplicity that makes it
possible to do complex things with it, but the language itself is not
complex.

(darren)

- -- 
If you think C++ is not overly complicated, just what is a protected
abstract virtual base pure virtual private destructor, and when was
the last time you needed one?
-- Peter van der Linded
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/DV8izsinjrVhZaoRApFjAJ934+BvWRcjMt1Hi4RA4hUgkIGy3wCfcIkV
ssKH1auNjLq51ORGZp43hd8=
=X9n5
-END PGP SIGNATURE-
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] emacs discussion

2003-07-09 Thread darren chamberlain
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* David Cantrell  [2003-07-09 13:55]:
> On Tuesday, July 8, 2003 21:48 -0400 William Goedicke
> <[EMAIL PROTECTED]> wrote:
> 
> >Dear Y'all -
> >
> >One thing that always confuses me about the emacs debate is the
> >functionality vs. cost question.  [X]emacs is nigh ultimately
> >functioal and free.
> 
> emacs is "only free if your time is worthless".  To get at that
> functionality involves a significant investment in time.

For me, that time was college.  And it lasted into the first job I had
where I was using Unix -- which was a stock Solaris 2.x machine.  That
was when I picked up vi, out of necessity at first; I mastered more of
vi over the course of those three years than I had mastered of emacs in
the entire 7 years that I considered myself an emacs user.

(darren)

- -- 
One cannot make an omelette without breaking eggs -- but it is amazing
how many eggs one can break without making a decent omelette.
-- Professor Charles P. Issawi
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/DFjIzsinjrVhZaoRAsxdAJ9q7UFDgk8O2ImVv61SiUvTiZcz2gCfXKly
B0K2/qn5k/HaCqiYn8KcUZ0=
=WWU/
-END PGP SIGNATURE-
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] .Net platform and Perl - feedback please

2003-07-03 Thread darren chamberlain
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* Chris Ball  [2003-07-03 08:45]:
> You can see how this creates problems for a Perl or Python port, too.
> When $a goes from being an IV to an PV, what do we do with the local
> variable preamble?

Why wouldn't you simply declare $a as an SV?

(darren)

- -- 
Neckties strangle clear thinking.
-- Lin Yutang
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/BCt5zsinjrVhZaoRAu5kAJ0S/J1nvZPw7LySjzaebVFvIlbIZwCfVQ1/
OqTTm/5O7Weqv/VeKxeKQuo=
=FWmm
-END PGP SIGNATURE-
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Komodo vs. emacs

2003-07-02 Thread darren chamberlain
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* Mikey Smelto  [2003-07-02 16:29]:
> My problem with Komodo was that it was slow. I have a P4 1.5Ghz with
> 768 MB of ram, and it took a long time to call it up.  Yes I was
> running the windows version.  But darren and the vi army have speed on
> their side.  so i joined that army.

Resistance is futile.  You will be assimilated.

(darren)

- -- 
To me vi is Zen.  To use vi is to practice zen.
Every command is a koan.  Profound to the user,
unintelligible to the uninitiated.  You discover
truth everytime you use it.
-- Reddy
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/A0KMzsinjrVhZaoRAq7IAKCGt7UgeeCr8JE33+u0fOfvrcuHpwCaA8Ez
+Zajjem361/Ukj+JxKnSBi0=
=acAa
-END PGP SIGNATURE-
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Komodo vs. emacs

2003-07-02 Thread darren chamberlain
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* Greg Marr  [2003-07-02 10:26]:
> At 09:42 AM 7/2/2003, darren chamberlain wrote:
> >My complaint with emacs' indenting isn't that it's the wrong amount
> >but that by default it mixes tab and space characters, which are not
> >the same thing.
> 
> Since it took me 12 years to find out about this option, I figure this
> is a good time to pass it along for anyone else who doesn't want tabs
> in their files.

It took me about that long too, and I found it about four years after
moving to vi.

(darren)

- -- 
How you look depends on where you go.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/AvLTzsinjrVhZaoRAg6cAJ9KWNUnucF6S4p5WS59kR8Fmt8tKQCgiv3s
JwCWdluUjg+NpJ+kjg43R7c=
=ez0t
-END PGP SIGNATURE-
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] DBI question

2003-06-18 Thread darren chamberlain
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* Joel Gwynn  [2003-06-18 09:28]:
> The problem is not so much that I can't connect, the problem is that
> if I can't, I don't want to return the db credentials to the browser.
> How can I turn this off?

I assume you're wrapping this in an eval, and the error message is in
[EMAIL PROTECTED]  $@ is just a string, so you can run it through a s/// to get rid of
the credentials before displaying the error message.  Maybe something
like:

  my $err = $@;
  for (qw( PROVIDER SERVER UID PWD DATABASE )) {
  $err =~ s/($_=)(.+?)([;'])/$1 . '*' x length($2) . $3/ge;
  }
  # Now, use $err instead of $@

With your example, $err will hold something like:

  DBI->connect(PROVIDER=;SERVER=;UID=***;PWD=***;DATABASE=
  mydb) failed: Can't connect to
  'PROVIDER=;SERVER=;UID=***;PWD=***;DATABASE=':
  Lasterror:   -2147217843: OLE exception from "Microsoft OLE DB
  Provider for SQL Server":

(Although this still has a security hole -- it betrays the lengths of
the elements you are hiding.)

(darren)

- -- 
I have discovered that all human evil comes from this, man's being
unable to sit still in a room.
-- Blaise Pascal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+8GtLzsinjrVhZaoRAmMxAJ4+DPwqetQ0q/5cvH6FL2S7VSInawCff3aW
btUogbJ3NXItB7HSpMceyL4=
=QUnp
-END PGP SIGNATURE-
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] tcl-perl-unix problem

2003-03-25 Thread darren chamberlain
* Greg London  [2003-03-25 15:31]:
> The original script had a line that said this:
> 
> >if {[catch {exec rsh $linuxMachine "cd $pwd/test/c/$testName; \
> > make $makeparam >&! log/make.log"} result]} {  ;# exec error
> > error "\n >>> Can't execute make:\n >>> '$result'\n\n"
> 
> which I translated into this in perl:
> 
> > my $make_command = 
> >  "rsh $linuxMachine "
> > ."cd $pwd/test/c/$testName;"
> > ."make $makeparam >&! log/make.log";
> >
> > my $retval = syscmd($make_command);
> >
> > if ($retval) 
> 
> when I run the perl version, I get this:
>sh: !: bad number

The >&! is csh syntax, not sh.  You'll need to change that to 2>&1 or
invoke system as system("csh -c '$make_command'");

(darren)

-- 
If history teaches us anything, it's that everyone will be part of the
problem, but not everyone will be part of the solution.
-- Larry Wall


pgp0.pgp
Description: PGP signature


Re: [Boston.pm] Email filtering...

2003-02-11 Thread darren chamberlain
* Ron Newman  [2003-02-11 12:42]:
> On Tuesday, February 11, 2003, at 12:23  PM, Gyepi SAM wrote:
> > I don't see how '*@*.aol.*' can match '[EMAIL PROTECTED]'.  How do you
> > account for the first '.' in the match expression?
> 
> For that matter, can a regular expression validly begin with "*" at
> all?  What does that mean?
> 
> And why would you want to match a string of zero or more @ characters?

I took those to be glob-type expansions, not regexes, so '*' means 0 or
more characters, '.' is a literal ., and so on.

(darren)

-- 
Millions long for immortality who do not know what to do with
themselves on a rainy Sunday afternoon.
-- Susan Ertz
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] Email filtering...

2003-02-11 Thread darren chamberlain
* Simon Wilcox  [2003-02-11 10:47]:
> We can actually use CPAN modules (as long as they are pure perl) but
> we need to distribute them as part of the code.

Well, then, bundle in Email::Valid, because it's wonderful, and is (more
or less) the definitive way to do what it does.

(darren)

-- 
Elegance and truth are inversely related.
-- Becker's Razor
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] Email filtering...

2003-02-11 Thread darren chamberlain
* Wizard  [2003-02-11 10:17]:
> > Why not use Email::Valid?
> 
> As I said in another email, this is for NMS, so I can't use anything that
> doesn't come with the standard 5.0004(?) perl.

Ah, I see.  OK, then, I have a small module (Email.pm) that rips off
from Email::Valid (I think, or it might have been an old version of
Email::Find), which I'll attach.  It uses a large part of Jeffrey
Friedl's RFC822 regex.  It will probably do what you want:

  use Email; # make a better package name
  my $e = Email->new('Wizard <[EMAIL PROTECTED]>');

  print $e->user;   # wizard
  print $e->host;   # neonedge.com

  # To validate chunks of an address:
  my @hostpieces = split /\./, $e->host;

It requires 5.005 (it uses qr), not 5.004.

(darren)

-- 
Maybe that's the only truth in the world.  Not the Bibles or poetry or
philosophy but just the old jokes.
-- Robert Shea and Robert Anton Wilson



Email.pm
Description: Perl program


Re: [Boston.pm] POSIX strftime...

2003-02-05 Thread darren chamberlain
* Wizard  [2003-02-05 10:53]:
> I'm working on a script for NMS, and I've encountered a problem. It's likely
> just me, but for some reason the '%T' and '%R' format specifiers don't seem
> to be working under Win2k, yet the '%H:%M' specifiers work. I've tried both
> cygwin perl 5.6.1 and ActivePerl 5.6.1.

%T and %R are part of the Single Unix spec, not POSIX, therefore
Windows' POSIX library probably doesn't have them.  The only workaround
is to use what they are shortcuts for.

(darren)

-- 
An idea is not responsible for the people who believe in it.
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] Job listings by programming language

2003-01-07 Thread darren chamberlain
* John Tobey <[EMAIL PROTECTED]> [2003-01-07 09:36]:
> Btw, the sharp drop in C++ around 10/2002 smacks of a change in
> statistics gathering methods.

Yep: 

  What happened on Oct 22, 2002 to cause that huge spike of more than
  3500 listings?

  A few weeks before that date, dice.com modified their site. If you
  remember, they launched a redesign in early October. (Anyone remember
  the exact date?) I thought I had adjusted for it the day it happened,
  but I was wrong. What they had done, I since learned, was forked their
  database. The "old" database was still up and running, but no new
  listings were being posted to it, and their site didn't point to it
  anymore. As time passed, the listings that were in the database at the
  time started expiring out and the number of listings started to fall.

  After investigating the issue, that's when I realized the database I
  was querying was no longer thier "live" database -- the one that was
  getting the new listings. I adjusted my polling routine to poll the new,
  live database.

  The huge spike on Oct 22, was the data being re-aligned with the
  dice.com database. Unfortunately, this means that for a few weeks prior
  to that date, each day represents an incremental diversion from reality.

  I now do an eyeball check every couple of days to compare the number
  of overall listings, just to be sure it doesn't happen again.

  You'll also note that's when I was able to start tracking C# and C++
  separately. Dice.com improved their search engine to support that. So,
  there is that one plus. 


(darren)

-- 
I look for what needs to be done After all, that's how the
universe designs itself.
-- R. Buckminster Fuller
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] Job listings by programming language

2003-01-07 Thread darren chamberlain
* Joel Gwynn <[EMAIL PROTECTED]> [2003-01-07 08:18]:
> Here's an interesting graph.  While demand for perl has never been as
> high as demand for other languages (C++, Java, etc.), the demand has not
> petered off as much as those languages.
> 
> http://mshiltonj.com/sm/categories/languages/

I find the assembly numbers to be slightly bizarre -- were there no job
listings for assembly over the last month, or did skillmarket begin
keeping track on 01/06/2003?  To go from 0 listings to 493 in two days
seems like an error, to me.

(darren)

-- 
I don't mow lawns for the reason that I don't shave.
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] OT: Favorite Mac OS X utilities

2003-01-02 Thread darren chamberlain
* Dan Sugalski <[EMAIL PROTECTED]> [2003-01-02 14:08]:
> At 1:31 PM -0500 1/2/03, Drew Taylor wrote:
> > I know everyone raves about mutt, and will probably look into it at 
> > some point. But it seems strange to be using a text-oriented mail 
> > program in one of the prettiest GUI's available. ;-) I also wonder 
> > if Mail.app is the best available GUI email program for OS X.
> 
> I've not used Mail.app, but I do use Eudora. As mail clients go, it's 
> pretty nice, and free (Which is a good thing) if you don't mind a 
> small and unobtrusive ad window. (Or reduced functionality)

Since he's already using Eudora on Windows ("at work", or so he claims ;),
that might be a pretty painless switch.

(darren)

PS I don't *really* have anything interesting to say in this message,
   but thought I did when I started it; but when my random sig generator
   produced what it did, I felt I had to at least send it along...

-- 
Remember, any design flaw you're sufficiently snide about becomes a
feature.
-- Dan Sugalski
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] OT: Favorite Mac OS X utilities

2003-01-02 Thread darren chamberlain
* Drew Taylor <[EMAIL PROTECTED]> [2003-01-02 11:06]:
> X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9
>
> I've recently gotten a Mac OS X (10.2.3) box up & running.

Not using it yet, though, huh?  :)

> 2. What are your favorite/must have utilities?
> 3. Are you using Mail for email? Plusses & minuses are welcome.

I'm not a Mac user, so I don't have any OS X-specific advice, but
remember that all/most of your favorite Unix utilities will run under OS
X -- be sure to include some of the better ones in your considerations.

For example, mutt -- the best MUA available, bar none -- will work just
fine under OS X.

(darren)

-- 
An operating system is just a name you give the features you left out
of your editor.
-- Per Abrahamsen in comp.emacs
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] for loop iterator variable -- !?

2002-11-21 Thread darren chamberlain
* Andrew M. Langmead <[EMAIL PROTECTED]> [2002-11-21 23:51]:
> This would be an odd place to look to for efficiency.

Maybe an odd place to look to make a script run more efficiently, but I
personally find I have to think harder about $#array than about scalar
@array, so the latter is more efficient for me as a programmer.  But
$#array scares away Python weenies ("too much punctuation"), so maybe
there's some value there... :)

Yes, I know I brought up $#array initially.  Too bad it isn't possible
to un-send a message with SMTP.

> Anyone who wants to disagree with me can discuss it over coffee
> tomorrow in boston.com's kitchen. The usual time.

I'd be worried that we'd have a flood of Perl Mongers in the kitchen, if
only this was an interesting topic.

(darren)

-- 
Any technology distinguishable from magic is insufficiently advanced.
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] for loop iterator variable -- !?

2002-11-21 Thread darren chamberlain
* Erik Price <[EMAIL PROTECTED]> [2002-11-21 22:37]:
> On Sunday, December 8, 2002, at 11:56  PM, Komtanoo Pinpimai wrote:
> 
> > you see? It is not elegant.. has perl this iterator variable ?
> 
> Man!  And I thought one of the nice things about Perl was you didn't 
> have to use an Iterator to traverse a List!

The cool thing about Perl is that you can use it to implement first
class iterators in your mini-languages:

  [% FOREACH num = [ 1 2 3 4 ] %]
* [% num %] ([% loop.count %] of [% loop.size %])
  [% END %]

In this example, using Template Toolkit, I is the iterator.

(darren)

-- 
Think like a man of action, act like a man of thought.
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] for loop iterator variable -- !?

2002-11-21 Thread darren chamberlain
* Erik Price <[EMAIL PROTECTED]> [2002-11-21 22:20]:
> Or don't even bother with $#array since "$n <= @array" forces scalar
> context to the array, which causes it to interpolate to the number of
> elements.
> 
> Terser, quicker, more seductive.  Such is the way of the dark side of
> Perl programming.  (Even if by only one char.)

It's also (slightly) faster -- the value for $#array is stored in it's
own slot in the AV, which has to be filled in when $#array is
referenced, which it does by (effectively) doing scalar @array, but it's
not stored until it is asked for.

Also, note that 

  $n <= $#array

and 

  $i <= @array

are not equivalent:  @array == $#array + 1

(darren)

-- 
The Earth quakes and the heavens rattle; the beasts of nature flock
together and the nations of men flock apart; volcanoes usher up heat
while elsewhere water becomes ice and melts; and then on other days it
just rains.
-- Principia Discordia
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] for loop iterator variable -- !?

2002-11-21 Thread darren chamberlain
* Bob Rogers <[EMAIL PROTECTED]> [2002-11-21 09:38]:
>  From: darren chamberlain <[EMAIL PROTECTED]>
>  Date: Thu, 21 Nov 2002 09:17:11 -0500
> > * Chris Devers <[EMAIL PROTECTED]> [2002-11-20 16:19]:
> > > On Wed, 20 Nov 2002, darren chamberlain wrote:
> > > > I think the answer is to use a C-style for loop:
> > > >
> > > >   for (my $i = 0; $i < $#array; $i++) {
> > > >   # $i is your "iterator"
> > > >   # $array[$i] is the "current" element
> > > . . .
> > > Is there any significant difference, beyond style preference?
> >
> > My C-style for loop (above) is identical to:
> >
> >   my $iterator = 0;
> >   while ($iterator < $#array) {
> >   $iterator++;
> >   do "stuff";
> >   }
> >
> > . . .
> 
> Not quite.  It looks like the 'while' loop skips element 0, but the
> 'for' version skips the last one.  I tend to prefer "$i < @array" over
> "$i <= $#array" in loop tests, because I think it is more natural and
> less prone to such problems.

Yes, the while condition needs to be either <= $#array or < @array, but
the while loop only skips element 0 only because the body of the loop
(the *example*) isn't robust (I thought that do "stuff" would be a clue
;).  Move the incrementation to the end, and fix the conditional, and it
Does The Right Thing:

  my @array = qw(1 2 3 4 5);
  my $iterator = 0; 
  while ($iterator < @array) {
  print "\$array[$iterator] => $array[$iterator]\n";
  $iterator++;
  }

Gives:

  $array[0] => 1
  $array[1] => 2
  $array[2] => 3
  $array[3] => 4
  $array[4] => 5

(darren)

-- 
I accept chaos. I'm not sure whether it accepts me. I know some people
are terrified of the bomb. But then some people are terrified to be
seen carrying a modern screen magazine. Experience teaches us that
silence terrified people the most.
-- Bob Dylan
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] for loop iterator variable -- !?

2002-11-21 Thread darren chamberlain
* Chris Devers <[EMAIL PROTECTED]> [2002-11-20 16:19]:
> On Wed, 20 Nov 2002, darren chamberlain wrote:
> > I think the answer is to use a C-style for loop:
> >
> >   for (my $i = 0; $i < $#array; $i++) {
> >   # $i is your "iterator"
> >   # $array[$i] is the "current" element
> 
> What is the advantage of that over something like:
> 
>   my $iterator = 0;
>   foreach my $elem (@array) {
>  $iterator++;
>  # do stuff on $elem, which seems like it would
>  # be the same thing as $array[$iterator] but not
>  # necessarily the same as $otherarray[$iterator]
>   }

Well, the first (C-style) is going away in Perl 6, right?

> These look roughly equivalent to me.
> 
> Is there any significant difference, beyond style preference?


My C-style for loop (above) is identical to:

  my $iterator = 0;
  while ($iterator < $#array) {
  $iterator++;
  do "stuff";
  }

Which is, I think, how it is implemented internally (I'm sure Dan will
correct me if this is not correct).

(darren)

-- 
Whatever is done for love is beyond good and evil.
-- Friedrich Neitzsche
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] for loop iterator variable -- !?

2002-11-20 Thread darren chamberlain
* Chris Devers <[EMAIL PROTECTED]> [2002-11-20 15:25]:
> foreach $i (@array) {
> # do something with $i
> 
> # then if appropriate...
> print $another_array[$i];

But $i is an element of the array, not an integer to be used as an
offset, most likely.

> # or, perhaps better, perhaps not, use a hash:
> print $another_hash{$i};
> }

I think the answer is to use a C-style for loop:

  for (my $i = 0; $i < $#array; $i++) {
  # $i is your "iterator"
  # $array[$i] is the "current" element

  ...

(darren)

-- 
Everything you've learned in school as `obvious' becomes less and less
obvious as you begin to study the universe. For example, there are no
solids in the universe. There's not even a suggestion of a solid.
There are no absolute continuums. There are no surfaces. There are no
straight lines.
-- R. Buckminster Fuller
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] Calling regex gurus ..A regex question..

2002-10-11 Thread darren chamberlain

* Ranga Nathan <[EMAIL PROTECTED]> [2002-10-11 13:42]:
> I need to parse a string that has multiple occurrences of a pattern
> that is determined by an embeded count. For example:
> 
> 02 s1n1 s1n2 3 s2n1 s2n2 s2n3 1 s3n1 4 s4n1 s4n2 s4n3 s4n4
> 
> 02 is the count and I need to extract s1n1 and s2n2
> 
> 3 is the count and  I need to extract s2n1, s2n2 and s2n3

Don't use a regex:

  my $s = "02 s1n1 s1n2 3 s2n1 s2n2 s2n3 1 s3n1 4 s4n1 s4n2 s4n3 s4n4";
  my @s = split /\s+/, $s;
  my @all = ();  # holds the answer

  while (@s) {
  my $num = shift @s;
  my @inner; 
  for (1 .. int($num)) {
  push @inner, shift @s
  }
  push @all, \@inner;
  }

  print Dumper(\@all);

Gives:

$VAR1 = [
  [
's1n1',
's1n2'
  ],
  [
's2n1',
's2n2',
's2n3'
  ],
  [
's3n1'
  ],
  [
's4n1',
's4n2',
's4n3',
's4n4'
  ]
];

$s is the original string, @s is the split string, and @all is the list.
You'll probably want to do something other thanb push @all and print
Dumper(), of course...

(darren)

-- 
In the fight between you and the world, back the world.
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] $/ and pattern matching

2002-09-24 Thread darren chamberlain

* Erik Price <[EMAIL PROTECTED]> [2002-09-23 17:30]:
> Anyone know of a way to get a regular expression to respect the input 
> record separator ( $/ ), so that "$" represents the end of a line as 
> defined by $/ ?

I'd do it a little differently:

  local $/;
  my $mileage;
  my @milage = split //, ; # <-- the string with your data

  for (@milage) {
  if (m/(\d+\.\d{1,2})$/) {
  $mileage += $1;
  }
  }

  print "$mileage total miles\n";

  __DATA__
  1.  Start on MILL ST 0.02.  Bear Left on MAIN ST 3.23.  
  Continue on KENDALL RD 0.34.  Take the US-3 SOUTH ramp towards 
  BOSTON/LOWELL 0.45.  Merge on US-3 SOUTH 18.7

This gives 22.6, which is what bc tells me.

(darren)

-- 
It's not that things are getting worse, it's just that news
reporting is getting better.
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm