<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Bytes - answers</title>
		<link>http://bytes.com</link>
		<description>Java programming language (Sun Microsystems) - Get answers to questions about Java programming, OOP, JRE, SDK, Swing, Plugins, Java Virtual Machine(JVM), Java Libraries: Collection, XML Processing, Security, JDBC, JNDI, RMI, CORBA, AWT (GUI) and more.</description>
		<language>en</language>
		<lastBuildDate>Fri, 20 Nov 2009 22:07:13 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://bytes.com/images/misc/rss.jpg</url>
			<title>Bytes - answers</title>
			<link>http://bytes.com</link>
		</image>
		<item>
			<title>Capturing equivalent file size given a String</title>
			<link>http://bytes.com/topic/java/answers/877371-capturing-equivalent-file-size-given-string</link>
			<pubDate>Fri, 20 Nov 2009 15:47:32 GMT</pubDate>
			<description>Is there a way to capture the equivalent file size(text) given a String? 
 
Any ideas? 
 
P.S Except for saving the text into a file first before...</description>
			<content:encoded><![CDATA[<div>Is there a way to capture the equivalent file size(text) given a String?<br />
<br />
Any ideas?<br />
<br />
P.S Except for saving the text into a file first before getting its file size...</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>sukatoa</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877371-capturing-equivalent-file-size-given-string</guid>
		</item>
		<item>
			<title>Text Encoding and Decoding</title>
			<link>http://bytes.com/topic/java/answers/877360-text-encoding-decoding</link>
			<pubDate>Fri, 20 Nov 2009 12:17:02 GMT</pubDate>
			<description><![CDATA[I'm trying to write *ISO8859_8*->*UNICODE*->*ISO8859_8* translator (the simplest as possible), but application doesn't seem to work properly. Can you...]]></description>
			<content:encoded><![CDATA[<div>I'm trying to write <b>ISO8859_8</b>-&gt;<b>UNICODE</b>-&gt;<b>ISO8859_8</b> translator (the simplest as possible), but application doesn't seem to work properly. Can you people, please, help me out? <br />
<br />
<!-- CODE -->
<div id="codeHolder" class="codeHolder" style="width: 500px;">
<div class="codeHeader">
	<span class="codeLink" onclick="Blur(this, this.parentNode.parentNode, getChildren(this),true);">Expand</span><span class="codeDivider">|</span><span class="codeLink" onclick="selectAll(this);">Select</span><span class="codeDivider">|</span><span class="codeLink" onclick="WordWrap(this);">Wrap</span><span class="codeDivider">|</span><span class="codeLink" onclick="LineNumbers(this);">Line Numbers</span>
</div>

<div class="codeContent" style="display: block; width: 500px; white-space: nowrap;">
	<ol START="1" highlight="true">

<li class="codeLI">import&nbsp;java.io.*;&nbsp;</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
public&nbsp;class&nbsp;Main&nbsp;{</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;static&nbsp;void&nbsp;main(String[]&nbsp;args)&nbsp;throws&nbsp;IOException&nbsp;{</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BufferedReader&nbsp;in&nbsp;=&nbsp;new&nbsp;BufferedReader(new&nbsp;InputStreamReader(System.in));</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;text&nbsp;=&nbsp;in.readLine();</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PrintStream&nbsp;out&nbsp;=&nbsp;new&nbsp;PrintStream(System.out,&nbsp;true,&nbsp;&quot;UnicodeLittleUnmarked&quot;);</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;out.println(&nbsp;&nbsp;&nbsp;&nbsp;En_De_CODE.encode(text)&nbsp;&nbsp;&nbsp;&nbsp;);</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
}</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
class&nbsp;En_De_CODE&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;static&nbsp;String&nbsp;encode(String&nbsp;s)&nbsp;throws&nbsp;UnsupportedEncodingException&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;s&nbsp;=&nbsp;&quot;&#1488;&#1497;&#1500;&#1497;&#1492;&quot;;&nbsp;//&nbsp;ISO8859_8</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;new&nbsp;String(s.getBytes(&quot;UnicodeLittleUnmarked&quot;));&nbsp;//&nbsp;to&nbsp;Unicode&nbsp;Little&nbsp;Endian</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;static&nbsp;String&nbsp;decode(String&nbsp;s)&nbsp;throws&nbsp;UnsupportedEncodingException&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;s&nbsp;=&nbsp;&quot;Ilja&quot;;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;new&nbsp;String(s.getBytes(&quot;ISO8859_8&quot;));&nbsp;//&nbsp;to&nbsp;Latin/Hebrew</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">
}</li>

	</ol>
</div>
</div>
<!-- /CODE -->


run: (input and output)<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="6" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2">
			<hr />
			
				&#1488;&#1497;&#1500;&#1497;&#1492;<br />
? ? ? ? ?
			
			<hr />
		</td>
	</tr>
	</table>
</div></div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>EntryTeam</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877360-text-encoding-decoding</guid>
		</item>
		<item>
			<title>Jsp</title>
			<link>http://bytes.com/topic/java/answers/877354-jsp</link>
			<pubDate>Fri, 20 Nov 2009 10:34:59 GMT</pubDate>
			<description>I was always looking to create a registration page and a login page so whichever users visiting my website can create an account so that I can have...</description>
			<content:encoded><![CDATA[<div>I was always looking to create a registration page and a login page so whichever users visiting my website can create an account so that I can have some details about the user who is using on my website.<br />
<br />
So, I wanted something like this &gt;&gt;<br />
<br />
1. To create a registration form with the following fields:<br />
<br />
Username<br />
Password<br />
Email Address<br />
Address<br />
Tel<br />
Occupation<br />
Hobbies<br />
<br />
And then their should be 2 buttons at the end of the page -&gt; Submit , Reset<br />
<br />
Then when the user clicks on the Submit button, all of these details should be stored in a Database, say for e.g. wamp server PhpAdmin<br />
<br />
<br />
After this, I wanted to create a Login page wherein a user enters his name and password and clicks on the Login button. As soon as he clicks on the Login button, the website should go to the database and match the username and password entered by the user with the data in the database (In other words, validating Username &amp; Password with the database).<br />
<br />
If his username and password matches, then he should successfully login into the website.<br />
<br />
If his username does not match, then it should display a message, 'No such Username' and if his password does not match, then if should show a message 'Invalid Password' and provide a link to 'Forgot your Password' page.<br />
<br />
Next, I want to create a Forgot your Password page wherein the User is asked to enter his username or email address and if it matches, then the password should be sent to his email address which was provided at the time of registration.<br />
and he should be displayed a message that an email containing a password has been sent to his email address (The email address should be displayed where the password is sent)<br />
<br />
Can any body help me out all this stuff using JSP.</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>naharol</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877354-jsp</guid>
		</item>
		<item>
			<title>Mp3 format for Java ???</title>
			<link>http://bytes.com/topic/java/answers/877352-mp3-format-java</link>
			<pubDate>Fri, 20 Nov 2009 10:25:28 GMT</pubDate>
			<description>Is there any way to play mp3 file by using Java api? I strongly need to play mp3 files, because wav files are so big according to mp3 . 
 
Thanks.</description>
			<content:encoded><![CDATA[<div>Is there any way to play mp3 file by using Java api? I strongly need to play mp3 files, because wav files are so big according to mp3 .<br />
<br />
Thanks.</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>desturrr</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877352-mp3-format-java</guid>
		</item>
		<item>
			<title>Sound for Java application ?</title>
			<link>http://bytes.com/topic/java/answers/877332-sound-java-application</link>
			<pubDate>Thu, 19 Nov 2009 21:07:46 GMT</pubDate>
			<description>I am planning to start writing an application by java. Let me tell what i have in my mind. There is going to be stave and client can input the notes...</description>
			<content:encoded><![CDATA[<div>I am planning to start writing an application by java. Let me tell what i have in my mind. There is going to be stave and client can input the notes for the song on the stave, as you know just like guitar pro. What i want to do is after composing these notes on a free stave, i have to play the notes but firstly i need to record the sounds , i searched about the sound file formats, the sound api for java supports wav files. If you know any program that is useful for recording small and quality wav sound records, please share with me.I may have 1 to 5 seconds records and nearly 300 sound record. Is it possible to make the program as an applet so that everyone can benefit from it? Or does it have to be an desktop app ?.I am rather new for this , but i believe i can write that program. Any help or Any source that may help is appreciated.Thanks.<br />
<br />
     By the way the instrument is http://en.wikipedia.org/wiki/Ney . (it is an excellent instrument :) )</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>desturrr</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877332-sound-java-application</guid>
		</item>
		<item>
			<title>probleme on service web with mysql</title>
			<link>http://bytes.com/topic/java/answers/877314-probleme-service-web-mysql</link>
			<pubDate>Thu, 19 Nov 2009 15:14:22 GMT</pubDate>
			<description>Hello, 
 
i have a class java conncet to database mysql when i execute the classe alone so execute but when i want to execute this link on web...</description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
i have a class java conncet to database mysql when i execute the classe alone so execute but when i want to execute this link on web :<a href="http://localhost:8080/ProjetService/services/Magasin/getMagasins" target="_blank">http://localhost:8080/ProjetService/...in/getMagasins</a><br />
i done this error:<br />
echec pilote :java.lang.ClassNotFoundException: com.mysql.jdbc.Driver<br />
echec connection a la bdd :java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/boutiquegeographique<br />
erreur selectionjava.lang.NullPointerException<br />
echec pilote :java.lang.ClassNotFoundException: com.mysql.jdbc.Driver<br />
echec connection a la bdd :java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/boutiquegeographique<br />
erreur selectionjava.lang.NullPointerException<br />
echec pilote :java.lang.ClassNotFoundException: com.mysql.jdbc.Driver<br />
echec connection a la bdd :java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/boutiquegeographique<br />
erreur selectionjava.lang.NullPointerException<br />
echec pilote :java.lang.ClassNotFoundException: com.mysql.jdbc.Driver<br />
echec connection a la bdd :java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/boutiquegeographique<br />
erreur selectionjava.lang.NullPointerException<br />
echec pilote :java.lang.ClassNotFoundException: com.mysql.jdbc.Driver<br />
echec connection a la bdd :java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/boutiquegeographique<br />
erreur selectionjava.lang.NullPointerException<br />
i use eclipse and axis2 and database mysql <br />
thanks</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>manjava</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877314-probleme-service-web-mysql</guid>
		</item>
		<item>
			<title>Java code used to read data from barcode scanner or rs232 port</title>
			<link>http://bytes.com/topic/java/answers/877306-java-code-used-read-data-barcode-scanner-rs232-port</link>
			<pubDate>Thu, 19 Nov 2009 13:17:52 GMT</pubDate>
			<description>Hi 
I am very new to java. 
I have made one application for inventory mgmt. 
I want some ready code to read data from barcode scanner or rs232 port....</description>
			<content:encoded><![CDATA[<div>Hi<br />
I am very new to java.<br />
I have made one application for inventory mgmt.<br />
I want some ready code to read data from barcode scanner or rs232 port.<br />
If any of have such code than please help me</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>jeekesh</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877306-java-code-used-read-data-barcode-scanner-rs232-port</guid>
		</item>
		<item>
			<title>web service with mysql and axis</title>
			<link>http://bytes.com/topic/java/answers/877301-web-service-mysql-axis</link>
			<pubDate>Thu, 19 Nov 2009 11:47:05 GMT</pubDate>
			<description>Hello, 
 
if any one know how can deploy a web service with class java conncet to database mysql with axis and IDE eclipse please help me or done...</description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
if any one know how can deploy a web service with class java conncet to database mysql with axis and IDE eclipse please help me or done tutorail explain that<br />
<br />
Thank you</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>manjava</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877301-web-service-mysql-axis</guid>
		</item>
		<item>
			<title>IO Tools eclipse</title>
			<link>http://bytes.com/topic/java/answers/877270-io-tools-eclipse</link>
			<pubDate>Wed, 18 Nov 2009 21:04:22 GMT</pubDate>
			<description>Hi, 
 
i have some problems with passing values through keyboard in eclipse plattform. 
 
if i import this code 
 
 import Prog1Tools.IOTools; 
 
i...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
i have some problems with passing values through keyboard in eclipse plattform.<br />
<br />
if i import this code<br />
<br />
 import Prog1Tools.IOTools;<br />
<br />
i got this error : The import Prog1Tools cannot be resolved<br />
<br />
what can i do to be able to insert data through keyboard ??<br />
<br />
where can i doenload this packge?<br />
<br />
any help is welcame....</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>mar11</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877270-io-tools-eclipse</guid>
		</item>
		<item>
			<title>How to get mime type of a document from the Byte array using Java?</title>
			<link>http://bytes.com/topic/java/answers/877224-how-get-mime-type-document-byte-array-using-java</link>
			<pubDate>Wed, 18 Nov 2009 08:46:49 GMT</pubDate>
			<description><![CDATA[Hi, 
 
I need to know how to get the Mime type of a Document from the Byte array. I'm not having file name of file extension. I have only Byte array...]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I need to know how to get the Mime type of a Document from the Byte array. I'm not having file name of file extension. I have only Byte array of a document.<br />
<br />
To be more specific, Using the binary of a docuement, I need to find whether it is MS Word or MS Excel and so on.<br />
<br />
<br />
Please tell me is there a way to find it in Java.<br />
<br />
Thanks in advance<br />
Bharath</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>bharath652</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877224-how-get-mime-type-document-byte-array-using-java</guid>
		</item>
		<item>
			<title>ftp vs sftp in JAVA</title>
			<link>http://bytes.com/topic/java/answers/877198-ftp-vs-sftp-java</link>
			<pubDate>Tue, 17 Nov 2009 19:16:26 GMT</pubDate>
			<description>I was hoping you could help me out with ftp vs sftp. 
Below is a method that I have that I call to ftp files from one unix box 
to another in house,...</description>
			<content:encoded><![CDATA[<div>I was hoping you could help me out with ftp vs sftp.<br />
Below is a method that I have that I call to ftp files from one unix box<br />
to another in house, but soon, we will have to ftp from here to NY so we<br />
have to start using sftp.  I know that we have open ssh on our unix<br />
boxes but was wondering how different the syntax would be, going from<br />
ftp to sftp.<br />
<br />
<br />
Here is a method that I have written in my java code for ftping a file<br />
to a specific location.<br />
How can I change this so that it will sftp instead of ftp?<br />
Do I need to change this line frome ftp to sftp and thats it:<br />
URL(&quot;<b>ftp:</b>//&quot;+user+&quot;:&quot;+password+&quot;@&quot;+host+&quot;.sbc.com:21/%2F&quot;+remoteDirFile<br />
<br />
<!-- CODE -->
<div id="codeHolder" class="codeHolder" style="width: 500px;">
<div class="codeHeader">
	<span class="codeLink" onclick="Blur(this, this.parentNode.parentNode, getChildren(this),true);">Expand</span><span class="codeDivider">|</span><span class="codeLink" onclick="selectAll(this);">Select</span><span class="codeDivider">|</span><span class="codeLink" onclick="WordWrap(this);">Wrap</span><span class="codeDivider">|</span><span class="codeLink" onclick="LineNumbers(this);">Line Numbers</span>
</div>

<div class="codeContent" style="display: block; width: 500px; white-space: nowrap;">
	<ol START="1" highlight="true">

<li class="codeLI">
ftpFile(&quot;upload&quot;,&quot;login&quot;,&quot;passwd&quot;,&quot;unixbox&quot;,remote,&quot;&quot;,m_spreadName,&quot;i&quot;);</li>
<li class="codeLI">&nbsp;</li>

	</ol>
</div>
</div>
<!-- /CODE -->


<!-- CODE -->
<div id="codeHolder" class="codeHolder" style="width: 500px;">
<div class="codeHeader">
	<span class="codeLink" onclick="Blur(this, this.parentNode.parentNode, getChildren(this),true);">Expand</span><span class="codeDivider">|</span><span class="codeLink" onclick="selectAll(this);">Select</span><span class="codeDivider">|</span><span class="codeLink" onclick="WordWrap(this);">Wrap</span><span class="codeDivider">|</span><span class="codeLink" onclick="LineNumbers(this);">Line Numbers</span>
</div>

<div class="codeContent" style="display: block; width: 500px; white-space: nowrap;">
	<ol START="1" highlight="true">

<li class="codeLI">
private&nbsp;void&nbsp;ftpFile(String&nbsp;actionType,String&nbsp;user,String</li>
<li class="codeLI">
password,String&nbsp;host,String&nbsp;remoteDirFile,String&nbsp;remoteFILE,String</li>
<li class="codeLI">
localeFile,String&nbsp;modeType)</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//modeType='a'&nbsp;for&nbsp;ascii&nbsp;||&nbsp;'i'&nbsp;for&nbsp;binary</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(actionType.equalsIgnoreCase(&quot;download&quot;))&nbsp;&nbsp;///Download&nbsp;a&nbsp;file</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URL&nbsp;url&nbsp;=&nbsp;new</li>
<li class="codeLI">
&nbsp;URL(&quot;<b>ftp:</b>//&quot;+user+&quot;:&quot;+password+&quot;@&quot;+host+&quot;.sbc.com:21/%2F&quot;+remoteDirFile</li>
<li class="codeLI">
&nbsp;+&quot;;type=&quot;+modeType);</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URLConnection&nbsp;conn&nbsp;=&nbsp;url.openConnection();</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PrintWriter&nbsp;ot&nbsp;=&nbsp;new&nbsp;PrintWriter(new&nbsp;FileWriter(localeFile));</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BufferedReader&nbsp;in&nbsp;=&nbsp;new&nbsp;BufferedReader(new</li>
<li class="codeLI">
InputStreamReader(conn.getInputStream()));</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;line=&quot;&quot;;</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while((line&nbsp;=&nbsp;in.readLine())&nbsp;!=&nbsp;null)</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ot.println(line);</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ot.close();</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in.close();</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch&nbsp;(MalformedURLException&nbsp;m)</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&quot;&nbsp;Error:&nbsp;&quot;+m);</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch&nbsp;(IOException&nbsp;ioe)</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&quot;&nbsp;Error:&nbsp;&quot;+ioe);</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;weekDay&nbsp;=&nbsp;convertToValidWeekDay(determineValidWeekDay((new&nbsp;GregorianCalendar().get(Calendar.DAY_OF_WEEK&nbsp;+&nbsp;day--))));</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(day&nbsp;&lt;&nbsp;-7)</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&quot;&nbsp;No&nbsp;valid&nbsp;file(s)&nbsp;to&nbsp;&quot;+actionType);</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;remoteDirFile2=&quot;/production/&quot;+weekDay+&quot;/dir2/&quot;+</li>
<li class="codeLI">
&nbsp;remoteFILE;</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
//ftpFile(actionType,user,password,host,remoteDirFile2,remoteFILE,locale&nbsp;File,modeType);</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if(actionType.equalsIgnoreCase(&quot;upload&quot;))&nbsp;&nbsp;///Upload&nbsp;a&nbsp;file;</li>
<li class="codeLI">
Only&nbsp;binary&nbsp;files</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URL&nbsp;url&nbsp;=&nbsp;new</li>
<li class="codeLI">
URL(&quot;<b>ftp:</b>//&quot;+user+&quot;:&quot;+password+&quot;@&quot;+host+&quot;.sbc.com:21/%2F&quot;+remoteDirFile</li>
<li class="codeLI">
);&nbsp;//'a'&nbsp;for&nbsp;ascii&nbsp;and&nbsp;'i'&nbsp;for&nbsp;binary</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URLConnection&nbsp;conn&nbsp;=&nbsp;url.openConnection();</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OutputStream&nbsp;os&nbsp;=&nbsp;conn.getOutputStream();</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BufferedInputStream&nbsp;bis&nbsp;=&nbsp;&nbsp;new&nbsp;BufferedInputStream(new</li>
<li class="codeLI">
FileInputStream(localeFile));</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;number;</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while((number&nbsp;=&nbsp;bis.read())&nbsp;!=&nbsp;-1)</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;os.write(number);</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;os.flush();</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;os.close();</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bis.close();</li>
<li class="codeLI">&nbsp;</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch&nbsp;(MalformedURLException&nbsp;m)</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&quot;&nbsp;Error:&nbsp;&quot;+m);</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch&nbsp;(IOException&nbsp;ioe)</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&quot;&nbsp;Error:&nbsp;&quot;+ioe);</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">
&nbsp;&nbsp;&nbsp;&nbsp;}</li>
<li class="codeLI">&nbsp;</li>

	</ol>
</div>
</div>
<!-- /CODE -->


</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>ndedhia1</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877198-ftp-vs-sftp-java</guid>
		</item>
		<item>
			<title>Sending an Object through Socket</title>
			<link>http://bytes.com/topic/java/answers/877185-sending-object-through-socket</link>
			<pubDate>Tue, 17 Nov 2009 17:11:02 GMT</pubDate>
			<description>Good day, 
 
I have an object, that contains a hashmap, that is dynamically utilized on client and server data transfer. that object may contain a...</description>
			<content:encoded><![CDATA[<div>Good day,<br />
<br />
I have an object, that contains a hashmap, that is dynamically utilized on client and server data transfer. that object may contain a string, an arraylist, or an object itself.<br />
<br />
Based on the observation, i found out that, when the database will be reset, the client could still able to send the reliable data(through showing on the stream - println) but when the server received it, the essential list of data have lost.<br />
<br />
What can you advice about this scenario?<br />
<br />
Im looking forward to your replies experts :)</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>sukatoa</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877185-sending-object-through-socket</guid>
		</item>
		<item>
			<title>java or .net</title>
			<link>http://bytes.com/topic/java/answers/877144-java-net</link>
			<pubDate>Tue, 17 Nov 2009 06:30:01 GMT</pubDate>
			<description>Hi to all friends, 
I am working on c,c++,vc++ for 1 year.Now i want to move from c++ to another technology like java/.net 
 
 
I learned both...</description>
			<content:encoded><![CDATA[<div>Hi to all friends,<br />
I am working on c,c++,vc++ for 1 year.Now i want to move from c++ to another technology like java/.net<br />
<br />
<br />
I learned both technology(java &amp; .net) during my CDAC 1 yr ago, &amp; I am good in core java but not so in j2ee while about .net I am good in asp.net but not so in c#/vb.<br />
And another scenario is that ,though I love Java...in india (i am in India Pune) for 1+ yr of exp there are lot opportunities in dotnet but for Java/J2ee opportunities are for 2+/3+ yr of exp...<br />
<br />
I am confused...<br />
Plz give your valuable suggation..</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>swapnilb1</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877144-java-net</guid>
		</item>
		<item>
			<title>Please help me to modify my code...</title>
			<link>http://bytes.com/topic/java/answers/877137-please-help-me-modify-my-code</link>
			<pubDate>Tue, 17 Nov 2009 04:56:40 GMT</pubDate>
			<description><![CDATA[Hi, 
I have the following code,it prints out a 5 by 5 matrix and puts "-" in each location. 
I need to ask user for the number of * they like to put...]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
I have the following code,it prints out a 5 by 5 matrix and puts &quot;-&quot; in each location.<br />
I need to ask user for the number of * they like to put in the matrix and based on the number they enter replace a random &quot;-&quot; by a &quot;*&quot;.<br />
It would be great if you modify my code and help me:<br />
Here is an example:<br />
How many * you want in the matrix?<br />
3<br />
-*---<br />
*----<br />
----*<br />
-----<br />
-----<br />
<br />
import java.io.*;<br />
import java.util.*;<br />
<br />
class TestRandomArray1 {<br />
private String [][] mBoard;   // Good for a two-dimensional world<br />
private int mDimension;        // the size of the board<br />
public TestRandomArray1(int dimension) {<br />
<br />
    mDimension = dimension;<br />
    mBoard = new String[mDimension][mDimension];<br />
    for (int i = 0; i &lt; mBoard.length; i++)<br />
      for (int j = 0; j &lt; mBoard[i].length; j++)<br />
	mBoard[i][j] = &quot;-&quot;;<br />
  }<br />
  <br />
  public void display() {<br />
<br />
    for (int i = 0; i &lt; mBoard.length; i++) {<br />
      for (int j = 0; j &lt; mBoard[i].length; j++)<br />
	<br />
	  System.out.print(mBoard[i][j]);<br />
<br />
      System.out.println();<br />
    }<br />
    <br />
  }<br />
   public static void main(String[] argv) {<br />
<br />
    TestRandomArray1 runATest = new TestRandomArray1(5);<br />
    runATest.display();<br />
  }<br />
}</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>alireza6485</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877137-please-help-me-modify-my-code</guid>
		</item>
		<item>
			<title>C to Java...</title>
			<link>http://bytes.com/topic/java/answers/877133-c-java</link>
			<pubDate>Tue, 17 Nov 2009 03:00:57 GMT</pubDate>
			<description>Hi, 
Could sme one please translate the following code from C to Java for me? 
 
Code : 
/* 
      Polytechnic University of the Philippines 
		...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
Could sme one please translate the following code from C to Java for me?<br />
<br />
Code :<br />
/*<br />
      Polytechnic University of the Philippines<br />
		 Sta.Mesa, Manila<br />
College of Computer Management and Information Technology<br />
<br />
			A<br />
		    CASE STUDY<br />
			in<br />
		  DATA STRUCTURES<br />
			AND<br />
		    ALGORITHM<br />
<br />
*/<br />
#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;ctype.h&gt;<br />
#include&lt;string.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
<br />
#define MAXROW 15<br />
#define MAXCOL 30<br />
<br />
#define ALIVE 1<br />
#define DEAD 0<br />
<br />
struct conway{<br />
  int organism;<br />
  int neighbor;<br />
}cell[MAXROW+2][MAXCOL+2];<br />
<br />
void twolinebox(int x1,int y1,int x2,int y2){<br />
 int x,y;<br />
 gotoxy(x1,y1); printf(&quot;É&quot;); //alt-201<br />
 gotoxy(x2,y1); printf(&quot;»&quot;); //alt-187<br />
  for(y=y1+1;y&lt;y2;y++){<br />
    gotoxy(x1,y); printf(&quot;º&quot;); //alt-186<br />
    gotoxy(x2,y); printf(&quot;º&quot;); //alt-186<br />
  }<br />
 gotoxy(x1,y2); printf(&quot;È&quot;); //alt-200<br />
 gotoxy(x2,y2); printf(&quot;¼&quot;); //alt-188<br />
  for(x=x1+1;x&lt;x2;x++){<br />
    gotoxy(x,y1); printf(&quot;Í&quot;); //alt-205<br />
    gotoxy(x,y2); printf(&quot;Í&quot;); //alt-205<br />
  }<br />
 gotoxy(x1+1,y1+1);<br />
}<br />
<br />
void printxy(int x,int y,char string[]){<br />
 gotoxy(x,y); printf(&quot;%s&quot;,string);<br />
}<br />
<br />
void center(int y,char string[]){<br />
int x=(80-strlen(string)+1)/2;<br />
gotoxy(x,y);printf(&quot;%s&quot;,string);<br />
}<br />
<br />
<br />
void initializeMatrix(void){<br />
int row,col;<br />
   for(row=-1;row&lt;MAXROW+1;row++){<br />
     for(col=-1;col&lt;MAXCOL+1;col++){<br />
	 cell[row][col].organism=DEAD;<br />
	 cell[row][col].neighbor=0;<br />
     }//end of inner for loop<br />
   }//end of outer for loop<br />
}//end of initializeMatrix<br />
<br />
void showMatrix(void){<br />
  int row,col;<br />
  twolinebox(1,1,80,24);<br />
   for(row=0;row&lt;MAXROW;row++){<br />
     for(col=0;col&lt;MAXCOL;col++){<br />
	gotoxy(5+col,5+row); printf(&quot;²&quot;); //alt-178<br />
	if(cell[row][col].organism==ALIVE){<br />
	   gotoxy(5+col,5+row);<br />
	   printf(&quot;%c&quot;,cell[row][col].organism);<br />
	}//end of if<br />
     }//end of inner for loop<br />
   }//end of outer for loop<br />
<br />
}//end of showMatrix<br />
<br />
void inputOrganism(void){<br />
  int org,row,col,err,a;<br />
     initializeMatrix();<br />
     do{<br />
       clrscr();<br />
       showMatrix();<br />
       gotoxy(5,3); printf(&quot;Input no. of organism to display(1-30 <br />
only):<br />
&quot;);<br />
       gotoxy(50,3); scanf(&quot;%d&quot;,&amp;org);<br />
     }while(org&lt;1||org&gt;30);<br />
<br />
     for(a=1;a&lt;=org;a++){<br />
      clrscr();<br />
      showMatrix();<br />
      do{<br />
       do{<br />
	 gotoxy(36,6); printf(&quot;Input cell row position of organism %d&quot;,a);<br />
	 printxy(36,7,&quot;row:(1-15)only\&gt;     &quot;);<br />
	 gotoxy(55,7); scanf(&quot;%d&quot;,&amp;row); row--;<br />
       }while(row&gt;15||row&lt;0);<br />
       do{<br />
	 gotoxy(36,9); printf(&quot;Input cell column position of organism <br />
%d&quot;,a+1);<br />
	 gotoxy(36,10); printf(&quot;col:(1-30)only\&gt;     &quot;);<br />
	 gotoxy(55,10); scanf(&quot;%d&quot;,&amp;col); col--;<br />
       }while(col&gt;30||col&lt;0);<br />
       if(cell[row][col].organism==ALIVE){<br />
	 gotoxy(36,20); printf(&quot;cell[%d][%d] is already <br />
occupied!&quot;,row+1,col+1);<br />
	 gotoxy(36,21); printf(&quot;Try other cell...&quot;);<br />
	 getch();<br />
	 gotoxy(36,20); clreol();<br />
	 gotoxy(36,21); clreol();<br />
       }//end of if<br />
      }while(cell[row][col].organism==ALIVE);<br />
       cell[row][col].organism=ALIVE;<br />
       showMatrix();<br />
     }//end of for loop<br />
<br />
}//end of inputOrganism<br />
<br />
void checkCell(void){<br />
   int row,col;<br />
<br />
   //in this part the neighboring cells are checked,<br />
   //if the neighborng cell is an occupied cell<br />
   //then the neighbor element of the structure cell is increased by 1<br />
<br />
     for(row=0;row&lt;MAXROW;row++){<br />
      for(col=0;col&lt;MAXCOL;col++){<br />
	     cell[row][col].neighbor=0;    //initialize neighbor to 0<br />
	  if(cell[row-1][col-1].organism==ALIVE)<br />
	     cell[row][col].neighbor++;<br />
	  if(cell[row-1][col].organism==ALIVE)<br />
	     cell[row][col].neighbor++;<br />
	  if(cell[row][col-1].organism==ALIVE)<br />
	     cell[row][col].neighbor++;<br />
	  if(cell[row][col+1].organism==ALIVE)<br />
	     cell[row][col].neighbor++;<br />
	  if(cell[row+1][col].organism==ALIVE)<br />
	     cell[row][col].neighbor++;<br />
	  if(cell[row+1][col-1].organism==ALIVE)<br />
	     cell[row][col].neighbor++;<br />
	  if(cell[row-1][col+1].organism==ALIVE)<br />
	     cell[row][col].neighbor++;<br />
	  if(cell[row+1][col+1].organism==ALIVE)<br />
	     cell[row][col].neighbor++;<br />
      }//end of inner for loop<br />
     }//end of outer for loop<br />
<br />
    //in this part we will check the cell's no. of neighbor then<br />
    //place or kill organism in that particular cell<br />
    //based on its neighboring cell according to Conway's Rule<br />
<br />
     for(row=0;row&lt;MAXROW;row++){<br />
	for(col=0;col&lt;MAXCOL;col++){<br />
	  if(cell[row][col].organism==ALIVE){  //rule2 and 3 if and occupied <br />
cell<br />
	     if(cell[row][col].neighbor&lt;2) //rule2: has less than 2 neighbor<br />
		cell[row][col].organism=DEAD; //organism will die in that cell<br />
	     else if(cell[row][col].neighbor&gt;3) //rule3: has greater than 3<br />
		cell[row][col].organism=DEAD; //organism will die in that cell<br />
	  }<br />
	  else //if(cell[row][col].organism!=1) //rule1. if an empty cell<br />
	     if(cell[row][col].neighbor==3) //has exactly 3 neigbor<br />
		cell[row][col].organism=ALIVE;  //an organism is born in that cell<br />
<br />
	}//end of inner for loop<br />
     }//end of outer for loop<br />
<br />
}//end of checkCell<br />
<br />
void showGeneration(void){<br />
  int gen,g;<br />
    clrscr();<br />
      showMatrix();<br />
      gotoxy(5,3); printf(&quot;Enter no. of generation you want to <br />
see...&quot;);<br />
      gotoxy(5,4); printf(&quot;gen:\&gt;     &quot;);<br />
      gotoxy(12,4); scanf(&quot;%d&quot;,&amp;gen);<br />
      for(g=1;g&lt;=gen;g++){<br />
	 clrscr();<br />
	 showMatrix();<br />
	 gotoxy(36,10); printf(&quot;GENERATION %d&quot;,g);<br />
	 checkCell();<br />
       getch();<br />
      }//end of for loop<br />
}//end of showGeneration<br />
<br />
<br />
void welcome(void){<br />
       clrscr();<br />
       twolinebox(1,1,80,24);<br />
       gotoxy(35,8); printf(&quot;WELCOME&quot;);<br />
       gotoxy(37,10); printf(&quot;to&quot;);<br />
       gotoxy(35,12); printf(&quot;CONWAY'S&quot;);<br />
       gotoxy(36,13); printf(&quot;GAME&quot;);<br />
       gotoxy(38,14); printf(&quot;of&quot;);<br />
       gotoxy(37,15); printf(&quot;LIFE&quot;);<br />
       gotoxy(26,23); printf(&quot;press any key to continue...&quot;);<br />
       getch();<br />
       clrscr();<br />
       twolinebox(1,1,80,24);<br />
       center(3,&quot;CONWAYS GAME OF LIFE&quot;);<br />
       printxy(5,5,&quot;RULE OF THE GAME&quot;);<br />
       printxy(5,7,&quot;If in one generation,&quot;);<br />
       printxy(10,8,&quot;an empty cell has exactly three neighboring cells<br />
containing&quot;);<br />
       printxy(10,9,&quot;organisms, then a new organism is born in that <br />
cell<br />
in the &quot;);<br />
       printxy(10,10,&quot;next generation.&quot;);<br />
       printxy(5,11,&quot;If in one generation,&quot;);<br />
       printxy(10,12,&quot;an organism has fewer than two neighboring cells<br />
containing&quot;);<br />
       printxy(10,13,&quot;organisms, then it dies from isolation before <br />
the&quot;);<br />
       printxy(10,14,&quot;next generation and its cell become empty.&quot;);<br />
       printxy(5,15,&quot;If in one generation,&quot;);<br />
       printxy(10,16,&quot;an organism has more than three neighboring cells<br />
containing&quot;);<br />
       printxy(10,17,&quot;organisms, then it dies from overcrowding before<br />
the&quot;);<br />
       printxy(10,18,&quot;next generation and its cell become empty.&quot;);<br />
       printxy(5,19,&quot;All other organisms survive unchanged to the next<br />
generation.&quot;);<br />
       center(21,&quot;Press any key to continue...&quot;);<br />
       getch();<br />
}<br />
<br />
void quit(void){<br />
       clrscr();<br />
       twolinebox(1,1,80,24);<br />
       center(7,&quot;PROGRAMMED&quot;);<br />
       center(8,&quot;BY&quot;);<br />
       center(9,&quot;BSCS 2-2&quot;);<br />
       center(11,&quot;Frederick Badion&quot;);<br />
       center(12,&quot;Michelle Baylon&quot;);<br />
       center(13,&quot;Kirby Adriano&quot;);<br />
       center(14,&quot;Jamil Soller&quot;);<br />
       center(15,&quot;Sweet Joan Zamora&quot;);<br />
       getch();<br />
}<br />
<br />
void main(){<br />
char opt;<br />
 textmode(BW80);<br />
 do{<br />
   clrscr();<br />
   welcome();<br />
   inputOrganism();<br />
   showGeneration();<br />
   gotoxy(5,22);<br />
   printf(&quot;Try again? [Y/N] &quot;);<br />
   opt=getch();<br />
 }while(toupper(opt)=='Y');<br />
quit();<br />
exit(1);<br />
}//end of main</div>

]]></content:encoded>
			<category domain="http://bytes.com/topic/java/answers/">answers</category>
			<dc:creator>alireza6485</dc:creator>
			<guid isPermaLink="true">http://bytes.com/topic/java/answers/877133-c-java</guid>
		</item>
	</channel>
</rss>
