From michael at potter.name Mon May 3 06:29:36 2010 From: michael at potter.name (Michael Potter) Date: Mon, 3 May 2010 09:29:36 -0400 Subject: [Chicago-talk] Macbook pro question Message-ID: I have a Macbook pro question and I am asking it here because many of you use Macbook pros. I searched the Apple forums for this and there is an overwhelming number of opinions. The problem with searching the apple forums is I want the opinions of my peers: people who use the Macbook pro to develop code. I don't use Photoshop so the quality of viewing a photo does not really matter to me. Anyway, here is my question: Which is better for the way we work: Glossy or Matte screens? I am also going to the Apple Store to compare. But I am not sure that I will get a fair comparison in the store. -- Michael Potter -------------- next part -------------- An HTML attachment was scrubbed... URL: From ed at questinformation.com Mon May 3 06:40:54 2010 From: ed at questinformation.com (Ed Pigg) Date: Mon, 3 May 2010 08:40:54 -0500 Subject: [Chicago-talk] Macbook pro question In-Reply-To: References: Message-ID: On May 3, 2010, at 8:29 AM, Michael Potter wrote: > I have a Macbook pro question and I am asking it here because many > of you use Macbook pros. I searched the Apple forums for this and > there is an overwhelming number of opinions. The problem with > searching the apple forums is I want the opinions of my peers: > people who use the Macbook pro to develop code. I don't use > Photoshop so the quality of viewing a photo does not really matter > to me. > > Anyway, here is my question: > Which is better for the way we work: Glossy or Matte screens? That's a fairly subjective question. It all depends upon you and your preference. I always had matte screens on the mac laptops until the last time I updated. I usually buy through the Apple store getting refurbished units. I've been using a glossy 15" Macbook Pro for the last 3 years. Most of the time I am connected to a 22" screen, so that does not count for this discussion. Other than having to adjust the screen for reflected light I have not had any problems with the glossy screen. YMMV ---------------------------------------------------------------------- Edgar Pigg ed at questinformation.com Quest Information Systems 847 234-1345 http://www.questinformation.com ---------------------------------------------------------------------- From joel.limardo at forwardphase.com Mon May 3 07:28:52 2010 From: joel.limardo at forwardphase.com (Joel Limardo) Date: Mon, 3 May 2010 09:28:52 -0500 Subject: [Chicago-talk] Macbook pro question In-Reply-To: References: Message-ID: "...I want the opinions of my peers: people who use the Macbook pro to develop code..." Haha...I think people in the MacBook Pro user forums would likely think that was an offensive statement. I mean, who in the heck is writing all of this iPhone/iPad apps....Windows users? On Mon, May 3, 2010 at 8:29 AM, Michael Potter wrote: > I have a Macbook pro question and I am asking it here because many of you > use Macbook pros. I searched the Apple forums for this and there is an > overwhelming number of opinions. The problem with searching the apple > forums is I want the opinions of my peers: people who use the Macbook pro to > develop code. I don't use Photoshop so the quality of viewing a photo does > not really matter to me. > > Anyway, here is my question: > Which is better for the way we work: Glossy or Matte screens? > > I am also going to the Apple Store to compare. But I am not sure that I > will get a fair comparison in the store. > > -- > Michael Potter > > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -- Sincerely, Joel Limardo Chief Software Engineer ForwardPhase Technologies, LLC 401 N. Michigan Avenue Suite 1200-10 Chicago, IL 60611 www.forwardphase.com joel.limardo at forwardphase.com LinkedIn: http://www.linkedin.com/in/joellimardo Twitter: http://twitter.com/joellimardo Fax: 815-346-9495 Ph : 877-321-5467 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon-chicagotalk at jrock.us Mon May 3 11:00:01 2010 From: jon-chicagotalk at jrock.us (Jonathan Rockway) Date: Mon, 03 May 2010 13:00:01 -0500 Subject: [Chicago-talk] Macbook pro question In-Reply-To: (Joel Limardo's message of "Mon, 3 May 2010 09:28:52 -0500") References: Message-ID: <87y6g0x3vi.fsf@snowball2.jrock.us> * On Mon, May 03 2010, Joel Limardo wrote: > I mean, who in the heck is writing all of these iPhone/iPad apps Not the people that are debating glossy vs. matte screens on Apple's forums. -- print just => another => perl => hacker => if $,=$" From cjhamil at gmail.com Mon May 3 11:08:58 2010 From: cjhamil at gmail.com (Chris Hamilton) Date: Mon, 3 May 2010 13:08:58 -0500 Subject: [Chicago-talk] Macbook pro question In-Reply-To: <87y6g0x3vi.fsf@snowball2.jrock.us> References: <87y6g0x3vi.fsf@snowball2.jrock.us> Message-ID: Unless you're primarily using your PC outdoors on sunny days it's probably not going to make much difference (and even in those cases it's difficult to see a matte screen anyway). Glossy screens generally look more vibrant, particularly when you don't have a bright light source directly behind your head. As stated above, it's really a matter of personal preference, I'd go somewhere and take a look at both screens side by side if you can, whichever one you think looks better is the correct answer. It's probably worth noting that not all glossy screens are created equal, either, I've definitely seen some that appear to handle reflections a lot better than others. -Chris On Mon, May 3, 2010 at 1:00 PM, Jonathan Rockway wrote: > * On Mon, May 03 2010, Joel Limardo wrote: > > I mean, who in the heck is writing all of these iPhone/iPad apps > > Not the people that are debating glossy vs. matte screens on Apple's > forums. > > -- > print just => another => perl => hacker => if $,=$" > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lembark at wrkhors.com Mon May 3 13:46:15 2010 From: lembark at wrkhors.com (Steven Lembark) Date: Mon, 3 May 2010 16:46:15 -0400 Subject: [Chicago-talk] Macbook pro question In-Reply-To: References: Message-ID: <20100503164615.4aaba8b6lembark@wrkhors.com@wrkhors.com> On Mon, 3 May 2010 09:29:36 -0400 Michael Potter wrote: > develop code. I don't use Photoshop so the quality of viewing a photo does > not really matter to me. > > Anyway, here is my question: > Which is better for the way we work: Glossy or Matte screens? > > I am also going to the Apple Store to compare. But I am not sure that I > will get a fair comparison in the store. Matte has fewer problems with reflections. ANY dust, scratches, snot, etc, on a glossy screen will be picked up immediately. I find the Matte screens also work quite nicely for images. This has nothing to do with macbooks in particular. -- Steven Lembark 85-09 90th St. Workhorse Computing Woodhaven, NY, 11421 lembark at wrkhors.com +1 888 359 3508 From michael at potter.name Mon May 3 16:36:26 2010 From: michael at potter.name (Michael Potter) Date: Mon, 3 May 2010 19:36:26 -0400 Subject: [Chicago-talk] Macbook pro question In-Reply-To: <8594544614390788254@unknownmsgid> References: <8594544614390788254@unknownmsgid> Message-ID: I just got back from the apple store: I am convinced to buy the matte screen. There was no position for the glossy screen that did not cause a reflection. There was no position for the matte screen that caused a reflection. Thanks for your comments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lembark at wrkhors.com Fri May 7 20:02:21 2010 From: lembark at wrkhors.com (Steven Lembark) Date: Fri, 7 May 2010 23:02:21 -0400 Subject: [Chicago-talk] Legal opinion from Chicago court of appeals Message-ID: <20100507230221.2fb5106flembark@wrkhors.com@wrkhors.com> Federal Court of Appeals in Chicago has detemined that 'a computer lets you make more mistakes faster than any invention in human history with the possible exceptions of handguns and tequila.' Or, perhaps, Java? -- Steven Lembark 85-09 90th St. Workhorse Computing Woodhaven, NY, 11421 lembark at wrkhors.com +1 888 359 3508 From tigerpeng2001 at yahoo.com Mon May 10 08:13:06 2010 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Mon, 10 May 2010 08:13:06 -0700 (PDT) Subject: [Chicago-talk] Not enough format arguments Message-ID: <353479.63501.qm@web58707.mail.re1.yahoo.com> Hello, ? I try to format the output as below with last couple of colmns being able to extend from 0 to any number of lines. If there is no data after 5th element, 'Not enough format arguments' warning message will be triggered. Is ther any simple way to make the format do not complain? ? Record1 12:30 98.40% 12 67.54% a(6) 77 80 ???????????????????????????????b(1) 56 54 ? format MFILE = @<<<<<<<<<<<<<@>>>>> @>>>>> @>>>>> @>>>>> @>>@>>>@>>>>>@>>>>> splice(@{$printArray[$ii]}, 0, 5),??????? splice(@{$printArray[$ii]}, 0, 4) if @{$printArray[$ii]}, ??????????????????????????????????????????@>>@>>>@>>>>>@>>>>> ~~ ????????????????????????????????????????? splice(@{$printArray[$ii]}, 0, 4) if @{$printArray[$ii]} -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andy_Bach at wiwb.uscourts.gov Mon May 10 09:34:14 2010 From: Andy_Bach at wiwb.uscourts.gov (Andy_Bach at wiwb.uscourts.gov) Date: Mon, 10 May 2010 11:34:14 -0500 Subject: [Chicago-talk] Not enough format arguments In-Reply-To: <353479.63501.qm@web58707.mail.re1.yahoo.com> References: <353479.63501.qm@web58707.mail.re1.yahoo.com> Message-ID: Not sure what exactly would be best (splice and numbers seems odd) but: splice(@{$printArray[$ii]}, 0, 4) if @{$printArray[$ii]} You could use the "pitchfork" ? : operator @{$printArray[$ii]} ? splice(@{$printArray[$ii]}, 0, 4) : 0 That is, a default of zero if the array is empty. a ---------------------- Andy Bach Systems Mangler Internet: andy_bach at wiwb.uscourts.gov Voice: (608) 261-5738; Cell: (608) 658-1890 Ducharme's Axiom: If you view your problem closely enough you will recognize yourself as part of the problem. From tigerpeng2001 at yahoo.com Mon May 10 12:35:05 2010 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Mon, 10 May 2010 12:35:05 -0700 (PDT) Subject: [Chicago-talk] Not enough format arguments In-Reply-To: References: <353479.63501.qm@web58707.mail.re1.yahoo.com> Message-ID: <27269.90040.qm@web58706.mail.re1.yahoo.com> Sorry, I? did not make the question clear. To make the question clearer, I simplifye it as below. #for a list of list @lol = (["a"], ["b", 1], ["c", 1,2], ['d', 1, 2, 3]); #I expet the output to be displaied like: #a #b????????? 1 #c????????? 1 #????????? ?2 #d????????? 1 #?????????? 2 #????????? ?3 foreach (@lol) { ? @ll = @$_; ? write FMFILE; } #format used: format FMFIEL = @> shift(@ll),?shift(@ll) if @ll, ??????????? @>> ~~ ??????????? shift(@ll) if @ll, . The question is when there is only one element in the sub-list, it will complain for the first and second line?of the format has not enough argument. I cheat it with: push @ll, '' if @==1; There is no complain for the first line noe, but it cannot make the second line quiet if there is only two elements, while?empty line?is not wanted in ?the output. ? As the @lol is very long, it makes a lot of noise; I do not like to turn off the warning, as it may cover other real issue. ________________________________ From: "Andy_Bach at wiwb.uscourts.gov" To: Chicago.pm chatter Sent: Mon, May 10, 2010 11:34:14 AM Subject: Re: [Chicago-talk] Not enough format arguments Not sure what exactly would be best (splice and numbers seems odd) but: splice(@{$printArray[$ii]}, 0, 4) if @{$printArray[$ii]} You could use the "pitchfork" ? : operator @{$printArray[$ii]} ? splice(@{$printArray[$ii]}, 0, 4) : 0 That is, a default of zero if the array is empty. a ---------------------- Andy Bach Systems Mangler Internet: andy_bach at wiwb.uscourts.gov Voice: (608) 261-5738; Cell: (608) 658-1890 Ducharme's Axiom: If you view your problem closely enough you will recognize yourself as part of the problem. _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.velox at vvelox.net Thu May 13 02:16:25 2010 From: v.velox at vvelox.net (Zane C.B.) Date: Thu, 13 May 2010 04:16:25 -0500 Subject: [Chicago-talk] Perl CMS suggestions Message-ID: <20100513041625.4fcd55ff@vixen42.vulpes.vvelox.net> Outside of Bricolage, any one have any suggestions on a Perl CMS that supports PostgreSQL? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 196 bytes Desc: not available URL: From younda at gmail.com Thu May 13 08:36:51 2010 From: younda at gmail.com (David Young) Date: Thu, 13 May 2010 10:36:51 -0500 Subject: [Chicago-talk] Perl CMS suggestions In-Reply-To: <20100513041625.4fcd55ff@vixen42.vulpes.vvelox.net> References: <20100513041625.4fcd55ff@vixen42.vulpes.vvelox.net> Message-ID: Take a look at WebGUI. www.webgui.org or plainblack.com. ydy On Thu, May 13, 2010 at 4:16 AM, Zane C.B. wrote: > Outside of Bricolage, any one have any suggestions on a Perl CMS that > supports PostgreSQL? > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.velox at vvelox.net Thu May 13 11:25:31 2010 From: v.velox at vvelox.net (Zane C.B.) Date: Thu, 13 May 2010 13:25:31 -0500 Subject: [Chicago-talk] Perl CMS suggestions In-Reply-To: References: <20100513041625.4fcd55ff@vixen42.vulpes.vvelox.net> Message-ID: <20100513132531.2d19860e@vixen42.vulpes.vvelox.net> On Thu, 13 May 2010 10:36:51 -0500 David Young wrote: > Take a look at WebGUI. www.webgui.org or plainblack.com. Nah, does not match one of the big requirements, supporting PostgreSQL. Unfortunately WebGUI went the direction of deciding to code it specifically MySQL. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 196 bytes Desc: not available URL: From joel.limardo at forwardphase.com Thu May 13 18:20:45 2010 From: joel.limardo at forwardphase.com (Joel Limardo) Date: Thu, 13 May 2010 20:20:45 -0500 Subject: [Chicago-talk] Perl CMS suggestions In-Reply-To: <20100513132531.2d19860e@vixen42.vulpes.vvelox.net> References: <20100513041625.4fcd55ff@vixen42.vulpes.vvelox.net> <20100513132531.2d19860e@vixen42.vulpes.vvelox.net> Message-ID: Here's an old post on Perlmonks with the same issue: http://www.perlmonks.org/?node_id=498079 I took a quick look and the only one I see that supports PostgreSQL is this one: http://www.cyclone3.org I've never used Cyclone, so I have no comment as to its functionality. On Thu, May 13, 2010 at 1:25 PM, Zane C.B. wrote: > On Thu, 13 May 2010 10:36:51 -0500 > David Young wrote: > > > Take a look at WebGUI. www.webgui.org or plainblack.com. > > Nah, does not match one of the big requirements, supporting > PostgreSQL. > > Unfortunately WebGUI went the direction of deciding to code it > specifically MySQL. > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -- Sincerely, Joel Limardo Chief Software Engineer ForwardPhase Technologies, LLC 401 N. Michigan Avenue Suite 1200-10 Chicago, IL 60611 www.forwardphase.com joel.limardo at forwardphase.com LinkedIn: http://www.linkedin.com/in/joellimardo Twitter: http://twitter.com/joellimardo Fax: 815-346-9495 Ph : 877-321-5467 -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshua.mcadams at gmail.com Fri May 14 19:34:14 2010 From: joshua.mcadams at gmail.com (Joshua) Date: Fri, 14 May 2010 21:34:14 -0500 Subject: [Chicago-talk] Fwd: [yapc] Early Bird Registration Ends Tomorrow In-Reply-To: References: Message-ID: FYI... ---------- Forwarded message ---------- From: Date: Fri, May 14, 2010 at 9:01 PM Subject: [yapc] Early Bird Registration Ends Tomorrow To: yapc at pm.org All: Early bird registration ends tomorrow so save yourself $10 and get that conference ticket purchased! ?Starting tomorrow your YAPC::NA Conference ticket will cost $100. Hope to see all of you next month! Heath Bair YAPC::NA 2010 Conference Chairman! _______________________________________________ yapc mailing list yapc at pm.org http://mail.pm.org/mailman/listinfo/yapc From amead2 at alanmead.org Mon May 17 14:25:10 2010 From: amead2 at alanmead.org (Alan Mead) Date: Mon, 17 May 2010 16:25:10 -0500 Subject: [Chicago-talk] Random first numbers Message-ID: <4BF1B436.6020409@alanmead.org> I have a CGI-based study coded in Perl that needs to randomly assign participants to conditions. The code below sucks: my @conditions = qw/cond1 cond2 cond3 cond4a/; shuffle(@conditions); $$state{'condition'} = $conditions[0]; I've just run through a dozen tests and cond3 appeared 90% of the time and cond2 10% of the time (cond1 and cond4a never appearing). I haven't run the numbers, but I think this is "statistically significant". I think my shuffle is a "good" one from the on-line Perl lore, but maybe I'm wrong: #---------------------------------------------------------- # Durstenfeld's implementation of Fisher and Yates #---------------------------------------------------------- sub shuffle { my $n = scalar @_; while ( $n > 0 ) { $n--; my $j = int rand $n; ($_[$j], $_[$n]) = ($_[$n], $_[$j]); # swap } } Assuming that shuffle() is not the culprit, I think it's just that when I run this code quickly/repeatedly, rand() is getting seeded with substantially the same value and is generating essentially the same initial value. If so, my question is whether there is a better way to generate random numbers (so that the first values are more random). I was wondering if anyone agreed/disagreed and whether anyone had a "lazy" solution... if not, I can enforce better randomness by keeping some sort of state in a database. -Alan -- Alan D. Mead, Ph.D. Assistant Professor of Industrial and Organization Psychology Scientific Advisor to the Center for Research and Service Illinois Institute of Technology 3101 South Dearborn, 2nd floor Chicago IL 60616 +312.567.5933 (Campus) +815.588.3846 (Home Office) +312.567.3493 (Fax) http://www.iit.edu/~mead http://www.center.iit.edu http://www.alanmead.org He who fights with monsters should be careful lest he thereby become a monster. -- Friedrich Nietzsche, "Beyond Good and Evil" From lee at laylward.com Mon May 17 14:49:40 2010 From: lee at laylward.com (Lee Aylward) Date: Mon, 17 May 2010 16:49:40 -0500 Subject: [Chicago-talk] Random first numbers In-Reply-To: <4BF1B436.6020409@alanmead.org> References: <4BF1B436.6020409@alanmead.org> Message-ID: <20100517164940.15bf78a2@hactar.servercentral.net> Hi, I typically use List::Util's shuffle function. I can't really say if it will give you better results, though. -- Lee On Mon, 17 May 2010 16:25:10 -0500 Alan Mead wrote: > I have a CGI-based study coded in Perl that needs to randomly assign > participants to conditions. The code below sucks: > > my @conditions = qw/cond1 cond2 cond3 cond4a/; > shuffle(@conditions); > $$state{'condition'} = $conditions[0]; > > I've just run through a dozen tests and cond3 appeared 90% of the > time and cond2 10% of the time (cond1 and cond4a never appearing). I > haven't run the numbers, but I think this is "statistically > significant". I think my shuffle is a "good" one from the on-line > Perl lore, but maybe I'm wrong: > > #---------------------------------------------------------- > # Durstenfeld's implementation of Fisher and Yates > #---------------------------------------------------------- > sub shuffle { > my $n = scalar @_; > while ( $n > 0 ) { > $n--; > my $j = int rand $n; > ($_[$j], $_[$n]) = ($_[$n], $_[$j]); # swap > } > } > > Assuming that shuffle() is not the culprit, I think it's just that > when I run this code quickly/repeatedly, rand() is getting seeded > with substantially the same value and is generating essentially the > same initial value. If so, my question is whether there is a better > way to generate random numbers (so that the first values are more > random). > > I was wondering if anyone agreed/disagreed and whether anyone had a > "lazy" solution... if not, I can enforce better randomness by keeping > some sort of state in a database. > > -Alan > From dean at serenevy.net Mon May 17 16:19:16 2010 From: dean at serenevy.net (Dean Serenevy) Date: Mon, 17 May 2010 19:19:16 -0400 Subject: [Chicago-talk] Random first numbers In-Reply-To: <4BF1B436.6020409@alanmead.org> References: <4BF1B436.6020409@alanmead.org> Message-ID: <4BF1CEF4.7070601@serenevy.net> On 05/17/2010 05:25 PM, Alan Mead wrote: > #---------------------------------------------------------- > # Durstenfeld's implementation of Fisher and Yates > #---------------------------------------------------------- > sub shuffle { > my $n = scalar @_; > while ( $n > 0 ) { > $n--; > my $j = int rand $n; > ($_[$j], $_[$n]) = ($_[$n], $_[$j]); # swap > } > } > > Assuming that shuffle() is not the culprit, I think it's just that when Bad assumption. That is not the Fisher-Yates shuffle. Try this (from perlfaq): sub shuffle { my $n = @_; while (--$n) { my $j = int rand ($n+1); @_[$n,$j] = @_[$j,$n]; } } Note that: * a no-op is possible in this version ($n may equal $j) * The last $n through the loop is 1 not 0 Good Day, Dean From amead2 at alanmead.org Mon May 17 16:29:51 2010 From: amead2 at alanmead.org (Alan Mead) Date: Mon, 17 May 2010 18:29:51 -0500 Subject: [Chicago-talk] Random first numbers In-Reply-To: <4BF1CEF4.7070601@serenevy.net> References: <4BF1B436.6020409@alanmead.org> <4BF1CEF4.7070601@serenevy.net> Message-ID: <4BF1D16F.9050707@alanmead.org> Dean Serenevy wrote: > On 05/17/2010 05:25 PM, Alan Mead wrote: > >> Assuming that shuffle() is not the culprit, I think it's just that when >> > > Bad assumption. That is not the Fisher-Yates shuffle. Try this (from perlfaq): > > sub shuffle { > my $n = @_; > while (--$n) { > my $j = int rand ($n+1); > @_[$n,$j] = @_[$j,$n]; > } > } > > Under light testing, this seems much better. Thanks! -Alan -- Alan D. Mead, Ph.D. Assistant Professor of Industrial and Organization Psychology Scientific Advisor to the Center for Research and Service Illinois Institute of Technology 3101 South Dearborn, 2nd floor Chicago IL 60616 +312.567.5933 (Campus) +815.588.3846 (Home Office) +312.567.3493 (Fax) http://www.iit.edu/~mead http://www.center.iit.edu http://www.alanmead.org He who fights with monsters should be careful lest he thereby become a monster. -- Friedrich Nietzsche, "Beyond Good and Evil" -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at petdance.com Mon May 17 17:05:40 2010 From: andy at petdance.com (Andy Lester) Date: Mon, 17 May 2010 19:05:40 -0500 Subject: [Chicago-talk] Random first numbers In-Reply-To: <4BF1CEF4.7070601@serenevy.net> References: <4BF1B436.6020409@alanmead.org> <4BF1CEF4.7070601@serenevy.net> Message-ID: On May 17, 2010, at 6:19 PM, Dean Serenevy wrote: > Bad assumption. That is not the Fisher-Yates shuffle. Try this (from perlfaq): Rather than replicating code, use the one in List::Util which is included with Perl itself since 5.7.3. $ corelist List::Util List::Util was first released with perl 5.007003 -- Andy Lester => andy at petdance.com => www.theworkinggeek.com => AIM:petdance From crap at mooresystems.com Mon May 17 17:11:36 2010 From: crap at mooresystems.com (Andrew Moore) Date: Mon, 17 May 2010 19:11:36 -0500 Subject: [Chicago-talk] Random first numbers In-Reply-To: <4BF1B436.6020409@alanmead.org> References: <4BF1B436.6020409@alanmead.org> Message-ID: On Mon, May 17, 2010 at 4:25 PM, Alan Mead wrote: > I have a CGI-based study coded in Perl that needs to randomly assign > participants to conditions. ?The code below sucks: > > ?my @conditions = qw/cond1 cond2 cond3 cond4a/; > ?shuffle(@conditions); > ?$$state{'condition'} = $conditions[0]; Is it necessary to shuffle the entire array when you seem to only want a random element? $state->{condition} = $conditions[ rand @conditions ]; Perhaps it is, and the justification wasn't shown, but sometimes I do needless work myself, so I thought I'd check. Cheers, -Andy From bdoty at eqtc.com Thu May 20 08:51:56 2010 From: bdoty at eqtc.com (Brad Doty) Date: Thu, 20 May 2010 10:51:56 -0500 Subject: [Chicago-talk] PERL mortgage In-Reply-To: References: Message-ID: <1274370716.11062.119.camel@bdoty01.eqtc.local> OK, what party within the Perl community went and opened a mortgage broker? http://www.perlmortgage.com/bankrate/landing/index2.html Thanks, bRad -----Original Message----- From: chicago-talk-request at pm.org Reply-to: chicago-talk at pm.org To: chicago-talk at pm.org Subject: Chicago-talk Digest, Vol 82, Issue 9 Date: Tue, 18 May 2010 12:00:29 -0700 Send Chicago-talk mailing list submissions to chicago-talk at pm.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.pm.org/mailman/listinfo/chicago-talk or, via email, send a message with subject or body 'help' to chicago-talk-request at pm.org You can reach the person managing the list at chicago-talk-owner at pm.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Chicago-talk digest..." Today's Topics: 1. Random first numbers (Alan Mead) 2. Re: Random first numbers (Lee Aylward) 3. Re: Random first numbers (Dean Serenevy) 4. Re: Random first numbers (Alan Mead) 5. Re: Random first numbers (Andy Lester) 6. Re: Random first numbers (Andrew Moore) ---------------------------------------------------------------------- Message: 1 Date: Mon, 17 May 2010 16:25:10 -0500 From: Alan Mead Subject: [Chicago-talk] Random first numbers To: "Chicago.pm chatter" Message-ID: <4BF1B436.6020409 at alanmead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed I have a CGI-based study coded in Perl that needs to randomly assign participants to conditions. The code below sucks: my @conditions = qw/cond1 cond2 cond3 cond4a/; shuffle(@conditions); $$state{'condition'} = $conditions[0]; I've just run through a dozen tests and cond3 appeared 90% of the time and cond2 10% of the time (cond1 and cond4a never appearing). I haven't run the numbers, but I think this is "statistically significant". I think my shuffle is a "good" one from the on-line Perl lore, but maybe I'm wrong: #---------------------------------------------------------- # Durstenfeld's implementation of Fisher and Yates #---------------------------------------------------------- sub shuffle { my $n = scalar @_; while ( $n > 0 ) { $n--; my $j = int rand $n; ($_[$j], $_[$n]) = ($_[$n], $_[$j]); # swap } } Assuming that shuffle() is not the culprit, I think it's just that when I run this code quickly/repeatedly, rand() is getting seeded with substantially the same value and is generating essentially the same initial value. If so, my question is whether there is a better way to generate random numbers (so that the first values are more random). I was wondering if anyone agreed/disagreed and whether anyone had a "lazy" solution... if not, I can enforce better randomness by keeping some sort of state in a database. -Alan -- Alan D. Mead, Ph.D. Assistant Professor of Industrial and Organization Psychology Scientific Advisor to the Center for Research and Service Illinois Institute of Technology 3101 South Dearborn, 2nd floor Chicago IL 60616 +312.567.5933 (Campus) +815.588.3846 (Home Office) +312.567.3493 (Fax) http://www.iit.edu/~mead http://www.center.iit.edu http://www.alanmead.org He who fights with monsters should be careful lest he thereby become a monster. -- Friedrich Nietzsche, "Beyond Good and Evil" ------------------------------ Message: 2 Date: Mon, 17 May 2010 16:49:40 -0500 From: Lee Aylward Subject: Re: [Chicago-talk] Random first numbers To: chicago-talk at pm.org Message-ID: <20100517164940.15bf78a2 at hactar.servercentral.net> Content-Type: text/plain; charset=US-ASCII Hi, I typically use List::Util's shuffle function. I can't really say if it will give you better results, though. -- Lee On Mon, 17 May 2010 16:25:10 -0500 Alan Mead wrote: > I have a CGI-based study coded in Perl that needs to randomly assign > participants to conditions. The code below sucks: > > my @conditions = qw/cond1 cond2 cond3 cond4a/; > shuffle(@conditions); > $$state{'condition'} = $conditions[0]; > > I've just run through a dozen tests and cond3 appeared 90% of the > time and cond2 10% of the time (cond1 and cond4a never appearing). I > haven't run the numbers, but I think this is "statistically > significant". I think my shuffle is a "good" one from the on-line > Perl lore, but maybe I'm wrong: > > #---------------------------------------------------------- > # Durstenfeld's implementation of Fisher and Yates > #---------------------------------------------------------- > sub shuffle { > my $n = scalar @_; > while ( $n > 0 ) { > $n--; > my $j = int rand $n; > ($_[$j], $_[$n]) = ($_[$n], $_[$j]); # swap > } > } > > Assuming that shuffle() is not the culprit, I think it's just that > when I run this code quickly/repeatedly, rand() is getting seeded > with substantially the same value and is generating essentially the > same initial value. If so, my question is whether there is a better > way to generate random numbers (so that the first values are more > random). > > I was wondering if anyone agreed/disagreed and whether anyone had a > "lazy" solution... if not, I can enforce better randomness by keeping > some sort of state in a database. > > -Alan > ------------------------------ Message: 3 Date: Mon, 17 May 2010 19:19:16 -0400 From: Dean Serenevy Subject: Re: [Chicago-talk] Random first numbers To: "Chicago.pm chatter" Message-ID: <4BF1CEF4.7070601 at serenevy.net> Content-Type: text/plain; charset=UTF-8 On 05/17/2010 05:25 PM, Alan Mead wrote: > #---------------------------------------------------------- > # Durstenfeld's implementation of Fisher and Yates > #---------------------------------------------------------- > sub shuffle { > my $n = scalar @_; > while ( $n > 0 ) { > $n--; > my $j = int rand $n; > ($_[$j], $_[$n]) = ($_[$n], $_[$j]); # swap > } > } > > Assuming that shuffle() is not the culprit, I think it's just that when Bad assumption. That is not the Fisher-Yates shuffle. Try this (from perlfaq): sub shuffle { my $n = @_; while (--$n) { my $j = int rand ($n+1); @_[$n,$j] = @_[$j,$n]; } } Note that: * a no-op is possible in this version ($n may equal $j) * The last $n through the loop is 1 not 0 Good Day, Dean ------------------------------ Message: 4 Date: Mon, 17 May 2010 18:29:51 -0500 From: Alan Mead Subject: Re: [Chicago-talk] Random first numbers To: "Chicago.pm chatter" Message-ID: <4BF1D16F.9050707 at alanmead.org> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Dean Serenevy wrote: > On 05/17/2010 05:25 PM, Alan Mead wrote: > >> Assuming that shuffle() is not the culprit, I think it's just that when >> > > Bad assumption. That is not the Fisher-Yates shuffle. Try this (from perlfaq): > > sub shuffle { > my $n = @_; > while (--$n) { > my $j = int rand ($n+1); > @_[$n,$j] = @_[$j,$n]; > } > } > > Under light testing, this seems much better. Thanks! -Alan From briank at kappacs.com Thu May 20 09:09:46 2010 From: briank at kappacs.com (Brian Katzung) Date: Thu, 20 May 2010 11:09:46 -0500 Subject: [Chicago-talk] PERL mortgage In-Reply-To: <1274370716.11062.119.camel@bdoty01.eqtc.local> References: <1274370716.11062.119.camel@bdoty01.eqtc.local> Message-ID: <4BF55ECA.1030707@kappacs.com> And then had the audacity to create their web site using PHP! Sheesh! Is nothing sacred any more? - Brian On 2010-05-20 10:51, Brad Doty wrote: > OK, what party within the Perl community went and opened a mortgage > broker? > > http://www.perlmortgage.com/bankrate/landing/index2.html > > > Thanks, > > bRad > -- Brian Katzung, Kappa Computer Solutions, LLC Leveraging UNIX, GNU/Linux, open source, and custom software solutions for business and beyond Phone: 877.367.8837 x1 http://www.kappacs.com From zrusilla at mac.com Thu May 20 14:00:52 2010 From: zrusilla at mac.com (Elizabeth Cortell) Date: Thu, 20 May 2010 14:00:52 -0700 Subject: [Chicago-talk] PERL mortgage In-Reply-To: <1274370716.11062.119.camel@bdoty01.eqtc.local> References: <1274370716.11062.119.camel@bdoty01.eqtc.local> Message-ID: <146656751960436463536239295444272123603-Webmail@me.com> Is it located next to Cafe Perl? http://www.cafeperl.com/ On Thursday, May 20, 2010, at 08:51AM, "Brad Doty" wrote: >OK, what party within the Perl community went and opened a mortgage >broker? > >http://www.perlmortgage.com/bankrate/landing/index2.html > From merlyn at stonehenge.com Thu May 20 14:13:34 2010 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Thu, 20 May 2010 14:13:34 -0700 Subject: [Chicago-talk] PERL mortgage In-Reply-To: <146656751960436463536239295444272123603-Webmail@me.com> (Elizabeth Cortell's message of "Thu, 20 May 2010 14:00:52 -0700") References: <1274370716.11062.119.camel@bdoty01.eqtc.local> <146656751960436463536239295444272123603-Webmail@me.com> Message-ID: <86k4qyi8e9.fsf@red.stonehenge.com> >>>>> "Elizabeth" == Elizabeth Cortell writes: Elizabeth> Is it located next to Cafe Perl? Elizabeth> http://www.cafeperl.com/ Or has it made any donations to PERLofBurlington.org ? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion From Andy_Bach at wiwb.uscourts.gov Thu May 20 14:18:33 2010 From: Andy_Bach at wiwb.uscourts.gov (Andy_Bach at wiwb.uscourts.gov) Date: Thu, 20 May 2010 16:18:33 -0500 Subject: [Chicago-talk] PERL mortgage In-Reply-To: <146656751960436463536239295444272123603-Webmail@me.com> References: <1274370716.11062.119.camel@bdoty01.eqtc.local> <146656751960436463536239295444272123603-Webmail@me.com> Message-ID: > Is it located next to Cafe Perl? http://www.cafeperl.com/ Probably, as when you go to: http://www.cafeperl.com/infos.php you see: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'cafeperl.com'@'88.191.253.148' (using password: YES) in log.inc.php on line 7 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in log.inc.php on line 8 Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in infos.php on line 4 Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in infos.php on line 5 Warning: mysql_result(): supplied argument is not a valid MySQL result resource in infos.php on line 7 Warning: mysql_result(): supplied argument is not a valid MySQL result resource in infos.php on line 8 Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in infos.php on line 10 Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in infos.php on line 11 Warning: mysql_result(): supplied argument is not a valid MySQL result resource in infos.php on line 93 Warning: mysql_result(): supplied argument is not a valid MySQL result resource in infos.php on line 94 Warning: getimagesize() [function.getimagesize]: Read error! in infos.php on line 95 ---------------------- Andy Bach Systems Mangler Internet: andy_bach at wiwb.uscourts.gov Voice: (608) 261-5738; Cell: (608) 658-1890 Ducharme's Axiom: If you view your problem closely enough you will recognize yourself as part of the problem. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Darren.Young at chicagobooth.edu Thu May 20 14:24:06 2010 From: Darren.Young at chicagobooth.edu (Young, Darren) Date: Thu, 20 May 2010 16:24:06 -0500 Subject: [Chicago-talk] PERL mortgage In-Reply-To: References: <1274370716.11062.119.camel@bdoty01.eqtc.local><146656751960436463536239295444272123603-Webmail@me.com> Message-ID: <07A371D457B501478C1DB3C3DE8372D7062AB69D@GSBHEX2V.gsb.uchicago.edu> > Probably, as when you go to: > http://www.cafeperl.com/infos.php > > you see: > Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'cafeperl.com'@'88.191.253.148' >(using password: YES) in log.inc.php on line 7 > Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in log.inc.php on line 8 > Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in infos.php on line 4 > Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in infos.php on line 5 > Warning: mysql_result(): supplied argument is not a valid MySQL result resource in infos.php on line 7 > Warning: mysql_result(): supplied argument is not a valid MySQL result resource in infos.php on line 8 > Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in infos.php on line 10 > Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in infos.php on line 11 > Warning: mysql_result(): supplied argument is not a valid MySQL result resource in infos.php on line 93 > Warning: mysql_result(): supplied argument is not a valid MySQL result resource in infos.php on line 94 > Warning: getimagesize() [function.getimagesize]: Read error! in infos.php on line 95 I knew it. PHP does in fact have it in for Perl. From me at heyjay.com Thu May 20 18:52:39 2010 From: me at heyjay.com (Jay Strauss) Date: Thu, 20 May 2010 20:52:39 -0500 Subject: [Chicago-talk] PERL mortgage In-Reply-To: <07A371D457B501478C1DB3C3DE8372D7062AB69D@GSBHEX2V.gsb.uchicago.edu> References: <1274370716.11062.119.camel@bdoty01.eqtc.local> <146656751960436463536239295444272123603-Webmail@me.com> <07A371D457B501478C1DB3C3DE8372D7062AB69D@GSBHEX2V.gsb.uchicago.edu> Message-ID: While I know the OP was just joking around. But I believe the founder's last name is Perlmutter. Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From lembark at wrkhors.com Fri May 21 10:31:17 2010 From: lembark at wrkhors.com (Steven Lembark) Date: Fri, 21 May 2010 13:31:17 -0400 Subject: [Chicago-talk] Random first numbers In-Reply-To: <4BF1D16F.9050707@alanmead.org> References: <4BF1B436.6020409@alanmead.org> <4BF1CEF4.7070601@serenevy.net> <4BF1D16F.9050707@alanmead.org> Message-ID: <20100521133117.43ec1d5elembark@wrkhors.com@wrkhors.com> On Mon, 17 May 2010 18:29:51 -0500 Alan Mead wrote: > Dean Serenevy wrote: > > On 05/17/2010 05:25 PM, Alan Mead wrote: > > > >> Assuming that shuffle() is not the culprit, I think it's just that when > >> > > > > Bad assumption. That is not the Fisher-Yates shuffle. Try this (from perlfaq): > > > > sub shuffle { > > my $n = @_; > > while (--$n) { > > my $j = int rand ($n+1); > > @_[$n,$j] = @_[$j,$n]; > > } > > } > > > > > > Under light testing, this seems much better. Thanks! sub shuffle { map { splice @_, rand @_, 1 } ( 1 .. @_ ) } -- Steven Lembark 85-09 90th St. Workhorse Computing Woodhaven, NY, 11421 lembark at wrkhors.com +1 888 359 3508 From brian.d.foy at gmail.com Tue May 25 11:18:51 2010 From: brian.d.foy at gmail.com (brian d foy) Date: Tue, 25 May 2010 13:18:51 -0500 Subject: [Chicago-talk] Rock Bottom tonight, with real copies of Effective Perl Programming Message-ID: It's a nice day and it's a Tuesday, so I'm guessing the roof patio at Rock Bottom won't be insane like last time. Come out and have a drink with us at 7ish. Josh and I have copies of Effective Perl Programming. Some of you helped with the book so I have your free (signed) copy now. You can pick it up at Rock Bottom (and I'll buy you a drink :). -- brian d foy http://www.pair.com/~comdog/ From hwigoda at mindspring.com Tue May 25 12:51:35 2010 From: hwigoda at mindspring.com (Hal Wigoda) Date: Tue, 25 May 2010 14:51:35 -0500 Subject: [Chicago-talk] Rock Bottom tonight, with real copies of Effective Perl Programming In-Reply-To: References: Message-ID: Damn. I was a the Restaurant Show. May have a customer for an iPhone app. On May 25, 2010, at 1:18 PM, brian d foy wrote: > It's a nice day and it's a Tuesday, so I'm guessing the roof patio at > Rock Bottom won't be insane like last time. Come out and have a drink > with us at 7ish. > > Josh and I have copies of Effective Perl Programming. Some of you > helped with the book so I have your free (signed) copy now. You can > pick it up at Rock Bottom (and I'll buy you a drink :). > > -- > brian d foy > http://www.pair.com/~comdog/ > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk From sean at blanton.com Thu May 27 06:43:05 2010 From: sean at blanton.com (Sean Blanton) Date: Thu, 27 May 2010 08:43:05 -0500 Subject: [Chicago-talk] Rock Bottom tonight, with real copies of Effective Perl Programming In-Reply-To: References: Message-ID: I'll look forward to the next get together. Missed the last several... Sean On Tue, May 25, 2010 at 2:51 PM, Hal Wigoda wrote: > Damn. > > I was a the Restaurant Show. > > May have a customer for an iPhone app. > > > On May 25, 2010, at 1:18 PM, brian d foy wrote: > > > It's a nice day and it's a Tuesday, so I'm guessing the roof patio at > > Rock Bottom won't be insane like last time. Come out and have a drink > > with us at 7ish. > > > > Josh and I have copies of Effective Perl Programming. Some of you > > helped with the book so I have your free (signed) copy now. You can > > pick it up at Rock Bottom (and I'll buy you a drink :). > > > > -- > > brian d foy > > http://www.pair.com/~comdog/ > > _______________________________________________ > > Chicago-talk mailing list > > Chicago-talk at pm.org > > http://mail.pm.org/mailman/listinfo/chicago-talk > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: