From darren at DarrenDuncan.net Thu Feb 1 17:09:17 2007 From: darren at DarrenDuncan.net (Darren Duncan) Date: Thu, 1 Feb 2007 17:09:17 -0800 Subject: [VPM] Tue, 2007 Feb 6th, 7:00PM - February RCSS meeting Message-ID: Forwarded from the "Recreational Computer Science Society" mailing list. -- Darren Duncan ------------- Date: Thu, 1 Feb 2007 09:37:18 -0800 From: "Peter van Hardenberg" To: reccompsci at googlegroups.com Subject: [reccompsci] Meeting Announcement: February 6th, 7:00PM List-Id: List-Post: List-Help: List-Unsubscribe: , Location: -- UVic, Engineering and Computer Science Building, Ground Floor, first lecture hall to your right as you enter from the in-campus side of the building. (The usual.) Topics: -- *Implicit Surfaces (Guest Speaker: Dr. Brian Wyvill) Dr. Wyvill, one of UVic CSC's most recent faculty additions, will be talking about his research into implicit surfaces. His project is a way to describe a 3d shape as a series of transforms to a base shape which eventually produces a final model. His scheme is known as blobTree and plenty of examples and images can be found by searching for that on Google and at his webpage. *Compression Algorithms (Open Forum: Sergei Popov) Sergei will, a particular focus on general purpose compression algorithms, introduce the field in broad strokes by outlining a few of the more common algorithms. From there, the floor will open up to discussion. *Application Widget Toolkits (Open Forum: Sunpreet Jassal) With a focus on the C++ widget toolkit Qt, Sunpreet will open the discussion to topics of application interface design. What widget sets are better, which are worse, and why are they all so damn same-y after all these years? Notes: -- This month's RCSS meeting will be a slightly different format from the last few months. We will still have a guest presenter in the form of Brian Wyvill, but the actual presentations will be less presentious* and more a chance to pool our collective knowledge. Personally, I'm excited as can be about this -- I trying to explain to a group things they know more than me about. Angela is working on a RCSS webpage, as those of you who follow the general mailing list may have noticed. Hopefully it will be online by the next meeting. If you have specific requests related to that, there is an ongoing thread. There is a Victoria Ruby Language group starting up these days. If you are, or want to be, a Rubinista* watch this space for an official group announcement. The first meeting will be some time in the next few weeks. -pvh * inventing words is a time-honored tradition and one of my favorite hobbies -- Peter van Hardenberg Victoria, BC, Canada "Everything was beautiful, and nothing hurt." -- Kurt Vonnegut From darren at DarrenDuncan.net Sun Feb 11 15:24:36 2007 From: darren at DarrenDuncan.net (Darren Duncan) Date: Sun, 11 Feb 2007 15:24:36 -0800 Subject: [VPM] probe Message-ID: this is a test of the vpm list From jeremygwa at hotmail.com Sun Feb 11 15:27:31 2007 From: jeremygwa at hotmail.com (Jer A) Date: Sun, 11 Feb 2007 15:27:31 -0800 Subject: [VPM] programmically create keys and vals for anonhash Message-ID: Darren is redirecting this to the list, as my own probe succeeded. ------------------ Hello Darren, I am resending you this message directly, as there is something wrong with the perl mailing-list. ------------------- Hi All, how do i programmically create a hash ref, without having to code the key and value pairs? eg. $data = {Key1 => $val1,Key2 => $val2,Key3 => $val3} ; suppose I create an Array with key and value pairs,....the number of keys and values are only known at run time. eg. push(@HEADERS,{ KEYNAME => $1, KEYVAL => $2}); With the information in @HEADERS, how do I use this to create a hashref, with as many key/val pairs in the array, without manually coding it? $data = { "KEY" => "VAL", ... etc }; Thanks in advance for your help. -Jer A. From abez at abez.ca Sun Feb 11 15:39:20 2007 From: abez at abez.ca (Abram Hindle) Date: Sun, 11 Feb 2007 18:39:20 -0500 Subject: [VPM] programmically create keys and vals for anonhash In-Reply-To: References: Message-ID: <45CFA928.905@abez.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 You can convert an array or list to hash just by assigning it: %hash = qw( key1 value1 key2 value2 key3 value3); Hashes can be formed from lists and array of an even number of elements where keys and values alternate. $hash{$1} = $2; #works push @headers,$1,$2; #works ... %hash = @headers; see perldoc perldsc abram Jer A (by way of Darren Duncan) wrote: > Darren is redirecting this to the list, as my own probe succeeded. > ------------------ > > Hello Darren, I am resending you this message directly, as there is > something wrong with the perl mailing-list. > > ------------------- > Hi All, > > how do i programmically create a hash ref, without having to code the > key and value pairs? > eg. $data = {Key1 => $val1,Key2 => $val2,Key3 => $val3} ; > suppose I create an Array with key and value pairs,....the number of > keys and values are only known at run time. > eg. > push(@HEADERS,{ KEYNAME => $1, KEYVAL => $2}); > > With the information in @HEADERS, how do I use this to create a > hashref, with as many key/val pairs in the array, without manually > coding it? > > $data = { "KEY" => "VAL", ... etc }; > > > Thanks in advance for your help. > > -Jer A. > _______________________________________________ > Victoria-pm mailing list > Victoria-pm at pm.org > http://mail.pm.org/mailman/listinfo/victoria-pm > > > ** ACCEPT: CRM114 PASS osb unique microgroom Matcher ** > CLASSIFY succeeds; success probability: 1.0000 pR: 34.7366 > Best match to file #0 (/home/abez/crm/nonspam.css) prob: 1.0000 pR: 34.7366 > Total features in input file: 3312 > #0 (/home/abez/crm/nonspam.css): features: 378059, hits: 4066312, prob: 1.00e+00, pR: 34.74 > #1 (/home/abez/crm/spam.css): features: 2082284, hits: 3381458, prob: 1.83e-35, pR: -34.74 > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFz6konOrfa1yW8IURApEOAKCowGUmzAUgsc9FzOVy3nSstE4H8wCggIz/ RZQKC2JTRJpTQ/87wSVrmXo= =RX5T -----END PGP SIGNATURE----- From abez at abez.ca Sun Feb 11 18:13:57 2007 From: abez at abez.ca (Abram Hindle) Date: Sun, 11 Feb 2007 21:13:57 -0500 Subject: [VPM] programmically create keys and vals for anonhash In-Reply-To: References: Message-ID: <45CFCD65.2010804@abez.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 $hash = { qw( ... ) } ; $hash = { @tuple_array }; %hash = qw( ... ); $hash = \%hash; $hash = { %hash }; push @arr, \%hash; push @arr, { %hash }; Those should all work unless I forgot something, either way see perldoc perlref for more info. abram Jer A wrote: > thank you Abram for your response. > > if I can create a hash like you say: > %hash = qw( key1 value1 key2 value2 key3 value3); > can I still access the hash with a pointer "->", if the entire %hash > were an element in an array? > eg. > foreach(@arr) > { > ... $_->{key1} etc? > } > > Thanks in advance, > -Jer A. > >> From: Abram Hindle >> To: "\"Jer A\" (by way of Darren Duncan)" >> , victoria-pm at pm.org >> Subject: Re: [VPM] programmically create keys and vals for anonhash >> Date: Sun, 11 Feb 2007 18:39:20 -0500 >> > You can convert an array or list to hash just by assigning it: > > %hash = qw( key1 value1 key2 value2 key3 value3); > > Hashes can be formed from lists and array of an even number of elements > where keys and values alternate. > > $hash{$1} = $2; #works > > push @headers,$1,$2; #works > ... > %hash = @headers; > > see perldoc perldsc > > abram > > Jer A (by way of Darren Duncan) wrote: >> Darren is redirecting this to the list, as my own probe succeeded. >> ------------------ > >> Hello Darren, I am resending you this message directly, as there is >> something wrong with the perl mailing-list. > >> ------------------- >> Hi All, > >> how do i programmically create a hash ref, without having to code the >> key and value pairs? >> eg. $data = {Key1 => $val1,Key2 => $val2,Key3 => $val3} ; >> suppose I create an Array with key and value pairs,....the number of >> keys and values are only known at run time. >> eg. >> push(@HEADERS,{ KEYNAME => $1, KEYVAL => $2}); > >> With the information in @HEADERS, how do I use this to create a >> hashref, with as many key/val pairs in the array, without manually >> coding it? > >> $data = { "KEY" => "VAL", ... etc }; > > >> Thanks in advance for your help. > >> -Jer A. >> _______________________________________________ >> Victoria-pm mailing list >> Victoria-pm at pm.org >> http://mail.pm.org/mailman/listinfo/victoria-pm > > >> ** ACCEPT: CRM114 PASS osb unique microgroom Matcher ** >> CLASSIFY succeeds; success probability: 1.0000 pR: 34.7366 >> Best match to file #0 (/home/abez/crm/nonspam.css) prob: 1.0000 pR: > 34.7366 >> Total features in input file: 3312 >> #0 (/home/abez/crm/nonspam.css): features: 378059, hits: 4066312, > prob: 1.00e+00, pR: 34.74 >> #1 (/home/abez/crm/spam.css): features: 2082284, hits: 3381458, > prob: 1.83e-35, pR: -34.74 > > > _________________________________________________________________ > Buy what you want when you want it on Sympatico / MSN Shopping > http://shopping.sympatico.msn.ca/content/shp/?ctId=2,ptnrid=176,ptnrdata=081805 > ** ACCEPT: CRM114 PASS osb unique microgroom Matcher ** CLASSIFY > succeeds; success probability: 1.0000 pR: 24.1569 > Best match to file #0 (/home/abez/crm/nonspam.css) prob: 1.0000 pR: > 24.1569 Total features in input file: 5208 > #0 (/home/abez/crm/nonspam.css): features: 378059, hits: 7129858, prob: > 1.00e+00, pR: 24.16 #1 (/home/abez/crm/spam.css): features: 2082284, > hits: 4957360, prob: 6.97e-25, pR: -24.16 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFz81lnOrfa1yW8IURAgnTAJ9ddfShGm3AEbWOx1zLeciPPmK89ACfcvHt Tf4Nhg/ASMwFBNXwayI1WFo= =lAa7 -----END PGP SIGNATURE----- From Peter at PSDT.com Mon Feb 12 10:04:27 2007 From: Peter at PSDT.com (Peter Scott) Date: Mon, 12 Feb 2007 10:04:27 -0800 Subject: [VPM] programmically create keys and vals for anonhash In-Reply-To: References: Message-ID: <6.2.3.4.2.20070212100117.02802b40@mail.webquarry.com> At 03:27 PM 2/11/2007, Jer A wrote: >how do i programmically create a hash ref, without having to code the >key and value pairs? >eg. $data = {Key1 => $val1,Key2 => $val2,Key3 => $val3} ; >suppose I create an Array with key and value pairs,....the number of >keys and values are only known at run time. >eg. >push(@HEADERS,{ KEYNAME => $1, KEYVAL => $2}); ^ makes hashref ^ >With the information in @HEADERS, how do I use this to create a >hashref, with as many key/val pairs in the array, without manually >coding it? > >$data = { "KEY" => "VAL", ... etc }; So @HEADERS contains hashrefs and you want to flatten them into a hashref containing all of their contents, is that it? $data = { map %$_, @HEADERS }; -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ http://www.perlmedic.com/ From Peter at PSDT.com Mon Feb 12 10:26:00 2007 From: Peter at PSDT.com (Peter Scott) Date: Mon, 12 Feb 2007 10:26:00 -0800 Subject: [VPM] Victoria Perl Mongers meeting February 20 Message-ID: <6.2.3.4.2.20070205102522.02754e40@mail.webquarry.com> Victoria.pm will meet at its regular date, time, and place at 7:00 pm on Tuesday, February 20, at UVic in ECS (Engineering Computer Science building) room 660 (see http://www.uvic.ca/maps/index.html). The theme: "Everything you wanted to know about arrays and hashes but were afraid to ask." I will deliver presentations that return to some basics as requested by survey respondees. The topics for this meeting will be: Array operations Introduction to hashes While aimed at the beginner, there will be a few things calculated to interest more knowledgeable users, and the opportunity to ask any type of question. The primary customer of this presentation remains the novice, even people with no Perl experience at all. Fresh meat welcome :-) And a free copy of the Fall Perl Review to a random attendee. [This was to have been the topic for the January meeting, which was cancelled due to weather and road conditions.] (Courtesy copy to VLUG and VOSSOC members by permission of the list managers. Victoria.pm's home page is .) -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ http://www.perlmedic.com/ From Peter at PSDT.com Mon Feb 19 01:27:00 2007 From: Peter at PSDT.com (Peter Scott) Date: Mon, 19 Feb 2007 01:27:00 -0800 Subject: [VPM] Victoria Perl Mongers meeting tomorrow Message-ID: <6.2.3.4.2.20070205102656.0264e020@mail.webquarry.com> Victoria.pm will meet at its regular date, time, and place at 7:00 pm tomorrow, Tuesday, February 20, at UVic in ECS (Engineering Computer Science building) room 660 (see http://www.uvic.ca/maps/index.html). The theme: "Everything you wanted to know about arrays and hashes but were afraid to ask." I will deliver presentations that return to some basics as requested by survey respondees. The topics for this meeting will be: Array operations Introduction to hashes While aimed at the beginner, there will be a few things calculated to interest more knowledgeable users, and the opportunity to ask any type of question. The primary customer of this presentation remains the novice, even people with no Perl experience at all. Fresh meat welcome :-) And a free copy of the Fall Perl Review to a random attendee. [This was to have been the topic for the January meeting, which was cancelled due to weather and road conditions.] (Courtesy copy to VLUG and VOSSOC members by permission of the list managers. Victoria.pm's home page is .) -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ http://www.perlmedic.com/ From Peter at PSDT.com Tue Feb 20 14:36:57 2007 From: Peter at PSDT.com (Peter Scott) Date: Tue, 20 Feb 2007 14:36:57 -0800 Subject: [VPM] Perl's place in the universe Message-ID: <6.2.3.4.2.20070220143526.027b2a78@mail.webquarry.com> http://imgs.xkcd.com/comics/lisp.jpg See you tonight! -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ http://www.perlmedic.com/