From darren at DarrenDuncan.net Sun Mar 2 20:05:19 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:18 2004 Subject: Next meeting In-Reply-To: <4.3.2.7.2.20030226152322.00c01a40@shell2.webquarry.com> References: <4.3.2.7.2.20030225180018.00beae10@shell2.webquarry.com> <4.3.2.7.2.20030226152322.00c01a40@shell2.webquarry.com> Message-ID: Peter Scott said: >Guys, can you agree on something between March 17 and 21? All fine with me. Given that the 18th is a tuesday and the 20th is a thursday, I suspect that the 18th would work better for me. How does tuesday the 18th work for you? -- Darren Duncan From nkuipers at uvic.ca Sun Mar 2 22:23:47 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:18 2004 Subject: Next meeting Message-ID: <3E630C31@wm2.uvic.ca> >Given that the 18th is a tuesday and the 20th is a thursday, I suspect that >the 18th would work better for me. How does tuesday the 18th work for you? I would prefer the 19th. From abez at abez.ca Sun Mar 2 23:06:17 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:18 2004 Subject: Next meeting In-Reply-To: <3E630C31@wm2.uvic.ca> References: <3E630C31@wm2.uvic.ca> Message-ID: I'd prefer 18th then the 19th. I have a preference for tuesdays in general. On Sun, 2 Mar 2003, nkuipers wrote: > >Given that the 18th is a tuesday and the 20th is a thursday, I suspect that > >the 18th would work better for me. How does tuesday the 18th work for you? > > I would prefer the 19th. > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From darren at DarrenDuncan.net Sun Mar 2 23:41:15 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:18 2004 Subject: Next meeting In-Reply-To: References: <3E630C31@wm2.uvic.ca> Message-ID: >I'd prefer 18th then the 19th. I have a preference for tuesdays in general. > >On Sun, 2 Mar 2003, nkuipers wrote: > >> >Given that the 18th is a tuesday and the 20th is a thursday, I suspect that >> >the 18th would work better for me. How does tuesday the 18th work for you? >> > > I would prefer the 19th. And I prefer tuesdays because I meet with a different group (not computer related) on every wednesday, and I would prefer to avoid a conflict. -- Darren Duncan From Peter at PSDT.com Mon Mar 3 01:38:42 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: Next meeting In-Reply-To: References: <3E630C31@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030302233805.00aacc70@shell2.webquarry.com> At 09:41 PM 3/2/2003 -0800, Darren Duncan wrote: > >I'd prefer 18th then the 19th. I have a preference for tuesdays in general. > > > >On Sun, 2 Mar 2003, nkuipers wrote: > > > >> >Given that the 18th is a tuesday and the 20th is a thursday, I > suspect that > >> >the 18th would work better for me. How does tuesday the 18th work > for you? > >> > > > I would prefer the 19th. > >And I prefer tuesdays because I meet with a different group (not computer >related) on every wednesday, and I would prefer to avoid a conflict. -- >Darren Duncan They're all fine with me. Can you arrive at a consensus, or do you want me to sever the Gordian knot? -- Peter Scott peter@psdt.com http://www.perldebugged.com From darren at DarrenDuncan.net Mon Mar 3 11:12:23 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:18 2004 Subject: Next meeting In-Reply-To: <4.3.2.7.2.20030302233805.00aacc70@shell2.webquarry.com> Message-ID: On Sun, 2 Mar 2003, Peter Scott wrote: > They're all fine with me. Can you arrive at a consensus, or do you want me > to sever the Gordian knot? Speaking more generally, *any* day can work for me after a fashion; wednesday would be a conflict, but mon, tue, thu, fri would not, unless my other group changes their dates, but I think they couldn't due to other conflicts. So it doesn't *have* to be tuesday. -- Darren Duncan From nkuipers at uvic.ca Mon Mar 3 15:02:07 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:18 2004 Subject: Next meeting Message-ID: <3E63C4B2@wm2.uvic.ca> >Speaking more generally, *any* day can work for me after a fashion; >wednesday would be a conflict, but mon, tue, thu, fri would not, unless my >other group changes their dates, but I think they couldn't due to other >conflicts. So it doesn't *have* to be tuesday. -- Darren Duncan God bless further ambiguity. Peter, sever away. From nkuipers at uvic.ca Tue Mar 4 13:40:29 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:18 2004 Subject: ADTs Message-ID: <3E654832@wm2.uvic.ca> Hello, So I'm taking this course in data structures in Java. For example, a java sequence inherits from vectors and lists, and iterators extend positions. Since my first language is Perl, this naturally has me thinking about ADTs in Perl. I looked around CPAN for "ADT" and "List" and "Vector" and such, and was surprised at the apparent lack of Perl representations of such constructs. The closest thing I found was Class::Struct. Now, I fully realize that between hashes and arrays, and the rich set of Perl built-ins (like splice), there isn't really a *need* for CPAN modular definitions of doubly linked lists and so forth. But what if I don't want to program with fundamental types yet stick with Perl? These abstractions make for easy programming and self-documenting code (at least for a maintainer or someone not too familiar with Perl), and I'm curious if I missed something on CPAN or if this simply isn't a Perl thing to do. Perl includes the fundamental data types scalar, array, and hash, would it be appropriate to also include a selection of ADTs? Cheers all, nathanael From yf110 at victoria.tc.ca Tue Mar 4 14:12:05 2003 From: yf110 at victoria.tc.ca (Malcolm Dew-Jones) Date: Wed Aug 4 00:11:18 2004 Subject: ADTs In-Reply-To: <3E654832@wm2.uvic.ca> Message-ID: On Tue, 4 Mar 2003, nkuipers wrote: > So I'm taking this course in data structures in Java. > Now, I fully realize that > between hashes and arrays, and the rich set of Perl built-ins (like splice), > there isn't really a *need* for CPAN modular definitions of doubly linked > lists and so forth. Exactly. > But what if I don't want to program with fundamental > types yet stick with Perl? These abstractions make for easy programming and > self-documenting code (at least for a maintainer or someone not too familiar > with Perl), and I'm curious if I missed something on CPAN or if this simply > isn't a Perl thing to do. Perl includes the fundamental data types scalar, > array, and hash, would it be appropriate to also include a selection of ADTs? Those things make it easy(er) for a maintainer of a language that makes it hard to program. It almost all cases, with perl, the task is simply to correctly describe the data. Then you simply use the data when you need it. It's kind of like switching from old datebase code where most of the work consists of manipulating/merging/massaging the data to get what you want, to a relational database where you simply describe the data you want and it's there when you need it. From nkuipers at uvic.ca Tue Mar 4 17:18:59 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:18 2004 Subject: nifty Message-ID: <3E656212@wm2.uvic.ca> Peter in particular may recall a problem I had way back, trying to figure out how to write an arbitrarily long sequence string to a specific format as follows: >description 60 chars of sequence 60 chars of sequence etc. We should both kick ourselves for not looking in the Camel for "wrapping text"...see page 866 or this handy working summary that I now use: :) #!/usr/bin/perl #write Fasta using a standard module, no bioperl yay! use Text::Wrap; $Text::Wrap::columns = 61; #includes terminal \n print $fh ">$description\n"; print $fh wrap('', '', $sequence_string."\n"); I just thought that was amusing to discover just now. Cheersies, Nathanael From abez at abez.ca Tue Mar 4 17:53:52 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:18 2004 Subject: Room Reservered Message-ID: Mar.18 CLEA206 7:00 has been reserved. -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From Peter at PSDT.com Tue Mar 4 19:26:50 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: Next meeting In-Reply-To: <3E63C4B2@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030304171953.00ab3060@shell2.webquarry.com> At 01:02 PM 3/3/2003 -0800, nkuipers wrote: > >Speaking more generally, *any* day can work for me after a fashion; > >wednesday would be a conflict, but mon, tue, thu, fri would not, unless my > >other group changes their dates, but I think they couldn't due to other > >conflicts. So it doesn't *have* to be tuesday. -- Darren Duncan > >God bless further ambiguity. Peter, sever away. Okay, given that Monday is St. Patrick's Day, I declare that the meeting will be on Tuesday, March 18. -- Peter Scott peter@psdt.com http://www.perldebugged.com From Peter at PSDT.com Tue Mar 4 19:39:08 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] Re: victoria-pm subject prefix In-Reply-To: <3E653E42.1080100@elrod.ca> References: Message-ID: <4.3.2.7.2.20030304173556.00ab2dd0@shell2.webquarry.com> >Would you mind configuring victoria-pm so that messages >sent through the list have a subject prefix, like "VPM:" Testing... -- Peter Scott peter@psdt.com http://www.perldebugged.com From darren at DarrenDuncan.net Wed Mar 5 12:39:52 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] ANNOUNCE: Rosetta 0.05 ... and the next meeting Message-ID: For those interested in looking, I have uploaded release 0.05 of my Rosetta database abstraction framework. You can see it at: http://search.cpan.org/author/DUNCAND/Rosetta-0.05/ While the framework is not complete enough to use practically, this release is significant in that it is the first to actually have code in it, rather than just documentation. I have fully coded, documented, and tested (79 tests) my first Rosetta module, Rosetta::Schema::DataType. Technically the module is release quality and can be used, but I would expect it is too simple to be much use by itself. Regardless, if nothing else, feel free to look at this as an example of a simple module that is cleanly designed and completely documented and tested, in my opinion. So at our next meeting you can get an idea of some ways that we could work on Nathaniel's Bio modules to improve them. (Not that I know their current state.) -- Darren Duncan From Peter at PSDT.com Sat Mar 8 13:12:21 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] Re: ADTs In-Reply-To: <3E654832@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030308110915.00aa8670@shell2.webquarry.com> At 11:40 AM 3/4/2003 -0800, nkuipers wrote: >Hello, > >So I'm taking this course in data structures in Java. For example, a java >sequence inherits from vectors and lists, and iterators extend positions. >Since my first language is Perl, this naturally has me thinking about ADTs in >Perl. I looked around CPAN for "ADT" and "List" and "Vector" and such, and >was surprised at the apparent lack of Perl representations of such constructs. Like you said later, they're not needed. Lists and Vectors are for languages that don't have the polymorphic lists/arrays/hashes that Perl already has. > The closest thing I found was Class::Struct. Now, I fully realize that >between hashes and arrays, and the rich set of Perl built-ins (like splice), >there isn't really a *need* for CPAN modular definitions of doubly linked >lists and so forth. But what if I don't want to program with fundamental >types yet stick with Perl? These abstractions make for easy programming and >self-documenting code (at least for a maintainer or someone not too familiar >with Perl), and I'm curious if I missed something on CPAN or if this simply >isn't a Perl thing to do. Perl includes the fundamental data types scalar, >array, and hash, would it be appropriate to also include a selection of ADTs? I'm not sure what more you want from an ADT that you think Perl doesn't provide, but it seems to me that the piece you're missing is operator overloading. Look up overload.pm. Between that and tie(), Perl gives you all the ADT-making capability that you could want. Or are you asking where third-party ADTs are? I think you'll find the greatest collection of them in PDL (Perl Data Language). Cheers, -- Peter Scott peter@psdt.com http://www.perldebugged.com From darren at DarrenDuncan.net Mon Mar 10 22:38:11 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] Apocalypse 6 is online Message-ID: Have a look here. And it's ABOUT time I say. -- Darren Duncan http://www.perl.com/pub/a/2003/03/07/apocalypse6.html From abez at abez.ca Mon Mar 10 23:02:45 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] Apocalypse 6 is online In-Reply-To: References: Message-ID: I'm really not into hacking types into a dynamically typed language. On another note I think lazy lists are a very cool feature for perl to have. Lazy evaluation is virtually needed by many "hacks". In haskell you can make an infinite list which is essentially like a function. Oh oh oh multimethods yes! Oh Oh Oh Pre and Post Conditions yes! And perl 6 is coming out when? :( Well at least parrot is coming along, maybe we'll get Perl5 in parrot :). abram On Mon, 10 Mar 2003, Darren Duncan wrote: > Have a look here. And it's ABOUT time I say. -- Darren Duncan > > http://www.perl.com/pub/a/2003/03/07/apocalypse6.html > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From nkuipers at uvic.ca Fri Mar 14 17:31:36 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] a little bit of perlophilia Message-ID: <3E72784A@wm2.uvic.ca> Hi everyone, I was playing with Perl at 2:30 this morning. My play turned to "Hello World!". Don't ask me how my brain works, but this is what came out: sub getName { (shift)->{name} } print "Hello ", bless({name => "World!\n"})->getName; It's object-based (I think, anyways when I threw a "ref or die" into getName it printed properly), doesn't use any explicit variables, and runs under strict and warnings pragmas no problem. When I consider each line carefully, I realize there is actually a lot of going on there in the way of shorthands, default behaviors etc., and I remember my very first days with Perl, and realize I've come a little ways. :) Anyways, reminiscing aside, I thought I would put this out to you all as an opportunity to creatively breathe new life into "Hello World!". I'd love to see what people came up with. If it turns out to be a fun and interesting thread, I'll post this on PerlMonks. Cheers, Nathanael From Peter at PSDT.com Fri Mar 14 17:52:38 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] a little bit of perlophilia In-Reply-To: <3E72784A@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030314153840.00aba830@shell2.webquarry.com> At 03:31 PM 3/14/03 -0800, nkuipers wrote: >Hi everyone, > >I was playing with Perl at 2:30 this morning. My play turned to "Hello >World!". > >Don't ask me how my brain works, but this is what came out: > >sub getName { (shift)->{name} } >print "Hello ", bless({name => "World!\n"})->getName; Maybe you'll like this: % perl -le 'package Hello; $,=", ";sub World { split /::/, (caller(0))[3] } print World Hello' >It's object-based (I think, anyways when I threw a "ref or die" into getName >it printed properly), doesn't use any explicit variables, and runs under >strict and warnings pragmas no problem. When I consider each line carefully, >I realize there is actually a lot of going on there in the way of shorthands, >default behaviors etc., and I remember my very first days with Perl, and >realize I've come a little ways. :) You sure have. Who was it was chastising me not long ago for shorthand idioms :-) >Anyways, reminiscing aside, I thought I would put this out to you all as an >opportunity to creatively breathe new life into "Hello World!". I'd love to >see what people came up with. If it turns out to be a fun and interesting >thread, I'll post this on PerlMonks. Have you seen POLECAT? (http://history.perl.org/oneliners/)? Or http://www.cpan.org/misc/japh ? -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From abez at abez.ca Fri Mar 14 18:20:01 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] a little bit of perlophilia In-Reply-To: <3E72784A@wm2.uvic.ca> References: <3E72784A@wm2.uvic.ca> Message-ID: I like it! Here is my rather large helloworld: Ok do not change any of the spacing it actually relies on that and it contains nathan's message Start cutting here -------- #Hi everyone, I was playing with Perl at 2:30 this morning. My play tu #rned to "Hello World!". Don't ask me how my brain works, but this is what came out: sub getName { #(shift)->{name} } print "Hello ", bless({name => "World! "})->getName; It's object-based (I think, anyways # when I threw a "ref or die" into getName it printed properly), doesn't use any explicit variables, and run #s under strict and warnings pragmas no problem. When I consider each line carefully, I realize there is actua #lly a lot of going on there in #the way of shorthands, default behaviors etc., and I remember my very first days with #Perl, and realize I've come a little ways. :) Anyways, reminiscing aside, I thought I would put this out to #you all as an opportunity to creatively breathe new life into "Hello World!". I'd love to see what people came u #p with. If it turns out to be a fun and interesting thread, I'll post this on PerlMonks. Cheers, Nathana #el ################################################################################################ seek DATA,0,0; while(){ chomp; print chr(length($_)) if /#/; } __DATA__ ---------- End Cutting here The string it prints is "Hello World\n" (evaluate it). abram On Fri, 14 Mar 2003, nkuipers wrote: > Hi everyone, > > I was playing with Perl at 2:30 this morning. My play turned to "Hello > World!". > > Don't ask me how my brain works, but this is what came out: > > sub getName { (shift)->{name} } > print "Hello ", bless({name => "World!\n"})->getName; > > It's object-based (I think, anyways when I threw a "ref or die" into getName > it printed properly), doesn't use any explicit variables, and runs under > strict and warnings pragmas no problem. When I consider each line carefully, > I realize there is actually a lot of going on there in the way of shorthands, > default behaviors etc., and I remember my very first days with Perl, and > realize I've come a little ways. :) > > Anyways, reminiscing aside, I thought I would put this out to you all as an > opportunity to creatively breathe new life into "Hello World!". I'd love to > see what people came up with. If it turns out to be a fun and interesting > thread, I'll post this on PerlMonks. > > Cheers, > > Nathanael > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From abez at abez.ca Sun Mar 16 16:23:44 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] Useful tiny script Message-ID: This is a very useful script: #!/usr/bin/perl for(@ARGV){print eval;print"\n";die $@,"\n"if $@} So you save and call it print anyways put it your path no you can go: print '3**(1/3)' and you get the answer or print 'sort(qw( print 'srand();join(" ",sort{int(rand()*3-1)}(qw(1 3 43 3 3 2 34 76 7 54 3 3 4 4 3 2 2 3 12 5 4 3 2 3 4 32)))' it's just a faster print -e [abez@supernaut abez]$ print 1 time 2 'join(",",reverse localtime)' 1 1047853394 2 0,74,0,103,2,16,14,23,14 I think the commandline math is the best. -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From darren at DarrenDuncan.net Sun Mar 16 17:43:16 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] need copies of modules we will examine in meeting Message-ID: Hello. Given that the next meeting is this tuesday and part of it will involve going over some biology-related modules, Nathaniel's I think, can the latest copies of these please be posted to the list tonight, so I or anyone else has time to look at them in advance, so the work/editing/discussion at the meeting can go more efficiently? Thank you. -- Darren Duncan From nkuipers at uvic.ca Mon Mar 17 13:09:17 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] BIO::modules Message-ID: <3E766A72@wm2.uvic.ca> There are three, but one is so trivial I am not sending it. Annotate ISA Basic. I've also attached the POD and driver files. If the computer used tomorrow evening has an internet connection, we can browse some BioPerl code as well. nathanael -------------- next part -------------- A non-text attachment was scrubbed... Name: Basic.pm Type: application/octet-stream Size: 2326 bytes Desc: not available Url : http://mail.pm.org/archives/victoria-pm/attachments/20030317/461ac5ac/Basic.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Annotate.pm Type: application/octet-stream Size: 1890 bytes Desc: not available Url : http://mail.pm.org/archives/victoria-pm/attachments/20030317/461ac5ac/Annotate.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Basic.pod Type: application/octet-stream Size: 1778 bytes Desc: not available Url : http://mail.pm.org/archives/victoria-pm/attachments/20030317/461ac5ac/Basic-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Annotate.pod Type: application/octet-stream Size: 3124 bytes Desc: not available Url : http://mail.pm.org/archives/victoria-pm/attachments/20030317/461ac5ac/Annotate-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: basicdriver Type: application/octet-stream Size: 1598 bytes Desc: not available Url : http://mail.pm.org/archives/victoria-pm/attachments/20030317/461ac5ac/basicdriver.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: annotatedriver Type: application/octet-stream Size: 796 bytes Desc: not available Url : http://mail.pm.org/archives/victoria-pm/attachments/20030317/461ac5ac/annotatedriver.obj From darren at DarrenDuncan.net Mon Mar 17 14:03:00 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] BIO::modules In-Reply-To: <3E766A72@wm2.uvic.ca> Message-ID: On Mon, 17 Mar 2003, nkuipers wrote: > There are three, but one is so trivial I am not sending it. Annotate ISA > Basic. I've also attached the POD and driver files. If the computer used > tomorrow evening has an internet connection, we can browse some BioPerl code > as well. > nathanael Thanks for sending those 3 files, Nathaniel. Since they are encoded in octet/stream I can't view them now in Pine, but they should decode fine in Eudora when I get home, so I will look at them then. It occurs to me that you should send the 4th file if it is required by any of the other three, in case we decide to run code against them to test that any changes work. On the other hand, if it is impractical to run the code, then that isn't such an issue. I look forward to the meeting tomorrow. -- Darren Duncan From Peter at PSDT.com Mon Mar 17 15:46:49 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] Victoria Perl Mongers meeting tomorrow Message-ID: <4.3.2.7.2.20030317131137.00ab9d50@shell2.webquarry.com> Victoria.pm will meet Tuesday, March 18, 7pm, at UVic's Clearihue A206. Nathanael Kuipers has agreed to provide some bioinformatics modules he has been working on for the group mind to improve as much as possible in the time permitting. Among the goals will be maintainability and following best practices for submissions intended for CPAN. We will present this via a laptop projected on a large screen. People making suggestions for changes will explain their reasoning. For those unfamiliar with UVic, see grid C3. Parking can be found at the top centre of B3. If you don't know how to get to UVic - welcome to Victoria - see . Other topics to be covered as time permits; make requests for anything particular. (Courtesy copy to VLUG members by permission of the list manager. Victoria.pm's home page is .) -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From Peter at PSDT.com Mon Mar 17 15:54:17 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] BIO::modules In-Reply-To: <3E766A72@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030317135311.00b61d20@shell2.webquarry.com> At 11:09 AM 3/17/03 -0800, you wrote: >There are three, but one is so trivial I am not sending it. Annotate ISA >Basic. I've also attached the POD and driver files. If the computer used >tomorrow evening has an internet connection, we can browse some BioPerl code >as well. How hard is it to get on the network in Clea A206? Is there a public 802.11b? If not, then tell me where the code you'd want to browse is so I can download it. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From abez at abez.ca Mon Mar 17 17:00:36 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] BIO::modules In-Reply-To: <4.3.2.7.2.20030317135311.00b61d20@shell2.webquarry.com> References: <4.3.2.7.2.20030317135311.00b61d20@shell2.webquarry.com> Message-ID: It's a pain to get network access. So download the necessary modules. On Mon, 17 Mar 2003, Peter Scott wrote: > At 11:09 AM 3/17/03 -0800, you wrote: > >There are three, but one is so trivial I am not sending it. Annotate ISA > >Basic. I've also attached the POD and driver files. If the computer used > >tomorrow evening has an internet connection, we can browse some BioPerl code > >as well. > > How hard is it to get on the network in Clea A206? Is there a public > 802.11b? If not, then tell me where the code you'd want to browse is > so I can download it. > > -- > Peter Scott > Pacific Systems Design Technologies > http://www.perldebugged.com/ > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From nkuipers at uvic.ca Tue Mar 18 13:34:13 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] database frontend Message-ID: <3E7776F6@wm2.uvic.ca> Fellow Mongers, You've seen me progress through various stages with my project and Perl, and now I'm at a new stage. I've got a Postgres database with about 20,000 entries from the salmonid genome project, mined from about 80,000+ sequences as being significant, by my Perl software. The database is very very simple at this point. What I need to do is throw up a correspondingly simple but effective web frontend for querying. I did a supersearch at PerlMonks on "database frontend" and from this I extracted the following tools for doing this: o CGI o DBI/DBIx::HTMLinterface o HTML::Mason/HTML::Template o LWP as well as the book "Programming the Perl DBI" (which I happen to have). There were less than 30 threads in the sections I searched, and the relevant ones were from around 2001 (and dealing with MySQL, although I wouldn't think this matters). Are these tools (other than DBI/CGI, I would imagine they are involved) still the defacto standard? I've never done anything like this, including zero LWP or CGI experience. What are your suggestions? Any ideas welcome. tia, ttyl, "and all that jazz". :) nathanael From darren at DarrenDuncan.net Tue Mar 18 13:53:45 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] database frontend In-Reply-To: <3E7776F6@wm2.uvic.ca> Message-ID: On Tue, 18 Mar 2003, nkuipers wrote: > I've got a Postgres database with about 20,000 entries from the salmonid > genome project, mined from about 80,000+ sequences as being significant, by my > Perl software. The database is very very simple at this point. What I need to > do is throw up a correspondingly simple but effective web frontend for > querying. I did a supersearch at PerlMonks on "database frontend" and from > this I extracted the following tools for doing this: Ah yes, databases, websites, and perl: 3 of my favorite things. > Are these tools (other than DBI/CGI, I would imagine they are > involved) still the defacto standard? I've never done anything like this, > including zero LWP or CGI experience. What are your suggestions? Any ideas > welcome. DBI and CGI are the two single most popular CPAN downloads as I recall which aren't part of the Perl core (CGI is bundled with the standard distribution, though). As such, if you use these you can probably get help from more people than if you use anything else. That said, if your interface is very simple, these should be quite enough to meet your needs, and you wouldn't have to write much code yourself. Whereas, if your interface would be quite complicated, you might want to look at some other options or write more code. LWP is for writing web clients, which isn't what you are doing, and Mason is designed for large complicated server applications, and would be overkill for your uses. Perhaps if you outlined briefly what kind of "screens" you want your web interface to have. Eg: what would be presented to a user initially, what they would do there, what should result, etc. Then we/I could better help you. -- Darren DUncan From darren at DarrenDuncan.net Tue Mar 18 13:56:02 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] BIO::modules In-Reply-To: <4.3.2.7.2.20030317135311.00b61d20@shell2.webquarry.com> Message-ID: I sent a message to Peter and the list last night, which had two attached files (for the meeting tonight). I didn't get a copy returned to me. Did any of you get it? -- Darren Duncan From Peter at PSDT.com Tue Mar 18 13:57:29 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] BIO::modules In-Reply-To: References: <4.3.2.7.2.20030317135311.00b61d20@shell2.webquarry.com> Message-ID: <4.3.2.7.2.20030318115653.00b60550@shell2.webquarry.com> At 11:56 AM 3/18/03 -0800, Darren Duncan wrote: >I sent a message to Peter and the list last night, which had two attached >files (for the meeting tonight). I didn't get a copy returned to me. Did >any of you get it? -- Darren Duncan I got it and downloaded the files. The list software rejected it because the total size of the message exceeded 40k lines. A URL for download would have been preferable... -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From peter at PSDT.com Tue Mar 18 14:08:15 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] database frontend In-Reply-To: <3E7776F6@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030318115816.00b67b40@shell2.webquarry.com> At 11:34 AM 3/18/03 -0800, nkuipers wrote: >Fellow Mongers, > >You've seen me progress through various stages with my project and Perl, and >now I'm at a new stage. > >I've got a Postgres database with about 20,000 entries from the salmonid >genome project, mined from about 80,000+ sequences as being >significant, by my >Perl software. The database is very very simple at this point. What I need to >do is throw up a correspondingly simple but effective web frontend for >querying. I did a supersearch at PerlMonks on "database frontend" and from >this I extracted the following tools for doing this: > >o CGI >o DBI/DBIx::HTMLinterface >o HTML::Mason/HTML::Template >o LWP > >as well as the book "Programming the Perl DBI" (which I happen to >have). There >were less than 30 threads in the sections I searched, and the relevant ones >were from around 2001 (and dealing with MySQL, although I wouldn't think this >matters). Are these tools (other than DBI/CGI, I would imagine they are >involved) still the defacto standard? I've never done anything like this, >including zero LWP or CGI experience. What are your suggestions? Any ideas >welcome. I would be interested in solutions here too. I have done a lot of rolling my own in this respect, including my latest project whose back end database was a Remedy trouble ticket system. What you appear to want is something like a ColdFusion capability, at least, that's something I was thinking about recently, after noting how easily CF integrates web forms and databases. The only culprit I know for sure that does this integration is AxKit, although from what I've seen of it, that would be like using an atom bomb to crack a nut for anything short of a site like a Microsoft bug report tracking system. What I do so far is just ensure that my database columns have names that I can also be used as HTML form input names, then when I read in a form I can pass param() through a routine that extracts values as a hash and returns it to an object constructor. That part's easy; I never have to mention fields explicitly unless they're exceptional. Unfortunately it's all the exceptions that are cumbersome. Fields that need special validation, fields that need to be transformed, computed fields, and fields that go into records in another table. Although frankly, probably a lot of the time just goes into creating the HTML. You might look at Tangram and Alzabo (should be on CPAN). They both map objects to RDBMSes. One can handle legacy databases, the other requires you use it to create the tables. Both are pretty complicated systems but you appear to have a knack for picking things up quickly :-) Hard to say whether this isn't overkill for your application, though. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From nkuipers at uvic.ca Tue Mar 18 14:40:20 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] database frontend Message-ID: <3E779059@wm2.uvic.ca> >I've just been using CGI and the Pg module Carl, Just out of curiosity, why do you use the Pg module as opposed to DBI (which would pull in DBD::Pg with the appropriate call to DBI->connect)? The reason I ask is that the interface of DBI is clean and standardized, and so the impression I've gotten is that it is generally what's used. But there must be a reason for the existence of Pg...perhaps a frequent user wouldn't mind sharing his wisdom. :) Cheers, nathanael From Peter at PSDT.com Tue Mar 18 14:50:19 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] database frontend In-Reply-To: <3E779059@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030318124857.00b64d40@shell2.webquarry.com> At 12:40 PM 3/18/03 -0800, nkuipers wrote: > >I've just been using CGI and the Pg module > >Carl, > >Just out of curiosity, why do you use the Pg module as opposed to DBI (which >would pull in DBD::Pg with the appropriate call to DBI->connect)? The reason >I ask is that the interface of DBI is clean and standardized, and so the >impression I've gotten is that it is generally what's used. But there >must be >a reason for the existence of Pg...perhaps a frequent user wouldn't mind >sharing his wisdom. :) The most recent version of Pg is three years old. On the other hand, the first version came out close to the inception of DBI. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From nkuipers at uvic.ca Tue Mar 18 14:59:43 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] database frontend Message-ID: <3E77A183@wm2.uvic.ca> >Perhaps if you outlined briefly what kind of "screens" you want your web >interface to have. Good idea. :) >Eg: what would be presented to a user initially A welcome page with a list of links, some of which are user/password protected. One username and one password is sufficient for my purposes; we just want to allow any approved guest read-only access to the database. >what they would do there No updating the database. Queries only, with nice webformatted output. The fields of my main table that I want to be queryable are: locus: int cluster: int length: int accession: varchar type: varchar name: text All fields should accept lists of arguments, ie., "all repeats located in clusters 58,2000" Numeric fields should accept ranges also ie., "all repeats located in clusters 58-2000", or "all repeats where length is less than 500 and greater than 301". The second group of fields, other than accession which must be case-sensitive and in all other ways totally specific, should allow "fuzzy" querying, ie, a request of "all repeats of type sInE" is interpretted as a case-insensitive mapping to the actual type "SINE", or "all repeats where name contains the text 'fooper dooper'". >From the above description you can imagine the sorts of buttons and text fields might be required. >what should result, etc. For now, a simple (but uniformly formatted) HTML dump is sufficient, I'd work out the actual formatting later. Thanks, Nathanael From nkuipers at uvic.ca Tue Mar 18 15:09:06 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] I'm just full of questions today Message-ID: <3E77A8A7@wm2.uvic.ca> Hello again, I've re-reading the Llama, just to come back to basics a bit and consolidate, and I came across the following in Chapter 11, page 150 (the first footnote): "Also, generally, errors aren't buffered. That means that if the standard error and standard output streams are both going to the same place (such as the monitor), the errors may appear earlier than the normal output. For example, if your program prints a line of ordinary text, then tries to divide by zero, the output may show the message about dividing by zero first, and the ordinary text second." Let's break that down. -generally, errors aren't buffered When are they buffered, how do you recognize when this is the case, and how do you apply error buffering (and why/when would you want to)? -the output may show the message about dividing by zero first, and the ordinary text second May? As in, this is a platform-dependent phenomenon? This is a magical phenomenon? This is perl taking a guess and generally being wrong phenomenon? Also, this behavior seems awfully reminiscent of a stack. Is there a stack under the hood here? too much to know... nathanael From peter at PSDT.com Tue Mar 18 15:16:58 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] database frontend In-Reply-To: <3E77A183@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030318131130.00b6ad10@shell2.webquarry.com> At 12:59 PM 3/18/03 -0800, nkuipers wrote: > >Eg: what would be presented to a user initially > >A welcome page with a list of links, some of which are user/password >protected. >One username and one password is sufficient for my purposes; we just want to >allow any approved guest read-only access to the database. > > >what they would do there > >No updating the database. Queries only, with nice webformatted output. The >fields of my main table that I want to be queryable are: > >locus: int >cluster: int >length: int > >accession: varchar >type: varchar >name: text > >All fields should accept lists of arguments, ie., "all repeats located in >clusters 58,2000" Numeric fields should accept ranges also ie., "all repeats >located in clusters 58-2000", or "all repeats where length is less than 500 >and greater than 301". > >The second group of fields, other than accession which must be case-sensitive >and in all other ways totally specific, should allow "fuzzy" querying, ie, a >request of "all repeats of type sInE" is interpretted as a case-insensitive >mapping to the actual type "SINE", or "all repeats where name contains the >text 'fooper dooper'". > > >From the above description you can imagine the sorts of buttons and text >fields might be required. > > >what should result, etc. > >For now, a simple (but uniformly formatted) HTML dump is sufficient, I'd work >out the actual formatting later. I find this sort of thing easiest if I mock up the HTML first and then I can imagine the different ways it will be used. Often there are more than I thought of to begin with. For instance, would the user want to query on whether a field is null? If that ever becomes a requirement it can screw up your whole interface unless you thought of it to begin with. Sounds like you want a table somewhere that describes each field and its type, plus what you can do with it. This is the database schema plus a bit more info. So you could indicate whether or not searches on that field are case insensitive, for instance. Or whether it's numeric. Then your searching code can be completely data-driven and just form the query without regard to specific fields. If efficiency is any concern you want to use placeholders where possible and prepare the SQL ahead of time. This may not be possible in this interface, though, where you don't know what the user is going to enter. The requirements you state for handling things like lists and ranges are easy to translate to SQL and I've done them before. I can share code if you want. We could always hack on this tonight as well... -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From peter at PSDT.com Tue Mar 18 15:22:44 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] I'm just full of questions today In-Reply-To: <3E77A8A7@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030318131717.00abd470@shell2.webquarry.com> At 01:09 PM 3/18/03 -0800, nkuipers wrote: >Hello again, > >I've re-reading the Llama, just to come back to basics a bit and consolidate, >and I came across the following in Chapter 11, page 150 (the first footnote): > >"Also, generally, errors aren't buffered. That means that if the standard >error and standard output streams are both going to the same place (such as >the monitor), the errors may appear earlier than the normal output. For >example, if your program prints a line of ordinary text, then tries to divide >by zero, the output may show the message about dividing by zero first, >and the >ordinary text second." > >Let's break that down. > >-generally, errors aren't buffered s/generally/almost always/ >When are they buffered, how do you recognize when this is the case, Never wanted/had to. >and how do >you apply error buffering (and why/when would you want to)? my $oldfh = select STDERR; $| = 0; select $oldfh; You'd need a darn good reason. There's been a thread recently on clpmod about intercepting stderr and stdout and keeping the streams in the same order that you'd see them on the terminal (where stdout is line buffered instead of fully buffered). If you had the source of the application being run perhaps you could handle this by buffering stderr. But I'm stretching here. >-the output may show the message about dividing by zero first, and the >ordinary text second > >May? As in, this is a platform-dependent phenomenon? Yes. >This is a magical phenomenon? No. >This is perl taking a guess and generally being wrong phenomenon? Nothing to do with Perl, it's to do with how terminal drivers and shells set buffering on their I/O streams. The same problem is faced by any language and on most if not all operating systems. > Also, this behavior seems awfully reminiscent of a stack. Is there > a stack under the hood here? No. >too much to know... Don't worry about this. It's highly unlikely to cause you any issues, and if it ever does, you'll know about it when it happens. If you really want to know the ugly truth, read Steven's Advanced Programming in the Unix Environment. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From darren at DarrenDuncan.net Tue Mar 18 15:42:49 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] I'm just full of questions today In-Reply-To: <3E77A8A7@wm2.uvic.ca> Message-ID: I don't know if this would be useful to you, but some modules I published like CGI::Portable and HTML::FormTemplate are designed to help with the kind of web application you are making. Collectively they replace all of CGI's functionality (except esoterica like file uploads) but also provide a lot of extra. Some extra functionality includes data-driven form generation, as well as trapping fatal errors in your program so they are easier to display in the web page for debugging. -- Darren Duncan From darren at DarrenDuncan.net Tue Mar 18 15:45:53 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:18 2004 Subject: [VPM] I'm just full of questions today (fwd) Message-ID: I just said: > Some extra functionality includes data-driven form generation, as well A key point I neglected to mention is that all form field types can take multiple values (a separate input box is made for each value), so if you prefer this to having the user type in a comma-delimited list, you can have it easily. -- Darren Duncan From cconstan at csc.UVic.CA Tue Mar 18 16:15:05 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] database frontend In-Reply-To: <3E779059@wm2.uvic.ca> References: <3E779059@wm2.uvic.ca> Message-ID: <20030318221505.GE8288@csc> sorry, the last one didn't go to the list. *On Tue Mar 18, 2003 at 12:40:20PM -0800, nkuipers (nkuipers@uvic.ca) wrote: > >I've just been using CGI and the Pg module > > Carl, > > Just out of curiosity, why do you use the Pg module as opposed to DBI (which > would pull in DBD::Pg with the appropriate call to DBI->connect)? The reason > I ask is that the interface of DBI is clean and standardized, and so the > impression I've gotten is that it is generally what's used. But there must be > a reason for the existence of Pg...perhaps a frequent user wouldn't mind > sharing his wisdom. :) At the time we decided to do this, Pg was the best solution for our needs. We didn't need the extra abstraction that DBI provides. It was also pretty quick. There were some other issues that my co-worker at the time looked into and decided we should just use Pg. For the may term, I will be installing Perl::DBI and DBI::Pg. Our CGI's will probably still use Pg though as we have a few modules that depend on it (including a nifty SQLFail routine and various others) and it works well and fast. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From darren at DarrenDuncan.net Tue Mar 18 16:21:52 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] database frontend In-Reply-To: <20030318221505.GE8288@csc> Message-ID: On Tue, 18 Mar 2003, Carl B. Constantine wrote: > At the time we decided to do this, Pg was the best solution for our > needs. We didn't need the extra abstraction that DBI provides. It was > also pretty quick. There were some other issues that my co-worker at the > time looked into and decided we should just use Pg. > > For the may term, I will be installing Perl::DBI and DBI::Pg. > Our CGI's will probably still use Pg though as we have a few modules > that depend on it (including a nifty SQLFail routine and various others) > and it works well and fast. I don't know for sure, but I think that the current version of Pg is actually a layer on top of DBD::Pg, in which case with the current version you would likely get better performance using the latter. -- Darren Duncan From darren at DarrenDuncan.net Tue Mar 18 19:03:09 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] MySQL 4.12 has been released Message-ID: I'm happy to say, having watched things carefully, that the 4.0.x branch of the MySQL database has now been declared stable or production ready as of today's 4.0.12 release. And it took a long period of testing to get there too. So now I can finally upgrade from 3.23.x. -- Darren Duncan From nkuipers at uvic.ca Fri Mar 21 14:12:21 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] database frontend II Message-ID: <3E7BDFD9@wm2.uvic.ca> Hello fellow Mongers, I gave some thought (though you'll probably conclude, "not much") to the layout of afore-mentioned database frontend, and put together a skeleton so that you can get an idea of what I am trying to accomplish. You can find it at http://www.csc.uvic.ca/~nkuipers/title.html Basically, it consists of a welcome page, a [very preliminary] documentation page, a [not yet password protected] search page, and some links. The search page is a form who elements are not yet active. I welcome any criticism on the layout/design, and any tips for making it better. So, I have a postgres database being populated as I write, and a nice looking frontend. Now is the hard(?) part, designing and writing the guy who sits in the middle. I've all but decided on using HTML::Template as my main tool, and am studying its documentation again. Again, any advice for how to proceed securely is much appreciated. Have a great weekend, Nathanael From peter at PSDT.com Fri Mar 21 14:15:06 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] database frontend II In-Reply-To: <3E7BDFD9@wm2.uvic.ca> Message-ID: <4.3.2.7.2.20030321121209.00b824b0@shell2.webquarry.com> At 12:12 PM 3/21/03 -0800, nkuipers wrote: >Hello fellow Mongers, > >I gave some thought (though you'll probably conclude, "not much") to the >layout of afore-mentioned database frontend, and put together a skeleton so >that you can get an idea of what I am trying to accomplish. > >You can find it at http://www.csc.uvic.ca/~nkuipers/title.html > >Basically, it consists of a welcome page, a [very preliminary] documentation >page, a [not yet password protected] search page, and some links. The search >page is a form who elements are not yet active. > >I welcome any criticism on the layout/design, and any tips for making it >better. The comments of the people who are going to be using the system are the ones you want. >So, I have a postgres database being populated as I write, and a nice looking >frontend. Now is the hard(?) part, designing and writing the guy who sits in >the middle. I've all but decided on using HTML::Template as my main tool, I would concur. I find it to be just right. >and >am studying its documentation again. Again, any advice for how to proceed >securely is much appreciated. What do you mean by "securely"? -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From cconstan at csc.UVic.CA Wed Mar 26 17:56:16 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines Message-ID: <20030326235616.GE17384@csc> I'm working on improving the perl code for the program I was talking about at the last meeting. I'm not quite ready to put it out for all to read yet as I have to change a bunch of data to protect people's privacy and I just haven't gotten around to doing that. One of the things my boss wants me to do is rework the print queue headings. Here are the gory details: I have an array that contains a list of all of our printers. Some of the printer names (print queue names really) are fairly long. For example: tp-colour-tr, where as others are relatively short, ie: tp. When I print the report out for each prof (using some ugly centering code to make sure everything lines up properly), the header looks like this: Page Rate ==> (0.07) (0.00) ( 0.07) ( 0.00) ( 0.50) ( 0.50) ( 0.00) Student Login rp tp rp-test tp-test rp-colour rp-colour-tr tp-colour-tr Total ======================================================================================================================= Now, what my boss would like is that for print queue names that have a hyphan in them, print the queue name over multiple lines while still lining things up like so: Page Rate ==> (0.07) (0.00) (0.07) (0.00) ( 0.50) ( 0.50) ( 0.00) Student Login rp tp rp- tp- rp- rp- tp- test test colour colour colour- tr- tr- Total =============================================================================================== the idea being to try and fit the report into 80 columns as much as possible. Quit frankly that header could be slightly different, like say the rp & tp and the test printers down a line or two, but the principle is the same. right now, when I'm printing this header, I have really ugly code that looks like this: print "Page Rate ==>\t"; foreach $queue (@allPrinters) { if (exists $profHash{$leftOver}{$queue}) { $len = length($queue); if ($len <= $rateLen) { printf "(%2.2f) ",$printCost{$queue}/100; } else { $len -= 2; # subtract 2 from the total length to take the ( & ) into account when printing printf "(%".$len.".2f) ",$printCost{$queue}/100; } } } print "\n"; print "Student Login\t"; my $count = 0; my $length = 0; foreach $queue (@allPrinters) { if (exists $profHash{$leftOver}{$queue}) { $len = length($queue); if ($len < $rateLen) { printf "%".$rateLen."s ",$queue; $length += $rateLen; } else { printf "%".$len."s ",$queue; $length += $len; } $count++; } } print "Total\n"; $length += ($count * 6) + 13 + 5; # this hack really needs to be fixed print "=" x $length; # it doesn't work right anyway. print "\n\n"; any ideas, help are greatly appreciated. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From Peter at PSDT.com Wed Mar 26 18:50:00 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] April meeting? Message-ID: <4.3.2.7.2.20030324165001.00babad0@shell2.webquarry.com> Any takers for a topic for the April meeting? Anyone want to continue with public module hacking? T'was quite educational, I thought. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From nkuipers at uvic.ca Wed Mar 26 18:52:17 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines Message-ID: <3E8289F5@wm2.uvic.ca> The builtins approach would probably use formats, and/or line wrapping with Text::Wrap. But you should have a look in the Text:: namespace on CPAN, as there are many modules there that may be of service in getting the job done with clean code. Two modules that caught my eye were Text::TabularDisplay Text::FormatTable but there are others that look interesting. Nathanael From nkuipers at uvic.ca Wed Mar 26 18:56:32 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] April meeting? Message-ID: <3E828CA2@wm2.uvic.ca> >Anyone want to continue with public module hacking...educational, I thought. Me too. I found it to be tremendously useful. I've since implemented most of the changes covered in my BIO modules, including not making direct calls to object fields even in the source module, putting parts of BIO::Annotate back into BIO::Basic and scrapping the rest of Annotate, and embedding POD. You can see the results of your much appreciated criticisms at www.csc.uvic.ca/nkuipers/nkuipers.html (scroll down to My Modules). Failing any other topics that people are just burning to cover, I would be quite content with more hacking. Nathanael From nkuipers at uvic.ca Wed Mar 26 18:58:46 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] bad URL Message-ID: <3E828E03@wm2.uvic.ca> not that you care, but just in case you do: http://www.csc.uvic.ca/~nkuipers/nkuipers.html I forgot that ~ doh! n From abez at abez.ca Wed Mar 26 20:09:10 2003 From: abez at abez.ca (Abram Hindle) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines In-Reply-To: <20030326235616.GE17384@csc> References: <20030326235616.GE17384@csc> Message-ID: I haven't looked at the code but why not print out latex rather than plain text. Then you use latex or pdflatex to render it. Then you need not waste time with formatting. Even better produce a flat (easy to parse) xml document which represents the table and then make a filter which outputs to latex->ps/pdf. abram On Wed, 26 Mar 2003, Carl B. Constantine wrote: > I'm working on improving the perl code for the program I was talking > about at the last meeting. I'm not quite ready to put it out for all to > read yet as I have to change a bunch of data to protect people's privacy > and I just haven't gotten around to doing that. > > One of the things my boss wants me to do is rework the print queue > headings. Here are the gory details: -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From peter at PSDT.com Wed Mar 26 21:15:01 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines In-Reply-To: <20030326235616.GE17384@csc> Message-ID: <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> At 03:56 PM 3/26/03 -0800, Carl B. Constantine wrote: >I'm working on improving the perl code for the program I was talking >about at the last meeting. I'm not quite ready to put it out for all to >read yet as I have to change a bunch of data to protect people's privacy >and I just haven't gotten around to doing that. > >One of the things my boss wants me to do is rework the print queue >headings. Here are the gory details: > >I have an array that contains a list of all of our printers. Some of the >printer names (print queue names really) are fairly long. For example: >tp-colour-tr, where as others are relatively short, ie: tp. > >When I print the report out for each prof (using some ugly centering >code to make sure everything lines up properly), the header looks like >this: > >Page Rate ==> (0.07) (0.00) ( 0.07) ( >0.00) ( 0.50) ( 0.50) ( 0.00) >Student >Login rp tp rp-test tp-test rp-colour >rp-colour-tr tp-colour-tr Total >======================================================================================================================= > >Now, what my boss would like is that for print queue names that have a >hyphan in them, print the queue name over multiple lines while still >lining things up like so: > >Page Rate ==> (0.07) (0.00) (0.07) (0.00) ( 0.50) ( >0.50) ( 0.00) >Student >Login rp tp rp- tp- rp- rp- tp- > test test colour > colour colour- > >tr- tr- Total >=============================================================================================== > > > >the idea being to try and fit the report into 80 columns as much as >possible. Quit frankly that header could be slightly different, like say >the rp & tp and the test printers down a line or two, but the principle >is the same. Yeah, that's pretty gross, and the right justification sucks. I don't have time to test this, but something like this perhaps: my @split_names = map split_name($_), @allPrinters; print "Page Rate ==> ", map(col_fmt($_, -1, page_rate($allPrinters[$_])) => 0 .. $#allPrinters), "\n"; for (my $line = 0; grep $split_names[$_][$line] => 0..$#allPrinters; $line++) { my $begin = $line ? " " : "Student Login "; print $begin, map(col_fmt($_, $line, $split_names[$line]) => 0 .. $#allPrinters, "\n"; } sub page_rate { sprintf "(%.2f)", $printCost{shift()}/100; } sub col_fmt { my ($prt, $line, $text) = @_; my $width = $line >= 0 ? max($MINWIDTH, length($split_names[$prt][$line]||'')) : $MINWIDTH; sprintf " %-*s", $width, $text; } sub split_name { [ shift =~ /(.*-?)/g ]; } >right now, when I'm printing this header, I have really ugly code that >looks like this: > >print "Page Rate ==>\t"; > foreach $queue (@allPrinters) { > if (exists $profHash{$leftOver}{$queue}) { > $len = length($queue); > if ($len <= $rateLen) { > printf "(%2.2f) ",$printCost{$queue}/100; > } else { > $len -= 2; # subtract 2 from the total length to take the ( & > ) into account when printing > printf "(%".$len.".2f) ",$printCost{$queue}/100; > } > } > } > print "\n"; > print "Student Login\t"; > my $count = 0; > my $length = 0; > foreach $queue (@allPrinters) { > if (exists $profHash{$leftOver}{$queue}) { > $len = length($queue); > if ($len < $rateLen) { > printf "%".$rateLen."s ",$queue; > $length += $rateLen; > } else { > printf "%".$len."s ",$queue; > $length += $len; > } > $count++; > } > } > print "Total\n"; > $length += ($count * 6) + 13 + 5; # this hack really needs to be fixed > print "=" x $length; # it doesn't work right anyway. > print "\n\n"; > >any ideas, help are greatly appreciated. > >-- >Carl B. Constantine University of Victoria >Programmer Analyst http://www.csc.uvic.ca >UNIX System Administrator Victoria, BC, Canada >cconstan@csc.uvic.ca ELW A220, 721-8753 -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From cconstan at csc.UVic.CA Thu Mar 27 10:31:11 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines In-Reply-To: References: <20030326235616.GE17384@csc> Message-ID: <20030327163111.GF17384@csc> *On Wed Mar 26, 2003 at 06:09:10PM -0800, Abram Hindle (abez@abez.ca) wrote: > > I haven't looked at the code but why not print out latex rather than plain > text. Then you use latex or pdflatex to render it. Then you need not waste > time with formatting. Even better produce a flat (easy to parse) xml document > which represents the table and then make a filter which outputs to > latex->ps/pdf. that would be fine except these reports are delivered via email to profs. Many don't bother with HTML mail (using console based email such as pine, elm, etc) so that's not an option either. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From cconstan at csc.UVic.CA Thu Mar 27 13:45:34 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines In-Reply-To: <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> References: <20030326235616.GE17384@csc> <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> Message-ID: <20030327194534.GI17384@csc> *On Wed Mar 26, 2003 at 07:15:01PM -0800, Peter Scott (Peter@PSDT.com) wrote: > >the idea being to try and fit the report into 80 columns as much as > >possible. Quit frankly that header could be slightly different, like say > >the rp & tp and the test printers down a line or two, but the principle > >is the same. > > Yeah, that's pretty gross, and the right justification sucks. > > I don't have time to test this, but something like this perhaps: > > my @split_names = map split_name($_), @allPrinters; interestingly, I get an error on the above line even though I put this section of the code in a new routine to test it out: Global symbol "@split_names" requires explicit package name at resPrint.pl line 617 but, I/you used "my @split_names" so what is it complaining about a global for? Nothing like that exists anywhere else in my code. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From Peter at PSDT.com Thu Mar 27 13:50:58 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines In-Reply-To: <20030327194534.GI17384@csc> References: <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> <20030326235616.GE17384@csc> <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> Message-ID: <5.2.0.9.2.20030327115030.00b42320@shell2.webquarry.com> At 11:45 AM 3/27/2003 -0800, Carl B. Constantine wrote: >*On Wed Mar 26, 2003 at 07:15:01PM -0800, Peter Scott (Peter@PSDT.com) wrote: > > >the idea being to try and fit the report into 80 columns as much as > > >possible. Quit frankly that header could be slightly different, like say > > >the rp & tp and the test printers down a line or two, but the principle > > >is the same. > > > > Yeah, that's pretty gross, and the right justification sucks. > > > > I don't have time to test this, but something like this perhaps: > > > > my @split_names = map split_name($_), @allPrinters; > >interestingly, I get an error on the above line even though I put this >section of the code in a new routine to test it out: > >Global symbol "@split_names" requires explicit package name at >resPrint.pl line 617 > >but, I/you used "my @split_names" so what is it complaining about a >global for? Nothing like that exists anywhere else in my code. Probably a syntax error on an immediately preceding line. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From cconstan at csc.UVic.CA Thu Mar 27 13:58:48 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines In-Reply-To: <5.2.0.9.2.20030327115030.00b42320@shell2.webquarry.com> References: <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> <20030326235616.GE17384@csc> <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> <5.2.0.9.2.20030327115030.00b42320@shell2.webquarry.com> Message-ID: <20030327195848.GJ17384@csc> *On Thu Mar 27, 2003 at 11:50:58AM -0800, Peter Scott (Peter@PSDT.com) wrote: > >> my @split_names = map split_name($_), @allPrinters; > > > >interestingly, I get an error on the above line even though I put this > >section of the code in a new routine to test it out: > > > >Global symbol "@split_names" requires explicit package name at > >resPrint.pl line 617 > > > >but, I/you used "my @split_names" so what is it complaining about a > >global for? Nothing like that exists anywhere else in my code. > > Probably a syntax error on an immediately preceding line. nope. I put this code at the end of the file in a new subroutine like so: sub newHeader { my @split_names = map split_name($_), @allPrinters; for (my $line = 0; grep $split_names[$_][$line] => 0..$#allPrinters; $line++) { my $begin = $line ? " " : "Student Login "; print $begin, map(col_fmt($_, $line, $split_names[$line]) => 0 .. $#allPrinters), "\n"; } } So I shouldn't get any such error; I just moved it to "global" scope and do not get any errors, but I also do not get printer names either. Having it in both locations gives me an error on max: Undefined subroutine &main::max called at ./resPrint.pl line 618. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From cconstan at csc.UVic.CA Thu Mar 27 14:15:09 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines In-Reply-To: <20030327195848.GJ17384@csc> References: <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> <20030326235616.GE17384@csc> <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> <5.2.0.9.2.20030327115030.00b42320@shell2.webquarry.com> <20030327195848.GJ17384@csc> Message-ID: <20030327201509.GK17384@csc> *On Thu Mar 27, 2003 at 11:58:48AM -0800, Carl B. Constantine (cconstan@csc.UVic.CA) wrote: > > Probably a syntax error on an immediately preceding line. > > nope. I put this code at the end of the file in a new subroutine like > so: > > sub newHeader { > my @split_names = map split_name($_), @allPrinters; > for (my $line = 0; grep $split_names[$_][$line] => 0..$#allPrinters; $line++) { > my $begin = $line ? " " : "Student Login "; > print $begin, map(col_fmt($_, $line, $split_names[$line]) => 0 .. $#allPrinters), "\n"; > } > } did a little more digging. > I just moved it to "global" scope and do not get any errors, but I also > do not get printer names either. it does need to be global scope as it's referenced in the col_fmt routine. However it does not print the printer names at all. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From peter at PSDT.com Thu Mar 27 15:49:20 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines In-Reply-To: <20030327201509.GK17384@csc> References: <20030327195848.GJ17384@csc> <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> <20030326235616.GE17384@csc> <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> <5.2.0.9.2.20030327115030.00b42320@shell2.webquarry.com> <20030327195848.GJ17384@csc> Message-ID: <5.2.0.9.2.20030327134818.018759d8@shell2.webquarry.com> At 12:15 PM 3/27/2003 -0800, Carl B. Constantine wrote: >*On Thu Mar 27, 2003 at 11:58:48AM -0800, Carl B. Constantine >(cconstan@csc.UVic.CA) wrote: > > > Probably a syntax error on an immediately preceding line. > > > > nope. I put this code at the end of the file in a new subroutine like > > so: > > > > sub newHeader { > > my @split_names = map split_name($_), @allPrinters; > > for (my $line = 0; grep $split_names[$_][$line] => > 0..$#allPrinters; $line++) { > > my $begin = $line ? " " : "Student Login "; > > print $begin, map(col_fmt($_, $line, $split_names[$line]) => 0 > .. $#allPrinters), "\n"; > > } > > } > >did a little more digging. > > > I just moved it to "global" scope and do not get any errors, but I also > > do not get printer names either. > >it does need to be global scope as it's referenced in the col_fmt >routine. However it does not print the printer names at all. Well this illustrates the problem in trying to do development on a program when all you have is a fragment :-) Take my input as a suggested approach but not necessarily something you can drop straight in to whatever you've got. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From cconstan at csc.UVic.CA Thu Mar 27 16:15:22 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines In-Reply-To: <5.2.0.9.2.20030327134818.018759d8@shell2.webquarry.com> References: <20030327195848.GJ17384@csc> <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> <20030326235616.GE17384@csc> <4.3.2.7.2.20030326184836.00ac1890@shell2.webquarry.com> <5.2.0.9.2.20030327115030.00b42320@shell2.webquarry.com> <20030327195848.GJ17384@csc> <5.2.0.9.2.20030327134818.018759d8@shell2.webquarry.com> Message-ID: <20030327221522.GL17384@csc> *On Thu Mar 27, 2003 at 01:49:20PM -0800, Peter Scott (peter@PSDT.com) wrote: > Well this illustrates the problem in trying to do development on a > program when all you have is a fragment :-) Take my input as a > suggested approach but not necessarily something you can drop straight > in to whatever you've got. I am actually. I'm looking into it further. Reading up on how map works and so forth. I originaly thought about using formats but they don't work with variable width data (sometimes theres 2 printers, sometimes 7, etc). -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From cconstan at csc.UVic.CA Fri Mar 28 13:31:25 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines In-Reply-To: <3E8289F5@wm2.uvic.ca> References: <3E8289F5@wm2.uvic.ca> Message-ID: <20030328193125.GC20137@csc> *On Wed Mar 26, 2003 at 04:52:17PM -0800, nkuipers (nkuipers@uvic.ca) wrote: > The builtins approach would probably use formats, and/or line wrapping with > Text::Wrap. > > But you should have a look in the Text:: namespace on CPAN, as there are many > modules there that may be of service in getting the job done with clean code. > Two modules that caught my eye were > > Text::TabularDisplay > Text::FormatTable > > but there are others that look interesting. Right now I can't get to search.cpan.org. It seems to have dropped off the face of the planet at present. I can't get there from UVic or my home machine. Looking just at the module listings and the README files, I'm not sure Text::TabularDisplay will do *quite* what I want. Text::FormatTable doesn't really have any info in the README that would pull me in to use it. I'll keep looking and play with the code Peter provided as well. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From Peter at PSDT.com Fri Mar 28 14:48:58 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Printing one line over several lines In-Reply-To: <20030328193125.GC20137@csc> References: <3E8289F5@wm2.uvic.ca> <3E8289F5@wm2.uvic.ca> Message-ID: <5.2.0.9.2.20030328124637.014c63b0@shell2.webquarry.com> At 11:31 AM 3/28/2003 -0800, Carl B. Constantine wrote: >*On Wed Mar 26, 2003 at 04:52:17PM -0800, nkuipers (nkuipers@uvic.ca) wrote: > > The builtins approach would probably use formats, and/or line > wrapping with > > Text::Wrap. > > > > But you should have a look in the Text:: namespace on CPAN, as > there are many > > modules there that may be of service in getting the job done with > clean code. > > Two modules that caught my eye were > > > > Text::TabularDisplay > > Text::FormatTable > > > > but there are others that look interesting. > >Right now I can't get to search.cpan.org. It seems to have dropped off >the face of the planet at present. I can't get there from UVic or my >home machine. Same here, tried widely separated sources. This doesn't look good: 14 gbr1-p40.sl9mo.ip.att.net (12.122.11.114) 72.932 ms 70.563 ms 72.005 ms 15 gar1-p360.sl9mo.ip.att.net (12.123.24.209) 72.061 ms 75.514 ms 72.011 ms 16 12.125.75.114 (12.125.75.114) 73.098 ms !X * * 17 * 12.125.75.114 (12.125.75.114) 75.823 ms !X * 18 * * * 19 12.125.75.114 (12.125.75.114) 84.845 ms !X * * -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From cconstan at csc.UVic.CA Fri Mar 28 15:48:25 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Text::Table Message-ID: <20030328214825.GD20137@csc> Taking nathanael's suggestion to heart, I took a look at some of the Text:: modules available. Though I can't get to search.cpan.org, I was able to list some modules by name from the parent cpan.org site. In the process I found a perl module that may satisfy my needs called Text::Table. Text::Table requires Text::Align as a pre-req. Here's an example from the SYNOPSIS of what Text::Table can do: use Text::Table; my $tb = Text::Table->new( "Planet", "Radius\nkm", "Density\ng/cm^3" ); $tb->load( [ "Mercury", 2360, 3.7 ], [ "Venus", 6110, 5.1 ], [ "Earth", 6378, 5.52 ], [ "Jupiter", 71030, 1.3 ], ); print $tb; This code results in the following table: Planet Radius Density km g/cm^3 Mercury 2360 3.7 Venus 6110 5.1 Earth 6378 5.52 Jupiter 71030 1.3 the Text::Table module supports column alignment such as left, right and center, as well as num, point (decimal point alignment) and the default auto. So, I'm going to try this out and see how well it works. I'll report back to the list on my findings if anyone is interested. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From peter at PSDT.com Fri Mar 28 16:24:02 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] Text::Table In-Reply-To: <20030328214825.GD20137@csc> Message-ID: <5.2.0.9.2.20030328142332.00b45f08@shell2.webquarry.com> At 01:48 PM 3/28/2003 -0800, you wrote: >Though I can't get to search.cpan.org, I reported it to CPAN-workers and it's back now. Try again. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From darren at DarrenDuncan.net Sun Mar 30 23:06:22 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] April meeting? Message-ID: Peter Scott said: >Any takers for a topic for the April meeting? Anyone want to continue with public module hacking? T'was quite educational, I thought. I am open for any topic that people want to discuss. Public module hacking does have some interest to me, although I think we should look at different modules than last week, given that I think we went through those exhaustively. Of course, if they were changed or there are other things we should hack that we didn't before, I'm very open to whatever anyone wants to do. As for dates, I am just posting a reminder that I will be away for a week-long trip between the wednesday before and the wednesday after easter, which I think is April 16-24. Outside those dates, and any wednesday (which would be a conflict), I think that any day should work for me. Tuesdays preferable, but the previous sentences are the only firm restrictions for my schedule. For dates, I recommend either April 1-15 or 25-30; if you go between those dates then I will not be able to attend. But do what works best for the majority of people, of course, even if I have to miss it. Have a good day. -- Darren Duncan From Peter at PSDT.com Mon Mar 31 11:55:53 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] April meeting? In-Reply-To: References: <4.3.2.7.2.20030324165001.00babad0@shell2.webquarry.com> <4.3.2.7.2.20030324165001.00babad0@shell2.webquarry.com> Message-ID: <5.2.0.9.2.20030331095419.00b9d4b0@shell2.webquarry.com> At 09:05 PM 3/30/2003 -0800, Darren Duncan wrote: >Peter Scott said: > >Any takers for a topic for the April meeting? Anyone want to > continue with public module hacking? T'was quite educational, I thought. > >I am open for any topic that people want to discuss. > >Public module hacking does have some interest to me, although I think >we should look at different modules than last week, given that I think >we went through those exhaustively. Didn't look like it to me, but I'll defer to Nathanael on this. I don't have time to get anything else together myself this month. Anyone else got something else they'd like to present? >Of course, if they were changed or there are other things we should >hack that we didn't before, I'm very open to whatever anyone wants to do. > >As for dates, I am just posting a reminder that I will be away for a >week-long trip between the wednesday before and the wednesday after >easter, which I think is April 16-24. Outside those dates, and any >wednesday (which would be a conflict), I think that any day should >work for me. Tuesdays preferable, but the previous sentences are the >only firm restrictions for my schedule. > >For dates, I recommend either April 1-15 or 25-30; if you go between >those dates then I will not be able to attend. But do what works best >for the majority of people, of course, even if I have to miss it. I propose Monday, April 14. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From darren at DarrenDuncan.net Mon Mar 31 14:00:33 2003 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] April meeting? In-Reply-To: <5.2.0.9.2.20030331095419.00b9d4b0@shell2.webquarry.com> Message-ID: On Mon, 31 Mar 2003, Peter Scott wrote: > Didn't look like it to me, but I'll defer to Nathanael on this. > > I don't have time to get anything else together myself this > month. Anyone else got something else they'd like to present? We can continue to look at the Bioperl modules, although I'm not sure what else we should be going over in them. All I can suggest is some design changes, but if we did those then the modules would start to look more like my work than Nathaniels. Is that a good thing to be trying? > I propose Monday, April 14. I am amendable to this date, meaning, that should work. -- Darren Duncan From peter at PSDT.com Mon Mar 31 14:25:04 2003 From: peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] April meeting? In-Reply-To: References: <5.2.0.9.2.20030331095419.00b9d4b0@shell2.webquarry.com> Message-ID: <5.2.0.9.2.20030331122448.00b424c8@shell2.webquarry.com> At 12:00 PM 3/31/2003 -0800, Darren Duncan wrote: >On Mon, 31 Mar 2003, Peter Scott wrote: > > Didn't look like it to me, but I'll defer to Nathanael on this. > > > > I don't have time to get anything else together myself this > > month. Anyone else got something else they'd like to present? > >We can continue to look at the Bioperl modules, although I'm not sure what >else we should be going over in them. All I can suggest is some design >changes, but if we did those then the modules would start to look more >like my work than Nathaniels. Is that a good thing to be trying? It was my impression that there was a lot of code left unvisited. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From cconstan at csc.UVic.CA Mon Mar 31 16:06:53 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] always floating point? Message-ID: <20030331220653.GC21851@csc> I know that I can format a number into a floating point using standard printf statements like this: printf "\$%6.2f\n",$studTotal; However, what if I always want a number to be a floating point value regardless of the printf? For example, consider the following: my $rate = 7; # 7 cents per page printing print $rate/100; will print 0.07. But if I have: my $rate = 50; # 50 cents per page colour printer print $rate/100; will print: .5 unless I use printf's and format it: 0.50. How can I have it always to be 0.50 without using printf statements? so I want to do this: my $cents = $rate/100; my $string = "$cents per page"; print $string; would yield: 0.50 per page This is for use in the Text::Table module, so I kind of need it like this or it prints .5 instead of 0.50, 0 instead of 0.00, and 0.07 as it should. There is a reason for it which goes into more detail and I can explain it better later, I'm just curious if I can do this or not. Thanks. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From Peter at PSDT.com Mon Mar 31 16:39:25 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] always floating point? In-Reply-To: <20030331220653.GC21851@csc> Message-ID: <5.2.0.9.2.20030331143622.00b424c8@shell2.webquarry.com> At 02:06 PM 3/31/2003 -0800, Carl B. Constantine wrote: >I know that I can format a number into a floating point using standard >printf statements like this: printf "\$%6.2f\n",$studTotal; > >However, what if I always want a number to be a floating point value >regardless of the printf? For example, consider the following: > >my $rate = 7; # 7 cents per page printing > >print $rate/100; > >will print 0.07. But if I have: > >my $rate = 50; # 50 cents per page colour printer > >print $rate/100; > >will print: .5 unless I use printf's and format it: 0.50. > >How can I have it always to be 0.50 without using printf statements? You can't. That said, there's a special variable called $# that *could* do it. *DON'T USE IT.* You'll hate yourself and so will anyone who looks at your code. Besides, it's deprecated. [1] >so I want to do this: > >my $cents = $rate/100; > >my $string = "$cents per page"; > >print $string; > >would yield: 0.50 per page my $string = sprintf "%.2f per page", $rate/100; >This is for use in the Text::Table module, so I kind of need it like >this or it prints .5 instead of 0.50, 0 instead of 0.00, and 0.07 as it >should. There is a reason for it which goes into more detail and I can >explain it better later, I'm just curious if I can do this or not. printf() and sprintf() are the official answers. [1] Okay, for the smart-alecs reading, yes, you could make $rate an object and overload it's nummification op. I hope none of you were considering foisting that on poor Carl... -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From cconstan at csc.UVic.CA Mon Mar 31 16:44:25 2003 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] always floating point? In-Reply-To: <5.2.0.9.2.20030331143622.00b424c8@shell2.webquarry.com> References: <20030331220653.GC21851@csc> <5.2.0.9.2.20030331143622.00b424c8@shell2.webquarry.com> Message-ID: <20030331224425.GE21851@csc> *On Mon Mar 31, 2003 at 02:39:25PM -0800, Peter Scott (Peter@PSDT.com) wrote: > >This is for use in the Text::Table module, so I kind of need it like > >this or it prints .5 instead of 0.50, 0 instead of 0.00, and 0.07 as it > >should. There is a reason for it which goes into more detail and I can > >explain it better later, I'm just curious if I can do this or not. > > printf() and sprintf() are the official answers. > > [1] Okay, for the smart-alecs reading, yes, you could make $rate an > object and overload it's nummification op. I hope none of you were > considering foisting that on poor Carl... Actually, I don't think that would work in this case anyway. I've taken to reworking my code a bit so the values are always floating point. so instead of: my $rate = 7; I have, my $rate = 0.07; and not doing the /100 later in the report. I don't think this approach is as elegant, but I think it will work better over the long run for this particular project. I've asked the author of Text::Table for a few features that would make the module more usable for financial data and a few other scenarios as well. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW A220, 721-8753 From Peter at PSDT.com Mon Mar 31 16:58:09 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] always floating point? In-Reply-To: <20030331224425.GE21851@csc> References: <5.2.0.9.2.20030331143622.00b424c8@shell2.webquarry.com> <20030331220653.GC21851@csc> <5.2.0.9.2.20030331143622.00b424c8@shell2.webquarry.com> Message-ID: <5.2.0.9.2.20030331145552.00b424c8@shell2.webquarry.com> At 02:44 PM 3/31/2003 -0800, Carl B. Constantine wrote: >Actually, I don't think that would work in this case anyway. > >I've taken to reworking my code a bit so the values are always floating >point. so instead of: > >my $rate = 7; > >I have, > >my $rate = 0.07; > >and not doing the /100 later in the report. I don't think this approach >is as elegant, but I think it will work better over the long run for >this particular project. Bit hard to see how this could matter, but I don't know how you have to interact with this other module. But in any case, I prefer to store percentages as fractions, e.g., 0.07 instead of 7 anyway, then the arithmetic always works without having to remember to divide. I only have to remember to multiply by 100 when displaying it as a percentage, which is better. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From nkuipers at uvic.ca Mon Mar 31 19:16:58 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] April meeting Message-ID: <3E892136@wm2.uvic.ca> Woah there cowboys, the hacking was confined to my own BIO:: modules, which are an altogether different kettle of fish from BioPerl's bio:: modules. I don't think we spent much time at all on the bio:: stuff. I wouldn't mind showing the revisions to my work that came out of the last meeting, although I hardly think that this plus possibly looking at "real" bio perl code could (or should) take up a whole meeting... As for the date, the 14th is fine by me. Nathanael From Peter at PSDT.com Mon Mar 31 19:52:00 2003 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] April meeting In-Reply-To: <3E892136@wm2.uvic.ca> Message-ID: <5.2.0.9.2.20030331175117.06fd8ec0@shell2.webquarry.com> At 05:16 PM 3/31/2003 -0800, you wrote: >Woah there cowboys, the hacking was confined to my own BIO:: modules, which >are an altogether different kettle of fish from BioPerl's bio:: modules. I >don't think we spent much time at all on the bio:: stuff. I wasn't proposing going to those modules. But I thought we hadn't gotten halfway through your own modules. That not the case? >I wouldn't mind >showing the revisions to my work that came out of the last meeting, >although I >hardly think that this plus possibly looking at "real" bio perl code >could (or >should) take up a whole meeting... > >As for the date, the 14th is fine by me. > >Nathanael -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ From abez at abez.ca Mon Mar 31 19:54:19 2003 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] April meeting In-Reply-To: <5.2.0.9.2.20030331175117.06fd8ec0@shell2.webquarry.com> References: <5.2.0.9.2.20030331175117.06fd8ec0@shell2.webquarry.com> Message-ID: I'm ok with April.14th On Mon, 31 Mar 2003, Peter Scott wrote: > At 05:16 PM 3/31/2003 -0800, you wrote: > >Woah there cowboys, the hacking was confined to my own BIO:: modules, which > >are an altogether different kettle of fish from BioPerl's bio:: modules. I > >don't think we spent much time at all on the bio:: stuff. > > I wasn't proposing going to those modules. But I thought we hadn't > gotten halfway through your own modules. That not the case? > > >I wouldn't mind > >showing the revisions to my work that came out of the last meeting, > >although I > >hardly think that this plus possibly looking at "real" bio perl code > >could (or > >should) take up a whole meeting... > > > >As for the date, the 14th is fine by me. > > > >Nathanael > > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From nkuipers at uvic.ca Mon Mar 31 21:32:43 2003 From: nkuipers at uvic.ca (nkuipers) Date: Wed Aug 4 00:11:19 2004 Subject: [VPM] April meeting Message-ID: <3E892B26@wm2.uvic.ca> >I wasn't proposing going to those modules. But I thought we hadn't >gotten halfway through your own modules. That not the case? Well...there were several methods that got glossed over. In the meaintime, I've ended up putting some of Annotate.pm into Basic.pm and throwing the rest of Annotate away. So now Basic is meatier, and more efficient. We could spend some time going over it again to cover everything and check out the changes made already. Actually, I'd appreciate that. Nathanael