From EmailLists at SimonDorfman.com Wed Jun 8 00:56:22 2005 From: EmailLists at SimonDorfman.com (Simon Dorfman) Date: Wed, 08 Jun 2005 02:56:22 -0500 Subject: [Neworleans-pm] Meeting Friday Message-ID: I had an idea for the meeting. I'd like to publicly ask Dave Cash (oh, the pressure of asking in public ;-) if he'd be willing to share the perl script he uses to keep track of his hours for billing clients. If yes, maybe I'll start using it for keeping track of my hours. My current system is to manually enter start and stop times in excel. Ugh. Help is needed and maybe I'd learn a thing or two along the way. Would anyone else be interested in learning this? Whad'ya'say Dave? Wanna package up your script, put it online and give a little demo on how you use it? Another thing we might work on is trying to come up with or find and configure an existing web-based calendar system for FairGrinds Coffeehouse. I was just looking at their calendar: http://www.fairgrinds.com/fgnews.html ...and it looks like they may have forgotten us. We're supposed to be meeting Friday, June 10th at 5:30pm - 8pm I don't see us on there and I even see two other things scheduled at times that conflict with ours. If I remember, I'll call tomorrow when they're open (948-3222) and ask them to make sure we're on the schedule. G'night, Simon From dave at gnofn.org Wed Jun 8 07:52:37 2005 From: dave at gnofn.org (Dave Cash) Date: Wed, 8 Jun 2005 09:52:37 -0500 (CDT) Subject: [Neworleans-pm] Meeting Friday In-Reply-To: References: Message-ID: <20050608094433.T25945@sparkie.gnofn.org> On Wed, 8 Jun 2005, Simon Dorfman wrote: > I had an idea for the meeting. I'd like to publicly ask Dave Cash > (oh, the pressure of asking in public ;-) if he'd be willing to > share the perl script he uses to keep track of his hours for > billing clients. If yes, maybe I'll start using it for keeping > track of my hours. My current system is to manually enter start > and stop times in excel. Ugh. Help is needed and maybe I'd learn > a thing or two along the way. Would anyone else be interested in > learning this? Whad'ya'say Dave? Wanna package up your script, > put it online and give a little demo on how you use it? Simon, I'm happy to share my little script. And I'll be happy to explain how it works. It's not too fancy, but I have been making little modifications over the years and it does have a few nice features. And some strange uses of Perl, especially in the way I implemented (mostly for fun) format and write stuff. Code is below. I apologize for the lack of docs and comments, but I never imagined I'd publish it. > Another thing we might work on is trying to come up with or find > and configure an existing web-based calendar system for FairGrinds > Coffeehouse. I was just looking at their calendar: > http://www.fairgrinds.com/fgnews.html Good idea, though I'm guessing the bests-of-show will be PHP apps. > ...and it looks like they may have forgotten us. We're supposed > to be meeting Friday, June 10th at 5:30pm - 8pm I don't see us on > there and I even see two other things scheduled at times that > conflict with ours. > > If I remember, I'll call tomorrow when they're open (948-3222) and > ask them to make sure we're on the schedule. Zoinks! Not again! I'll call them if you don't want to. Or I can even drop by if necessary. Let me know how attempts at contact go. Thanks! Dave /L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\ Dave Cash Power to the People! Frolicking in Fields of Garlic Right On-Line! dave at gnofn.org Dig it all. timeclock.pl: #!/usr/bin/perl use strict; use warnings; use POSIX qw(strftime); use Time::ParseDate; my $file_base = $ENV{ HOME } . '/.timeclock'; mkdir $file_base unless -e $file_base; die "$file_base is not a directory$/" unless -d $file_base; my ( $opt, $client ) = @ARGV; if ( $opt !~ /^-/ ) { $client = $opt; $opt = ''; } elsif ( $opt !~ /^-(calc|status|edit)$/ ) { die "unknown option: $opt"; } die "usage: clock.pl [-calc | -status | -edit] client\n" if ! $client; my ( $client_name ) = $client =~ m#([^.]+)\.[^.]+$#; $client_name ||= $client; $client =~ s/\.clk$//; my $client_file = $client =~ m#/# ? "$client.clk" : "$file_base/$client.clk"; my %codes; if ( -f "$file_base/$client_name.codes" ) { open CODES, "< $file_base/$client_name.codes"; while ( ) { chomp; my ( $code, $description ) = m/^(\S+)\s+(.*)$/; $codes{ $code } = $description; } close CODES; } if ( $opt eq '-calc' ) { print calc( $client_file ), $/; } elsif ( $opt eq '-status' ) { print get_status( $client_file ), ".$/"; } elsif ( $opt eq '-edit' ) { edit( $client_file ); print calc( $client_file ), $/; } else { my $status = get_status( $client_file ); open (LOG, ">> $client_file") || die "$client_file: $!"; if ( $status eq 'stopped' ) { print "starting work.\n"; print LOG 'start: ' . POSIX::strftime('%A %d %B %Y %H:%M:%S', localtime(time)) . $/; close LOG; } else { print "stopping work.\n"; print LOG 'stop: ' . POSIX::strftime('%A %d %B %Y %H:%M:%S', localtime(time)) . $/; if ( %codes ) { my $code = get_code( %codes ) if %codes; print LOG 'code: ', $code, $/; } close LOG; print 'Add a comment? [Y/n] '; my $answer = ; chomp $answer; edit( $client_file ) if (! $answer) || $answer =~ /^y/i; print calc( $client_file ), $/; } } sub calc { my ( $client_file ) = @_; $client_file =~ s/\.clk$// unless -e $client_file; open ( CLIENT, "< $client_file" ) || die "$client_file: $!"; my $total_seconds = 0; my %subtotals; my $hold; my $span; while ( ) { chomp; next unless /^(start|stop|code):\s/; if ( $1 eq 'code' ) { my ( $coding ) = m/^code:\s+(.*)$/; $subtotals{ $coding } += $span; } else { my ( $time ) = m/[tp]:\s+(.*)$/; $time =~ s/^(...)\S+\s+(\d+)\s+(...)\S*\s+(\d+)\s+([0-9:]+)/$1 $3 $2 $5 $4/; my $seconds = parsedate($time, NO_RELATIVE => 1); if ( /^start:/ ) { $hold = $seconds; } elsif ( /^stop:/ ) { $span = $seconds - $hold; $total_seconds += $span; $hold = undef; } } } close CLIENT; my $report; my $bas_fmt = '@>>>>>>>>>>>> ^<<<<<<<<<<<<<<<<<<<<<<<< @>>>>>>> @>>>>>>>>> @>>>>' . $/; my $tab_fmt = ' -------- ----------' . $/; my $ext_fmt = '~ ^<<<<<<<<<<<<<<<<<<<<<<<<' . $/; $report .= scalar keys %subtotals ? "Coded Subtotals for $client_name ($client_file):$/" : "Total for $client_name ($client_file):$/"; foreach my $code ( sort keys %subtotals ) { my $hours = int( $subtotals{ $code } / 3600 ); my $minutes = sprintf '%02d', int( ( $subtotals{ $code } % 3600 ) / 60 ); my $seconds = sprintf '%02d', $subtotals{ $code } % 60; my $percentage = int( ( ( $subtotals{ $code } / $total_seconds ) * 100 ) + 0.5 ); my $dollars = sprintf( '%0.02f', int( ( $subtotals{ $code } / 3600 ) * 4 + 0.5 ) / .04 ); 1 while $dollars =~ s/^(-?\d+)(\d{3})/$1,$2/; my $time = "$hours:$minutes:$seconds"; formline $bas_fmt, $code, $codes{ $code }, $time, '$' . $dollars, $percentage . '%'; formline $ext_fmt, $codes{ $code } while $codes{ $code }; } my $hours = int( $total_seconds / 3600 ); my $minutes = sprintf '%02d', int( ( $total_seconds % 3600 ) / 60 ); my $seconds = sprintf '%02d', $total_seconds % 60; my $dollars = int( ( $total_seconds / 3600 ) * 4 + 0.5 ) / .04; my $total_time = "$hours:$minutes:$seconds"; my $total_dollars = sprintf( '%0.02f', int( ( $total_seconds / 3600 ) * 4 + 0.5 ) / .04 ); 1 while $total_dollars =~ s/^(-?\d+)(\d{3})/$1,$2/; formline $tab_fmt if $^A; my $nothing = ''; formline $bas_fmt, $nothing, $nothing, $total_time, '$' . $total_dollars, $nothing; $report .= $^A; chomp $report; return $report; } sub edit { my ( $client_file ) = @_; die "$client_file: $!" unless stat $client_file; my $lines = int( `wc $client_file` ) - 3; my $command_args = $lines ? "+$lines $client_file" : $client_file; system "vi $command_args"; } sub get_code { my ( %codes ) = @_; my $choice = 97; my %choice_map; foreach my $code ( sort keys %codes ) { printf "%s. %s (%s)$/", chr( $choice ), $code, $codes{ $code }; $choice_map{ chr( $choice ) } = $code; $choice ++; } print "Choose a code: "; my $chosen_code = ; $chosen_code = lc( substr $chosen_code, 0, 1 ); print "CHOSEN CODE: '$chosen_code'", $/; return exists $choice_map{ $chosen_code } ? $choice_map{ $chosen_code } : get_code( %codes ); } sub get_status { my ( $client_file ) = @_; system "touch $client_file" if ! -e $client_file; open ( CLIENT, qq!cat $client_file | grep "^st[ao][rp]" | tail -1 |! ) || die "$client_file: $!"; my $last_line = || ''; close CLIENT; return $last_line =~ /^stop:/ || ! $last_line ? 'stopped' : 'started'; } From dave at gnofn.org Fri Jun 10 13:06:53 2005 From: dave at gnofn.org (Dave Cash) Date: Fri, 10 Jun 2005 15:06:53 -0500 (CDT) Subject: [Neworleans-pm] Meeting Tonight Message-ID: <20050610144911.S25945@sparkie.gnofn.org> Hope to see you all at the Perl Mongers meeting tonight. As usual, we're meeting at Fair Grinds Coffeehouse (3133 Ponce de Leon in New Orleans). The meeting is upstairs from 5:30 to 8:00 (I confirmed this with Robert, the owner of Fair Grinds, yesterday). We certainly can talk about my timeclock.pl script if folks want to do that. But it won't take us all of the time. I had an idea for another thing we could do. Fran has been wanting to start learning Perl, and she's come up with a small project to help her do this. I've talked to her and she says it's okay for us to use it for a meeting topic if we'd like. It goes like this: Fran wants an RSS feed aggregator that will show new entries from all feeds together in one view, sorted by date. This is different from how many RSS readers work, in that many of them just allow grouping by feed. (There may well be something out there that does what she wants, but it will still be a good exercise.) So my proposal for tonight's meeting is to write this script (probably I'll be doing the typing). I imagine we'll go through steps like this: 1. Spec out the project 2. Decide implementation specifics and features 3. Search CPAN for relevant modules to use 4. Write, test and debug the script Sorry for the lateness of this post, but I just thought of this as a possible topic. If we decide to do this and it works out, we might be able to do things like this in the future. Take care, Dave /L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\ Dave Cash Power to the People! Frolicking in Fields of Garlic Right On-Line! dave at gnofn.org Dig it all. From EmailLists at SimonDorfman.com Mon Jun 13 02:27:00 2005 From: EmailLists at SimonDorfman.com (Simon Dorfman) Date: Mon, 13 Jun 2005 04:27:00 -0500 Subject: [Neworleans-pm] Meeting summary Message-ID: I wrote up a little summary of the last meeting on the wiki. Please feel free to fill it in or add comments. http://neworleans.pm.org/ http://neworleans.pm.org/index.cgi?Meeting-June-10-2005 Simon From jkeen at verizon.net Mon Jun 13 14:32:13 2005 From: jkeen at verizon.net (James Keenan) Date: Mon, 13 Jun 2005 17:32:13 -0400 Subject: [Neworleans-pm] YAPC Anyone? Message-ID: <69b8a172670278ff7dd9f0612e7c12b5@verizon.net> Will anyone (besides me) be coming to YAPC in Toronto in two weeks? jimk From joey at joeykelly.net Mon Jun 13 15:34:12 2005 From: joey at joeykelly.net (Joey Kelly) Date: Mon, 13 Jun 2005 17:34:12 -0500 Subject: [Neworleans-pm] YAPC Anyone? In-Reply-To: <69b8a172670278ff7dd9f0612e7c12b5@verizon.net> References: <69b8a172670278ff7dd9f0612e7c12b5@verizon.net> Message-ID: <200506131734.23033.joey@joeykelly.net> On Monday June 13 2005 16:32, James Keenan spake: > Will anyone (besides me) be coming to YAPC in Toronto in two weeks? > > jimk I asked about YAPC at the meeting Friday, and not no hits. Sorry. I really wanted to go, too... -- Joey Kelly < Minister of the Gospel | Linux Consultant > http://joeykelly.net "I may have invented it, but Bill made it famous." --- David Bradley, the IBM employee that invented CTRL-ALT-DEL -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.pm.org/pipermail/neworleans-pm/attachments/20050613/d549f8a9/attachment.bin From dave at gnofn.org Thu Jun 16 09:30:13 2005 From: dave at gnofn.org (Dave Cash) Date: Thu, 16 Jun 2005 11:30:13 -0500 (CDT) Subject: [Neworleans-pm] Revised timeclock.pl Message-ID: <20050616112608.R29790@sparkie.gnofn.org> Hello, all. I've spent some time this week doing some work on timeclock.pl. I've reworked a lot of it to make it more configurable and to address some of the requests that came up in the meeting. I've also added full documentation, using POD. So to see the docs, just type perldoc timeclock.pl (assuming it's either in the same directory or in your $PATH) and you should see some pretty docs. Please let me know if any of the docs are incomplete, incorrect or just downright confusing. I did some commenting in broad strokes, but I know I need to add more fine detail. I'll try to do that soon. For now, here's the revised script: http://neworleans.pm.org/code/timeclock-pl.txt Enjoy! Dave /L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\ Dave Cash Power to the People! Frolicking in Fields of Garlic Right On-Line! dave at gnofn.org Dig it all. From EmailLists at SimonDorfman.com Thu Jun 16 14:57:35 2005 From: EmailLists at SimonDorfman.com (Simon Dorfman) Date: Thu, 16 Jun 2005 16:57:35 -0500 Subject: [Neworleans-pm] Revised timeclock.pl In-Reply-To: <20050616112608.R29790@sparkie.gnofn.org> Message-ID: First of all, nice work Dave! Danke Sch?n! I see you hardcoded /home/dave/.timeclock on line 13. I simply changed that to /Users/simon/.timeclock but I thought I'd point it out because I'm pretty sure the old version of the script just detected the home directory and didn't require hard coding of it's path. Before changing that this was the result: $ ./timeclock.pl clientname /home/dave/.timeclock is not a directory I have two feature ideas: 1. I'd like to be able to charge a different rate for different clients. Maybe a client config file similar to the client code file you're currently using would be a good way to implement it. 2. I'd like to enter a comment when starting the clock. This way, in case I forget to stop the clock, I can see a comment like "troubleshoot xyz" and remember what I had started the clock for. Maybe I'll try to figure out the second one on my own since it should be pretty easy. And maybe the first one could be something we try at the next meeting? Simon On 6/16/05 11:30 AM, "Dave Cash" wrote: > Hello, all. > > I've spent some time this week doing some work on timeclock.pl. > I've reworked a lot of it to make it more configurable and to > address some of the requests that came up in the meeting. I've also > added full documentation, using POD. So to see the docs, just type > > perldoc timeclock.pl > > (assuming it's either in the same directory or in your $PATH) and > you should see some pretty docs. Please let me know if any of the > docs are incomplete, incorrect or just downright confusing. > > I did some commenting in broad strokes, but I know I need to add > more fine detail. I'll try to do that soon. For now, here's the > revised script: > > http://neworleans.pm.org/code/timeclock-pl.txt > > Enjoy! > > Dave > > /L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\ > Dave Cash Power to the People! > Frolicking in Fields of Garlic Right On-Line! > dave at gnofn.org Dig it all. > _______________________________________________ > NewOrleans-pm mailing list > NewOrleans-pm at pm.org > http://mail.pm.org/mailman/listinfo/neworleans-pm > > From glim at mycybernet.net Thu Jun 16 21:49:00 2005 From: glim at mycybernet.net (Gerard Lim) Date: Fri, 17 Jun 2005 00:49 -0400 Subject: [Neworleans-pm] Last-minute reminder -- YAPC::NA 2005 Message-ID: Here's a last reminder about Yet Another Perl Conference, North America (YAPC::NA 2005) http://yapc.org/America In case anyone out there has been sitting on the fence or has been meaning to register but has put it on the backburner until now, here is a final information package. Dates: Mon - Wed June 27 - 29, 2005 (11 days from now!) Location: 89 Chestnut Street, University of Toronto, Toronto, Ontario, Canada Accommodations ============== Due to recent renegotiations with the conference facility and hotel, 89 Chestnut, there are still a few rooms left. For details on accommodations go to: http://www.yapc.org/America/accommodations-2005.shtml For quick and easy booking: 89 Chestnut Phone: +1-416-977-0707 Conference booking code: perl0626 The base rate is approx. CAD$80/night, which is *great* for downtown Toronto. Add in taxes and in-room high speed internet and it's up to about CAD$95/night. Book yourself to check-in on Sunday the 26th and check-out on the morning of Wednesday the 29th. Conference Registration ======================= Registration is easy and cheap - only USD$85 - see http://yapc.org/America/register-2005.shtml for details or register directly online at http://donate.perlfoundation.org/index.pl?node=registrant%20info&conference_id=423 The schedule is awesome - http://yapc.org/America/schedule-2005/day1.html >From here, click on the "Day 2" and "Day 3" spots near the top to go from page to page. Click on a talk name to get details regarding the talk. Speakers include Larry Wall, Allison Randal, Autrijus Tang, Brian Ingerson, Andy Lester, chromatic, brian d foy, Chip Salzenberg & Dan Sugalski... and many more! [ This message was sent by Gerard Lim on behalf of the YAPC::NA 2005 Conference organizing committee of the Toronto Perl Mongers. Thanks for your patience and support. ] From dave at gnofn.org Fri Jun 17 02:15:46 2005 From: dave at gnofn.org (Dave Cash) Date: Fri, 17 Jun 2005 04:15:46 -0500 (CDT) Subject: [Neworleans-pm] Revised timeclock.pl In-Reply-To: References: Message-ID: <20050617041021.X29790@sparkie.gnofn.org> On Thu, 16 Jun 2005, Simon Dorfman wrote: > First of all, nice work Dave! Danke Sch?n! Thanks! > I see you hardcoded /home/dave/.timeclock on line 13. Oops! That was meant to be temporary. It's gone now. > I simply changed that to /Users/simon/.timeclock but I thought I'd > point it out because I'm pretty sure the old version of the script > just detected the home directory and didn't require hard coding of > it's path. > > Before changing that this was the result: > $ ./timeclock.pl clientname > /home/dave/.timeclock is not a directory Actually, you should just remove that line altogether (the copy on the neworleans.pm.org site is now right, if you want to grab it. > I have two feature ideas: > 1. I'd like to be able to charge a different rate for different > clients. Maybe a client config file similar to the client code > file you're currently using would be a good way to implement it. This feature already exists. And it's documented! See both the CONFIGURATION and FILES sections. > 2. I'd like to enter a comment when starting the clock. This way, > in case I forget to stop the clock, I can see a comment like > "troubleshoot xyz" and remember what I had started the clock for. This wouldn't be too hard of a thing to add or even to make configurable. Take a crack at it and let me know if you have questions. Dave /L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\ Dave Cash Power to the People! Frolicking in Fields of Garlic Right On-Line! dave at gnofn.org Dig it all.