<?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>Code Monkey Java</title>
	<atom:link href="http://www.codemonkeyjava.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codemonkeyjava.com</link>
	<description>Bloggings of a Code Monkey</description>
	<lastBuildDate>Tue, 24 Jan 2012 18:39:51 +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>Getting Better Battery Life on the Samsung Princeton in Ubuntu 11.10</title>
		<link>http://www.codemonkeyjava.com/2012/01/24/getting-better-battery-life-on-the-samsung-princeton-in-ubuntu-11-10/</link>
		<comments>http://www.codemonkeyjava.com/2012/01/24/getting-better-battery-life-on-the-samsung-princeton-in-ubuntu-11-10/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 18:39:51 +0000</pubDate>
		<dc:creator>Haines Chuck</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[samsung]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.codemonkeyjava.com/?p=87</guid>
		<description><![CDATA[Battery life under Linux has always been worse that Windows in every machine I have ever owned.  So I set out to find out what I could do on my new Samsung Princeton to stretch the battery as far as possible while still leaving me a machine I could use for programming.  This blog is part one or a two part blog series on what I found and the optimizations I made.  My laptop now gets over 8 hours of battery life which is significantly better than the 4-5 hours I was previously getting.]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I purchased a Samsung Princeton from Staples when they were having their fire-sale for $350.  At $350, it seemed like a steal.  I wasn&#8217;t super happy with the device when I first got it, but now that I&#8217;ve had some time to do some minor upgrades and tweaking, I am extremely happy with this device.</p>
<p>The first thing I did when I got the device was install Ubuntu 11.10 (Oneric Oncelot).  I&#8217;m a big Linux fan and now that I&#8217;m doing web development using an open source stack I&#8217;m free to use Linux on my machines instead of Windows.  The only downfall to Linux is the battery life.  On both my main laptop (a Samsung Chronos 7) and the Princeton battery life half what I can get in Windows.  I was determined to keep Linux on this device so I set out to get the maximum battery life on this device.</p>
<p>The following information is based purely on what I have found to work best for my machine.  I can&#8217;t guarantee this work for you or your machine but hopefully it can at least guide you in the right direction.  I have made some minor hardware upgrades to the laptop since I purchased it.  This included an extended battery I found on eBay, an Intel 320 series SSD and 8GB of RAM.  While the SSD and extended battery will give me better battery life, the tweaks I made are still generic enough that they should improve battery life on any machine.</p>
<p>I had read that the 3.2 kernel series had some nice power improvements, especially for Intel devices.  There are some PCIe ASPM (power management for PCI Express devices) issues in the mainline 3.2 kernel, but ubuntu has applied the fixes from the 3.3 kernel in their 3.2 kernel tree that will be included with Ubuntu 12.04.  PCIe ASPM is a huge battery saver so it was definitely something I knew I needed to have working properly.  There is a lot of documentation out there on the various issues and I highly recommend reading <a title="Linux PCIe ASPM" href="http://www.phoronix.com/scan.php?page=article&amp;item=linux_2638_aspm&amp;num=2" target="_blank">this article from Phoronix</a>.  This article is based on the 2.6 kernel series but the issue haven&#8217;t changed much since then.  A Google search will bring up plenty more reading.</p>
<p>After cloning the Precise kernel from git://kernel.ubuntu.com/ubuntu/ubuntu-precise.git I compiled a custom kernel tailored for the Samsung Princeton. Ubuntu kernels are good out of the box, however they include a ton of stuff I either don&#8217;t use, or is not needed for my machine.  I could spend an entire blog post on the decisions I made and why I made them, but for now I will just link to the config file I use.  I&#8217;m a make menuconfig kind of guy (which goes against the recommended way to compile an Ubuntu kernel) so you may have to change the config if you want to use the &#8220;Ubuntu way.&#8221;</p>
<p>Once the new kernel was up and running successfully, I turned my attention towards kernel command line arguments that are designed for better battery life.  After much research and reading I decided to use the four arguments I had found.  I changed the GRUB_CMDLINE_LINUX_DEFAULTS line in /etc/default/grub to the following:</p>
<pre>GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1"</pre>
<p>The first parameter is pretty straightforward, pcie_aspm=force.  What this does is to force the PCIe ASPM even if the BIOS tells the system it&#8217;s not supported.  This allows Linux to use the full power saving features of the PCIe devices in the laptop.  I have no idea if the Princeton suffers from this bug but I did notice a difference in battery when I applied that argument to the kernel.</p>
<p>The next kernel parameter i915.i915_enable_rc6=1 has some arguments around it&#8217;s use.  The parameter allows the GPU to enter a low power state when the GPU is idling.  That sounds great, but the caveat is it can also cause the GPU to use more power when running, albeit it at better performance.  It appears that it only uses more power when doing OpenGL or 3D things (at least from the information I could find), which I never do, however there seems to not be a lot of consensus on the matter.  I did notice a significant drop in power according to powertop with this parameter so I decided to keep it for now.  RC6 is not enabled by default because on some systems it can cause the GPU to hang.  In my limited testing I have not had any GPU hangs on the Princeton, so it does not appear that this laptop suffers from that bug.</p>
<p>The kernel option i915.i915_enable_fbc enables the frame-buffer compression (FBC) for the i915 graphics driver.  FBC, as you might guess, will compress the buffer that is being rendered on the screen.  This means less memory has to be used to for screen refreshes, which will lead to less power consumption.  This parameter is not enabled by default because on some systems the screen does not repaint properly when using a window manager that uses compositing (such as compiz).  However as with the i915_enable_rc6 parameter, this does not seem to be the case for the Princeton in my testing.</p>
<p>Finally, I added the i915.lvds_downclock=1 parameter.  This will enable the LVDS refresh rate to run at a slower clock speed.  Under-clocking usually has a positive impact on power consumption and definitely helps in this case.  This parameter is not enabled by default because on systems that do not support the down-clocking the screen can flicker while you are using the machine.  I have noticed zero flickers so far on the Princeton.</p>
<p>If you are interested in reading more about the kernel parameters, including benchmarks, I recommend <a href="http://www.phoronix.com/scan.php?page=article&amp;item=intel_i915_power&amp;num=1" target="_blank">reading this article on Phoronix.</a>  It does a great job of explaining the parameters in more detail and provides an exhaustive list of benchmarks for all the parameters.</p>
<p>The final piece to the puzzle of better battery life is optimizing the system for power consumption while disconnected from the wall.  I will be posting another blog soon on what I did under Ubuntu 11.10.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemonkeyjava.com/2012/01/24/getting-better-battery-life-on-the-samsung-princeton-in-ubuntu-11-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the Samsung Chronos 7 Touchpad Working in Ubuntu 11.10</title>
		<link>http://www.codemonkeyjava.com/2012/01/14/getting-the-samsung-chronos-7-touchpad-working-in-ubuntu-11-10/</link>
		<comments>http://www.codemonkeyjava.com/2012/01/14/getting-the-samsung-chronos-7-touchpad-working-in-ubuntu-11-10/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 03:10:46 +0000</pubDate>
		<dc:creator>Haines Chuck</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[samsung]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.codemonkeyjava.com/?p=90</guid>
		<description><![CDATA[Ubuntu 11.10 has been installed on my Samsung Chronos 7 since the day I bought it.  After finally figuring out how to get the hybrid graphics to behave, I turned my attention towards getting the touchpad to work correctly.  Under the stock kernel the touchpad, which is reported as an Elantech v4, does not show [...]]]></description>
			<content:encoded><![CDATA[<p>Ubuntu 11.10 has been installed on my Samsung Chronos 7 since the day I bought it.  After finally figuring out how to get the hybrid graphics to behave, I turned my attention towards getting the touchpad to work correctly.  Under the stock kernel the touchpad, which is reported as an Elantech v4, does not show in Gnome3 as a touchpad and is fairly unusable.  There is no multi-finger support and I would constantly hit the mouse while I was typing.  I would basically disable the internal mouse any time I was in Linux and just use an external mouse.  This is fine when I am at my desk, but doesn&#8217;t work so well when I&#8217;m sitting downstairs on the couch in my living room.</p>
<p>I decided to try the 3.2 kernel one day on the laptop, mostly due to better power management, especially for the Intel drivers.  After I compiled a 3.2 kernel for Ubuntu, I noticed my touchpad was (mostly) working perfectly.  Everything worked except two-finger right-click (two-finger right tap works though) and the mouse was not nearly sensitive enough.  Tweaking the sensitivity settings under Gnome3 had no effect on the mouse.  I ended up tweaking the FingerLow and FingerHigh using synclient to meet my sensitivity needs, but I&#8217;ll detail that a bit later.</p>
<p>I would have stayed on the 3.2 kernel, however my hybrids graphics seemed a little quirky and I was not getting near the battery life I was getting under the 3.0 kernel that came with Ubuntu 11.10.  So I decided to switch back to the 3.0 kernel, however I wanted my touchpad working like it was in 3.2. So I took the changes from the 3.2 kernel and back ported them to 3.0.  The following instructions will show you how to set up your build environment, get the kernel sources, patch the kernel, compile and install the new kernel.</p>
<p>If you have never built an Ubuntu kernel before you will need to execute the following, which will install the packages you need to compile a kernel for Ubuntu.</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Install build tools</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge
<span class="kw2">sudo</span> <span class="kw2">apt-get</span> build-dep linux
<span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev</pre></div></div>
<p>Next, you will need to grab the kernel sources for Ubuntu 11.10 and make the necessary control files.</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Get kernel source</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">git clone git:<span class="sy0">//</span>kernel.ubuntu.com<span class="sy0">/</span>ubuntu<span class="sy0">/</span>ubuntu-oneiric.git
<span class="kw3">cd</span> ubuntu-oneiric
fakeroot debian<span class="sy0">/</span>rules clean</pre></div></div>
<p>Once you have the source and made the control files, it&#8217;s time to patch the kernel for touchpad.  Download the patch from <a href="http://dl.dropbox.com/u/20007106/Blog/patch-elantech.patch">here</a> and take a note of the path where you saved it.  Then patch the kernel via the following command</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Apply patch for mouse</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">patch</span> <span class="re5">-p1</span> <span class="sy0">&lt;</span> ..<span class="sy0">/</span>dir<span class="sy0">/</span>to<span class="sy0">/</span>patch<span class="sy0">/</span>file.patch</pre></div></div>
<p>If everything worked correctly you should see the patch applied successfully.  If not, you may need to apply some parts of the patch manually.  After you have applied the patches it&#8217;s time to configure you kernel.  If you wish to have a starting point, download my kernel config from <a href="http://dl.dropbox.com/u/20007106/Blog/config-3.0.0-14">here</a> and put it in the kernel directory and name it .config.  This config is tuned for the Chronos 7, though I still have a little more tuning to accomplish.</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Configure kernel</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">make</span> menuconfig</pre></div></div>
<p>Once you are happy with the kernel, compile your kernel with the following command (replacing the 3.0.14.1 revision number with whatever revision you want).</p>
<div id="wpshdo_5" class="wp-synhighlighter-outer"><div id="wpshdt_5" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_5"></a><a id="wpshat_5" class="wp-synhighlighter-title" href="#codesyntax_5"  onClick="javascript:wpsh_toggleBlock(5)" title="Click to show/hide code block">Compile kernel</a></td><td align="right"><a href="#codesyntax_5" onClick="javascript:wpsh_code(5)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_5" onClick="javascript:wpsh_print(5)" title="Print code"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_5" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">fakeroot make-kpkg <span class="re5">--initrd</span> <span class="re5">--revision</span>=3.0.14.1 kernel_image</pre></div></div>
<p>The above command will place a .deb file one level up from the kernel source.  Install the kernel with the following command</p>
<div id="wpshdo_6" class="wp-synhighlighter-outer"><div id="wpshdt_6" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_6"></a><a id="wpshat_6" class="wp-synhighlighter-title" href="#codesyntax_6"  onClick="javascript:wpsh_toggleBlock(6)" title="Click to show/hide code block">Install kernel</a></td><td align="right"><a href="#codesyntax_6" onClick="javascript:wpsh_code(6)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_6" onClick="javascript:wpsh_print(6)" title="Print code"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_6" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw3">cd</span> ..<span class="sy0">/</span>
<span class="kw2">sudo</span> <span class="kw2">dpkg</span> <span class="re5">-i</span> NAME_OF_DEB.deb</pre></div></div>
<p>You may get a warning message about replacing the current kernel.  If you do, just say yes and let it replace it.  It won&#8217;t affect anything and is necessary to get the new kernel installed.  Once this is complete, reboot and enjoy your working touchpad.  If you are happy with the sensitivity of the mouse you are done.  If not, read on for how to make it more sensitive.</p>
<p>Personally I like a pretty sensitive mouse.  By default the mouse sensitivity on the Elantech with the patch above was awful.  I had to place almost my entire finger on the touchpad to get it to scroll and trying to adjust the settings in Gnome3 had no effect.  So I used the synclient tool to adjust the sensitivity and created a shell script to apply the settings on each reboot and wake from sleep.</p>
<p>First create a file called elantech_synclient.sh in ~/.local/bin and put the following in the file</p>
<div id="wpshdo_7" class="wp-synhighlighter-outer"><div id="wpshdt_7" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_7"></a><a id="wpshat_7" class="wp-synhighlighter-title" href="#codesyntax_7"  onClick="javascript:wpsh_toggleBlock(7)" title="Click to show/hide code block">elantech_synclient.sh</a></td><td align="right"><a href="#codesyntax_7" onClick="javascript:wpsh_code(7)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_7" onClick="javascript:wpsh_print(7)" title="Print code"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_7" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="co0">#!/bin/sh</span>
&nbsp;
synclient <span class="re2">FingerLow</span>=10
synclient <span class="re2">FingerHigh</span>=<span class="nu0">20</span></pre></div></div>
<p>The final step is to make gnome run this file one reboot and wakeup.  Run the following command replace codemonkeyjava with your username for login.</p>
<div id="wpshdo_8" class="wp-synhighlighter-outer"><div id="wpshdt_8" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_8"></a><a id="wpshat_8" class="wp-synhighlighter-title" href="#codesyntax_8"  onClick="javascript:wpsh_toggleBlock(8)" title="Click to show/hide code block">Make Gnome run script</a></td><td align="right"><a href="#codesyntax_8" onClick="javascript:wpsh_code(8)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_8" onClick="javascript:wpsh_print(8)" title="Print code"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_8" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">gsettings <span class="kw1">set</span> org.gnome.settings-daemon.peripherals.input-devices hotplug-command <span class="st0">&quot;/home/termleech/.local/bin/elantech_synclient.sh&quot;</span></pre></div></div>
<p>Congratulations, you now have a fully working touchpad on your Chronos 7 in Ubuntu 11.10.</p>
<p>If you liked this post or if helped you in any way, consider <a href="http://www.codemonkeyjava.com/caffeinate-me/">buying me a cup of coffee.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemonkeyjava.com/2012/01/14/getting-the-samsung-chronos-7-touchpad-working-in-ubuntu-11-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intel 320 Series SSD Installation in a Samsung Princeton Ultrabook</title>
		<link>http://www.codemonkeyjava.com/2012/01/11/intel-320-series-ssd-installation-on-a-samsung-princeton-ultrabook/</link>
		<comments>http://www.codemonkeyjava.com/2012/01/11/intel-320-series-ssd-installation-on-a-samsung-princeton-ultrabook/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 15:40:38 +0000</pubDate>
		<dc:creator>Haines Chuck</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[samsung]]></category>
		<category><![CDATA[ssd]]></category>

		<guid isPermaLink="false">http://www.codemonkeyjava.com/?p=66</guid>
		<description><![CDATA[I recently purchased an Intel 320 series 120GB SSD hard drive for my Samsung Princeton ultrabook.  The drive was intended to replace my Corsair Force3 SSD that I could never get to work with the laptop.  The Force3 was too large for the laptop and always caused issues with the wireless as soon as the drive was [...]]]></description>
			<content:encoded><![CDATA[<p>I recently purchased an Intel 320 series 120GB SSD hard drive for my Samsung Princeton ultrabook.  The drive was intended to replace my Corsair Force3 SSD that I could never get to work with the laptop.  The Force3 was too large for the laptop and always caused issues with the wireless as soon as the drive was installed.  I tried multiple things to get it to work including taking it apart to make it smaller and making custom carriers for the SSD.  It didn&#8217;t seem to matter what I did, the second I installed the Force3 I would immediately get wireless issue.  It would take ages for my laptop to connect to my router, if it ever did, and when it did finally connect it would generally connect at between 1Mb/s and 6Mb/s.  Performance was awful and disconnects were frequently occurring.  I finally decided to return it to Best Buy and decided on the Intel 320 since they had them in stock.</p>
<p>The packaging for the Intel drive was incredibly impressive.  In addition to the drive and the mounting hardware, the packaging included a USB3-SATA cable and a rubber enclosure for your old hard drive, an adapter for a 3.5&#8243; drive bay, a screw driver, an internal SATA cable and power adapter and cloning software.  The USB3-SATA cable, and rubber enclosure for your old drive, is easily a $40 addition to the packaging and really show Intel commitment to the customer.  The price of the drive was $219, which is a little more than my Force3, but the easy of installation and extras more than made up for the additional cost.  I did not try the cloning software as I was running Linux and assumed it didn&#8217;t work, so I can comment on how good the software actually is.</p>
<p>The first step of installation is removing the bottom plate from the Princeton.  I had previously done this for the Force3 so there were no surprises here.  I took out the battery first, followed by the protector for the SD slot.  Next came the memory cover, which only has a single screw to hold it in place, followed by the actual memory of the system.  Once the components had been removed, all that remains is eight screws holding the bottom plate on.  I did say 8, even though you will only see 6.  There is a screw hidden under each of the rubber footings.  Carefully remove the rubber footings (I used a plastic flat head screw driver).  They seem to retain their stickiness even after a few removals which is a relief since I had this laptop apart quite a few times when I was trying to get the Force3 to work.</p>
<p>The bottom plate is held on by the infamous Samsung plastic hooks (they have the same thing on my Chronos 7 and my Galaxy Nexus and they are giant pain).  After carefully prying off the bottom you have access to everything you need.  The first time I took apart the laptop I was shocked to see that the hard  drive is not actually mounted via any screws.  It just sits there in a rubber enclosure.  The Intel SSD comes with a black rubber railing on the top, so the first time I tried to install it, I just took out the old hard drive and put in the Intel drive.  After I snapped the computer back together, I noticed a slight buldge on the palmrest right above the drive.  So I took the black railing off the Intel drive.  However upon doing that I noticed the screws now stuck out on the drive and there were no screws that were shorter to use.  So I put the Intel drive in the rubber wrapping that the original drive had and did not use any screws.  It kept the drive together pretty good.  I put the drive back in and there was no longer a buldge on the laptop.</p>
<p>After putting the laptop back together and booting to an Ubuntu USB drive, everything works perfect.  I have installed Ubuntu 11.10 on the laptop and it&#8217;s running spectacularly.  I patched the stock Ubuntu kernel with a new scheduler, called FIOPS, which was designed by an Intel engineer specifically for SSD drives.  It&#8217;s based on the CFQ kernel scheduler but removes all the code that deals with platter drives and optimizes it for and SSD.  I got the patches from a friend who does Android development and will post more about them in a bit.</p>
<p>The speed of this  drive is amazing.  Even on a Core i3 machine with only 4GB of RAM, this machine flies.  A cold boot takes about 2-3 seconds, which is incredibly.  I&#8217;m getting about 200MB/s for transfer speeds in my benchmarks.  Overall the Intel 320 series drive is a great upgrade for anyone.  I would highly recommend the drive, despite seeing a lot of bad reviews out there.  Installation was flawless and I have had zero issues with the drive.</p>

<a href='http://www.codemonkeyjava.com/2012/01/11/intel-320-series-ssd-installation-on-a-samsung-princeton-ultrabook/img_20120103_143155/' title='Memory slot and rubber foot removed'><img width="150" height="150" src="http://www.codemonkeyjava.com/wp-content/uploads/2012/01/IMG_20120103_143155-150x150.jpg" class="attachment-thumbnail" alt="Memory slot and rubber foot removed" title="Memory slot and rubber foot removed" /></a>
<a href='http://www.codemonkeyjava.com/2012/01/11/intel-320-series-ssd-installation-on-a-samsung-princeton-ultrabook/img_20120103_143120/' title='Bottom case removed'><img width="150" height="150" src="http://www.codemonkeyjava.com/wp-content/uploads/2012/01/IMG_20120103_143120-150x150.jpg" class="attachment-thumbnail" alt="Bottom case removed" title="Bottom case removed" /></a>
<a href='http://www.codemonkeyjava.com/2012/01/11/intel-320-series-ssd-installation-on-a-samsung-princeton-ultrabook/img_20120103_143128/' title='Rubber casing for original hard drive'><img width="150" height="150" src="http://www.codemonkeyjava.com/wp-content/uploads/2012/01/IMG_20120103_143128-150x150.jpg" class="attachment-thumbnail" alt="Rubber casing for original hard drive" title="Rubber casing for original hard drive" /></a>
<a href='http://www.codemonkeyjava.com/2012/01/11/intel-320-series-ssd-installation-on-a-samsung-princeton-ultrabook/img_20120109_202122/' title='USB3-SATA cable'><img width="150" height="150" src="http://www.codemonkeyjava.com/wp-content/uploads/2012/01/IMG_20120109_202122-150x150.jpg" class="attachment-thumbnail" alt="USB3-SATA cable" title="USB3-SATA cable" /></a>
<a href='http://www.codemonkeyjava.com/2012/01/11/intel-320-series-ssd-installation-on-a-samsung-princeton-ultrabook/img_20120109_202132/' title='Rubber external enclosure'><img width="150" height="150" src="http://www.codemonkeyjava.com/wp-content/uploads/2012/01/IMG_20120109_202132-150x150.jpg" class="attachment-thumbnail" alt="Rubber external enclosure" title="Rubber external enclosure" /></a>
<a href='http://www.codemonkeyjava.com/2012/01/11/intel-320-series-ssd-installation-on-a-samsung-princeton-ultrabook/img_20120109_211456/' title='Spare drive in external enclosure'><img width="150" height="150" src="http://www.codemonkeyjava.com/wp-content/uploads/2012/01/IMG_20120109_211456-150x150.jpg" class="attachment-thumbnail" alt="Spare drive in external enclosure" title="Spare drive in external enclosure" /></a>
<a href='http://www.codemonkeyjava.com/2012/01/11/intel-320-series-ssd-installation-on-a-samsung-princeton-ultrabook/img_20120109_202029/' title='Intel SSD and laptop'><img width="150" height="150" src="http://www.codemonkeyjava.com/wp-content/uploads/2012/01/IMG_20120109_202029-150x150.jpg" class="attachment-thumbnail" alt="Intel SSD and laptop" title="Intel SSD and laptop" /></a>
<a href='http://www.codemonkeyjava.com/2012/01/11/intel-320-series-ssd-installation-on-a-samsung-princeton-ultrabook/img_20120109_202335/' title='SSD installed with original black railing'><img width="150" height="150" src="http://www.codemonkeyjava.com/wp-content/uploads/2012/01/IMG_20120109_202335-150x150.jpg" class="attachment-thumbnail" alt="SSD installed with original black railing" title="SSD installed with original black railing" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.codemonkeyjava.com/2012/01/11/intel-320-series-ssd-installation-on-a-samsung-princeton-ultrabook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>APN List for Galaxy Nexus for AT&amp;T</title>
		<link>http://www.codemonkeyjava.com/2011/12/08/apn-list-for-galaxy-nexus-for-att/</link>
		<comments>http://www.codemonkeyjava.com/2011/12/08/apn-list-for-galaxy-nexus-for-att/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 15:08:02 +0000</pubDate>
		<dc:creator>Haines Chuck</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[galaxy nexus]]></category>

		<guid isPermaLink="false">http://www.codemonkeyjava.com/?p=59</guid>
		<description><![CDATA[I always have a hard time finding the APN list I should be using for any AT&#038;T “4g” phone, so I thought I would post them here for easier reference.  These came from the XDA forums and I take not responsibility for them.  I’m just sharing them for all.  I believe you need all 4 of them and you should set the AT&#038;T US HSDPA to the default one in your APN manager.]]></description>
			<content:encoded><![CDATA[<p>I always have a hard time finding the APN list I should be using for any AT&amp;T &#8220;4g&#8221; phone, so I thought I would post them here for easier reference.  These came from the XDA forums and I take not responsibility for them.  I&#8217;m just sharing them for all.  I believe you need all 4 of them and you should set the AT&amp;T US HSDPA to the default one in your APN manager.</p>
<p><strong>Name:</strong> AT&amp;T US<br />
<strong>APN:</strong> wap.cingular<br />
<strong>Proxy:</strong> wireless.cingular.com<br />
<strong>Port:</strong> 80<br />
<strong>Username:</strong> &lt;not set&gt;<br />
<strong>Password:</strong> &lt;not set&gt;<br />
<strong>Server:</strong> &lt;not set&gt;<br />
<strong>MMSC:</strong> &lt;not set&gt;<br />
<strong>MMS Proxy:</strong> &lt;not set&gt;<br />
<strong>MMS Port:</strong> &lt;not set&gt;<br />
<strong>MCC:</strong> 310<br />
<strong>MNC:</strong> 410<br />
<strong>Authentication type:</strong> &lt;not set&gt;<br />
<strong>APN type:</strong> default,supl,agps,fota,dun</p>
<p><strong>Name:</strong> AT&amp;T US HSDPA<br />
<strong>APN:</strong> phone<br />
<strong>Proxy:</strong> &lt;not set&gt;<br />
<strong>Port:</strong> &lt;not set&gt;<br />
<strong>Username:</strong> &lt;not set&gt;<br />
<strong>Password:</strong> &lt;not set&gt;<br />
<strong>Server:</strong> &lt;not set&gt;<br />
<strong>MMSC:</strong> &lt;not set&gt;<br />
<strong>MMS Proxy:</strong> &lt;not set&gt;<br />
<strong>MMS Port:</strong> &lt;not set&gt;<br />
<strong>MCC:</strong> 310<br />
<strong>MNC:</strong> 410<br />
<strong>Authentication type:</strong> &lt;not set&gt;<br />
<strong>APN type:</strong> default,supl,agps,fota,dun</p>
<p><strong>Name:</strong> AT&amp;T US Tether<br />
<strong>APN:</strong> broadband<br />
<strong>Proxy:</strong> wireless.cingular.com<br />
<strong>Port:</strong> 80<br />
<strong>Username:</strong> &lt;not set&gt;<br />
<strong>Password:</strong> &lt;not set&gt;<br />
<strong>Server:</strong> &lt;not set&gt;<br />
<strong>MMSC:</strong> &lt;not set&gt;<br />
<strong>MMS Proxy:</strong> &lt;not set&gt;<br />
<strong>MMS Port:</strong> &lt;not set&gt;<br />
<strong>MCC:</strong> 310<br />
<strong>MNC:</strong> 410<br />
<strong>Authentication type:</strong> &lt;not set&gt;<br />
<strong>APN type:</strong> tether</p>
<p><strong>Name:</strong> AT&amp;T US MMS<br />
<strong>APN:</strong> wap.cingular<br />
<strong>Proxy:</strong> wireless.cingular.com<br />
<strong>Port:</strong> 80<br />
<strong>Username:</strong> &lt;not set&gt;<br />
<strong>Password:</strong> &lt;not set&gt;<br />
<strong>Server:</strong> &lt;not set&gt;<br />
<strong>MMSC:</strong> <a href="http://mmsc.cingular.com/" rel="nofollow" target="_blank">http://mmsc.cingular.com</a><br />
<strong>MMS Proxy:</strong> wireless.cingular.com<br />
<strong>MMS Port:</strong> 80<br />
<strong>MCC:</strong> 310<br />
<strong>MNC:</strong> 410<br />
<strong>Authentication type:</strong> &lt;not set&gt;<br />
<strong>APN type:</strong> mms</p>
<p>Hopefully this will help anyone like me who is always searching for these after flashing a new ROM.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemonkeyjava.com/2011/12/08/apn-list-for-galaxy-nexus-for-att/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix for Transparent PNG files for Symfony sfThumbnailPlugin</title>
		<link>http://www.codemonkeyjava.com/2011/11/23/fix-for-transparent-png-files-for-symfony-sfthumbnailplugin/</link>
		<comments>http://www.codemonkeyjava.com/2011/11/23/fix-for-transparent-png-files-for-symfony-sfthumbnailplugin/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 18:57:26 +0000</pubDate>
		<dc:creator>Haines Chuck</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.codemonkeyjava.com/?p=35</guid>
		<description><![CDATA[One of the project I work on uses Symfony 1.4.  I had a client contact me today saying that when they uploaded transparent png files, the resized files were no longer transparent, instead had a black background.  I thought this was strange and knew it had to be something with resizing of the images using [...]]]></description>
			<content:encoded><![CDATA[<p>One of the project I work on uses Symfony 1.4.  I had a client contact me today saying that when they uploaded transparent png files, the resized files were no longer transparent, instead had a black background.  I thought this was strange and knew it had to be something with resizing of the images using sfThumbnail.  The original images were fine, it was only the resized images that no longer had their transparency.</p>
<p>After doing some google searching I came across a number of people with the same issue.  I eventually was led to this post, <a href="http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/">http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/</a> which describes how to do a resize while maintaining transparency.  The original sfThumbnail plugin has the following code in the sfGDAdaptor.class.php file (some lines have been removed for brevity):</p>
<div id="wpshdo_9" class="wp-synhighlighter-outer"><div id="wpshdt_9" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_9"></a><a id="wpshat_9" class="wp-synhighlighter-title" href="#codesyntax_9"  onClick="javascript:wpsh_toggleBlock(9)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_9" onClick="javascript:wpsh_code(9)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_9" onClick="javascript:wpsh_print(9)" title="Print code"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_9" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="kw2">public</span> <span class="kw2">function</span> loadFile<span class="br0">&#40;</span><span class="re0">$thumbnail</span><span class="sy0">,</span> <span class="re0">$image</span><span class="br0">&#41;</span>
<span class="br0">&#123;</span>
  <span class="coMULTI">/* ... removed for brevity ... */</span>
  <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">source</span> <span class="sy0">=</span> <span class="re0">$loader</span><span class="br0">&#40;</span><span class="re0">$image</span><span class="br0">&#41;</span><span class="sy0">;</span>
  <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">sourceWidth</span> <span class="sy0">=</span> <span class="re0">$imgData</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="sy0">;</span>
  <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">sourceHeight</span> <span class="sy0">=</span> <span class="re0">$imgData</span><span class="br0">&#91;</span>1<span class="br0">&#93;</span><span class="sy0">;</span>
  <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">sourceMime</span> <span class="sy0">=</span> <span class="re0">$imgData</span><span class="br0">&#91;</span><span class="st_h">'mime'</span><span class="br0">&#93;</span><span class="sy0">;</span>
  <span class="re0">$thumbnail</span><span class="sy0">-&gt;</span><span class="me1">initThumb</span><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">sourceWidth</span><span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">sourceHeight</span><span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">maxWidth</span><span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">maxHeight</span><span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">&gt;</span>scale<span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">inflate</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
  <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span> <span class="sy0">=</span> <a href="http://www.php.net/imagecreatetruecolor"><span class="kw3">imagecreatetruecolor</span></a><span class="br0">&#40;</span><span class="re0">$thumbnail</span><span class="sy0">-&gt;</span><span class="me1">getThumbWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span> <span class="re0">$thumbnail</span><span class="sy0">-&gt;</span><span class="me1">getThumbHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
  <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$imgData</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span> <span class="sy0">==</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">maxWidth</span> <span class="sy0">&amp;&amp;</span> <span class="re0">$imgData</span><span class="br0">&#91;</span>1<span class="br0">&#93;</span> <span class="sy0">==</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">maxHeight</span><span class="br0">&#41;</span>
  <span class="br0">&#123;</span>
    <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span> <span class="sy0">=</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">source</span><span class="sy0">;</span>
  <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
    <a href="http://www.php.net/imagecopyresampled"><span class="kw3">imagecopyresampled</span></a><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span><span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">source</span><span class="sy0">,</span> 0<span class="sy0">,</span> 0<span class="sy0">,</span> 0<span class="sy0">,</span> 0<span class="sy0">,</span> <span class="re0">$thumbnail</span><span class="sy0">-&gt;</span><span class="me1">getThumbWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span> <span class="re0">$thumbnail</span><span class="sy0">-&gt;</span><span class="me1">getThumbHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span> <span class="re0">$imgData</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="sy0">,</span> <span class="re0">$imgData</span><span class="br0">&#91;</span>1<span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
  <span class="br0">&#125;</span>
&nbsp;
  <span class="coMULTI">/* ... Removed for brevity ... */</span>
<span class="br0">&#125;</span></pre></div></div>
<p>If you make the following changes, you will now be able to resize transparent png files and keep their transparency.  This will supposedly work for transparent gif files as well, however I have not tried it.  If you have and it works, please leave comment.</p>
<div id="wpshdo_10" class="wp-synhighlighter-outer"><div id="wpshdt_10" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_10"></a><a id="wpshat_10" class="wp-synhighlighter-title" href="#codesyntax_10"  onClick="javascript:wpsh_toggleBlock(10)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_10" onClick="javascript:wpsh_code(10)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_10" onClick="javascript:wpsh_print(10)" title="Print code"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.codemonkeyjava.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_10" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="kw2">public</span> <span class="kw2">function</span> loadFile<span class="br0">&#40;</span><span class="re0">$thumbnail</span><span class="sy0">,</span> <span class="re0">$image</span><span class="br0">&#41;</span>
<span class="br0">&#123;</span>
  <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">source</span> <span class="sy0">=</span> <span class="re0">$loader</span><span class="br0">&#40;</span><span class="re0">$image</span><span class="br0">&#41;</span><span class="sy0">;</span>
  <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">sourceWidth</span> <span class="sy0">=</span> <span class="re0">$imgData</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="sy0">;</span>
  <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">sourceHeight</span> <span class="sy0">=</span> <span class="re0">$imgData</span><span class="br0">&#91;</span>1<span class="br0">&#93;</span><span class="sy0">;</span>
  <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">sourceMime</span> <span class="sy0">=</span> <span class="re0">$imgData</span><span class="br0">&#91;</span><span class="st_h">'mime'</span><span class="br0">&#93;</span><span class="sy0">;</span>
  <span class="re0">$thumbnail</span><span class="sy0">-&gt;</span><span class="me1">initThumb</span><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">sourceWidth</span><span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">sourceHeight</span><span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">maxWidth</span><span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">maxHeight</span><span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">scale</span><span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">inflate</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
  <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span> <span class="sy0">=</span> <a href="http://www.php.net/imagecreatetruecolor"><span class="kw3">imagecreatetruecolor</span></a><span class="br0">&#40;</span><span class="re0">$thumbnail</span><span class="sy0">-&gt;</span><span class="me1">getThumbWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span> <span class="re0">$thumbnail</span><span class="sy0">-&gt;</span><span class="me1">getThumbHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
  <span class="kw1">if</span> <span class="br0">&#40;</span> <span class="br0">&#40;</span><span class="re0">$imgData</span><span class="br0">&#91;</span>2<span class="br0">&#93;</span> <span class="sy0">==</span> IMAGETYPE_GIF<span class="br0">&#41;</span> <span class="sy0">||</span> <span class="br0">&#40;</span><span class="re0">$imgData</span><span class="br0">&#91;</span>2<span class="br0">&#93;</span> <span class="sy0">==</span> IMAGETYPE_PNG<span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="re0">$trnprt_indx</span> <span class="sy0">=</span> <a href="http://www.php.net/imagecolortransparent"><span class="kw3">imagecolortransparent</span></a><span class="br0">&#40;</span><span class="re0">$image</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$trnprt_indx</span> <span class="sy0">&gt;=</span> 0<span class="br0">&#41;</span> <span class="br0">&#123;</span>
      <span class="re0">$trnprt_color</span> <span class="sy0">=</span> <a href="http://www.php.net/imagecolorsforindex"><span class="kw3">imagecolorsforindex</span></a><span class="br0">&#40;</span><span class="re0">$image</span><span class="sy0">,</span> <span class="re0">$trnprt_indx</span><span class="br0">&#41;</span><span class="sy0">;</span>
      <span class="re0">$transparency</span> <span class="sy0">=</span> <a href="http://www.php.net/imagecolorallocate"><span class="kw3">imagecolorallocate</span></a><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span><span class="sy0">,</span> <span class="re0">$trnprt_color</span><span class="br0">&#91;</span><span class="st_h">'red'</span><span class="br0">&#93;</span><span class="sy0">,</span> <span class="re0">$trnprt_color</span><span class="br0">&#91;</span><span class="st_h">'green'</span><span class="br0">&#93;</span><span class="sy0">,</span> <span class="re0">$trnprt_color</span><span class="br0">&#91;</span><span class="st_h">'blue'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
      <a href="http://www.php.net/imagefill"><span class="kw3">imagefill</span></a><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span><span class="sy0">,</span> 0<span class="sy0">,</span> 0<span class="sy0">,</span> <span class="re0">$transparency</span><span class="br0">&#41;</span><span class="sy0">;</span>
      <a href="http://www.php.net/imagecolortransparent"><span class="kw3">imagecolortransparent</span></a><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span><span class="sy0">,</span> <span class="re0">$transparency</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span> <span class="kw1">elseif</span> <span class="br0">&#40;</span><span class="re0">$imgData</span><span class="br0">&#91;</span>2<span class="br0">&#93;</span> <span class="sy0">==</span> IMAGETYPE_PNG<span class="br0">&#41;</span> <span class="br0">&#123;</span>
      <a href="http://www.php.net/imagealphablending"><span class="kw3">imagealphablending</span></a><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span><span class="sy0">,</span> <span class="kw4">false</span><span class="br0">&#41;</span><span class="sy0">;</span>
      <span class="re0">$color</span> <span class="sy0">=</span> <a href="http://www.php.net/imagecolorallocatealpha"><span class="kw3">imagecolorallocatealpha</span></a><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span><span class="sy0">,</span> 0<span class="sy0">,</span> 0<span class="sy0">,</span> 0<span class="sy0">,</span> 127<span class="br0">&#41;</span><span class="sy0">;</span>
      <a href="http://www.php.net/imagefill"><span class="kw3">imagefill</span></a><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span><span class="sy0">,</span> 0<span class="sy0">,</span> 0<span class="sy0">,</span> <span class="re0">$color</span><span class="br0">&#41;</span><span class="sy0">;</span>
      <a href="http://www.php.net/imagesavealpha"><span class="kw3">imagesavealpha</span></a><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span><span class="sy0">,</span> <span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
  <span class="br0">&#125;</span>
&nbsp;
  <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$imgData</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span> <span class="sy0">==</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">maxWidth</span> <span class="sy0">&amp;&amp;</span> <span class="re0">$imgData</span><span class="br0">&#91;</span>1<span class="br0">&#93;</span> <span class="sy0">==</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">maxHeight</span><span class="br0">&#41;</span>
  <span class="br0">&#123;</span>
    <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span> <span class="sy0">=</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">source</span><span class="sy0">;</span>
  <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
    <a href="http://www.php.net/imagecopyresampled"><span class="kw3">imagecopyresampled</span></a><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">thumb</span><span class="sy0">,</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">source</span><span class="sy0">,</span> 0<span class="sy0">,</span> 0<span class="sy0">,</span> 0<span class="sy0">,</span> 0<span class="sy0">,</span> <span class="re0">$thumbnail</span><span class="sy0">-&gt;</span><span class="me1">getThumbWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span>   <span class="re0">$thumbnail</span><span class="sy0">-&gt;</span><span class="me1">getThumbHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span> <span class="re0">$imgData</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="sy0">,</span> <span class="re0">$imgData</span><span class="br0">&#91;</span>1<span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
  <span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.codemonkeyjava.com/2011/11/23/fix-for-transparent-png-files-for-symfony-sfthumbnailplugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Cyanogenmod Build out for Motorola Atrix</title>
		<link>http://www.codemonkeyjava.com/2011/10/25/new-cyanogenmod-build-out-for-motorola-atrix/</link>
		<comments>http://www.codemonkeyjava.com/2011/10/25/new-cyanogenmod-build-out-for-motorola-atrix/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 19:08:20 +0000</pubDate>
		<dc:creator>Haines Chuck</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[atrix]]></category>
		<category><![CDATA[cyanogenmod]]></category>

		<guid isPermaLink="false">http://www.codemonkeyjava.com/?p=12</guid>
		<description><![CDATA[A new Cyanogenmod build, Atrix CM ¬B^¬N build, has been released for the Motorola Atrix by the Atrix Dev Team.  This release is designed to be the final release by the team before official nightlies from Cyanogenmod work.  Fingerprint is still being worked (we are having a strange issue with fingerprint that we are currently working on fixing) [...]]]></description>
			<content:encoded><![CDATA[<p>A new Cyanogenmod build, <a href="http://code.google.com/p/atrix-dev-team/downloads/detail?name=stopgap.zip&amp;can=2&amp;q=">Atrix CM ¬B^¬N build</a>, has been released for the Motorola Atrix by the <a title="Atrix Dev Team" href="http://code.google.com/p/atrix-dev-team/" target="_blank">Atrix Dev Team</a>.  This release is designed to be the final release by the team before official nightlies from Cyanogenmod work.  Fingerprint is still being worked (we are having a strange issue with fingerprint that we are currently working on fixing) and WebTop is not yet there (going to be a long road for this).  However this build is certainly for every day use and runs great in my initial testing.</p>
<p>The build include Faux&#8217;s new kernel (0.21) running at the stock 1Ghz speed.  The new kernel has some great improvements in it and should really go a long way towards better battery life.</p>
<p>I have flashed this build and in my initial testing it runs better than any build I&#8217;ve tested up to this point.  It really feels like a polished build.  Once the fingerprint bug is fixed an integrated this will definitely be the best ROM out there for the Atrix.</p>
<p>Full list of what works and what doesn&#8217;t can be <a href="http://modmymobile.com/forums/661-motorola-atrix-4g-development/562977-exp-cyanogenmod-7-1-atrix-b-n.html">here</a>.  Bolded items are new items for this build.</p>
<p>The build can be downloaded from the usual <a href="http://code.google.com/p/atrix-dev-team/downloads/list" target="_blank">place</a>.</p>
<p>Screenshots from the new build below.</p>

<a href='http://www.codemonkeyjava.com/2011/10/25/new-cyanogenmod-build-out-for-motorola-atrix/screenshot-1319568190429/' title='About page'><img width="150" height="150" src="http://www.codemonkeyjava.com/wp-content/uploads/2011/10/screenshot-1319568190429-150x150.png" class="attachment-thumbnail" alt="About page" title="About page" /></a>
<a href='http://www.codemonkeyjava.com/2011/10/25/new-cyanogenmod-build-out-for-motorola-atrix/screenshot-1319568248112/' title='Lockscreen using the new rings'><img width="150" height="150" src="http://www.codemonkeyjava.com/wp-content/uploads/2011/10/screenshot-1319568248112-150x150.png" class="attachment-thumbnail" alt="Lockscreen using the new rings" title="Lockscreen using the new rings" /></a>
<a href='http://www.codemonkeyjava.com/2011/10/25/new-cyanogenmod-build-out-for-motorola-atrix/screenshot-1319568278082/' title='Homescreen'><img width="150" height="150" src="http://www.codemonkeyjava.com/wp-content/uploads/2011/10/screenshot-1319568278082-150x150.png" class="attachment-thumbnail" alt="Homescreen" title="Homescreen" /></a>

<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemonkeyjava.com/2011/10/25/new-cyanogenmod-build-out-for-motorola-atrix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where has Code Monkey Java Gone?</title>
		<link>http://www.codemonkeyjava.com/2011/10/22/where-has-code-monkey-java-gone/</link>
		<comments>http://www.codemonkeyjava.com/2011/10/22/where-has-code-monkey-java-gone/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 12:46:29 +0000</pubDate>
		<dc:creator>Haines Chuck</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[welcome]]></category>

		<guid isPermaLink="false">http://www.codemonkeyjava.com/?p=7</guid>
		<description><![CDATA[If you are coming to this page for the first time, welcome.  If you have been here before you might have noticed that Code Monkey Java the consulting business no longer resides here.  I have been hired full time by a start-up located in Maryland.  I will be in charge of software development for the company in [...]]]></description>
			<content:encoded><![CDATA[<p>If you are coming to this page for the first time, welcome.  If you have been here before you might have noticed that Code Monkey Java the consulting business no longer resides here.  I have been hired full time by a start-up located in Maryland.  I will be in charge of software development for the company in addition to owning part of the company.  It&#8217;s a great opportunity for me that was impossible to say no to.</p>
<p>That being said I will no longer have time to do any consulting work so I am shutting down Code Monkey Java as a business. Instead it will become my new blog.  It will be a lot of work but it will open up the opportunity for me to be able to finally blog like I&#8217;ve been wanting to do for a long time.  I&#8217;m looking forward to putting up a post a week to start and hopefully increasing that to a few posts a week.</p>
<p>So what will I be posting about, well anything and everything.  I&#8217;m a technology focused guy so most of my posts will likely be technology related, but I&#8217;m sure there will be plenty of flair.</p>
<p>Thanks for stopping by and I hope you enjoy your stay.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemonkeyjava.com/2011/10/22/where-has-code-monkey-java-gone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

