From gabrielle.roth at xo.com Tue Jan 2 11:58:34 2007 From: gabrielle.roth at xo.com (Roth, Gabrielle) Date: Tue, 2 Jan 2007 12:58:34 -0700 Subject: [Pdx-pm] January 10th is coming soon In-Reply-To: <200612292022.59703.ewilhelm@cpan.org> Message-ID: > Gabrielle, where's that martini bar? Or, are we having a > jifty talk or > game night or playing the jifty game or what? That particular martini bar is, IIRC, not easily public-transpo accessible. Your Martini Team is working hard to find an Alternative Martini Solution. > The way I see it, everyone wants some > jifty, some fun-n'-games, and maybe some beer. I'm afraid the fun > faction will get restless if we try to do a sit-down talk at > freegeek, > should we just start at the bar and allow the hardcore holdem players > to splinter-off? Jax might be an option if there would be enough > people to fill their quota. I've heard the Jifty talk is only an hour & includes slides, so we need somewhere with a wall/screen. Restless people will be duct-taped (duct tape to be paid for by the non-member surcharge). :) - gabrielle - "If you're not part of the solution, you're part of the precipitate." From ben.hengst at gmail.com Tue Jan 2 16:36:12 2007 From: ben.hengst at gmail.com (benh) Date: Tue, 2 Jan 2007 16:36:12 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug Message-ID: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> A co-worker and I are wondering how/what the best way around this is? we have a module that cans up all our DB connections... but when I want to test it should be a mocDB object... so we now have a DBTest that builds out the mocDB stuffies. But the issue now is that to get all the existing scripts to use DBTest for our tests. Is there a clean way to intercept DB calls? is there some kinda bubble that we can toss the scripts in to and then any call out gets redirected? Our inital though was to just set an env var and then when the script would run then it would pick the right object, but that requires selecting a use statement (ie if($ENV{test}){use DBTest; } else {use DBHost;} ) alas that doesn't work.... any other ideas? -- benh~ From krisb at ring.org Tue Jan 2 16:23:47 2007 From: krisb at ring.org (Kris Bosland) Date: Tue, 2 Jan 2007 16:23:47 -0800 (PST) Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> Message-ID: It looks like you are trying to use a proxy object. Did you put your if/else in a begin block to be sure it happens before the use statement? Do things work for testing if you hard code the change in the script? -Kris On Tue, 2 Jan 2007, benh wrote: > redirected? Our inital though was to just set an env var and then when > the script would run then it would pick the right object, but that > requires selecting a use statement (ie if($ENV{test}){use DBTest; } > else {use DBHost;} ) alas that doesn't work.... any other ideas? From scratchcomputing at gmail.com Tue Jan 2 18:17:21 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Tue, 2 Jan 2007 18:17:21 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: References: Message-ID: <200701021817.21530.ewilhelm@cpan.org> # from Kris Bosland # on Tuesday 02 January 2007 04:23 pm: >Did you put >your if/else in a begin block to be sure it happens before the use >statement? You actually need an eval("use thing") if you want to use "use" conditionally. But, you might want to BEGIN {if($foo) {require foo;} else {require bar}} instead. The compiler is a really good detective. If you use() anything anywhere it will find it. --Eric -- Those who cannot remember the past are condemned to repeat it. --George Santayana --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From scratchcomputing at gmail.com Tue Jan 2 18:39:24 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Tue, 2 Jan 2007 18:39:24 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> Message-ID: <200701021839.24703.ewilhelm@cpan.org> # from benh # on Tuesday 02 January 2007 04:36 pm: >when I >want to test it should be a mocDB object... so we now have a DBTest >that builds out the mocDB stuffies. But the issue now is that to get >all the existing scripts to use DBTest for our tests. Are those test scripts? If so, sed or perl -pie should do the trick. It sounds like it is maybe not so easy though (e.g. you have modules that use said module.) Possibly you could make a wee use() module that just checks the environment variable and requires one or another. If need be, you could then goto that \&import from this import, but it might be easier to do something less voodooey. package whatever; use DBAdaptor; DBAdaptor->selected->import; and package DBAdaptor; my $selected; if($ENV{THESE_ARE_NOT_THE_DATABASES_YOU_ARE_LOOKING_FOR}) { $selected = DBFaker; } else { $selected = DBReal; } eval("require $selected") or die $@; sub selected {$selected}; Though I might instead lean toward something that just pretends to be the real db module, moving into his %INC house, eating his *{} bacon and all that, so that once somebody says "use DBFaker;", package DBReal has been smashed and require will just ignore you (or your evil twin who keeps forgetting about that adaptor.) Similarly, the faker could actually use the real module and then just steal its fire, which gives you the added benefit of being able to test the real db code, but just blunt the dangerous bits. Who was it that said the first thing to do when you find yourself in a hole is to stop digging? --Eric -- The reasonable man adapts himself to the world; the unreasonable man persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. --George Bernard Shaw --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From schwern at gmail.com Wed Jan 3 02:36:57 2007 From: schwern at gmail.com (Michael G Schwern) Date: Wed, 03 Jan 2007 02:36:57 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> Message-ID: <459B8749.3060107@gmail.com> benh wrote: > A co-worker and I are wondering how/what the best way around this is? > > we have a module that cans up all our DB connections... but when I > want to test it should be a mocDB object... so we now have a DBTest > that builds out the mocDB stuffies. But the issue now is that to get > all the existing scripts to use DBTest for our tests. > > Is there a clean way to intercept DB calls? is there some kinda bubble > that we can toss the scripts in to and then any call out gets > redirected? Our inital though was to just set an env var and then when > the script would run then it would pick the right object, but that > requires selecting a use statement (ie if($ENV{test}){use DBTest; } > else {use DBHost;} ) alas that doesn't work.... any other ideas? If you're putting testing code into production code something is wrong. Your production code should not have any special cases for testing. Its a red flag stating that your code is inflexible. That elements of its configuration and class structure are hard coded. If its hard to test, chances are it'll be hard to use. There's several ways to handle this. The first, and least elegant, is to have your tests replace methods of your database class so that they are mocked up. use DBHost; no warnings 'redefine'; *DBHost::connect = sub { ...mock code here... }; While this avoids having to put special cases into your code, it doesn't do anything to increase the flexibility of your code. A better option is to put the decision as to which DB class to use into some configuration option. Then your tests can just change the config. Another is instead of your system loading the database class and instanciating a new database object, the database object it should use can be passed into the system. This allows the calling code, your test, to compose the elements of the system rather than they be hard coded. Finally, you can question why you're mocking the database connection at all. As its not testing the real code, mocking should be a last resort. (I presume by mocking you mean replacing the database methods with dummy calls that return dummy data). Instead, consider having the tests create a new test database, load some test data in it and work from that. SQLite is fantastic for this sort of thing. From publiustemp-pdxpm at yahoo.com Wed Jan 3 03:08:36 2007 From: publiustemp-pdxpm at yahoo.com (Ovid) Date: Wed, 3 Jan 2007 03:08:36 -0800 (PST) Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <459B8749.3060107@gmail.com> Message-ID: <691713.15613.qm@web60813.mail.yahoo.com> --- Michael G Schwern wrote: > If you're putting testing code into production code something is > wrong. Your production code should not have any special cases for > testing. I used to think that and I find myself putting testing hooks all the time. Sure, I could do all sorts of things to intercept a 'print' statement in a command-line tool I'm writing or I could just use: sub _print {...} And override &_print rather than try to grab STDOUT. > Finally, you can question why you're mocking the database connection > at all. As its not testing the real code, mocking should be a last > resort. (I presume by mocking you mean replacing the database > methods with dummy calls that return dummy data). Instead, consider > having the tests create a new test database, load some test data in > it and work from that. SQLite is fantastic for this sort of thing. I mostly agree with this. In working with MySQL, I finally gave up trying to use SQLite for this because certain coworkers are very fond of using MySQL-specific SQL, thus guaranteeing non-portable code (damn it). Now I just dump the schema and load that directly into a dummy test database. With MySQL: mysqldump --no-data $database [$table|$tables] > schema.sql Then if you have some static data in the database which you need for your tests, dump the few tables which have that data and merge the resulting SQL into schema.sql. You can then import that into a clean test database and your code is much easier to test. Here's something I have at the top of the SQL I import (obviously MySQL-specific and processed via Template Toolkit): DROP DATABASE IF EXISTS `[% database %]`; CREATE DATABASE `[% database %]`; use `[% database %]`; ... rest of SQL statements ... And then I load it when my tests start: mysql < schema.sql This is an easy strategy to follow for just about and DBMS. Plus, if you set up your tests so every developer gets a different database name, they can all use this strategy simultaneously without worrying about collisions (and your tests run against the actual DBMS you're using, rather than SQLite). Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/ From wcooley at nakedape.cc Wed Jan 3 20:32:42 2007 From: wcooley at nakedape.cc (Wil Cooley) Date: Wed, 03 Jan 2007 20:32:42 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> Message-ID: <1167885162.25968.23.camel@spartacus.nakedape.priv> On Tue, 2007-01-02 at 16:36 -0800, benh wrote: > A co-worker and I are wondering how/what the best way around this is? > > we have a module that cans up all our DB connections... but when I > want to test it should be a mocDB object... so we now have a DBTest > that builds out the mocDB stuffies. But the issue now is that to get > all the existing scripts to use DBTest for our tests. > > Is there a clean way to intercept DB calls? is there some kinda bubble > that we can toss the scripts in to and then any call out gets > redirected? Our inital though was to just set an env var and then when > the script would run then it would pick the right object, but that > requires selecting a use statement (ie if($ENV{test}){use DBTest; } > else {use DBHost;} ) alas that doesn't work.... any other ideas? It may not be the best or right way to do it, but I just put in a backdoor in my constructor to allow me to pass in an object of the expected type (and documented it as an unsupported, test-only sort of feature). The module in question is basically a facade around Net::FTP: http://search.cpan.org/src/WILCO/Net-FTP-Simple-0.0006/lib/Net/FTP/Simple.pm (My constructor is private and called "_new()".) Then I create Test::MockObject objects for my tests: http://search.cpan.org/src/WILCO/Net-FTP-Simple-0.0006/t/10-Net-FTP-Simple.t Wil -- Wil Cooley http://nakedape.cc/wiki/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/pdx-pm-list/attachments/20070103/4b9ed0b1/attachment.bin From schwern at gmail.com Wed Jan 3 21:27:54 2007 From: schwern at gmail.com (Michael G Schwern) Date: Wed, 03 Jan 2007 21:27:54 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <1167885162.25968.23.camel@spartacus.nakedape.priv> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> <1167885162.25968.23.camel@spartacus.nakedape.priv> Message-ID: <459C905A.7080107@gmail.com> Wil Cooley wrote: > It may not be the best or right way to do it, but I just put in a > backdoor in my constructor to allow me to pass in an object of the > expected type (and documented it as an unsupported, test-only sort of > feature). The module in question is basically a facade around Net::FTP: > > http://search.cpan.org/src/WILCO/Net-FTP-Simple-0.0006/lib/Net/FTP/Simple.pm > > (My constructor is private and called "_new()".) > > Then I create Test::MockObject objects for my tests: > > http://search.cpan.org/src/WILCO/Net-FTP-Simple-0.0006/t/10-Net-FTP-Simple.t That's going in the right direction, allowing users to pass in elements of your object's composition rather than hard coding it all. Why not make that option available publicly? That way they can use a different subclass of Net::FTP. Or pass in a differently configured Net::FTP object. Or a mock object for testing, just like you're doing. While testing, if you find your existing interface inadequate chances are your users will, too. That's why its better to add to the public interface rather than put in private testing hacks. From wcooley at nakedape.cc Thu Jan 4 10:04:34 2007 From: wcooley at nakedape.cc (Wil Cooley) Date: Thu, 04 Jan 2007 10:04:34 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <459C905A.7080107@gmail.com> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> <1167885162.25968.23.camel@spartacus.nakedape.priv> <459C905A.7080107@gmail.com> Message-ID: <1167933874.14954.13.camel@willow.odshp.com> On Wed, 2007-01-03 at 21:27 -0800, Michael G Schwern wrote: > That's going in the right direction, allowing users to pass in > elements of your object's composition rather than hard coding it all. > Why not make that option available publicly? That way they can use a > different subclass of Net::FTP. Or pass in a differently configured > Net::FTP object. Or a mock object for testing, just like you're > doing. Hm, yes, indeed that's reasonable. > While testing, if you find your existing interface inadequate chances > are your users will, too. That's why its better to add to the public > interface rather than put in private testing hacks. Yes, that certainly makes sense. It obviously doesn't make sense to require $obj->isa('Net::FTP'), because with duck-typing it doesn't actually have to be a subclass. How thoroughly should I test with $obj->can() for the object's abilities? Wil -- Wil Cooley http://nakedape.cc -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/pdx-pm-list/attachments/20070104/42c9ecdd/attachment.bin From krisb at ring.org Thu Jan 4 10:17:58 2007 From: krisb at ring.org (Kris Bosland) Date: Thu, 4 Jan 2007 10:17:58 -0800 (PST) Subject: [Pdx-pm] Ask PDX.PM: SVK 2.0 on Win32 Message-ID: I see that SVK 2.0 is officially out, and I would like to try it on my windows box, but I don't want to compile stuff. My understanding is that only the Perl-SVN bindings are needed. Can I install an earlier binary SVK-Win32 package, and then hand-install SVK 2.0? Thanks. -Kris From scratchcomputing at gmail.com Thu Jan 4 11:11:24 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Thu, 4 Jan 2007 11:11:24 -0800 Subject: [Pdx-pm] Ask PDX.PM: SVK 2.0 on Win32 In-Reply-To: References: Message-ID: <200701041111.24212.ewilhelm@cpan.org> # from Kris Bosland # on Thursday 04 January 2007 10:17 am: >windows box, but I don't want to compile stuff. ?My understanding is >that only the Perl-SVN bindings are needed. ?Can I install an earlier >binary SVK-Win32 package, and then hand-install SVK 2.0? Does the binary contain all of the svn bindings? Probably just grab the windows svn binaries from tigris.org. --Eric -- Chicken farmer's observation: Clunk is the past tense of cluck. --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From schwern at gmail.com Thu Jan 4 11:20:30 2007 From: schwern at gmail.com (Michael G Schwern) Date: Thu, 04 Jan 2007 11:20:30 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <1167933874.14954.13.camel@willow.odshp.com> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> <1167885162.25968.23.camel@spartacus.nakedape.priv> <459C905A.7080107@gmail.com> <1167933874.14954.13.camel@willow.odshp.com> Message-ID: <459D537E.6060401@gmail.com> Wil Cooley wrote: > Yes, that certainly makes sense. It obviously doesn't make sense to > require $obj->isa('Net::FTP'), because with duck-typing it doesn't > actually have to be a subclass. How thoroughly should I test with > $obj->can() for the object's abilities? Your code already does all the checking it needs by calling methods on $obj. About all ->can is going to buy you is a nicer error message, but then you have to keep a duplicate list of all the methods your code calls on $obj. Its up to how lax or strict you want to be. Since you're allowing duck-typing you're probably lax. From schwern at gmail.com Thu Jan 4 11:25:10 2007 From: schwern at gmail.com (Michael G Schwern) Date: Thu, 04 Jan 2007 11:25:10 -0800 Subject: [Pdx-pm] Ask PDX.PM: SVK 2.0 on Win32 In-Reply-To: References: Message-ID: <459D5496.3040901@gmail.com> Kris Bosland wrote: > I see that SVK 2.0 is officially out, and I would like to try it > on my windows box, but I don't want to compile stuff. My understanding is > that only the Perl-SVN bindings are needed. Can I install an earlier > binary SVK-Win32 package, and then hand-install SVK 2.0? http://svk.bestpractical.com/view/BuildingFromSourceOnStrawberryPerl Basically... 1) Install SVN win32 binaries 2) Install SVN win32 Perl bindings binaries 3) Install SVK fairly normally Umm, I'll go fix File::chdir now. From chromatic at wgz.org Thu Jan 4 11:30:11 2007 From: chromatic at wgz.org (chromatic) Date: Thu, 4 Jan 2007 11:30:11 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <1167933874.14954.13.camel@willow.odshp.com> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> <459C905A.7080107@gmail.com> <1167933874.14954.13.camel@willow.odshp.com> Message-ID: <200701041130.12030.chromatic@wgz.org> On Thursday 04 January 2007 10:04, Wil Cooley wrote: > Yes, that certainly makes sense. It obviously doesn't make sense to > require $obj->isa('Net::FTP'), because with duck-typing it doesn't > actually have to be a subclass. How thoroughly should I test with > $obj->can() for the object's abilities? Using Test::MockObject::Extends gives you a mock object that actually is-a appropriately. -- c From scratchcomputing at gmail.com Thu Jan 4 11:58:18 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Thu, 4 Jan 2007 11:58:18 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <459D537E.6060401@gmail.com> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> <1167933874.14954.13.camel@willow.odshp.com> <459D537E.6060401@gmail.com> Message-ID: <200701041158.18666.ewilhelm@cpan.org> # from Michael G Schwern # on Thursday 04 January 2007 11:20 am: >Wil Cooley wrote: >> It obviously doesn't make sense to >> require $obj->isa('Net::FTP'), because with duck-typing it doesn't >> actually have to be a subclass. How thoroughly should I test with >> $obj->can() for the object's abilities? > >Your code already does all the checking it needs by calling methods on > $obj. About all ->can is going to buy you is a nicer error message, > but then you have to keep a duplicate list of all the methods your > code calls on $obj. Its up to how lax or strict you want to be. > Since you're allowing duck-typing you're probably lax. I agree that keeping a duplicate list of all of the methods isn't the way to go unless you can easily auto-generate it -- even then, it might be more strict than is actually needed. I think there's usefullness in doing one check for 'get' or other similarly characteristic/indispensible method, just as a general early run-time sanity check (to be reasonably sure it's not a Shovel.pm object.) Let the rest fail later with the 'Can't locate object method "foo"...' stock error. This will make development easier, since the duck only needs to support what gets called on it in any given prototype/hack. The exception would be when you're dealing with a set of classes that have agreed on some standard or convention (ala the USB spec's "what sort of device are you?" scheme -- but even olympus managed to botch that by only testing their "I'm a mass sortage device" camera against windows where the spec-mandated question never got asked.) --Eric -- Peer's Law: The solution to the problem changes the problem. --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From kellert at ohsu.edu Thu Jan 4 12:30:00 2007 From: kellert at ohsu.edu (Thomas J Keller) Date: Thu, 4 Jan 2007 12:30:00 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <200701041158.18666.ewilhelm@cpan.org> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> <1167933874.14954.13.camel@willow.odshp.com> <459D537E.6060401@gmail.com> <200701041158.18666.ewilhelm@cpan.org> Message-ID: <6BFE5254-F389-4814-9310-13CCDF98303A@ohsu.edu> Beginner's lament: What the heck is "duck-typing"? Tom K On Jan 4, 2007, at 11:58 AM, Eric Wilhelm wrote: > # from Michael G Schwern > # on Thursday 04 January 2007 11:20 am: > >> Wil Cooley wrote: >>> It obviously doesn't make sense to >>> require $obj->isa('Net::FTP'), because with duck-typing it doesn't >>> actually have to be a subclass. How thoroughly should I test with >>> $obj->can() for the object's abilities? >> >> Your code already does all the checking it needs by calling >> methods on >> $obj. About all ->can is going to buy you is a nicer error message, >> but then you have to keep a duplicate list of all the methods your >> code calls on $obj. Its up to how lax or strict you want to be. >> Since you're allowing duck-typing you're probably lax. > > I agree that keeping a duplicate list of all of the methods isn't the > way to go unless you can easily auto-generate it -- even then, it > might > be more strict than is actually needed. > > I think there's usefullness in doing one check for 'get' or other > similarly characteristic/indispensible method, just as a general early > run-time sanity check (to be reasonably sure it's not a Shovel.pm > object.) Let the rest fail later with the 'Can't locate object method > "foo"...' stock error. This will make development easier, since the > duck only needs to support what gets called on it in any given > prototype/hack. > > The exception would be when you're dealing with a set of classes that > have agreed on some standard or convention (ala the USB spec's "what > sort of device are you?" scheme -- but even olympus managed to botch > that by only testing their "I'm a mass sortage device" camera against > windows where the spec-mandated question never got asked.) > > --Eric > -- > Peer's Law: The solution to the problem changes the problem. > --------------------------------------------------- > http://scratchcomputing.com > --------------------------------------------------- > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > From merlyn at stonehenge.com Thu Jan 4 12:39:15 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: 04 Jan 2007 12:39:15 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <6BFE5254-F389-4814-9310-13CCDF98303A@ohsu.edu> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> <1167933874.14954.13.camel@willow.odshp.com> <459D537E.6060401@gmail.com> <200701041158.18666.ewilhelm@cpan.org> <6BFE5254-F389-4814-9310-13CCDF98303A@ohsu.edu> Message-ID: <86bqle8r2k.fsf@blue.stonehenge.com> >>>>> "Thomas" == Thomas J Keller writes: Thomas> Beginner's lament: Thomas> What the heck is "duck-typing"? Tip: Wikipedia search for concepts you don't know. It's been rare that in the past year I've searched for something and NOT gotten a useful hit. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From merlyn at stonehenge.com Thu Jan 4 12:40:38 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: 04 Jan 2007 12:40:38 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <86bqle8r2k.fsf@blue.stonehenge.com> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> <1167933874.14954.13.camel@willow.odshp.com> <459D537E.6060401@gmail.com> <200701041158.18666.ewilhelm@cpan.org> <6BFE5254-F389-4814-9310-13CCDF98303A@ohsu.edu> <86bqle8r2k.fsf@blue.stonehenge.com> Message-ID: <867iw28r09.fsf@blue.stonehenge.com> >>>>> "Randal" == Randal L Schwartz writes: >>>>> "Thomas" == Thomas J Keller writes: Thomas> Beginner's lament: Thomas> What the heck is "duck-typing"? Randal> Tip: Wikipedia search for concepts you don't know. It's been rare Randal> that in the past year I've searched for something and NOT gotten Randal> a useful hit. Randal> Second Tip: Having read what you needed, DO NOT CLICK ON ANY OF THE ADDITIONAL LINKS. Unless you have an entire afternoon to spare. :) Wikipedia - "giver of pain and pleasure". -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From marvin at rectangular.com Thu Jan 4 13:02:03 2007 From: marvin at rectangular.com (Marvin Humphrey) Date: Thu, 4 Jan 2007 13:02:03 -0800 Subject: [Pdx-pm] interesting testing hole thats been dug In-Reply-To: <86bqle8r2k.fsf@blue.stonehenge.com> References: <85ddf48b0701021636q134f7f1am31fd163b2683564d@mail.gmail.com> <1167933874.14954.13.camel@willow.odshp.com> <459D537E.6060401@gmail.com> <200701041158.18666.ewilhelm@cpan.org> <6BFE5254-F389-4814-9310-13CCDF98303A@ohsu.edu> <86bqle8r2k.fsf@blue.stonehenge.com> Message-ID: On Jan 4, 2007, at 12:39 PM, Randal L. Schwartz wrote: > Tip: Wikipedia search for concepts you don't know. It's been rare > that in the past year I've searched for something and NOT gotten > a useful hit. Seconded. What a fantastic resource! For a whole class of subjects, Wikipedia has chopped my research time way, way down. It used to be that I could find several web docs with the aid of a naive algorithmic search engine like Google, and acquire the knowledge I was looking for after plowing through several articles of varying depth, quality, and relevance. Going to Wikipedia first, though, is so much better. I'm reminded of the revelatory experience of switching from AltaVista to Google in 1998. Marvin Humphrey Rectangular Research http://www.rectangular.com/ From krisb at ring.org Thu Jan 4 13:50:52 2007 From: krisb at ring.org (Kris Bosland) Date: Thu, 4 Jan 2007 13:50:52 -0800 (PST) Subject: [Pdx-pm] Ask PDX.PM: SVK 2.0 on Win32 In-Reply-To: <459D5496.3040901@gmail.com> Message-ID: Thanks. Do I have any version-hell problems? I am not running the latest SVN version because of compatability with the server I am accessing. On Thu, 4 Jan 2007, Michael G Schwern wrote: > Kris Bosland wrote: > > I see that SVK 2.0 is officially out, and I would like to try it > > on my windows box, but I don't want to compile stuff. My understanding is > > that only the Perl-SVN bindings are needed. Can I install an earlier > > binary SVK-Win32 package, and then hand-install SVK 2.0? > > http://svk.bestpractical.com/view/BuildingFromSourceOnStrawberryPerl > > Basically... > 1) Install SVN win32 binaries > 2) Install SVN win32 Perl bindings binaries > 3) Install SVK fairly normally > > Umm, I'll go fix File::chdir now. > > > !DSPAM:459d50d664511907149465! > > From krisb at ring.org Thu Jan 4 14:36:48 2007 From: krisb at ring.org (Kris Bosland) Date: Thu, 4 Jan 2007 14:36:48 -0800 (PST) Subject: [Pdx-pm] Ask PDX.PM: SVK 2.0 on Win32 In-Reply-To: Message-ID: OK, that was a hasty post. I see from the page that the version numbers for subversion are 1.4.2 and it says 'SVK 2.0' at the top. Thanks. -Kris On Thu, 4 Jan 2007, Kris Bosland wrote: > > Thanks. Do I have any version-hell problems? I am not running > the latest SVN version because of compatability with the server I am > accessing. From schwern at gmail.com Fri Jan 5 01:43:17 2007 From: schwern at gmail.com (Michael G Schwern) Date: Fri, 05 Jan 2007 01:43:17 -0800 Subject: [Pdx-pm] Ask PDX.PM: SVK 2.0 on Win32 In-Reply-To: References: Message-ID: <459E1DB5.5060504@gmail.com> Kris Bosland wrote: > Thanks. Do I have any version-hell problems? I am not running > the latest SVN version because of compatability with the server I am > accessing. Wow, how old's that Subversion server? SVK will work with rather old versions of Subversion. Its documented to work back to 1.0.4 if you can find pre-compiled Windows packages for that. From kellert at ohsu.edu Fri Jan 5 11:42:27 2007 From: kellert at ohsu.edu (Thomas J Keller) Date: Fri, 5 Jan 2007 11:42:27 -0800 Subject: [Pdx-pm] hash of hashes in TT2 Message-ID: <8E5DFAE2-89D5-4159-8E2A-386EFC3D09C9@ohsu.edu> Greetings, I've pulled out enough hairs on this. I can't find an example in the TT book. So I request the help of you, oh mongers most excellent: I have a TT data structure defined as a hash of hashes and I can't figure out how to iterate through them. Here's the code: # /templates/lib/fees: [% #define fees fees = { dseq = { A = { title = "cadillac" fee = 25 } B = { title = "economy" fee = 15 } C = { title = "scooter" fee = 9 } D = { title = "Do-it-yourself" fee = '2.60' } E = { title = "Fragment Analysis, aka AFLP" fee = '2.60' } } }; %] # from templates/src/dseq/index.html ..
    [% FOREACH key IN fees.dseq.keys %]
  • [% key %] mode, [% fees.dseq.key.title %]: [% fees.dseq.key.fee %]
  • [% END %]
  • Discounts available for high-throughput work. Contact the lab for details.
... This gives no error but doesn't return anything for [% fees.dseq.key.title %]: [% fees.dseq.key.fee %] Do I need to change the data structure to a List of hashes? or can I get to the internal hash directly? Thanks, Tom K kellert at ohsu.edu 4-2442 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/pdx-pm-list/attachments/20070105/c6f32431/attachment.html From kellert at ohsu.edu Fri Jan 5 11:54:08 2007 From: kellert at ohsu.edu (Thomas J Keller) Date: Fri, 5 Jan 2007 11:54:08 -0800 Subject: [Pdx-pm] hash of hashes in TT2 In-Reply-To: <8E5DFAE2-89D5-4159-8E2A-386EFC3D09C9@ohsu.edu> References: <8E5DFAE2-89D5-4159-8E2A-386EFC3D09C9@ohsu.edu> Message-ID: <12EAC91A-A31D-4C49-8EE0-8E947646C225@ohsu.edu> I switched the data to a list of hashes and that simplified it. I'd still like to know how to iterate through the [% fees.dseq %] hashes though. (I just like hashes better than lists for ease of understanding down the road.) Thanks, Tom K On Jan 5, 2007, at 11:42 AM, Thomas J Keller wrote: > Greetings, > I've pulled out enough hairs on this. I can't find an example in > the TT book. So I request the help of you, oh mongers most excellent: > > I have a TT data structure defined as a hash of hashes and I can't > figure out how to iterate through them. Here's the code: > # /templates/lib/fees: > [% #define fees > fees = { > dseq = { > A = { > title = "cadillac" > fee = 25 > } > B = { > title = "economy" > fee = 15 > } > C = { > title = "scooter" > fee = 9 > } > D = { > title = "Do-it-yourself" > fee = '2.60' > } > E = { > title = "Fragment Analysis, aka AFLP" > fee = '2.60' > } > } > }; > %] > > # from templates/src/dseq/index.html > ... >
    > [% FOREACH key IN fees.dseq.keys %] >
  • [% key %] mode, [% fees.dseq.key.title %]: [% > fees.dseq.key.fee %]
  • > [% END %] >
  • Discounts available for high-throughput work. > Contact the lab for details.
  • >
... > This gives no error but doesn't return anything for [% > fees.dseq.key.title %]: [% fees.dseq.key.fee %] > > Do I need to change the data structure to a List of hashes? or can > I get to the internal hash directly? > > Thanks, > Tom K > kellert at ohsu.edu > 4-2442 > > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/pdx-pm-list/attachments/20070105/1cc71056/attachment-0001.html From randall at sonofhans.net Fri Jan 5 11:55:44 2007 From: randall at sonofhans.net (Randall Hansen) Date: Fri, 5 Jan 2007 11:55:44 -0800 Subject: [Pdx-pm] hash of hashes in TT2 In-Reply-To: <8E5DFAE2-89D5-4159-8E2A-386EFC3D09C9@ohsu.edu> References: <8E5DFAE2-89D5-4159-8E2A-386EFC3D09C9@ohsu.edu> Message-ID: <876B0F55-0A2D-46DE-BC71-EEC9231EB332@sonofhans.net> On Jan 5, 2007, at 11:42 AM, Thomas J Keller wrote: >
  • [% key %] mode, [% fees.dseq.key.title %]: [% > fees.dseq.key.fee %]
  • TT is trying to evaluate "key" as a literal key name: $dseq-> { key }. you want it to use the value of the variable "key," or $dseq->{ $key }:
  • [% key %] mode, [% fees.dseq.$key.title %]: [% fees.dseq.$key.fee %]
  • r From kellert at ohsu.edu Fri Jan 5 12:08:34 2007 From: kellert at ohsu.edu (Thomas J Keller) Date: Fri, 5 Jan 2007 12:08:34 -0800 Subject: [Pdx-pm] hash of hashes in TT2 In-Reply-To: <876B0F55-0A2D-46DE-BC71-EEC9231EB332@sonofhans.net> References: <8E5DFAE2-89D5-4159-8E2A-386EFC3D09C9@ohsu.edu> <876B0F55-0A2D-46DE-BC71-EEC9231EB332@sonofhans.net> Message-ID: Dooooh! I knew that but got confused as to how to express it. I wrote [% fees.dseq.[% key %].title %] which choked. Thanks! Tom K On Jan 5, 2007, at 11:55 AM, Randall Hansen wrote: > On Jan 5, 2007, at 11:42 AM, Thomas J Keller wrote: > >>
  • [% key %] mode, [% fees.dseq.key.title %]: [% >> fees.dseq.key.fee %]
  • > > TT is trying to evaluate "key" as a literal key name: $dseq-> > { key }. you want it to use the value of the variable "key," or > $dseq->{ $key }: > >
  • [% key %] mode, [% fees.dseq.$key.title %]: [% > fees.dseq.$key.fee %]
  • > > r > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > From krisb at ring.org Fri Jan 5 12:50:08 2007 From: krisb at ring.org (Kris Bosland) Date: Fri, 5 Jan 2007 12:50:08 -0800 (PST) Subject: [Pdx-pm] Ask PDX.PM: SVK 2.0 on Win32 In-Reply-To: <459E1DB5.5060504@gmail.com> Message-ID: Actually, I am using 1.1.2 server side, and 1.2.3 client side (as part of TortiseSVN 1.2.6). I think I will recheck my server side available software and see if I can update my server. -Kris On Fri, 5 Jan 2007, Michael G Schwern wrote: > Kris Bosland wrote: > > Thanks. Do I have any version-hell problems? I am not running > > the latest SVN version because of compatability with the server I am > > accessing. > > Wow, how old's that Subversion server? > > SVK will work with rather old versions of Subversion. Its documented to work back to 1.0.4 if you can find pre-compiled Windows packages for that. > > > !DSPAM:459e19fa129236854032830! > > From scratchcomputing at gmail.com Fri Jan 5 14:10:36 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Fri, 5 Jan 2007 14:10:36 -0800 Subject: [Pdx-pm] Ask PDX.PM: SVK 2.0 on Win32 In-Reply-To: References: Message-ID: <200701051410.36468.ewilhelm@cpan.org> # from Kris Bosland # on Friday 05 January 2007 12:50 pm: >Actually, I am using 1.1.2 server side, and 1.2.3 client side (as >part of TortiseSVN 1.2.6). ?I think I will recheck my server side >available software and see if I can update my server. Shouldn't it "just work"? Note that svk only needs to be compatible with your local svn libs. Your svn libs should be compatible with pretty old servers. http://subversion.tigris.org/faq.html#interop "any 1.X client will work with a 1.Y server" http://subversion.tigris.org/hacking.html#release-numbering --Eric -- The only thing that could save UNIX at this late date would be a new $30 shareware version that runs on an unexpanded Commodore 64. --Don Lancaster (1991) --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From krisb at ring.org Fri Jan 5 13:58:22 2007 From: krisb at ring.org (Kris Bosland) Date: Fri, 5 Jan 2007 13:58:22 -0800 (PST) Subject: [Pdx-pm] Ask PDX.PM: SVK 2.0 on Win32 In-Reply-To: <200701051410.36468.ewilhelm@cpan.org> Message-ID: Hmm, when I was looking (TortiseSVN bugs me regularly about upgrading to latest) I thought I read something that said I couldn't use 1.2 with 1.4. But that would be a 1.4 client with a 1.2 server. Maybe they mean that 1.X client will work with 1.Y server where X < Y? Maybe it is a TortiseSVN problem and not a Subversion problem. -Kris On Fri, 5 Jan 2007, Eric Wilhelm wrote: > # from Kris Bosland > # on Friday 05 January 2007 12:50 pm: > > >Actually, I am using 1.1.2 server side, and 1.2.3 client side (as > >part of TortiseSVN 1.2.6). ?I think I will recheck my server side > >available software and see if I can update my server. > > Shouldn't it "just work"? Note that svk only needs to be compatible > with your local svn libs. Your svn libs should be compatible with > pretty old servers. > > http://subversion.tigris.org/faq.html#interop > > "any 1.X client will work with a 1.Y server" > > http://subversion.tigris.org/hacking.html#release-numbering > > --Eric > -- > The only thing that could save UNIX at this late date would be a new $30 > shareware version that runs on an unexpanded Commodore 64. > --Don Lancaster (1991) > --------------------------------------------------- > http://scratchcomputing.com > --------------------------------------------------- > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > > > !DSPAM:459ec936196776837612271! > > From scratchcomputing at gmail.com Fri Jan 5 15:29:03 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Fri, 5 Jan 2007 15:29:03 -0800 Subject: [Pdx-pm] Ask PDX.PM: SVK 2.0 on Win32 In-Reply-To: References: Message-ID: <200701051529.03446.ewilhelm@cpan.org> # from Kris Bosland # on Friday 05 January 2007 01:58 pm: >I thought I read something that said I couldn't use >1.2 with 1.4. ?But that would be a 1.4 client with a 1.2 server. > ?Maybe they mean that 1.X client will work with 1.Y server where > ?X < Y? ?Maybe it is a TortiseSVN problem > ?and not a Subversion problem. My guess would be that you can't use tortise 1.2 on the same *working copy* as the svn 1.4 command-line client. I've never seen a client/server incompatibility. The working copies are quite a bit pickier because of all of the data stored in files in the .svn directory. But svk doesn't use any of the (I think they call it something south of "ugly") working-copy code from svn, so no worries there. --Eric -- Like a lot of people, I was mathematically abused as a child. --Paul Graham --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From kellert at ohsu.edu Fri Jan 5 15:58:38 2007 From: kellert at ohsu.edu (Thomas J Keller) Date: Fri, 5 Jan 2007 15:58:38 -0800 Subject: [Pdx-pm] java programmer position Message-ID: <119C04EF-1448-4CA9-B9EB-96D81FC3E20A@ohsu.edu> Hi, Lots of you program in Java as well as Perl. I was asked to post a job opportunity for a Java programmer at ProteomeSoftware.com Here's the url http://www.proteomesoftware.com/index.html Contact Mark Turner if you are interested. He hasn't posted this job anywhere yet (as of 6 pm last night). regards, Tom Tom Keller, Ph.D. kellert at ohsu.edu 503-494-2442 6339b Basic Science Bldg http://www.ohsu.edu/research/core -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/pdx-pm-list/attachments/20070105/4799f806/attachment.html From merlyn at stonehenge.com Fri Jan 5 16:53:02 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: 05 Jan 2007 16:53:02 -0800 Subject: [Pdx-pm] java programmer position In-Reply-To: <119C04EF-1448-4CA9-B9EB-96D81FC3E20A@ohsu.edu> References: <119C04EF-1448-4CA9-B9EB-96D81FC3E20A@ohsu.edu> Message-ID: <86fyap2cy9.fsf@blue.stonehenge.com> >>>>> "Thomas" == Thomas J Keller writes: Thomas> Lots of you program in Java as well as Perl. I was asked to post a job Thomas> opportunity for a Java programmer at ProteomeSoftware.com Lots of us own cars too. Does this justify posting a "car for sale" ad? Seriously, "overlap" does not mean "on topic". -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From joshua at keroes.com Fri Jan 5 16:58:51 2007 From: joshua at keroes.com (Joshua Keroes) Date: Fri, 5 Jan 2007 16:58:51 -0800 Subject: [Pdx-pm] java programmer position In-Reply-To: <86fyap2cy9.fsf@blue.stonehenge.com> References: <119C04EF-1448-4CA9-B9EB-96D81FC3E20A@ohsu.edu> <86fyap2cy9.fsf@blue.stonehenge.com> Message-ID: On 05 Jan 2007 16:53:02 -0800, Randal L. Schwartz wrote: > >>>>> "Thomas" == Thomas J Keller writes: > > Thomas> Lots of you program in Java as well as Perl. I was asked to post a job > Thomas> opportunity for a Java programmer at ProteomeSoftware.com > > Lots of us own cars too. Does this justify posting a "car for sale" ad? > > Seriously, "overlap" does not mean "on topic". Not to belabor the point, but I think the bi+lingual folks in this group would also be signed up on various Java mailing lists/fora, places more suitable for that sort of stuff. Cheers, Joshua From scratchcomputing at gmail.com Fri Jan 5 17:03:50 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Fri, 5 Jan 2007 17:03:50 -0800 Subject: [Pdx-pm] java programmer position In-Reply-To: <86fyap2cy9.fsf@blue.stonehenge.com> References: <119C04EF-1448-4CA9-B9EB-96D81FC3E20A@ohsu.edu> <86fyap2cy9.fsf@blue.stonehenge.com> Message-ID: <200701051703.50667.ewilhelm@cpan.org> # from Randal L. Schwartz # on Friday 05 January 2007 04:53 pm: >Thomas> Lots of you program in Java as well as Perl. I was asked to > post a ?job Thomas> opportunity for a Java programmer at > ProteomeSoftware.com > >Lots of us own cars too. ?Does this justify posting a "car for sale" > ad? Hey, most cars can't be converted to run faster, cleaner, and more efficiently in Perl. (And if you have one that can, I'm fine with those ads being posted here.) --Eric -- Introducing change is like pulling off a bandage: the pain is a memory almost as soon as you feel it. --Paul Graham --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From schwern at gmail.com Sat Jan 6 14:33:52 2007 From: schwern at gmail.com (Michael G Schwern) Date: Sat, 06 Jan 2007 14:33:52 -0800 Subject: [Pdx-pm] Ask PDX.PM: SVK 2.0 on Win32 In-Reply-To: <200701051529.03446.ewilhelm@cpan.org> References: <200701051529.03446.ewilhelm@cpan.org> Message-ID: <45A023D0.8040909@gmail.com> Eric Wilhelm wrote: > # from Kris Bosland > # on Friday 05 January 2007 01:58 pm: > >> I thought I read something that said I couldn't use >> 1.2 with 1.4. But that would be a 1.4 client with a 1.2 server. >> Maybe they mean that 1.X client will work with 1.Y server where >> X < Y? Maybe it is a TortiseSVN problem >> and not a Subversion problem. > > My guess would be that you can't use tortise 1.2 on the same *working > copy* as the svn 1.4 command-line client. I've never seen a > client/server incompatibility. The working copies are quite a bit > pickier because of all of the data stored in files in the .svn > directory. But svk doesn't use any of the (I think they call it > something south of "ugly") working-copy code from svn, so no worries > there. http://tortoisesvn.tigris.org/compatibility.html has a client/server compatibility matrix. It basically says yes, all 1.x versions of Tortoise and SVN are compatible with each other, but the client might have functions the server does not implement. So there shouldn't be any harm in using the latest SVN clients with older servers or vice-versa. From schwern at gmail.com Sat Jan 6 14:46:20 2007 From: schwern at gmail.com (Michael G Schwern) Date: Sat, 06 Jan 2007 14:46:20 -0800 Subject: [Pdx-pm] java programmer position In-Reply-To: <86fyap2cy9.fsf@blue.stonehenge.com> References: <119C04EF-1448-4CA9-B9EB-96D81FC3E20A@ohsu.edu> <86fyap2cy9.fsf@blue.stonehenge.com> Message-ID: <45A026BC.4040101@gmail.com> Randal L. Schwartz wrote: >>>>>> "Thomas" == Thomas J Keller writes: > > Thomas> Lots of you program in Java as well as Perl. I was asked to post a job > Thomas> opportunity for a Java programmer at ProteomeSoftware.com > > Lots of us own cars too. Does this justify posting a "car for sale" ad? If I knew someone in the group needed a car, yes. This is a social club as much as a programming group. Perl Mongers is about the people not just the Perl. Some of us are out of work and need jobs and don't mind working with something other than Perl. Thomas knows this, he's not some random recruiter. > Seriously, "overlap" does not mean "on topic". What topic? We jabber about all sorts of totally unrelated stuff here. Do we complain about Gabrielle and Sabrina posting PDX Postgres meetings here? How about your GIT talk at the LUG meeting, Randal? Should we stop showing funny movies at the beginning of the meetings? No, that would be stupidly purist and unfun. The real issue here is that its Java. Get over it. Don't snitty because someone mentions a technology you don't like. I'm so utterly tired of petty technology wars. PS Also realize you were CC'ing all that back to the Proteome Software folks. From merlyn at stonehenge.com Sun Jan 7 08:03:08 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: 07 Jan 2007 08:03:08 -0800 Subject: [Pdx-pm] java programmer position In-Reply-To: <45A026BC.4040101@gmail.com> References: <119C04EF-1448-4CA9-B9EB-96D81FC3E20A@ohsu.edu> <86fyap2cy9.fsf@blue.stonehenge.com> <45A026BC.4040101@gmail.com> Message-ID: <86fyamzuwz.fsf@blue.stonehenge.com> >>>>> "Michael" == Michael G Schwern writes: Michael> The real issue here is that its Java. Get over it. Don't snitty Michael> because someone mentions a technology you don't like. I'm so utterly Michael> tired of petty technology wars. Not at all. Don't presume I'm *that* petty. I mostly triggered because it was a *job ad*. There are plenty of other specialized places for that. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From schwern at gmail.com Sun Jan 7 10:51:20 2007 From: schwern at gmail.com (Michael G Schwern) Date: Sun, 07 Jan 2007 10:51:20 -0800 Subject: [Pdx-pm] Job adverts ok by me In-Reply-To: <86fyamzuwz.fsf@blue.stonehenge.com> References: <119C04EF-1448-4CA9-B9EB-96D81FC3E20A@ohsu.edu> <86fyap2cy9.fsf@blue.stonehenge.com> <45A026BC.4040101@gmail.com> <86fyamzuwz.fsf@blue.stonehenge.com> Message-ID: <45A14128.9090208@gmail.com> Randal L. Schwartz wrote: > I mostly triggered because it was a *job ad*. There are plenty of other > specialized places for that. Jobs have been posted in the past without a peep. http://mail.pm.org/pipermail/pdx-pm-list/2006-November/003883.html http://mail.pm.org/pipermail/pdx-pm-list/2006-October/003815.html Along with all sorts of other only vaguely topical subjects. This is a small, low traffic group. Its not NY.pm which was getting flooded with recruiters and adverts and had to institute a no-jobs policy. Should we start to get too many job averts... well, let's say that would be a fine problem to have. I encourage posting of relevant jobs by members. From schwern at gmail.com Sun Jan 7 10:57:04 2007 From: schwern at gmail.com (Michael G Schwern) Date: Sun, 07 Jan 2007 10:57:04 -0800 Subject: [Pdx-pm] Wed 10.Jan - Jiftini - Jifty and a Martini Message-ID: <45A14280.2050506@gmail.com> http://pdx.pm.org/kwiki/index.cgi?January2007Meeting Schwern is giving a jiffy talk (one hour) covering the basics of Jifty, Best Practical's new web development framework with a pony. We'll be walking through the basics of developing a simple application highlighting Jifty's strengths. Audience participation is encouraged, so if you have a laptop install Jifty now. http://jifty.org/ There will be a beverage service during the talk, martinis. Audience members are encouraged to bring their own glass. A couple shakers and at least one bottle of vermouth and booze will be provided. It is encouraged to bring additional booze and martini fixins (olives, bitters, etc...). Wacky martini variations encouraged. Non-drinkers are encouraged to bring something fancy to sip. Restless people will be duct-taped (or is that duck-typed?). Duct tape to be paid for by the non-member surcharge. Meeting adjourns to the usual place for the quasi-annual Game Night. Please bring your games! What You Can Do * Bring a game for game night * Have Jifty installed * Read up a bit on http://jifty.org * Bring a glass * Bring some martini fixins * Bring additional vermouth and booze * Volunteer to play bartender * Suggest an opening movie Notes Schwern will be arriving back in PDX at 5pm that night, so there's a chance he may not make it. In that case, From raanders at acm.org Mon Jan 8 15:11:11 2007 From: raanders at acm.org (Roderick A. Anderson) Date: Mon, 08 Jan 2007 15:11:11 -0800 Subject: [Pdx-pm] Apache, mod_perl, Catalyst, qx, and the ampersand In-Reply-To: <4589C8DB.9010106@acm.org> References: <4589C8DB.9010106@acm.org> Message-ID: <45A2CF8F.1030806@acm.org> Roderick A. Anderson wrote: > I'm starting here to get some ideas on whether I'm going anywhere near > the right direction. > > We have a Catalyst based application but have been asked to some > non-View processing while the user continues with other things. > > Short-ish story is we pull a XML file -- specified as a GET from a URL > redirect. Parse it and get a URI/URL of a large file. The next step is > to pull that file back but not make the user wait on it. They should be > able to continue with other parts of the process. > > I'm wondering if > > qx{ script_that_does_the_get_and_other_magic & }; > > is the right way to go. Other methods of backgrounding a process from > within Apache/mod_perl. > > This clear as mud? I thought I had picked an option based on the post by Nate Nuss but going through the Catalyst thread. I'm thinking a POE server will be the best long term as well as providing a similar functionality for some other processes. Trouble is the example code from the POE site ( http://pow.perl.org ) doesn't work for a POST. http://poe.perl.org/?POE_Cookbook/CGI_Requests Is what I want to use and it uses what I'm used to -- CGI.pm The problem is I can't get it to use a POST. I looks like the $request object doesn't return anything "new CGI()" can use. Since everything I seen for far uses POST to send the key=value pairs I'm kind if in a tough spot. There is a RT ticket but it is from May 2005. Any suggestions for how to resolve the POE::Component::Server::HTTP issue with POSTs? I'm going to dive into the code for awhile but I hoping someone might have resolved this already. Rod -- > > > Rod From krisb at ring.org Mon Jan 8 16:01:42 2007 From: krisb at ring.org (Kris Bosland) Date: Mon, 8 Jan 2007 16:01:42 -0800 (PST) Subject: [Pdx-pm] Apache, mod_perl, Catalyst, qx, and the ampersand In-Reply-To: <45A2CF8F.1030806@acm.org> Message-ID: You should see if you can get the POST info out of the relevant filehandle with CGI.pm like this: ============================================================== CREATING A NEW QUERY OBJECT FROM AN INPUT FILE $query = new CGI(INPUTFILE); If you provide a file handle to the new() method, it will read parameters from the file (or STDIN, or whatever). The file can be in any of the forms describing below under debugging (i.e. a series of newline delimited TAG=VALUE pairs will work). Conveniently, this type of file is created by the save() method (see below). Multiple records can be saved and restored. Perl purists will be pleased to know that this syntax accepts references to file handles, or even references to filehandle globs, which is the ``official'' way to pass a filehandle: $query = new CGI(\*STDIN); You can also initialize the CGI object with a FileHandle or IO::File object. ============================================================== -Kris On Mon, 8 Jan 2007, Roderick A. Anderson wrote: > Roderick A. Anderson wrote: > > I'm starting here to get some ideas on whether I'm going anywhere near > > the right direction. > > > > We have a Catalyst based application but have been asked to some > > non-View processing while the user continues with other things. > > > > Short-ish story is we pull a XML file -- specified as a GET from a URL > > redirect. Parse it and get a URI/URL of a large file. The next step is > > to pull that file back but not make the user wait on it. They should be > > able to continue with other parts of the process. > > > > I'm wondering if > > > > qx{ script_that_does_the_get_and_other_magic & }; > > > > is the right way to go. Other methods of backgrounding a process from > > within Apache/mod_perl. > > > > This clear as mud? > > I thought I had picked an option based on the post by Nate Nuss but > going through the Catalyst thread. I'm thinking a POE server will be > the best long term as well as providing a similar functionality for some > other processes. > > Trouble is the example code from the POE site ( http://pow.perl.org ) > doesn't work for a POST. > > http://poe.perl.org/?POE_Cookbook/CGI_Requests > > Is what I want to use and it uses what I'm used to -- CGI.pm > > The problem is I can't get it to use a POST. I looks like the $request > object doesn't return anything "new CGI()" can use. Since everything I > seen for far uses POST to send the key=value pairs I'm kind if in a > tough spot. There is a RT ticket but it is from May 2005. > > Any suggestions for how to resolve the POE::Component::Server::HTTP > issue with POSTs? > > > I'm going to dive into the code for awhile but I hoping someone might > have resolved this already. > > > Rod > -- > > > > > > > Rod > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > > > !DSPAM:45a2cbe6239682701912406! > > From raanders at acm.org Mon Jan 8 19:32:03 2007 From: raanders at acm.org (Roderick A. Anderson) Date: Mon, 08 Jan 2007 19:32:03 -0800 Subject: [Pdx-pm] Apache, mod_perl, Catalyst, qx, and the ampersand In-Reply-To: References: Message-ID: <45A30CB3.80701@acm.org> Thanks Kris but I've been there, done that, got a t-shirt. The problem, I believe, is with POE::Component::Server::HTTP 's $request object. I had just got started in the code when I got interrupted with another burning-duck so I could find out what it was really doing. Well I also couldn't figure out how to turn what it was returning into an INPUTFILE or handle. I'll probably end up in the guts of CGI.pm also. Rod -- Kris Bosland wrote: > You should see if you can get the POST info out of the relevant filehandle > with CGI.pm like this: > > ============================================================== > CREATING A NEW QUERY OBJECT FROM AN INPUT FILE > > $query = new CGI(INPUTFILE); > > If you provide a file handle to the new() method, it will read parameters > from the file (or STDIN, or whatever). The file can be in any of the forms > describing below under debugging (i.e. a series of newline delimited > TAG=VALUE pairs will work). Conveniently, this type of file is created by > the save() method (see below). Multiple records can be saved and restored. > > Perl purists will be pleased to know that this syntax accepts references > to file handles, or even references to filehandle globs, which is the > ``official'' way to pass a filehandle: > > $query = new CGI(\*STDIN); > > You can also initialize the CGI object with a FileHandle or IO::File > object. > ============================================================== > > -Kris > > > On Mon, 8 Jan 2007, Roderick A. Anderson wrote: > >> Roderick A. Anderson wrote: >>> I'm starting here to get some ideas on whether I'm going anywhere near >>> the right direction. >>> >>> We have a Catalyst based application but have been asked to some >>> non-View processing while the user continues with other things. >>> >>> Short-ish story is we pull a XML file -- specified as a GET from a URL >>> redirect. Parse it and get a URI/URL of a large file. The next step is >>> to pull that file back but not make the user wait on it. They should be >>> able to continue with other parts of the process. >>> >>> I'm wondering if >>> >>> qx{ script_that_does_the_get_and_other_magic & }; >>> >>> is the right way to go. Other methods of backgrounding a process from >>> within Apache/mod_perl. >>> >>> This clear as mud? >> I thought I had picked an option based on the post by Nate Nuss but >> going through the Catalyst thread. I'm thinking a POE server will be >> the best long term as well as providing a similar functionality for some >> other processes. >> >> Trouble is the example code from the POE site ( http://pow.perl.org ) >> doesn't work for a POST. >> >> http://poe.perl.org/?POE_Cookbook/CGI_Requests >> >> Is what I want to use and it uses what I'm used to -- CGI.pm >> >> The problem is I can't get it to use a POST. I looks like the $request >> object doesn't return anything "new CGI()" can use. Since everything I >> seen for far uses POST to send the key=value pairs I'm kind if in a >> tough spot. There is a RT ticket but it is from May 2005. >> >> Any suggestions for how to resolve the POE::Component::Server::HTTP >> issue with POSTs? >> >> >> I'm going to dive into the code for awhile but I hoping someone might >> have resolved this already. >> >> >> Rod >> -- >> >>> >>> Rod >> _______________________________________________ >> Pdx-pm-list mailing list >> Pdx-pm-list at pm.org >> http://mail.pm.org/mailman/listinfo/pdx-pm-list >> >> >> !DSPAM:45a2cbe6239682701912406! >> >> > From schwern at gmail.com Mon Jan 8 19:36:58 2007 From: schwern at gmail.com (Michael G Schwern) Date: Mon, 08 Jan 2007 19:36:58 -0800 Subject: [Pdx-pm] Wed 10.Jan - Jiftini - Jifty and a Martini In-Reply-To: <45A14280.2050506@gmail.com> References: <45A14280.2050506@gmail.com> Message-ID: <45A30DDA.7000406@gmail.com> Oh yeah, like time and place and stuff. Where: Free Geek When: 6:45pm From ben.hengst at gmail.com Mon Jan 8 20:16:15 2007 From: ben.hengst at gmail.com (benh) Date: Mon, 8 Jan 2007 20:16:15 -0800 Subject: [Pdx-pm] Wed 10.Jan - Jiftini - Jifty and a Martini In-Reply-To: <45A30DDA.7000406@gmail.com> References: <45A14280.2050506@gmail.com> <45A30DDA.7000406@gmail.com> Message-ID: <85ddf48b0701082016u7fad74b0k9f27c71a54fe5688@mail.gmail.com> the'll let us get drunk at freekee*hic*eek ? On 1/8/07, Michael G Schwern wrote: > Oh yeah, like time and place and stuff. > > Where: Free Geek > When: 6:45pm > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > -- benh~ From publiustemp-pdxpm at yahoo.com Tue Jan 9 01:46:55 2007 From: publiustemp-pdxpm at yahoo.com (Ovid) Date: Tue, 9 Jan 2007 01:46:55 -0800 (PST) Subject: [Pdx-pm] Wed 10.Jan - Jiftini - Jifty and a Martini In-Reply-To: <85ddf48b0701082016u7fad74b0k9f27c71a54fe5688@mail.gmail.com> Message-ID: <20070109094656.55869.qmail@web60814.mail.yahoo.com> --- benh wrote: > the'll let us get drunk at freekee*hic*eek ? I'm not sure if they'll let you get drunk so much as they'd be afraid to say anything to a group of rabid Perl developers. I was giving a talk once (or was Schwern? Don't remember) when Schwern walked in and handed me a beer. Nothing was said, but the beer was tasty. Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/ From raanders at acm.org Tue Jan 9 12:05:07 2007 From: raanders at acm.org (Roderick A. Anderson) Date: Tue, 09 Jan 2007 12:05:07 -0800 Subject: [Pdx-pm] Apache, mod_perl, Catalyst, qx, and the ampersand In-Reply-To: <45A2CF8F.1030806@acm.org> References: <4589C8DB.9010106@acm.org> <45A2CF8F.1030806@acm.org> Message-ID: <45A3F573.2010901@acm.org> Roderick A. Anderson wrote: > Roderick A. Anderson wrote: >> I'm starting here to get some ideas on whether I'm going anywhere near >> the right direction. >> >> We have a Catalyst based application but have been asked to some >> non-View processing while the user continues with other things. >> > > Trouble is the example code from the POE site ( http://pow.perl.org ) OOPS typo http://poe.perl.org > doesn't work for a POST. > > http://poe.perl.org/?POE_Cookbook/CGI_Requests > > Is what I want to use and it uses what I'm used to -- CGI.pm Solved the problem when it became clear it was a SSFF ( sloped shoulders, flat forehead ) issue. I _can_ post the POE server. Where I'm confused now is how to handle the actual process without having the client wait. What I am doing is passing a URI to a pdf file that needs to pulled back followed by some processing. This needs to happen after the client hits the server. I've got a snippet of code like this: # All the POE setup and friends plus URI ( get ) parsing then: $response->code(RC_OK); $response->content( start_html("Posted Values") . "Order Id = " . $oid . br() . "User Id = " . $uid . br() . "URL = " . $url . br() . "md5sum = " . $md5sum . br() . "Image path = " . $ipath . br() . end_html() ); # The actual application code goes here and down # ... return RC_OK; What I should go after the $response-content ( ... ); so the rest of my code runs but the client can continue along its merry way. Rod -- From kevin at scaldeferri.com Tue Jan 9 16:28:47 2007 From: kevin at scaldeferri.com (Kevin Scaldeferri) Date: Tue, 9 Jan 2007 16:28:47 -0800 Subject: [Pdx-pm] Wed 10.Jan - Jiftini - Jifty and a Martini In-Reply-To: References: <45A14280.2050506@gmail.com> Message-ID: <5F7F0DEE-553F-4FC1-A048-1DD93F93DA26@scaldeferri.com> Well, looks like I can't help out bartending after all. My SO has been delayed getting back into town, and the babysitter has the flu, so I'm stuck at home tomorrow. I'll have to be content with making myself a martini at home and lifting it in the direction of FreeGeek. cheers, -kevin On Jan 7, 2007, at 12:54 PM, Kevin Scaldeferri wrote: > Location? > > I'm happy to bartend, although I currently estimate a 20% chance I > won't be able to make the meeting after all. I should be able say > for sure at least 24 hours in advance. > > -kevin > > On Jan 7, 2007, at 10:57 AM, Michael G Schwern wrote: > >> http://pdx.pm.org/kwiki/index.cgi?January2007Meeting >> >> Schwern is giving a jiffy talk (one hour) covering the basics of >> Jifty, Best Practical's new web development framework with a pony. >> We'll be walking through the basics of developing a simple >> application highlighting Jifty's strengths. Audience participation >> is encouraged, so if you have a laptop install Jifty now. >> >> http://jifty.org/ >> >> There will be a beverage service during the talk, martinis. >> Audience members are encouraged to bring their own glass. A couple >> shakers and at least one bottle of vermouth and booze will be >> provided. It is encouraged to bring additional booze and martini >> fixins (olives, bitters, etc...). Wacky martini variations >> encouraged. Non-drinkers are encouraged to bring something fancy >> to sip. >> >> Restless people will be duct-taped (or is that duck-typed?). Duct >> tape to be paid for by the non-member surcharge. >> >> Meeting adjourns to the usual place for the quasi-annual Game >> Night. Please bring your games! >> >> What You Can Do >> >> * Bring a game for game night >> * Have Jifty installed >> * Read up a bit on http://jifty.org >> * Bring a glass >> * Bring some martini fixins >> * Bring additional vermouth and booze >> * Volunteer to play bartender >> * Suggest an opening movie >> >> Notes >> >> Schwern will be arriving back in PDX at 5pm that night, so there's >> a chance he may not make it. In that case, >> _______________________________________________ >> Pdx-pm-list mailing list >> Pdx-pm-list at pm.org >> http://mail.pm.org/mailman/listinfo/pdx-pm-list > From scratchcomputing at gmail.com Tue Jan 9 16:30:54 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Tue, 9 Jan 2007 16:30:54 -0800 Subject: [Pdx-pm] meeting tomorrow Wed 10.Jan - Jiftini - Jifty and a Martini In-Reply-To: <45A30DDA.7000406@gmail.com> References: <45A14280.2050506@gmail.com> <45A30DDA.7000406@gmail.com> Message-ID: <200701091630.54608.ewilhelm@cpan.org> # from Michael G Schwern # on Monday 08 January 2007 07:36 pm: >Where: Free Geek >When: ?6:45pm Yeah, and what else he said. Jifty, duct tape, duck typing, games. If you're not of drinking age, you have to bring somebody who is legally allowed to provide you with hooch. If you need help drinking (or driving) responsibly, bring a designated drinker (or driver.) Note designated drinker and designated driver should be not be the same person. Also note, you may not use someone else's designated drinker as your designated driver, or vice-versa. --Eric -- Moving pianos is dangerous. Moving pianos are dangerous. Buffalo buffalo buffalo buffalo buffalo buffalo buffalo. --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From david.brewer at gmail.com Thu Jan 11 16:35:42 2007 From: david.brewer at gmail.com (David Brewer) Date: Thu, 11 Jan 2007 16:35:42 -0800 Subject: [Pdx-pm] [JOB] Web Application Developer and Interactive Developer at Second Story Message-ID: <2248649a0701111635j24fd6b08p3b8c92004b645b4c@mail.gmail.com> Hi everyone -- I'd like to pass these two job listings from Second Story Interactive (where I work) on to the list. Disclaimer: they're not specifically Perl positions. We tend to end up using a variety of languages because our server-side environment is sometimes determined by the client, so we like polyglots. If you know anyone else who might be interested, please pass it on to them. Thanks! David Brewer ---------------------------------------------------------------------- Web Application Developer Second Story [http://www.secondstory.com/] is reviewing resumes of versatile web application programmers for fulltime or contract positions. Our ideal candidate has experience with object-oriented programming and relational databases, as well as a desire to explore new and emerging technologies for UI development. Should be able to produce results independently as well as collaboratively in a team environment, and be detail oriented with excellent communication skills. Special consideration will be given to candidates who have created projects that are experimental, educational, cultural, and entertainment related. Have experience with or willingness to learn: * One or more programming languages such as PHP, Perl, Java/JSP, Ruby, ActionScript, C++. Proven ability to learn new languages and technologies as needed. * Creating databases and writing SQL queries. * Web application development, including frontend and backend issues. Should be very familiar with browsers and dealing with browser bugs. Knowledge of accessibility issues and Section 508 is a plus. * Experience with symfony, Rails, or similar web application frameworks is a plus. Responsibilities: Work closely with team in a small, fast-paced, creative environment. Participate in concept development and overall project creation. Develop code to realize information structure, user interface, and visual design for the interactive experiences we produce. Actively participate in web application development, website development, HTML front-end development, HTML production, quality assurance. Be part of a technical development team that creates innovative media-rich Web and kiosk projects such as Arago (http://arago.si.edu/), a web site created for the National Postal Museum which shares their extensive collection with the public. If you are an innovator and want an excellent opportunity to bring your skills and learn some new ones, please send your resume and tell us what innovation means to you. Send to careers at secondstory.com. Please reference web developer in your subject line. No phone calls, consultants, or recruiters please. ---------------------------------------------------------------------- Interactive Developer Second Story [http://www.secondstory.com/] is reviewing resumes of experienced interactive developers for full-time or contract positions. Our ideal candidate demonstrates a passion for interactive content development and has a proven track record of pushing the envelope. Proven technical facility with object oriented Flash development and experience marrying compelling interfaces with dynamic data. Must be a good communicator, comfortable following direction, and able to balance great programming with meeting short deadlines. Special consideration will be given to candidates who have created projects that are experimental, educational, cultural, and entertainment related. Have experience with or willingness to learn: * Object Oriented programming (ActionScript, c#). * Interactive development workflow from design to quality assurance. * Developing dynamic data-driven interactive experiences. * Experience with PHP, Perl, Ruby or similar a plus. * Experience combining flash with other technologies and working around its limitations. Responsibilities: Work closely with team in a small, fast-paced, creative environment. Participate in concept development and overall project creation. Actively participate in the technical development and programming for media-rich Web and kiosk projects. Develop code to realize information structure, user interface, and visual design within studio guidelines. Be part of a technical development team that creates websites like Monticello Explorer (http://explorer.monticello.org), a site that provides an immersive experience exploring Thomas Jefferson's Monticello. Create physical interactive experiences like those installed at the McCormick Tribune Freedom Museum (http://secondstory.com/index.php?page=collection&pid=91) If you are an innovator and want an excellent opportunity to bring your skills and learn some new ones, please send your resume and tell us what innovation means to you. Send to careers at secondstory.com. Please reference Interactive Developer in your subject line. No phone calls, consultants, or recruiters please. ---------------------------------------------------------------------- About Second Story: Second Story creates informative and entertaining interactive experiences including media-rich storytelling presentations, online collections, interpretive installations and database-driven applications. Since its founding in 1994, the Second Story team of creative artists, producers, writers, animators and programmers has developed over 150 award-winning interactive projects. The studio takes pride in providing clear and intuitive access to archives, artifacts and information as well as staging compelling storytelling features for the Web, kiosks and other digital media. View the Collected Works at http://www.secondstory.com/collected.php. From andrew.clapp at gmail.com Mon Jan 15 10:35:23 2007 From: andrew.clapp at gmail.com (Andrew Clapp) Date: Mon, 15 Jan 2007 10:35:23 -0800 Subject: [Pdx-pm] Portable Animation in web browsers Message-ID: I am currently investigating using css and lots of javascript (not mine, see this link), http://tiny.verilan.com/cgi-bin/ev.cgi?rm=view_scroll&schedule_id=4&day=2007-01-20 and although I have succeeded with impatience (it kinda works, but is very buggy) and laziness (someone else's 2500+ lines of javascript), my hubris seems to think it should be possible to implement this in a better, more portable and perl-like way. Also, debugging this javascript has become less than fun. Can anyone here suggest a way to do something like this in pure perl (or close), that is browser portable (since I cannot force everyone to use a mozilla product). I've got apache w/ mod_perl. -ASC -- "Yes, could I please have half an order of magnitude and a side of PI?" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/pdx-pm-list/attachments/20070115/a20f7b39/attachment.html From andrew.clapp at gmail.com Mon Jan 15 10:48:55 2007 From: andrew.clapp at gmail.com (Andrew Clapp) Date: Mon, 15 Jan 2007 10:48:55 -0800 Subject: [Pdx-pm] Portable Animation in web browsers In-Reply-To: <659b9ea30701151040ve445745i460b073bd1aa8697@mail.gmail.com> References: <659b9ea30701151040ve445745i460b073bd1aa8697@mail.gmail.com> Message-ID: My apologies, the correct link to the code I'm trying to emulate is here: http://sorgalla.com/jcarousel/ -ASC On 1/15/07, Chris Dawson wrote: > > User/password required, but no place to register, AFAICT. > > Chris > > On 1/15/07, Andrew Clapp wrote: > > I am currently investigating using css and lots of javascript (not mine, > see > > this link), > > > > > http://tiny.verilan.com/cgi-bin/ev.cgi?rm=view_scroll&schedule_id=4&day=2007-01-20 > > > > and although I have succeeded with impatience (it kinda works, but is > very > > buggy) and laziness (someone else's 2500+ lines of javascript), my > hubris > > seems to think it should be possible to implement this in a better, more > > portable and perl-like way. Also, debugging this javascript has become > less > > than fun. > > > > Can anyone here suggest a way to do something like this in pure perl (or > > close), that is browser portable (since I cannot force everyone to use a > > mozilla product). I've got apache w/ mod_perl. > > > > -ASC > > > > -- > > "Yes, could I please have half an order of magnitude and a side of PI?" > > > > _______________________________________________ > > Pdx-pm-list mailing list > > Pdx-pm-list at pm.org > > http://mail.pm.org/mailman/listinfo/pdx-pm-list > > > > > -- "Yes, could I please have half an order of magnitude and a side of PI?" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/pdx-pm-list/attachments/20070115/d8bb9239/attachment.html From jeff at vpservices.com Mon Jan 15 11:02:10 2007 From: jeff at vpservices.com (Jeff Zucker) Date: Mon, 15 Jan 2007 11:02:10 -0800 Subject: [Pdx-pm] Portable Animation in web browsers In-Reply-To: References: Message-ID: <45ABCFB2.90501@vpservices.com> Andrew Clapp wrote: > I am currently investigating using css and lots of javascript (not > mine, see this link), > > http://tiny.verilan.com/cgi-bin/ev.cgi?rm=view_scroll&schedule_id=4&day=2007-01-20 > > > and although I have succeeded with impatience (it kinda works, but is > very buggy) and laziness (someone else's 2500+ lines of javascript), > my hubris seems to think it should be possible to implement this in a > better, more portable and perl-like way. Also, debugging this > javascript has become less than fun. > > Can anyone here suggest a way to do something like this in pure perl > (or close), > Not sure what you mean by "like this" but one of the easiest ways to go between Perl and JavaScript is with the CPAN modules JSON::SYCK or JSON. You create all your data structures in Perl, convert them all into JavaScript structures with a single statement, then send them to the client where they can be poured into JavaScript widgets. There is also JSAN (not related to JSON) which is JavaScript CPAN-act-alike. It contains a number of JavaScript modules that are written with a Perlish flavour. -- Jeff From joshua at keroes.com Mon Jan 15 11:29:54 2007 From: joshua at keroes.com (Joshua Keroes) Date: Mon, 15 Jan 2007 11:29:54 -0800 Subject: [Pdx-pm] Portable Animation in web browsers In-Reply-To: References: <659b9ea30701151040ve445745i460b073bd1aa8697@mail.gmail.com> Message-ID: On 1/15/07, Andrew Clapp wrote: > My apologies, the correct link to the code I'm trying to emulate is here: > > http://sorgalla.com/jcarousel/ You want something like a Fisheye/OSX Dock widget? That's a browser/client-side technology. Perl is a server-side technology. There won't be an all-perl solution to your problem. You've got three portable-ish options: DHTML, AJAX, or plugin. Let's cover the plug-in first. Flash. Flash will do what you want. It has a large installed base. Enough said. Next, you've got DHTML (aka Javascript on the client-side) and AJAX (aka Javascript + a server-side backend). Choosing one or the other depends on whether you know what all of the items in your widget need to do at load-time (DHTML). If they're supposed to get more info or massage data on the backend, you need AJAX. Looks like you want a side-scrolling menu. With buttons. If that's being used to go to different webpages or download programs, then DHTML will suffice. If it's being used to display large images, then you'll save bandwidth by using AJAX and serving images when the AJAX client-side demands it. There are several off-the-shelf so-called AJAX kits that blend the two and export a bunch of useful widgets. I've used other widgets in Dojo before, and while I've had issues dealing with layout (padding, primarily), they seem to get stuff right most of the time. Or I was getting CSS things wrong some of the time; that's a good possibility, too. I'm not a CSS ninja. Anyway, check out Dojo's Fisheye widget [1]. it might do what you're looking for. If it doesn't, check out the various other AJAX libraries [2]. In particular, see if Yahoo (YUI) or Google's libraries will do what you want. -Joshua [1] http://dojotoolkit.org -> see it in action -> general widgets -> fisheye [2] http://www.google.com/search?q=related%3Adojotoolkit.org From scratchcomputing at gmail.com Mon Jan 15 22:22:16 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Mon, 15 Jan 2007 22:22:16 -0800 Subject: [Pdx-pm] OSCON proposal deadline looms again Message-ID: <200701152222.16423.ewilhelm@cpan.org> Already!? Sorry, I totally missed this in the news items last week. "Proposals are due no later than February 5, 2007" http://conferences.oreillynet.com/os2007/ --Eric -- Moving pianos is dangerous. Moving pianos are dangerous. Buffalo buffalo buffalo buffalo buffalo buffalo buffalo. --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From scratchcomputing at gmail.com Mon Jan 15 22:23:26 2007 From: scratchcomputing at gmail.com (The Dread Parrot) Date: Mon, 15 Jan 2007 22:23:26 -0800 Subject: [Pdx-pm] Fwd: [pm_groups] YAPC Europe 2007 - Call for Papers Message-ID: <200701152223.26944.ewilhelm@cpan.org> For this one, you get to submit papers a little closer to the deadline. ---------- Forwarded Message: ---------- Subject: [pm_groups] YAPC Europe 2007 - Call for Papers Date: Friday 12 January 2007 03:02 am From: Michael Kr?ll To: pm_groups at pm.org Please forward this mail to your respective mailing lists. We are pleased to announce the Call for Papers for the YAPC Europe 2007 in Vienna, Austria, 29th to 31st August 2007: http://vienna.yapceurope.org/ye2007/cfp.html The theme for this year's conference is "Social Perl", which we hope will inspire submissions for this and related topics. If Perl has helped you or your company to get people together, or if you can report how Perl is "social" to other programming languages, or how Perl may profit from inspirations from other languages, we'd like to hear about it. Although this is our main topic for the conference, it will not be the only one, and as such we will also be accepting talks on just about any theme. Types of talks include 20 or 40 minutes talks, 60-90 minute tutorials, or 3 hour Hack-a-thons, BOFs or Workshops. Please submit talk proposals via the conference web site until Sunday, 27th May 2007. A Call for Participation will follow in a few weeks. Thanks, The YAPC Europe 2007 Organisers http://vienna.yapceurope.org/ye2007/ -- Request pm.org Technical Support via support at pm.org pm_groups mailing list pm_groups at pm.org http://mail.pm.org/mailman/listinfo/pm_groups ------------------------------------------------------- -- http://pdx.pm.org From merlyn at stonehenge.com Mon Jan 15 22:39:54 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: 15 Jan 2007 22:39:54 -0800 Subject: [Pdx-pm] OSCON proposal deadline looms again In-Reply-To: <200701152222.16423.ewilhelm@cpan.org> References: <200701152222.16423.ewilhelm@cpan.org> Message-ID: <86r6tvzd8l.fsf@blue.stonehenge.com> >>>>> "Eric" == Eric Wilhelm writes: Eric> Already!? Sorry, I totally missed this in the news items last week. Eric> "Proposals are due no later than February 5, 2007" Eric> http://conferences.oreillynet.com/os2007/ Wonderful. They picked THE EXACT SAME WEEK as SAGE-AU in australia, just like last year. {Sigh} Another OSCON I won't be attending. :( -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From xrdawson at gmail.com Mon Jan 15 23:29:44 2007 From: xrdawson at gmail.com (Chris Dawson) Date: Mon, 15 Jan 2007 23:29:44 -0800 Subject: [Pdx-pm] podcast is posted, plus fun reading Message-ID: <659b9ea30701152329o3c432b40uef5583eaa82a332@mail.gmail.com> I posted Schwern's podcast from last week. I brought a spare microphone, thank you. Never ending issues with the microphone at FreeGeek. http://podasp.com:8000/P/PD/PDX.pm/1283.mp3.m3u http://pdxpm.podasp.com/archive.html?pname=meetings.xml Please read this if you like getting these podcasts: http://news.com.com/Senators+aim+to+restrict+Net%2C+satellite+radio+recording/2100-1028_3-6149915.html If we don't put any music at all into these recorded podcasts, in theory we should not have to worry. I still get scared when I see something like this: '...obligated to implement "reasonably available and economically reasonable" copy-protection technology aimed at preventing "music theft" and restricting automatic recording...' This could have been written by a lobbyist, I suppose. I doubt our congresspeople would not know what "reasonably available and economically reasonable DRM" is because I don't know what that is, and this my line of work. Chris From publiustemp-pdxpm at yahoo.com Tue Jan 16 02:16:56 2007 From: publiustemp-pdxpm at yahoo.com (Ovid) Date: Tue, 16 Jan 2007 02:16:56 -0800 (PST) Subject: [Pdx-pm] Fwd: [pm_groups] YAPC Europe 2007 - Call for Papers In-Reply-To: <200701152223.26944.ewilhelm@cpan.org> Message-ID: <340521.70699.qm@web60822.mail.yahoo.com> --- The Dread Parrot wrote: > For this one, you get to submit papers a little closer to the > deadline. Thanks for the link. Here's the proposal I submitted: Multi-Language Test Suites TAP is now generated by test suites written in Perl, Python, PHP, C, and many other languages. However, despite so many languages supporting TAP, there's not been an easy way to run test suites which have tests written with more than one programming language -- until now. Enter TAPx::Parser. With the 'runtests' utility and a properly written 'execrc' file, you can have fine- grained control over how to run individual tests and still have a single test harness collect all results. And the comment I attached to the proposal: Part of the talk is intended to be a demo of TAPx::Parser. I plan to run a test suite written in at least 3 languages, possibly more, and still have a single test harness aggregate the results. Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/ From scratchcomputing at gmail.com Sun Jan 21 13:30:04 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Sun, 21 Jan 2007 13:30:04 -0800 Subject: [Pdx-pm] svn4cpan thinkfest Message-ID: <200701211330.04357.ewilhelm@cpan.org> Hi all, Since we said after the last meeting that this has to happen within one or two weeks, I guess that leaves us with sometime between now and about 8pm on Tuesday. How's Tuesday afternoon running into Tuesday night sound? Urban Grind in the Pearl? I say "thinkfest" and not hackfest because I haven't looked at this code for over a year. Thus, there will be some code review necessary. There are also several things I haven't solved yet, such as what the mirroring and commit-bit management involves. I'm sure hacking will happen, but expect to be prototyping rather than actually finishing. Also, the backpan import being a 17 hour process means we need to come up with a faster way to find all of the edge cases (which may involve the 6 CPUs in these 4 not-racked-yet boxen I'm sitting on.) Once we know the code will survive every tarball, zipfile, and mislabeled shovel, it's no problem to make a fresh svn and let it spin for a day. I think the linearity is worth the extra wait. Of course, it's possible that the hard limit of 3 commits/second exists only in the silly svn client code. Possibly an svk-based import would solve that. There may also be discussion of OSCON proposals, unless somebody wants to host that (and possibly involve booze) on another day. --Eric -- Moving pianos is dangerous. Moving pianos are dangerous. Buffalo buffalo buffalo buffalo buffalo buffalo buffalo. --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From schwern at gmail.com Tue Jan 23 14:39:52 2007 From: schwern at gmail.com (Michael G Schwern) Date: Tue, 23 Jan 2007 14:39:52 -0800 Subject: [Pdx-pm] svn4cpan thinkfest In-Reply-To: <200701211330.04357.ewilhelm@cpan.org> References: <200701211330.04357.ewilhelm@cpan.org> Message-ID: <45B68EB8.5060407@gmail.com> Eric Wilhelm wrote: > Since we said after the last meeting that this has to happen within one > or two weeks, I guess that leaves us with sometime between now and > about 8pm on Tuesday. > > How's Tuesday afternoon running into Tuesday night sound? Urban Grind > in the Pearl? Rats, I'm already booked tonight. Christopher Moore is speaking at Powell's in Beaverton, some friends and I are going. From ben.hengst at gmail.com Tue Jan 23 14:44:16 2007 From: ben.hengst at gmail.com (benh) Date: Tue, 23 Jan 2007 14:44:16 -0800 Subject: [Pdx-pm] svn4cpan thinkfest In-Reply-To: <45B68EB8.5060407@gmail.com> References: <200701211330.04357.ewilhelm@cpan.org> <45B68EB8.5060407@gmail.com> Message-ID: <85ddf48b0701231444i645e89f3t2ebf58679b3a8dc6@mail.gmail.com> Doom! I also have plans of tonight, rats! Schwern enjoy the talk. On 1/23/07, Michael G Schwern wrote: > Eric Wilhelm wrote: > > Since we said after the last meeting that this has to happen within one > > or two weeks, I guess that leaves us with sometime between now and > > about 8pm on Tuesday. > > > > How's Tuesday afternoon running into Tuesday night sound? Urban Grind > > in the Pearl? > > Rats, I'm already booked tonight. Christopher Moore is speaking at Powell's in Beaverton, some friends and I are going. > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > -- benh~ From schwern at gmail.com Tue Jan 23 14:49:19 2007 From: schwern at gmail.com (Michael G Schwern) Date: Tue, 23 Jan 2007 14:49:19 -0800 Subject: [Pdx-pm] February meeting reschedule? Message-ID: <45B690EF.8030903@gmail.com> I was just looking at the calendar and noticed our normal meeting time of the 2nd Wednesday of the month happens to fall on Valentine's Day. Disparaging remarks about geeks' love lives aside, some folks might have better things to do on that day than sit around and talk about Perl no matter how many fancy drinks we offer at the meeting. OTOH, those who celebrate February 14th as Singles Awareness Day might be quite happy to do something that doesn't involve hearts and roses and sappy cards. So, leave it on the 14th or move it to another day? Who's willing to show up on the 14th? PS I'm probably not going to be in town anyway. From jeff at zeroclue.com Tue Jan 23 15:35:11 2007 From: jeff at zeroclue.com (Jeff Lavallee) Date: Tue, 23 Jan 2007 15:35:11 -0800 Subject: [Pdx-pm] svn4cpan thinkfest In-Reply-To: <45B68EB8.5060407@gmail.com> References: <200701211330.04357.ewilhelm@cpan.org> <45B68EB8.5060407@gmail.com> Message-ID: <45B69BAF.5010004@zeroclue.com> Michael G Schwern wrote: > Eric Wilhelm wrote: >> Since we said after the last meeting that this has to happen within one >> or two weeks, I guess that leaves us with sometime between now and >> about 8pm on Tuesday. >> >> How's Tuesday afternoon running into Tuesday night sound? Urban Grind >> in the Pearl? > > Rats, I'm already booked tonight. Christopher Moore is speaking at Powell's in Beaverton, some friends and I are going. What's the good word? I can make this evening, but I'm a little under the weather so I'd happily postpone as well. From scratchcomputing at gmail.com Tue Jan 23 15:36:00 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Tue, 23 Jan 2007 15:36:00 -0800 Subject: [Pdx-pm] February meeting reschedule? (what February meeting!?) In-Reply-To: <45B690EF.8030903@gmail.com> References: <45B690EF.8030903@gmail.com> Message-ID: <200701231536.00631.ewilhelm@cpan.org> # from Michael G Schwern # on Tuesday 23 January 2007 02:49 pm: >OTOH, those who celebrate February 14th as Singles Awareness Day might > be quite happy to do something that doesn't involve hearts and roses > and sappy cards. > >So, leave it on the 14th or move it to another day? ?Who's willing to > show up on the 14th? Hmm, given that we currently don't have a topic, the non-single members are going to have a hard time making an excuse for not having reservations at restaurantX on the one night of the year when you have to call 10 months in advance. First Wednesday (Feb 7th)? Can anybody come up with a topic before then? How about an anatomy lab on PAR::Packer/Module::ScanDeps guts? --Eric -- So malloc calls a timeout and starts rummaging around the free chain, sorting things out, and merging adjacent small free blocks into larger blocks. This takes 3 1/2 days. --Joel Spolsky --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From scratchcomputing at gmail.com Tue Jan 23 15:39:09 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Tue, 23 Jan 2007 15:39:09 -0800 Subject: [Pdx-pm] svn4cpan thinkfest In-Reply-To: <85ddf48b0701231444i645e89f3t2ebf58679b3a8dc6@mail.gmail.com> References: <200701211330.04357.ewilhelm@cpan.org> <45B68EB8.5060407@gmail.com> <85ddf48b0701231444i645e89f3t2ebf58679b3a8dc6@mail.gmail.com> Message-ID: <200701231539.09443.ewilhelm@cpan.org> # from benh # on Tuesday 23 January 2007 02:44 pm: >Doom! I also have plans of tonight, rats! >On 1/23/07, Michael G Schwern wrote: >> Rats, I'm already booked tonight. And there was much hair-washing... But, wait. Isn't procrastination the father of all invention? Ok, we'll reschedule for Thursday. Let's get on IRC and pick a time. --Eric -- "Everything goes wrong all at once." --Quantized Revision of Murphy's Law --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From ben.hengst at gmail.com Tue Jan 23 22:10:32 2007 From: ben.hengst at gmail.com (benh) Date: Tue, 23 Jan 2007 22:10:32 -0800 Subject: [Pdx-pm] svn4cpan thinkfest In-Reply-To: <200701231539.09443.ewilhelm@cpan.org> References: <200701211330.04357.ewilhelm@cpan.org> <45B68EB8.5060407@gmail.com> <85ddf48b0701231444i645e89f3t2ebf58679b3a8dc6@mail.gmail.com> <200701231539.09443.ewilhelm@cpan.org> Message-ID: <85ddf48b0701232210r769ab3f5s988cfdd81dede280@mail.gmail.com> I'm game for thrs. On 1/23/07, Eric Wilhelm wrote: > # from benh > # on Tuesday 23 January 2007 02:44 pm: > > >Doom! I also have plans of tonight, rats! > >On 1/23/07, Michael G Schwern wrote: > >> Rats, I'm already booked tonight. > > And there was much hair-washing... But, wait. Isn't procrastination > the father of all invention? > > Ok, we'll reschedule for Thursday. Let's get on IRC and pick a time. > > --Eric > -- > "Everything goes wrong all at once." > --Quantized Revision of Murphy's Law > --------------------------------------------------- > http://scratchcomputing.com > --------------------------------------------------- > -- benh~ From mikeraz at patch.com Wed Jan 24 15:36:08 2007 From: mikeraz at patch.com (Michael Rasmussen) Date: Wed, 24 Jan 2007 15:36:08 -0800 (PST) Subject: [Pdx-pm] forking Message-ID: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> Consider this code representation: while( database_query ) { bunch of stuff if(my $pid = fork) { parent processing } else { # child stuff follows if( ! $test_target ) { print "WTF? No $test_target?\n"; $ret = test_it($test_target); exit $ret; } } } At this point you may be chuckling, scratching your head, wiping beverages off the monitor or ... If you're scratching your head study the code until the light goes on. It is not recommended to implement a test case to see what happens. This is especially not recommended if you like your database or the responsiveness of your system. -- Michael Rasmussen, Portland, Ore, USA Be Appropriate && Follow Your Curiosity http://www.patch.com/words/ -- Michael Rasmussen, Portland, Ore, USA Be Appropriate && Follow Your Curiosity http://www.patch.com/words/ From schwern at gmail.com Wed Jan 24 16:36:54 2007 From: schwern at gmail.com (Michael G Schwern) Date: Wed, 24 Jan 2007 16:36:54 -0800 Subject: [Pdx-pm] Debian Sysadmin Job @ Open Sourcery Message-ID: <45B7FBA6.5030506@gmail.com> The folks over at Open Sourcery asked if I knew anyone interested in a sysadmin job. I figure I do, so here's the job listing. http://www.opensourcery.com/about/careers/system_administrator Email your resume to hr42 at opensourcery.com Resume/CV's need to be in ODT or ASCII format. OpenSourcery is looking for a mid to senior level systems administrator to join our team. System Administrators are tasked with design and implementation of primary IT systems for clients ranging from email, LAMP, wireless, Ubuntu desktop migrations, and Asterisk telephony. We touch it all, and you will work in an environment where continual learning is required. We also support our software development team with responsibility for internal IT, and systems for implementing the final software product for clients. Required Non-Technical Skills * Communication skills. Ability to communicate ideas to engineering team or client about a particular design. * Time management skills. We are a project-based consultancy where billable time tracking is required; must be able to manage time spent on design and implementation work. * Project scoping. Must be able to work with the team on time estimates. * Strong documentation skills. We write documentation on all of our projects for future reference and knowledge transfer to our clients. * On-call support. We offer 24x7 support, and all system administrators follow a rotating schedule with fair compensation. * Transportation is required for on-site client visits. This includes the Portland Metro area. OpenSourcery gives additional reimbursement for biodiesel use. * Must be able to lift 50 lbs. Required Technical Skills * Email system design: redundancy, load balancing, postfix, courier/dovecot, webmail systems. * Networking: DNS (djbdns), iptables, OpenVPN, openssh, basic switching & routing * Web: LAMP systems, apache2, AAA, virtual domains, logging and statistics, performance optimizing, load balancing, redundancy * Network Management: SNMP, Nagios, Cacti(or other stats programs) * Distributions: Debian/Ubuntu(primary), RHEL/CentOS * File Sharing: Samba/CIFS, NFS, WebDAV * Databases: Installation, configuration and maintenance of MySQL and Postgres * Basic scripting: bash, python, perl * Backup systems: BackupPC, tar, rsync Preferred Non-Technical Skills * Formal Systems process management (ITIL, etc.) * Change Control experience: change management, issue handling, client communications * Request management: Request Tracker Preferred Technical Skills * Directory services: Fedora Directory Server/OpenLDAP, its uses in single sign-on and authentication. * Authentication services: PAM, Kerberos, Apache basic * Mixed environment applications: Active Directory, Windows XP/2003 networking * Telephony applications: Asterisk, SIP, IAX2, rollout and cutover planning * Design, redundancy, performance, and capacity planning for all aspects of our technical abilities * Change control: subversion Experience * 5 years professional experience working directly in UNIX, GNU/Linux environments * 2 years experience in medium to large UNIX, GNU/Linux IT environments (University, Corporate, etc) Optional Certifications * LPI * RHCE * CCNA/CCNP * Resume/CV's need to be in ODT or ASCII format. * Email your resume to hr42 at opensourcery.com From schwern at gmail.com Wed Jan 24 23:38:49 2007 From: schwern at gmail.com (Michael G Schwern) Date: Wed, 24 Jan 2007 23:38:49 -0800 Subject: [Pdx-pm] forking In-Reply-To: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> References: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> Message-ID: <45B85E89.4080103@gmail.com> Michael Rasmussen wrote: > Consider this code representation: > > while( database_query ) { > > bunch of stuff > > if(my $pid = fork) { > parent processing > } else { # child stuff follows > if( ! $test_target ) { > print "WTF? No $test_target?\n"; > $ret = test_it($test_target); > exit $ret; > } > } > } > > At this point you may be chuckling, scratching your head, wiping beverages off the > monitor or ... Or having no idea. I give, what's the gag? > If you're scratching your head study the code until the light goes on. It is not > recommended to implement a test case to see what happens. This is especially not > recommended if you like your database or the responsiveness of your system. From chromatic at wgz.org Wed Jan 24 23:42:27 2007 From: chromatic at wgz.org (chromatic) Date: Wed, 24 Jan 2007 23:42:27 -0800 Subject: [Pdx-pm] forking In-Reply-To: <45B85E89.4080103@gmail.com> References: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> <45B85E89.4080103@gmail.com> Message-ID: <200701242342.27948.chromatic@wgz.org> On Wednesday 24 January 2007 23:38, Michael G Schwern wrote: > Or having no idea. I give, what's the gag? It's generally better if the child processes don't also fork(). -- c From schwern at gmail.com Thu Jan 25 00:37:06 2007 From: schwern at gmail.com (Michael G Schwern) Date: Thu, 25 Jan 2007 00:37:06 -0800 Subject: [Pdx-pm] forking In-Reply-To: <200701242342.27948.chromatic@wgz.org> References: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> <45B85E89.4080103@gmail.com> <200701242342.27948.chromatic@wgz.org> Message-ID: <45B86C32.4000009@gmail.com> chromatic wrote: > On Wednesday 24 January 2007 23:38, Michael G Schwern wrote: > >> Or having no idea. I give, what's the gag? > > It's generally better if the child processes don't also fork(). Nope, still don't see it. Maybe someone can draw a map of the joke? From mikeraz at patch.com Thu Jan 25 05:08:54 2007 From: mikeraz at patch.com (Michael Rasmussen) Date: Thu, 25 Jan 2007 05:08:54 -0800 Subject: [Pdx-pm] forking In-Reply-To: <45B85E89.4080103@gmail.com> References: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> <45B85E89.4080103@gmail.com> Message-ID: <20070125130854.GB14581@patch.com> Michael G Schwern wrote: > Michael Rasmussen wrote: > > Consider this code representation: > > > > while( database_query ) { > > > > bunch of stuff > > > > if(my $pid = fork) { > > parent processing > > } else { # child stuff follows > > if( ! $test_target ) { > > print "WTF? No $test_target?\n"; > > $ret = test_it($test_target); > > exit $ret; > > } > > } > > } > > > > At this point you may be chuckling, scratching your head, wiping beverages off the > > monitor or ... > > Or having no idea. I give, what's the gag? I thought you were kidding. I was almost embarrassed to post it... A re-write: while( database_query ) { bunch of stuff if(my $pid = fork) { parent processing # so far so good } else { # child stuff follows if(! $test_target) { print "WTF? No $test_target?\n"; # should have a $test_target, something is wrong here $ret = test_it($test_target); # no target? are you sure a test is a sane thing to do? exit $ret; # give a result and quit being childish } # flow here if we have a target to test } # how special, the child program flow now joins with the parent, real family togetherness } # loop up for another db query, parent activities, another fork ... When I ran it the first clue was DBI errors about attempts to write to a locked db, and I only write in two parent places second clue was the system load averages staying very low, .05, but the system became unresponsive third clue was I/O wait shot up to 90%+, while all other sysload items stayed low, including swap fourth clue was "ps -ef | grep perl | perl -nae 'print $F[1],$/;' | xargs -n 1 kill -9" (Solaris system) would kill lots of processes and at the end I'd have lots still running. fifth clue was it worked fine a few days ago, so I must have done something... I believe this is called a fork bomb. -- Michael Rasmussen, Portland Oregon Be appropriate && Follow your curiosity http://www.patch.com/words/ The fortune cookie says: Satire is tragedy plus time. -- Lenny Bruce From rootbeer at redcat.com Thu Jan 25 07:43:24 2007 From: rootbeer at redcat.com (Tom Phoenix) Date: Thu, 25 Jan 2007 07:43:24 -0800 Subject: [Pdx-pm] forking In-Reply-To: <45B86C32.4000009@gmail.com> References: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> <45B85E89.4080103@gmail.com> <200701242342.27948.chromatic@wgz.org> <45B86C32.4000009@gmail.com> Message-ID: <31086b240701250743u52faf7abof17b5e94a830024@mail.gmail.com> On 1/25/07, Michael G Schwern wrote: > Nope, still don't see it. Maybe someone can draw a map of the joke? Maybe it's because, for each time $test_target is true, another child process falls into the parent process's code...? --Tom Phoenix From merlyn at stonehenge.com Thu Jan 25 10:36:26 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Thu, 25 Jan 2007 10:36:26 -0800 Subject: [Pdx-pm] forking In-Reply-To: <20070125130854.GB14581@patch.com> (Michael Rasmussen's message of "Thu, 25 Jan 2007 05:08:54 -0800") References: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> <45B85E89.4080103@gmail.com> <20070125130854.GB14581@patch.com> Message-ID: <861wljrm1h.fsf@blue.stonehenge.com> >>>>> "Michael" == Michael Rasmussen writes: Michael> I believe this is called a fork bomb. I've learned to always type "die" at the end of the child branch from the moment I type the fork. I won't say how I've learned. :) defined(my $kid = fork) or die "Cannot fork: $!"; unless ($kid) { # kid does ... die "should not reach here"; # this gets added first.. } -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From scratchcomputing at gmail.com Thu Jan 25 13:00:58 2007 From: scratchcomputing at gmail.com (The Dread Parrot) Date: Thu, 25 Jan 2007 13:00:58 -0800 Subject: [Pdx-pm] Fwd: OSCON 2007 Call for Participation Ends Soon Message-ID: <200701251300.58737.ewilhelm@cpan.org> ---------- Forwarded Message: ---------- Subject: OSCON 2007 Call for Participation Ends Soon Date: Thursday 25 January 2007 11:29 am From: O'Reilly Conferences To: ewilhelm at cpan.org Be Heard at OSCON 2007 -- Submit Your Proposal to Lead Sessions and Tutorials by February 5! The O'Reilly Open Source Convention July 23-27, 2007 Portland, Oregon http://conferences.oreillynet.com/os2007/ More than 2500 open source developers, gurus, experts and users will gather, eager to network, learn, and share the latest knowledge on open source software. We think of this group as "the best of the best," and we invite you to contribute to the more than 400 sessions and 40 tutorials designed to build inspiration and know-how. Submit your proposals at: http://conferences.oreillynet.com/cs/os2007/create/e_sess Share your favorite techniques, your proven successes, and newly developed technology in tracks for Linux, PHP, Perl, Python, Ruby, Java, Databases, Desktop Applications, Web Applications (client-side and server-side), Windows, Administration, Security, and Emerging Topics. No topic (other than closed source software) is off-limits, so send us your best ideas. Among the hot topics we want to hear about are: - Tools for the administration and deployment of large server farms - Parallelization, grid, and multicore technologies - Virtualization - Ajax, Javascript, standards-based design, and other client-side web issues - Seaside, Rails, Django, and other interesting server-side technology - Ubuntu as an emergent usable Linux distro and contender for Red Hat and Sun's client and server markets - Java as open source - AI, machine learning, and other ways of making software smarter than the people using it - User experience and usability engineering lessons for web and desktop software - The spread of open source into law, culture, data, and services, and the accompanying issues and lessons For full details and guidelines on submitting your proposal, go to http://conferences.oreillynet.com/os2007/. If you know someone who would be a good speaker, please pass this email on. Whether as a speaker or as an attendee, you'll want to participate in this meeting of the best minds in the business, which will also include the O'Reilly Radar Executive Briefing. Be sure to save the dates -- July 23-27. Registration will open in early April. We hope to see you in Portland in July! The OSCON Team P.S. Remember, proposals for sessions and tutorials must be submitted to http://conferences.oreillynet.com/os2007/ by (11:59PM Pacific Standard Time) Monday, February 5. ******************************************************* To change your newsletter subscription options, please visit http://www.oreillynet.com/cs/nl/home. To unsubscribe from O'Reilly conference announcements, email conferences-unsubscribe at oreilly.com. For assistance, email help at oreillynet.com. O'Reilly Media, Inc. 1005 Gravenstein Highway North, Sebastopol, CA 95472 ******************************************************* ------------------------------------------------------- -- http://pdx.pm.org From scratchcomputing at gmail.com Thu Jan 25 13:09:20 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Thu, 25 Jan 2007 13:09:20 -0800 Subject: [Pdx-pm] svn4cpan thinkfest In-Reply-To: <85ddf48b0701232210r769ab3f5s988cfdd81dede280@mail.gmail.com> References: <200701211330.04357.ewilhelm@cpan.org> <200701231539.09443.ewilhelm@cpan.org> <85ddf48b0701232210r769ab3f5s988cfdd81dede280@mail.gmail.com> Message-ID: <200701251309.20290.ewilhelm@cpan.org> # from benh # on Tuesday 23 January 2007 10:10 pm: >I'm game for thrs. Ok, we're thinking 6:30 or so, and I was leaning toward Jax, but their side room has a party, and then there will be Jazz. Paddy's? I'd like someplace on or near the Max line. Wifi is critical, drinks are good, but just beer would be acceptable. --Eric -- "Left to themselves, things tend to go from bad to worse." --Murphy's Corollary --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From alan at clueserver.org Thu Jan 25 13:12:17 2007 From: alan at clueserver.org (alan) Date: Thu, 25 Jan 2007 13:12:17 -0800 (PST) Subject: [Pdx-pm] svn4cpan thinkfest In-Reply-To: <200701251309.20290.ewilhelm@cpan.org> References: <200701211330.04357.ewilhelm@cpan.org> <200701231539.09443.ewilhelm@cpan.org> <85ddf48b0701232210r769ab3f5s988cfdd81dede280@mail.gmail.com> <200701251309.20290.ewilhelm@cpan.org> Message-ID: On Thu, 25 Jan 2007, Eric Wilhelm wrote: > # from benh > # on Tuesday 23 January 2007 10:10 pm: > >> I'm game for thrs. > > Ok, we're thinking 6:30 or so, and I was leaning toward Jax, but their > side room has a party, and then there will be Jazz. > > Paddy's? I'd like someplace on or near the Max line. Wifi is critical, > drinks are good, but just beer would be acceptable. Paddy's has wireless. (I know. I installed it.) The meeting room in back is small. They have "The Wall of Alcohol(tm)". (As Richard Nixon said, "This is a Great Wall".) -- "Invoking the supernatural can explain anything, and hence explains nothing." - University of Utah bioengineering professor Gregory Clark From schwern at gmail.com Thu Jan 25 13:26:24 2007 From: schwern at gmail.com (Michael G Schwern) Date: Thu, 25 Jan 2007 13:26:24 -0800 Subject: [Pdx-pm] forking In-Reply-To: <31086b240701250743u52faf7abof17b5e94a830024@mail.gmail.com> References: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> <45B85E89.4080103@gmail.com> <200701242342.27948.chromatic@wgz.org> <45B86C32.4000009@gmail.com> <31086b240701250743u52faf7abof17b5e94a830024@mail.gmail.com> Message-ID: <45B92080.2040105@gmail.com> Tom Phoenix wrote: > On 1/25/07, Michael G Schwern wrote: > >> Nope, still don't see it. Maybe someone can draw a map of the joke? > > Maybe it's because, for each time $test_target is true, another child > process falls into the parent process's code...? *light bulb!* Thank you, Tom. You're better than AAA. Stuff like this just adds to my conviction that the fork() interface sucks. http://mail.pm.org/pipermail/pdx-pm-list/2006-December/003945.html From ben.hengst at gmail.com Thu Jan 25 13:29:30 2007 From: ben.hengst at gmail.com (benh) Date: Thu, 25 Jan 2007 13:29:30 -0800 Subject: [Pdx-pm] svn4cpan thinkfest In-Reply-To: References: <200701211330.04357.ewilhelm@cpan.org> <200701231539.09443.ewilhelm@cpan.org> <85ddf48b0701232210r769ab3f5s988cfdd81dede280@mail.gmail.com> <200701251309.20290.ewilhelm@cpan.org> Message-ID: <85ddf48b0701251329u6afe8717h9f0d5458354a0a52@mail.gmail.com> alan, is this the map to the right paddy's? http://maps.google.com/maps?f=q&hl=en&q=Paddy%27s+Portland+OR&ie=UTF8&z=15&ll=45.523608,-122.674499&spn=0.020025,0.027809&om=1&iwloc=A On 1/25/07, alan wrote: > On Thu, 25 Jan 2007, Eric Wilhelm wrote: > > > # from benh > > # on Tuesday 23 January 2007 10:10 pm: > > > >> I'm game for thrs. > > > > Ok, we're thinking 6:30 or so, and I was leaning toward Jax, but their > > side room has a party, and then there will be Jazz. > > > > Paddy's? I'd like someplace on or near the Max line. Wifi is critical, > > drinks are good, but just beer would be acceptable. > > Paddy's has wireless. (I know. I installed it.) The meeting room in back > is small. They have "The Wall of Alcohol(tm)". (As Richard Nixon said, > "This is a Great Wall".) > > -- > "Invoking the supernatural can explain anything, and hence explains nothing." > - University of Utah bioengineering professor Gregory Clark > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > -- benh~ From merlyn at stonehenge.com Thu Jan 25 13:47:03 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Thu, 25 Jan 2007 13:47:03 -0800 Subject: [Pdx-pm] forking In-Reply-To: <45B92080.2040105@gmail.com> (Michael G. Schwern's message of "Thu, 25 Jan 2007 13:26:24 -0800") References: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> <45B85E89.4080103@gmail.com> <200701242342.27948.chromatic@wgz.org> <45B86C32.4000009@gmail.com> <31086b240701250743u52faf7abof17b5e94a830024@mail.gmail.com> <45B92080.2040105@gmail.com> Message-ID: <86fy9yrd7s.fsf@blue.stonehenge.com> >>>>> "Michael" == Michael G Schwern writes: Michael> Stuff like this just adds to my conviction that the fork() interface sucks. Maybe, but the alternatives suck harder. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From tex at off.org Thu Jan 25 13:44:00 2007 From: tex at off.org (Austin Schutz) Date: Thu, 25 Jan 2007 13:44:00 -0800 Subject: [Pdx-pm] forking In-Reply-To: <86fy9yrd7s.fsf@blue.stonehenge.com> References: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> <45B85E89.4080103@gmail.com> <200701242342.27948.chromatic@wgz.org> <45B86C32.4000009@gmail.com> <31086b240701250743u52faf7abof17b5e94a830024@mail.gmail.com> <45B92080.2040105@gmail.com> <86fy9yrd7s.fsf@blue.stonehenge.com> Message-ID: <20070125214400.GK32358@gblx.net> On Thu, Jan 25, 2007 at 01:47:03PM -0800, Randal L. Schwartz wrote: > >>>>> "Michael" == Michael G Schwern writes: > > Michael> Stuff like this just adds to my conviction that the fork() interface sucks. > > Maybe, but the alternatives suck harder. :) > The socket() interface sucks too, but who uses it directly? There are lots of tools available to manage processes. Austin From alan at clueserver.org Thu Jan 25 14:04:40 2007 From: alan at clueserver.org (alan) Date: Thu, 25 Jan 2007 14:04:40 -0800 (PST) Subject: [Pdx-pm] forking In-Reply-To: <86fy9yrd7s.fsf@blue.stonehenge.com> References: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> <45B85E89.4080103@gmail.com> <200701242342.27948.chromatic@wgz.org> <45B86C32.4000009@gmail.com> <31086b240701250743u52faf7abof17b5e94a830024@mail.gmail.com> <45B92080.2040105@gmail.com> <86fy9yrd7s.fsf@blue.stonehenge.com> Message-ID: On Thu, 25 Jan 2007, Randal L. Schwartz wrote: >>>>>> "Michael" == Michael G Schwern writes: > > Michael> Stuff like this just adds to my conviction that the fork() interface sucks. > > Maybe, but the alternatives suck harder. :) What does he want, a spork()? -- "Invoking the supernatural can explain anything, and hence explains nothing." - University of Utah bioengineering professor Gregory Clark From alan at clueserver.org Thu Jan 25 14:07:17 2007 From: alan at clueserver.org (alan) Date: Thu, 25 Jan 2007 14:07:17 -0800 (PST) Subject: [Pdx-pm] svn4cpan thinkfest In-Reply-To: <85ddf48b0701251329u6afe8717h9f0d5458354a0a52@mail.gmail.com> References: <200701211330.04357.ewilhelm@cpan.org> <200701231539.09443.ewilhelm@cpan.org> <85ddf48b0701232210r769ab3f5s988cfdd81dede280@mail.gmail.com> <200701251309.20290.ewilhelm@cpan.org> <85ddf48b0701251329u6afe8717h9f0d5458354a0a52@mail.gmail.com> Message-ID: On Thu, 25 Jan 2007, benh wrote: > alan, is this the map to the right paddy's? > > http://maps.google.com/maps?f=q&hl=en&q=Paddy%27s+Portland+OR&ie=UTF8&z=15&ll=45.523608,-122.674499&spn=0.020025,0.027809&om=1&iwloc=A Yes. > > On 1/25/07, alan wrote: >> On Thu, 25 Jan 2007, Eric Wilhelm wrote: >> >> > # from benh >> > # on Tuesday 23 January 2007 10:10 pm: >> > >> >> I'm game for thrs. >> > >> > Ok, we're thinking 6:30 or so, and I was leaning toward Jax, but their >> > side room has a party, and then there will be Jazz. >> > >> > Paddy's? I'd like someplace on or near the Max line. Wifi is critical, >> > drinks are good, but just beer would be acceptable. >> >> Paddy's has wireless. (I know. I installed it.) The meeting room in back >> is small. They have "The Wall of Alcohol(tm)". (As Richard Nixon said, >> "This is a Great Wall".) >> >> -- >> "Invoking the supernatural can explain anything, and hence explains >> nothing." >> - University of Utah bioengineering professor Gregory >> Clark >> _______________________________________________ >> Pdx-pm-list mailing list >> Pdx-pm-list at pm.org >> http://mail.pm.org/mailman/listinfo/pdx-pm-list >> > > > -- "Invoking the supernatural can explain anything, and hence explains nothing." - University of Utah bioengineering professor Gregory Clark From randall at sonofhans.net Thu Jan 25 14:23:04 2007 From: randall at sonofhans.net (Randall Hansen) Date: Thu, 25 Jan 2007 14:23:04 -0800 Subject: [Pdx-pm] forking In-Reply-To: References: <53668.170.135.112.12.1169681768.squirrel@mail.patch.com> <45B85E89.4080103@gmail.com> <200701242342.27948.chromatic@wgz.org> <45B86C32.4000009@gmail.com> <31086b240701250743u52faf7abof17b5e94a830024@mail.gmail.com> <45B92080.2040105@gmail.com> <86fy9yrd7s.fsf@blue.stonehenge.com> Message-ID: <01744C06-AF7D-4C1E-90CE-70BE9488B37A@sonofhans.net> On Jan 25, 2007, at 2:04 PM, alan wrote: > What does he want, a spork()? http://search.cpan.org/~ingy/Spork-0.20/lib/Spork.pm r From scratchcomputing at gmail.com Fri Jan 26 23:21:01 2007 From: scratchcomputing at gmail.com (The Dread Parrot) Date: Fri, 26 Jan 2007 23:21:01 -0800 Subject: [Pdx-pm] Fwd: Newsletter from O'Reilly UG Program, January 26 Message-ID: <200701262321.01983.ewilhelm@cpan.org> Hi all, It appears that these newsletters are getting so long that the mailing list manager bounces them. Unfortunately, it doesn't look like http://ug.oreilly.com/ has an up-to-date copy, so you're stuck with the automated hack-job of editing that I do with them. If you're looking for 10 books on vista and word, you're reading the wrong mailing list. Anyway, it says check out the new releases and let me know if you want a review copy. "Pattern not found: perl", ... `egrep '^(\*\*\*| ... ---------------------------------------------------------------- General News or Inquiries ---------------------------------------------------------------- ***Looking for Slashdot reviewers for the following titles: Linux Kernel in a Nutshell MySQL Cookbook Web Services and Ajax Google Web Toolkit ================================================================ O'Reilly News for User Group Members January 26, 2007 ================================================================ ---------------------------------------------------------------- New Releases ---------------------------------------------------------------- -Access 2007 for Starters: The Missing Manual -ActionScript 3.0 Programming (PDF) -The Book of JavaScript, Second Edition -Botnets: The Killer Web App -Comp TIA RFID+ Study Guide and Practice Exam (RFO-001) -CRAFT: Volume 02 -Cyber Crime Investigations -Developers Guide to Web Application Security -Eight Great Ways to Get the Most from Your Zune -Essential Electronics for Software Folk -Excel 2007 for Starters: The Missing Manual -Google Web Toolkit for Ajax (PDF) -Introduction to Neogeography -The OpenBSD 4.0 Crash Course -Physical and Logical Security Convergence: Powered By Enterprise Security Management -PowerPoint 2007 for Starters: The Missing Manual -Programming Firefox: Rough Cuts Version -Rails Cookbook (Book or PDF) -Rails for Java Developers -Release It! -Secure Your Network for Free -Software Testing Foundations, Second Edition -The OpenBSD 4.0 Crash Course (PDF) -Using Samba, Third Edition -Using XForms with Mozilla (PDF) -What's New in Windows Vista? -Windows Developer Power Tools -Windows Vista for Starters: The Missing Manual -Windows Vista in a Nutshell -Word 2007 for Starters: The Missing Manual -MAKE & CRAFT Magazine Subscriptions ---------------------------------------------------------------- Upcoming Events ---------------------------------------------------------------- -O'Reilly at ASTD TechKnowledge 2007, Las Vegas, NV-- January 31-February 2 -Geek Cruise Features David Pogue, Deke McClelland, and Eddie Tapp, Eastern Caribbean--February 3-10 -O'Reilly at Conferencia Internacional de Software Libre 3.0--Feb 7-11 -Peter Krogh ("The DAM Book: Digital Asset Management for Photographers") ASMP Evening and Next Day Presentations, Philadelphia, PA--February 8-9 -O'Reilly at RoR eXchange 2007, London, UK--Feb 9 -Rob Orsini ("Rails Cookbook") at the North Bay Rails User's Group, Sebastopol, CA--February 15 -Rasmus Lerdorf at the 2007 PHP Conference, London, UK--February 23 -Derrick Story ("Digital Photography Pocket Guide, 3rd Edition) at NCMUG, Rohnert Park, CA--February 20 -Emerging Telephony Conference 2007,Burlingame, CA-- February 27-March 1 -Rob Orsini ("Rails Cookbook") at SOCOSA, Sebastopol, CA--March 6 -Peter Morville, "Information Architecture & Search" International Master Class, Sydney, Australia--March 8-9 -O'Reilly Authors at South by Southwest, Austin, TX--March 9-13 -O'Reilly at ASTD TechKnowledge 2007, Las Vegas, NV-- January 31-February 2 -O'Reilly at the Photo Marketing Association, Las Vegas, NV--March 8-11 -O'Reilly at SD West, Santa Clara, CA--March 20-22, 2007 ---------------------------------------------------------------- Conference News ---------------------------------------------------------------- -New 40% Discount for the 2007 Emerging Telephony Conference -Call for Participation for O'Reilly Open Source Convention -Call for Participation for O'Reilly Energy Innovation Conference -Register for ETech 2007 -Register for Web 2.0 Expo ---------------------------------------------------------------- News ---------------------------------------------------------------- -Craftzine Interviews Amy Sedaris, Author of "I Like You: Hospitality Under the Influence" -David Pogue (Missing Manual Creator) talks with the Public Libraries Association in the ?Podcast from Hell? -Publishing for (Sales) Success -New Course Featuring AJAX--O'Reilly/University of Illinois Certificate Series -Why I Stopped Coding and Why I'd Start Again -Greylisting with PF -Compare, Select, and Rate -Free Pass for Photoshop World Tech Expo -Digital Media Insider Podcast 6: Desktop Music in Japan -Macworld 2007: 1984 All Over Again -My Favorite Macworld Product: Indigo -The Case for Freeware and Open Source Windows Tools -The Five Best and Worst Things About Vista -Word 2007 Missing Manual Screencast: Word's Ribbon -Build a .NET App for Google Checkout -Discovering a Java Application's Security Requirements -Review/Preview: 2006 and 2007 in Java -Accessible JavaScript -SD West--Free Expo Pass -Let's Speculate for 2007 --------------------------------------------------------------- New Releases--Books, PDFs, and Rough Cuts ---------------------------------------------------------------- Get 35% off from O'Reilly, No Starch, Paraglyph, PC Publishing, Pragmatic Bookshelf, SitePoint, Syngress, or YoungJin books you purchase directly from O'Reilly. Just use code DSUG when ordering online or by phone 800-998-9938. Free ground shipping on orders of $29.95 or more. For more details, go to: Did you know you can request a free book or PDF to review for your group? Ask your group leader for more information. For book review writing tips and suggestions, go to: ***Access 2007 for Starters: The Missing Manual ***ActionScript 3.0 Programming (PDF) ***The Book of JavaScript, Second Edition ***Botnets: The Killer Web App ***Comp TIA RFID+ Study Guide and Practice Exam (RFO-001) ***CRAFT: Volume 02 ***Cyber Crime Investigations ***Developers Guide to Web Application Security ***Eight Great Ways to Get the Most from Your Zune ***Essential Electronics for Software Folk ***Excel 2007 for Starters: The Missing Manual ***Google Web Toolkit for Ajax (PDF) ***Introduction to Neogeography (PDF) ***The OpenBSD 4.0 Crash Course ***Physical and Logical Security Convergence: Powered By Enterprise ***PowerPoint 2007 for Starters: The Missing Manual ***Programming Firefox: Rough Cuts Version ***Rails Cookbook (Book or PDF) ***Rails for Java Developers ***Release It! ***Secure Your Network for Free ***Software Testing Foundations, Second Edition ***The OpenBSD 4.0 Crash Course (PDF) ***Using Samba, Third Edition ***Using XForms with Mozilla (PDF) ***What's New in Windows Vista? ***Windows Developer Power Tools ***Windows Vista for Starters: The Missing Manual ***Windows Vista in a Nutshell ***Word 2007 for Starters: The Missing Manual ***MAKE Magazine Subscriptions ***Craft Magazine Subscriptions ***For more events, please see: ***O'Reilly at ASTD TechKnowledge 2007, Las Vegas, NV--January ***Geek Cruise Features David Pogue, Deke McClelland, and Eddie ***O'Reilly at Conferencia Internacional de Software Libre ***Peter Krogh ("The DAM Book: Digital Asset Management for ***O'Reilly at RoR eXchange 2007, London, UK--February 9 ***Rob Orsini ("Rails Cookbook") at the North Bay Rails User's Group, ***Rasmus Lerdorf ("Programming PHP, Second Edition") at the 2007 PHP ***Emerging Telephony Conference 2007,Burlingame, CA-- ***Rob Orsini ("Rails Cookbook") at SOCOSA, Sebastopol, CA--March 6 ***Peter Morville, "Information Architecture & Search" International ***O'Reilly at ah the Photo Marketing Association, ***O'Reilly at SD West, Santa Clara, CA--March 20-22, 2007 ***New 40% Discount for the 2007 Emerging Telephony Conference ***Call for Participation for O'Reilly Open Source Convention ***Call for Participation for O'Reilly Energy Innovation Conference ***Register for ETech 2007 ***Register for Web 2.0 Expo ***Craftzine Interviews Amy Sedaris, Author of "I Like You: Hospitality ***Publishing For (Sales) Success ***New Course Featuring AJAX--O'Reilly/University of Illinois ***Why I Stopped Coding and Why I'd Start Again ***Compare, Select, and Rate ***Digital Media Insider Podcast 6: Desktop Music in Japan ***Word 2007 Missing Manual Screencast: Word's Ribbon ****Build a .NET App for Google Checkout ***SD West--Free Expo Pass ***Let's Speculate for 2007 -- http://pdx.pm.org From scratchcomputing at gmail.com Sun Jan 28 02:18:49 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Sun, 28 Jan 2007 02:18:49 -0800 Subject: [Pdx-pm] next meeting February 7th, 6:53 pm Message-ID: <200701280218.49259.ewilhelm@cpan.org> Mongers, The next meeting will be a week early on account of the holiday of romance and chocolate. The location is FreeGeek. The topic is a secret, but if you know it, feel free to spill the beans. (That's just my subtle way of saying that if you don't have something to talk about, we'll write tests for a couple hours.) --Eric -- Speak softly and carry a big carrot. --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From randall at sonofhans.net Sun Jan 28 12:06:26 2007 From: randall at sonofhans.net (Randall Hansen) Date: Sun, 28 Jan 2007 12:06:26 -0800 Subject: [Pdx-pm] next meeting February 7th, 6:53 pm In-Reply-To: <200701280218.49259.ewilhelm@cpan.org> References: <200701280218.49259.ewilhelm@cpan.org> Message-ID: <2981026D-2464-4BE1-930C-E29E24C70C3E@sonofhans.net> On Jan 28, 2007, at 2:18 AM, Eric Wilhelm wrote: > (That's just my subtle way of saying that if you don't have something > to talk about, we'll write tests for a couple hours.) you sound like my high school study hall teacher. r From mikeraz at patch.com Mon Jan 29 08:03:57 2007 From: mikeraz at patch.com (Michael Rasmussen) Date: Mon, 29 Jan 2007 08:03:57 -0800 (PST) Subject: [Pdx-pm] DBI middle ground Message-ID: <52969.170.135.112.12.1170086637.squirrel@mail.patch.com> I'm querying a large data set. The current code works something like: while( @lease_information = $lease->fetchrow_array) { modification of data, plugging in defaults where currently null ensuring constraints are met # another_db_sth is an update command $another_db_sth->execute(@lease_information); } I don't have control over the source database, so the changes need to be made in my code. This takes longer to execute than I'd like. I can't just do a fetchall or selectall because the dataset is larger than my available memory. Nor have I found a middle ground. Is there one? If so, that I may study up, what are references to it? -- Michael Rasmussen, Portland, Ore, USA Be Appropriate && Follow Your Curiosity http://www.patch.com/words/ From ben.hengst at gmail.com Mon Jan 29 08:27:48 2007 From: ben.hengst at gmail.com (benh) Date: Mon, 29 Jan 2007 08:27:48 -0800 Subject: [Pdx-pm] DBI middle ground In-Reply-To: <52969.170.135.112.12.1170086637.squirrel@mail.patch.com> References: <52969.170.135.112.12.1170086637.squirrel@mail.patch.com> Message-ID: <85ddf48b0701290827w474b0148ldec7369d2b738daa@mail.gmail.com> I guess my first question would be is your slowdown due to the Database or local processing? If your hardware bound localy I would ask how your filling in the defaults. Though if your network/DB bound then you could look at getting something like 20 rows at a time and just cycle thru the entire DB in 20 row chunks. hope that helps a little bit. On 1/29/07, Michael Rasmussen wrote: > I'm querying a large data set. The current code works something like: > > while( @lease_information = $lease->fetchrow_array) { > modification of data, plugging in defaults where currently null > ensuring constraints are met > # another_db_sth is an update command > $another_db_sth->execute(@lease_information); > } > > I don't have control over the source database, so the changes need to be made in > my code. > > This takes longer to execute than I'd like. I can't just do a fetchall or > selectall because the dataset is larger than my available memory. Nor have I > found a middle ground. > > Is there one? If so, that I may study up, what are references to it? > > -- > Michael Rasmussen, Portland, Ore, USA > Be Appropriate && Follow Your Curiosity > http://www.patch.com/words/ > > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > -- benh~ From mikeraz at patch.com Mon Jan 29 08:30:44 2007 From: mikeraz at patch.com (Michael Rasmussen) Date: Mon, 29 Jan 2007 08:30:44 -0800 (PST) Subject: [Pdx-pm] DBI middle ground - update In-Reply-To: <52969.170.135.112.12.1170086637.squirrel@mail.patch.com> References: <52969.170.135.112.12.1170086637.squirrel@mail.patch.com> Message-ID: <54401.170.135.112.12.1170088244.squirrel@mail.patch.com> Update: when I write "takes longer to execute" I'm seeing processing rates of ~40,000 rows per hour. I'm querying a large data set. The current code works something like: while( @lease_information = $lease->fetchrow_array) { modification of data, plugging in defaults where currently null ensuring constraints are met # another_db_sth is an update command $another_db_sth->execute(@lease_information); } I don't have control over the source database, so the changes need to be made in my code. This takes longer to execute than I'd like. I can't just do a fetchall or selectall because the dataset is larger than my available memory. Nor have I found a middle ground. Is there one? If so, that I may study up, what are references to it? -- Michael Rasmussen, Portland, Ore, USA Be Appropriate && Follow Your Curiosity http://www.patch.com/words/ From mikeraz at patch.com Mon Jan 29 08:53:13 2007 From: mikeraz at patch.com (Michael Rasmussen) Date: Mon, 29 Jan 2007 08:53:13 -0800 (PST) Subject: [Pdx-pm] DBI middle ground - resolved Message-ID: <55716.170.135.112.12.1170089593.squirrel@mail.patch.com> Ben H. pointed out the limit clause to SQL's select syntax. That provides the needed functionality. -- Michael Rasmussen, Portland, Ore, USA Be Appropriate && Follow Your Curiosity http://www.patch.com/words/ From jeff at vpservices.com Mon Jan 29 09:02:08 2007 From: jeff at vpservices.com (Jeff Zucker) Date: Mon, 29 Jan 2007 09:02:08 -0800 Subject: [Pdx-pm] DBI middle ground In-Reply-To: <52969.170.135.112.12.1170086637.squirrel@mail.patch.com> References: <52969.170.135.112.12.1170086637.squirrel@mail.patch.com> Message-ID: <45BE2890.3090203@vpservices.com> Michael Rasmussen wrote: > I'm querying a large data set. The current code works something like: > > while( @lease_information = $lease->fetchrow_array) { > modification of data, plugging in defaults where currently null > ensuring constraints are met > # another_db_sth is an update command > $another_db_sth->execute(@lease_information); > } > > I don't have control over the source database, so the changes need to be made in > my code. > > This takes longer to execute than I'd like. I can't just do a fetchall or > selectall because the dataset is larger than my available memory. Nor have I > found a middle ground. > > Is there one? If so, that I may study up, what are references to it? > > I'll assume that you are using placeholders and doing your prepares outside of the loops. Have you tried bind_cols (not binding placeholders on the way in, but binding values on the way out). The DBI docs say the fastest way is ftechall_arrayref with bind cols, though it may or may not help much in your case. Tim Bunce's OSCON talk always features performance tips, you might google for it, the slides are online somewhere. I don't know what database you are using but functions or UDFs might help e.g. let the SQL deal with defaults and NULLs (though depending on your RDBMS that may take *more* time). Good luck! -- Jeff From jeff at vpservices.com Mon Jan 29 10:17:52 2007 From: jeff at vpservices.com (Jeff Zucker) Date: Mon, 29 Jan 2007 10:17:52 -0800 Subject: [Pdx-pm] DBI middle ground In-Reply-To: <60143.170.135.112.12.1170093785.squirrel@mail.patch.com> References: <52969.170.135.112.12.1170086637.squirrel@mail.patch.com> <45BE2890.3090203@vpservices.com> <60143.170.135.112.12.1170093785.squirrel@mail.patch.com> Message-ID: <45BE3A50.4030600@vpservices.com> Michael Rasmussen wrote: > so db functions, or changes to the exisiting db functions to apply rules I need > are not available. This is part of the reason I'm making a local copy of the data > of interest. > What about built-in functions like COALESCE() which would let the db deal with nulls. You don't need any special privs to use those. -- Jeff From ben.hengst at gmail.com Mon Jan 29 10:23:00 2007 From: ben.hengst at gmail.com (benh) Date: Mon, 29 Jan 2007 10:23:00 -0800 Subject: [Pdx-pm] DBI middle ground In-Reply-To: <45BE3A50.4030600@vpservices.com> References: <52969.170.135.112.12.1170086637.squirrel@mail.patch.com> <45BE2890.3090203@vpservices.com> <60143.170.135.112.12.1170093785.squirrel@mail.patch.com> <45BE3A50.4030600@vpservices.com> Message-ID: <85ddf48b0701291023g82b46dcl1674974ab79ae5fe@mail.gmail.com> I know that mysql (5+?) has a IFNULL() so you can specify a replacement value for NULLs so an example would be something like: select IFNULL(possible_null,"this value is null") from table; On 1/29/07, Jeff Zucker wrote: > Michael Rasmussen wrote: > > so db functions, or changes to the exisiting db functions to apply rules I need > > are not available. This is part of the reason I'm making a local copy of the data > > of interest. > > > What about built-in functions like COALESCE() which would let the db > deal with nulls. You don't need any special privs to use those. > > -- > Jeff > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > -- benh~ From tkil at scrye.com Mon Jan 29 11:15:25 2007 From: tkil at scrye.com (Tkil) Date: Mon, 29 Jan 2007 12:15:25 -0700 Subject: [Pdx-pm] DBI middle ground In-Reply-To: <52969.170.135.112.12.1170086637.squirrel@mail.patch.com> (Michael Rasmussen's message of "Mon, 29 Jan 2007 08:03:57 -0800 (PST)") References: <52969.170.135.112.12.1170086637.squirrel@mail.patch.com> Message-ID: >>>>> "MR" == Michael Rasmussen writes: MR> I'm querying a large data set. The current code works something like: MR> while( @lease_information = $lease->fetchrow_array) { MR> modification of data, plugging in defaults where currently null MR> ensuring constraints are met MR> # another_db_sth is an update command MR> $another_db_sth->execute(@lease_information); MR> } MR> I don't have control over the source database, so the changes need MR> to be made in my code. MR> This takes longer to execute than I'd like. I can't just do a MR> fetchall or selectall because the dataset is larger than my MR> available memory. Nor have I found a middle ground. MR> Is there one? If so, that I may study up, what are references to MR> it? A few things to check: 1. Are you using autocommit? That can be really painful in this situation. My usual technique is to turn off autocommit, then explicitly commit() every so often (either by time, or by number of DML statements, or by number of rows affected by those DML, it varies.) 2. It'll almost always be faster to do this work in the DB, if you can. You should be able to use MySQL's IFNULL() or Oracle's NVL() to fill in the blanks, and hopefully you can use standard WHERE conditions to check constraints. (Although the lack of proper regex support in most DBs is painful.) 3. Profile your code locally, to see if it's CPU bound somehow. As others pointed out, binding values with "fetch" is advertised as the fastest way to get data through the DBI; doing some local profiling might point fingers. (There's also the DBI trace methods, which can use high-resolution timing (i think?) to give you further insight.) 4. Talk to your DBA, if you have one. It might be that your update can be tuned, or it might be much faster to load up a temp table and then do the update in one swell foop. Happy hacking, t. From schwern at gmail.com Wed Jan 31 10:48:34 2007 From: schwern at gmail.com (Michael G Schwern) Date: Wed, 31 Jan 2007 13:48:34 -0500 Subject: [Pdx-pm] Eliminating circular table relations. Message-ID: <45C0E482.9020201@gmail.com> This is a SQL question so everyone else can safely let their eyes glaze over. Let's say I'm storing account information in a database. And let's say there are two different types of accounts (how about "meat" and "mushroom"), but they share some common characteristics. My impulse is to put the common information in one table and have another table for each sub type. CREATE TABLE account ( id INTEGER PRIMARY KEY, name VARCHAR, address VARCHAR, phone VARCHAR ); # sub-type CREATE TABLE meat_account ( id INTEGER PRIMARY KEY, account_id INTEGER REFERENCES account (id), drippings BOOLEAN, gravy ENUM("white", "brown", "red") ); # sub-type CREATE TABLE mushroom_account ( id INTEGER, account_id INTEGER REFERENCES account (id), type ENUM('shitaki', 'crimini') ); While this ensures each sub-type row has an account row, it allows an account row to exist without a sub-type. That's not allowed by the business rules. Each account has one sub-type row and for each sub-type there is one account. I could add in a constraint to the account table to check that a meat or mushroom account exists, but now I have a circular dependency. That's bad. It means in order to create or delete an account I have to defer constraint checking while I create (or delete) both the account row and the associated sub-type row. To add to the problem, this is MySQL 5.0 which does not have proper constraint deferral. [1] There's got to be a better way to structure this. Ideas? [1] MySQL can turn off constraints but it does not re-check them when you turn them back on. From a.r.ferreira at gmail.com Wed Jan 31 10:55:35 2007 From: a.r.ferreira at gmail.com (Adriano Ferreira) Date: Wed, 31 Jan 2007 16:55:35 -0200 Subject: [Pdx-pm] Eliminating circular table relations. In-Reply-To: <45C0E482.9020201@gmail.com> References: <45C0E482.9020201@gmail.com> Message-ID: <73ddeb6c0701311055t218b143fh32097e44958d2456@mail.gmail.com> On 1/31/07, Michael G Schwern wrote: > This is a SQL question so everyone else can safely let their eyes glaze over. > > Let's say I'm storing account information in a database. And let's say there are two different types of accounts (how about "meat" and "mushroom"), but they share some common characteristics. My impulse is to put the common information in one table and have another table for each sub type. > > CREATE TABLE account ( > id INTEGER PRIMARY KEY, > > name VARCHAR, > address VARCHAR, > phone VARCHAR > ); > > # sub-type > CREATE TABLE meat_account ( > id INTEGER PRIMARY KEY, > account_id INTEGER REFERENCES account (id), > > drippings BOOLEAN, > gravy ENUM("white", "brown", "red") > ); > > # sub-type > CREATE TABLE mushroom_account ( > id INTEGER, > account_id INTEGER REFERENCES account (id), > > type ENUM('shitaki', 'crimini') > ); > > While this ensures each sub-type row has an account row, it allows an account row to exist without a sub-type. That's not allowed by the business rules. Each account has one sub-type row and for each sub-type there is one account. That means one additional common attribute may be some kind of account_type_id. This account_type_id in your case should live in a discriminator table with two rows: one for meat accounts and another for mushroom accounts. As this attribute will be required, there is no way to create an account that is other than meat or mushroom (unless you add a new type -- but you should know what you're doing in this case). The remaining logic of your application should guarantee that for an account marked as meat there is a row in meat_account and the same with respect to mushroom_accounts. This is the ordinary approach to such issues in relational models. > > I could add in a constraint to the account table to check that a meat or mushroom account exists, but now I have a circular dependency. That's bad. It means in order to create or delete an account I have to defer constraint checking while I create (or delete) both the account row and the associated sub-type row. To add to the problem, this is MySQL 5.0 which does not have proper constraint deferral. [1] > > There's got to be a better way to structure this. Ideas? > > > [1] MySQL can turn off constraints but it does not re-check them when you turn them back on. > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > From david at kineticode.com Wed Jan 31 11:53:46 2007 From: david at kineticode.com (David E. Wheeler) Date: Wed, 31 Jan 2007 11:53:46 -0800 Subject: [Pdx-pm] Eliminating circular table relations. In-Reply-To: <45C0E482.9020201@gmail.com> References: <45C0E482.9020201@gmail.com> Message-ID: On Jan 31, 2007, at 10:48 AM, Michael G Schwern wrote: > I could add in a constraint to the account table to check that a > meat or mushroom account exists, but now I have a circular > dependency. That's bad. It means in order to create or delete an > account I have to defer constraint checking while I create (or > delete) both the account row and the associated sub-type row. To > add to the problem, this is MySQL 5.0 which does not have proper > constraint deferral. [1] Pity. If it was PostgreSQL or SQLite, I have answers a-ready (views + rules/triggers + permissions). But for MySQL, well, your SOL in enforcing this type of stuff at the database level. You'll have to enforce it in your application code, like all "good" MySQL applications do. Sorry? David From schwern at gmail.com Wed Jan 31 13:15:32 2007 From: schwern at gmail.com (Michael G Schwern) Date: Wed, 31 Jan 2007 16:15:32 -0500 Subject: [Pdx-pm] Eliminating circular table relations. In-Reply-To: References: <45C0E482.9020201@gmail.com> Message-ID: <45C106F4.90708@gmail.com> David E. Wheeler wrote: > On Jan 31, 2007, at 10:48 AM, Michael G Schwern wrote: > >> I could add in a constraint to the account table to check that a meat >> or mushroom account exists, but now I have a circular dependency. >> That's bad. It means in order to create or delete an account I have >> to defer constraint checking while I create (or delete) both the >> account row and the associated sub-type row. To add to the problem, >> this is MySQL 5.0 which does not have proper constraint deferral. [1] > > Pity. If it was PostgreSQL or SQLite, I have answers a-ready (views + > rules/triggers + permissions). But for MySQL, well, your SOL in > enforcing this type of stuff at the database level. You'll have to > enforce it in your application code, like all "good" MySQL applications do. Let's hear those answers. I'm building up a case for Postgres here and the more ammo the better. From schwern at gmail.com Wed Jan 31 13:22:18 2007 From: schwern at gmail.com (Michael G Schwern) Date: Wed, 31 Jan 2007 16:22:18 -0500 Subject: [Pdx-pm] Eliminating circular table relations. In-Reply-To: <73ddeb6c0701311055t218b143fh32097e44958d2456@mail.gmail.com> References: <45C0E482.9020201@gmail.com> <73ddeb6c0701311055t218b143fh32097e44958d2456@mail.gmail.com> Message-ID: <45C1088A.3040006@gmail.com> Adriano Ferreira wrote: >> While this ensures each sub-type row has an account row, it allows an >> account row to exist without a sub-type. That's not allowed by the >> business rules. Each account has one sub-type row and for each >> sub-type there is one account. > > That means one additional common attribute may be some kind of > account_type_id. This account_type_id in your case should live in a > discriminator table with two rows: one for meat accounts and another > for mushroom accounts. As this attribute will be required, there is no > way to create an account that is other than meat or mushroom (unless > you add a new type -- but you should know what you're doing in this > case). Could you write out that discriminator table long hand? I'm a little hazy on how it would work and I'm having trouble finding examples. From david at kineticode.com Wed Jan 31 13:33:54 2007 From: david at kineticode.com (David E. Wheeler) Date: Wed, 31 Jan 2007 13:33:54 -0800 Subject: [Pdx-pm] Eliminating circular table relations. In-Reply-To: <45C106F4.90708@gmail.com> References: <45C0E482.9020201@gmail.com> <45C106F4.90708@gmail.com> Message-ID: On Jan 31, 2007, at 1:15 PM, Michael G Schwern wrote: > Let's hear those answers. I'm building up a case for Postgres here > and the more ammo the better. You build the tables as you described, then you create a view joining them as two separate tables, one for meat_account and one for mushroom account. Something like this (untested PostgreSQL code): CREATE TABLE _account ( id SERIAL PRIMARY KEY, name TEXT, address TEXT, phone TEXT ); # sub-type CREATE TABLE _meat_account ( id INTEGER PRIMARY KEY REFERENCES account(id), drippings BOOLEAN, gravy TEXT ); # sub-type CREATE TABLE _mushroom_account ( id INTEGER PRIMARY KEY REFERENCES account(id), type TEXT ); CREATE VIEW meat_account AS SELECT a.id as id, name, address, phone, drippings, gravy FROM _account a, _meat_account ma WHERE a.id = ma.id; CREATE VIEW mushsroom_account AS SELECT a.id as id, name, address, phone, type FROM _account a, _mushroom_account ma WHERE a.id = ma.id; Then update preferences so that the user has permission to access only the views, and not the tables. Next you create rules on the view to handle INSERTS, UPDATES, and DELETES. They look something like this: CREATE RULE insert_meat_account AS ON INSERT TO meat_account DO INSTEAD ( INSERT INTO _account (id, name, address, phone) VALUES (NEXTVAL('_account_id_seq'), NEW.name, NEW.address, NEW.phone); INSERT INTO _meat_account (id, drippings, gravy) VALUES (CURRVAL('_account_id_seq'), NEW.drippings, NEW.gravy); ); Create similar rules ON UPDATE and ON DELETE. Then you can treat the views exactly like tables and completely ignore the _account and _meat_account tables. I went into some detail on this approach in presentations at the last two OSCONs. I used it to model OO inheritance in the database (meat_account inherits from account). You can get the slides here: http://conferences.oreillynet.com/presentations/os2006/ wheeler_david.pdf http://www.kineticode.com/docs/polymorphic_database_design.pdf I also use it extensively in Object::Relation, my ORM module that I expect to get back to hacking sooner or later. HTH, David From masque at pobox.com Wed Jan 31 13:38:43 2007 From: masque at pobox.com (Paul Blair) Date: Wed, 31 Jan 2007 16:38:43 -0500 Subject: [Pdx-pm] next meeting February 7th, 6:53 pm In-Reply-To: <200701280218.49259.ewilhelm@cpan.org> References: <200701280218.49259.ewilhelm@cpan.org> Message-ID: On Jan 28, 2007, at 5:18 AM, Eric Wilhelm wrote: > The next meeting will be a week early on account of the holiday of > romance and chocolate. Son of a (&@#^%! My next trip to Portland was a "What side of the weekend should I stay..." trip, and I picked the side with the Perl Mongers meeting. Except I missed. RAR, I say! Rar! :) From xeres at efn.org Wed Jan 31 13:50:36 2007 From: xeres at efn.org (Robert Shepard) Date: Wed, 31 Jan 2007 13:50:36 -0800 Subject: [Pdx-pm] sample code Message-ID: <45C10F2C.2060305@efn.org> Newbie to the list here. Hi! A couple of times when I have applied for work, the employer asks to see some sample code. I find it difficult to decide what to show them. What are they looking for? Are they looking to see if it conforms to standard practice, and looks like something straight out of an O'Reilly recipe book? If so, how do they know it's really mine, and not something I just ripped from somewhere? If they know enough about it to judge my skill, then they must already have the skill, and therefore they don't really need me. On the other hand, if they don't know enough about it, then what are they going by? Neatness and penmanship? Comment lines that document the thing? Or will they actually install it and run it and see if it works? Will a snippet suffice? I don't want to give them a fully functional copy of anything, because I don't want to give away the goods. They have to pay for that. But if it doesn't function, then they will think I can't write code. I could give them something that has a require() in it, and withhold the required subprogram. It won't run, of course, but at least then they can't rip off my blood, sweat and tears. Come to think of it, if the function does anything halfway fancy, I can't guarantee that any of my code will be portable to a foreign system anyhow - since the paths to any resources will be different. So are they really going to expect it to run? But okay, assuming I decide to give them something self-contained that actually does something functional, what would be sufficiently impressive? How fancy does it need to be? Should it hook up to databases and send out emails and spiders and have password protection and whistle the Star Spangled Banner backwards? Or will a simple webform backend that says "Thanks for your submission" suffice? Thanks for sharing your experience in this regard! Robert From keithl at kl-ic.com Wed Jan 31 14:06:07 2007 From: keithl at kl-ic.com (Keith Lofstrom) Date: Wed, 31 Jan 2007 14:06:07 -0800 Subject: [Pdx-pm] next meeting February 7th, 6:53 pm In-Reply-To: References: <200701280218.49259.ewilhelm@cpan.org> Message-ID: <20070131220607.GA20025@gate.kl-ic.com> On Jan 28, 2007, at 5:18 AM, Eric Wilhelm wrote: > The next meeting will be a week early on account of the holiday of > romance and chocolate. On Wed, Jan 31, 2007 at 04:38:43PM -0500, Paul Blair wrote: > Son of a (&@#^%! My next trip to Portland was a "What side of the > weekend should I stay..." trip, and I picked the side with the Perl > Mongers meeting. > > Except I missed. > > RAR, I say! Rar! :) Sounds like an excuse for a Perl Party. It's an ancient tradition I just made up, like a Perl Mongers meeting, with code and demos and references to CPAN, but with more romance and dancing and such. I would organize the party, but on the 14th I will be in San Francisco, investigating an alleged cache of mislaid lounge singer hearts. Perhaps someone else wants to Promote a Perl Party for Paul. Or perhaps he can move his flights ahead. Keith -- Keith Lofstrom keithl at keithl.com Voice (503)-520-1993 KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon" Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs From bruce at drangle.com Wed Jan 31 14:29:09 2007 From: bruce at drangle.com (Bruce J Keeler) Date: Wed, 31 Jan 2007 14:29:09 -0800 Subject: [Pdx-pm] sample code In-Reply-To: <45C10F2C.2060305@efn.org> References: <45C10F2C.2060305@efn.org> Message-ID: <45C11835.5080301@drangle.com> Robert Shepard wrote: > Newbie to the list here. Hi! > > A couple of times when I have applied for work, the employer asks to see > some sample code. I find it difficult to decide what to show them. > > What are they looking for? > > Are they looking to see if it conforms to standard practice, and looks > like something straight out of an O'Reilly recipe book? If so, how do > they know it's really mine, and not something I just ripped from somewhere? > The ideal, I think, is to just point them at a module on CPAN if you have one. That's what I do. Failing that, just look through your code directory and pick something out. I'd say it should solve a real-world problem, rather than an abstract CS101-ish one like the recipe books give. Something relatively concise, clear and easy to follow. Make something up if you don't have such a program. Say, perhaps an HTTP proxy server that mangles content in some specific way. Bonus points for including some tests. > If they know enough about it to judge my skill, then they must already > have the skill, and therefore they don't really need me. > They may well have the skill, just not enough of it. > On the other hand, if they don't know enough about it, then what are > they going by? Neatness and penmanship? Comment lines that document the > thing? Or will they actually install it and run it and see if it works? > They might, but more than likely not. I would judge based on how easy it is to understand, and how well it demonstrates knowledge of CS fundamentals - using the right data structures or algorithms for the job. > Will a snippet suffice? I don't want to give them a fully functional > copy of anything, because I don't want to give away the goods. They have > to pay for that. But if it doesn't function, then they will think I > can't write code. I could give them something that has a require() in > it, and withhold the required subprogram. It won't run, of course, but > at least then they can't rip off my blood, sweat and tears. Pfft! I wouldn't worry about that. Samples need to be small enough that one person can read and understand it in less than, oh, say 5-10 minutes. Such programs aren't worth ripping off, even to the unscrupulous. > But okay, assuming I decide to give them something self-contained that > actually does something functional, what would be sufficiently > impressive? How fancy does it need to be? Should it hook up to databases > and send out emails and spiders and have password protection and whistle > the Star Spangled Banner backwards? Or will a simple webform backend > that says "Thanks for your submission" suffice? > If it's a web service you want to submit, I'd suggest sending the code along with a URL where they can play with it. They're probably not going to go to the trouble of setting up a database and obscure mod_perl configurations themselves. Perhaps something like your average site registration thing would be about right: they fill out a form, get a URL in the email that they have to click to complete the registration. Covers quite a lot of ground while being an easy problem to define. From kevin at scaldeferri.com Wed Jan 31 14:32:41 2007 From: kevin at scaldeferri.com (Kevin Scaldeferri) Date: Wed, 31 Jan 2007 14:32:41 -0800 Subject: [Pdx-pm] sample code In-Reply-To: <45C10F2C.2060305@efn.org> References: <45C10F2C.2060305@efn.org> Message-ID: <5AA972EB-6F47-4BE7-B418-AC4DB27AC2E3@scaldeferri.com> On Jan 31, 2007, at 1:50 PM, Robert Shepard wrote: > Newbie to the list here. Hi! > > A couple of times when I have applied for work, the employer asks > to see > some sample code. I find it difficult to decide what to show them. > > What are they looking for? > > Are they looking to see if it conforms to standard practice, and looks > like something straight out of an O'Reilly recipe book? If so, how do > they know it's really mine, and not something I just ripped from > somewhere? In my experience as an interviewer, I would like to see a number of the following: a) Solution to an interesting, non-trivial problem b) Follows a minimal set of best practices (use strict & warnings, appropriately modularized for the size of the problem, avoids common gotchas) c) Well documented (might include an external explanation of what the heck this is for) d) Readable / Maintainable (admittedly somewhat subjective) e) if you included unit tests, you would win big points from me > > If they know enough about it to judge my skill, then they must already > have the skill, and therefore they don't really need me. That's certainly a false assumption. If I could hire someone I thought was equal in skill-level to myself, I'd do it in a minute. (And, doesn't this complain apply to all interview processes?) > > On the other hand, if they don't know enough about it, then what are > they going by? Neatness and penmanship? Comment lines that document > the > thing? Or will they actually install it and run it and see if it > works? Yes, all of the above. > > Will a snippet suffice? I don't want to give them a fully functional > copy of anything, because I don't want to give away the goods. They > have > to pay for that. But if it doesn't function, then they will think I > can't write code. This is a good reason to release at least some of your code as open source. > Come to > think of it, if the function does anything halfway fancy, I can't > guarantee that any of my code will be portable to a foreign system > anyhow - since the paths to any resources will be different. Some might say that abstracting that sort of thing out into a configuration system of some type would be good software engineering practice... > > But okay, assuming I decide to give them something self-contained that > actually does something functional, what would be sufficiently > impressive? How fancy does it need to be? Should it hook up to > databases > and send out emails and spiders and have password protection and > whistle > the Star Spangled Banner backwards? Or will a simple webform backend > that says "Thanks for your submission" suffice? Well, if it's too big, they aren't really going to look at it. I'd ask them what size program they are looking for. Personally, I'd aim for less than 500 lines, but still non-trivial. -kevin From david at kineticode.com Wed Jan 31 14:45:32 2007 From: david at kineticode.com (David E. Wheeler) Date: Wed, 31 Jan 2007 14:45:32 -0800 Subject: [Pdx-pm] Eliminating circular table relations. In-Reply-To: References: <45C0E482.9020201@gmail.com> <45C106F4.90708@gmail.com> Message-ID: On Jan 31, 2007, at 1:33 PM, David E. Wheeler wrote: > # sub-type > CREATE TABLE _meat_account ( > id INTEGER PRIMARY KEY REFERENCES account(id), > drippings BOOLEAN, > gravy TEXT > ); Oh, and check out EnumKit for building enums for PostgreSQL. http://www.oreillynet.com/pub/a/databases/2006/01/06/enumerated- fields-in-postgresql.html Best, David From ben.hengst at gmail.com Wed Jan 31 15:11:54 2007 From: ben.hengst at gmail.com (benh) Date: Wed, 31 Jan 2007 15:11:54 -0800 Subject: [Pdx-pm] Eliminating circular table relations. In-Reply-To: <45C1088A.3040006@gmail.com> References: <45C0E482.9020201@gmail.com> <73ddeb6c0701311055t218b143fh32097e44958d2456@mail.gmail.com> <45C1088A.3040006@gmail.com> Message-ID: <85ddf48b0701311511m26d3ab33j436dc60eebed42bd@mail.gmail.com> 1) is this jifty or just sql? 2) wouldn't it just be something like: CREATE TABLE account ( id INTEGER PRIMARY KEY, name VARCHAR, address VARCHAR, phone VARCHAR sub_type_id INTEGER, ); CREATE UNIQUE INDEX account_to_sub_account (id,sub_type_id) ; # sub-type CREATE TABLE meat_account ( id INTEGER PRIMARY KEY, account_id INTEGER REFERENCES account (id), drippings BOOLEAN, gravy ENUM("white", "brown", "red") ); # sub-type CREATE TABLE mushroom_account ( id INTEGER, account_id INTEGER REFERENCES account (id), type ENUM('shitaki', 'crimini') ); though I dont know if you can have a paired unique key that invovles the primary.... humm. On 1/31/07, Michael G Schwern wrote: > Adriano Ferreira wrote: > >> While this ensures each sub-type row has an account row, it allows an > >> account row to exist without a sub-type. That's not allowed by the > >> business rules. Each account has one sub-type row and for each > >> sub-type there is one account. > > > > That means one additional common attribute may be some kind of > > account_type_id. This account_type_id in your case should live in a > > discriminator table with two rows: one for meat accounts and another > > for mushroom accounts. As this attribute will be required, there is no > > way to create an account that is other than meat or mushroom (unless > > you add a new type -- but you should know what you're doing in this > > case). > > Could you write out that discriminator table long hand? I'm a little hazy on how it would work and I'm having trouble finding examples. > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > -- benh~ From xrdawson at gmail.com Wed Jan 31 18:15:46 2007 From: xrdawson at gmail.com (Chris Dawson) Date: Wed, 31 Jan 2007 18:15:46 -0800 Subject: [Pdx-pm] (off-topic) internal/external simple version control for Mac and Linux? Message-ID: <659b9ea30701311815s19a4e88aq9bde6ee56b68fe09@mail.gmail.com> Hi there, We are struggling to find a good version control system that can be operated both internally and externally (meaning, for people working inside the firewall and outside, at a coffee shop). I want to use both GIT and SVN. I need something that works with both Mac and Linux. I would prefer to have a VPN type solution, but I need to make sure all clients support it. I have considered setting up a SOCKS proxy, but I am not sure whether this would work with GIT and SVN clients on Mac, for example, or even Linux. I have considered setting up SVN and GIT over a WedDAV apache server, but I am not sure if this works well (we've had trouble with Apache+SVN), and I probably want this over SSL for extra protection. Can people share the systems and successes they have for this kind of situation that doesn't compromise security for coffee shop flexibility? Thanks, Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/pdx-pm-list/attachments/20070131/f73bc97c/attachment.html From merlyn at stonehenge.com Wed Jan 31 18:30:42 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Wed, 31 Jan 2007 18:30:42 -0800 Subject: [Pdx-pm] (off-topic) internal/external simple version control for Mac and Linux? In-Reply-To: <659b9ea30701311815s19a4e88aq9bde6ee56b68fe09@mail.gmail.com> (Chris Dawson's message of "Wed, 31 Jan 2007 18:15:46 -0800") References: <659b9ea30701311815s19a4e88aq9bde6ee56b68fe09@mail.gmail.com> Message-ID: <86y7ni623x.fsf@blue.stonehenge.com> >>>>> "Chris" == Chris Dawson writes: Chris> We are struggling to find a good version control system that can be operated Chris> both internally and externally (meaning, for people working inside the Chris> firewall and outside, at a coffee shop). Consider OpenVPN, which is relatively easy to set up. Chris> I want to use both GIT and SVN. Since git can layer on SVN, but not vice versa, that means your repo is forced to be SVN, and git tools can import/export for it. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From scratchcomputing at gmail.com Wed Jan 31 19:17:03 2007 From: scratchcomputing at gmail.com (Seven till Seven) Date: Wed, 31 Jan 2007 19:17:03 -0800 Subject: [Pdx-pm] next meeting February 7th, 6:53 pm Message-ID: <200701311917.03893.ewilhelm@cpan.org> Mongers, Indeed, the meeting will be a week early. And, since we have no topic, we'll write tests. The question is: Is keeping the thing under test a secret until the start of the meeting likely to cause more or fewer people to show up? Does your answer change if I tell you that the video is a rockin' overview of erlang starring Mike, Joe, Robert? What if I keep it a secret even while we're testing it? This will be an interactive session. Bring a computer if you can, though you don't exactly need one. Definitely do bring your thinking caps because it will be a challenge. --Eric -- http://pdx.pm.org From scratchcomputing at gmail.com Wed Jan 31 19:18:12 2007 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Wed, 31 Jan 2007 19:18:12 -0800 Subject: [Pdx-pm] next meeting February 7th, 6:53 pm In-Reply-To: References: <200701280218.49259.ewilhelm@cpan.org> Message-ID: <200701311918.12748.ewilhelm@cpan.org> # from Paul Blair # on Wednesday 31 January 2007 01:38 pm: >> The next meeting will be a week early on account of the holiday of >> romance and chocolate. > >Son of a (&@#^%! ?My next trip to Portland was a "What side of the ? >weekend should I stay..." trip, and I picked the side with the Perl ? >Mongers meeting. Hey, maybe there will be a Thursday the 15th meeting. There are lots of tests to be written. --Eric -- Turns out the optimal technique is to put it in reverse and gun it. --Steven Squyres (on challenges in interplanetary robot navigation) --------------------------------------------------- http://scratchcomputing.com ---------------------------------------------------