From rlharris at oplink.net Tue Oct 2 08:00:44 2012 From: rlharris at oplink.net (Russell L. Harris) Date: Tue, 2 Oct 2012 15:00:44 +0000 Subject: [pm-h] simple perl directory+file task Message-ID: <20121002150044.GB18883@gospelbroadcasting.org> I am looking forward to the meeting on the 11th. It is simple tasks of the following sort which I hope the presentation is going to teach me how best to approach: -------------------------- SITUATION: A directory "datafiles/" contains files named "red.doc", "green.dat", "yellow.tex", "blue.txt", etc. NEED: Open each file in the directory, and append to the end of each file the file name, so that file "red.doc" reads: red.doc file "yellow.tex" reads: yellow.tex and so forth. -------------------------- Of course, the next step is recursion into sub-directories. From my reading I think I see how to handle recursion, but obtaining the filename and stepping through a directory is the immediate hurdle. It seems to me that the books and tutorials typically do not spend enough time explaining the fundamental concepts. RLH From lanny.ripple at gmail.com Tue Oct 2 08:36:01 2012 From: lanny.ripple at gmail.com (Lanny Ripple) Date: Tue, 2 Oct 2012 10:36:01 -0500 Subject: [pm-h] simple perl directory+file task In-Reply-To: <20121002150044.GB18883@gospelbroadcasting.org> References: <20121002150044.GB18883@gospelbroadcasting.org> Message-ID: <1C35A362-8E20-49AA-969C-C9038DD57B71@gmail.com> Hi Russell, You might review the docs for find2perl[1] and also examining the output of find2perl . -type f -print Building your project in perl will give you a lot of added flexibility but just because you have a swiss army chainsaw doesn't mean every problem is a... thing you would drive into a piece of wood with a chainsaw. (Doesn't just trip off the tongue does it?) Consider $ cat > /tmp/name_me <<'END' #!/bin/bash echo $(basename $1) >> $1 END $ chmod 755 /tmp/name_me $ cd datafiles $ find . -type f -print | xargs -n 1 /tmp/name_me and your task is also accomplished. Perl can do everything bash and sed can (and awk too but use perl instead) but sometimes you don't need perl when simpler tools will do. Enjoy, -ljr [1] http://perldoc.perl.org/find2perl.html On Oct 2, 2012, at 10:00 AM, "Russell L. Harris" wrote: > I am looking forward to the meeting on the 11th. It is simple tasks > of the following sort which I hope the presentation is going to teach > me how best to approach: > > -------------------------- > SITUATION: A directory "datafiles/" contains files named "red.doc", > "green.dat", "yellow.tex", "blue.txt", etc. > > NEED: Open each file in the directory, and append to the end of each > file the file name, so that file "red.doc" reads: > > > red.doc > > file "yellow.tex" reads: > > > yellow.tex > > and so forth. > -------------------------- > > Of course, the next step is recursion into sub-directories. From my > reading I think I see how to handle recursion, but obtaining the > filename and stepping through a directory is the immediate hurdle. > > It seems to me that the books and tutorials typically do not spend > enough time explaining the fundamental concepts. > > RLH > _______________________________________________ > Houston mailing list > Houston at pm.org > http://mail.pm.org/mailman/listinfo/houston > Website: http://houston.pm.org/ From rlharris at oplink.net Tue Oct 2 18:17:46 2012 From: rlharris at oplink.net (Russell L. Harris) Date: Wed, 3 Oct 2012 01:17:46 +0000 Subject: [pm-h] simple perl directory+file task In-Reply-To: <1C35A362-8E20-49AA-969C-C9038DD57B71@gmail.com> References: <20121002150044.GB18883@gospelbroadcasting.org> <1C35A362-8E20-49AA-969C-C9038DD57B71@gmail.com> Message-ID: <20121003011746.GA31944@gospelbroadcasting.org> * Lanny Ripple [121002 15:39]: > Building your project in perl will give you a lot of added > flexibility but just because you have a swiss army chainsaw doesn't > mean every problem is a... thing you would drive into a piece of > wood with a chainsaw. (Doesn't just trip off the tongue does it?) > Consider > > $ cat > /tmp/name_me <<'END' > #!/bin/bash > echo $(basename $1) >> $1 > END > $ chmod 755 /tmp/name_me > $ cd datafiles > $ find . -type f -print | xargs -n 1 /tmp/name_me > and your task is also accomplished. > Perl can do everything bash and sed can ... > but sometimes you don't need perl when simpler tools will do. Agreed. My tool of preference is Emacs. Gratitude and thanks, Lanny. Your solution saved the day, getting me past the immediate impasse. Chainsaw, hand saw, or axe -- in the end, all that matters is that the tree is felled. But this was but one of many trees which I must fell, so other impasses are likely. I am attempting to resurrect a project which I was forced to set aside in mid-stream several years ago. That project necessitates recursion to perform a series of simple, identical operations on several sets of data, each of which involves a search-and-replace operation on literally hundreds of files. Because of the repetition, my approach back then was to create a set of Perl scripts; I found it easier to utilize a sequence of about a dozen simple scripts, rather than try to do everything in one or two complex scripts. And the script-writing and processing was going well, until I was forced to set aside the project. So, I am reading the latest edition of "Learning Perl" (a few years ago, I read two of the earlier editions, plus portions of the other O'Reilly Perl books), trying this time to get a better grasp of the fundamentals. RLH From rlharris at oplink.net Wed Oct 10 09:25:48 2012 From: rlharris at oplink.net (Russell L. Harris) Date: Wed, 10 Oct 2012 16:25:48 +0000 Subject: [pm-h] ode blogging (perl script) Message-ID: <20121010162548.GA3881@gospelbroadcasting.org> I am considering installing and learning to use the Perl blogging engine script "ode", first in the LAN and later, on a remote host for public access. My last blogging experience was with WordPress. I started with the first release, but as releases of updated versions and patches became more frequent, WordPress quickly became a very demanding "religion". In particular, I could not tolerate the inability of WordPress to automatically transfer customizations and configuration settings from one release to the next. Ode assumes that the blogger is going to use his normal text editor to produce plain text, then allow ode to utilize "markdown" to convert plain-text to HTML. However, ode allows the direct import of HTML. My intention is to write posts in LaTeX markup (which is how I write everything nowadays) and convert from LaTeX to HTML for the blog. Several years ago, I was using HeVeA to convert LaTeX to HTML, but with the advent of HTML5 and CSS, that may not be practical today. Recommendations? Warnings? RLH From mrallen1 at yahoo.com Wed Oct 10 09:39:04 2012 From: mrallen1 at yahoo.com (Mark Allen) Date: Wed, 10 Oct 2012 09:39:04 -0700 (PDT) Subject: [pm-h] ode blogging (perl script) In-Reply-To: <20121010162548.GA3881@gospelbroadcasting.org> References: <20121010162548.GA3881@gospelbroadcasting.org> Message-ID: <1349887144.97411.YahooMailNeo@web164003.mail.gq1.yahoo.com> These days WordPress is pretty good about keeping your customizations and stuff? consistent across upgrades. ?And there's always wordpress.com if you don't want to? self host. ?Wordpress.com even supports LaTeX? http://en.support.wordpress.com/latex/ I personally write most of blog posts in Markdown, save them to github and? use a tiny little?perl script to turn them into HTML for posting on my original blog. You can check out my repository for this work here: https://github.com/mrallen1/P5P-Weekly This works pretty nicely - then I have a form that looks reasonably nice as plain? text and as HTML without doing any extra work. ?One thing that's nice about? Markdown is that even if it isn't rendered it's a pretty clean reading experience. Mark ________________________________ From: Russell L. Harris To: houston at pm.org Sent: Wednesday, October 10, 2012 11:25 AM Subject: [pm-h] ode blogging (perl script) I am considering installing and learning to use the Perl blogging engine script "ode", first in the LAN and later, on a remote host for public access. My last blogging experience was with WordPress.? I started with the first release, but as releases of updated versions and patches became more frequent, WordPress quickly became a very demanding "religion". In particular, I could not tolerate the inability of WordPress to automatically transfer customizations and configuration settings from one release to the next. Ode assumes that the blogger is going to use his normal text editor to produce plain text, then allow ode to utilize "markdown" to convert plain-text to HTML.? However, ode allows the direct import of HTML. My intention is to write posts in LaTeX markup (which is how I write everything nowadays) and convert from LaTeX to HTML for the blog. Several years ago, I was using HeVeA to convert LaTeX to HTML, but with the advent of HTML5 and CSS, that may not be practical today. Recommendations?? Warnings? RLH _______________________________________________ Houston mailing list Houston at pm.org http://mail.pm.org/mailman/listinfo/houston Website: http://houston.pm.org/ From zaki.mughal at gmail.com Wed Oct 10 13:41:05 2012 From: zaki.mughal at gmail.com (Zakariyya Mughal) Date: Wed, 10 Oct 2012 15:41:05 -0500 Subject: [pm-h] ode blogging (perl script) In-Reply-To: <20121010162548.GA3881@gospelbroadcasting.org> References: <20121010162548.GA3881@gospelbroadcasting.org> Message-ID: <20121010204104.GA8350@simulo> On 2012-10-10 at 16:25:48 +0000, Russell L. Harris wrote: > Ode assumes that the blogger is going to use his normal text editor to > produce plain text, then allow ode to utilize "markdown" to convert > plain-text to HTML. However, ode allows the direct import of HTML. I use ikiwiki on my site with markdown which updates the HTML output using a repository hook whenever I push to the repository. > My intention is to write posts in LaTeX markup (which is how I write > everything nowadays) and convert from LaTeX to HTML for the blog. > Several years ago, I was using HeVeA to convert LaTeX to HTML, but > with the advent of HTML5 and CSS, that may not be practical today. I was able to use ikiwiki with a plugin for LaTeX that generates HTML using TeX4ht which worked pretty well for uploading notes with many equations . TeX4ht's output can be configured, but I haven't had any reason to do so yet. > Recommendations? Warnings? > > RLH From rlharris at oplink.net Thu Oct 11 01:37:09 2012 From: rlharris at oplink.net (Russell L. Harris) Date: Thu, 11 Oct 2012 08:37:09 +0000 Subject: [pm-h] october meeting time and location - solved In-Reply-To: <20121011035041.GA2334@gospelbroadcasting.org> References: <20121011035041.GA2334@gospelbroadcasting.org> Message-ID: <20121011083709.GB2334@gospelbroadcasting.org> * Russell L. Harris [121011 03:51]: > What is the time and location of the October meeting? Found it in a message posted 29 September: "As usual, we will meet at 3131 W. Alabama St. The presentation starts at 7pm. We'll gather in the lobby on top of the parking garage between 6:40pm and 7pm, and go to the meeting from there." From gwadej at anomaly.org Sun Oct 14 15:24:55 2012 From: gwadej at anomaly.org (G. Wade Johnson) Date: Sun, 14 Oct 2012 17:24:55 -0500 Subject: [pm-h] Sept and Oct meeting notes are on-line Message-ID: <20121014172455.2b38b183@cygnus> I just published my notes and the slides for both of the most recent meetings at http://houston.pm.org/talks/index.html G. Wade -- It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong. -- Richard Feynman From gwadej at anomaly.org Mon Oct 22 15:57:13 2012 From: gwadej at anomaly.org (G. Wade Johnson) Date: Mon, 22 Oct 2012 17:57:13 -0500 Subject: [pm-h] November Houston.pm call for presentation Message-ID: <20121022175713.7fad16b0@cygnus> We've got a couple of weeks until the next Houston.pm meeting. Does anyone have suggestions for a topic? Either that you would like to present or that you would like to see presented? G. Wade -- If there's no solution, there's no problem. -- Rick Hoselton From gwadej at anomaly.org Wed Oct 24 19:01:49 2012 From: gwadej at anomaly.org (G. Wade Johnson) Date: Wed, 24 Oct 2012 21:01:49 -0500 Subject: [pm-h] November Houston.pm call for presentation In-Reply-To: <20121022175713.7fad16b0@cygnus> References: <20121022175713.7fad16b0@cygnus> Message-ID: <20121024210149.16565241@cygnus> On Mon, 22 Oct 2012 17:57:13 -0500 "G. Wade Johnson" wrote: > We've got a couple of weeks until the next Houston.pm meeting. > > Does anyone have suggestions for a topic? > > Either that you would like to present or that you would like to see > presented? I've gotten a suggestion for a topic off-list. Would anyone be interested in a group discussion of favorite tools or tricks for automating daily tasks? The idea is that several of us would show our favorites and we would discuss them as a group. Opinions? Other ideas? G. Wade -- You should never hand someone a gun unless you're sure where they'll point it. -- Jeffrey Sinclair in "By Any Means Necessary" From chiragsabunani at gmail.com Wed Oct 24 19:56:48 2012 From: chiragsabunani at gmail.com (Chirag Sabunani) Date: Wed, 24 Oct 2012 21:56:48 -0500 Subject: [pm-h] November Houston.pm call for presentation In-Reply-To: <20121024210149.16565241@cygnus> References: <20121022175713.7fad16b0@cygnus> <20121024210149.16565241@cygnus> Message-ID: <-8442233893340258545@unknownmsgid> Thanks G. Wade!!! Will do as you say! Sent from my iPhone On Oct 24, 2012, at 9:02 PM, "G. Wade Johnson" wrote: > On Mon, 22 Oct 2012 17:57:13 -0500 > "G. Wade Johnson" wrote: > >> We've got a couple of weeks until the next Houston.pm meeting. >> >> Does anyone have suggestions for a topic? >> >> Either that you would like to present or that you would like to see >> presented? > > I've gotten a suggestion for a topic off-list. > > Would anyone be interested in a group discussion of favorite tools or > tricks for automating daily tasks? > > The idea is that several of us would show our favorites and we would > discuss them as a group. > > Opinions? Other ideas? > > G. Wade > -- > You should never hand someone a gun unless you're sure where they'll > point it. -- Jeffrey Sinclair in "By Any Means Necessary" > _______________________________________________ > Houston mailing list > Houston at pm.org > http://mail.pm.org/mailman/listinfo/houston > Website: http://houston.pm.org/ From todd at rinaldo.us Wed Oct 24 20:39:18 2012 From: todd at rinaldo.us (Todd Rinaldo) Date: Wed, 24 Oct 2012 22:39:18 -0500 Subject: [pm-h] November Houston.pm call for presentation In-Reply-To: <20121024210149.16565241@cygnus> References: <20121022175713.7fad16b0@cygnus> <20121024210149.16565241@cygnus> Message-ID: On Wed, Oct 24, 2012 at 9:01 PM, G. Wade Johnson wrote: > > I've gotten a suggestion for a topic off-list. > > Would anyone be interested in a group discussion of favorite tools or > tricks for automating daily tasks? > > The idea is that several of us would show our favorites and we would > discuss them as a group. > I can donate a few one liners I use for quick and dirty tricks these days. From will.willis at gmail.com Wed Oct 24 21:09:47 2012 From: will.willis at gmail.com (Will Willis) Date: Wed, 24 Oct 2012 23:09:47 -0500 Subject: [pm-h] November Houston.pm call for presentation In-Reply-To: References: <20121022175713.7fad16b0@cygnus> <20121024210149.16565241@cygnus> Message-ID: great topic! put me down for 10-15 minutes worth of material. On Wed, Oct 24, 2012 at 10:39 PM, Todd Rinaldo wrote: > On Wed, Oct 24, 2012 at 9:01 PM, G. Wade Johnson > wrote: > > > > I've gotten a suggestion for a topic off-list. > > > > Would anyone be interested in a group discussion of favorite tools or > > tricks for automating daily tasks? > > > > The idea is that several of us would show our favorites and we would > > discuss them as a group. > > > > I can donate a few one liners I use for quick and dirty tricks these days. > _______________________________________________ > Houston mailing list > Houston at pm.org > http://mail.pm.org/mailman/listinfo/houston > Website: http://houston.pm.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rlharris at oplink.net Tue Oct 30 01:29:00 2012 From: rlharris at oplink.net (Russell L. Harris) Date: Tue, 30 Oct 2012 08:29:00 +0000 Subject: [pm-h] codeweavers 24-hour Halloween CrossOver giveaway Message-ID: <20121030082900.GA2978@gospelbroadcasting.org> According to the press release: http://www.codeweavers.com/flockthevoteqa/ Codeweavers, the author of CrossOver, has a 24-hour Halloween giveaway. According to the release, it appears that anyone who wishes may obtain a full-privilege copy of CrossOver (choose either Mac or Linux) with 12-month support entitlement. RLH From gwadej at anomaly.org Tue Oct 30 05:38:10 2012 From: gwadej at anomaly.org (G. Wade Johnson) Date: Tue, 30 Oct 2012 07:38:10 -0500 Subject: [pm-h] November Houston.pm Technical Meeting Message-ID: <20121030073810.01f28b99@cygnus> The next Houston.pm meeting is on November 8, a week from this Thursday. This month's meeting will be a little different. I will be leading a discussion of tools and tricks for automating daily tasks. The quality of the meeting will depend on you. Everyone should bring their favorite Perl snippets, quick scripts, and one-liners. The only theme is "Getting Things Done". If the code solves a problem for you, it is a subject for the meeting. As usual, we will meet at 3131 W. Alabama St. in the lobby area between 6:40pm and 7pm on Thursday night. We'll go up to the conference room at 7pm. Parking on top of the parking garage is free. I look forward to seeing you there. G. Wade -- No, no, you're not thinking, you're just being logical. -- Neils Bohr