<?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>64 Bit Jungle &#187; Programming</title>
	<atom:link href="http://www.64bitjungle.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.64bitjungle.com</link>
	<description>Linux and Programming Tips and Tutorials, Technology and Rants from the Jungle</description>
	<lastBuildDate>Thu, 05 Jan 2012 08:42:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>64 Bit Jungle Forums now open!</title>
		<link>http://www.64bitjungle.com/linux/64-bit-jungle-forums-now-open/</link>
		<comments>http://www.64bitjungle.com/linux/64-bit-jungle-forums-now-open/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 16:22:41 +0000</pubDate>
		<dc:creator>Hodge</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.64bitjungle.com/?p=594</guid>
		<description><![CDATA[I&#8217;ve decided to create a forum community for 64 Bit Jungle users, and anyone else who would like to join. I guess the forums are an extension to post comments, allow discussion of topics not (yet) covered in any articles or posts on the site, and will hopefully encourage discussion and debate within the community! [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I&#8217;ve decided to create a <a href="http://www.64bitjungle.com/forums">forum community</a> for 64 Bit Jungle users, and anyone else who would like to join. I guess the forums are an extension to post comments, allow discussion of topics not (yet) covered in any articles or posts on the site, and will hopefully encourage discussion and debate within the community! Whilst I don&#8217;t anticipate they will be as active or comprehensive as the well established <a href="http://ubuntuforums.org" target="_blank">Ubuntu forums</a>, I do hope they will be successful, and most of all helpful and fun.</p>
<p>You&#8217;ll need to <a href="http://www.64bitjungle.com/wp-login.php?action=register">register</a> to post, but anyone can read them. I&#8217;ll eventually be on the look out for moderators, and the forums may possibly even lead to enlisting future guest writers for 64 Bit Jungle too.</p>
<p>They&#8217;re obviously looking a little sparse at the moment, since they&#8217;ve only just opened, but please don&#8217;t let that put you off registering and posting to kick things off.</p>
<p>Enjoy!</p>
<div class="shr-publisher-594"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.64bitjungle.com/linux/64-bit-jungle-forums-now-open/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Webgrind: Cross-platform Xdebug Profiling Web Frontend</title>
		<link>http://www.64bitjungle.com/programming/webgrind-cross-platform-xdebug-profiling-web-frontend/</link>
		<comments>http://www.64bitjungle.com/programming/webgrind-cross-platform-xdebug-profiling-web-frontend/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 04:53:30 +0000</pubDate>
		<dc:creator>Hodge</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Xdebug]]></category>

		<guid isPermaLink="false">http://www.64bitjungle.com/?p=512</guid>
		<description><![CDATA[I&#8217;m using Xdebug as my primary PHP debugger. I have it integrated into my Eclipse PDT IDE, and have also been using its profiling capabilities. Until recently, I&#8217;ve been using KCachegrind &#8211; which has a wonderfully diverse feature set &#8211; as my primary profile data visualisation tool. However, as a Gnome user, KCachegrind requires a [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignleft size-full wp-image-517" title="webgrind-title" src="http://www.64bitjungle.com/wp-content/uploads/2009/04/webgrind-title.jpg" alt="webgrind-title" width="163" height="62" align="left" />I&#8217;m using <a href="http://www.xdebug.org" target="_blank">Xdebug</a> as my primary PHP debugger. I have it integrated into my <a href="http://www.64bitjungle.com/tech/debugging-php-applications-with-xdebug-and-eclipse-pdt/">Eclipse PDT IDE</a>, and have also been using its profiling capabilities. Until recently, I&#8217;ve been using <a href="http://kcachegrind.sourceforge.net/cgi-bin/show.cgi" target="_blank">KCachegrind</a> &#8211; which has a wonderfully diverse feature set &#8211; as my primary profile data visualisation tool. However, as a Gnome user, KCachegrind requires a lot of KDE libraries to be installed in order to run. KCachegrind can be installed easily on Debian based systems by running:</p>
<p><code>sudo apt-get install kcachegrind</code></p>
<p>Anyone who has installed KCachegrind on a Gnome system before, or who has just run the above command, can see that it takes approximately 250Mb (after installation &#8211; about 80Mb worth of archives to download) of additional libraries and packages in order to install. I still have it installed, and use it for more detailed analysis of profile data, but I recently stumbled across a fantastic alternative called <a href="http://code.google.com/p/webgrind/" target="_blank">Webgrind</a>.</p>
<p><strong>Installing Webgrind</strong></p>
<p>Webgrind implements a subset of the KCachegrind features, and is great for a quick preview, or simple analysis of profile data. It&#8217;s written in PHP5, and as such leaves a very small footprint, and can be installed on any platform. To install, <a href="http://webgrind.googlecode.com/files/webgrind-release-1.0.zip" target="_blank">download the latest package</a> (1.0 at the time of writing) &#8211; as usual I downloaded to my cluttered Desktop, which by now is brimming with things I&#8217;ve forgotten about, and whose purpose I no longer have any idea&#8230; Once downloaded, the package needs unpacking, and moving to the root web directory (/var/www in my case)</p>
<p><code>cd ~/Desktop<br />
unzip webgrind-release-1.0.zip<br />
sudo mv webgrind /var/www</code></p>
<p>Once installed, Webgrind can be accessed by pointing your web browser to http://localhost/webgrind</p>
<p><strong>Profiling</strong></p>
<p>In order to profile an application, the Xdebug profiler needs switching on. This can be done by editing either the php.ini file, or in my case, a separate ini file specifically for Xdebug. Either way, the following line needs adding, so open up the ini file in a text editor, and add:</p>
<p><code>xdebug.profiler_enable = 1</code></p>
<p>Save the file and restart Apache:</p>
<p><code>sudo /etc/init.d/apache2 restart</code></p>
<p>Your PHP web application will now be profiled by Xdebug. By default, profile data will be saved in /tmp/cachegrind.out.%p (where %p is the pid). This can be changed by editing php.ini and adding the following directives:</p>
<p><code>xdebug.profiler_output_dir = /desired/output/directory/path<br />
xdebug.profiler_output_name = desired.name.specifier</code></p>
<p>(See <a href="http://www.xdebug.org/docs/all_settings#trace_output_name" target="_blank">http://www.xdebug.org/docs/all_settings#trace_output_name</a> for possible specifiers). To switch profiling off, simply edit the php.ini file, set  xdebug.profiler_enable to 0 and restart Apache.</p>
<p><strong>Viewing Profile Data</strong></p>
<p>Once profile data is available, Webgrind will automatically detect the latest profile, and give the option to display it. Point your web browser to http://localhost/webgrind. At the top are three pull down menus &#8211; the centre menu allowing us to select which profile data file to view. By default, it will automatically select the latest file, but others can be manually selected based not only on Xdebug&#8217;s default filename, but also by the actual PHP file profiled. Clicking the Update button will begin the analysis process (which may take some time depending on the size and complexity of the profile data) resulting in data being displayed in tabular format, which allows for drill down and sorting:</p>
<p style="text-align: center;"><img class="size-full wp-image-515 aligncenter" title="webgrind-screenshot" src="http://www.64bitjungle.com/wp-content/uploads/2009/04/webgrind-screenshot.jpg" alt="webgrind-screenshot" width="600" height="274" /></p>
<p style="text-align: left;">KCachegrind can be used for more detailed analysis, but for a quick view of potential bottlenecks in code, and considering its size, Webgrind is a fantastic starting point, which for me, picks out the most relevant data I need to analyse, which is sufficient 90% of the time.</p>
<div class="shr-publisher-512"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.64bitjungle.com/programming/webgrind-cross-platform-xdebug-profiling-web-frontend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merge two images with PHP and GD</title>
		<link>http://www.64bitjungle.com/programming/merge-two-images-with-php-and-gd/</link>
		<comments>http://www.64bitjungle.com/programming/merge-two-images-with-php-and-gd/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 12:09:46 +0000</pubDate>
		<dc:creator>Hodge</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[GD]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.64bitjungle.com/?p=477</guid>
		<description><![CDATA[One of the things I really wanted to incorporate into the new site design template, was a nice big, I-really-want-people-to-click-on-this-and-Subscribe-to-my-RSS-Feed image/link/button (big [what the hell is] &#8220;Web 2.0&#8243; buttons seem to be the in thing at the moment &#8211; I didn&#8217;t want to feel left out&#8230;), which is located at the top right of the [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignleft size-full wp-image-484" title="PHP &amp; GD" src="http://www.64bitjungle.com/wp-content/uploads/2009/04/phpgd125.jpg" alt="PHP &amp; GD" width="125" height="125" align="left" />One of the things I really wanted to incorporate into the new site design template, was a nice big, I-really-want-people-to-click-on-this-and-Subscribe-to-my-RSS-Feed image/link/button (big [what the hell is] &#8220;Web 2.0&#8243; buttons seem to be the in thing at the moment &#8211; I didn&#8217;t want to feel left out&#8230;), which is located at the top right of the site header, under the search box (in case you missed it). That&#8217;s easy enough, so what&#8217;s the point of this article? Well, I use <a href="http://feedburner.google.com" target="_blank">FeedBurner</a> to serve my RSS Feeds, and wanted to display the cool little badge they have, which shows the number of subscribers to my Feeds. I decided I wanted to include the FeedBurner stat counter in the new big &#8220;Look! I have a Web 2.0 site too&#8221; Subscribe to my RSS Feed button, since placing it elsewhere on the site&#8217;s layout, such as one of the sidebars, just didn&#8217;t feel right. Now, as with any problem, there are numerous ways this can be done, and no one solution is right. For instance, I could have set the &#8220;No, really, it <em>is</em> a Web 2.0 Site&#8221; Subscribe button as a background image to an (X)HTML &lt;div&gt; element, and then had the FeedBurner Badge ensconced therein, but since I had my <a href="http://www.64bitjungle.com/ubuntu/full-64-bit-or-32-bit-web-development-and-php-mysql-ide-with-eclipse-34-ganymede-and-pdt-2/" target="_self">PHP IDE</a> open at the time, I opted for the following method (which also happens to give me something to write about).</p>
<p>So, on to the code itself, which is actually rather embarrassingly simple:<br />
<code>&lt;?php<br />
//Set the Image source variables<br />
$backgroundSource = "http://www.64bitjungle.com/wp-content/themes/openbook22-en/images/rss-subscribe.jpg";<br />
$feedBurnerStatsSource = "http://feeds2.feedburner.com/~fc/64BitJungle?bg=151515&amp;fg=ffffff&amp;anim=0";<br />
//Create new images<br />
$outputImage = imagecreatefromjpeg($backgroundSource);<br />
$feedBurnerStats = imagecreatefromgif($feedBurnerStatsSource);<br />
//Grab width and height of the FeedBurner image<br />
$feedBurnerStatsX = imagesx($feedBurnerStats);<br />
$feedBurnerStatsY = imagesy($feedBurnerStats);<br />
//Merge the two images<br />
imagecopymerge($outputImage,$feedBurnerStats,156,50,0,0,$feedBurnerStatsX,$feedBurnerStatsY,100);<br />
//Output header<br />
header('Content-type: image/png');<br />
//send new image to browser<br />
imagepng($outputImage);<br />
imagedestroy($outputImage);<br />
?&gt;</code></p>
<p>Now for the breakdown of each line. First, I put the source images into a couple of variables &#8211; the background image, located at <a href="http://www.64bitjungle.com/wp-content/themes/openbook22-en/images/rss-subscribe.jpg" target="_blank">http://www.64bitjungle.com/wp-content/themes/openbook22-en/images/rss-subscribe.jpg</a>:</p>
<p style="text-align: center;"><img class="aligncenter" title="RSS Subscribe Background" src="http://www.64bitjungle.com/wp-content/themes/openbook22-en/images/rss-subscribe.jpg" alt="" width="245" height="70" /></p>
<p>and the FeedBurner badge, located at <a href="http://feeds2.feedburner.com/~fc/64BitJungle?bg=151515&amp;fg=ffffff&amp;anim=0" target="_blank">http://feeds2.feedburner.com/~fc/64BitJungle?bg=151515&amp;fg=ffffff&amp;anim=0</a>:</p>
<p style="text-align: center;"><img class="aligncenter" title="64 Bit Jungle Feedburner Stat Badge" src="http://feeds2.feedburner.com/~fc/64BitJungle?bg=151515&amp;fg=ffffff&amp;anim=0" alt="" width="88" height="26" /></p>
<p><code>$backgroundSource = "http://www.64bitjungle.com/wp-content/themes/openbook22-en/images/rss-subscribe.jpg";<br />
$feedBurnerStatsSource = "http://feeds2.feedburner.com/~fc/64BitJungle?bg=151515&amp;fg=ffffff&amp;anim=0";</code></p>
<p>The next significant lines, tell GD to create two new image link resources from the sources above:</p>
<p><code>$outputImage = imagecreatefromjpeg($backgroundSource);<br />
$feedBurnerStats = imagecreatefromgif($feedBurnerStatsSource);</code></p>
<p>The FeedBurner badge is delivered as a GIF, hence the <a href="http://php.net/imagecreatefromgif" target="_blank">imagecreatefromgif</a> function, and the background image is in jpeg format, so we call the <a href="http://php.net/imagecreatefromjpeg" target="_blank">imagecreatefromjpeg</a> function. Next, we grab the height and width of the FeedBurner image using the <a href="http://php.net/imagesx" target="_blank">imagesx</a> and <a href="http://php.net/imagesy" target="_blank">imagesy</a> functions, and stick the values in a coupe of variables:</p>
<p><code>$feedBurnerStatsX = imagesx($feedBurnerStats);<br />
$feedBurnerStatsY = imagesy($feedBurnerStats);</code></p>
<p>and then run the important function, <a href="http://php.net/imagecopymerge" target="_blank">imagecopymerge</a>, to combine the two images:</p>
<p><code>imagecopymerge($outputImage,$feedBurnerStats,156,50,0,0,$feedBurnerStatsX,$feedBurnerStatsY,100);</code></p>
<p>Finally, the image is output to the browser in PNG format:</p>
<p><code>header('Content-type: image/png');<br />
imagepng($outputImage);<br />
imagedestroy($outputImage);</code></p>
<p>That&#8217;s it &#8211; painfully simple, eh? Now all that&#8217;s required is to include the new image in some (X)HTML Markup &#8211; <strong>note</strong> that the src of the image, points to the PHP file, not to a traditional JPG etc.:</p>
<p><code>&lt;img src="http://www.64bitjungle.com/wp-content/themes/openbook22-en/subscribe-image.php" alt="Subscribe to RSS Feed" /&gt;</code></p>
<p>Et voila:</p>
<p style="text-align: center;"><img class="aligncenter" title="Subscribe to RSS Feed" src="http://www.64bitjungle.com/wp-content/themes/openbook22-en/subscribe-image.php" alt="" width="245" height="70" /></p>
<p>The font, by the way, is &#8220;SF Fedora&#8221;.</p>
<div class="shr-publisher-477"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.64bitjungle.com/programming/merge-two-images-with-php-and-gd/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MySQL Workbench 5.1.4 Alpha released for Linux</title>
		<link>http://www.64bitjungle.com/ubuntu/mysql-workbench-514-alpha-released-for-linux/</link>
		<comments>http://www.64bitjungle.com/ubuntu/mysql-workbench-514-alpha-released-for-linux/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 04:29:31 +0000</pubDate>
		<dc:creator>Hodge</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[workbench]]></category>

		<guid isPermaLink="false">http://www.64bitjungle.com/?p=241</guid>
		<description><![CDATA[Ok, so this is a few weeks after it&#8217;s been released, but I&#8217;ve not had much of a chance to catch up on these things! Anyway, following my post on MySQL Workbench 5.1.3 Alpha, here&#8217;s an update on installing the latest version &#8211; 5.1.4 Alpha. 32 Bit users can install from the repositories, by first [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Ok, so this is a few weeks after it&#8217;s been released, but I&#8217;ve not had much of a chance to catch up on these things! Anyway, following my post on <a href="http://www.64bitjungle.com/tech/mysql-workbench-513-linux-alpha-testing-on-32-bit-and-64-bit-ubuntu/" target="_self">MySQL Workbench 5.1.3 Alpha</a>, here&#8217;s an update on installing the latest version &#8211; <a href="http://dev.mysql.com/workbench/?p=169" target="_blank">5.1.4 Alpha</a>. <strong>32 Bit users</strong> can install from the repositories, by first adding the following to /etc/apt/sources.list so, open up a Terminal, and run the following:</p>
<p><code>gksu gedit /etc/apt/sources.list</code></p>
<p>Once the Text editor is open, add the following lines to the end of the file:</p>
<p><code>deb ftp://ftp.mysql.com/pub/mysql/download/gui-tools/ubuntu/ binary/<br />
deb-src ftp://ftp.mysql.com/pub/mysql/download/gui-tools/ubuntu/ source/</code></p>
<p>Save the file, and close the Editor. From the terminal, run:</p>
<p><code>sudo apt-get update<br />
sudo apt-get install mysql-workbench</code></p>
<p>That&#8217;s it. <strong>64 Bit users</strong> still have to compile and install from the source tarball &#8211; the latest version of which can be downloaded from <a href="ftp://ftp.mysql.com/pub/mysql/download/gui-tools/mysql-workbench-5.1.4alpha.tar.gz" target="_blank">ftp://ftp.mysql.com/pub/mysql/download/gui-tools/mysql-workbench-5.1.4alpha.tar.gz</a>, but the instructions are the same as in my previous post &#8220;<a href="http://www.64bitjungle.com/tech/mysql-workbench-513-linux-alpha-testing-on-32-bit-and-64-bit-ubuntu/" target="_self">MySQL Workbench 5.1.3 Linux Alpha &#8211; Testing on 32 bit and 64 bit Ubuntu</a>&#8220;.</p>
<p>This version has loads of bug fixes and some new features implemented, but it&#8217;s still not recommended to use on a Production DB!</p>
<div class="shr-publisher-241"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.64bitjungle.com/ubuntu/mysql-workbench-514-alpha-released-for-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Bundle and Widget Debugging on YouBundle</title>
		<link>http://www.64bitjungle.com/ubuntu/ubuntu-bundle-and-widget-debugging-on-youbundle/</link>
		<comments>http://www.64bitjungle.com/ubuntu/ubuntu-bundle-and-widget-debugging-on-youbundle/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 04:38:09 +0000</pubDate>
		<dc:creator>Hodge</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[youbundle]]></category>

		<guid isPermaLink="false">http://www.64bitjungle.com/?p=188</guid>
		<description><![CDATA[YouBundle is finally live! I&#8217;m currently trying to do 6 dozen different things, including debugging a really annoying &#8220;feature&#8221; in the Bundle Widget&#8230; For some reason, it only occurs on WordPress blogs, and basically, the page&#8217;s style sheet/CSS seems to be overriding the Widget CSS, and adding bullet styles to list items, where I really [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://www.youbundle.com" target="_blank">YouBundle</a> is finally live! I&#8217;m currently trying to do 6 dozen different things, including debugging a really annoying &#8220;feature&#8221; in the Bundle Widget&#8230; For some reason, it only occurs on WordPress blogs, and basically, the page&#8217;s style sheet/CSS seems to be overriding the Widget CSS, and adding bullet styles to list items, where I really don&#8217;t want them! Anyway, here&#8217;s a nice introduction to YouBundle, and the Widget feature &#8211; the <a href="http://www.youbundle.com/b/ubuntu" target="_blank">Ubuntu Bundle</a> I created a while back, during early development and testing:</p>
<div><script src="http://www.youbundle.com/widget/ubuntu" type="text/javascript"></script><a style="&amp;quote;color:blue;font-size:8pt;text-decoration:none;&amp;quote;" href="http://www.youbundle.com/b/ubuntu" target="_blank">Ubuntu</a></div>
<div class="shr-publisher-188"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.64bitjungle.com/ubuntu/ubuntu-bundle-and-widget-debugging-on-youbundle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>64 Bit Eclipse 3.4 (Ganymede) IDE with PDT and SQL Explorer &#8211; Full PHP/MySQL Web Application IDE</title>
		<link>http://www.64bitjungle.com/programming/64-bit-eclipse-34-ganymede-ide-with-pdt-and-sqlexplorer-full-php-mysql-web-application-ide/</link>
		<comments>http://www.64bitjungle.com/programming/64-bit-eclipse-34-ganymede-ide-with-pdt-and-sqlexplorer-full-php-mysql-web-application-ide/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 06:50:27 +0000</pubDate>
		<dc:creator>Hodge</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Eclipse 64 Bit]]></category>
		<category><![CDATA[Eclipse IDE]]></category>
		<category><![CDATA[Eclipse PDT]]></category>
		<category><![CDATA[Ganymede]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://www.64bitjungle.com/?p=117</guid>
		<description><![CDATA[Update, 16/01/09: This Guide has been superseded by &#8220;Full 64 Bit (or 32 Bit) Web Development and PHP/MySQL IDE with Eclipse 3.4 Ganymede and PDT 2&#8220;, but will be left here for reference, history, and so on&#8230; PDT is MUCH easier to install now I&#8217;ve been checking out the recently released Eclipse 3.4 (Ganymede), and [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignleft size-full wp-image-118" style="border: 0pt none ; float: left;" title="Eclipse 3.4 Ganymede" src="http://www.64bitjungle.com/wp-content/uploads/2008/08/ganymede.png" alt="Eclipse 3.4 Ganymede" width="300" height="195" /></p>
<p><strong>Update, 16/01/09: This Guide has been superseded by &#8220;<a href="http://www.64bitjungle.com/ubuntu/full-64-bit-or-32-bit-web-development-and-php-mysql-ide-with-eclipse-34-ganymede-and-pdt-2/">Full 64 Bit (or 32 Bit) Web Development and PHP/MySQL IDE with Eclipse 3.4 Ganymede and PDT 2</a>&#8220;, but will be left here for reference, history, and so on&#8230; PDT is MUCH easier to install now <img src='http://www.64bitjungle.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<p>I&#8217;ve been checking out the recently released Eclipse 3.4 (Ganymede), and so far so good. I&#8217;ve managed to get PDT (for PHP Development) and SQL Explorer installed and running successfully, so I&#8217;ll be doing some testing to see how it compares to Europa, which I have been using for some time. Thankfully, installing plugins is <em>much</em> easier with Ganymede &#8211; this is how I got it set up an configured.</p>
<p><strong>IMPORTANT NOTE:</strong> This installation configuration currently relies on Integration builds of both PDT and DLTK, since the current Stable builds of each are not currently supported under Eclipse 3.4. I will update this tutorial as support becomes available, but if you are not comfortable installing Integration builds, please see my previous tutorial on setting up a PHP IDE in Eclipse Europa: &#8220;<a href="http://www.64bitjungle.com/tech/64-bit-eclipse-linux-installation-including-pdt-wtp-wst-atf-and-mysql-sql-explorer-plugin/" target="_self">64 Bit Eclipse: Linux Installation, including PDT, WTP (WST), ATF, and MySQL (SQL Explorer Plugin)</a>&#8220;.</p>
<p><strong>Install Eclipse</strong></p>
<p>Installing Eclipse is a pretty easy task &#8211; just head over to <a href="http://www.eclipse.org/downloads/" target="_blank">http://www.eclipse.org/downloads</a> and download the latest version of &#8220;Eclipse Classic&#8221; (<a href="http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.4-200806172000/eclipse-SDK-3.4-linux-gtk-x86_64.tar.gz" target="_blank">direct link to 64 bit version</a>). I downloaded the file to my desktop, and once finished, opened up a Terminal window, extracted the archive, and installed Eclipse into the <span style="font-size: 120%; font-family: monospace;">/opt</span> directory:</p>
<p><code>cd ~/Desktop<br />
tar -zxvf eclipse-SDK-3.4-linux-gtk-x86_64.tar.gz<br />
sudo mv eclipse /opt/ganymede</code></p>
<p>I installed into <span style="font-size: 120%; font-family: monospace;">/opt/ganymede</span> since I already have Europa installed in <span style="font-size: 120%; font-family: monospace;">/opt/eclipse</span>.</p>
<p>That&#8217;s all there is to installing Eclipse. It can be run (for now) via the Terminal:</p>
<p><code>cd /opt/ganymede<br />
./eclipse</code></p>
<p><strong>Installing PDT</strong></p>
<p>As mentioned above, the latest Stable build of PDT is not yet supported in Eclipse 3.4, and since only PDT 1.0.x is available via the Update Site, it&#8217;s necessary to download the 2.0.x Integration Build from the PDT Website (see <a href="http://www.mail-archive.com/pdt-dev@eclipse.org/msg00103.html" target="_blank">this thread</a> at pdt-dev for more information). The same goes for DLTK (Dynamic Languages Toolkit) upon which PDT depends &#8211; only the Integration Build may be installed with Ganymede.</p>
<p>Firstly I downloaded DLTK, from <a href="http://download.eclipse.org/technology/dltk/downloads/" target="_blank">http://download.eclipse.org/technology/dltk/downloads</a> &#8211; click on the Integration Build download link, and grab the Core Frameworks archive (<a href="http://download.eclipse.org/technology/dltk/downloads/drops/R1.0/I-I200807291021-200807291021/dltk-core-I-I200807291021-200807291021-incubation.zip" target="_blank">direct link</a> to current version &#8211; Integration Builds are likely to change frequently, so best to visit the main doanload page). Next, grab the PDT archive from <a href="http://download.eclipse.org/tools/pdt/downloads/" target="_blank">http://download.eclipse.org/tools/pdt/downloads/</a> (click on the 2.0.0 Integration Build link, then grab the PDT Runtime archive &#8211; <a href="http://www.eclipse.org/downloads/download.php?file=/tools/pdt/downloads/drops/I20080722/org.eclipse.php_feature-I20080722.zip" target="_blank">direct link</a>). Don&#8217;t worry about the requirements and handy extras.</p>
<p>Once downloaded, again to my Desktop, I created a couple of temporary directories, and unziped both archives into their respective new homes:</p>
<p><code>mkdir pdt dltk<br />
mv org.eclipse.php_feature-I20080722.zip pdt<br />
cd pdt<br />
unzip org.eclipse.php_feature-I20080722.zip pdt<br />
cd ~/Desktop<br />
mv dltk-core-I-I200807291021-200807291021-incubation.zip dltk<br />
cd dltk<br />
unzip dltk-core-I-I200807291021-200807291021-incubation.zip</code></p>
<p>Now the Eclipse Update manager can be pointed to these &#8220;local sites&#8221;. I fired up Eclipse once again, and navigated to the Update Manager: Help -&gt; Software Updates. Once open, I clicked on the Available Software tab, and added the new sites &#8211; click on Add Site, click Local, and navigate to <span style="font-size: 120%; font-family: monospace;">~/Desktop/pdt/eclipse</span>. Click OK, and repeat for <span style="font-size: 120%; font-family: monospace;">~/Desktop/dltk/eclipse</span>. Now there should be two more sites (&#8220;/home/username/Desktop/pdt/eclipse&#8221; and &#8220;/home/username/Desktop/dltk/eclipse&#8221;) in addition to &#8220;Eclipse Project Update Site&#8221; and &#8220;Ganymede&#8221; (or &#8220;http://download.eclipse.org/releases/ganymede&#8221;). Expand each of the two new sites, and select the lowest leaf in each tree &#8211; &#8220;PDT Feature&#8221; and &#8220;Dynamic Languages Toolkit&#8221;.</p>
<p style="text-align: center;"><img class="size-full wp-image-119" title="Eclipse Ganymede Update Manager" src="http://www.64bitjungle.com/wp-content/uploads/2008/08/eclipse-ganymede-update-manager.png" alt="Eclipse Ganymede Update Manager" width="450" height="418" /></p>
<p>PDT is also dependent upon the Graphical Editing Framework (GEF), so expand the Ganymede tree, then &#8220;Graphical Editors and Frameworks&#8221; and select the &#8220;Graphical Editing Framework GEF&#8221; option.</p>
<p>Don&#8217;t click &#8220;Install&#8221; quite yet &#8211; there are a few other additional things to select for a full Web Application Development IDE.</p>
<p><strong>Web Application stuff</strong></p>
<p>Expand the main Ganymede tree, and &#8220;Web and Java EE Dvelopment&#8221;. I personally selected:</p>
<ul>
<li> Eclipse XML Editors and Tools</li>
<li> Javascript Developer Tools</li>
<li> Web Developer Tools</li>
<li> Web Page Editor</li>
</ul>
<p>You may want more, or less. Almost there&#8230;</p>
<p><strong>Database Integration</strong></p>
<p>Expand Database Development, and select Data Tools Platform Enablement and Data Tools Platform SQL Development. These are required for setting up a connection to MySQL later.</p>
<p>OK, click Install! Go and make a brew, or coffee &#8211; this may take some time.</p>
<p>Once everything has been downloaded and installed, restart Eclipse.</p>
<p><strong>SQL Explorer Plugin<br />
</strong></p>
<p>I find <a href="http://eclipsesql.sourceforge.net/" target="_blank">SQL Explorer</a> is a great little plugin to use as a DB GUI. To install it, I downloaded the <a href="http://sourceforge.net/project/showfiles.php?group_id=132863" target="_blank">latest version</a> to my Desktop, and extracted the files.</p>
<p><code>cd ~/Desktop<br />
mkdir sqlexplorer<br />
mv sqlexplorer_plugin-3.5.0.RC5.zip sqlexplorer<br />
cd sqlexplorer<br />
unzip sqlexplorer_plugin-3.5.0.RC5.zip</code></p>
<p>As with the PDT and DLTK plugins, to install is just a simple case of adding a new Local site to the Eclipse Update Manager, and selecting the plugin to install. So, open up the Update Manager &#8211; Help -&gt; Software Updates, and select the Available Software tab. Add new site, click Local, navigate to ~/Desktop/sqlexplorer, click OK, etc. Once the site is added, expand the new SQL Explorer, select the lowest level leaf, and click install.</p>
<p>Once installed, restart Eclipse. Some configuration is still required to get SQL Explorer linked up to a MySQL Database, which I have covered in a previous tutorial: <a href="http://www.64bitjungle.com/tech/eclipse-pdt-and-mysql-sql-explorer-plugin/#configsqlexplorer" target="_self">Eclipse PDT and MySQL &#8211; SQL Explorer Plugin</a>. It&#8217;s pretty simple, and just involves downloading the Java Connector for MySQL, and pointing Eclipse to it.</p>
<p><strong>ATF (AJAX Toolkit)</strong></p>
<p>Unfortunately, ATF is not yet supported in Ganymede &#8211; I&#8217;m keeping track of it, however, and will update this tutorial as soon as support is available. In the mean time, check out the current status at <a href="http://www.mail-archive.com/atf-dev@eclipse.org" target="_blank">atf-dev</a>.</p>
<p><strong>Debugging PHP with Xdebug</strong></p>
<p>The information in my previous tutorial, <a href="http://www.64bitjungle.com/tech/debugging-php-applications-with-xdebug-and-eclipse-pdt" target="_self">Debugging PHP Applications with Xdebug and Eclipse PDT</a>, can still be applied to Ganymede.</p>
<p>Hope that helps.</p>
<p><strong>References</strong></p>
<ol>
<li><a href="http://wiki.eclipse.org/PDT/Installation#Eclipse_3.4_.2F_Ganymede_.2F_PDT_1" target="_blank">http://wiki.eclipse.org/PDT/Installation#Eclipse_3.4_.2F_Ganymede_.2F_PDT_1</a></li>
<li><a href="http://www.mail-archive.com/pdt-dev@eclipse.org" target="_blank">http://www.mail-archive.com/pdt-dev@eclipse.org</a></li>
<li><a href="http://www.mail-archive.com/atf-dev@eclipse.org/" target="_blank">http://www.mail-archive.com/atf-dev@eclipse.org</a></li>
</ol>
<div class="shr-publisher-117"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.64bitjungle.com/programming/64-bit-eclipse-34-ganymede-ide-with-pdt-and-sqlexplorer-full-php-mysql-web-application-ide/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Debugging PHP Applications with Xdebug and Eclipse PDT</title>
		<link>http://www.64bitjungle.com/tech/debugging-php-applications-with-xdebug-and-eclipse-pdt/</link>
		<comments>http://www.64bitjungle.com/tech/debugging-php-applications-with-xdebug-and-eclipse-pdt/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 04:31:47 +0000</pubDate>
		<dc:creator>Hodge</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[PDT]]></category>
		<category><![CDATA[Xdebug]]></category>

		<guid isPermaLink="false">http://www.64bitjungle.com/tech/debugging-php-applications-with-xdebug-and-eclipse-pdt/</guid>
		<description><![CDATA[OK, so I have x64 Eclipse successfully installed and running with all the plugins I use for Web Application Development. But what about debugging? Sure, var_dump(), echo, print and so on are all valuable to me when debugging a script, but it&#8217;s always good to have more information. Xdebug is a fantastic PHP extension, which [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://www.xdebug.org" target="_blank"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/04/xdebug-logo.png" alt="Xdebug Logo" align="left" border="0" /></a>OK, so I have <a href="http://www.64bitjungle.com/tech/64-bit-eclipse-linux-installation-including-pdt-wtp-wst-atf-and-mysql-sql-explorer-plugin/">x64 Eclipse successfully installed and running</a> with all the plugins I use for Web Application Development. But what about debugging? Sure, <span style="font-family: monospace; font-size: 120%">var_dump()</span>, <span style="font-family: monospace; font-size: 120%">echo</span>, <span style="font-family: monospace; font-size: 120%">print</span> and so on are all valuable to me when debugging a script, but it&#8217;s always good to have more information.</p>
<p><a href="http://www.xdebug.org" target="_blank">Xdebug</a> is a fantastic PHP extension, which is written by one of the PHP Core Developers, Derick Rethans. The current version is 2.0.3, and I set about installing it on my system, and integrating it into Eclipse PDT today.</p>
<p>Xdebug can be installed in a few different ways &#8211; by downloading the binaries from the site, compiling the source, or via PECL:</p>
<p><code>sudo pecl install xdebug</code></p>
<p>Some days, I just prefer to download compile the source, as it gives me more of an understanding of what is being installed and where, and this is one of those days:</p>
<p><code>cd ~/<br />
mkdir xdebug<br />
cd xdebug<br />
wget http://www.xdebug.org/link.php?url=xdebug203<br />
tar -zxvf xdebug-2.0.3.tgz<br />
cd xdebug-2.0.3</code></p>
<p>The packages <span style="font-family: monospace; font-size: 120%">phpize</span> and <span style="font-family: monospace; font-size: 120%">php-config</span> are required to install Xdebug, and can be obtained by installing the relevant PHP development packages:</p>
<p><code>sudo apt-get install php4-dev</code></p>
<p>or</p>
<p><code>sudo apt-get install php5-dev</code></p>
<p>depending on the PHP version installed. After unzipping the Xdebug source, I ran</p>
<p><code>phpize</code></p>
<p>which output:</p>
<p><code>PHP Api Version: 20041225<br />
Zend Module Api No: 20060613<br />
Zend Extension Api No: 220060519</code></p>
<p>I then checked this against the table at <a href="http://www.xdebug.org/docs/install#phpize" target="_blank">http://www.xdebug.org/docs/install#phpize</a> to see if my PHP version (5.2.3) was compatible with Xdebug &#8211; it matched  up to the table&#8217;s 5.2.x PHP version row, so I went ahead and installed:</p>
<p><code>./configure --enable-xdebug  --with-php-config=/usr/bin/php-config<br />
make</code></p>
<p>which created a file <span style="font-family: monospace; font-size: 120%">xdebug.so</span> in the <span style="font-family: monospace; font-size: 120%">modules</span> subdirectory. This file needs to be copied (or moved) to the PHP Extension directory, which on my system is in <span style="font-family: monospace; font-size: 120%">/usr/lib/php5/20060613/</span>. An easy way to find the PHP extension directory is to run:</p>
<p><code>locate mysql.so</code></p>
<p>ok, so I copied the xdebug.so to the extension directory:</p>
<p><code>sudo cp modules/xdebug.so /usr/lib/php5/20060613/</code></p>
<p>So far so good. Now PHP needs to be told about the extension, and to load it. This can be done by adding</p>
<p><code>zend_extension="/usr/lib/php5/20060613/xdebug.so"</code></p>
<p>to the <span style="font-family: monospace; font-size: 120%">php.ini</span> file. However, on my Ubuntu system, the PHP extensions are activated by adding an .ini file to the <span style="font-family: monospace; font-size: 120%">/etc/php5/apache2/conf.d</span> directory, for each extension installed. The .ini file is the extension_name.ini, so I created a file called <span style="font-family: monospace; font-size: 120%">xdebug.ini</span>:</p>
<p><code>cd /etc/php5/apache2/conf.d<br />
gksu gedit xdebug.ini</code></p>
<p>which for now, contains a single line:</p>
<p><code>zend_extension="/usr/lib/php5/20060613/xdebug.so"</code></p>
<p>After restarting the Apache server</p>
<p><code>sudo /etc/init.d/apache2 restart</code></p>
<p>I created a file called <span style="font-family: monospace; font-size: 120%">test.php</span> in my Web Root directory, containing a call to the <span style="font-family: monospace; font-size: 120%">phpinfo()</span> function:</p>
<p><code>&lt;?php<br />
phpinfo();<br />
?&gt;</code></p>
<p>and pointed my browser to <span style="font-family: monospace; font-size: 120%">http://localhost/test.php</span>. Just before the &#8220;PHP Credits&#8221; section, is a small box containing information on Zend &#8211; and now, with a successful Xdebug installation, additional information on Xdebug:</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/04/xdebug-successful-install.png" alt="Xdebug information output by phpinfo()" /></p>
<p>The same information can be found by opening a Terminal and running</p>
<p><code>php -m</code></p>
<p>to output the loaded modules, and towards the end of the output, you should see</p>
<p><code>[Zend Modules]<br />
Xdebug</code></p>
<p>alternatively, run</p>
<p><code>php -i | grep Xdebug</code></p>
<p>and if Xdebug has been installed successfully, you should see</p>
<p><code>with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans</code></p>
<p>Now, Xdebug needs to be enabled before any scripts can be debugged! So, in the <span style="font-family: monospace; font-size: 120%">php.ini</span> file (or in my case, the newly created <span style="font-family: monospace; font-size: 120%">/etc/php5/apache2/conf.d/xdebug.ini</span> file) I added the lines:</p>
<p><code>xdebug.remote_enable=On<br />
xdebug.remote_host="localhost"<br />
xdebug.remote_port=9000<br />
xdebug.remote_handler="dbgp"</code></p>
<p>and restarted Apache again:</p>
<p><code>sudo /etc/init.d/apache2 restart</code></p>
<p>running</p>
<p><code>php -i | grep xdebug</code></p>
<p>in the Terminal, or using the <span style="font-family: monospace; font-size: 120%">test.php</span> file containing <span style="font-family: monospace; font-size: 120%">phpinfo()</span> shows that the new settings are being used, and Xdebug is active and running.</p>
<p><strong>Configuring Eclipse PDT:</strong></p>
<p>Setting up Eclipse PDT to use the Xdebug extension is pretty simple. In Eclipse PDT, I opened Window -&gt; Preferences, then clicked on  PHP, expanded the tree, and selected Debug. I Chose Xdebug from the pull down menu for the PHP Debugger, the &#8220;Default PHP Server&#8221; (should already be set to localhost), and then created a new PHP Executable option by clicking on the PHP Executables link next to the PHP Executable pull down menu.</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/04/xdebug_in_eclipse_pdt.png" alt="XDebug and Eclipse PDT" /></p>
<p>In the PHP Executables dialog, I Clicked Add, filled in the name (PHP with XDebug), and entered the path to the PHP executable &#8211; on my system this is <span style="font-family: monospace; font-size: 120%">/usr/bin/php</span> but if you don&#8217;t know, then in a terminal, run</p>
<p><code>which php</code></p>
<p>to find out where the <span style="font-family: monospace; font-size: 120%">php</span> command is run from. I also entered the location of <span style="font-family: monospace; font-size: 120%">php.ini</span> &#8211; again, on my system, this is <span style="font-family: monospace; font-size: 120%">/etc/php5/apache2/php.ini</span> &#8211; and selected XDebug as the PHP debugger:</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/04/xdebug_setting_up_php_executable.png" alt="Xdebug - set up PHP Executable in Eclipse PDT" /></p>
<p>Clicked OK, then went back to the PHP -&gt; Debug preferences screen, and selected the PHP Executable just created in the PHP Executable pull down. Finally, in the Debug -&gt; Workbench Options option in the left,  I selected &#8220;Never&#8221; for the &#8220;allow multiple debug sessions&#8221; option, since Xdebug does not support them.</p>
<p>Finally, I needed to set the Default Web Browser in Eclipse, to that when I debug a script, the output is sent to Firefox. Again in Preferences, I navigated to General -&gt; Web Browser, and clicked &#8220;New&#8221;. It&#8217;s pretty straight forward stuff &#8211; entering a name and location &#8211; Firefox, and <span style="font-family: monospace; font-size: 120%">/usr/bin/firefox</span>. Again, if you don&#8217;t know the location of the firefox binary, in a terminal run:</p>
<p><code>which firefox</code></p>
<p>With this done, and the preferences saved, I can now debug my scripts using Xdebug!</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/04/xdebug_using.png" alt="Using Xdebug in PDT" /></p>
<p><strong>References:</strong></p>
<p><a href="http://www.xdebug.org/docs/install" target="_blank">http://www.xdebug.org/docs/install</a><br />
<a href="http://www.eclipse.org/pdt/documents/XDebugGuide.pdf" target="_blank">http://www.eclipse.org/pdt/documents/XDebugGuide.pdf</a><br />
<a href="http://devzone.zend.com/article/2803-Introducing-xdebug" target="_blank">http://devzone.zend.com/article/2803-Introducing-xdebug</a></p>
<div class="shr-publisher-69"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.64bitjungle.com/tech/debugging-php-applications-with-xdebug-and-eclipse-pdt/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>64 Bit Eclipse: Linux Installation, including PDT, WTP (WST), ATF, and MySQL (SQL Explorer Plugin)</title>
		<link>http://www.64bitjungle.com/tech/64-bit-eclipse-linux-installation-including-pdt-wtp-wst-atf-and-mysql-sql-explorer-plugin/</link>
		<comments>http://www.64bitjungle.com/tech/64-bit-eclipse-linux-installation-including-pdt-wtp-wst-atf-and-mysql-sql-explorer-plugin/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 06:25:19 +0000</pubDate>
		<dc:creator>Hodge</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ATF]]></category>
		<category><![CDATA[Eclipse 64 Bit]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PDT]]></category>
		<category><![CDATA[SQL Explorer Plugin]]></category>
		<category><![CDATA[WST]]></category>
		<category><![CDATA[WTP]]></category>

		<guid isPermaLink="false">http://www.64bitjungle.com/tech/64-bit-eclipse-linux-installation-including-pdt-wtp-wst-atf-and-mysql-sql-explorer-plugin/</guid>
		<description><![CDATA[Update, 16/01/09: This tutorial has been superseded by &#8220;Full 64 Bit (or 32 Bit) Web Development and PHP/MySQL IDE with Eclipse 3.4 Ganymede and PDT 2&#8221; which covers the latest versions of Eclipse (Ganymede &#8211; 3.4) and PDT (2.x). NOTE, 04/08/08: This tutorial covers Eclipse Europa. If you would like to install the latest version [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img src="http://www.64bitjungle.com/wp-content/uploads/2008/02/eclipse_home_header.jpg" alt="Eclipse SDK" align="left" /><strong>Update, 16/01/09:</strong> This tutorial has been superseded by &#8220;<a href="http://www.64bitjungle.com/ubuntu/full-64-bit-or-32-bit-web-development-and-php-mysql-ide-with-eclipse-34-ganymede-and-pdt-2/" target="_self">Full 64 Bit (or 32 Bit) Web Development and PHP/MySQL IDE with Eclipse 3.4 Ganymede and PDT 2</a>&#8221; which covers the latest versions of <em><strong>Eclipse (Ganymede &#8211; 3.4) and PDT (2.x)</strong></em>.</p>
<p><strong>NOTE, 04/08/08: </strong>This tutorial covers <strong><em>Eclipse Europa</em></strong>.<strong> </strong>If you would like to install the latest version of Eclipse <strong>3.4 Ganymede</strong>, with PDT and SQL Explorer, take a look at my latest Tutorial: &#8220;<a href="http://www.64bitjungle.com/programming/64-bit-eclipse-34-ganymede-ide-with-pdt-and-sqlexplorer-full-php-mysql-web-application-ide" target="_self">64 Bit Eclipse 3.4 (Ganymede) IDE with PDT and SQL Explorer &#8211; Full PHP/MySQL Web Application IDE</a>&#8220;.</p>
<p>I had tried once before to install the x64 (64 Bit) version of Eclipse IDE, about 8 months ago, but found it to be somewhat buggy and unstable. In the interim, I&#8217;ve been using the <a href="http://www.64bitjungle.com/tech/eclipse-32-bit-pdt-install-on-64-bit-ubuntu/">32 Bit version of Eclipse PDT</a> for my development stuff. Earlier this year (21/02/08) a new version of Eclipse 64 Bit was released, so I gave it a go today. So far, so good!</p>
<p>Unfortunately, there&#8217;s no 64 Bit PDT all-in-one, but I managed to install a 64 Bit equivalent by cobbling together the relevant packages available by using the Eclipse Update Manager system, after initially installing the latest version of Eclipse Classic 3.3.2 64 Bit.</p>
<p>I wanted to keep everything (or as much as possible) 64 Bit, so I also download and installed the 64 Bit JRE, which can be <a href="http://www.java.com/en/download/linux_manual.jsp" target="_blank">downloaded here</a> (or use the <a href="http://javadl.sun.com/webapps/download/AutoDL?BundleId=18707" target="_blank">direct link to the bin file</a>). The method for installing the 64 Bit JRE is the same as the 32 Bit version &#8211; after the file downloaded to my desktop, I opened up a new Terminal Window (Applications -&gt; Accessories -&gt; Terminal), traversed to the directory I wanted to install it into, moved the file, made it executable, and ran it to install:</p>
<p><code>cd /usr/java<br />
sudo mkdir 64<br />
cd 64<br />
sudo mv ~/Desktop/jdk-6u5-linux-x64.bin /usr/java/64/<br />
sudo chmod a+x jdk-6u5-linux-x64.bin<br />
sudo ./jdk-6u5-linux-x64.bin</code></p>
<p>If the &#8220;java&#8221; directory doesn&#8217;t exist, it needs to be created first:</p>
<p><code>sudo mkdir /usr/java</code></p>
<p>listing the directory</p>
<p><code>ls</code></p>
<p>should return</p>
<p><code>jre1.6.0_05</code></p>
<p>which is the directory containing the necessary Java binaries.</p>
<p>As with my previous 32 Bit installation, I wanted Eclipse to be installed in the /opt directory:</p>
<p><code>cd /opt<br />
sudo mv ~/Desktop/eclipse-SDK-3.3.2-linux-gtk-x86_64.tar.gz /opt<br />
sudo tar -zxvf eclipse-SDK-3.3.2-linux-gtk-x86_64.tar.gz</code></p>
<p>then rename the eclipse directory:</p>
<p><code>sudo mv eclipse eclipse64</code></p>
<p>I also needed to get the newly installed Eclipse to run with the newly installed JRE &#8211; by default, the eclipse executable in the directory will try and detect Java and use whatever it finds, so I created a shell script:</p>
<p><code>cd eclipse64<br />
sudo gksu gedit eclipse.sh</code></p>
<p>containing the following:</p>
<p><code>#!/bin/bash<br />
PATH=/usr/java/64/jre1.6.0_05/bin:$PATH<br />
/opt/eclipse64/eclipse</code></p>
<p>Now instead of running the eclipse executable, I run eclipse.sh (make sure it&#8217;s executable)</p>
<p><code>sudo chmod 755 eclipse.sh</code></p>
<p>before running</p>
<p><code>/opt/eclipse64/eclipse.sh</code></p>
<p><strong>PDT and WTP Plugins</strong></p>
<p>The first time I ran the new 64 Bit version, everything went well &#8211; it was fast, and seemed stable, so I went ahead and started installing all the additional plugins I needed (and still need&#8230;). Goto Help -&gt; Software Updates -&gt; Find and Install, and select &#8220;Search for new features to install&#8221;.Click on &#8220;New Remote Site&#8221; for each of the following:</p>
<ul>
<li>Name: PDT, URL: http://download.eclipse.org/tools/pdt/updates/</li>
<li>Name: WTP, URL:  http://download.eclipse.org/webtools/updates/</li>
<li>Name: GEF, URL:  http://www.eclipse.org/gef/updates/</li>
<li>Name: EMF, IRL:  http://www.eclipse.org/modeling/emf/updates/</li>
</ul>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/04/eclipse_add_remote_site.png" alt="Eclipse Update Manager Add Remote Site" /></p>
<p>Actually, there are only a couple of components required from the GEF (Graphical Editing Framework) and EMF (Eclipse Modeling Framework) packages to satisfy dependencies &#8211; WTP (Web Tools Platform) requires a package from GEF, and GEF from EMF&#8230;</p>
<p>After adding these, click on Finish &#8211; the Update Manager will then query any mirrors for the latest versions of the plugins. Once it has finished, a dialog appears, where it is possible to select the plugins to download and install. First, I selected PDT &#8211; the Update Manager then informed me that PDT requires files from WTP, so I tried clicking the &#8220;Select Requires&#8221; button, hoping that it would sort out the dependencies on my behalf. Unfortunately, nothing happened&#8230; So, I selected WTP manually, then expanded GEF -&gt; Eclipse SDK R3.3.1 and Selected Graphical Editing Framework 3.3.1v20070814, <em>then</em> expanded EMF -&gt; EMF SDK 2.3.2 and selected Eclipse Modeling Framework (EMF) &#8211; org.eclipse.emf.ecore 2.3.2v200802051830&#8230; I could <strong>then</strong> click &#8220;Select Required&#8221; to get the last few residual required dependencies&#8230; Phew&#8230;</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/04/eclipse_select_updates.png" alt="Eclipse Update Manager Select Updates" /></p>
<p>Actualy, it still bugged me for dependencies for Java Persistence API contained in WTP, but by that stage I really couldn&#8217;t be arsed going through the process of adding more stuff to the Update Manager and potentially having to search for further dependencies, so I just deselected the three Java Persistence API files contained in WTP.</p>
<p>OK, with the dependencies sorted,  I clicked Next, accepted the agreements, finished, and went to make, and drink a brew (that&#8217;s Tea) while the Update Manager downloaded and installed the requested stuff.</p>
<p><strong>MySQL: SQL Explorer Plugin </strong></p>
<p><img src="http://www.64bitjungle.com/wp-content/uploads/2008/03/sqlexplorer_logo.jpg" border="0" alt="Eclipse SQL Explorer Logo" align="left" />Once everything had downloaded and installed, I restarted Eclipse. Everything looked good! Great, in fact. But I also wanted to install a few more plugins, including the MySQL SQL Explorer Plugin &#8211; which additionally requires, and depends on <a href="http://eclipse.org/datatools" target="_blank">Eclipse DTP</a> (Data Tools Project). Eclipse DTP has to be downloaded and installed manually, since there is no automated Update Site. So, I downloaded <a href="http://www.eclipse.org/downloads/download.php?file=/datatools/downloads/1.5/dtp_1.5.2_022008.zip" target="_blank">dtp_1.5.2_022008.zip</a> to my Desktop, and set about extracting and installing the files:</p>
<p><code>cd ~/Desktop<br />
mkdir DTP<br />
mv dtp_1.5.2_022008.zip DTP<br />
cd DTP<br />
unzip dtp_1.5.2_022008.zip<br />
cd eclipse<br />
sudo cp -R features plugins /opt/eclipse64</code></p>
<p>If Eclipse is open, restart it. With the DTP installed, I could set about installing the SQL Explorer Plugin. The instructions for installing and configuring the SQL Explorer Plugin can be found in my previous article &#8211; <a href="http://www.64bitjungle.com/tech/eclipse-pdt-and-mysql-sql-explorer-plugin/">Eclipse PDT and MySQL &#8211; SQL Explorer Plugin</a>, since I don&#8217;t want to regurgitate information, just follow the link if you need to install it, and come back when it&#8217;s done.</p>
<p><strong>Note:</strong> Actually, now I had the DTP installed, I could download and install the additional Java Persistence API in WTP! Same method: Update Manager, select WTP etcetera, etcetera&#8230;</p>
<p><strong>ATF: AJAX Framework Toolkit </strong></p>
<p><img src="http://www.64bitjungle.com/wp-content/uploads/2008/04/scriptaculous_logo.gif" border="0" alt="Script.aculo.us" align="left" />Once the SQL Explorer Plugin was installed, I had one final plugin &#8211; <a href="http://www.eclipse.org/atf/" target="_blank">ATF (the AJAX Toolkit Framework)</a>. This can be <a href="http://www.eclipse.org/downloads/download.php?file=/webtools/atf/0.2.3M4-v200709141050/atf-incubation-SiteArchive-0.2.3M4-v200709141050.zip" target="_blank">downloaded as a Site Archive</a>, and the zip file added to Eclipse&#8217;s Update Manager. Once downloaded, I opened the Update Manager in Eclipse (Help -&gt; Software Updates -&gt; Find and Install), and clicked on &#8220;New Archived Site&#8221;, to add a new locally archived site, calling it ATF, and pointing it to the freshly downloaded <a href="http://www.eclipse.org/downloads/download.php?file=/webtools/atf/0.2.3M4-v200709141050/atf-incubation-SiteArchive-0.2.3M4-v200709141050.zip" target="_blank">atf-incubation-SiteArchive-0.2.3M4-v200709141050.zip</a> file. I discovered, however, that the site.xml file contained within the zipped site archive is somewhat out of date and the pointers within are directed to the wrong download locations, so I had to manually locate the additional dependent plugins &#8211; Mozilla XULRunner, and Mozilla JS.  They can both be added as New Remote Sites to the Update Manager, by clicking on the &#8220;New Remote Site&#8221; button, and adding the following information:</p>
<ul>
<li>Name: Mozilla JS, URL: http://ftp.mozilla.org/pub/mozilla.org/js/eclipse/</li>
<li>Name: XULRunner, URL: http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.8.1.3/contrib/eclipse/</li>
</ul>
<p>The previously used EMF plugin is also required to satisfy a couple of dependencies, so I selected the ATF, Mozilla JS, XULRunner, and EMF plugins from the list, and clicked Finish. Once the &#8220;updates&#8221; were found, I selected XULRunner, Mozilla JS, ATF (I deselected the ATF -&gt; Mozilla JS component though, since an updated version was to be downloaded and installed from the Mozilla Server), and also selected the required EMF components. Click through Next etc. to download and install. Once completed, I restarted Eclipse.</p>
<p>In the Window -&gt; Preferences menu by the way, AJAX toolkits such as Script.aculo.us can be added to the ATF module.</p>
<p><strong>Et Voila! </strong>I now have a working Eclipse 64 Bit version up and running! Finally!</p>
<p>Oh, if you want a desktop icon, just create a file on your Desktop called Eclipse.desktop,</p>
<p><code>cd ~/Desktop<br />
gedit Eclipse.desktop</code></p>
<p>and add the following:</p>
<p><code>[Desktop Entry]<br />
Categories=;<br />
Encoding=UTF-8<br />
Exec=/opt/eclipse32/eclipse.sh<br />
Hidden=false<br />
Icon=/opt/eclipse64/icon.xpm<br />
Icon[en_US]=/opt/eclipse64/icon.xpm<br />
Name=Eclipse<br />
Name[en_US]=Eclipse<br />
Terminal=false<br />
Type=Application<br />
Version=1.0</code></p>
<div class="shr-publisher-65"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.64bitjungle.com/tech/64-bit-eclipse-linux-installation-including-pdt-wtp-wst-atf-and-mysql-sql-explorer-plugin/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Conky: Dual Core Processors in .conkyrc</title>
		<link>http://www.64bitjungle.com/tech/conky-dual-core-processors-in-conkyrc/</link>
		<comments>http://www.64bitjungle.com/tech/conky-dual-core-processors-in-conkyrc/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 07:14:20 +0000</pubDate>
		<dc:creator>Hodge</dc:creator>
				<category><![CDATA[Conky]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[64 bit]]></category>
		<category><![CDATA[AMD]]></category>
		<category><![CDATA[conkyrc]]></category>
		<category><![CDATA[Dual Core]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://www.64bitjungle.com/tech/conky-dual-core-processors-in-conkyrc/</guid>
		<description><![CDATA[OK, this is a bit of a cheeky post, since I&#8217;m merely extending a previous post &#8220;Conky on Ubuntu 64 Bit &#8211; .conkyrc&#8221; &#8211; or elaborating on it &#8211; to clarify setting up .conkyrc for Dual Core Processors &#8211; specifically for my AMD Turion 64 X2. I&#8217;ve had a few requests specifically about this, so [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>OK, this is a bit of a cheeky post, since I&#8217;m merely extending a previous post &#8220;<a href="http://www.64bitjungle.com/tech/conky-on-ubuntu-64-bit-conkyrc/">Conky on Ubuntu 64 Bit &#8211; .conkyrc</a>&#8221; &#8211; or elaborating on it &#8211; to clarify setting up .conkyrc for Dual Core Processors &#8211; specifically for my AMD Turion 64 X2. I&#8217;ve had a few requests specifically about this, so here goes&#8230;</p>
<p>Now, the part of my .conkyrc file that deals with my Dual Core looks like this:</p>
<p>
<code>${color #42AE4A}Usage (Avg):${color #42AE4A} ${freq_dyn_g}Ghz ${color lightgrey}${cpu cpu0}% ${alignr}${color #42AE4A}${cpubar cpu0 5,80}<br />
${color #42AE4A}Usage (Core 1):${color #42AE4A} ${freq_dyn_g cpu1}Ghz ${color lightgrey}${cpu cpu1}% ${alignr}${color #42AE4A}${cpubar cpu1 5,80}<br />
${color #42AE4A}Usage (Core 2):${color #42AE4A} ${freq_dyn_g cpu2}Ghz ${color lightgrey}${cpu cpu2}% ${alignr}${color #42AE4A}${cpubar cpu2 5,80}<br />
${color #42AE4A}Average<br />
${cpugraph cpu0 42AE4A eeeeee}<br />
${color #42AE4A}Core 1 $alignr Core 2<br />
${color #42AE4A}${cpugraph cpu1 25,120 42AE4A eeeeee} ${color #42AE4A} $alignr${color #42AE4A}${cpugraph cpu2 25,120 42AE4A eeeeee}<br />
${color #42AE4A}Processes:${color lightgrey} $processes  ${color #42AE4A}Run:${color lightgrey} $running_processes ${color #42AE4A}CPU Temp:${color lightgrey} ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep -o "[0-9]* C"}<br />
${color #42AE4A}Core 1 Temp: ${color lightgrey}${execi 8 sensors | grep -A 1 'Core0' | cut -c13-16 | sed '/^$/d'} C ${color #42AE4A}Core 2 Temp: ${color lightgrey}${execi 8 sensors | grep -A 1 'Core1' | cut -c13-16 | sed '/^$/d'} C<br />
</code></p>
<p>This outputs the following to Conky:</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/03/conky_dual_core.png" alt="Conky Dual Core CPU Output" /></p>
<p>Stripping out all the formatting, and colouring gives this:</p>
<p><code>Usage (Avg): ${freq_dyn_g}Ghz ${cpu cpu0}% ${alignr}${cpubar cpu0 5,80}<br />
Usage (Core 1): ${freq_dyn_g cpu1}Ghz ${cpu cpu1}% ${alignr}${cpubar cpu1 5,80}<br />
Usage (Core 2): ${freq_dyn_g cpu2}Ghz ${cpu cpu2}% ${alignr}${cpubar cpu2 5,80}<br />
Average<br />
${cpugraph cpu0 42AE4A eeeeee}<br />
Core 1 $alignr Core 2<br />
${cpugraph cpu1 25,120 42AE4A eeeeee}  $alignr${cpugraph cpu2 25,120 42AE4A eeeeee}<br />
Processes: $processes  Run: $running_processes CPU Temp: ${execi 1100  cat /proc/acpi/thermal_zone/THRM/temperature | grep -o "[0-9]* C"}<br />
Core 1 Temp: ${execi 8 sensors | grep -A 1 'Core0' | cut -c13-16 | sed '/^$/d'} C Core 2 Temp: ${execi 8 sensors | grep -A 1 'Core1' | cut -c13-16 | sed '/^$/d'} C<br />
</code></p>
<p>Now the walk through. The first line, <span style="font-size: 120%; font-family: monospace;">Usage (Avg): ${freq_dyn_g}Ghz ${cpu cpu0}% ${alignr}${cpubar cpu0 5,80}</span> gives the Average clock speed usage for both cores &#8211; <span style="font-size: 120%; font-family: monospace;">${freq_dyn_g}</span> with no parameters, will output the current clock speed usage for the CPU as a whole. Passing <span style="font-size: 120%; font-family: monospace;">cpu0</span> as a parameter to <span style="font-size: 120%; font-family: monospace;">${cpu}</span> will output the overall CPU % used, and similarly, passing <span style="font-size: 120%; font-family: monospace;">cpu0</span> to <span style="font-size: 120%; font-family: monospace;">${cpubar}</span> will draw the overall % used graph (the parameters <span style="font-size: 120%; font-family: monospace;">5,80</span> are just for the height and width.</p>
<p>Now, by passing <span style="font-size: 120%; font-family: monospace;">cpu1</span> or <span style="font-size: 120%; font-family: monospace;">cpu2</span> to <span style="font-size: 120%; font-family: monospace;">${freq_dny_g}</span>, <span style="font-size: 120%; font-family: monospace;">${cpu}</span> and <span style="font-size: 120%; font-family: monospace;">${cpubar}</span> Conky will output the same data but for each individual core. This can be extended by passing <span style="font-size: 120%; font-family: monospace;">cpu<em>N</em></span> where <em><span style="font-size: 120%; font-family: monospace;">N</span></em> is the core number, for quad core etc. this could be <span style="font-size: 120%; font-family: monospace;">cpu<em>3 </em></span><span style="font-size: 120%; font-family: monospace;">cpu<em>4</em></span>. So, the first three lines:</p>
<p><code>Usage (Avg): ${freq_dyn_g}Ghz ${cpu cpu0}% ${alignr}${cpubar cpu0 5,80}<br />
Usage (Core 1): ${freq_dyn_g cpu1}Ghz ${cpu cpu1}% ${alignr}${cpubar cpu1 5,80}<br />
Usage (Core 2): ${freq_dyn_g cpu2}Ghz ${cpu cpu2}% ${alignr}${cpubar cpu2 5,80}<br />
</code></p>
<p>Outputs:</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/03/conky_dual_core_usage.png" alt="Conky Dual Core CPU Usage" /></p>
<p>The next lines of the file deal with throughput/usage graphs, <span style="font-size: 120%; font-family: monospace;">${cpugraph cpu0 42AE4A eeeeee}</span> being the average for the CPU as a whole, since <span style="font-size: 120%; font-family: monospace;">cpu0</span> is passed as a parameter. <span style="font-size: 120%; font-family: monospace;">42AE4A</span> and <span style="font-size: 120%; font-family: monospace;">eeeeee</span> are just colour parameters to create a gradient overlay on the graph. As before, passing <span style="font-size: 120%; font-family: monospace;">cpu1</span> and <span style="font-size: 120%; font-family: monospace;">cpu2</span> will draw the graphs for the individual cores. The additional parameters, <span style="font-size: 120%; font-family: monospace;">25,120</span> are again just height and width parameters.</p>
<p>So, the lines</p>
<p><code>Average<br />
${cpugraph cpu0 42AE4A eeeeee}<br />
Core 1 $alignr Core 2<br />
${cpugraph cpu1 25,120 42AE4A eeeeee}  $alignr${cpugraph cpu2 25,120 42AE4A eeeeee}<br />
</code></p>
<p>Will output:</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/03/conky_dual_core_throuput.png" alt="Conky Dual Core CPU Throughput Graphs" /></p>
<p>Finally, I have a bunch of other data output, such as total processes, processes running, and CPU temperature. The first line outputs general information about the CPU as a whole:</p>
<p><code>Processes: $processes  Run: $running_processes CPU Temp: ${execi 1100  cat /proc/acpi/thermal_zone/THRM/temperature | grep -o "[0-9]* C"}<br />
</code></p>
<p><span style="font-size: 120%; font-family: monospace;">$processes</span> outputs the total number of processes, while <span style="font-size: 120%; font-family: monospace;">$running_processes</span> outputs the number of currently running processes on the CPU. To output the overall temperature, I had to call the <span style="font-size: 120%; font-family: monospace;">execi</span> function, and do some tweaking of the output to get the number, so <span style="font-size: 120%; font-family: monospace;">${execi 1100  cat /proc/acpi/thermal_zone/THRM/temperature | grep -o &#8220;[0-9]* C&#8221;}</span> basically outputs <span style="font-size: 120%; font-family: monospace;">/proc/acpi/thermal_zone/THRM/temperature</span>, pipes the output through <span style="font-size: 120%; font-family: monospace;">grep</span> which searches for the regular expression <span style="font-size: 120%; font-family: monospace;">&#8216;[0-9]* C&#8217;</span> (which matches a string of numbers followed by a space followed by an upper-case C), and thus outputs just the temperature value &#8211; e.g. &#8220;45 C&#8221;.</p>
<p>To output the temperature of each Core, I once again run the <span style="font-size: 120%; font-family: monospace;">execi</span> function on a couple of piped shell commands, and pipe the output through other shell commands to get the number I want:</p>
<p><code>Core 1 Temp: ${execi 8 sensors | grep -A 1 'Core0' | cut -c13-16 | sed '/^$/d'} C Core 2 Temp: ${execi 8 sensors | grep -A 1 'Core1' | cut -c13-16 | sed '/^$/d'} C<br />
</code></p>
<p>Basically what is happening here is I&#8217;m running the shell command <span style="font-size: 120%; font-family: monospace;">sensors</span>, piping to <span style="font-size: 120%; font-family: monospace;">grep</span> to search for the string &#8220;<span style="font-size: 120%; font-family: monospace;">Core0</span>&#8220;, piing this output to <span style="font-size: 120%; font-family: monospace;">cut</span> to trim it, and finally editing out some of the crap I don&#8217;t want by piping to <span style="font-size: 120%; font-family: monospace;">sed</span>. This is just repeated for <span style="font-size: 120%; font-family: monospace;">Core1</span>. You may need to customise the output from sensors, by greping, cutting and seding different stuff &#8211; experiment by opening a terminal, and running sensors, then just pipe it through the <span style="font-size: 120%; font-family: monospace;">grep</span>, <span style="font-size: 120%; font-family: monospace;">cut</span>, and <span style="font-size: 120%; font-family: monospace;">sed</span> commands until you get the data you want.</p>
<p>So, the final lines together:</p>
<p><code>Processes: $processes  Run: $running_processes CPU Temp: ${execi 1100  cat /proc/acpi/thermal_zone/THRM/temperature | grep -o "[0-9]* C"}<br />
Core 1 Temp: ${execi 8 sensors | grep -A 1 'Core0' | cut -c13-16 | sed '/^$/d'} C Core 2 Temp: ${execi 8 sensors | grep -A 1 'Core1' | cut -c13-16 | sed '/^$/d'} C<br />
</code></p>
<p>Output:</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/03/conky_dual_core_misc.png" alt="Conky Dual Core CPU Misc Info" /></p>
<p>Of course, this should work on any Linux distro with Conky installed.</p>
<p>Hope that helps someone.</p>
<div class="shr-publisher-50"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.64bitjungle.com/tech/conky-dual-core-processors-in-conkyrc/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Eclipse PDT and MySQL &#8211; SQL Explorer Plugin</title>
		<link>http://www.64bitjungle.com/tech/eclipse-pdt-and-mysql-sql-explorer-plugin/</link>
		<comments>http://www.64bitjungle.com/tech/eclipse-pdt-and-mysql-sql-explorer-plugin/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 05:41:10 +0000</pubDate>
		<dc:creator>Hodge</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PDT]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[SQL Explorer]]></category>

		<guid isPermaLink="false">http://www.64bitjungle.com/tech/eclipse-pdt-and-mysql-sql-explorer-plugin/</guid>
		<description><![CDATA[I&#8217;ve been using Eclipse PDT for some time now, and since PHP programming invariably involves connecting to a database at some point or another, I wanted to be able to access my MySQL databases from within the Eclipse IDE &#8211; even if only to quickly debug SQL statements. I generally use a combination of a [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://eclipsesql.sourceforge.net" target="_blank"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/03/sqlexplorer_logo.jpg" border="0" alt="Eclipse SQL Explorer Logo" align="left" /></a>I&#8217;ve been using Eclipse PDT for some time now, and since PHP programming invariably involves connecting to a database at some point or another, I wanted to be able to access my MySQL databases from within the Eclipse IDE &#8211; even if only to quickly debug SQL statements. I generally use a combination of a locally installed phpMyAdmin, MySQL Administrator, MySQL Query Browser, and now the <a href="http://eclipsesql.sourceforge.net/" target="_blank">Eclipse </a><a href="http://eclipsesql.sourceforge.net/" target="_blank">SQL Explorer Plugin</a>, which give me all the functionality I need for Web Application development.</p>
<p>phpMyAdmin, MySQL Administrator and MySQL Query Browser can be installed as follows, by the way:</p>
<p><code>sudo apt-get install phpmyadmin mysql-admin mysql-query-browser</code></p>
<p>Installing Eclipse SQL Explorer was pretty straight forward &#8211; I simply <a href="http://sourceforge.net/project/showfiles.php?group_id=132863" target="_blank">downloaded</a> the archive package from Sourceforge, saved it to a directory in on my desktop (there is also a <a href="http://sourceforge.net/project/showfiles.php?group_id=132863">standalone</a> client available, so be sure to download &#8220;Eclipse SQL Explorer [RCP/Plugin]&#8221; if you&#8217;re setting it up as an Eclipse plugin &#8211; here&#8217;s a <a href="http://nchc.dl.sourceforge.net/sourceforge/eclipsesql/sqlexplorer_plugin-3.5.0.RC5.zip">direct link to the latest plugin file</a>), and extracted the files:</p>
<p><code>cd ~/Desktop/sqlexplorer<br />
unzip sqlexplorer_plugin-3.5.0.RC5.zip<br />
</code></p>
<p>This created two directories (features and plugins) along with two text files. To install the plugin, I just copied the two directories to my Eclipse root installation directory (see my previous post &#8220;<a href="http://www.64bitjungle.com/tech/eclipse-32-bit-pdt-install-on-64-bit-ubuntu/">Eclipse PDT IDE for PHP MySQL 32 Bit install on 64 Bit Ubuntu</a>&#8220;), which is <span style="font-size: 120%; font-family: monospace;">/opt/eclipse32</span></p>
<p><code>cp -R features plugins /opt/eclipse32/</code></p>
<p>Notice there was no need to use the <span style="font-size: 120%; font-family: monospace;">sudo</span> command before copying, since my user owns the eclipse32 folder.</p>
<p><strong>Configuring SQL Explorer</strong><a name="configsqlexplorer"></a></p>
<p>Once installed, I also had to do some additional setup before I could configure SQL Explorer to connect to my local MySQL databases via Eclipse &#8211; namely, download and install the Java Connector for MySQL (<a href="http://dev.mysql.com/downloads/connector/j/5.1.html" target="_blank">MySQL JDBC Driver</a>), to enable JDBC connections. The latest driver (5.1 at the time of writing) tar.gz file can be downloaded from the MySQL site <a href="http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.6.tar.gz/from/pick#mirrors" target="_blank">here</a>.</p>
<p>Once downloaded, I just extracted the files, and entered the new directory:</p>
<p><code>cd ~/Desktop/mysqljdbc<br />
tar -zxvf mysql-connector-java-5.1.6.tar.gz<br />
cd mysql-connector-java-5.1.6</code></p>
<p>The important file here (along with the documentation, of course) is the <span style="font-size: 120%; font-family: monospace;">mysql-connector-java-5.1.6-bin.jar</span> file, which is the driver itself. I guess this could be placed anywhere, since we just need to point the SQL Explorer plugin to it when setting it up in Eclipse, but for convenience and tidiness, I moved it to the <span style="font-size: 120%; font-family: monospace;">/usr/share/mysql</span> directory:</p>
<p><code>sudo cp mysql-connector-java-5.1.6-bin.jar /usr/share/mysql</code></p>
<p>With the JDBC driver installed, I could set up the Eclipse SQL Explorer plugin. In Eclipse, I went to Window-&gt;Preferences and expanded the new SQL Explorer section, highlighting &#8220;JDBC Drivers&#8221;, then double clicking on &#8220;MySQL Driver&#8221; to open the MySQL setup dialog:</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/03/sqlexplorersetup1.png" alt="Eclipse SQL Explorer Setup" /></p>
<p>In the MySQL Driver setup, I had to point the plugin to the MySQL JDBC Driver, by clicking on the &#8220;Extra Class Path&#8221; tab, and then clicking &#8220;Add&#8221; to point it to <span style="font-size: 120%; font-family: monospace;">/usr/share/mysql/mysql-connector-java-5.1.6-bin.jar</span>. Once added, clicking on &#8220;List Drivers&#8221; will bring up the list of available drivers in the &#8220;Driver Class Name&#8221; pull down menu. Only one is listed, and it just so happens to be the one we need &#8211; <span style="font-size: 120%; font-family: monospace;">com.mysql.jdbc.Driver</span>:</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/03/sqlexplorersetup2.png" alt="Eclipse SQL Explorer Setup" /></p>
<p>Click OK, and the driver is set up! I also clicked the &#8220;Set Default&#8221; button, since MySQL is currently the only database I connect to. With the Driver set up, I could then set up a connection to my database system. If the &#8220;Connections&#8221; view is not already available, it has to be selected via the Window-&gt;Show View-&gt;Other menu, and clicking on the &#8220;Connections&#8221; view within the &#8220;SQL Explorer&#8221; folder in this dialog.</p>
<p>With the Connections View available, I could set up the new connection profile, by right clicking in the  view and selecting &#8220;New Connection Profile&#8221;, which opens up a new dialog, in which the new connection data is input:</p>
<p style="text-align: center"><img src="http://www.64bitjungle.com/wp-content/uploads/2008/03/sqlexplorersetup4.png" alt="Eclipse SQL Explorer Setup" /></p>
<p>It was a pretty simple process to create the connection &#8211; I just needed to replace the relevant parameters in the JDBC connections string with my connection details, so</p>
<p><code>jdbc:mysql://&lt;hostname&gt;[&lt;:3306:&gt;]/&lt;dbname&gt;</code></p>
<p>became</p>
<p><code>jdbc:mysql://localhost:3306/mydatabase</code></p>
<p>Entered the DB username and password, gave the connection a name, selected the newly created MySQL Driver, and clicked OK to save the connection. Double clicking the connection name in the Connections View connects to the DB and brings up an SQL window form which Queries may be run. By default, the results are displayed in a small view at the bottom of the main Eclipse IDE window &#8211; although, this can be dragged and placed anywhere. There are also several other views available via the Window-&gt;Show View-&gt;Other menu within the SQL Explorer section to peruse.</p>
<p>The Eclipse <a href="http://eclipsesql.sourceforge.net/" target="_blank">SQL Explorer homepage</a> has extensive documentation available, including a cool section on <a href="http://eclipsesql.sourceforge.net/extending.php" target="_blank">extending</a> the plugin. Maybe I should learn Java too?</p>
<p>That&#8217;s all Folks.</p>
<div class="shr-publisher-42"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.64bitjungle.com/tech/eclipse-pdt-and-mysql-sql-explorer-plugin/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>

