<?xml version="1.0" encoding="UTF-8"?>



<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">

    <channel>
        <title>scratchpad</title>
        <link>http://prlmnks.org/list/</link>
        <description>RSS feeds from perlmonks.org</description>
        <language>en</language>
        <ttl>5</ttl>

        

<item>
    <title>wjw&#39;s scratchpad (wjw)</title>
    <link>http://prlmnks.org/html/581024.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/581024.html</guid>

    <description>
        Will have to put something here.. perhaps when I have an itch...
    </description>
</item>

        

<item>
    <title>adrianxw&#39;s scratchpad (adrianxw)</title>
    <link>http://prlmnks.org/html/580899.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/580899.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>nishanth_ev&#39;s scratchpad (nishanth_ev)</title>
    <link>http://prlmnks.org/html/580702.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/580702.html</guid>

    <description>
        &lt;b&gt; my $deployed_sql = &lt;&lt;__SQL__;&lt;/b&gt;&lt;br&gt;SELECT&lt;/br&gt;   &lt;br&gt;n7.NODE_PATH_NAME,&lt;/br&gt;   &lt;br&gt;n2.NODE_PATH_NAME,&lt;/br&gt;   &lt;br&gt;ROUND( ( (  sum(sw.SOFTWARE_FILE_SIZE) / 1024 ) /1024), 1),&lt;/br&gt;   &lt;br&gt;sw.SOFTWARE_DISPLAY_NAME&lt;/br&gt;   &lt;br&gt;FROM&lt;/br&gt;      &lt;br&gt;NODES n1,&lt;/br&gt;      &lt;br&gt;NODES n2,&lt;/br&gt;      &lt;br&gt;NODES n3,&lt;/br&gt;      &lt;br&gt;NODES n4,&lt;/br&gt;      &lt;br&gt;NODES n5,&lt;/br&gt;      &lt;br&gt;NODES n6,&lt;/br&gt;      &lt;br&gt;NODES n7,&lt;/br&gt;      &lt;br&gt;NODES n8,&lt;/br&gt;      &lt;br&gt;SOFTWARE sw,&lt;/br&gt;      &lt;br&gt;NODE_SOFTWARE ns&lt;/br&gt;          &lt;br&gt;AND n1.NODE_ID = n2.PARENT_NODE_ID&lt;/br&gt;          &lt;br&gt;AND n2.NODE_ID = n3.PARENT_NODE_ID&lt;/br&gt;          &lt;br&gt;AND n3.NODE_ID = n4.PARENT_NODE_ID&lt;/br&gt;          &lt;br&gt;AND n4.NODE_ID = n5.PARENT_NODE_ID&lt;/br&gt;          &lt;br&gt;AND n5.NODE_ID = n6.PARENT_NODE_ID&lt;/br&gt;          &lt;br&gt;AND n6.NODE_ID = n7.PARENT_NODE_ID&lt;/br&gt;          &lt;br&gt;AND n7.NODE_ID = n8.PARENT_NODE_ID&lt;/br&gt;          &lt;br&gt;AND n8.NODE_ID = ns.NODE_ID&lt;/br&gt;          &lt;br&gt;AND sw.SOFTWARE_ID = ns.SOFTWARE_ID&lt;/br&gt;          &lt;br&gt;AND n3.NODE_SHORT_NAME = ?&lt;/br&gt;          &lt;br&gt;GROUP BY &lt;br&gt;n7.NODE_PATH_NAME,n2.NODE_PATH_NAME,n3.NODE_ID,sw.SOFTWARE_DISPLAY_NAME__SQL__&lt;/br&gt;    &lt;br&gt;my $dbh =DBI-&gt;connect( $opswdb{dsn}, $opswdb{user}, &lt;/br&gt;&lt;br&gt;$opswdb{pass},{ AutoCommit =&gt; 1, ChopBlanks =&gt; 1 } );&lt;/br&gt;   &lt;br&gt; my $sth = $dbh-&gt;prepare($deployed_sql);&lt;/br&gt;    &lt;br&gt;$sth-&gt;execute($appname);&lt;/br&gt;
    </description>
</item>

        

<item>
    <title>jimt&#39;s scratchpad (jimt)</title>
    <link>http://prlmnks.org/html/580624.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/580624.html</guid>

    <description>
        &lt;p&gt;For Limbic~Region:&lt;/p&gt;&lt;p&gt;My version may scale better than yours does, if you needed it to operate on larger sets or greater numbers of sets. I think more larger sets is where mine shines more.&lt;/p&gt;&lt;p&gt;Try this out, it generates a random data file:&lt;/p&gt;&lt;pre class=&quot;block_code&quot;&gt;#!/usr/bin/perlmy @letters = (&#39;a&#39;..&#39;z&#39;);foreach (1..5000) {my $length = int(rand 26);my %pool = map {$_ =&gt; 1} @letters;for (0..$length) {my $v = (keys %pool)[int rand(scalar keys %pool)];delete $pool{$v};print $v;}print &quot;\n&quot;;}&lt;/pre&gt;&lt;p&gt;Now, admittedly, who knows how the CPU was partitioning up time for the jobs or whatnot. But, I kicked your version off and let it sit for about 2 minutes, then I kicked mine off after that. Your version had a 2 million line lead at that point.&lt;/p&gt;&lt;p&gt;As it chugged along, the gaps narrowed, until mine eventually ended up 2.3 million lines ahead before I killed &#39;em off.&lt;/p&gt;&lt;p&gt;It was also using about 1/3rd the ram - about 100 megs vs 350 for yours, roughly.&lt;/p&gt;
    </description>
</item>

        

<item>
    <title>sabari&#39;s scratchpad (sabari)</title>
    <link>http://prlmnks.org/html/580501.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/580501.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>journey&#39;s scratchpad (journey)</title>
    <link>http://prlmnks.org/html/580395.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/580395.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>andreas1234567&#39;s scratchpad (andreas1234567)</title>
    <link>http://prlmnks.org/html/580231.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/580231.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>Bucchi&#39;s scratchpad (Bucchi)</title>
    <link>http://prlmnks.org/html/580205.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/580205.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>Chalai&#39;s scratchpad (Chalai)</title>
    <link>http://prlmnks.org/html/580159.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/580159.html</guid>

    <description>
        &lt;pre class=&quot;block_code&quot;&gt;#This is a section of part three.  The sorted doc groups are chopped down to individual docs and saved.open (APPFORWRIT, &quot;repository\\AppForWrit.txt&quot;) or die &quot;AppForWrit.txt not found \n&quot;;my @docgroup = &lt;APPFORWRIT&gt; ;while ($docgroup[0]) {if ($docgroup[0] =~ /ELECTRONIC FILING ONLY/) {&amp;finalpack;}else {shift (@docgroup);}}sub finalpack {@final = @docgroup[0..131];#Below generates the file name and dumps the contents to the file$date = $final[129];$acct = $final[130];$datecut = substr ($date, 18, 11); chomp ($datecut);$acctcut = substr ($acct, 22, 12); chomp ($acctcut);$d_a_t = &quot;$datecut $acctcut App for Writ&quot;;print &quot;Creating $d_a_t \n&quot;;open(my $d_a_t, &#39;&gt;&#39;, &quot;$d_a_t\.txt&quot;) or die(&quot;Unable to create file \&quot;$d_a_t\&quot;: $!\n&quot;);print $d_a_t @final;close ($d_a_t);#This should cut the text just printedsplice (@docgroup, 0, 130);}close (APPFORWRIT);&lt;/pre&gt;
    </description>
</item>

        

<item>
    <title>SFLEX&#39;s scratchpad (SFLEX)</title>
    <link>http://prlmnks.org/html/580022.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/580022.html</guid>

    <description>
        SF_form_secure - example of securing form field data&lt;pre class=&quot;block_code&quot;&gt;# making the data# require modulerequire SF_form_secure;# set variables$SF_form_secure::code = &#39;The_Key&#39;;$SF_form_secure::exp = &#39;&#39;;$SF_form_secure::ip_ct = &#39;&#39;;# make secure code I am using  Married but all below value can be used one at a timemy $secure_value = SF_form_secure::x_secure(4, &#39;Married&#39;, &#39;&#39;);# add the controled value with secure code!$secure_value = &#39;Married&#39; . &#39;|&#39; . $secure_value;# The part of the form to secure is Married# &lt;select name=&quot;marstat&quot;&gt;&lt;option value=&quot;&quot;&gt;&lt;/option&gt;# &lt;option value=&quot;$secure_value&quot;&gt;Married&lt;/option&gt;# &lt;option value=&quot;Single&quot;&gt;Single&lt;/option&gt;# &lt;option value=&quot;Single and Looking&quot;&gt;Single and Looking&lt;/option&gt;# &lt;option value=&quot;Divorced&quot;&gt;Divorced&lt;/option&gt;# &lt;/select&gt;# ------------------------------------------------------------------------# Checking The data# require modulerequire SF_form_secure;# set variables$SF_form_secure::code = &#39;The_Key&#39;; # same key as above$SF_form_secure::exp = &#39;&#39;; # same key as above$SF_form_secure::ip_ct = &#39;&#39;; # same key as above# cut the codes to check or set the input $marstat to noneif ($marstat &amp;&amp; $marstat =~ s/^(.*?)\|(.*?)$/$1/) {my $data_controle = $2 || &#39;&#39;;# Check the datamy $secure_value = SF_form_secure::x_secure(5, $marstat, $data_controle);# your doing good if its 1 and for english errors you could use $secure_value# for 4.0 you have to use ne 1 becase with a blank $data_controle variable will return the package version. if ($secure_value ne 1) {      user_error(&#39;Problem with form content&#39;);      }}else {$marstat = &#39;&#39;;}&lt;/pre&gt;
    </description>
</item>

        

<item>
    <title>iridius&#39;s scratchpad (iridius)</title>
    <link>http://prlmnks.org/html/579822.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/579822.html</guid>

    <description>
        &lt;pre class=&quot;block_code&quot;&gt;#! /usr/bin/perl --# the purpose of this script is take the user input in the form of text# and count each unique word# the code SHOULD count occurences of the word# then print each word in a table row, with the second cell &lt;td&gt; having the number of occurences of each worduse strict;use CGI qw(:standard);if (param()) {my @params = param();my $fname = param(&#39;fname&#39;);if(!$fname){dienice(&quot;You did not enter your name, please click the back button\n&quot;);}my $email = param(&#39;email&#39;);if(!$email){dienice(&quot;You did not enter your email, please click the back button\n&quot;);}my $text2count = param(&#39;text2count&#39;);if(!$text2count){dienice(&quot;You did not enter any text to analyze, please click the back button\n&quot;);}my $textcolor= param(&#39;textcolor&#39;);my $bgcolor= param(&#39;bgcolor&#39;);print header();print (&quot;&lt;style type=&#39;text/css&#39;&gt; &lt;!-- .style1 {font-family: Arial, Helvetica, sans-serif} --&gt; &lt;/style&gt;&quot;);print start_html(&quot;Welcome to text analaysis&quot;);my $text2count = param(&#39;text2count&#39;);# get a text array from textmy @textarray = get_text_array($text2count);# make a hash out of this array @textarraymy %texthash = get_counting_hash(@textarray);# after get all of the values needed, print out the content for the result:print (&quot;&lt;table border=&#39;1&#39; cellpadding=&#39;1&#39; cellspacing=&#39;1&#39;&gt;&quot;);while (($key, $value) = each %texthash) {print (&quot;&lt;tr&gt;&lt;td&gt;$value&lt;/td&gt;&lt;td&gt;$key&lt;/td&gt;&lt;/tr&gt;&quot;);}print (&quot;&lt;/table&gt;&quot;);} else {print header();print (&quot;&lt;style type=&#39;text/css&#39;&gt; &lt;!-- .style1 {font-family: Arial, Helvetica, sans-serif} --&gt; &lt;/style&gt;&quot;);print start_html(&quot;Welcome to text analaysis&quot;);print (&quot;&lt;span class=&#39;style1&#39;&gt;We&#39;re going to analyze some text you enter!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&quot;);print (&quot;&lt;form method=&#39;post&#39; action=&#39;textexample.cgi&#39;&gt;  &lt;table width=&#39;600&#39; border=&#39;0&#39; cellspacing=&#39;0&#39; cellpadding=&#39;0&#39;&gt;  &lt;tr&gt;    &lt;td width=&#39;250&#39;&gt;&lt;span class=&#39;style1&#39;&gt;Please enter your first name:&lt;/span&gt;&lt;/td&gt;    &lt;td width=&#39;10&#39;&gt;&amp;nbsp;&lt;/td&gt;    &lt;td width=&#39;340&#39;&gt;&lt;span class=&#39;style1&#39;&gt;      &lt;input name=&#39;fname&#39; type=&#39;text&#39; size=&#39;20&#39; /&gt;    &lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;    &lt;td width=&#39;250&#39;&gt;&lt;span class=&#39;style1&#39;&gt;Please enter your email: &lt;/span&gt;&lt;/td&gt;    &lt;td width=&#39;10&#39;&gt;&amp;nbsp;&lt;/td&gt;    &lt;td width=&#39;340&#39;&gt;&lt;span class=&#39;style1&#39;&gt;      &lt;input name=&#39;email&#39; type=&#39;text&#39; size=&#39;20&#39; /&gt;    &lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;    &lt;td width=&#39;250&#39;&gt;&amp;nbsp;&lt;/td&gt;    &lt;td width=&#39;10&#39;&gt;&amp;nbsp;&lt;/td&gt;    &lt;td width=&#39;340&#39;&gt;&amp;nbsp;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;    &lt;td width=&#39;250&#39;&gt;&lt;span class=&#39;style1&#39;&gt;Please enter some text:&lt;/span&gt;&lt;/td&gt;    &lt;td width=&#39;10&#39;&gt;&amp;nbsp;&lt;/td&gt;    &lt;td width=&#39;340&#39;&gt;&lt;span class=&#39;style1&#39;&gt;      &lt;textarea name=&#39;text2count&#39;&gt;&lt;/textarea&gt;    &lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;    &lt;td width=&#39;250&#39;&gt;&amp;nbsp;&lt;/td&gt;    &lt;td width=&#39;10&#39;&gt;&amp;nbsp;&lt;/td&gt;    &lt;td width=&#39;340&#39;&gt;&amp;nbsp;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;    &lt;td width=&#39;250&#39;&gt;&lt;span class=&#39;style1&#39;&gt;Choose a text color:&lt;/span&gt;&lt;/td&gt;    &lt;td width=&#39;10&#39;&gt;&amp;nbsp;&lt;/td&gt;    &lt;td width=&#39;340&#39;&gt;&lt;span class=&#39;style1&#39;&gt;      &lt;select name=&#39;textcolor&#39; size=&#39;1&#39;&gt;        &lt;option value=&#39;red&#39;&gt;red&lt;/option&gt;        &lt;option value=&#39;blue&#39;&gt;blue&lt;/option&gt;        &lt;option value=&#39;green&#39;&gt;green&lt;/option&gt;        &lt;option value=&#39;yellow&#39;&gt;yellow&lt;/option&gt;        &lt;option value=&#39;orange&#39;&gt;orange&lt;/option&gt;        &lt;option value=&#39;purple&#39;&gt;purple&lt;/option&gt;        &lt;option value=&#39;black&#39;&gt;black&lt;/option&gt;        &lt;option value=&#39;white&#39;&gt;white&lt;/option&gt;        &lt;option value=&#39;grey&#39;&gt;grey&lt;/option&gt;      &lt;/select&gt;    &lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;    &lt;td width=&#39;250&#39;&gt;&lt;span class=&#39;style1&#39;&gt;Choose a background color:&lt;/span&gt;&lt;/td&gt;    &lt;td width=&#39;10&#39;&gt;&amp;nbsp;&lt;/td&gt;    &lt;td width=&#39;340&#39;&gt;&lt;span class=&#39;style1&#39;&gt;      &lt;select name=&#39;bgcolor&#39; size=&#39;1&#39;&gt;        &lt;option value=&#39;red&#39;&gt;red&lt;/option&gt;        &lt;option value=&#39;blue&#39;&gt;blue&lt;/option&gt;        &lt;option value=&#39;green&#39;&gt;green&lt;/option&gt;        &lt;option value=&#39;yellow&#39;&gt;yellow&lt;/option&gt;        &lt;option value=&#39;orange&#39;&gt;orange&lt;/option&gt;        &lt;option value=&#39;purple&#39;&gt;purple&lt;/option&gt;        &lt;option value=&#39;black&#39;&gt;black&lt;/option&gt;        &lt;option value=&#39;white&#39;&gt;white&lt;/option&gt;        &lt;option value=&#39;grey&#39;&gt;grey&lt;/option&gt;      &lt;/select&gt;    &lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;    &lt;td width=&#39;250&#39;&gt;&amp;nbsp;&lt;/td&gt;    &lt;td width=&#39;10&#39;&gt;&amp;nbsp;&lt;/td&gt;    &lt;td width=&#39;340&#39;&gt;&amp;nbsp;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;    &lt;td colspan=&#39;3&#39; align=&#39;center&#39;&gt;&lt;input name=&#39;Submit&#39; type=&#39;submit&#39; value=&#39;Submit&#39; /&gt;&lt;/td&gt;    &lt;/tr&gt;&lt;/table&gt;&lt;span class=&#39;style1&#39;&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/form&gt;&quot;);}print end_html();# subroutine to die - provided by our teachersub dienice {my ($s) = @_;print $s, &quot;\n&quot;;exit(1);}# make a text array out of the plain textsub get_text_array {return split(/ /, $_[0]);}# building a hash counting words from an array of words# the keys are the words# the values are the number of occurrences of that word in the arraysub get_counting_hash {my @wordArray = @_;my %wordHash = ();# I think I need some more code here?return %wordHash;}&lt;/pre&gt;Here is the error code I am getting:malformed header from script. Bad header=Global symbol &quot;$key&quot; requires : cgiwrap 
    </description>
</item>

        

<item>
    <title>bones&#39;s scratchpad (bones)</title>
    <link>http://prlmnks.org/html/579633.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/579633.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>lyklev&#39;s scratchpad (lyklev)</title>
    <link>http://prlmnks.org/html/579607.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/579607.html</guid>

    <description>
        &lt;pre class=&quot;block_code&quot;&gt;#!/usr/bin/perluse strict;use warnings;use Tk;use Tk::Canvas;my $self = { };# configurationmy $n_circles = 500;my $c_width  = 600;my $c_height = 400;my $r = 3;# initialise datamy @circles;for (1..$n_circles) {   my $x = rand;   my $y = rand;   push (@circles, [$x, $y]);}$self -&gt; {&#39;circles&#39;} = \@circles;# initial zoom$self -&gt; {&#39;max_x&#39;} = 1.0;$self -&gt; {&#39;min_x&#39;} = 0.0;$self -&gt; {&#39;max_y&#39;} = 1.0;$self -&gt; {&#39;min_y&#39;} = 0.0;$self -&gt; {&#39;can_w&#39;} = $c_width;$self -&gt; {&#39;can_h&#39;} = $c_height;$self -&gt; {&#39;mode&#39;}  = &#39;&#39;;&amp;compute_transform($self);# draw the main window and the canvasmy $mw = Tk::MainWindow -&gt; new();my $can = $mw -&gt; Canvas(-width  =&gt; $c_width,                        -height =&gt; $c_height,                       );my $butcan = $mw -&gt; Canvas();$self -&gt; {&#39;button_zoom&#39;} =     $butcan -&gt; Button (-text    =&gt; &#39;Zoom&#39;,                       -command =&gt; [\&amp;zoom, $self]);$self -&gt; {&#39;button_zoomall&#39;} =    $butcan -&gt; Button (-text =&gt; &#39;Zoom all&#39;,                       -command =&gt; [\&amp;zoomall, $self] );$self -&gt; {&#39;button_zoom&#39;} -&gt; pack(-side =&gt; &#39;left&#39;);$self -&gt; {&#39;button_zoomall&#39;} -&gt; pack(-after =&gt; $self -&gt; {&#39;button_zoom&#39;},                                    -side  =&gt; &#39;left&#39;);$butcan -&gt; pack (-side =&gt; &#39;top&#39;,                 -fill =&gt; &#39;x&#39;);$can -&gt; pack(-side    =&gt; &#39;bottom&#39;,             -expand  =&gt; 1,             -fill    =&gt; &#39;both&#39;);$self -&gt; {&#39;can&#39;} = $can;$can -&gt; Tk::bind (&#39;&lt;1&gt;&#39; =&gt; [\&amp;mouse1, Ev(&#39;x&#39;), Ev(&#39;y&#39;), $self]);$can -&gt; Tk::bind (&#39;&lt;2&gt;&#39; =&gt; [\&amp;mouse2, Ev(&#39;x&#39;), Ev(&#39;y&#39;), $self]);$can -&gt; Tk::bind (&#39;&lt;Motion&gt;&#39; =&gt; [\&amp;motion, Ev(&#39;x&#39;), Ev(&#39;y&#39;), $self]); &amp;draw ($self);MainLoop();sub draw {   my ($self) = @_;   foreach (@{$self -&gt; {&#39;circles&#39;}}) {      my ($x_c, $y_c) = &amp;real_to_screen ($self, @$_);      $self -&gt; {&#39;can&#39;} -&gt; createOval($x_c - 2, $y_c - 2, $x_c + 2, $y_c + 2);   }   return;}   sub real_to_screen {   my ($self, $x_r, $y_r) = @_;   my $x_s = $self -&gt; {&#39;can_w&#39;} / 2.0 +             $self -&gt; {&#39;sca_x&#39;} * ($x_r - $self -&gt; {&#39;mid_x&#39;});   my $y_s = $self -&gt; {&#39;can_h&#39;} / 2.0 -              $self -&gt; {&#39;sca_y&#39;} * ($y_r - $self -&gt; {&#39;mid_y&#39;});   return ($x_s, $y_s);}sub screen_to_real {   my ($self, $x_s, $y_s) = @_;   my $x_r = ($x_s - $self -&gt; {&#39;can_w&#39;} / 2.0) / $self -&gt; {&#39;sca_x&#39;} +              $self -&gt; {&#39;mid_x&#39;};   my $y_r = ($self -&gt; {&#39;can_h&#39;} / 2.0 - $y_s) / $self -&gt; {&#39;sca_y&#39;} +              $self -&gt; {&#39;mid_y&#39;};   return ($x_r, $y_r);}sub compute_transform {   my $self = shift;   $self -&gt; {&#39;sca_x&#39;} =      $self -&gt; {&#39;can_w&#39;} / ($self -&gt; {&#39;max_x&#39;} - $self -&gt; {&#39;min_x&#39;});   $self -&gt; {&#39;sca_y&#39;} =       $self -&gt; {&#39;can_h&#39;} / ($self -&gt; {&#39;max_y&#39;} - $self -&gt; {&#39;min_y&#39;});   $self -&gt; {&#39;mid_x&#39;} = ($self -&gt; {&#39;max_x&#39;} + $self -&gt; {&#39;min_x&#39;}) / 2.0;   $self -&gt; {&#39;mid_y&#39;} = ($self -&gt; {&#39;max_y&#39;} + $self -&gt; {&#39;min_y&#39;}) / 2.0;   return;}   sub zoom {   my ($self) = @_;   $self -&gt; {&#39;button_zoom&#39;} -&gt; configure(-state =&gt; &#39;active&#39;);   $self -&gt; {&#39;mode&#39;} = &#39;zoom0&#39;;   return;}sub zoomall {   my $self = shift;   $self -&gt; {&#39;min_x&#39;} = 0;   $self -&gt; {&#39;max_x&#39;} = 1;   $self -&gt; {&#39;min_y&#39;} = 0;   $self -&gt; {&#39;max_y&#39;} = 1;   $self -&gt; {&#39;can&#39;} -&gt; delete(&#39;all&#39;);   &amp;compute_transform ($self);   &amp;draw ($self);   return;}sub mouse1 {   my (undef, $x, $y, $self) = @_;   if ($self -&gt; {&#39;mode&#39;} eq &#39;zoom0&#39;) {      $self -&gt; {&#39;window&#39;} = [$x, $y, $x, $y];      $self -&gt; {&#39;window_id&#39;} =         $self -&gt; {&#39;can&#39;} -&gt; createRectangle(@{$self -&gt; {&#39;window&#39;}},                                            -dash =&gt; &#39;-&#39;);      $self -&gt; {&#39;mode&#39;}  = &#39;zoom1&#39;;      print &quot;Window created.\n&quot;;   }   elsif ($self -&gt; {&#39;mode&#39;} eq &#39;zoom1&#39;) {      print &quot;zooming to $x, $y\n&quot;;      $self -&gt; {&#39;can&#39;} -&gt; delete ($self -&gt; {&#39;window_id&#39;});      ($self -&gt; {&#39;min_x&#39;}, $self -&gt; {&#39;min_y&#39;}) =         &amp;screen_to_real ($self, $self -&gt; {&#39;window&#39;} -&gt; [0],                                 $self -&gt; {&#39;window&#39;} -&gt; [1]);      ($self -&gt; {&#39;max_x&#39;}, $self -&gt; {&#39;max_y&#39;}) =         &amp;screen_to_real ($self, $self -&gt; {&#39;window&#39;} -&gt; [2],                                 $self -&gt; {&#39;window&#39;} -&gt; [3]);      &amp;compute_transform($self);      $self -&gt; {&#39;can&#39;} -&gt; delete(&#39;all&#39;);      &amp;draw ($self);      $self -&gt; {&#39;mode&#39;} = &#39;&#39;;   }   return;}sub motion {   my (undef, $x, $y, $self) = @_;   if ($self -&gt; {&#39;mode&#39;} eq &#39;zoom1&#39;) {      $self -&gt; {&#39;can&#39;} -&gt; delete ($self -&gt; {&#39;window_id&#39;});      $self -&gt; {&#39;window&#39;} -&gt; [2] = $x;      $self -&gt; {&#39;window&#39;} -&gt; [3] = $y;      $self -&gt; {&#39;window_id&#39;} =          $self -&gt; {&#39;can&#39;} -&gt; createRectangle(@{$self -&gt; {&#39;window&#39;}},                                            -dash =&gt; &#39;-&#39;);   }   return;}&lt;/pre&gt;
    </description>
</item>

        

<item>
    <title>quester&#39;s scratchpad (quester)</title>
    <link>http://prlmnks.org/html/579536.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/579536.html</guid>

    <description>
        print &quot;empty scratchpad&quot;;
    </description>
</item>

        

<item>
    <title>smammy&#39;s scratchpad (smammy)</title>
    <link>http://prlmnks.org/html/579513.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/579513.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>brig&#39;s scratchpad (brig)</title>
    <link>http://prlmnks.org/html/579492.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/579492.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>markh&#39;s scratchpad (markh)</title>
    <link>http://prlmnks.org/html/578889.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/578889.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>rquinlan&#39;s scratchpad (rquinlan)</title>
    <link>http://prlmnks.org/html/578845.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/578845.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>lowphive&#39;s scratchpad (lowphive)</title>
    <link>http://prlmnks.org/html/578297.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/578297.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>caelifer&#39;s scratchpad (caelifer)</title>
    <link>http://prlmnks.org/html/577849.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/577849.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>jtsceioa&#39;s scratchpad (jtsceioa)</title>
    <link>http://prlmnks.org/html/577788.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/577788.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>sideval&#39;s scratchpad (sideval)</title>
    <link>http://prlmnks.org/html/577786.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/577786.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>Resin&#39;s scratchpad (Resin)</title>
    <link>http://prlmnks.org/html/577744.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/577744.html</guid>

    <description>
        Monks are cool. I visited Belgium and they had these monks that made great, super alcoholic beer. They are called Trappists.
    </description>
</item>

        

<item>
    <title>mbruce&#39;s scratchpad (mbruce)</title>
    <link>http://prlmnks.org/html/577600.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/577600.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>jonsmith1982&#39;s scratchpad (jonsmith1982)</title>
    <link>http://prlmnks.org/html/577513.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/577513.html</guid>

    <description>
        md5 password cracker&lt;pre class=&quot;block_code&quot;&gt;#!/usr/bin/perl -wuse strict;use Digest::Perl::MD5 &#39;md5_hex&#39;;my $list = &quot;mil-dic.txt&quot;;my @hash = (&quot;13ef708e32874151851382bf1e05c429&quot;);my $number = 1;open (F, $list) || die (&quot;\nCan not open file : &quot;.$!.&quot;\n\n&quot;);while(&lt;F&gt;) {   my $word = $_;   check($word);}close(F);exit(0);sub check {   my $pass = shift;   $pass =~ s/[\r\n]//g;   my $match_1 = md5_hex $pass;   foreach my $match_2 (@hash) {      if ($match_1 eq $match_2) {         print &quot;\nFound !\t[&quot;.$match_2.&quot;] : [&quot;.$pass.&quot;] : [&quot;.$number.&quot;]\n\n&quot;;         open (A, &quot;&gt;&gt;found.txt&quot;) || die (&quot;\nCan not open file : &quot;.$!.&quot;\n\n&quot;);         print A &quot;[&quot;.$match_2.&quot;] : [&quot;.$pass.&quot;]\n&quot;;         close(A);      }   }   $number++;}&lt;/pre&gt;
    </description>
</item>

        

<item>
    <title>alvingao&#39;s scratchpad (alvingao)</title>
    <link>http://prlmnks.org/html/577379.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/577379.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>tolyan77&#39;s scratchpad (tolyan77)</title>
    <link>http://prlmnks.org/html/577362.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/577362.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>muthuk_v&#39;s scratchpad (muthuk_v)</title>
    <link>http://prlmnks.org/html/577356.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/577356.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>b4swine&#39;s scratchpad (b4swine)</title>
    <link>http://prlmnks.org/html/577324.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/577324.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>sj1&#39;s scratchpad (sj1)</title>
    <link>http://prlmnks.org/html/576797.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/576797.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>ashokpj&#39;s scratchpad (ashokpj)</title>
    <link>http://prlmnks.org/html/576679.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/576679.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>mandarin&#39;s scratchpad (mandarin)</title>
    <link>http://prlmnks.org/html/576661.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/576661.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>jalex&#39;s scratchpad (jalex)</title>
    <link>http://prlmnks.org/html/576580.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/576580.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>texasperl&#39;s scratchpad (texasperl)</title>
    <link>http://prlmnks.org/html/576448.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/576448.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>Mike&#39;s scratchpad (Mike)</title>
    <link>http://prlmnks.org/html/576348.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/576348.html</guid>

    <description>
        I can not view the next page. I would appreciate if some one can help me.#!/usr/bin/perl#!C:/perl/bin/perlprint &quot;Content-type:text/html\n\n&quot;;use CGI qw(:standard);use CGI::Carp qw(fatalsToBrowser);use DBI ();if(!$start) {$start = 0;} my $eu = ($start - 0); my $limit = 5;                     my $this = $eu + $limit; my $back = $eu - $limit ; my $next = $eu + $limit; ### Perform the connection using the MYSQL Driver.#open connection to MYSQL.my $dbh = DBI-&gt;connect(&quot;DBI:mysql:database=aramco;host=localhost&quot;, &quot;root&quot;,&quot;buick89&quot;)or die &quot;Can&#39;t make connect to the database: $DBI::errstr\n&quot;;my $sql=(&quot;select * from student &quot;);$sth = $dbh-&gt;prepare($sql);$sth-&gt;execute();my $nume = $sth-&gt;rows;print &quot;&lt;html&gt;&lt;body&gt;&quot;;print &quot;&lt;h1&gt;Tower II Lease Return Project&lt;/h1&gt;\n&quot;;print &quot;&lt;TABLE width=50% align=center  cellpadding=0 cellspacing=0&gt; &lt;tr&gt;&quot;;print &quot;&lt;td  bgcolor=&#39;f1f1f1&#39; &gt;&lt;font face=&#39;arial,verdana,helvetica&#39; color=&#39;#000000&#39; size=&#39;4&#39;&gt;Name&lt;/font&gt;&lt;/td&gt;&quot;;print &quot;&lt;td  bgcolor=&#39;f1f1f1&#39; &gt;&lt;font face=&#39;arial,verdana,helvetica&#39; color=&#39;#000000&#39; size=&#39;4&#39;&gt;Class&lt;/font&gt;&lt;/td&gt;&quot;;print &quot;&lt;td  bgcolor=&#39;f1f1f1&#39;&gt;&lt;font face=&#39;arial,verdana,helvetica&#39; color=&#39;#000000&#39; size=&#39;4&#39;&gt;Mark&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&quot;;my $sql=(&quot;select * from student limit $eu, $limit&quot;);$sth = $dbh-&gt;prepare($sql) ;$sth-&gt;execute( )   ;while (@row=$sth-&gt;fetchrow_array) { if($bgcolor==&#39;f1f1f1&#39; ){$bgcolor=&#39;99FF99&#39;;}else{$bgcolor=&#39;f1f1f1&#39;;}print &quot;&lt;tr &gt;&quot;;print &quot;&lt;td align=left bgcolor=$bgcolor &gt;  $row&lt;a href=&quot;/out/node/1&quot;&gt;1&lt;/a&gt;&lt;/td&gt;\n&quot;; print &quot;&lt;td align=left bgcolor=$bgcolor &gt; $row&lt;a href=&quot;/out/node/2&quot;&gt;2&lt;/a&gt; &lt;/td&gt;\n&quot;; print &quot;&lt;td align=left bgcolor=$bgcolor &gt; $row&lt;a href=&quot;/out/node/3&quot;&gt;3&lt;/a&gt;&lt;/td&gt;\n&quot;;   print &quot;&lt;/tr&gt;&quot;;}print &quot;&lt;/table&gt;\n&quot;;print &quot;&lt;table align = &#39;center&#39; width=&#39;50%&#39;&gt;&lt;tr&gt;&lt;td  align=&#39;left&#39; width=&#39;30%&#39;&gt;&quot;;if( $nume &gt;= 0 ) { print &quot;&lt;a href=temp.pl?start=$back&gt;&lt;font face=&#39;Verdana&#39; size=&#39;2&#39;&gt;PREV&lt;/font&gt;&lt;/a&gt;&quot;;} print &quot;&lt;/td&gt;&lt;td align=center width=&#39;30%&#39;&gt;&quot;;my $i=0;my $l=1;for($i=0; $i &lt; $nume; $i=$i+$limit ){if($i!=$eu){print &quot;&lt;a href=temp.pl?start=$i&gt;&lt;font face=&#39;Verdana&#39; size=&#39;2&#39;&gt;$l&lt;/font&gt;&lt;/a&gt; &quot;;} else { print &quot; &lt;font face=&#39;Verdana&#39; size=&#39;4&#39; color=red&gt;$l&lt;/font&gt;&quot;;}           $l=$l+1;}print &quot;&lt;/td&gt;&lt;td  align=&#39;right&#39; width=&#39;30%&#39;&gt;&quot;;if($this &lt; $nume) { print &quot;&lt;a href=temp.pl?start=$next&gt;&lt;font face=&#39;Verdana&#39; size=&#39;2&#39;&gt;NEXT&lt;/font&gt;&lt;/a&gt;&quot;;} print &quot;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;;print &quot; &lt;br&gt;\n&quot;;print &quot;&lt;hr size=2 color=blue&gt;\n&quot;;print &quot;&lt;center&gt;\n&quot;;print &quot;&lt;/from&gt;&quot;;print &quot;&lt;/body&gt;&quot;;print &quot;&lt;/html&gt;&quot;;$dbh-&gt;disconnect or warn &quot;Disconnect failed: $DBI::errstr\n&quot;;exit; 
    </description>
</item>

        

<item>
    <title>jwu&#39;s scratchpad (jwu)</title>
    <link>http://prlmnks.org/html/576302.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/576302.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>jay&#39;s scratchpad (jay)</title>
    <link>http://prlmnks.org/html/576040.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/576040.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>sunnavy&#39;s scratchpad (sunnavy)</title>
    <link>http://prlmnks.org/html/575899.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/575899.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>DrWhynot&#39;s scratchpad (DrWhynot)</title>
    <link>http://prlmnks.org/html/575849.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/575849.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>fenLisesi&#39;s scratchpad (fenLisesi)</title>
    <link>http://prlmnks.org/html/575820.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/575820.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>holandes777&#39;s scratchpad (holandes777)</title>
    <link>http://prlmnks.org/html/575696.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/575696.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>panguar&#39;s scratchpad (panguar)</title>
    <link>http://prlmnks.org/html/575600.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/575600.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>hgolden&#39;s scratchpad (hgolden)</title>
    <link>http://prlmnks.org/html/575444.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/575444.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>AgedOne&#39;s scratchpad (AgedOne)</title>
    <link>http://prlmnks.org/html/575389.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/575389.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>babug_prg&#39;s scratchpad (babug_prg)</title>
    <link>http://prlmnks.org/html/575354.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/575354.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>eriam&#39;s scratchpad (eriam)</title>
    <link>http://prlmnks.org/html/575316.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/575316.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>josephworkman&#39;s scratchpad (josephworkman)</title>
    <link>http://prlmnks.org/html/575181.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/575181.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>rkaminski&#39;s scratchpad (rkaminski)</title>
    <link>http://prlmnks.org/html/574993.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/574993.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>Jin&#39;s scratchpad (Jin)</title>
    <link>http://prlmnks.org/html/574971.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/574971.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>Danaita&#39;s scratchpad (Danaita)</title>
    <link>http://prlmnks.org/html/574627.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/574627.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>Jeremy&#39;s scratchpad (Jeremy)</title>
    <link>http://prlmnks.org/html/574601.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/574601.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>Lynx Iberu&#39;s scratchpad (Lynx Iberu)</title>
    <link>http://prlmnks.org/html/574397.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/574397.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>perlmonkey2&#39;s scratchpad (perlmonkey2)</title>
    <link>http://prlmnks.org/html/574393.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/574393.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>gar0t0&#39;s scratchpad (gar0t0)</title>
    <link>http://prlmnks.org/html/574023.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/574023.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>lin0&#39;s scratchpad (lin0)</title>
    <link>http://prlmnks.org/html/573925.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/573925.html</guid>

    <description>
          &lt;h1&gt; Fuzzy C-means &lt;/h1&gt;  &lt;pre class=&quot;block_code&quot;&gt;#!/usr/bin/perluse warnings;use strict;# fcm: fuzzy c-means implementation in Perl# usage: $fcm [number_of_clusters] [fuzzyfication_factor]#        [max_iter] [tolerace]# returns: prototypes, partition matrix# ## reading data#my ( @data, @tmp, $rows, $columns );while (defined(my $line = &lt;DATA&gt;)) {  chomp ($line);  @tmp = split /\s+/, $line;  push @data, [ @tmp ];}$columns = @tmp;$rows    = @data;## assigning other variables#my $number_of_clusters   = shift @ARGV;my $fuzzification_factor = shift @ARGV;my $max_iter             = shift @ARGV;my $tolerance            = shift @ARGV;unless (defined($number_of_clusters)) {  $number_of_clusters = 2;}unless (defined($fuzzification_factor)) {  $fuzzification_factor = 2.0;}unless (defined($max_iter)) { $max_iter = 4000; }unless (defined($tolerance)) { $tolerance = 0.00001; }## initializing partition matrices#my @previous_partition_matrix;my @current_partition_matrix =      initialize_partition_matrix($number_of_clusters, $rows);          ## fuzzy c means implementation#my ($iter, @dist, $sum_numerator, $sum_denominator, @prototypes);$iter = 0;while ( 1 ){  # computing each prototype  for (my $i = 0; $i &lt; $number_of_clusters; $i++) {    for (my $k = 0; $k &lt; $columns; $k++) {      $sum_numerator = 0;      $sum_denominator = 0;      for (my $j = 0; $j &lt; $rows; $j++) {        $sum_numerator +=           $data[$j][$k] * ($current_partition_matrix[$i][$j] **            $fuzzification_factor);        $sum_denominator +=          $current_partition_matrix[$i][$j] ** $fuzzification_factor;      }      $prototypes[$i][$k] = $sum_numerator / $sum_denominator;    }  }  # copying partition matrix  for (my $i = 0; $i &lt; $number_of_clusters; $i++) {    for (my $j = 0; $j &lt; $rows; $j++) {      $previous_partition_matrix[$i][$j] =         $current_partition_matrix[$i][$j];    }  }  # updating the partition matrix  my ($sum, @pattern_is_prototype);  for (my $i = 0; $i &lt; $number_of_clusters; $i++) {    for (my $j = 0; $j &lt; $rows; $j++) {      $dist[$i][$j] = distance( $prototypes[$i], $data[$j] );    }  }  for (my $i = 0; $i &lt; $number_of_clusters; $i++) {    for (my $j = 0; $j &lt; $rows; $j++) {    $sum = 0.0;    if ( $dist[$i][$j] == 0 ) {      $current_partition_matrix[$i][$j] = 1.0;    } else {        for (my $l = 0; $l &lt; $number_of_clusters; $l++) {          $sum += ( $dist[$i][$j]/$dist[$l][$j] )               ** ( 2.0 / ($fuzzification_factor - 1.0) )                  unless ($dist[$l][$j] == 0);        }        $current_partition_matrix[$i][$j] = 1.0 / $sum           unless ($sum == 0);      }    }  }    # checking stop conditions    last if ( ++$iter == $max_iter );    my ($dif, $max_dif);    $max_dif = 0;CLUSTER:    for (my $i = 0; $i &lt; $number_of_clusters; $i++){        for (my $j = 0; $j &lt; $rows; $j++){            $dif = abs( $current_partition_matrix[$i][$j] -                         $previous_partition_matrix[$i][$j] );            $max_dif = $dif if ($dif &gt; $max_dif);            last CLUSTER if ( $max_dif &gt; $tolerance );        }    }#    print &quot;max dif= $max_dif\n&quot;;    last if ($max_dif &lt; $tolerance);    }## Performance Index calculation#my $performance_index;for (my $i = 0; $i &lt; $number_of_clusters; $i++){  for (my $j = 0; $j &lt; $rows; $j++){      my $dij = distance( $prototypes[$i], $data[$j] );        $performance_index +=            ($current_partition_matrix[$i][$j] **              $fuzzification_factor) * $dij;    }}print &quot;Clustering completed ...\n&quot;;for (my $i = 0; $i &lt; $number_of_clusters; $i++) {  for (my $k = 0; $k &lt; $columns; $k++) {    print &quot;Prototype[$i][$k]: $prototypes[$i][$k]\n&quot;;  }}print &quot;performance index: $performance_index\n&quot;;print &quot;number of iterations: $iter\n&quot;;for (my $i = 0; $i &lt; $number_of_clusters; $i++) {  for (my $j = 0; $j &lt; $rows; $j++){    print &quot;U[$i][$j] = $current_partition_matrix[$i][$j]\n&quot;;  }}         # ================================# initialize_partition_matrix# partition_matrix = #   initialize_partition_matrix(#     num_clusters, num_patterns)# ================================sub initialize_partition_matrix {  srand;  my (@partition_matrix, @column_sum);    for (my $i = 0; $i &lt; $_[0]; $i++){    for (my $j = 0; $j &lt; $_[1]; $j++){      $partition_matrix[$i][$j] = rand;      $column_sum[$j] += $partition_matrix[$i][$j];    }  }    for (my $i = 0; $i &lt; $_[0]; $i++){    for (my $j = 0; $j &lt; $_[1]; $j++){      die &quot;column [$j] sum is equal to zero\n&quot;         unless $column_sum[$j];      $partition_matrix[$i][$j] /= $column_sum[$j];          }  }  return @partition_matrix;}# ====================================# compute distance between two vectors# dist = distance( vector1, vector2 )# ====================================sub distance {  my $vector1 = shift;  my $vector2 = shift;  my $sum = 0;  for ( my $i = 0; $i &lt; scalar @{$vector1}; $i++ ){    my $difference = ${ $vector1 }[$i] - ${ $vector2 }[$i];    $sum += $difference * $difference;  }  return sqrt( $sum );}__DATA__0 01 11 00 11 212 1110 1112 1012 1213 112 22 010 12&lt;/pre&gt;  &lt;hr/&gt;
    </description>
</item>

        

<item>
    <title>ChrisCantrall&#39;s scratchpad (ChrisCantrall)</title>
    <link>http://prlmnks.org/html/573794.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/573794.html</guid>

    <description>
        &lt;a href=&quot;/html/281137.html&quot;&gt;davido&lt;/a&gt; has a good recommended reading list - listed in order of what to tackle.
    </description>
</item>

        

<item>
    <title>cq&#39;s scratchpad (cq)</title>
    <link>http://prlmnks.org/html/573584.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/573584.html</guid>

    <description>
        ~/.cpan/build/PathTools-3.19 $ make installCannot forceunlink /usr/lib/perl5/5.8/cygwin/auto/Cwd/Cwd.dll: Permission denied at /usr/lib/perl5/5.8/File/Find.pm line 907make: *** &lt;a href=&quot;/out/node/pure_perl_install&quot;&gt;pure_perl_install&lt;/a&gt; Error 13
    </description>
</item>

        

<item>
    <title>phemal&#39;s scratchpad (phemal)</title>
    <link>http://prlmnks.org/html/573474.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/573474.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>ocs&#39;s scratchpad (ocs)</title>
    <link>http://prlmnks.org/html/573062.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/573062.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

        

<item>
    <title>mega&#39;s scratchpad (mega)</title>
    <link>http://prlmnks.org/html/572923.html</link>
    <guid isPermaLink="true">http://prlmnks.org/html/572923.html</guid>

    <description>
        Scratchpad - no content
    </description>
</item>

    </channel>
</rss>
