Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

n1vux (1492)

n1vux
  (email not shown publicly)
http://boston.pm ... x.cgi?BillRicker
AOL IM: n1vux (Add Buddy, Send Message)
Yahoo! ID: n1vux (Add User, Send Message)

Only started with Perl4 and Perl5 in 1995. I was doing AWK etc for 12 years before that, and resisted switching. I've been doing OO since before C++ hit bigtime, with Objective-C and SmallTalk, so I really like the (no longer new) Perl5 OO style; and the Lispish Map style is also an old friend. What do I hack with Perl? All data that passes my way; systems monitoring scripts at $DayJob, weather data at night, and I cheat on NPR word puzzles. Member: Boston.pm.org [pm.org] BLU.org [blu.org] /. LinkedIn [linkedin.com]

N1VUX is my FCC-issued ham radio callsign.

+ -

  Journal: dumping environment etc from batch perl script on 2010.02.24 0:37

Journal by n1vux on 2010.02.24 0:37
User Journal

use Data::Dumper;
print Dumper([       # like ...
       {  X=>$^X},   # which perl
                     # but not fooled by #!
       {V0 =>  "$]", # perl -v , ditto
         V => $^V lt v5.9.0
            ? q(v).(join(q(.),
 

Read More 0 comments

+ -

  Comment: tough(book) love (Score 1) on 2009.11.30 13:43

by n1vux on 2009.11.30 13:43 (#71269)
Attached to: Every Toughbook ever made

I for one would be interested in detailed reports of whith toughbooks are most linux friendly.

Read More 1 comments
Comments: 1
+ -

  Comment: History good (Score 1) on 2009.11.24 19:46

I am enjoying your alternative this-day-in-history bits.

it's a bit odd to have them in the Perl section of my RSS feeds and there's no way to tell from the subject what the unrelated Perl gem will be.

Read More 2 comments
Comments: 2
+ -

  Comment: check date ? (Score 1) on 2009.11.09 15:05

http://bugs.gentoo.org/show_bug.cgi?id=8132 ... Linux went non-self-hosting and most people never noticed. There's no Slashdot headlines.

could that silence be because the bug you linked was in 2002, is marked resolved, and was last updated in 2005?

do you browse the Perl 4 or SQL 87 bug logs too ?

Read More 6 comments
Comments: 6
+ -

  Comment: uh oh (Score 1) on 2009.10.23 14:19

by n1vux on 2009.10.23 14:19 (#70959)
Attached to: I'm a Perl::Critic committer.

making me LOL in the office like that could get me in trouble ...

Read More 6 comments
Comments: 6
+ -

  Comment: global bad, lexical good (Score 1) on 2009.10.19 11:49

by n1vux on 2009.10.19 11:49 (#70917)
Attached to: Declarations and Scope followup on Chromatic's post
This certainly is covered in Damian Conway's PBP:

"5.1. Lexical Variables
Avoid using non-lexical variables."

And preferred use of my (or local for certain built-ins) is repeated in a dozen or more specific contexts like filehandeles, builtin vars, ....

Read More 5 comments
Comments: 5
+ -

  Comment: Re:That is strange... (Score 1) on 2009.09.15 15:57

by n1vux on 2009.09.15 15:57 (#70591)
Attached to: Death of a newsgroup

Verizon recently announced impending usenet feed stop, idk the effective date. That may be unrelated.

Where are you getting feed and what robust spam filter are you using? I have mostly ignored Usenet although i have kedt my original ISP world!wdr account active.

Read More 4 comments
Comments: 4
+ -

  Comment: Re:OpenStreetBugs, OpenStreetMap (Score 1) on 2009.08.25 8:03

by n1vux on 2009.08.25 8:03 (#70256)
Attached to: Random openstreetmap fixup request

right. well, we've marked it for the locals on the bug map. either the bike-mappers or urban ramblers will pick it up.

(we'll be talking OSM at Boston.PM's September meeting.)

feel free to trace anything missing where you travel currently,

bill

Read More 3 comments
Comments: 3
+ -

  Comment: OpenStreetBugs, OpenStreetMap (Score 1) on 2009.08.24 20:43

by n1vux on 2009.08.24 20:43 (#70250)
Attached to: Random openstreetmap fixup request

if you know the path well enough to trace it from yahoo imagery, you gan create an osm id and add it without using a GPS. Is is purlely a footpath or a bikepath by intent? My GPS is too far from London, and I do not know it so shalln't trace it. Meantime I have marked it on http://openstreetbugs.appspot.com/?lat=51.53601&lon=-0.29349&zoom=16 where a local may find it and fi it.

Bill in Boston

Read More 3 comments
Comments: 3
+ -

  Comment: backgrading Perl (Score 1) on 2009.07.30 13:29

by n1vux on 2009.07.30 13:29 (#69790)
Attached to: How To Downgrade Perl on Ubuntu

on a Debian based system line Ubuntu it should also be possible to revert the upgrade to bin/perl itself, reinstalling the older 5.8
8 as bin/perl with the Debs, and pinning that version. this may rollback and block an expanding number of dependant upgrades, however.

as is stated elsewhere, having app prod perl be OS bin/perl is dangerous, best to have your own.

Read More 12 comments
Comments: 12
+ -

  Comment: nice but why? (Score 1) on 2009.07.24 16:48

by n1vux on 2009.07.24 16:48 (#69620)
Attached to: git up to date

One of my esteemed prior co-workers recommends that I follow git releases very closely.

Is git not yet stable? Is the bleeding edge still needed? For whom? Or is what a distro package manager (eg Ubuntu Paunty or Intrepid apt-get .debs) provides good enough for most folks?

I've added a "git-update" command into my path so I can just say "git update" occasionally

Nice. That ability to extend it simply is awesome.

Since I would expect git-update to operate against the remote repo for the current project directory, i might name this git-gitupdate on my system to avoid misunderstanding.

to get all the newest features and bugs.

how good / bad is the features / bugs ratio?

Read More 2 comments
Comments: 2
+ -

  Comment: bad SQL column names (Score 1) on 2009.07.24 16:36

by n1vux on 2009.07.24 16:36 (#69618)
Attached to: SQL Keywords Are Not Good Column Names
I too feel your pain. It is quite natural in ham radio to abbreviate Callsign (our government issued not-quite* unique ids) as 'call'. That was a poor choice for a column name for such things, since user defined procedures in SQL have to be invoked by a call keyword. I had to expand the column name such that it is wider than the longest likely value (except Roman Italic compresses Callsign more than Roman Bold does WB1GOF) http://fd.ema.arrl.org/History.php

* why 'not quite unique? Two issues --

  1. A call can be reissued after a period of disuse**, so is only unique id within a time range.
  2. There is an overlap in FCC + treaty definitions for US callsigns
    • $ham = qr/[WANK][A-Z]? \d [A-Z]{2,3}/xism;
    • $plane=qr/N \d+ [A-Z]{1,2}/xism;

** this over simlifies several ways. the US has q(AA)..q(AL) but not A1 .. A9, AM .. AZ. http://en.wikipedia.org/wiki/ITU_prefix. There is more than a year between disuse and re-issue of personal callsigns to persons. Exceptions include bequething or memorializing a callsign to/with a club or relative after death, or special event callsigns, which flip week to week: in the US, volunteers loan out so-called 1x1 callsigns > $spe=qr/[WNK] \d [A-Z]/xism; to special events, eg W4H is sed in Bosten once a year but is used for other events elsewhen elsewhere, eg Knoxville TN (Fourth of July), Hunterdon Co 4H Fair, and Key Biscayne FL (in 4th call district), so the uniqueness is but for a weekend, not for a decade. And the equivalence range isn't even autoritatively defined online.

Moral of the story is that seemingly unique identifiers that you don't control issuance of are as likely to bite as seemingly good English word column names that turn out to be SQL reserved words.

Read More 3 comments
Comments: 3
+ -

  Comment: Enough SQL Re:how about using IN? (Score 1) on 2009.06.30 16:25

by n1vux on 2009.06.30 16:25 (#69196)
Attached to: You know you are doing too complex SQL queries...

O'Reilly has some general titles in both portable paperback and online formats such as SQL Cookbook , SQL Hacks , SQL Pocket Guide, 2nd Ed , Head First SQL , SQL in a Nutshell, 3rd Ed . I mention these since they're not specific to any one vendor.

The DB vendor website should have online docs for how much of latest ANSI spec each release has implemented with what divergences (to be polite). I frequently have the MySQL website's manual section open when working on my dot.org site SQL, since their subquery syntax is their subset, not TIMTOWTDI allowed.

A fantastic free resource (which is in the corners specific to IBM DB2 but mostly standard ANSI SQL) is available for download or reference DB2 SQL Cookbook

Read More 6 comments
Comments: 6
+ -

  Comment: stats - one third of perl C goto is toke (Score 1) on 2009.06.10 16:40

by n1vux on 2009.06.10 16:40 (#69050)
Attached to: HAHA PHP

in the 5.8.9-rc1 that i had handy from a regression test

of 1270 C-ish file hits using Andy's ack invocation

nearly one third are in one file alone
  403 toke.c

most of which and one quarter of the total being exactly
  343 toke.c: goto unknown;

the long tail continues over 65 files, but a mere 5 files cover 50% in 5 a tie
  403 toke.c
    95 regexec.c
    54 pp_sys.c
    53 sv.c
    39 opmini.c
    39 op.c # tied for 5th
(subtotal 683 53%)

and covers 80% at 19 files (17th-21st having 18 each, subtotal 1059 83%)

(That's a pretty good Pareto approximation!)

16 are in comments
17 are in quotes
      including two in comments above
      and 8 are die messages
16 are #define yacc actions in four files

Top 30 goto-bearing Cish files -

  403 toke.c
    95 regexec.c
    54 pp_sys.c
    53 sv.c
    39 opmini.c
    39 op.c
    36 util.c
    36 regcomp.c
    30 os2/OS2/Process/Process.xs
    30 gv.c
    29 pp_hot.c
    28 x2p/walk.c
    27 os2/os2.c
    26 perl.c
    25 doio.c
    19 pp_pack.c
    18 x2p/a2p.c
    18 win32/win32.c
    18 utf8.c
    18 pp_ctl.c
    18 perly.c
    17 vms/vms.c
    16 ext/Storable/Storable.xs
    15 ext/SDBM_File/sdbm/dbe.c
    12 pp.c
    12 dump.c
    11 jpl/JNI/JNI.xs
    10 mg.c
      9 ext/Encode/Encode.xs
      8 doop.c

(30th subtotal 1169 92%)

(ack did find a few .h as well but they had few each.)

Read More 7 comments
Comments: 7
+ -

  Comment: Re:dictionary Re:5 is the shortest (Score 1) on 2009.06.01 14:45

by n1vux on 2009.06.01 14:45 (#68897)
Attached to: Word ladder

Even if Perl is in dict, starting at perl is faster since it has fewer adjacent ladder words, so search tree starts less bushy (and on average will reamain so), and more next-move-win states since ping has more adjacency.

Most of the time shouldn't be in file scan unless your machine has no disk cache or the program ran correctly the first and only time! With cache, I am seeing 124ms on building %is_word with a small dict, twice as much loading half dozen dicts including moby. Oh wait, I made one small tweak to achieve that ...

my $n = length($start ); # add ...
while () {
                chomp();
                next unless length() == $n; # add
                $is_word{lc($_)}++;
}

the cost of rebalancing the much smaller hash is much less. To build a full dict is more like 5000ms, so yes, tha would be dominating. Don't hash what you don't need!

maybe tonight or weekend i can bench some otheralgos, eg the meet in the middle / alternate ends strategy and the grep f($word), keys tactic. Need something better to try to answer if there is ANY connection from
    ladder
    ramrod

starting from ping, with a gob of dicts loaded, I still don't to theoretical 3-move 4-ladder, but this is cute -

perl
pern
penn
peng
ping

not that I'd allow many of those in a game of Scr@bbl3* either.

Read More 10 comments
Comments: 10