Re: Just to say hello

2011-11-09 Thread Uri Guttman
On 11/09/2011 12:26 PM, Sandro CAZZANIGA wrote: 2011/11/9 Bennett Toddb...@rahul.net I think this list may have fallen into disuse. I don't have any fresh juicy bits to share, I'm sorry. I hope you inspire some contributions to re-kindle the list. The only cool perl trick I recall at this

YN golf

2008-03-31 Thread Uri Guttman
spaces but it does work. golf away! uri perl -le 'print join \n, map {tr/01/NY/; $_} map unpack( b5, chr), 0 .. 31' -- Uri Guttman -- [EMAIL PROTECTED] http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl

Re: regex of the month (decade?)

2008-01-07 Thread Uri Guttman
count 9 errors and 213 characters removed. Though, I can't DC count, so that may be wrong. Did I miss anything? i dunno. i can't figure it out either. that is why i posted it here! :) uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem

Re: AW: bad code to good golf

2007-12-13 Thread Uri Guttman
sub new{bless{0,@_},$_[0]} my double reverse thing has the same flaw. but i don't think the extra key/value is legit (being the judge of this contest :). uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture

Re: bad code to good golf

2007-12-10 Thread Uri Guttman
that i would use lisp assoc lists! :) uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http://jobs.perl.org

Re: bad code to good golf

2007-12-09 Thread Uri Guttman
sub new [EMAIL PROTECTED],shift} that is the same as my shorter golf answer. maybe i counted mine wrong. MGS sub new {$a=shift;[EMAIL PROTECTED],$a} MGS 21. And it's even strict clean. :) that is nice. the other replies beat it though! uri -- Uri Guttman -- [EMAIL PROTECTED

Re: bad code to good golf

2007-12-09 Thread Uri Guttman
to splice or shift. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http://jobs.perl.org

Re: bad code to good golf

2007-12-09 Thread Uri Guttman
MGS == Michael G Schwern [EMAIL PROTECTED] writes: MGS Uri Guttman wrote: is there any guarantee of evaluation order in arg lists? will the bless/splice always be executed before the pop? MGS I believe it is undefined, so it's not recommended that you do MGS anything order dependent

bad code to good golf

2007-12-08 Thread Uri Guttman
it be fun to post more snippets and taunt them with happy fun ball? uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http

Re: new !-based secret operators

2007-11-30 Thread Uri Guttman
to my heart's content? :) this is code for cpan. your requests are requirements for top quality cpan code! uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs

Re: hashes over easy

2007-11-29 Thread Uri Guttman
there are plenty of small errors, typos, format issues etc. i did these slides under time pressure and never fixed up the plentiful bugs as they were not public. thanx, uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems

hashes over easy

2007-11-28 Thread Uri Guttman
://sysarch.com/computershare/hashes/index.html yes, i know the sets slide is empty. i didn't have time to write it. you can show these slides to others but attribute them to me, please. i didn't even put copyright notices in the templates so don't rip me off for my lifetime + 75 years! uri -- Uri Guttman

Re: fun with hashes!

2007-11-25 Thread Uri Guttman
such as which are really variations of each other. they are all hash variations when you come down to that so the context and name of each use must be clearly explained. i will post here the url for these slides (with mistakes! :) when i get them done. please be kind. :) thanx, uri -- Uri Guttman

Re: fun with hashes!

2007-11-25 Thread Uri Guttman
} s ;-) GACK!!! and that assume knowledge of the internals of hashes. not a good thing to teach! :) uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs

Re: fun with hashes!

2007-11-25 Thread Uri Guttman
. and i am not talking obscure code, just judicious use of statement modifiers, subs, logic order that generally eliminates the need for else. others will use else as they please. thanx, uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem

Re: fun with hashes!

2007-11-24 Thread Uri Guttman
DL == David Landgren [EMAIL PROTECTED] writes: DL Uri Guttman writes: AP == A Pagaltzis [EMAIL PROTECTED] writes: AP * Jerrad Pierce [EMAIL PROTECTED] [2007-11-23 22:50]: exists( $dispatch{$sub} ) ? $dispatch{$sub}-() : warn Key $sub does not exist in the dispatch table; AP

Re: fun with hashes!

2007-11-24 Thread Uri Guttman
! :) and with outside input as in web you need to do this checking in the server. if you know the data is clean then you can default on a missing key but otherwise you need to check the key against the dispatch table. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com

Re: fun with hashes!

2007-11-24 Thread Uri Guttman
, uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http://jobs.perl.org

Re: fun with hashes!

2007-11-23 Thread Uri Guttman
. this is not a hash issue but a detail about doing dispatch tables cleanly. sometimes you want to predefine a default code ref in the dispatch table and other times you want to handle the missing key when you make the call through the dispatch table. uri -- Uri Guttman -- [EMAIL PROTECTED] http

Re: fun with hashes!

2007-11-23 Thread Uri Guttman
ugly in reality. s/dispatch tables/inheritance/g ; :) uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http://jobs.perl.org

Re: fun with hashes!

2007-11-23 Thread Uri Guttman
is @[EMAIL PROTECTED] = () ; and then use exists() to test instead of truth. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs

template::simple released

2006-09-25 Thread Uri Guttman
hi all, i have released Template::Simple to cpan so get it from there and start rendering! thanx, uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs

Re: Punctuation Free Quine -- Almost

2006-09-19 Thread Uri Guttman
-- http://en.wikipedia.org/wiki/Quine and beyond that, reading and printing the source file of the script isn't quining either. the goal is for a self-contained program to print its source. so usually the quine source has to be generated on the fly using some nasty tricks. uri -- Uri

Re: Error puzzler

2006-09-13 Thread Uri Guttman
$_ and so do the for loops. i wouldn't hazard a guess as to what the code will do. i never run into that since i rarely use $_. i use my vars on all loops and only use $_ where required (map/grep/for modifier) or in one liners and such. uri -- Uri Guttman -- [EMAIL PROTECTED] http

template::simple rc1

2006-09-11 Thread Uri Guttman
these lists would be a good idea -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http://jobs.perl.org

Re: Interesting little regex

2006-02-23 Thread Uri Guttman
): print map $_ = $unique{$_}\n, sort keys %unique; i am curious how much faster it will run with all those changes. :) uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer

Re: Interesting little regex

2006-02-23 Thread Uri Guttman
AY == Alan Young [EMAIL PROTECTED] writes: AY Updated script at bottom. AY On 2/23/06, Uri Guttman [EMAIL PROTECTED] wrote: AY $text =~ s{( AY (\b\w+(?:['-]+\w+)*\b) why the multiple ['-] inside the words? could those chars ever begin or end words? so just [\w'-]+ should

Re: Fwd: first release of PerlWar

2005-11-01 Thread Uri Guttman
code review and heat death will occur before i respond! :) uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http://jobs.perl.org

Re: Unknown level of hash

2005-03-28 Thread Uri Guttman
AS == Aaron Sherman [EMAIL PROTECTED] writes: AS On Mon, 2005-03-28 at 18:43, Uri Guttman wrote: ZL == Zhuang Li [EMAIL PROTECTED] writes: ZL Hi, given an array: @a = ('E1', 'E2', ..., 'En'); ZL Is there an easy way, hopefully one liner, to do the following without a ZL loop

tough regex problem

2004-09-17 Thread Uri Guttman
passed this problem to a top regex person and he sent me the second one above (obviously untested! :). so fame, glory and an acknowledgement in the new release all go to the valiant warrior who solves this. let the fl^Wgames begin! uri -- Uri Guttman -- [EMAIL PROTECTED] http

Re: tough regex problem

2004-09-17 Thread Uri Guttman
as that will slow it down. as i said, it is trickier than meets the eye. that is why i settled on the split with lookbehind as it works properly in all the corner cases. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems

Re: tough regex problem

2004-09-17 Thread Uri Guttman
fix that with another list reverse but that all will be too slow IMO. i have another solution i think which i will test later today. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding

Re: Y2K Again ??

2004-05-14 Thread Uri Guttman
the () and . makes it look like about a wash golfwise but top posting and full quoting should add penalty strokes :) uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl

Re: Reading X lines at a time

2004-05-03 Thread Uri Guttman
# ... XN } uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http://jobs.perl.org

Re: Padding a length of string

2004-04-20 Thread Uri Guttman
and no one found one of the faster methods: my $padded = substr( $in . $c x $pad_len, 0, $pad_len ) ; uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs

Re: What does }{ mean?

2004-02-06 Thread Uri Guttman
such a construct would be legal. I'm not sure what it K means. you have it backwards from the string in the subject. replace that with }{ and it works. see all the other responses. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development

Re: lvalue hash slice

2003-09-30 Thread Uri Guttman
/ }= (3, 5);print join ,, values %h' 5,3 where did you get the notion that hash slices won't work as an lvalue? any list (of lvalues) can be an lvalue and a slice is just syntactic sugar for the same list expanded out. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com

Re: reencoding ampersands for html, longhand

2003-04-03 Thread Uri Guttman
. it was like coding regexes in cobol. it was like having bush for a president. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs

Re: reencoding ampersands for html, longhand

2003-04-02 Thread Uri Guttman
and cleaner loop: untested s/(#?\w{2,7});/fix_ent( $1 )/ge ; sub fix_ent { my $ent = shift ; return $ent; if $ent =~ /^#\d{3}/ || $html_entities{ lc $ent } ; return amp;$ent; ; } fix up to suit your taste. uri -- Uri Guttman

Re: removing extra empty lines

2002-09-30 Thread Uri Guttman
PBE == Peter B Ensch [EMAIL PROTECTED] writes: PBE Uri Guttman wrote: Y == Yanick [EMAIL PROTECTED] writes: no one seems to have seen my earlier post on this so here it is again and it is much shorter. Y perl -pe'/\S/?($e=0):($e++and$_=)' filename perl -0777pe's

Re: Great programming language shootout

2002-06-11 Thread Uri Guttman
interested. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com - Damian Conway Perl Classes -- July 1-3 -- http://stemsystems.com/class/ --- - Stem and Perl Development, Systems Architecture, Design and Coding Search or Offer Perl Jobs

perl job saving (was Re: Non-golf fun)

2002-03-19 Thread Uri Guttman
. and advocacy has some stories i think. but a collection of these stories would be great to have. you can delete the cc if you wish. i know many are on two or more of these lists. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open Source Network Development

Re: Golf spectators

2002-03-18 Thread Uri Guttman
DC == Dave Cross [EMAIL PROTECTED] writes: DC I'm having flashbacks to the 2000 OSCON Perl Golf Apocalypse, DC which is something that I'm sure the organisers would like to DC forget :) MUST KILL ALL WHO KNOW!! MUST KILL!!! MUST KILL!!! uri -- Uri Guttman -- [EMAIL

Re: rethinking printf

2002-03-10 Thread Uri Guttman
a == abigail [EMAIL PROTECTED] writes: a On Wed, Mar 06, 2002 at 11:15:30PM -0500, Uri Guttman wrote: good point. $() can still wrap that but then there has to be a balance between printf strings and double quoters. how about this wacky idea: make a new type of string where

Re: rethinking printf

2002-03-10 Thread Uri Guttman
YS == Yitzchak Scott-Thoennes [EMAIL PROTECTED] writes: YS Uri Guttman [EMAIL PROTECTED] wrote: i disagree. but we shall see if larry is listening to this thread and will back away from hash interpolation or take some of our suggestions that make it work without killing format

Re: rethinking printf

2002-03-10 Thread Uri Guttman
alternatives. :-/ uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open Source Network Development Toolkit and Application Suite - - Stem and Perl Development, Systems Architecture, Design and Coding Search or Offer Perl Jobs

Re: rethinking printf

2002-03-10 Thread Uri Guttman
BD == Brent Dax [EMAIL PROTECTED] writes: BD Uri Guttman: BD # $prec = %hash{width} ; BD # sprintf( qf%${prec}s, $string); BD # BD # sprintf( \%${prec}s, $string); BD # BD # is one of your alternatives. :-/ BD You forgot one. BD sprintf('%'_%hash{width}_'s', $string

Re: rethinking printf

2002-03-06 Thread Uri Guttman
is $(%foo.string), $bar ; no ambiguity and no confusion. how often will you need to interpolate a hash? so make it more cumbersome as it is a rare thing. that is larry's credo from way back. breaking % in a s/printf format is not good as that is the very common thing to do. uri -- Uri Guttman

Re: rethinking printf

2002-03-06 Thread Uri Guttman
BD == Brent Dax [EMAIL PROTECTED] writes: BD Uri Guttman: BD # printf %d hash is $(%foo.string), $bar ; BD # BD # no ambiguity and no confusion. how often will you need to BD # interpolate a BD # hash? BD As others have pointed out, %foo{BAR} has to work. But I have

Re: interesting typo I couldn't see

2002-02-17 Thread Uri Guttman
; printf ORDER (\n%4d %-50s %3.2f %3.2f\n, $quantity, $p_item, $price, $ext); that eliminates the brace issue, and the duplication of the printf format (which is annoying to have to change in both places later). better code is what i call fun. :) uri -- Uri Guttman

Re: interesting typo I couldn't see

2002-02-17 Thread Uri Guttman
client a favor by simplifying the code down to his level. :) and you should never write code for the client, you write code for the maintainer (who may be you, the client, or anyone else!). but this is getting off fun (even if vicki is involved :) uri -- Uri Guttman -- [EMAIL PROTECTED

Re: Golf and the Perl Review

2002-02-05 Thread Uri Guttman
the meaning of words can turn upside down so BL completely. the kabbalah is a collection of mystical and spiritual jewish teachings and writings over the last two thousand years. it doesn't have anything to do with the word cabal AFAIK. uri -- Uri Guttman -- [EMAIL PROTECTED] http

Re: Perl and majordomo

2001-12-26 Thread Uri Guttman
MGS == Michael G Schwern [EMAIL PROTECTED] writes: MGS perl.org mailing lists don't use Majordomo. They're... something MGS else. ezlm? mailman? definitely qmail/ezmlm. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open Source

Re: test a password string for correctness

2001-12-13 Thread Uri Guttman
RF == Ryan Fischer [EMAIL PROTECTED] writes: y/a-zA-Z//2y/0-9//1 RF That's not gonna do it. You'll kill $_. :( you don't know y/// too well if you think that. it is a well known perl golf trick. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com

Re: test a password string for correctness

2001-12-13 Thread Uri Guttman
if it is not specified. that is also a useful feature and documented. i wouldn't call them counter intuitive as they are clearly documented and make it more flexible than your single use approach would. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open

Re: Possible improvements for the next golf apocalypse

2001-12-10 Thread Uri Guttman
and no software could help. but i like the idea of the winner being the next judge and/or puzzle maker. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open Source Network Development Toolkit and Application Suite - - Stem and Perl Development, Systems

Re: Possible improvements for the next golf apocalypse

2001-12-10 Thread Uri Guttman
PC == Piers Cawley [EMAIL PROTECTED] writes: PC Uri Guttman [EMAIL PROTECTED] writes: AS == Andrew Savige [EMAIL PROTECTED] writes: AS 1. Timing you started it just as i was leaving for LISA. :( i should be around for the next one. just don't do one around the time

Re: tri-state flags

2001-12-05 Thread Uri Guttman
to golf. looks like a lot of fun i am skipping. -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open Source Network Development Toolkit and Application Suite - - Stem and Perl Development, Systems Architecture, Design and Coding Search or Offer

Re: middle line (was Re: Daily Perl FAQ...)

2001-11-29 Thread Uri Guttman
to solve this cutesy problem. :) if someone patches it, i will apply it and upload a new version. SEEK would be much harder and i am not sure it is warranted. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open Source Network Development Toolkit

Re: middle line (was Re: Daily Perl FAQ...)

2001-11-29 Thread Uri Guttman
) in time. and it uses no more than 1 buffer (actually 2) of data which is O(1) in memory no matter the size of the file. that assumes normal size lines and not enormous ones. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open Source Network

Re: middle line (was Re: Daily Perl FAQ...)

2001-11-29 Thread Uri Guttman
function in O() notation. it will eventually swamp out any lower growth function. both the ST and GRT have a O(N) component but the O(Log N) of the actual sort call is what counts. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open Source Network

Re: 'vacation'

2001-11-28 Thread Uri Guttman
get sent out. i will need to automate this with LWP and mail filters, etc. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open Source Network Development Toolkit and Application Suite - - Stem and Perl Development, Systems Architecture, Design

Re: Practical Perl Golf

2001-11-15 Thread Uri Guttman
)/)print' uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open Source Network Development Toolkit and Application Suite - - Stem and Perl Development, Systems Architecture, Design and Coding Search or Offer Perl Jobs

Re: Practical Perl Golf

2001-11-15 Thread Uri Guttman
-ne 'print if/^#!.*perl/i..0and/\s*#\s*(include|define|(ifn?|un)def|else|elif|endif)/|/^\s*[^#]/' 3 more than ronald's i also had the range idea independently. i ran into the problem of binding tighter than scalar .. but i have another idea up my sleeve. :) uri -- Uri Guttman -- [EMAIL

Re: Practical Perl Golf

2001-11-15 Thread Uri Guttman
should be filtered out but isn't. you can only pass lines which start with exact cpp command tokens uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com -- Stem is an Open Source Network Development Toolkit and Application Suite - - Stem and Perl Development

Re: isNumber( ) ??

2001-10-19 Thread Uri Guttman
IP == Ian Phillipps [EMAIL PROTECTED] writes: IP On Thu, 18 Oct 2001 at 20:43:40 -0400, Uri Guttman wrote: IP == Ian Phillipps [EMAIL PROTECTED] writes: IP I feel sure this is a FAQ... trust your feelings. i didn't answer because it IS an FAQ. FAQ's aren't fun. :) IP Oh, I

Re: isNumber( ) ??

2001-10-18 Thread Uri Guttman
IP == Ian Phillipps [EMAIL PROTECTED] writes: IP I feel sure this is a FAQ... trust your feelings. i didn't answer because it IS an FAQ. FAQ's aren't fun. :) perldoc -q number How do I determine whether a scalar is a number/whole/integer/float? uri -- Uri Guttman