<?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>geek.de.nz &#187; Programming</title>
	<atom:link href="http://www.thheuer.com/Pakistan/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thheuer.com</link>
	<description>Dance of the geek - New Zealand - Germany - DEutschland</description>
	<lastBuildDate>Sat, 04 Feb 2012 02:06:53 +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>jQuery Plugin &#8211; Image Radio buttons</title>
		<link>http://www.thheuer.com/2011/10/jquery-plugins-image-radio-buttons/</link>
		<comments>http://www.thheuer.com/2011/10/jquery-plugins-image-radio-buttons/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 04:38:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.thheuer.com/?p=129</guid>
		<description><![CDATA[At work I&#8217;ve written this jQuery plugin. It&#8217;s only 2KB big and turns your normal radio buttons into images, you can set any images you like for src, checked and hover. Simply attach the configuration to your html input field as the class attribute as a JavaScript like object. I know you might want to [...]]]></description>
			<content:encoded><![CDATA[<p>At work I&#8217;ve written this jQuery plugin. It&#8217;s only 2KB big and turns your normal radio buttons into images, you can set any images you like for src, checked and hover. Simply attach the configuration to your html input field as the class attribute as a JavaScript like object. I know you might want to attach a class to your radio buttons, but this is how far it currently is.</p>
<p>Here an example:</p>
<p><iframe width="600" height="300" src="/jquery-plugins/imageradio/"></iframe></p>
<p><a href="/jquery-plugins/imageradio/jquery.imageradio.js" title="Download Source" target="_blank">Get the JavaScript code</a><br />
<a href="/jquery-plugins/imageradio/" title="Download Source" target="_blank">Get the HTML/JavaScript code</a></p>
<p>Edit: Just found <a href="http://screwdefaultbuttons.com/" target="_blank">this</a> which seems to make this plugin obsolete. <img src='http://www.thheuer.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  Wish I would have found this earlier&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thheuer.com/2011/10/jquery-plugins-image-radio-buttons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto: Install XAMPP 1.7.2 on Windows 7 with XDebug and Netbeans</title>
		<link>http://www.thheuer.com/2010/12/howto-install-xampp-1-7-2-on-windows-7-with-xdebug-and-netbeans/</link>
		<comments>http://www.thheuer.com/2010/12/howto-install-xampp-1-7-2-on-windows-7-with-xdebug-and-netbeans/#comments</comments>
		<pubDate>Sat, 25 Dec 2010 05:26:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ihostnz.com/blog/?p=62</guid>
		<description><![CDATA[Hi, Just for my own reference and some other poor people out there trying to get this to work: Download XAMPP 1.7.2 from sourceforge.net/projects/xampp/files/XAMPP%20Windows/1.7.2/xampp-win32-1.7.2.exe/download Install Download php_xdebug-2.0.5-5.3-vc6.dll from xdebug.org/download.php Place it in C:\xampp\php\ext Edit C:\xampp\php\php.ini add:zend_extension = &#8220;C:\xampp\php\ext\php_xdebug-2.0.5-5.3-vc6.dll&#8221;[xdebug] xdebug.remote_enable=on xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.remote_handler=&#8221;dbgp&#8221; Enjoy!]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>Just for my own reference and some other poor people out there trying to get this to work:</p>
<ol>
<li>Download XAMPP 1.7.2 from <a href="http://sourceforge.net/projects/xampp/files/XAMPP%20Windows/1.7.2/xampp-win32-1.7.2.exe/download">sourceforge.net/projects/xampp/files/XAMPP%20Windows/1.7.2/xampp-win32-1.7.2.exe/download</a></li>
<li>Install</li>
<li>Download php_xdebug-2.0.5-5.3-vc6.dll from <a href="http://xdebug.org/download.php">xdebug.org/download.php</a></li>
<li>Place it in C:\xampp\php\ext</li>
<li>Edit C:\xampp\php\php.ini add:<br/>zend_extension = &#8220;C:\xampp\php\ext\php_xdebug-2.0.5-5.3-vc6.dll&#8221;[xdebug]
<p>xdebug.remote_enable=on</p>
<p>xdebug.remote_host=127.0.0.1</p>
<p>xdebug.remote_port=9000</p>
<p>xdebug.remote_handler=&#8221;dbgp&#8221;</li>
<li>Enjoy!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.thheuer.com/2010/12/howto-install-xampp-1-7-2-on-windows-7-with-xdebug-and-netbeans/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Micro-Optimization For High-Level-Language Programmers</title>
		<link>http://www.thheuer.com/2010/10/micro-optimization-for-high-level-language-programmers/</link>
		<comments>http://www.thheuer.com/2010/10/micro-optimization-for-high-level-language-programmers/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 07:50:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ihostnz.com/blog/?p=47</guid>
		<description><![CDATA[In this post I would like to point out some optimizations that seem to be fairly generic. Every average to advanced level programmer should be able to use these little tricks quite effectively. Code that is well written and thought of can be called great code if it takes advantage of every byte available. However, [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I would like to point out some optimizations that seem to be fairly generic. Every average to advanced level programmer should be able to use these little tricks quite effectively. Code that is well written and thought of can be called great code if it takes advantage of every byte available. However, one should also not overdo optimization, because the gain of 1ms cannot make up for half an hour that you spend more on programming it. But if you get used to using these techniques from now on, you should be good. So lets get to it.</p>
<h2>Choosing the right algorithm</h2>
<p>&#8230; is probably the best optimization you can be doing when writing code. Before you think of saving at the register level, think about how efficient the algorithm is that you are using. For example using quick sort for sorting elements is probably a good idea, rather than using slower algorithms like bubble or insertion sort. If you are using a high-level-language (HLL) like PHP, you would probably want to use the internal *sort() functions. They use quick sort on a low level (written in C). For example, suppose you have an array with 1000 variables (which can be objects, primitives or arrays) and you want to sort it by your own sorting order algorithm. Instead of going through great lengths of searching for an implementation of a sort algorithm online or even writing your own, in PHP, for example, you should use the usort() function and be passing in your compare function. Like this you can sort dates, strings or numbers in any order that you like, you just need to define when item A is smaller than item B and return a negative number in that case, and in the converse return a positive number as well as 0 when they are equal. You get the idea. If you find a good algorithm and need to implement it yourself, it might be hard and challenging but it can be well-worth the time spent on it, because you can save the user of your application time and your application server number crunching resources.</p>
<h2>Saving on the byte or even bit level</h2>
<p>Now to the more generic optimisations that you can think of when you have chosen the right algorithm for your implementation. When you know that the algorithm you are using is good or even could not be better, great. You can go on implementing it. When you do so, you should think of every expression you use more than once as a variable and also reserve the necessary space for it. For example, you could have an expression like (a &lt; b &amp;&amp; b &lt; c &amp;&amp; b+2 == d). If you use this expression in only one if statement, it is probably a good idea to use the expression as is. As soon as you use the expression more than once, make a variable that describes the purpose of the expression. For example:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">aGreaterBAndBLessCAndBPlus2EqualD <span style="color: #339933;">=</span> a <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> b <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> b <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> c <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> b<span style="color: #339933;">+</span><span style="color: #CC0000;">2</span> <span style="color: #339933;">==</span> a<span style="color: #339933;">;</span></pre></div></div>

<p>Remember that code readability and understanding of it after the initial implementation is more important than saving a few bytes for the variable name. In compiled languages the length of a variable name does not matter usually. Only in higher level, interpreted languages it can make a difference, but again only nano seconds or so. It is still more important to have an efficient algorithm which is easier to achieve when the code is readable, at least when you later come back to it.</p>
<p>Another trick, which actually follows from the above is to optimise loops in a generic way. A simple for loop like:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> somevar.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// do something with somevar[i]</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>(in JavaScript) can simply be rewritten as</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> leni <span style="color: #339933;">=</span> somevar.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span>i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> leni<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// do something with somevar[i]</span>
  <span style="color: #006600; font-style: italic;">// THIS SAVES 20% PERFORMANCE FOR EACH LOOP!</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This only works if you know ahead of time, that somevar.length will not and need not change inside of the loop, which is mostly the case. This runs faster because somevar.length is re-evaluated every time it is called in every iteration of the top-most for-loop. If you give it a temporary variable the CPU can cache the leni variable in a register and check much quicker if i is smaller than that. I read also that ++i can be faster than i++ in some implementations of programming languages such as JavaScript in some browsers. It depends on how the low-level assembly for that is written. I have seen arguments that i++ and ++i have exactly the same amount of machine instructions, but also ++i is not less readable than i++ and it does not hurt to write it that way if it can cut down the number of instructions by one or two in each iteration.</p>
<p>Edit:<br />
You can use the same concepts in C(++). Actually the book &#8220;Write Great Code&#8221; talks about C and other lower level languages mainly. In C++ it would look like so, if you want to output a string char by char:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">char</span> cstring<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">10</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;My String&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> i <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> leni <span style="color: #339933;">=</span> strlen<span style="color: #009900;">&#40;</span>cstring<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span>i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> leni<span style="color: #339933;">;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066;">cout</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;&amp;</span>lt<span style="color: #339933;">;</span> cstring<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Also, if you want to improve your low-level knowlege, even as a high-level programmer like me, it might pay to read the &#8216;Write Great Code&#8217; series by Randall Hyde. But in essence these tips here should be sufficient for some improvement of your code and should be simple enough to implement for any level programmer. Just remember that the best compiler or interpreter cannot replace a skilled programmer and I think this will stay that way for a long time if not forever. This is also a good thing and will keep us employed.</p>
<p>I hope someone could learn something from this and you think it was worthwhile to read this short article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thheuer.com/2010/10/micro-optimization-for-high-level-language-programmers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaScript Concepts</title>
		<link>http://www.thheuer.com/2010/08/javascript-concepts/</link>
		<comments>http://www.thheuer.com/2010/08/javascript-concepts/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 10:03:13 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ihostnz.com/blog/?p=31</guid>
		<description><![CDATA[Having learned JavaScript mainly by doing, it was quite late that I figured out some important details. Please comment if you think or know that I&#8217;m wrong. The arguments array as well as the caller instance are universal variables inside every JavaScript function. The names are self-explanatory. An anonymous function inside another function keeps the [...]]]></description>
			<content:encoded><![CDATA[<p>Having learned JavaScript mainly by doing, it was quite late that I figured out some important details. Please comment if you think or know that I&#8217;m wrong.</p>
<p>The arguments array as well as the caller instance are universal variables inside every JavaScript function. The names are self-explanatory.<br />
An anonymous function inside another function keeps the variables in scope as in:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> somefunction <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>arg1<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> avar1 <span style="color: #339933;">=</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>  
  object.<span style="color: #660066;">onclick</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'arg1='</span> <span style="color: #339933;">+</span> arg1 <span style="color: #339933;">+</span> <span style="color: #3366CC;">' avar1='</span> <span style="color: #339933;">+</span> avar1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
somefunction<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Foo'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// &quot;arg1=Foo avar1=10&quot; when object is clicked on</span></pre></div></div>

<p>So this means that the scope of the function defines what variables can be accessed within it, even after the function call has finished.</p>
<p>Another part I always found confusing in JavaScript is the &#8220;this&#8221;-keyword, but that might have to be the topic of another post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thheuer.com/2010/08/javascript-concepts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GeoExt and OpenLayers &#8211; Zoom Mode</title>
		<link>http://www.thheuer.com/2010/08/geoext-and-openlayers-zoom-mode/</link>
		<comments>http://www.thheuer.com/2010/08/geoext-and-openlayers-zoom-mode/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 04:14:20 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ihostnz.com/blog/?p=18</guid>
		<description><![CDATA[Just playing around with GeoExt and OpenLayers, I figured out how to easily change the control to a zoom rectangle with minimal changes: First create the normal and the custom control with: var inZoom = false; var navigation = new OpenLayers.Control.Navigation&#40;&#41;; var ZoomBoxNav = OpenLayers.Class&#40;OpenLayers.Control.Navigation, &#123; zoomBoxKeyMask: null // this ensures that a box is [...]]]></description>
			<content:encoded><![CDATA[<p>Just playing around with GeoExt and OpenLayers, I figured out how to easily change the control to a zoom rectangle with minimal changes:</p>
<p>First create the normal and the custom control with:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> inZoom <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> navigation <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">Navigation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> ZoomBoxNav <span style="color: #339933;">=</span> OpenLayers.<span style="color: #003366; font-weight: bold;">Class</span><span style="color: #009900;">&#40;</span>OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">Navigation</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
 zoomBoxKeyMask<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #006600; font-style: italic;">// this ensures that a box is always drawn</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> zoomBox <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> ZoomBoxNav<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Then all you need is a button or better Action object, which adds the appropriate control to the map:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> toggleRectZoom <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>inZoom<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span>navigation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    map.<span style="color: #660066;">removeControl</span><span style="color: #009900;">&#40;</span>zoomBox<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    inZoom <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
    map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span>zoomBox<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    map.<span style="color: #660066;">removeControl</span><span style="color: #009900;">&#40;</span>navigation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    inZoom <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
zoomButton <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GeoExt.<span style="color: #660066;">Action</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  text<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Zoom Mode'</span><span style="color: #339933;">,</span>
  handler<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>inZoom<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      zoomButton.<span style="color: #660066;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Zoom Mode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
      zoomButton.<span style="color: #660066;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Pan Mode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    toggleRectZoom<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
toolBar <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">Toolbar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> zoomButton <span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
mapPanel <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GeoExt.<span style="color: #660066;">MapPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  border<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
  region<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;center&quot;</span><span style="color: #339933;">,</span>
  <span style="color: #006600; font-style: italic;">// we do not want all overlays, to try the OverlayLayerContainer</span>
  map<span style="color: #339933;">:</span> map<span style="color: #339933;">,</span>
  center<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">172.1569825</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">42.6109735</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
  zoom<span style="color: #339933;">:</span> <span style="color: #CC0000;">6</span><span style="color: #339933;">,</span>
  layers<span style="color: #339933;">:</span> myLayers<span style="color: #339933;">,</span>
  tbar<span style="color: #339933;">:</span> toolBar
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.thheuer.com/2010/08/geoext-and-openlayers-zoom-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thoughts on JavaScript compilers</title>
		<link>http://www.thheuer.com/2010/07/thoughts-on-javascript-compilers/</link>
		<comments>http://www.thheuer.com/2010/07/thoughts-on-javascript-compilers/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 09:35:14 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ihostnz.com/blog/?p=13</guid>
		<description><![CDATA[I think JavaScript compilers sort of defeat the purpose of a programming language. I can understand that you would want to compress JavaScript to save download time on the client side. However, it seems strange to me that another programming language writes code in another, higher level language. If the JavaScript you write is good [...]]]></description>
			<content:encoded><![CDATA[<p>I think JavaScript compilers sort of defeat the purpose of a programming language. I can understand that you would want to compress JavaScript to save download time on the client side. However, it seems strange to me that another programming language writes code in another, higher level language. If the JavaScript you write is good and not highly redundant, another PL wont be able to generate it. The only place where it seems useful to me is when creating variables&#8217; values like a count or an array of file names or similar. However, generating JavaScript from PHP or any other server side language seems to defeat the purpose of reusable code. You can in fact write highly re-usable code in JavaScript, it supports inheritance etc and libraries like jQuery make it highly compact. When it comes to deployment though, it is beneficial to have a script running that compresses the JavaScript.</p>
<p>Anyway, let me know your thoughts in a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thheuer.com/2010/07/thoughts-on-javascript-compilers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

