From shanehill00 at gmail.com Fri Apr 1 01:14:34 2005 From: shanehill00 at gmail.com (Shane Hill) Date: Fri Apr 1 01:14:42 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <200503312205.52882.josh@agliodbs.com> References: <7637e21505033118035f6a057c@mail.gmail.com> <20050401024414.GC3674@fetter.org> <7637e21505033119413988ac40@mail.gmail.com> <200503312205.52882.josh@agliodbs.com> Message-ID: <7637e215050401011416e741cf@mail.gmail.com> > Um, you're not using the OID as your key, are you? That's no longer > supported ... no sir, I am just using it in the query to retrieve object info that was just inserted. like so: SELECT * FROM table WHERE oid = 37; is there an issue with doing that as well? I am using the latest 7xx, have not tried 8xx yet. good night all, -Shane From shanehill00 at gmail.com Fri Apr 1 08:03:56 2005 From: shanehill00 at gmail.com (Shane Hill) Date: Fri Apr 1 08:04:06 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <20050401045614.GA21529@fetter.org> References: <7637e21505033118035f6a057c@mail.gmail.com> <20050401024414.GC3674@fetter.org> <7637e21505033119413988ac40@mail.gmail.com> <20050401045614.GA21529@fetter.org> Message-ID: <7637e215050401080354d0cd61@mail.gmail.com> > > > > I tried both 'public' and my username and I get the same result. > > nada. > > Does the above work for you? it does not. I created the exact same table that is in your example and used your script without editing it and voila! I get "d00d! wtf?!?" but no id. wah. my client is using 7.4.5 and does not want to go to 8.0.1. I see that you used 8.0.1. Could this be the problem? have you tried your script on a 7xx server? I have not looked yet, but is there a way to retrieve the name of the sequence associated with the serial column in a table? This way I could just hide the details of getting the seq name, call curr_val and maintain the clean data interface I have been using. thanks for your help, I really appreciate it. -Shane > > > > Anyhow, I'm puzzled, but I have a fix. After > > > you've checked whether the INSERT succeeded (you're doing that anyway, > > > RIGHT?!? ;) just do: > > > > > > SELECT currval('the_name_of_the_appropriate_seq'); > > > > > > Not quite as convenient, and I've got a query in to the DBD::Pg dev > > > team, but it will work. > > > > not convenient at all and yes I am checking for errors. I have been > > doing this successfully for years with the Pg module / class using: > > > > $result->oidStatus > > I suspect that Pg gets less maintenance than DBD::Pg. > > > but I switch to the DBI in an effort to "standardize" my code and my > > system takes a steaming dump on me. lovely. > > Bummer. It works at least one place. Let's see about getting it > working for you :) > > Cheers, > D > -- > David Fetter david@fetter.org http://fetter.org/ > phone: +1 510 893 6100 mobile: +1 415 235 3778 > > Remember to vote! > From david at fetter.org Fri Apr 1 08:10:47 2005 From: david at fetter.org (David Fetter) Date: Fri Apr 1 08:11:01 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <7637e215050401011416e741cf@mail.gmail.com> References: <7637e21505033118035f6a057c@mail.gmail.com> <20050401024414.GC3674@fetter.org> <7637e21505033119413988ac40@mail.gmail.com> <200503312205.52882.josh@agliodbs.com> <7637e215050401011416e741cf@mail.gmail.com> Message-ID: <20050401161047.GB21529@fetter.org> On Fri, Apr 01, 2005 at 01:14:34AM -0800, Shane Hill wrote: > > Um, you're not using the OID as your key, are you? That's no > > longer supported ... > > no sir, I am just using it in the query to retrieve object info > that was just inserted. like so: > > SELECT * FROM table WHERE oid = 37; > > is there an issue with doing that as well? I am using the latest > 7xx, have not tried 8xx yet. Oid is deprecated and will eventually be removed, as it is not guaranteed to be unique, so it would be a Good Thing(TM) to get it out of your code. Cheers, D -- David Fetter david@fetter.org http://fetter.org/ phone: +1 510 893 6100 mobile: +1 415 235 3778 Remember to vote! From danlyke at flutterby.com Fri Apr 1 08:10:56 2005 From: danlyke at flutterby.com (Dan Lyke) Date: Fri Apr 1 08:12:06 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <20050401024414.GC3674@fetter.org> References: <7637e21505033118035f6a057c@mail.gmail.com> <20050401024414.GC3674@fetter.org> Message-ID: <16973.29329.161449.401241@flutterby.com> David Fetter writes: > SELECT currval('the_name_of_the_appropriate_seq'); > > Not quite as convenient, and I've got a query in to the DBD::Pg dev > team, but it will work. My "Oh crap I'm going to be cleaning that code up someday" filter just kicked in... I'm a really strong proponent of wrapping insert statements in a function which takes a tablename and a set of key-value pairs, and returns an ID. For MySQL and SQLite I do the insert and then get the last insert ID, for PostgreSQL I do a: SELECT NEXTVAL('table_id_seq') And insert with that value. If you have multiple users of the database (ala, say, a web app), doing the SELECT CURRVAL('table_id_seq') allows for another insert to sneak in between your insert and the select. From shanehill00 at gmail.com Fri Apr 1 08:52:39 2005 From: shanehill00 at gmail.com (Shane Hill) Date: Fri Apr 1 08:52:48 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <16973.29329.161449.401241@flutterby.com> References: <7637e21505033118035f6a057c@mail.gmail.com> <20050401024414.GC3674@fetter.org> <16973.29329.161449.401241@flutterby.com> Message-ID: <7637e21505040108524ec9c63d@mail.gmail.com> Dan said: > For MySQL and SQLite I do the insert and then get the > last insert ID, yup. and the docs state that the last_insert_id should work for postgres but it does not, AFAICT, for the 7.x.x servers. I will try 8 today. > for PostgreSQL I do a: > > SELECT NEXTVAL('table_id_seq') > > And insert with that value. yeah, I used to do that, but then I switched to retrieving the oid after I inserted. I would then just select on the oid to retrieve my object data. I am trying to get migrated to the DBI entirely and I have done it except for this one issue. I am sure I will prevail. thanks, -Shane From josh at agliodbs.com Fri Apr 1 08:56:10 2005 From: josh at agliodbs.com (Josh Berkus) Date: Fri Apr 1 08:57:03 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <16973.29329.161449.401241@flutterby.com> References: <7637e21505033118035f6a057c@mail.gmail.com> <20050401024414.GC3674@fetter.org> <16973.29329.161449.401241@flutterby.com> Message-ID: <200504010856.10371.josh@agliodbs.com> Dan, > If you have multiple users of the database (ala, say, a web app), > doing the > > ? ?SELECT CURRVAL('table_id_seq') > > allows for another insert to sneak in between your insert and the > select. Only if those multiple users share a database connection (e.g. multi-threaded app). CURRVAL is session-specific. -- Josh Berkus Aglio Database Solutions San Francisco From josh at agliodbs.com Fri Apr 1 09:00:41 2005 From: josh at agliodbs.com (Josh Berkus) Date: Fri Apr 1 09:01:33 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <7637e21505040108524ec9c63d@mail.gmail.com> References: <7637e21505033118035f6a057c@mail.gmail.com> <16973.29329.161449.401241@flutterby.com> <7637e21505040108524ec9c63d@mail.gmail.com> Message-ID: <200504010900.41507.josh@agliodbs.com> Shane, > yup. and the docs state that the last_insert_id should work for > postgres but it does not, AFAICT, for the 7.x.x servers. I will try 8 > today. I also think I can give you query text that allows you to get a sequence id from a table name. Let me poke around my 7.4.7 server a bit. -- Josh Berkus Aglio Database Solutions San Francisco From david at fetter.org Fri Apr 1 09:10:06 2005 From: david at fetter.org (David Fetter) Date: Fri Apr 1 09:10:19 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <7637e215050401080354d0cd61@mail.gmail.com> References: <7637e21505033118035f6a057c@mail.gmail.com> <20050401024414.GC3674@fetter.org> <7637e21505033119413988ac40@mail.gmail.com> <20050401045614.GA21529@fetter.org> <7637e215050401080354d0cd61@mail.gmail.com> Message-ID: <20050401171006.GC21529@fetter.org> On Fri, Apr 01, 2005 at 08:03:56AM -0800, Shane Hill wrote: > > > > > > I tried both 'public' and my username and I get the same result. > > > nada. > > > > Does the above work for you? > > it does not. I created the exact same table that is in your example > and used your script without editing it and voila! I get "d00d! > wtf?!?" but no id. wah. > > my client is using 7.4.5 and does not want to go to 8.0.1. I see that > you used 8.0.1. Could this be the problem? have you tried your script > on a 7xx server? I don't have a 7xx server handy, but your client *needs* to upgrade to 7.4.7 because of known crash/data loss bugs in previous versions in the 7.4 series. Oh, and 8x is very nice. :) > I have not looked yet, but is there a way to retrieve the name of > the sequence associated with the serial column in a table? This way > I could just hide the details of getting the seq name, call curr_val > and maintain the clean data interface I have been using. I dug this out of the system catalogs with the help of psql -E. This is probably why people like to use abstraction layers ;) SELECT (string_to_array(d.adsrc, '\''))[2] FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON ( c.relname = 'foo_tab' AND c.oid = a.attrelid ) JOIN pg_catalog.pg_attrdef d ON ( d.adsrc LIKE 'nextval%' AND d.adrelid = a.attrelid AND d.adnum = a.attnum ) ; > thanks for your help, I really appreciate it. Hope this does. Oh, and try talking your client into upgrading to 8.0x :) Cheers, D -- David Fetter david@fetter.org http://fetter.org/ phone: +1 510 893 6100 mobile: +1 415 235 3778 Remember to vote! From josh at agliodbs.com Fri Apr 1 09:15:46 2005 From: josh at agliodbs.com (Josh Berkus) Date: Fri Apr 1 09:16:44 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <20050401171006.GC21529@fetter.org> References: <7637e21505033118035f6a057c@mail.gmail.com> <7637e215050401080354d0cd61@mail.gmail.com> <20050401171006.GC21529@fetter.org> Message-ID: <200504010915.46666.josh@agliodbs.com> David, > I don't have a 7xx server handy, but your client *needs* to upgrade to > 7.4.7 because of known crash/data loss bugs in previous versions in > the 7.4 series. ? Actually, the stuff in 7.4.6 was pretty minor, and 7.4.7 was strictly a security fix. Not that Shane *shouldn't* upgrade, but he can probably wait for a convenient 5min of downtime. > Oh, and 8x is very nice. :) Yes. -- Josh Berkus Aglio Database Solutions San Francisco From shanehill00 at gmail.com Fri Apr 1 09:21:24 2005 From: shanehill00 at gmail.com (Shane Hill) Date: Fri Apr 1 09:21:32 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <200504010900.41507.josh@agliodbs.com> References: <7637e21505033118035f6a057c@mail.gmail.com> <16973.29329.161449.401241@flutterby.com> <7637e21505040108524ec9c63d@mail.gmail.com> <200504010900.41507.josh@agliodbs.com> Message-ID: <7637e215050401092141ee464e@mail.gmail.com> Thanks Josh , I have thought of a couple ways to do what I need, but they are a bit hokey and brute force, not my style. Actually, there a numerous ways to do what I need, but I am very anal about having a clean object interface and I want this to remain elegant. If you have some slick sql that will give me the seq name, I will go out and immediately buy your poster and put it on my wall. You do have a poster, don't you? -Shane On Apr 1, 2005 9:00 AM, Josh Berkus wrote: > Shane, > > > yup. and the docs state that the last_insert_id should work for > > postgres but it does not, AFAICT, for the 7.x.x servers. I will try 8 > > today. > > I also think I can give you query text that allows you to get a sequence id > from a table name. Let me poke around my 7.4.7 server a bit. > > -- > Josh Berkus > Aglio Database Solutions > San Francisco > From david at fetter.org Fri Apr 1 09:28:25 2005 From: david at fetter.org (David Fetter) Date: Fri Apr 1 09:28:37 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <7637e215050401092141ee464e@mail.gmail.com> References: <7637e21505033118035f6a057c@mail.gmail.com> <16973.29329.161449.401241@flutterby.com> <7637e21505040108524ec9c63d@mail.gmail.com> <200504010900.41507.josh@agliodbs.com> <7637e215050401092141ee464e@mail.gmail.com> Message-ID: <20050401172825.GE21529@fetter.org> On Fri, Apr 01, 2005 at 09:21:24AM -0800, Shane Hill wrote: > Thanks Josh , > > I have thought of a couple ways to do what I need, but they are a > bit hokey and brute force, not my style. Actually, there a > numerous ways to do what I need, but I am very anal about having a > clean object interface and I want this to remain elegant. > > If you have some slick sql that will give me the seq name, I will go > out and immediately buy your poster and put it on my wall. You do > have a poster, don't you? It's *my* poster you'll put up ;) Cheers, D -- David Fetter david@fetter.org http://fetter.org/ phone: +1 510 893 6100 mobile: +1 415 235 3778 Remember to vote! From david at kineticode.com Fri Apr 1 09:29:33 2005 From: david at kineticode.com (David Wheeler) Date: Fri Apr 1 09:29:41 2005 Subject: [sf-perl] Going from XML to SQL In-Reply-To: <7637e21505033117591e0889e5@mail.gmail.com> References: <200503240326.j2O3QMP97903@mail0.rawbw.com> <20050324193740.GA23549@fetter.org> <200503281509.30139.josh@agliodbs.com> <7637e21505033117591e0889e5@mail.gmail.com> Message-ID: <4a32a1c692f6b0ce333e681f7e6ce7be@kineticode.com> On Mar 31, 2005, at 5:59 PM, Shane Hill wrote: > my $id = > $self->connection->last_insert_id(undef,undef,$table_name,undef); > $table_name is defined and assigned. > > the docs say this is ok, how am I screwing up? How is the ID generated? What does your ID column declaration look like? Do you use a sequence? Regards, David From mattalbright at yahoo.com Fri Apr 1 09:45:50 2005 From: mattalbright at yahoo.com (Matthew Albright) Date: Fri Apr 1 09:45:58 2005 Subject: [sf-perl] Going from XML to SQL In-Reply-To: 6667 Message-ID: <20050401174550.75754.qmail@web30207.mail.mud.yahoo.com> We're on 7.x here, and we use: select currval($tablename . '_id_seq') We can do this because all of our tables are created through one interface, and they always have a column: "id serial primary key". And of course the above sql statement is abstracted behind a method that's called "get_last_insert_id", and that method checks that you're in a transaction at the time, and dies if it isn't. If we ever upgrade to 8.x it could probably be changed, but it's only in one place so it would be trivial. matt --- David Wheeler wrote: > On Mar 31, 2005, at 5:59 PM, Shane Hill wrote: > > > my $id = > > > $self->connection->last_insert_id(undef,undef,$table_name,undef); > > $table_name is defined and assigned. > > > > the docs say this is ok, how am I screwing up? > > How is the ID generated? What does your ID column declaration > look > like? Do you use a sequence? > > Regards, > > David > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm@pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > From shanehill00 at gmail.com Fri Apr 1 09:50:20 2005 From: shanehill00 at gmail.com (Shane Hill) Date: Fri Apr 1 09:50:29 2005 Subject: [sf-perl] Going from XML to SQL In-Reply-To: <20050401174550.75754.qmail@web30207.mail.mud.yahoo.com> References: <20050401174550.75754.qmail@web30207.mail.mud.yahoo.com> Message-ID: <7637e215050401095012e96b36@mail.gmail.com> yup, that was one of the ways I contemplated doing this. But you are hosed if Pg starts auto naming things differently. I am going to try several things and see what I like best. I will let the list know what I come up with. -Shane On Apr 1, 2005 9:45 AM, Matthew Albright wrote: > We're on 7.x here, and we use: > > select currval($tablename . '_id_seq') > > We can do this because all of our tables are created through one > interface, and they always have a column: "id serial primary > key". > > And of course the above sql statement is abstracted behind a > method that's called "get_last_insert_id", and that method > checks that you're in a transaction at the time, and dies if it > isn't. > > If we ever upgrade to 8.x it could probably be changed, but it's > only in one place so it would be trivial. > > matt > > > --- David Wheeler wrote: > > On Mar 31, 2005, at 5:59 PM, Shane Hill wrote: > > > > > my $id = > > > > > > $self->connection->last_insert_id(undef,undef,$table_name,undef); > > > $table_name is defined and assigned. > > > > > > the docs say this is ok, how am I screwing up? > > > > How is the ID generated? What does your ID column declaration > > look > > like? Do you use a sequence? > > > > Regards, > > > > David > > > > _______________________________________________ > > SanFrancisco-pm mailing list > > SanFrancisco-pm@pm.org > > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm@pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > From josh at agliodbs.com Fri Apr 1 10:20:50 2005 From: josh at agliodbs.com (Josh Berkus) Date: Fri Apr 1 10:16:12 2005 Subject: [sf-perl] Last Insert ID In-Reply-To: <7637e215050401095012e96b36@mail.gmail.com> References: <20050401174550.75754.qmail@web30207.mail.mud.yahoo.com> <7637e215050401095012e96b36@mail.gmail.com> Message-ID: <200504011020.50432.josh@agliodbs.com> Shane, > yup, that was one of the ways I contemplated doing this. But you are > hosed if ?Pg starts auto naming things differently. That's not too likely at this point. In older versions, it could hose you because we had a 32-character identifier limit, so sometimes sequence names would get truncated. The other alternative is to manually name your sequences. That declaration looks like: CREATE SEQUENCE users_seq; ... user_id INT NOT NULL PRIMARY KEY DEFAULT nextval('users_seq'), ... instead of ... user_id SERIAL PRIMARY KEY And is it just me, or did the other SFPUG just sort of annex the SFPerl list? ;-) -- --Josh Josh Berkus Aglio Database Solutions San Francisco From shanehill00 at gmail.com Fri Apr 1 11:11:52 2005 From: shanehill00 at gmail.com (Shane Hill) Date: Fri Apr 1 11:12:04 2005 Subject: [sf-perl] PostgreSQL DBD ---- repost: sorry, I had the wrong subject in my previous post In-Reply-To: <20050401171006.GC21529@fetter.org> References: <7637e21505033118035f6a057c@mail.gmail.com> <20050401024414.GC3674@fetter.org> <7637e21505033119413988ac40@mail.gmail.com> <20050401045614.GA21529@fetter.org> <7637e215050401080354d0cd61@mail.gmail.com> <20050401171006.GC21529@fetter.org> Message-ID: <7637e21505040111115f3ccc2c@mail.gmail.com> nice find david, this works well and is probably more bomb-proof than concatenating strings and guessing the seq_name. looks like I am buying a new poster this evening :-) -Shane > SELECT > (string_to_array(d.adsrc, '\''))[2] > FROM pg_catalog.pg_class c > JOIN pg_catalog.pg_attribute a > ON ( > c.relname = 'foo_tab' > AND > c.oid = a.attrelid > ) > JOIN pg_catalog.pg_attrdef d > ON ( > d.adsrc LIKE 'nextval%' > AND > d.adrelid = a.attrelid > AND > d.adnum = a.attnum > ) > ; > > > thanks for your help, I really appreciate it. > > Hope this does. Oh, and try talking your client into upgrading to > 8.0x :) > > Cheers, > D > -- > David Fetter david@fetter.org http://fetter.org/ > phone: +1 510 893 6100 mobile: +1 415 235 3778 > > Remember to vote! > From david at fetter.org Fri Apr 1 14:18:50 2005 From: david at fetter.org (David Fetter) Date: Fri Apr 1 14:19:05 2005 Subject: [sf-perl] Last Insert ID In-Reply-To: <200504011020.50432.josh@agliodbs.com> References: <20050401174550.75754.qmail@web30207.mail.mud.yahoo.com> <7637e215050401095012e96b36@mail.gmail.com> <200504011020.50432.josh@agliodbs.com> Message-ID: <20050401221850.GF27354@fetter.org> On Fri, Apr 01, 2005 at 10:20:50AM -0800, Josh Berkus wrote: > And is it just me, or did the other SFPUG just sort of annex the > SFPerl list? ;-) These days, we prefer the term, "extraordinary rendition." ;) Cheers, D -- David Fetter david@fetter.org http://fetter.org/ phone: +1 510 893 6100 mobile: +1 415 235 3778 Remember to vote! From rick at linuxmafia.com Fri Apr 1 14:23:14 2005 From: rick at linuxmafia.com (Rick Moen) Date: Fri Apr 1 14:23:28 2005 Subject: [sf-perl] Last Insert ID In-Reply-To: <20050401221850.GF27354@fetter.org> References: <20050401174550.75754.qmail@web30207.mail.mud.yahoo.com> <7637e215050401095012e96b36@mail.gmail.com> <200504011020.50432.josh@agliodbs.com> <20050401221850.GF27354@fetter.org> Message-ID: <20050401222313.GS27314@linuxmafia.com> Quoting David Fetter (david@fetter.org): > On Fri, Apr 01, 2005 at 10:20:50AM -0800, Josh Berkus wrote: > > > And is it just me, or did the other SFPUG just sort of annex the > > SFPerl list? ;-) > > These days, we prefer the term, "extraordinary rendition." ;) Or is it perhaps "OUTER JOIN"? -- Cheers, "He who hesitates is frost." Rick Moen -- Inuit proverb rick@linuxmafia.com From qw at sf.pm.org Fri Apr 1 14:44:17 2005 From: qw at sf.pm.org (Quinn Weaver) Date: Fri Apr 1 14:41:11 2005 Subject: [sf-perl] *** Special meeting this Tuesday *** Message-ID: <20050401224417.GF60786@cfcl.com> Andy Lester of OSCON fame is coming to town. Actually, my company, BGI, is bringing him in for some consulting. I just became aware of this from a mass corporate email. Well, I got in touch with Andy, and he'd like to come and speak to us. In fact, he'd been looking for me. :) So, we're having a special meeting this Tuesday, April 5. This won't supersede our April meeting; it's a bonus. :) We're still discussing the topic, but it will be something cool. Some of you will remember Andy from OSCON. He's done a number of presentations on automated testing, software engineering in the large, and the practical human elements of making software. Very sensibly guy, no BS, good head on his shoulders. The topic is likely to come from these areas of expertise. I will order food and we'll pick his brains. (Note these are two separate topics. Brains and food. Both fresh, of course.) RSVP if you can make it: qw@sf.pm.org. Let me know if you want food or if you're eating beforehand. Note any dietary restrictions. I'll take care of the rest. Muy buenas tardes, -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From josh at agliodbs.com Fri Apr 1 14:48:43 2005 From: josh at agliodbs.com (Josh Berkus) Date: Fri Apr 1 14:44:04 2005 Subject: [sf-perl] *** Special meeting this Tuesday *** In-Reply-To: <20050401224417.GF60786@cfcl.com> References: <20050401224417.GF60786@cfcl.com> Message-ID: <200504011448.43290.josh@agliodbs.com> Quinn, > RSVP if you can make it: ?qw@sf.pm.org. ?Let me know if you want food > or if you're eating beforehand. ?Note any dietary restrictions. ?I'll > take care of the rest. Probably not. Next week is OSBC, which is why Andy is here. But it also means that I have a dinner date with some suits on Tuesday. -- --Josh Josh Berkus Aglio Database Solutions San Francisco From matt at cloudfactory.org Fri Apr 1 15:58:52 2005 From: matt at cloudfactory.org (Matthew Lanier) Date: Fri Apr 1 15:59:00 2005 Subject: [sf-perl] Last Insert ID In-Reply-To: <20050401221850.GF27354@fetter.org> Message-ID: On Fri, 1 Apr 2005, David Fetter wrote: > On Fri, Apr 01, 2005 at 10:20:50AM -0800, Josh Berkus wrote: > > > And is it just me, or did the other SFPUG just sort of annex the > > SFPerl list? ;-) them's fighting words! seriously, i'm happy to see what i still think of as my little list (sfperl) significantly overlapping with other community lists, especially the postgresql community. it makes me happy. m@ From andy at petdance.com Fri Apr 1 16:01:31 2005 From: andy at petdance.com (Andy Lester) Date: Fri Apr 1 16:01:45 2005 Subject: [sf-perl] Re: *** Special meeting this Tuesday *** In-Reply-To: <20050401224417.GF60786@cfcl.com> References: <20050401224417.GF60786@cfcl.com> Message-ID: <20050402000131.GA15946@petdance.com> I'm on the list now, too. :-) On Fri, Apr 01, 2005 at 02:44:17PM -0800, Quinn Weaver (qw@sf.pm.org) wrote: > Some of you will remember Andy from OSCON. He's done a number of > presentations on automated testing, software engineering in the large, > and the practical human elements of making software. Very sensibly > guy, no BS, good head on his shoulders. The topic is likely to come > from these areas of expertise. What topics would people like to see covered? I can talk about a lot of stuff: * Automated testing, both in the large and Perl-specific, and on the web * Project estimation and tracking, which is the talk I'll be presenting at OSCON this year (although I still don't see it announced yet) * How to get hired: Effective job resume-ing, cover lettering and interviewing. Those are the biggies, but I've talked about a lot of stuff. I have a list of talks I've given and articles I've written at http://petdance.com/resume/. I welcome your requests. xoxo, Andy -- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance From vlb at cfcl.com Fri Apr 1 16:57:39 2005 From: vlb at cfcl.com (Vicki Brown) Date: Fri Apr 1 17:02:41 2005 Subject: [sf-perl] Administrivia: Post from your subscribed address Message-ID: Just a reminder, this is a members-only list. Unless you post from your subscribed address, your message will bounce. It won't vanish; it will bounce to Quinn and to me and one of us will accept it and send it on to the list. But you may experience a delay in this case. YMMV. -- Vicki Brown ZZZ Journeyman Sourceror: zz |\ _,,,---,,_ Code, Docs, Process, Scripts & Philtres zz /,`.-'`' -. ;-;;,_ Perl, WWW, Mac OS X http://cfcl.com/vlb |,4- ) )-,_. ,\ ( `'-' SF Bay Area, CA USA _______________________ '---''(_/--' `-'\_) ___________________________ From doom at kzsu.stanford.edu Sat Apr 2 14:34:48 2005 From: doom at kzsu.stanford.edu (Joseph Brenner) Date: Sat Apr 2 14:34:59 2005 Subject: [sf-perl] Re: *** Special meeting this Tuesday *** In-Reply-To: <20050402000131.GA15946@petdance.com> References: <20050401224417.GF60786@cfcl.com> <20050402000131.GA15946@petdance.com> Message-ID: <200504022234.j32MYnb59650@mail0.rawbw.com> Andy Lester wrote: > Quinn Weaver (qw@sf.pm.org) wrote: > > Some of you will remember Andy from OSCON. He's done a number of > > presentations on automated testing, software engineering in the large, > > and the practical human elements of making software. Very sensibly > > guy, no BS, good head on his shoulders. The topic is likely to come > > from these areas of expertise. > What topics would people like to see covered? I can talk about a lot of > stuff: > > * Automated testing, both in the large and Perl-specific, and on the web That's what I'd vote for. > * How to get hired: Effective job resume-ing, cover lettering and > interviewing. Though this is evidentally what I really need help with these days... but I'll try and get by with your on-line slides. > Those are the biggies, but I've talked about a lot of stuff. I have a > list of talks I've given and articles I've written at > http://petdance.com/resume/. I welcome your requests. From andy at petdance.com Mon Apr 4 07:31:30 2005 From: andy at petdance.com (Andy Lester) Date: Mon Apr 4 07:31:48 2005 Subject: [sf-perl] Re: *** Special meeting this Tuesday *** In-Reply-To: <20050402000131.GA15946@petdance.com> References: <20050401224417.GF60786@cfcl.com> <20050402000131.GA15946@petdance.com> Message-ID: <20050404143130.GA28848@petdance.com> I don't know what your swag situation is like, but I'm bringing a copy of "Spidering Hacks" to give away. It's got three hacks in there about how to use WWW::Mechanize. I may bring other stuff as well. Ranting about testing, AND free book(s)! What more can you want? xoa -- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance From david at kineticode.com Mon Apr 4 09:20:20 2005 From: david at kineticode.com (David Wheeler) Date: Mon Apr 4 09:20:25 2005 Subject: [sf-perl] Re: *** Special meeting this Tuesday *** In-Reply-To: <20050404143130.GA28848@petdance.com> References: <20050401224417.GF60786@cfcl.com> <20050402000131.GA15946@petdance.com> <20050404143130.GA28848@petdance.com> Message-ID: On Apr 4, 2005, at 7:31 AM, Andy Lester wrote: > Ranting about testing, AND free book(s)! What more can you want? Free lunch. ;-) D From qw at sf.pm.org Mon Apr 4 10:13:46 2005 From: qw at sf.pm.org (Quinn Weaver) Date: Mon Apr 4 10:11:30 2005 Subject: [sf-perl] Re: *** Special meeting this Tuesday *** In-Reply-To: <20050404143130.GA28848@petdance.com> References: <20050401224417.GF60786@cfcl.com> <20050402000131.GA15946@petdance.com> <20050404143130.GA28848@petdance.com> Message-ID: <20050404171346.GA48536@cfcl.com> On Mon, Apr 04, 2005 at 09:31:30AM -0500, Andy Lester wrote: > I don't know what your swag situation is like, but I'm bringing a copy > of "Spidering Hacks" to give away. It's got three hacks in there about > how to use WWW::Mechanize. I may bring other stuff as well. > > Ranting about testing, AND free book(s)! What more can you want? Cool. I have some books I've been meaning to give away; I'll bring them too. -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From qw at sf.pm.org Tue Apr 5 12:33:22 2005 From: qw at sf.pm.org (Quinn Weaver) Date: Tue Apr 5 12:30:16 2005 Subject: [sf-perl] Reminder: special meeting tonight Message-ID: <20050405193321.GB37537@cfcl.com> Hey, all, This is a reminder that we're meeting tonight for a special presentation from Andy Lester. I'm ordering Szechuan. RSVP to me if you want some: qw@sf.pm.org (unless you already have, that is). ************************************************************************* If you find you can't make it, or if you've already RSVP'ed but you don't want food, please email me and let me know. (I am ordering food in advance, so if I over-order I get stuck with the check.) ************************************************************************* Thanks; I'll look forward to seeing you there. :) Again, full detailas are at http://sf.pm.org/weblog/archives/00000024.html . -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From qw at sf.pm.org Wed Apr 6 11:22:01 2005 From: qw at sf.pm.org (Quinn Weaver) Date: Wed Apr 6 11:19:01 2005 Subject: [sf-perl] Testing; please ignore Message-ID: <20050406182201.GB57402@cfcl.com> ... -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From dave at daveliebreich.com Wed Apr 6 15:14:39 2005 From: dave at daveliebreich.com (Dave Liebreich) Date: Wed Apr 6 15:14:55 2005 Subject: [sf-perl] Testing; please ignore In-Reply-To: <20050406182201.GB57402@cfcl.com> References: <20050406182201.GB57402@cfcl.com> Message-ID: <20050406151439.1438418103.dave@daveliebreich.com> No! No! No! Don't ignore testing! Testing is very important! Didn't you learn anything from last night's get-together? _Dave From andy at petdance.com Wed Apr 6 22:28:17 2005 From: andy at petdance.com (Andy Lester) Date: Wed Apr 6 22:28:30 2005 Subject: [sf-perl] Testing; please ignore In-Reply-To: <20050406151439.1438418103.dave@daveliebreich.com> References: <20050406182201.GB57402@cfcl.com> <20050406151439.1438418103.dave@daveliebreich.com> Message-ID: <20050407052817.GB771@petdance.com> On Wed, Apr 06, 2005 at 03:14:39PM -0700, Dave Liebreich (dave@daveliebreich.com) wrote: > Don't ignore testing! Testing is very important! Didn't you learn anything from last night's get-together? Hey, where were you? You owe me a beer! -- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance From doom at kzsu.stanford.edu Wed Apr 6 23:25:11 2005 From: doom at kzsu.stanford.edu (Joseph Brenner) Date: Wed Apr 6 23:25:20 2005 Subject: [sf-perl] Testing; please ignore In-Reply-To: <20050406151439.1438418103.dave@daveliebreich.com> References: <20050406182201.GB57402@cfcl.com> <20050406151439.1438418103.dave@daveliebreich.com> Message-ID: <200504070625.j376PC831973@mail0.rawbw.com> I mentioned this module I was working on at the last meeting: http://search.cpan.org/~doom/GraphViz-DBI-General-0.1/ GraphViz::DBI::General is an object-oriented module that provides the capability to automatically generate graphs of database schemas (i.e. foreign key connections between tables). This is a subclass of GraphViz::DBI, that extends it so that: (1) it will work with any database with a driver that supports the foreign_key_info method (GraphViz::DBI relies on a naming convention to identify foreign keys) (2) it provides a way of specifying the name of the schema you're interested in (which makes it possible to use this with postgresql, otherwise you get a *huge* graph dominated by pg_catalog and possibly the information_schema, if you're using postgresql 8.0). There's a page about it on my site, with some sample output: http://obsidianrook.com/graphviz_dbi_general/ If anyone has any suggestions on writing portable tests for something like this, I'd really like to hear them. From rdm at cfcl.com Fri Apr 8 16:58:19 2005 From: rdm at cfcl.com (Rich Morin) Date: Fri Apr 8 15:58:47 2005 Subject: [sf-perl] Fwd: April IT & Tea Seminar - Thursday, April 14th Message-ID: Terry Winograd is a Bright Guy. This could be quite interesting. To get into the gate at SLAC, you'll need picture ID. -r --- Begin Forward --- Subject: April IT & Tea Seminar - Thursday, April 14th Date: Fri, 8 Apr 2005 14:44:44 -0700 The IT & Tea April Seminar is scheduled for Thursday, 14, 2005 Topic: "Computer-Augmented Collaborative Workspaces" Speaker: Terry Winograd Date: Thursday, April 14, 2005 Time: 3:30 - 5:00 PM Location: Orange Conference Room, Bldg. 40 Goodies: Tea and cookies provided To find out more information, click on one of the below links: URL: http://www2.slac.stanford.edu/ITnTEA/default.htm OR http://www2.slac.stanford.edu/ITnTEA/info/2005_04_14.htm --- End Forward --- -- email: rdm@cfcl.com; phone: +1 650-873-7841 http://www.cfcl.com - Canta Forda Computer Laboratory http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc. http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series From doom at kzsu.stanford.edu Tue Apr 12 11:30:59 2005 From: doom at kzsu.stanford.edu (Joseph Brenner) Date: Tue Apr 12 11:31:08 2005 Subject: [sf-perl] Celebrity Endorsement (?) Message-ID: <200504121830.j3CIUx803038@mail0.rawbw.com> http://kerneltrap.org/node/4982 "... which really shows what a horrid shell-person I am (I still use the old tools I learnt to use fifteen years ago. I bet you can do it trivially in perl or something sane, and I'm just stuck in the stone age of UNIX)." -- Linus Torvalds So we have here an endorsement of the power of perl, combined with a suggestion that it isn't sane... I don't know that this belongs in the "advocacy" pile, but it's getting there. From shanehill00 at gmail.com Tue Apr 12 11:36:02 2005 From: shanehill00 at gmail.com (Shane Hill) Date: Tue Apr 12 11:36:09 2005 Subject: [sf-perl] Celebrity Endorsement (?) In-Reply-To: <200504121830.j3CIUx803038@mail0.rawbw.com> References: <200504121830.j3CIUx803038@mail0.rawbw.com> Message-ID: <7637e21505041211365b011f4a@mail.gmail.com> > So we have here an endorsement of the power of perl, combined with a > suggestion that it isn't sane... hmm, it appears to me that perl was included in a sane list. but maybe I am just optimistic and hopeful. -Shane > I don't know that this belongs in > the "advocacy" pile, but it's getting there. > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm@pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > From doom at kzsu.stanford.edu Tue Apr 12 14:06:27 2005 From: doom at kzsu.stanford.edu (Joseph Brenner) Date: Tue Apr 12 14:06:42 2005 Subject: [sf-perl] Celebrity Endorsement (?) In-Reply-To: <7637e21505041211365b011f4a@mail.gmail.com> References: <200504121830.j3CIUx803038@mail0.rawbw.com> <7637e21505041211365b011f4a@mail.gmail.com> Message-ID: <200504122106.j3CL6S837291@mail0.rawbw.com> Shane Hill wrote: > Joe Brenner wrote: > > http://kerneltrap.org/node/4982 > > "... which really shows what a horrid shell-person I am (I still > > use the old tools I learnt to use fifteen years ago. I bet you can > > do it trivially in perl or something sane, and I'm just stuck in > > the stone age of UNIX)." -- Linus Torvalds > > So we have here an endorsement of the power of perl, combined with a > > suggestion that it isn't sane... > > hmm, it appears to me that perl was included in a sane list. but > maybe I am just optimistic and hopeful. That was my first take on it, but on second reading I noticed he wasn't saying "perl or something *else* sane". I would guess he was reflexively covering his butt against the religous fanatics that tend to jump down your throat when you say the "p" word. (That "git" project sounds weird... he have a point about line-oriented version control being obsolete in an era of cheap disk space, but the idea that a few people can hand roll a small set of scripts to replace a distributed version control system seems pretty nutty. Torvalds may be twice as bright as Tom Lord, but Tom Lord has spent more than twice as much time thinking about source control. I would think they should shove the linux source into Gnu arch, and get some resources thrown at it -- OSDL? -- until it works well enough.) ObPerl: there are some Arch interface modules out on CPAN: http://search.cpan.org/~migo/Arch-0.4.2/perllib/Arch.pm From qw at sf.pm.org Tue Apr 12 14:32:53 2005 From: qw at sf.pm.org (Quinn Weaver) Date: Tue Apr 12 14:28:58 2005 Subject: [sf-perl] Celebrity Endorsement (?) In-Reply-To: <200504122106.j3CL6S837291@mail0.rawbw.com> References: <200504121830.j3CIUx803038@mail0.rawbw.com> <7637e21505041211365b011f4a@mail.gmail.com> <200504122106.j3CL6S837291@mail0.rawbw.com> Message-ID: <20050412213253.GA32323@cfcl.com> I saw a talk on ArX (an Arch fork :( ) at CodeCon. http://superbeast.ucsd.edu/~landry/ArX/codecon/img0.html It was a very useful presentation, because it did a feature-by-feature comparison of existing free source control systems (including performance comparisons), attempting to answer the questions "Why yet another system?" Anyway, it convinced me of two things: 1) GNU ArX is slightly better than tla (Tom Lord's Arch). 2) Monotone is better than anything else on the market. --probably not what the speaker had in mind, but useful nonetheless. ;) > > > I bet you can > > > do it trivially in perl or something sane, and I'm just stuck in > > > the stone age of UNIX)." -- Linus Torvalds > > hmm, it appears to me that perl was included in a sane list. but > > maybe I am just optimistic and hopeful. > > That was my first take on it, but on second reading I noticed he wasn't > saying "perl or something *else* sane". I don't think Linus is that careful with his language. This sounds like a typical off-the-cuff comment, and my sense is that he just didn't think about the "else". So... I'm pretty sure the contrast is between shell scripts (insane) and Perl or something else (sane), but I'm not sure I can justify my intuition. But you could mail him and ask. ;) -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From rick at linuxmafia.com Tue Apr 12 14:34:05 2005 From: rick at linuxmafia.com (Rick Moen) Date: Tue Apr 12 14:34:16 2005 Subject: [sf-perl] Celebrity Endorsement (?) In-Reply-To: <200504122106.j3CL6S837291@mail0.rawbw.com> References: <200504121830.j3CIUx803038@mail0.rawbw.com> <7637e21505041211365b011f4a@mail.gmail.com> <200504122106.j3CL6S837291@mail0.rawbw.com> Message-ID: <20050412213405.GH27314@linuxmafia.com> Quoting Joseph Brenner (doom@kzsu.stanford.edu): > (That "git" project sounds weird... he have a point about line-oriented > version control being obsolete in an era of cheap disk space, but the > idea that a few people can hand roll a small set of scripts to replace a > distributed version control system seems pretty nutty. I don't think he imagines that "git" can serve as an SCM. Absent a great deal of work that nobody's done, it's just a cute little toy patch manager, and was described as such. From doom at kzsu.stanford.edu Tue Apr 12 19:03:32 2005 From: doom at kzsu.stanford.edu (Joseph Brenner) Date: Tue Apr 12 19:03:43 2005 Subject: [sf-perl] Celebrity Endorsement (?) In-Reply-To: <20050412213253.GA32323@cfcl.com> References: <200504121830.j3CIUx803038@mail0.rawbw.com> <7637e21505041211365b011f4a@mail.gmail.com> <200504122106.j3CL6S837291@mail0.rawbw.com> <20050412213253.GA32323@cfcl.com> Message-ID: <200504130203.j3D23X865439@mail0.rawbw.com> Quinn Weaver wrote: > I saw a talk on ArX (an Arch fork :( ) at CodeCon. > http://superbeast.ucsd.edu/~landry/ArX/codecon/img0.html And I see he remarks about Svk: "Written in perl, so it gets no respect". From rdm at cfcl.com Thu Apr 14 15:11:28 2005 From: rdm at cfcl.com (Rich Morin) Date: Thu Apr 14 15:13:54 2005 Subject: [sf-perl] local boy gets interviewed... Message-ID: Just saw this on Slashdot... Of the multiple hundreds of thousands of open source projects on Source Forge, the vast numerical majority is small projects run by one or two persons. This interview with Bricolage founder David Wheeler is one of a series of interviews of small projects which have contributed mightily to the richness of open source. ... http://madpenguin.org/cms/html/62/3926.html -r -- email: rdm@cfcl.com; phone: +1 650-873-7841 http://www.cfcl.com - Canta Forda Computer Laboratory http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc. http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series From qw at sf.pm.org Wed Apr 20 12:43:58 2005 From: qw at sf.pm.org (Quinn Weaver) Date: Wed Apr 20 12:39:07 2005 Subject: [sf-perl] Next meeting this Tuesday: Munch at Verona Message-ID: <20050420194358.GA39924@cfcl.com> Hi, all, It's that time again. For a change, we're meeting at a Greek-flavored Italian place, Verona. Should be low-key but fun. :) Date: April 24, 2005 Time: 8:00 Place: 291 30th St. (at the end of Church) Price: This wil be slightly more expensive than our usual fare: more like $15 rather than $10. Directions: It depends a lot on where you're coming from. Use http://transit.511.org/tripplanner/ . From qw at sf.pm.org Wed Apr 20 12:55:57 2005 From: qw at sf.pm.org (Quinn Weaver) Date: Wed Apr 20 12:51:20 2005 Subject: [sf-perl] Next meeting this Tuesday: Munch at Verona In-Reply-To: <20050420194358.GA39924@cfcl.com> References: <20050420194358.GA39924@cfcl.com> Message-ID: <20050420195557.GC39924@cfcl.com> On Wed, Apr 20, 2005 at 12:43:58PM -0700, Quinn Weaver wrote: > Hi, all, > > It's that time again. For a change, we're meeting at a Greek-flavored > Italian place, Verona. Should be low-key but fun. :) > > Date: April 24, 2005 Correction: It's April 26. Thanks to David Alban for catching this. At least I got it right on the web site. ;) -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From qw at sf.pm.org Wed Apr 20 13:18:10 2005 From: qw at sf.pm.org (Quinn Weaver) Date: Wed Apr 20 13:13:20 2005 Subject: [sf-perl] Venue announcement Message-ID: <20050420201810.GF39924@cfcl.com> I am very pleased to announce that I've quit my job at BGI to start my own company. :D This has been in the works for a long time, but I've had to keep it quiet. (In fact, the company itself will stay in stealth mode for a while.) The one practical consequence for SF.pm is that we can no longer meet at BGI. I've been looking for other venues, and I have a few good candidates, but I would like to have more. (I think it would be nice to rotate venues sometimes.) Therefore I'm asking for y'all to think about whether you can use your company (or loft, or house) as a venue. Criteria are - It must be in San Francisco, near downtown. - It must be able to accomodate 30 to 40 people. - There must be room for people to consume food. ;) - You must have a video projector and a computer to drive it. This is a tough one, I know, but it makes logistics a lot easier. - The venue doesn't have to allow alcohol, but that would be nice. If you know of such venues, please mail me at qw@sf.pm.org. One more note: I'll be out of the country in May. SF.pm will have a dinner meeting that month, organized by Rich Morin, Commander 'n' Chef. The meeting will take place May 23; watch this space for details. Thanks, -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From extasia at gmail.com Thu Apr 21 06:37:33 2005 From: extasia at gmail.com (David Alban) Date: Thu Apr 21 06:37:46 2005 Subject: [sf-perl] fwd: BayLISA meeting: Regular expressions In-Reply-To: <20050421055940.GJ21692@linuxmafia.com> References: <20050421055940.GJ21692@linuxmafia.com> Message-ID: <4c714a9c050421063720cf7f33@mail.gmail.com> ---------- Forwarded message ---------- From: Rick Moen Date: Apr 20, 2005 10:59 PM Subject: [baylisa] BayLISA monthly meeting: Regular Expressions To: baylisa@baylisa.org Date: Thursday, 21 April 2005 Where: Apple Computer, Town Hall Building, upstairs meeting room http://www.baylisa.org/locations/current.html 7:30 pm Introductions and announcements 8:00 pm Formal presentation 9:45 pm After-meeting dinner/social outing (BJ's, next door) William Ward will present on "Regular Expressions". Whether running a simple grep command or writing a big Perl program, a thorough understanding of regular expressions is an essential skill for any system administrator. The talk will describe the history, syntax, and best practices for regular expressions; how a well-written regular expression can dramatically improve the speed of pattern matching; and give tips for using regular expressions in Perl programs. William Ward has been managing Unix and Linux computers since 1990. He has been programming Perl since 1993 and teaching Perl since 1999 at De Anza College and through his company, Bay View Training. He is also a member of two Toastmasters clubs, including ProToasties, a club for professional speakers, and received the Competent Toastmaster award in 2004. Also, William Fuller of MonoSphere will do a brief presentation on "Data Migration in Tiered Storage Environments". http://www.baylisa.org/events/ _______________________________________________ baylisa mailing list: baylisa@baylisa.org rsvp for meeting: rsvp@baylisa.org baylisa board (request to sponsor or present): blw@baylisa.org -- Live in a world of your own, but always welcome visitors. From rdm at cfcl.com Tue Apr 26 11:38:53 2005 From: rdm at cfcl.com (Rich Morin) Date: Tue Apr 26 11:39:12 2005 Subject: [sf-perl] meeting reminder: Munch at Verona (TONIGHT) In-Reply-To: <20050420195557.GC39924@cfcl.com> References: <20050420194358.GA39924@cfcl.com> <20050420195557.GC39924@cfcl.com> Message-ID: QW> It's that time again. For a change, we're meeting at a Greek-flavored QW> Italian place, Verona. Should be low-key but fun. :) Date: 8 pm, April 26, 2005 Place: Verona Restaurant 291 30th (at Chiurch) Details: http://sf.pm.org/weblog -r -- email: rdm@cfcl.com; phone: +1 650-873-7841 http://www.cfcl.com - Canta Forda Computer Laboratory http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc. From rdm at cfcl.com Tue Apr 26 11:46:33 2005 From: rdm at cfcl.com (Rich Morin) Date: Tue Apr 26 11:46:50 2005 Subject: [sf-perl] meeting reminder: Munch at Verona (TONIGHT) (details) Message-ID: Here are some details, adapted from the January Weblog entry. -r RSVP: None is necessary. Just show up. :) Date: Tuesday, April 26, 2005 Time: 8:00 p.m. Place: Verona 291 30th (at Chiurch); SF, CA Food: Italian, with some Greek influences Driving Hints Parking is not TOO bad in this neighborhood, but you may have to search a bit. Peninsula: Take I280 North to the San Jose Avenue exit. Move over to the left-hand lane and turn left (North) onto Dolores St. Take a left on 30th or 29th or ... and start looking for a parking place. Mass Transit Hints Be prepared for a bit of a crowd, as this is the end of the prime commute time. All instructions given below are approximate and subject to the whims of the transit gods. BART (East Bay, Downtown): Transfer to Muni at a lower Market St. station. Within the station, exit BART, enter MUNI, and catch the J Church (outbound). Get off at 30th St; walk forward (South) a bit. BART (Peninsula): Transfer to the J Church (inbound) at the Glen Park station. Get off at 30th St; walk back (South) a bit. Caltrain: (Don't take Caltrain if you can avoid it. Trains run back at 10:00 p.m. and 11:59 p.m. only!) From the station, take the N to a lower Market St. station, then transfer to the J (outbound). Get off at 30th St; walk forward (South) a bit. Muni: Take the J Church. Get off at 30th St; walk forward (South) a bit. -- email: rdm@cfcl.com; phone: +1 650-873-7841 http://www.cfcl.com - Canta Forda Computer Laboratory http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc. From david at fetter.org Tue Apr 26 15:09:52 2005 From: david at fetter.org (David Fetter) Date: Tue Apr 26 15:10:04 2005 Subject: [sf-perl] [Job] QA Person Message-ID: <20050426220952.GI11721@fetter.org> Folks, At Perpetual Entertainment, Inc., where I work, we're looking for a QA person. Perpetual, Inc. is downtown San Francisco on New Montgomery, eminently BART-able, and a fun place to work. Languages are Java, C++ and possibly some PostgreSQL things. If you have done formal QA on any or all of the above, lemme know. Extra points for knowing how to write JUnit tests. :) Cheers, D -- David Fetter david@fetter.org http://fetter.org/ phone: +1 510 893 6100 mobile: +1 415 235 3778 Remember to vote! From chris at noncombatant.org Tue Apr 26 15:46:55 2005 From: chris at noncombatant.org (Chris Palmer) Date: Tue Apr 26 15:47:12 2005 Subject: [sf-perl] reduce-like function in Perl? Message-ID: <20050426224655.GA2676@nodewarrior.org> Say I have a list of numbers, and I want to add them all up in one go. Is there a reduce-like function (see Python) to do this? # hypothetical $total = reduce(+, @numbers); I can do this, but it's aesthetically displeasing (better than foreach at least): $total = 0; map { $total += $_ } @numbers; Also, what's the very fastest way to sum a bunch of numbers? I have read hunks of *Mastering Algorithms with Perl*, and it has good performance anecdotes, but I don't have it here with me now... Thanks! From cjm at fruitfly.org Tue Apr 26 16:09:01 2005 From: cjm at fruitfly.org (Chris Mungall) Date: Tue Apr 26 16:08:47 2005 Subject: [sf-perl] reduce-like function in Perl? In-Reply-To: <20050426224655.GA2676@nodewarrior.org> References: <20050426224655.GA2676@nodewarrior.org> Message-ID: You might want to check out Language::Functional http://search.cpan.org/~lbrocard/Language-Functional-0.03/Functional.pm The equivalent function is 'foldl' or 'foldr' I don't know if there's anyway to pass around '+' as a function - you'll have to define your own 'plus' function you might want to check out fp::functionals too functional programming rules!! On Tue, 26 Apr 2005, Chris Palmer wrote: > Say I have a list of numbers, and I want to add them all up in one go. > Is there a reduce-like function (see Python) to do this? > > # hypothetical > $total = reduce(+, @numbers); > > I can do this, but it's aesthetically displeasing (better than foreach > at least): > > $total = 0; > map { $total += $_ } @numbers; > > Also, what's the very fastest way to sum a bunch of numbers? I have read > hunks of *Mastering Algorithms with Perl*, and it has good performance > anecdotes, but I don't have it here with me now... > > Thanks! > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm@pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > From cjm at fruitfly.org Tue Apr 26 16:09:01 2005 From: cjm at fruitfly.org (Chris Mungall) Date: Tue Apr 26 16:09:20 2005 Subject: [sf-perl] reduce-like function in Perl? In-Reply-To: <20050426224655.GA2676@nodewarrior.org> References: <20050426224655.GA2676@nodewarrior.org> Message-ID: You might want to check out Language::Functional http://search.cpan.org/~lbrocard/Language-Functional-0.03/Functional.pm The equivalent function is 'foldl' or 'foldr' I don't know if there's anyway to pass around '+' as a function - you'll have to define your own 'plus' function you might want to check out fp::functionals too functional programming rules!! On Tue, 26 Apr 2005, Chris Palmer wrote: > Say I have a list of numbers, and I want to add them all up in one go. > Is there a reduce-like function (see Python) to do this? > > # hypothetical > $total = reduce(+, @numbers); > > I can do this, but it's aesthetically displeasing (better than foreach > at least): > > $total = 0; > map { $total += $_ } @numbers; > > Also, what's the very fastest way to sum a bunch of numbers? I have read > hunks of *Mastering Algorithms with Perl*, and it has good performance > anecdotes, but I don't have it here with me now... > > Thanks! > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm@pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > From chris at noncombatant.org Tue Apr 26 16:15:36 2005 From: chris at noncombatant.org (Chris Palmer) Date: Tue Apr 26 16:15:52 2005 Subject: [sf-perl] reduce-like function in Perl? In-Reply-To: <20050426224655.GA2676@nodewarrior.org> References: <20050426224655.GA2676@nodewarrior.org> Message-ID: <20050426231536.GA11374@nodewarrior.org> Sorry to bug you all. I found a fun thread on perlmonks.org that answers my question: http://perlmonks.org/index.pl?node_id=20447 If you can live with the limitations of a signed ling, the somewhat freaky last method given beats the mdillon method soundly: use Benchmark; sub a1 { my $sum; $sum += $_ for @_; $sum } sub a2 { unpack"l",pack"l",unpack"%32d*",pack"d*",@_ } timethese(1000000, { 'mdillon' => sub { a1(1,2,3,4,5,6,7,8,9,10); } 'pack' => sub { a2(1,2,3,4,5,6,7,8,9,10); }, } ); From david at fetter.org Tue Apr 26 16:16:49 2005 From: david at fetter.org (David Fetter) Date: Tue Apr 26 16:16:58 2005 Subject: [sf-perl] reduce-like function in Perl? In-Reply-To: <20050426224655.GA2676@nodewarrior.org> References: <20050426224655.GA2676@nodewarrior.org> Message-ID: <20050426231649.GA28609@fetter.org> On Tue, Apr 26, 2005 at 03:46:55PM -0700, Chris Palmer wrote: > Say I have a list of numbers, and I want to add them all up in one go. > Is there a reduce-like function (see Python) to do this? > > # hypothetical > $total = reduce(+, @numbers); > > I can do this, but it's aesthetically displeasing (better than foreach > at least): > > $total = 0; > map { $total += $_ } @numbers; > > Also, what's the very fastest way to sum a bunch of numbers? I have > read hunks of *Mastering Algorithms with Perl*, and it has good > performance anecdotes, but I don't have it here with me now... You might want to get your hands on a copy of Higher-Order Perl http://perl.plover.com/hop/ which just came out in paperback. It covers this kind of thing quite nicely. My idea (somewhat derivative, but more comprehensible, IMHO): $foo = reduce('+', \@numbers); sub reduce { my $operator = shift; my $array_ref = shift; # probably just easier this way. my %init_condition = ( + => 0 , * => 1 ); die "No initial condition for $operator!\n" unless (defined $init_condition{$operator}); my $val = $init_condition{$operator}; foreach my $elem (@$array_ref) { $val = eval("$val $operator $elem"); } return $val; } HTH :) Cheers, D -- David Fetter david@fetter.org http://fetter.org/ phone: +1 510 893 6100 mobile: +1 415 235 3778 Remember to vote! From chris at noncombatant.org Tue Apr 26 16:32:23 2005 From: chris at noncombatant.org (Chris Palmer) Date: Tue Apr 26 16:32:38 2005 Subject: [sf-perl] reduce-like function in Perl? In-Reply-To: <20050426231649.GA28609@fetter.org> References: <20050426224655.GA2676@nodewarrior.org> <20050426231649.GA28609@fetter.org> <20050426224655.GA2676@nodewarrior.org> Message-ID: <20050426233223.GD15514@nodewarrior.org> Chris Mungall writes: > You might want to check out Language::Functional Thanks for the tip. I hadn't heard of this. David Fetter writes: > You might want to get your hands on a copy of Higher-Order Perl Thanks for the tip again! This book looks awesome. In fact, I just higher-ordered it. The code in question is going to go in the function that eats the most time (as shown by DProf) in my program, so I'm actually going to go with the pack/unpack solution. It has the benefit of being terribly kinky as well as fast, so it's a double-win! :) I might bug you all some more if I can't speed up the slow function. From david at fetter.org Fri Apr 29 16:16:05 2005 From: david at fetter.org (David Fetter) Date: Fri Apr 29 16:16:24 2005 Subject: [sf-perl] [OT] OS/X 10.4 (Tiger) Consortium Message-ID: <20050429231605.GA12191@fetter.org> Folks, I'm thinking that it's more fun to pay ~$40/license for a 5-pack than $130/license for singles. Who wants to go in on some OS/X 10.4 licenses? Lemme know offlist :) Cheers, D -- David Fetter david@fetter.org http://fetter.org/ phone: +1 510 893 6100 mobile: +1 415 235 3778 Remember to vote!