<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Algorithms Forum RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest threads from the 'Algorithms' forum at Programmer's Heaven, excluding replies.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Thu, 09 Feb 2012 06:33:00 -0800</pubDate>
    <lastBuildDate>Thu, 09 Feb 2012 06:33:00 -0800</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Basis Matrices in Visual Cryptography Scheme</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/427221/427221/basis-matrices-in-visual-cryptography-scheme/</link>
      <description>Hey everyone,&lt;br /&gt;
I'm doing my final year project on Visual Cryptography, and I'm basing it off the paper below:&lt;br /&gt;
&lt;a href="http://lbms03.cityu.edu.hk/theses/c_ftt/mphil-cs-b39478154f.pdf"&gt;http://lbms03.cityu.edu.hk/theses/c_ftt/mphil-cs-b39478154f.pdf&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I coded everything, according to what's described in section 3, but the output seems to be off. I have a feeling I messed up the contents of the Basis Matrices B0 and B1(PDF page 41/86). What's more, I can't understand their construction, and the paper fails to specify its contents even for the example they've shown (2-out of-2 color VCS for Lena image). It's so ambiguous I can't even figure out if it should be a 2x2 or 2x4 matrix. Some help would be appreciated! &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/427221/427221/basis-matrices-in-visual-cryptography-scheme/</guid>
      <pubDate>Sat, 04 Feb 2012 08:49:54 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>DATA STRUCTURE QUESTION 2..... PLS ITS URGENT</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/426943/426943/data-structure-question-2-pls-its-urgent/</link>
      <description>PLS ITS URGENT ..HELP ME SOLVE THIS PROBLEM...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.	Each student in a class of 30 students takes 6 tests in which scores range between 0 and 100.&lt;br /&gt;
Suppose the test scores are stored in a 30 * 6 array TEST. Write a module which&lt;br /&gt;
(a)	Find the average grade for each test&lt;br /&gt;
(b)	 Find the final grade for each student where the final grade is the average of the student’s five highest test scores&lt;br /&gt;
(c)	 Finds the number NUM of students who have failed i.e. whose final grade is less than 60.&lt;br /&gt;
(d)	 Find the average of the final grades.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/426943/426943/data-structure-question-2-pls-its-urgent/</guid>
      <pubDate>Mon, 23 Jan 2012 05:58:32 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>DATA STRUCTURE</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/426940/426940/data-structure/</link>
      <description>PLS HELP ME SOLVE THIS QUESTION.................ITS VERY URGENT FOR ME..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.	An array contains 25 positive integers. Write  a module which&lt;br /&gt;
(a)	 Finds all pairs of elements whose sum is 25.&lt;br /&gt;
(b)	 Find the number EVNUM of elements of A which are even, and the number ODNUM of elements of A which are odd.    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/426940/426940/data-structure/</guid>
      <pubDate>Mon, 23 Jan 2012 05:49:07 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>NetLogo_GeneticProgramming</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/426880/426880/netlogo_geneticprogramming/</link>
      <description>&lt;span style="font-size: xx-small;"&gt;Hi all, I'm trying to figure out how does the genetic algorithm works? I don't understand what does random-seed in the program means? Is it number? A constant? If it is, why do we need it? &lt;br /&gt;
This is the program I'm talking about -&amp;gt; &lt;br /&gt;
&lt;a href="http://www.cs.northwestern.edu/~fjs750/netlogo/final/gpdemo.html"&gt;http://www.cs.northwestern.edu/~fjs750/netlogo/final/gpdemo.html&lt;/a&gt;&lt;br /&gt;
 Sorry for my bad English :( Thanks for reply :)&lt;/span&gt;&lt;span style="color: Green;"&gt;&lt;/span&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/426880/426880/netlogo_geneticprogramming/</guid>
      <pubDate>Thu, 19 Jan 2012 01:50:17 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Need Data Distribution Server algorithm</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/426740/426740/need-data-distribution-server-algorithm/</link>
      <description>Hi Everyone,&lt;br /&gt;
&lt;br /&gt;
I'm searching for an algorithm / how to appliy on:&lt;br /&gt;
a server that listens on one port (handles many TCP connections) and distributes data (after a small processing) recieved on the 'feed' port to all registered servers connected on the other port.&lt;br /&gt;
&lt;br /&gt;
I want to desgin the server for high performances &amp;amp; scalable abilities.&lt;br /&gt;
&lt;br /&gt;
thanks for the help,&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/426740/426740/need-data-distribution-server-algorithm/</guid>
      <pubDate>Sat, 07 Jan 2012 06:04:15 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Need Data Distribution Server algorithm</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/426739/426739/need-data-distribution-server-algorithm/</link>
      <description>Hi Everyone,&lt;br /&gt;
&lt;br /&gt;
I'm searching for an algorithm / how to appliy on:&lt;br /&gt;
a server that listens on one port (handles many TCP connections) and distributes data (after a small processing) recieved on the 'feed' port to all registered servers connected on the other port.&lt;br /&gt;
&lt;br /&gt;
I want to desgin the server for high performances &amp;amp; scalable abilities.&lt;br /&gt;
&lt;br /&gt;
thanks for the help,&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/426739/426739/need-data-distribution-server-algorithm/</guid>
      <pubDate>Sat, 07 Jan 2012 06:02:25 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Can anyone recognize what type(s) of algorithm(s) solve this problem?</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/426521/426521/can-anyone-recognize-what-types-of-algorithms-solve-this-problem/</link>
      <description>Hello guys,&lt;br /&gt;
I am having a big problem for the past several days with an algorithm design about this problem:&lt;br /&gt;
&lt;br /&gt;
The Context:&lt;br /&gt;
You have an employee assigned to a schedule. That schedule has start/end times, also possibly a lunch and few breaks. During his schedule he is doing his primary work.&lt;br /&gt;
The agent has several types of secondary activities, he has to accomplish during his schedule, each activity having a priority(can be the same) and an amount of time. Activities can be broken down to smaller blocks.&lt;br /&gt;
Each activity type has it's own definitions for Minimum and Maximum block lengths, and also Minimum interval length between blocks of the same type of activity, and different types of activities. There is also a setting, activity Block Increment step.&lt;br /&gt;
Each 5 minute schedule interval has a Score value, the higher the score, the better to place an activity there.&lt;br /&gt;
All intervals and blocks are snapped to 5 Minute boundaries.&lt;br /&gt;
&lt;br /&gt;
The Goal: &lt;br /&gt;
Assign all the required quantities of activities during the schedule, trying to honor these soft constraints, in the following order:&lt;br /&gt;
- to the best possible locations (best score)&lt;br /&gt;
- if there is not enough schedule space, assign the activities proportionally to their priority/requirement&lt;br /&gt;
- try to assign activities, so that fewer Schedule-Break-Lunch-Activity1-Activity2... transitions occur&lt;br /&gt;
&lt;br /&gt;
Thanks a lot in advance for any fresh idea out there:D&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/426521/426521/can-anyone-recognize-what-types-of-algorithms-solve-this-problem/</guid>
      <pubDate>Wed, 21 Dec 2011 02:17:28 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Help Encrypting on Windows 7 Home Premium</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/426461/426461/help-encrypting-on-windows-7-home-premium/</link>
      <description>Long story short, I need to encrypt folders on a Windows 7 Home Premium computer. I have no computer programming or hacking experience, and I  have googled for hours with no luck. I've tried using regedit and bitlocker to no avail. I haven't the slightest idea on how to use the command prompt or powershell. Everything I've read says since there is no EFS on home premium, I won't be able to encrypt. Is there really NO way to encrypt a document folder on this operating system?!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/426461/426461/help-encrypting-on-windows-7-home-premium/</guid>
      <pubDate>Sun, 18 Dec 2011 13:54:25 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>This post has been deleted.</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/426460/426460/this-post-has-been-deleted/</link>
      <description>This post has been deleted.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/426460/426460/this-post-has-been-deleted/</guid>
      <pubDate>Sun, 18 Dec 2011 13:45:49 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>c++, recursive loop, algorithm</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/426254/426254/c++-recursive-loop-algorithm/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
first of all i want to apologize for my english. I want to simplify the following thing:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
  for (int i = &lt;strong&gt;0&lt;/strong&gt;; i &amp;lt;= m; i++)
        for (int j = &lt;strong&gt;i&lt;/strong&gt;; j &amp;lt;= m; j++)
            for (int k = &lt;strong&gt;j&lt;/strong&gt;; k &amp;lt;= m; k++)
                     .
                     .
                     .
                       cout &amp;lt;&amp;lt;  i &amp;lt;&amp;lt; "   " &amp;lt;&amp;lt; j &amp;lt;&amp;lt; "   " &amp;lt;&amp;lt; k &amp;lt;&amp;lt; ... &amp;lt;&amp;lt;  endl;

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
For example if I give 7 on the beginning, then lets do this loop to the g.&lt;br /&gt;
&lt;br /&gt;
Thank you in advance! &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/426254/426254/c++-recursive-loop-algorithm/</guid>
      <pubDate>Sun, 11 Dec 2011 12:01:38 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>vhdl</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/425900/425900/vhdl/</link>
      <description>how to write the code for run's of zeroes ended with 1...&lt;br /&gt;
eg:0001&lt;br /&gt;
   3&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/425900/425900/vhdl/</guid>
      <pubDate>Sun, 20 Nov 2011 05:10:23 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Unknow Compression Algorithm</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/425899/425899/unknow-compression-algorithm/</link>
      <description>Hi all, this is my first topic.&lt;br /&gt;
I'm trying to understand a compression algorithm used by a games maker, preface they themselves have released a small program to unzip their files for modding, then I suppose isn't illegal.&lt;br /&gt;
The two files for comparison were obtained from the original game (compressed), and from file uncompressed by the released program (is a exe).&lt;br /&gt;
&lt;br /&gt;
Obviously is a proprietary program then the source code is not released, but certainly from a first analysis with a hex editor seems to be intuitive:&lt;br /&gt;
If you see the string "Scene Root" is rewritten equal, the string "bone_root" is written "bone_r" because i suppose "oot" string is already in the previous string. :wtf:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://dl.dropbox.com/u/47659776/ballista_crank.zip"&gt;http://dl.dropbox.com/u/47659776/ballista_crank.zip&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
After this introduction someone can enlighten me ? I would be very grateful !&lt;br /&gt;
The purpose of this is just to understand if the same method was used to compress an animations used by the game in some special cases, however, is already dated and now unpacked to 99% with programs made ​​by its to support modding, butt this aspect have been neglected and no longer offer support for this game.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/425899/425899/unknow-compression-algorithm/</guid>
      <pubDate>Sun, 20 Nov 2011 03:31:06 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>This post has been deleted.</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/425898/425898/this-post-has-been-deleted/</link>
      <description>This post has been deleted.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/425898/425898/this-post-has-been-deleted/</guid>
      <pubDate>Sun, 20 Nov 2011 03:27:23 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>fotran95: "random_seed()" function problem...help!</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/425751/425751/fotran95-random_seed-function-problemhelp/</link>
      <description>Hello everone!So i am writing this code where I am producoing random numbers from a generator through a subroutine.Then I call the subroutine and pass them through a Gaussian distribution.I have problem with my seed subroutine: my program compiles but when i try to execute it complain that "Random_seed(): PUT array too small" i have no idea what does this means!Here is my subroutine:&lt;br /&gt;
subroutine setSEED (seed)&lt;br /&gt;
implicit none&lt;br /&gt;
real*8:: x&lt;br /&gt;
integer, dimension(2), intent(inout):: seed&lt;br /&gt;
if (seed(1) == 0.0) &amp;amp; &lt;br /&gt;
 seed = floor(1000*secnds(0.0)) +(/0, 37 /) &amp;lt;--- this line is where it                          &lt;br /&gt;
                                                       complains    call random_seed(put=seed) &amp;lt;---...and here&lt;br /&gt;
&lt;br /&gt;
end subroutine setSEED&lt;br /&gt;
&lt;br /&gt;
and my gaussian distribution function :&lt;br /&gt;
Real*8 Function gasdev(idum) &lt;br /&gt;
implicit none&lt;br /&gt;
integer, intent(inout) :: idum&lt;br /&gt;
integer, save::iset&lt;br /&gt;
real*8:: fac,rsq,v1,v2&lt;br /&gt;
real*8, dimension(2) :: x&lt;br /&gt;
real*8, save :: gset&lt;br /&gt;
if (idum.lt.0) iset=0&lt;br /&gt;
if (iset.eq.0) then&lt;br /&gt;
 rsq = 0.0&lt;br /&gt;
do while (rsq &amp;gt; 1.0.or.rsq==0) &lt;br /&gt;
 call random_number(x)&lt;br /&gt;
 v1=2.*x(1)-1&lt;br /&gt;
 v2=2.*x(2)-1&lt;br /&gt;
 rsq=v1**2+v2**2&lt;br /&gt;
end do	&lt;br /&gt;
&lt;br /&gt;
fac=sqrt(-2.*log(rsq)/rsq)&lt;br /&gt;
gset=v1*fac&lt;br /&gt;
gasdev=v2*fac&lt;br /&gt;
iset=1&lt;br /&gt;
else&lt;br /&gt;
gasdev=gset&lt;br /&gt;
iset=0&lt;br /&gt;
endif&lt;br /&gt;
&lt;br /&gt;
return&lt;br /&gt;
end Function gasdev&lt;br /&gt;
....AND MY MAIN PROGRAM:&lt;br /&gt;
program mainprog&lt;br /&gt;
 implicit none&lt;br /&gt;
 real*8::angle,gasdev,number&lt;br /&gt;
 integer::i&lt;br /&gt;
 integer, dimension(2) :: seed = 0&lt;br /&gt;
call setSEED(seed)&lt;br /&gt;
&lt;br /&gt;
Do i=1,10,1&lt;br /&gt;
 angle=gasdev(seed) &lt;br /&gt;
 print*,"angle=gasdev =",angle&lt;br /&gt;
 write(299,*),angle&lt;br /&gt;
end do&lt;br /&gt;
end program mainprog&lt;br /&gt;
Do you guys think can help me?its so frustrating!!!thank you all!!! &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/425751/425751/fotran95-random_seed-function-problemhelp/</guid>
      <pubDate>Sat, 12 Nov 2011 14:44:34 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>fotran95: "random_seed()" function problem...help!</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/425750/425750/fotran95-random_seed-function-problemhelp/</link>
      <description>Hello everone!So i am writing this code where I am producoing random numbers from a generator through a subroutine.Then I call the subroutine and pass them through a Gaussian distribution.I have problem with my seed subroutine: my program compiles but when i try to execute it complain that "Random_seed(): PUT array too small" i have no idea what does this means!&lt;br /&gt;
&lt;br /&gt;
Here is my subroutine:&lt;br /&gt;
subroutine setSEED (seed)&lt;br /&gt;
implicit none&lt;br /&gt;
&lt;br /&gt;
real*8:: x&lt;br /&gt;
integer, dimension(2), intent(inout):: seed&lt;br /&gt;
if (seed(1) == 0.0) &amp;amp; &lt;br /&gt;
seed = floor(1000*secnds(0.0)) +(/0, 37 /) &amp;lt;--- this is where it complains&lt;br /&gt;
call random_seed(put=seed) &amp;lt;---...and here&lt;br /&gt;
&lt;br /&gt;
end subroutine setSEED&lt;br /&gt;
&lt;br /&gt;
and my gaussian distribution :&lt;br /&gt;
&lt;br /&gt;
Real*8 Function gasdev(idum) &lt;br /&gt;
implicit none&lt;br /&gt;
integer, intent(inout) :: idum&lt;br /&gt;
integer, save::iset&lt;br /&gt;
real*8:: fac,rsq,v1,v2&lt;br /&gt;
real*8, dimension(2) :: x&lt;br /&gt;
real*8, save :: gset&lt;br /&gt;
!data iset/0/&lt;br /&gt;
if (idum.lt.0) iset=0&lt;br /&gt;
if (iset.eq.0) then&lt;br /&gt;
rsq = 0.0&lt;br /&gt;
do while (rsq &amp;gt; 1.0.or.rsq==0) &lt;br /&gt;
call random_number(x)&lt;br /&gt;
v1=2.*x(1)-1&lt;br /&gt;
v2=2.*x(2)-1&lt;br /&gt;
rsq=v1**2+v2**2&lt;br /&gt;
&lt;br /&gt;
end do	&lt;br /&gt;
&lt;br /&gt;
fac=sqrt(-2.*log(rsq)/rsq)&lt;br /&gt;
gset=v1*fac&lt;br /&gt;
gasdev=v2*fac&lt;br /&gt;
iset=1&lt;br /&gt;
else&lt;br /&gt;
gasdev=gset&lt;br /&gt;
iset=0&lt;br /&gt;
endif&lt;br /&gt;
&lt;br /&gt;
return&lt;br /&gt;
&lt;br /&gt;
end Function gasdev&lt;br /&gt;
&lt;br /&gt;
....AND MY MAIN PROGRAM:&lt;br /&gt;
&lt;br /&gt;
program mainprog&lt;br /&gt;
&lt;br /&gt;
implicit none&lt;br /&gt;
&lt;br /&gt;
real*8::angle,gasdev,number&lt;br /&gt;
integer::i&lt;br /&gt;
integer, dimension(2) :: seed = 0&lt;br /&gt;
&lt;br /&gt;
open(299,FILE='gauss.dat',STATUS='REPLACE')&lt;br /&gt;
&lt;br /&gt;
call setSEED(seed)&lt;br /&gt;
&lt;br /&gt;
Do i=1,10,1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
angle=gasdev(seed) &lt;br /&gt;
print*,"angle=gasdev =",angle&lt;br /&gt;
write(299,*),angle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
end do&lt;br /&gt;
&lt;br /&gt;
close(299,STATUS="KEEP")&lt;br /&gt;
end program mainprog&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do you guys think can help me?its so frustrating!!!thank you all!!! &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/425750/425750/fotran95-random_seed-function-problemhelp/</guid>
      <pubDate>Sat, 12 Nov 2011 14:37:15 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Fortran95-"random_seed()" function : problem!help!!</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/425749/425749/fortran95-random_seed-function--problemhelp/</link>
      <description>Hello everone!So i am writing this code where I am producoing random numbers from a generator through a subroutine.Then I call the subroutine and pass them through a Gaussian distribution.I have problem with my seed subroutine: my program compiles but when i try to execute it complain that "Random_seed(): PUT array too small" i have no idea what does this means!&lt;br /&gt;
&lt;br /&gt;
Here is my subroutine:&lt;br /&gt;
subroutine setSEED (seed)&lt;br /&gt;
implicit none&lt;br /&gt;
&lt;br /&gt;
real*8:: x&lt;br /&gt;
integer, dimension(2), intent(inout):: seed&lt;br /&gt;
if (seed(1) == 0.0) &amp;amp; &lt;br /&gt;
seed = floor(1000*secnds(0.0)) +(/0, 37 /) &amp;lt;--- this is where it complains&lt;br /&gt;
call random_seed(put=seed) &amp;lt;---...and here&lt;br /&gt;
&lt;br /&gt;
end subroutine setSEED&lt;br /&gt;
&lt;br /&gt;
and my gaussian distribution :&lt;br /&gt;
&lt;br /&gt;
Real*8 Function gasdev(idum) &lt;br /&gt;
implicit none&lt;br /&gt;
integer, intent(inout) :: idum&lt;br /&gt;
integer, save::iset&lt;br /&gt;
real*8:: fac,rsq,v1,v2&lt;br /&gt;
real*8, dimension(2) :: x&lt;br /&gt;
real*8, save :: gset&lt;br /&gt;
!data iset/0/&lt;br /&gt;
if (idum.lt.0) iset=0&lt;br /&gt;
if (iset.eq.0) then&lt;br /&gt;
rsq = 0.0&lt;br /&gt;
do while (rsq &amp;gt; 1.0.or.rsq==0) &lt;br /&gt;
call random_number(x)&lt;br /&gt;
v1=2.*x(1)-1&lt;br /&gt;
v2=2.*x(2)-1&lt;br /&gt;
rsq=v1**2+v2**2&lt;br /&gt;
&lt;br /&gt;
end do	&lt;br /&gt;
&lt;br /&gt;
fac=sqrt(-2.*log(rsq)/rsq)&lt;br /&gt;
gset=v1*fac&lt;br /&gt;
gasdev=v2*fac&lt;br /&gt;
iset=1&lt;br /&gt;
else&lt;br /&gt;
gasdev=gset&lt;br /&gt;
iset=0&lt;br /&gt;
endif&lt;br /&gt;
&lt;br /&gt;
return&lt;br /&gt;
&lt;br /&gt;
end Function gasdev&lt;br /&gt;
&lt;br /&gt;
....AND MY MAIN PROGRAM:&lt;br /&gt;
&lt;br /&gt;
program mainprog&lt;br /&gt;
&lt;br /&gt;
implicit none&lt;br /&gt;
&lt;br /&gt;
real*8::angle,gasdev,number&lt;br /&gt;
integer::i&lt;br /&gt;
integer, dimension(2) :: seed = 0&lt;br /&gt;
&lt;br /&gt;
open(299,FILE='gauss.dat',STATUS='REPLACE')&lt;br /&gt;
&lt;br /&gt;
call setSEED(seed)&lt;br /&gt;
&lt;br /&gt;
Do i=1,10,1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
angle=gasdev(seed) &lt;br /&gt;
print*,"angle=gasdev =",angle&lt;br /&gt;
write(299,*),angle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
end do&lt;br /&gt;
&lt;br /&gt;
close(299,STATUS="KEEP")&lt;br /&gt;
end program mainprog&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do you guys think can help me?its so frustrating!!!thank you all!!! &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/425749/425749/fortran95-random_seed-function--problemhelp/</guid>
      <pubDate>Sat, 12 Nov 2011 14:34:22 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Fortran95-"random_seed()" function : problem!help!!</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/425748/425748/fortran95-random_seed-function--problemhelp/</link>
      <description>Hello everone!So i am writing this code where I am producoing random numbers from a generator through a subroutine.Then I call the subroutine and pass them through a Gaussian distribution.I have problem with my seed subroutine: my program compiles but when i try to execute it complain that "Random_seed(): PUT array too small" i have no idea what does this means!&lt;br /&gt;
&lt;br /&gt;
Here is my subroutine:&lt;br /&gt;
subroutine setSEED (seed)&lt;br /&gt;
implicit none&lt;br /&gt;
&lt;br /&gt;
real*8:: x&lt;br /&gt;
integer, dimension(2), intent(inout):: seed&lt;br /&gt;
if (seed(1) == 0.0) &amp;amp; &lt;br /&gt;
seed = floor(1000*secnds(0.0)) +(/0, 37 /) &amp;lt;--- this is where it complains&lt;br /&gt;
call random_seed(put=seed) &amp;lt;---...and here&lt;br /&gt;
&lt;br /&gt;
end subroutine setSEED&lt;br /&gt;
&lt;br /&gt;
and my gaussian distribution :&lt;br /&gt;
&lt;br /&gt;
Real*8 Function gasdev(idum) &lt;br /&gt;
implicit none&lt;br /&gt;
integer, intent(inout) :: idum&lt;br /&gt;
integer, save::iset&lt;br /&gt;
real*8:: fac,rsq,v1,v2&lt;br /&gt;
real*8, dimension(2) :: x&lt;br /&gt;
real*8, save :: gset&lt;br /&gt;
!data iset/0/&lt;br /&gt;
if (idum.lt.0) iset=0&lt;br /&gt;
if (iset.eq.0) then&lt;br /&gt;
rsq = 0.0&lt;br /&gt;
do while (rsq &amp;gt; 1.0.or.rsq==0) &lt;br /&gt;
call random_number(x)&lt;br /&gt;
v1=2.*x(1)-1&lt;br /&gt;
v2=2.*x(2)-1&lt;br /&gt;
rsq=v1**2+v2**2&lt;br /&gt;
&lt;br /&gt;
end do	&lt;br /&gt;
&lt;br /&gt;
fac=sqrt(-2.*log(rsq)/rsq)&lt;br /&gt;
gset=v1*fac&lt;br /&gt;
gasdev=v2*fac&lt;br /&gt;
iset=1&lt;br /&gt;
else&lt;br /&gt;
gasdev=gset&lt;br /&gt;
iset=0&lt;br /&gt;
endif&lt;br /&gt;
&lt;br /&gt;
return&lt;br /&gt;
&lt;br /&gt;
end Function gasdev&lt;br /&gt;
&lt;br /&gt;
....AND MY MAIN PROGRAM:&lt;br /&gt;
&lt;br /&gt;
program mainprog&lt;br /&gt;
&lt;br /&gt;
implicit none&lt;br /&gt;
&lt;br /&gt;
real*8::angle,gasdev,number&lt;br /&gt;
integer::i&lt;br /&gt;
integer, dimension(2) :: seed = 0&lt;br /&gt;
&lt;br /&gt;
open(299,FILE='gauss.dat',STATUS='REPLACE')&lt;br /&gt;
&lt;br /&gt;
call setSEED(seed)&lt;br /&gt;
&lt;br /&gt;
Do i=1,10,1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
angle=gasdev(seed) &lt;br /&gt;
print*,"angle=gasdev =",angle&lt;br /&gt;
write(299,*),angle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
end do&lt;br /&gt;
&lt;br /&gt;
close(299,STATUS="KEEP")&lt;br /&gt;
end program mainprog&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do you guys think can help me?its so frustrating!!!thank you all!!! &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/425748/425748/fortran95-random_seed-function--problemhelp/</guid>
      <pubDate>Sat, 12 Nov 2011 14:32:32 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>DataGrid / storing massive data</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/425393/425393/datagrid--storing-massive-data/</link>
      <description>Hi,&lt;br /&gt;
don't know where to post this question. Could fit in several categories...&lt;br /&gt;
&lt;br /&gt;
I'm currently working on a big project where we have a server (written in Java 1.6) and an client (Silverlight / C#).&lt;br /&gt;
&lt;br /&gt;
At the moment we are in the concept phase for a DataGrid-Control.&lt;br /&gt;
And we're really struggling around with memory management on the server side.&lt;br /&gt;
&lt;br /&gt;
Imagine following scenario:&lt;br /&gt;
 - 1 DataGrid = 10,000 rows x 20 columns = 200,000 cells&lt;br /&gt;
 - each cell has about 30 properties (forecolor, backcolor, value, ...)&lt;br /&gt;
&lt;br /&gt;
That would make 6,000,000 properties the server has to store - PER DATAGRID!&lt;br /&gt;
&lt;br /&gt;
If there are 10 users, each one viewing 10 datagrids this will exceed memory on every 32bit machine... (datagrids are by far not the only thing the server has to handle)&lt;br /&gt;
&lt;br /&gt;
So how could this be done? How to reduce memory to an absolute minimum?&lt;br /&gt;
Any best practices?&lt;br /&gt;
&lt;br /&gt;
Would really appreciate to hear your oppinions!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PS: Must say that we are not completely clueless. We currently have a not-so-bad attempt. But I'd like to hear your suggestions first. :)&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/425393/425393/datagrid--storing-massive-data/</guid>
      <pubDate>Tue, 25 Oct 2011 13:54:21 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>A mobile implementation of genetic algorithms for Android devices.</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/425333/425333/a-mobile-implementation-of-genetic-algorithms-for-android-devices/</link>
      <description>&lt;br /&gt;
It can run for any mathematical function which can be described with Java language and its Math package.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://market.android.com/details?id=org.baatar.mobile.android.optimization.genetic.activity"&gt;https://market.android.com/details?id=org.baatar.m
obile.android.optimization.genetic.activity&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/425333/425333/a-mobile-implementation-of-genetic-algorithms-for-android-devices/</guid>
      <pubDate>Fri, 21 Oct 2011 04:18:16 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Data Structure</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/424590/424590/data-structure/</link>
      <description>Wats the diff between Dijikstra and minimum spanning tree&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/424590/424590/data-structure/</guid>
      <pubDate>Sun, 21 Aug 2011 03:52:49 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Segmentation algorithm</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/424463/424463/segmentation-algorithm/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I look for an algorithm to "slice" a population of ordered values into subsets (groups) that maintain the order of the values.&lt;br /&gt;
&lt;br /&gt;
For example, I have a population of 50 ordered values (1,2,3,...,50) and I want to "slice" it first into two groups (one cutoff point), then into three groups (two cutoff points), then into four groups (three cutoff points) etc. until a specific number of cutoff points (e.g., size of population divided over 2; max of 25 cutoff points in this example). The order of the original values has to be maintained.&lt;br /&gt;
&lt;br /&gt;
Can you recommend any appropriate general-purpose algorithm? &lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Chris&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/424463/424463/segmentation-algorithm/</guid>
      <pubDate>Fri, 05 Aug 2011 11:53:49 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Bentley Ottman and Line Sweep algorithms in general</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/424355/424355/bentley-ottman-and-line-sweep-algorithms-in-general/</link>
      <description>Hi! :) I am in need of an algorithm that will tell me all of the intersection points in a given array of lines.&lt;br /&gt;
&lt;br /&gt;
At first, I went googling "Line intersection point". I got lots of algebra, which  could have solved, but computers... Not so much. I have no clue how to convert algebra to a computer program. That's question one.&lt;br /&gt;
&lt;br /&gt;
As I went through this I came across a quote: "A naive algorithm would attempt to analyze all lines in an array, and calculate each line's intersection" (Or something like that). That's exactly where I was heading. The quote lead me towards the Bently Ottman algorithm which uses a Line Sweep method. Line seeps themselves confuse me -- I could find nothing actually explaining their inner workings, just that they basically sweep, typically horizontally, and put down any information they find that is of relevance along the way. That deeply troubled me, but, since Line Sweeps are just ideas, not really hard algorithms, I went back to Bently Ottman. I could find nothing on how THAT internally works either, just more of "how you can visualize it". his is where I get really confused.&lt;br /&gt;
&lt;br /&gt;
In order for it to be detecting intersections, shouldn't it be, say, going at infinitesimally small jumps? How could this possibly be efficient. So, okay, maybe it just jumps to where things intersect, and vertices. How can that be possible when it does not know where the intersections are? Okay, maybe it jumps at static lengths. Then, more often than not, it'll jump completely over all the vertices and intersections!&lt;br /&gt;
&lt;br /&gt;
Just now it occurs to me -- Maybe it goes across each vertex, and whenever it comes across more than one at the same time, it calculates the intersection for those and jumps there or to the next vertex. That makes more sense to me. The question is left though, how best to calculate the intersection point?&lt;br /&gt;
&lt;br /&gt;
Thanks for any answers that can be given, Flynn&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/424355/424355/bentley-ottman-and-line-sweep-algorithms-in-general/</guid>
      <pubDate>Fri, 22 Jul 2011 10:39:59 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Very urgent Help needed..Regarding Pseudo code for graph related work</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/424193/424193/very-urgent-help-neededregarding-pseudo-code-for-graph-related-work/</link>
      <description>Hi everyone! &lt;br /&gt;
&lt;br /&gt;
I would appreciate if I can be given some help to solve thus riddle (my project task) to find out the solution. I really need the pseudo code for this which fully solve this problem. I am really dying to solve this problem as I have been working for last two months to solve this but can't get the answer to this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROBLEM&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
Assuming you have a graph G whose edges are labeled with the distance between each pair of vertices they connect. Given two vertices a and b in G, and a distance n as input, write an algorithm in pseudo-code to find out if there is a path from a to b with cumulative distance less than n.&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
I will be very much thankful for any help in this regards&lt;br /&gt;
&lt;br /&gt;
Thanks in advance&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/424193/424193/very-urgent-help-neededregarding-pseudo-code-for-graph-related-work/</guid>
      <pubDate>Tue, 05 Jul 2011 16:45:59 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Very urgent help .... regarding Pseudo code for graphs related problem</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/424186/424186/very-urgent-help--regarding-pseudo-code-for-graphs-related-problem/</link>
      <description>Hi everyone! &lt;br /&gt;
&lt;br /&gt;
I would appreciate if I can be given some help to solve thus riddle (my project task) to find out the solution. I really need the pseudo code for this which fully solve this problem. I  am really dying to solve this problem as I have been working for last two months to solve this but can't get the answer to this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PROBLEM&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
Assuming you have a graph &lt;em&gt;G&lt;/em&gt; whose edges are labeled with the distance between each pair of vertices they connect. Given two vertices &lt;em&gt;a&lt;/em&gt; and &lt;em&gt;b&lt;/em&gt; in&lt;em&gt; G&lt;/em&gt;, and a distance &lt;em&gt;n&lt;/em&gt; as input, write an algorithm in pseudo-code to find out if there is a path from &lt;em&gt;a&lt;/em&gt; to &lt;em&gt;b&lt;/em&gt; with cumulative distance less than &lt;em&gt;n&lt;/em&gt;.&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
I will be very much thankful for any help in this regards&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Kashi &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/424186/424186/very-urgent-help--regarding-pseudo-code-for-graphs-related-problem/</guid>
      <pubDate>Mon, 04 Jul 2011 23:18:40 -0800</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>genetic algorithm to optimize static evaluation function</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/424169/424169/genetic-algorithm-to-optimize-static-evaluation-function/</link>
      <description>Hi guys. I'm supposed to do a computer game for a school project. So I chose five in a row. I'm using a standard minimax algorithm. I also want to somehow optimize the static evaluation function, so I thought about using genetic algorithm to do this. The evaluation function has some parameters, so I would generate several sets of those parametrs and let them play against each other, and then I'd replace the one with the poorest result with some combination of the two with the best result and this would go on for some time. Question is: Could this produce a viable result or is it inapropriate to use genetic algorithm for this problem? I mean doesn't it create some problems because the result of one set depends on the other ones?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/424169/424169/genetic-algorithm-to-optimize-static-evaluation-function/</guid>
      <pubDate>Sun, 03 Jul 2011 08:21:15 -0800</pubDate>
      <category>Algorithms</category>
    </item>
  </channel>
</rss>
