Le jeudi 5 mai 2011 18:43, Paul Johnson a écrit :
> On Thu, May 05, 2011 at 08:20:13AM -0700, eventual wrote:
> > Hi, Concerning the game Lotto, how do I generate a list of 6 numbers out
> > of 12 numbers, eg
> >
> > given the 12 numbers as 1,2,3,4,5,6,7,8,9,10,11,12
> > the list of 6 numbers goes
On Thu, May 05, 2011 at 08:20:13AM -0700, eventual wrote:
> Hi, Concerning the game Lotto, how do I generate a list of 6 numbers out of
> 12
> numbers, eg
>
> given the 12 numbers as 1,2,3,4,5,6,7,8,9,10,11,12
> the list of 6 numbers goes like this :-
> 1,2,3,4,5,6
> 1,2,3,4,5,7
> 1,2,3,4,5,8
Hi, Concerning the game Lotto, how do I generate a list of 6 numbers out of 12
numbers, eg
given the 12 numbers as 1,2,3,4,5,6,7,8,9,10,11,12
the list of 6 numbers goes like this :-
1,2,3,4,5,6
1,2,3,4,5,7
1,2,3,4,5,8
1,2,3,4,5,9
1,2,3,4,5,10 . etc etc
Thanks
From: Ryan <[EMAIL PROTECTED]>
> While I agree that it would be a good homework assignment it's not.
> What I have is a logic look up table for health records using an EAV
> model (in an SQL table):
>
> rowID - key - value
>
> From a web form I select some keys and values. When subm
On Mon, Oct 06, 2008 at 08:32:22PM -0400, Stephen Gallagher wrote:
> I can come up with one example where this might be interesting. Imagine you
> are a software tester and were tasked with identifying all potential
> variable combinations that needed to be covered/tested. Risk m
- Original Message -
From: "Jason Trebilcock" <[EMAIL PROTECTED]>
To: "Perl Beginners"
Sent: Monday, October 6, 2008 7:57:23 PM GMT -05:00 US/Canada Eastern
Subject: RE: combinations
-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: M
e" of glob the same way you treat:
my $foo if 0;
and those stupid:
perl -e ' ... }{ ...'
tricks, as in, it works for now, but I wouldn't promise it in the
future.
As in, my answer started with a joke. Hence the smiley. But I did
have a
puzzling question about
-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: Monday, October 06, 2008 12:37 PM
To: Perl Beginners
Cc: Randal L. Schwartz; Mr. Shawn H. Corey
Subject: Re: combinations
What are the real-world problems that are solved using a list of
combinations of
sets of items
> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes:
Rob> The homework aroma entices me to respond with another question -
Rob> hopefully an educational one. I hadn't thought of watermarking them
Rob> though - good idea :)
I didn't come up with the watermark idea. Can't remember where I saw it..
Randal L. Schwartz wrote:
>> "Peter" == Peter Scott <[EMAIL PROTECTED]> writes:
>
> Peter> Did you see the smiley? Randal might have been more inclined to give a
> Peter> less cute answer if the poster said what he wanted this for, because it
> Peter> does sound like homework.
>
> Precisely.
Mr. Shawn H. Corey wrote:
> On Mon, 2008-10-06 at 09:02 -0700, Randal L. Schwartz wrote:
>>
>> As in, my answer started with a joke. Hence the smiley. But I did have a
>> puzzling question about this recurring need for "all combinations" and
>> always state
gt; and those stupid:
>
> perl -e ' ... }{ ...'
>
> tricks, as in, it works for now, but I wouldn't promise it in the future.
>
> As in, my answer started with a joke. Hence the smiley. But I did have a
> puzzling question about this recurring need for
On Mon, 2008-10-06 at 09:02 -0700, Randal L. Schwartz wrote:
> As in, my answer started with a joke. Hence the smiley. But I did
> have a
> puzzling question about this recurring need for "all combinations" and
> always
> stated rather abstractly, without the real
> "Peter" == Peter Scott <[EMAIL PROTECTED]> writes:
Peter> Did you see the smiley? Randal might have been more inclined to give a
Peter> less cute answer if the poster said what he wanted this for, because it
Peter> does sound like homework.
Precisely. If it smells like homework to me, I t
, but I wouldn't promise it in the future.
As in, my answer started with a joke. Hence the smiley. But I did have a
puzzling question about this recurring need for "all combinations" and always
stated rather abstractly, without the real-world need backing it up.
--
Randal
On Sun, 05 Oct 2008 19:06:35 -0400, Mr. Shawn H. Corey wrote:
> On Sun, 2008-10-05 at 15:11 -0700, Randal L. Schwartz wrote:
>> my @result = map [split /-/], glob "{a}-{b,c}-{d,e,f}-{a}";
>>
>> :-)
>>
>> But seriously, why does this come up often?
>
> Because your solution relies on knowledge of
Mr. Shawn H. Corey wrote:
> On Sun, 2008-10-05 at 21:30 -0700, Randal L. Schwartz wrote:
>>
>> Eh? My question has *nothing* to do with my solution. My question
>> has to do with the original question.
>
> And my question is why isn't these abilities of glob described in
> perldoc?
They are des
On Sun, 2008-10-05 at 21:30 -0700, Randal L. Schwartz wrote:
> Eh? My question has *nothing* to do with my solution. My question
> has to do with the original question.
And my question is why isn't these abilities of glob described in
perldoc?
--
Just my 0.0002 million dollars worth,
Sh
> "Shawn" == Shawn H Corey <[EMAIL PROTECTED]> writes:
Shawn> Because your solution relies on knowledge of bash which many Windows
Shawn> users do not have.
Eh? My question has *nothing* to do with my solution. My question
has to do with the original question.
--
Randal L. Schwartz - Ston
On Sun, 2008-10-05 at 15:11 -0700, Randal L. Schwartz wrote:
> my @result = map [split /-/], glob "{a}-{b,c}-{d,e,f}-{a}";
>
> :-)
>
> But seriously, why does this come up often?
Because your solution relies on knowledge of bash which many Windows
users do not have.
Also this ability of glob is
>>>>> "Ryan" == Ryan <[EMAIL PROTECTED]> writes:
Ryan> my %data = (
Ryan> k1 => 'a',
Ryan> k2 => ['b', 'c'],
Ryan> k3 => ['d', 'e', 'f']
Ryan> k4 => 'a'
Rya
On Sun, 2008-10-05 at 17:33 -0400, Mr. Shawn H. Corey wrote:
> sub combos {
> my %data = @_;
> my @keys = sort keys %data;
>
> return _combos( [EMAIL PROTECTED], %data );
> }
>
First correction:
sub combos {
my %data = @_;
my @keys = keys %data;
return _combos( [EMAIL PROTECTED], %
On Sun, 2008-10-05 at 15:29 -0500, Ryan wrote:
> my %data = (
> k1 => 'a',
> k2 => ['b', 'c'],
> k3 => ['d', 'e', 'f']
> k4 => 'a'
> );
>
> I want to get all the po
my %data = (
k1 => 'a',
k2 => ['b', 'c'],
k3 => ['d', 'e', 'f']
k4 => 'a'
);
I want to get all the possible combinations:
k1 => a
k2 => b
k3 => d
k4 => a
k1 => a
k
sh of arrays
> equivalent to a 122 x 6152 matrix that I want to run
> in 'pairwise combinations' and execute the 'sum of the
> difference squares' for each combination.
>
> In other words:
> columns: y1...y122
> rows: x1...x6152
>
> so...
> com
sh of arrays
> equivalent to a 122 x 6152 matrix that I want to run
> in 'pairwise combinations' and execute the 'sum of the
> difference squares' for each combination.
>
> In other words:
> columns: y1...y122
> rows: x1...x6152
>
> so...
> com
I am fairly new to Perl and haven't approached a scipt
this complex or computation this intensive. So I
would certainly appreciate any advice.
I have successfully created a hash of arrays
equivalent to a 122 x 6152 matrix that I want to run
in 'pairwise combinations' and execute
> This (perl -n -we 'print if /[\[\].]{2}/;' file) almost did the trick, but
> it was also picking up lines with many .. or many
flanked
> in between something. So I ammended it to (as there is always a space
> between the characters I am trying to pull out):
>
> perl -n -we 'p
re what you want but:
> > >
> > > /[\[\].]{2}/
> > >
> > > will match any combination of two .[]
> > >
> > > /Stefan
> > >
> > > Aimal Pashtoonmal wrote:
> > > >
> > > > Hello,
> > > >
&g
Hello
I am not sure what you want but:
/[\[\].]{2}/
will match any combination of two .[]
/Stefan
Aimal Pashtoonmal wrote:
>
> Hello,
>
> I am trying to use command line grep and perl regex to capture all
> combinations of the following, but I am not getting everything:
Hello,
I am trying to use command line grep and perl regex to capture all
combinations of the following, but I am not getting everything:
somethingdigits/digits digitsdigits..digits
digits..digitsdigits.digits
somethingdigits/digits digitsdigits
31 matches
Mail list logo