<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cgsbay &#187; Python</title>
	<atom:link href="http://cgsbay.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://cgsbay.com</link>
	<description>Just another personal website</description>
	<lastBuildDate>Sat, 13 Mar 2010 13:26:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Offline math program for iPhone</title>
		<link>http://cgsbay.com/offline-math-program-for-iphone/</link>
		<comments>http://cgsbay.com/offline-math-program-for-iphone/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 12:59:01 +0000</pubDate>
		<dc:creator>cgs</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://cgsbay.com/?p=155</guid>
		<description><![CDATA[Hi, I have got an iPod Touch and I&#8217;ve always wanted a good math program for my iPod. I wanted one with all the things that I needed to calculate: integrals, diffs, limits, matrices, &#8230; but there was nothing for the iPhone. I looked up and in the AppStore and I found Wolfram Alpha, but [...]]]></description>
			<content:encoded><![CDATA[<p>Hi, I have got an iPod Touch and I&#8217;ve always wanted a good math program for my iPod. I wanted one with all the things that I needed to calculate: integrals, diffs, limits, matrices, &#8230; but there was nothing for the iPhone. I looked up and in the AppStore and I found Wolfram Alpha, but it has two things I don&#8217;t like: it&#8217;s online and it has no memory.</p>
<div align="center"><img src="http://files.cgsbay.com/uploads/Images/sympylogo.png"></div>
<p>So I looked up in Cydia an over the Internet and I didn&#8217;t find anything. I decided  to try to compile GNU Octave, but it was very difficult, then I found that I could install python from Cydia. I did it and I found a module called <a href="http://code.google.com/p/sympy/">sympy</a> that does everything I wanted, it&#8217;s like a small matlab for your iPhone. You can see all the things this module does <a href="http://docs.sympy.org/tutorial.html">here</a>. It&#8217;s really easy to get it working, here there are the requirements:</p>
<p>- Jailbroken iPhone<br />
- Python (you can download it form Cydia)</p>
<p>And the steps:</p>
<p><strong>Installation</strong></p>
<p><strong>1.</strong> In your iPhone, you need the Telesphoreo Tangelo source, that comes by default, anyway, it&#8217;s: http://apt.saurik.com and if you don&#8217;t have it a package called Terminal.</p>
<div align="center"><img src="http://www.files.cgsbay.com/uploads/Images/cydiapy.PNG"></div>
<p><strong>2.</strong> Now, in Cydia click into search and type python and download &#8220;Python&#8221; (not &#8220;iPhone/Python&#8221;).<br />
<strong>3.</strong> From your computer download the .tar.gz file of Sympy from <a href="http://code.google.com/p/sympy/downloads/list">here</a>. You should download the latest one, in this case it&#8217;s sympy-0.6.6.tar.gz<br />
<strong>4.</strong> You&#8217;ll find a folder called sympy-version where version is the version, i.e.: sympy-0.6.6. To avoid problems extract the folder in your desktop and rename it to sympy.</p>
<div align="center"><img src="http://www.files.cgsbay.com/uploads/Images/sympy-linux.png"></div>
<p><strong>5.</strong> From your computer copy the folder sympy directly inside your Media folder inside your iPhone. To copy files in your iPhone use <a href="http://cgsbay.com/mount-iphone-ipod-touch-over-usb-in-linux/">iFuse</a> if you are not on Lucid (if you&#8217;re on Lucid you don&#8217;t need anything!), and <a href="http://www.iphone-explorer.com/">iPhone Explorer</a> if you&#8217;re on Windows or on a Mac. The media folder is the default folder when you browse your iPhone with this programs. Some folders inside of Media are DCIM, iTunes_Control, or Photos.</p>
<p>(Note: The next steps: 6-8 may not be needed, if you want, try the manual without them and tell me if it worked.)</p>
<p><strong>6. </strong> It&#8217;s almost done, now open your iPhone Terminal and type su. Type your root password, if you don&#8217;t have changed it, it should be alpine, if you have problems look up in google, I also don&#8217;t know if this step is needed or not, if you have problems try to avoid this part.</p>
<p><strong>7. </strong> Now put this code in your Terminal:</p>
<p><code>cd /var/mobile/Media/sympy</code></p>
<p>And this one:<br />
<code><br />
chmod +x setup.py<br />
</code></p>
<p><strong>8. </strong> Now type this in your Terminal:</p>
<p><code>python setup.py</code></p>
<p><strong>Running Sympy (after installation)</strong></p>
<p>Even if you get errors executing setup.py don&#8217;t worry, as I don&#8217;t know if steps 6-8 are needed, I&#8217;ve done them but I doubt if they were needed. Ok, the point is that you have sympy installed. Now let&#8217;s see how you can open it. Close your terminal and open it again. Then put this code:</p>
<p><code>cd /var/mobile/Media/sympy</code></p>
<p>And then this one:</p>
<p><code>python</code></p>
<p>And&#8230; finally this one:</p>
<p><code>from sympy import *</code></p>
<p>You&#8217;re done, everything is fine. You can use the program, let&#8217;s do an example:</p>
<div align="center"><img src="http://www.files.cgsbay.com/uploads/Images/integration-sympy.PNG"></div>
<p><code>x=symbol('x')<br />
pprint(integrate(1/(x**3+1),x))</code></p>
<p>Enjoy!</p>
<p><strong>How to open Sympy faster</strong></p>
<p>If you want to open Sympy faster, <a href="http://www.files.cgsbay.com/uploads/Linux/sympy.zip">download this bash file</a> I&#8217;ve created. Put it in /bin and give it executing permissions. To do this, just copy the file to Media in your iPhone and then, in your iPhone Terminal:</p>
<p><code>cd Media<br />
su<br />
cp 'sympy' '/bin'<br />
cd /bin<br />
chmod +x sympy<br />
</code></p>
<p>Then, to run Sympy, open your Terminal, type sympy and then inside the Python prompt type:</p>
<p><code>from sympy import *</code></p>
]]></content:encoded>
			<wfw:commentRss>http://cgsbay.com/offline-math-program-for-iphone/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

