<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: python code...convert to ksh or sh in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023952#M762355</link>
    <description>thanks,&lt;BR /&gt;&lt;BR /&gt;Bingo..yes my code comes from that page..I wanted to see how does it work...I have no experience in python that is why I ask if anyone can help me out to compile it thru ksh or sh...&lt;BR /&gt;&lt;BR /&gt;I would not like to install python..I would prefare if someone can help me out with his..becouse I plan to upgrade this method..and add new modules in shell..??&lt;BR /&gt;&lt;BR /&gt;Regards..any help is very welcome????</description>
    <pubDate>Mon, 22 Jan 2007 04:30:11 GMT</pubDate>
    <dc:creator>amonamon</dc:creator>
    <dc:date>2007-01-22T04:30:11Z</dc:date>
    <item>
      <title>python code...convert to ksh or sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023950#M762353</link>
      <description>Helloo...&lt;BR /&gt;&lt;BR /&gt;I am not much familiar with python..I found this small script in python I even do not have python on my computer...can anyone help me out to convert this into ksh or sh..&lt;BR /&gt;&lt;BR /&gt;PLEASE any help I will appreciate..&lt;BR /&gt;&lt;BR /&gt;here is python code..&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/env python&lt;BR /&gt;import random # Get a random number generator.&lt;BR /&gt;NTRIALS = 10000 # Enough trials to get an reasonably accurate answer.&lt;BR /&gt;NPEOPLE = 30 # How many people in the group?&lt;BR /&gt;matches = 0 # Keep track of how many trials have matching birthdays.&lt;BR /&gt;for trial in range(NTRIALS): # Do a bunch of trials...&lt;BR /&gt;taken = {} # A place to keep track of which birthdays&lt;BR /&gt;# are already taken on this trial.&lt;BR /&gt;for person in range(NPEOPLE): # Put the people’s birthdays down, one at a time...&lt;BR /&gt;day = random.randint(0, 365) # On a randomly chosen day.&lt;BR /&gt;if day in taken:&lt;BR /&gt;matches += 1 # A match!&lt;BR /&gt;break # No need to look for more than one.&lt;BR /&gt;taken[day] = 1 # Mark the day as taken.</description>
      <pubDate>Mon, 22 Jan 2007 03:31:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023950#M762353</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2007-01-22T03:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: python code...convert to ksh or sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023951#M762354</link>
      <description>Hi,&lt;BR /&gt;If you do not have python on your machine, you are not riunning the codse currently, so why do you want to port it ?&lt;BR /&gt;&lt;BR /&gt;You can use the Random Number Generator (RNG)product:&lt;BR /&gt;&lt;A href="http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=KRNG11I" target="_blank"&gt;http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=KRNG11I&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Your python code comes from:&lt;BR /&gt;kochanski.org/gpk/./teaching/0501Oxford/MonteCarlo.pdf &lt;BR /&gt;&lt;BR /&gt;Could you also please revisit your previous threads and tidy them up (award points and close), for example:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1086922" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1086922&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Jan 2007 04:02:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023951#M762354</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2007-01-22T04:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: python code...convert to ksh or sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023952#M762355</link>
      <description>thanks,&lt;BR /&gt;&lt;BR /&gt;Bingo..yes my code comes from that page..I wanted to see how does it work...I have no experience in python that is why I ask if anyone can help me out to compile it thru ksh or sh...&lt;BR /&gt;&lt;BR /&gt;I would not like to install python..I would prefare if someone can help me out with his..becouse I plan to upgrade this method..and add new modules in shell..??&lt;BR /&gt;&lt;BR /&gt;Regards..any help is very welcome????</description>
      <pubDate>Mon, 22 Jan 2007 04:30:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023952#M762355</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2007-01-22T04:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: python code...convert to ksh or sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023953#M762356</link>
      <description>right..I did close previus thread..sorryy that I forgot that one..&lt;BR /&gt;&lt;BR /&gt;I still hope I will get more help on this one?!?</description>
      <pubDate>Mon, 22 Jan 2007 04:35:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023953#M762356</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2007-01-22T04:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: python code...convert to ksh or sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023954#M762357</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I remember discussing "the birthday" problem in one of my CS classes...&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;typeset -i NTRIALS=10000&lt;BR /&gt;typeset -i NPEOPLE=30&lt;BR /&gt;set -A TAKEN&lt;BR /&gt;typeset -i MATCHES=0&lt;BR /&gt;typeset -i CURTRIAL=0&lt;BR /&gt;typeset -i DAY&lt;BR /&gt;&lt;BR /&gt;while [[ ${CURTRIAL} -lt ${NTRIALS} ]]&lt;BR /&gt;do&lt;BR /&gt;        DAY=$(( ${RANDOM}%365 ))&lt;BR /&gt;        if [[ ${TAKEN[${DAY}]:--1} -gt 0 ]]&lt;BR /&gt;        then&lt;BR /&gt;                MATCHES=$(( ${MATCHES}+1 ))&lt;BR /&gt;                TAKEN[${DAY}]=$(( ${TAKEN[${DAY}]}+1 ))&lt;BR /&gt;        else&lt;BR /&gt;                TAKEN[${DAY}]=1&lt;BR /&gt;        fi&lt;BR /&gt;        #echo "Trial: ${CURTRIAL} Day: ${DAY} Matches: ${MATCHES}"&lt;BR /&gt;        CURTRIAL=$(( ${CURTRIAL}+1 ))&lt;BR /&gt;done&lt;BR /&gt;echo "Matches: ${MATCHES}"&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Mon, 22 Jan 2007 08:59:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023954#M762357</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-01-22T08:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: python code...convert to ksh or sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023955#M762358</link>
      <description>Thanks a lot...I do appreciate it..&lt;BR /&gt;&lt;BR /&gt;Regards..</description>
      <pubDate>Tue, 23 Jan 2007 01:43:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023955#M762358</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2007-01-23T01:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: python code...convert to ksh or sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023956#M762359</link>
      <description>Thanks everyone..</description>
      <pubDate>Tue, 23 Jan 2007 01:43:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/python-code-convert-to-ksh-or-sh/m-p/5023956#M762359</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2007-01-23T01:43:42Z</dc:date>
    </item>
  </channel>
</rss>

