<?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>TheHippo</title>
	<atom:link href="http://blog.thehippo.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thehippo.de</link>
	<description>if (i=1) throw null;</description>
	<lastBuildDate>Sun, 29 Apr 2012 23:01:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Do a loop with LESS css</title>
		<link>http://blog.thehippo.de/2012/04/programming/do-a-loop-with-less-css/</link>
		<comments>http://blog.thehippo.de/2012/04/programming/do-a-loop-with-less-css/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 22:42:46 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools and Software]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[less]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[node]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=392</guid>
		<description><![CDATA[Lately I discovered LESS and started loving and using it. In combination with Twitter&#8217;s Bootstrap it become very easy to generate CSS in a very comfortable way. At one point I needed to generate roughly 30 css classes to leverage CSS sprites. I&#8217;ve been used do this all by hand back when CSS was written without any [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I discovered <a title="LESS css" href="http://lesscss.org/" target="_blank">LESS</a> and started loving and using it. In combination with Twitter&#8217;s <a title="Bootstrap" href="http://twitter.github.com/bootstrap/" target="_blank">Bootstrap</a> it become very easy to generate CSS in a very comfortable way.</p>
<p>At one point I needed to generate roughly 30 css classes to leverage <a title="CSS sprites" href="http://css-tricks.com/css-sprites/" target="_blank">CSS sprites</a>. I&#8217;ve been used do this all by hand back when CSS was written without any help, but having such awesome tools like LESS there must be a way to do this more comfortable. After searching for a while various sources (and also the LESS documentation) said that there are no loops in LESS, so I looked through the Bootstrap sources I found some stuff that looked similar to loops (<a title="Bootstrap grid.less" href="https://github.com/twitter/bootstrap/blob/master/less/grid.less" target="_blank">grid.less</a> and <a title="Bootstrap - mixins.less" href="https://github.com/twitter/bootstrap/blob/master/less/mixins.less#L531" target="_blank">mixins.less</a>).</p>
<p>After simplifying what I found here is the shortest version of doing a loop-like construct in LESS:<span id="more-392"></span></p>
<p>LESS code:</p>
<pre>@iterations: 30;

// helper class, will never show up in resulting css
// will be called as long the index is above 0
.loopingClass (@index) when (@index &gt; 0) {

	// create the actual css selector, example will result in
	// .myclass_30, .myclass_28, .... , .myclass_1
	(~".myclass_@{index}") {
		// your resulting css
		my-property: -@index px;
	}

	// next iteration
	.loopingClass(@index - 1);
}

// end the loop when index is 0
.loopingClass (0) {}

// "call" the loopingClass the first time with highest value
.loopingClass (@iterations);</pre>
<p>Resulting CSS:</p>
<pre>.myclass_30 {
  my-property: -30 px;
}
.myclass_29 {
  my-property: -29 px;
}

.......
.......
.......

.myclass_1 {
  my-property: .1 px;
}</pre>
<p>This is just a very basic example but I thing you get the idea how to use this trick.</p>
 <p><a href="http://blog.thehippo.de/?flattrss_redirect&amp;id=392&amp;md5=323258ba8338386838a69f66d5aeb038" title="Flattr" target="_blank"><img src="http://blog.thehippo.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2012/04/programming/do-a-loop-with-less-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=TheHippo&amp;popout=1&amp;url=http%3A%2F%2Fblog.thehippo.de%2F2012%2F04%2Fprogramming%2Fdo-a-loop-with-less-css%2F&amp;language=en_GB&amp;category=text&amp;title=Do+a+loop+with+LESS+css&amp;description=Lately+I+discovered+LESS%C2%A0and+started+loving+and+using+it.+In+combination+with+Twitter%26%238217%3Bs+Bootstrap%C2%A0it+become+very+easy+to+generate+CSS+in+a+very+comfortable+way.+At+one+point+I+needed...&amp;tags=bootstrap%2Ccss%2Cless%2Cloop%2Cnode%2Cnode.js%2Cblog" type="text/html" />
	</item>
		<item>
		<title>How to create a custom git command/extension</title>
		<link>http://blog.thehippo.de/2012/03/tools-and-software/how-to-create-a-custom-git-command-extension/</link>
		<comments>http://blog.thehippo.de/2012/03/tools-and-software/how-to-create-a-custom-git-command-extension/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 22:09:37 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[Tools and Software]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git command]]></category>
		<category><![CDATA[git extension]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=374</guid>
		<description><![CDATA[It&#8217;s been a while since my last post, so here some relevant updates (shot version): I entirely switched to git for source control and I am quite happy about it. It is flexible, fast and simply amazing. After using it for a while you sometime discover some shortcomings. For example: Many of my client do not [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since my last post, so here some relevant updates (shot version): I entirely switched to <a title="Moved to GitHub" href="http://blog.thehippo.de/2010/03/general/moved-to-github-2/" target="_blank">git</a> for source control and I am quite happy about it. It is flexible, fast and simply amazing.</p>
<p>After using it for a while you sometime discover some shortcomings.<br />
For example: Many of my client do not use git so I need to send them an archive with the current state of development. There are different way to get this done.</p>
<ul>
<li>Do this in your file manager. Very annoying, because you need to sort out all files that should not be in the archive (.git folder, log, cache, etc.)</li>
<li>On your console:
<pre>git archive --format zip --output useful_name_for_the_zip_file.zip name_of_branch</pre>
</li>
</ul>
<p>This is not easy as it should be. So why not create your own custom git command (or git extension)? Like git archive-file!<span id="more-374"></span></p>
<h2>How to create a custom git command</h2>
<p>&nbsp;</p>
<ul>
<li>create a executable script file somewhere in your executable paths. It must use the following naming schema  &#8220;git-your-custom-command&#8221; and must be without a extension. (In my example from above: &#8220;git-archive-file&#8221;)</li>
<li>This file can be written in any scripting language who want and that is executable on your system. (It also should work with binaries.)</li>
<li>This file does not need to be anywhere near all the other git command.</li>
<li>Now you could use it as &#8220;git your-custom-command&#8221;</li>
</ul>
<h2>Example script</h2>
<p>&nbsp;</p>
<div>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re3">#!/bin/bash</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re3"># extract current branch name</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">BRANCH=</span>$<span class="br0">&#40;</span>git name-<span class="kw2">rev</span> HEAD <span class="nu0">2</span>&gt; /dev/null | <span class="kw2">awk</span> <span class="st0">&quot;{ print <span class="es0">\$</span>2 }&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">echo</span> Building archive on branch \\<span class="st0">&quot;$BRANCH<span class="es0">\\</span>&quot;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="re3"># get name of the most top folder of current directory, used <span class="kw1">for</span> the</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re3"># output filename</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">ARCHIVE_NAME=</span>$<span class="br0">&#40;</span><span class="kw2">basename</span> $<span class="br0">&#40;</span><span class="kw3">pwd</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re3"># get a version string, so archives will not be overwritten when creating</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re3"># many of them</span></div>
</li>
<li class="li2">
<div class="de2"><span class="re2">VERSION=</span>$<span class="br0">&#40;</span>git describe &#8211;always &#8211;long<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re3"># <span class="kw1">if</span> not on master append branch name into the filename</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#91;</span> <span class="st0">&quot;$BRANCH&quot;</span> = <span class="st0">&quot;master&quot;</span> <span class="br0">&#93;</span>; <span class="kw1">then</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">FILENAME=</span><span class="re1">$ARCHIVE_NAME</span>.<span class="re1">$VERSION</span>.<span class="kw2">zip</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">else</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">FILENAME=</span><span class="re1">$ARCHIVE_NAME</span>.<span class="re1">$VERSION</span>.<span class="re1">$BRANCH</span>.<span class="kw2">zip</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">fi</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re3"># combine path and filename</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">OUTPUT=</span>$<span class="br0">&#40;</span><span class="kw3">pwd</span><span class="br0">&#41;</span>/<span class="re1">$FILENAME</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re3"># building archive</span></div>
</li>
<li class="li2">
<div class="de2">git archive &#8211;format <span class="kw2">zip</span> &#8211;output <span class="re1">$OUTPUT</span> <span class="re1">$BRANCH</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re3"># also display <span class="kw2">size</span> of the resulting file</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">echo</span> Saved to \\<span class="st0">&quot;$FILENAME<span class="es0">\\</span>&quot;</span> \<span class="br0">&#40;</span>`<span class="kw2">du</span> -h <span class="re1">$OUTPUT</span> | <span class="kw2">cut</span> -f1`\<span class="br0">&#41;</span></div>
</li>
</ol>
</div>
</div>
<p>In any local repository you now can do: &#8220;git archive-file&#8221; which will compress all your tracked files into a zip archive. The name of the archive file will be chosen from your current HEAD. If the current branch name differs from &#8220;master&#8221; the branch name will be included into the zip file name.</p>
<p>If you like to get some nice git extras commands check out: <a title="git-extras" href="https://github.com/visionmedia/git-extras" target="_blank">git-extras</a>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
 <p><a href="http://blog.thehippo.de/?flattrss_redirect&amp;id=374&amp;md5=35baaf80295efb2f51566ca8a36d381e" title="Flattr" target="_blank"><img src="http://blog.thehippo.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2012/03/tools-and-software/how-to-create-a-custom-git-command-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=TheHippo&amp;popout=1&amp;url=http%3A%2F%2Fblog.thehippo.de%2F2012%2F03%2Ftools-and-software%2Fhow-to-create-a-custom-git-command-extension%2F&amp;language=en_GB&amp;category=text&amp;title=How+to+create+a+custom+git+command%2Fextension&amp;description=It%26%238217%3Bs+been+a+while+since+my+last+post%2C+so+here+some+relevant+updates+%28shot+version%29%3A+I+entirely+switched+to+git+for+source+control+and+I+am+quite+happy+about+it....&amp;tags=archive%2Cgit%2Cgit+command%2Cgit+extension%2Czip%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Flex: Using embedded image in HTML-Text</title>
		<link>http://blog.thehippo.de/2011/03/programming/flex-using-embedded-image-in-html-text/</link>
		<comments>http://blog.thehippo.de/2011/03/programming/flex-using-embedded-image-in-html-text/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 18:05:09 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[HTML Text]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[mxml]]></category>
		<category><![CDATA[spark]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=352</guid>
		<description><![CDATA[I am currently working on a Flash project. Because it has a lot of GUI stuff and it is always a lot of code to make some nice GUI components in pure ActionScript 3 I decided to give Flex a change. Surprisingly I really like it. It&#8217;s nice and a little bit sick (for a [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently working on a Flash project. Because it has a lot of GUI stuff and it is always a lot of code to make some nice GUI components in pure ActionScript 3 I decided to give Flex a change. Surprisingly I really like it. It&#8217;s nice and a little bit sick (for a framework a lot of magic happens during compilation). Like for ActionScript 3 Adobe again did a really good job on writing a nice documentation.</p>
<p>But not everything works flawless. Here is a thing struggled with:</p>
<p>Embedding an image is quite easy (the image will be compiled into the final swf file):</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;mx:Image source=&quot;@Embed(source=&#8217;image.jpg&#8217;)&quot;/&gt;</div>
</li>
</ol>
</div>
<p>Using HTML to format text shouldn&#8217;t be a problem for anyone.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;mx:Text width=&quot;100%&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &lt;mx:htmlText&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &lt;![CDATA[&lt;p&gt;&lt;img src='url'/&gt;some text&lt;/p&gt;]]&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &lt;/mx:htmlText&gt;
</div>
</li>
<li class="li2">
<div class="de2">&lt;/mx:Text&gt;</div>
</li>
</ol>
</div>
<p>This will show the image from the given URL and &#8220;some text&#8221;. The Image is going to be loaded when displayed, it is not embedded into the swf file.</p>
<p><strong>How to use a embedded image in a HTML text element?<span id="more-352"></span></strong></p>
<p>It took a while, so here is the solution. It is not clean as it should, but it works.</p>
<p>First you need a helper class, which embeds the image:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">package embeds <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> mx.<span class="me1">core</span>.<span class="me1">BitmapAsset</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> ImageAsset <span class="kw3">extends</span> Sprite <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>Embed<span class="br0">&#40;</span>source=<span class="st0">&quot;image.jpg&quot;</span><span class="br0">&#41;</span><span class="br0">&#93;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>Bindable<span class="br0">&#93;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> source : <span class="kw2">Class</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> ImageAsset<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> image:BitmapAsset = <span class="kw2">new</span> source<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>image<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>Then you could do this, as I said it looks a little bit like a hack, but it works just fine.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;fx:Script&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;![CDATA[
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; import embeds.ImageAsset;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; // this is needed, otherwise the image is not
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; // available within the html text
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; private var hack:ImageAsset;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; ]]&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;/fx:Script&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;mx:Text&gt;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:htmlText&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;![CDATA[&lt;p&gt;&lt;img src='embeds.ImageAsset'/&gt;some text&lt;/p&gt;]]&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/mx:htmlText&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;/mx:Text&gt;</div>
</li>
</ol>
</div>
 <p><a href="http://blog.thehippo.de/?flattrss_redirect&amp;id=352&amp;md5=066e58cb1fc8a92eb53d4b1488361bec" title="Flattr" target="_blank"><img src="http://blog.thehippo.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2011/03/programming/flex-using-embedded-image-in-html-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=TheHippo&amp;popout=1&amp;url=http%3A%2F%2Fblog.thehippo.de%2F2011%2F03%2Fprogramming%2Fflex-using-embedded-image-in-html-text%2F&amp;language=en_GB&amp;category=text&amp;title=Flex%3A+Using+embedded+image+in+HTML-Text&amp;description=I+am+currently+working+on+a+Flash+project.+Because+it+has+a+lot+of+GUI+stuff+and+it+is+always+a+lot+of+code+to+make+some+nice+GUI+components...&amp;tags=ActionScript+3%2CFlex%2CHTML+Text%2CImage%2Cmxml%2Cspark%2Cblog" type="text/html" />
	</item>
		<item>
		<title>How to combine DELETE and JOIN in one MySQL query</title>
		<link>http://blog.thehippo.de/2011/01/server/delete-and-join-mysql-query/</link>
		<comments>http://blog.thehippo.de/2011/01/server/delete-and-join-mysql-query/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 18:33:30 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[join]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=334</guid>
		<description><![CDATA[Today I discovered that a while back on a PHP/HTML/MySQL project I made some serious mistakes on my database design. To explain it in short: I have one a table, lets call it &#8220;table1&#8243;, and another table, lets call it &#8220;table2&#8243;. Table1 references a row from table2, but I didn&#8217;t used foreign keys in these [...]]]></description>
			<content:encoded><![CDATA[<p>Today I discovered that a while back on a PHP/HTML/MySQL project I made some serious mistakes on my database design. To explain it in short:</p>
<p>I have one a table, lets call it &#8220;table1&#8243;, and another table, lets call it &#8220;table2&#8243;. Table1 references a row from table2, but I didn&#8217;t used foreign keys in these days. (I don&#8217;t if I didn&#8217;t know that they are exist or if InnoDB wasn&#8217;t available.) The Website has an admin tool which edits all the tables through some HTML forms. My mistake was that it is possible to delete a row from table2 which leaves all the rows in table1 referencing this row in table2 somehow broken. Today someone discovered this mistake I needed to clean this up. My idea was to create a simple query which cleans table1 and the alter the PHP which deleting rows from table2 to also clean up table1.</p>
<p>I started which the following query:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">DELETE</span> <span class="kw1">FROM</span> table1 <span class="kw1">WHERE</span> id <span class="kw5">IN</span> <span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">SELECT</span> t1.id</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">FROM</span> table1 AS t1</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">LEFT</span> <span class="kw1">JOIN</span> table2 AS t2 ON t1.key = t2.key</div>
</li>
<li class="li2">
<div class="de2">&nbsp; <span class="kw1">WHERE</span> t2.key <span class="kw5">IS</span> <span class="kw3">NULL</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
<p>Which leads to the following error:</p>
<pre>#1093 - You can't specify target table 'table1' for update in FROM clause</pre>
<p>I was some kind of shocked because I had no idea whats wrong with this query. After searching the web for a while I found out that it is some kind of bug in MySQL but there is a weird looking workaround:<span id="more-334"></span></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">DELETE</span> <span class="kw1">FROM</span> table1 <span class="kw1">WHERE</span> id <span class="kw5">IN</span> <span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">SELECT</span> id</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">FROM</span> <span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">SELECT</span> t1.id</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">FROM</span> table1 AS t1</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">LEFT</span> <span class="kw1">JOIN</span> table2 AS t2 ON t1.key = t2.key</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">WHERE</span> t2.key <span class="kw5">IS</span> <span class="kw3">NULL</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#41;</span> AS temp</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
<p>This works very nicely, but costs a lot of performance, because you need to add another subquery and you create a temporary table. So the better solution is to sanitise all your data before you remove some referenced rows <img src='http://blog.thehippo.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
 <p><a href="http://blog.thehippo.de/?flattrss_redirect&amp;id=334&amp;md5=3bf6080bce612a67a9b7acb2481b073a" title="Flattr" target="_blank"><img src="http://blog.thehippo.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2011/01/server/delete-and-join-mysql-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=TheHippo&amp;popout=1&amp;url=http%3A%2F%2Fblog.thehippo.de%2F2011%2F01%2Fserver%2Fdelete-and-join-mysql-query%2F&amp;hidden=1&amp;language=en_GB&amp;category=text&amp;title=How+to+combine+DELETE+and+JOIN+in+one+MySQL+query&amp;description=Today+I+discovered+that+a+while+back+on+a+PHP%2FHTML%2FMySQL+project+I+made+some+serious+mistakes+on+my+database+design.+To+explain+it+in+short%3A+I+have+one+a+table%2C...&amp;tags=database%2Cdelete%2Cjoin%2Cmysql%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Installing Windows AFTER you installed Ubuntu</title>
		<link>http://blog.thehippo.de/2010/09/general/installing-windows-after-you-installed-ubuntu/</link>
		<comments>http://blog.thehippo.de/2010/09/general/installing-windows-after-you-installed-ubuntu/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 16:12:55 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tools and Software]]></category>
		<category><![CDATA[bootmanager]]></category>
		<category><![CDATA[gparted]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu 10.04]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=317</guid>
		<description><![CDATA[I&#8217;m a big fan of the Linux operating system, but sometimes you really need a Windows to run software that isn&#8217;t available for Linux or where isn&#8217;t any related program. Therefore you could try WINE (which emulates the Windows API within you Linux system), you could install a virtual windows using a virtual machine like [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a big fan of the Linux operating system, but sometimes you really need a Windows to run software that isn&#8217;t available for Linux or where isn&#8217;t any related program.<br />
Therefore you could try <a title="Wine" href="http://www.winehq.org/" target="_blank">WINE</a> (which emulates the Windows API within you Linux system), you could install a virtual windows using a virtual machine like <a title="Virtual Box" href="http://www.virtualbox.org/" target="_blank">Virtual Box</a> (which emulates a whole PC within you Linux system) or you could install a native Windows operating system side by side to you Linux. If you need the whole performance you hardware could give you, you need to install Windows on your hard drive next to you Linux installation.<br />
Since the Windows boot loader is very restrictive regarding to having multiple operating systems the easiest way is to first install Windows and then later install your Linux system, which brings <a href="http://www.gnu.org/software/grub/">GRUB</a> (or something similar) as a boot loader.<br />
I first installed Ubuntu on my PC and wanted to install Windows later, so I hard to do it the hardest way:<br />
<span id="more-317"></span><br />
(There is absolutely no guarantee that  this works for you, but this is how I did it. This instructions only work for fresh installations of Ubuntu 9.10 or later, because earlier version of Ubuntu use an older version of the GRUB boot loader.)</p>
<p>You need:</p>
<ul>
<li>Enough space on hard drive</li>
<li>Windows installation CD/DVD</li>
<li>Linux/Ubuntu Live-CD/DVD (!!)</li>
<li>Some time you like to waste on a Windows installation process</li>
</ul>
<p>Instructions:</p>
<ul>
<li>Make sure you have enough free space on you hard disc.</li>
<li>If you hadn&#8217;t install <a title="GParted" href="http://gparted.sourceforge.net/" target="_blank">GParted</a>, do it now.</li>
<li>Make space for the Windows partition on you hard drive and create a new NTFS partition. The overview from GParted should somehow look similar to this (/dev/sda2 is my NTFS partition):
<p><div id="attachment_321" class="wp-caption aligncenter" style="width: 510px"><a href="http://blog.thehippo.de/wp-content/uploads/2010/09/screenshot1.png"><img class="size-full wp-image-321  " title="GParted - partitions on hard drive" src="http://blog.thehippo.de/wp-content/uploads/2010/09/screenshot1.png" alt="GParted - partitions on hard drive" width="500" height="122" /></a><p class="wp-caption-text">GParted - partitions on hard drive</p></div></li>
<li>Reboot you system, install Windows on the <strong>NEW</strong> partition on your hard drive (It is quite important to choose the right one, otherwise you Linux system could get lost). After the installation there is (currently) no way to boot you Linux system, since Windows has overwritten the Linux boot loader.</li>
<li>Insert you Ubuntu/Linux Live CD / DVD and boot a Live system.</li>
<li>Mount you Linux partition into you Live system. (Easiest way is: On main menu: &#8220;Places&#8221; -&gt; &#8220;Name/size of Filesystem&#8221;</li>
<li>Open a console/terminal</li>
<li>Check if everything is correctly mounted and get the ID of you Linux partition. Enter:
<pre>mount</pre>
<p>which should give you a line like this</p>
<pre>/dev/sda2 on /media/0d104aff-ec8c-44c8-b811-92b993823444 type ext4 (rw,nosuid,nodev,uhelper=devkit)</pre>
<p>Now run:</p>
<pre>ls /media/0d104aff-ec8c-44c8-b811-92b993823444/boot</pre>
<p>Replace <code>0d104aff-ec8c-44c8-b811-92b993823444</code> with the ID given by the <code>mount</code> command earlier. (Tip: Use &lt;Tab&gt;-Key to get autocompletion.)<br />
The result should be very close to this:</p>
<pre>config-2.6.18-3-686      initrd.img-2.6.18-3-686.bak  System.map-2.6.18-3-686
grub                     lost+found                   vmlinuz-2.6.18-3-686
initrd.img-2.6.18-3-686  memtest86+.bin</pre>
</li>
<li>Overwrite the master boot record and replace the Windows boot loader with GRUB: (again insert the correct ID for the partition and make sure you perform this on the right hard drive!)
<pre>sudo grub-install --root-directory=/media/0d104aff-ec8c-44c8-b811-92b993823444 /dev/sda</pre>
</li>
<li>Grub automatically detects all the installed operating system. After a reboot you should be able to chose which operating system you want to boot.</li>
<li>Done.</li>
</ul>
<p>Tip: If you do not see the grub menu during boot, press and hold the Shift key before the boot process starts.</p>
<ul></ul>
 <p><a href="http://blog.thehippo.de/?flattrss_redirect&amp;id=317&amp;md5=4ab4980ca49abb7d518cc380d9d08d2a" title="Flattr" target="_blank"><img src="http://blog.thehippo.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2010/09/general/installing-windows-after-you-installed-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=TheHippo&amp;popout=1&amp;url=http%3A%2F%2Fblog.thehippo.de%2F2010%2F09%2Fgeneral%2Finstalling-windows-after-you-installed-ubuntu%2F&amp;language=en_GB&amp;category=text&amp;title=Installing+Windows+AFTER+you+installed+Ubuntu&amp;description=I%26%238217%3Bm+a+big+fan+of+the+Linux+operating+system%2C+but+sometimes+you+really+need+a+Windows+to+run+software+that+isn%26%238217%3Bt+available+for+Linux+or+where+isn%26%238217%3Bt+any+related+program....&amp;tags=bootmanager%2Cgparted%2Cgrub%2Cinstallation%2CLinux%2CUbuntu%2CUbuntu+10.04%2CWindows%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Ubuntu: getting notifications from the console</title>
		<link>http://blog.thehippo.de/2010/08/tools-and-software/ubuntu-getting-notifications-from-the-console/</link>
		<comments>http://blog.thehippo.de/2010/08/tools-and-software/ubuntu-getting-notifications-from-the-console/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 18:10:24 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[Tools and Software]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[notify]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=302</guid>
		<description><![CDATA[Sometimes you run a task from the console which takes a while. (E.g.: compiling some programs, downloading something from the internet or installing updates.) Often you do not wait until this task finishes and just toggle to the next window. Would it be nice if you would get some kind of notification, when the task has finished? [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you run a task from the console which takes a while. (E.g.: compiling some programs, downloading something from the internet or installing updates.) Often you do not wait until this task finishes and just toggle to the next window. Would it be nice if you would get some kind of notification, when the task has finished? I found the following solution, which uses the Ubuntu notification system:</p>
<ul>
<li>Edit the <em>.bashrc</em> file from you home directory and append the following lines:
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw3">alias</span> <span class="re2">alert_helper=</span><span class="st0">&#8216;history|tail -n1|sed -e &quot;s/^<span class="es0">\s</span>*[0-9]<span class="es0">\+</span><span class="es0">\s</span>*//&quot; -e &quot;s/;<span class="es0">\s</span>*alert$//&quot;&#8217;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">alias</span> <span class="re2">alert=</span><span class="st0">&#8216;notify-send -i /usr/share/icons/gnome/32&#215;32/apps/gnome-terminal.png &quot;[$?] $(alert_helper)&quot;&#8217;</span></div>
</li>
</ol>
</div>
</li>
<li>Install the <em>libnotify-bin</em> package
<pre>sudo apt-get install libnotify-bin</pre>
</li>
<li>If you do not want to restart execute the next command in a console:
<pre>source ~/.bashrc</pre>
</li>
</ul>
<p>Now you have a new command available on your console: <em>alert</em><br />
If you do something time consuming now add the additional <em>alert</em> after the last command and you will get a nice notification:<br />
<div id="attachment_312" class="wp-caption aligncenter" style="width: 360px"><a href="http://blog.thehippo.de/wp-content/uploads/2010/08/notification.png"><img class="size-full wp-image-312" title="notification" src="http://blog.thehippo.de/wp-content/uploads/2010/08/notification.png" alt="notification" width="350" height="151" /></a><p class="wp-caption-text">notification from the console</p></div></p>
 <p><a href="http://blog.thehippo.de/?flattrss_redirect&amp;id=302&amp;md5=acdd8752f050ccf78756144137bacb6e" title="Flattr" target="_blank"><img src="http://blog.thehippo.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2010/08/tools-and-software/ubuntu-getting-notifications-from-the-console/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=TheHippo&amp;popout=1&amp;url=http%3A%2F%2Fblog.thehippo.de%2F2010%2F08%2Ftools-and-software%2Fubuntu-getting-notifications-from-the-console%2F&amp;language=en_GB&amp;category=text&amp;title=Ubuntu%3A+getting+notifications+from+the+console&amp;description=Sometimes+you+run+a+task+from+the+console+which+takes+a+while.+%28E.g.%3A+compiling+some+programs%2C+downloading+something+from+the+internet+or+installing+updates.%29+Often+you+do+not+wait+until...&amp;tags=console%2Cnotification%2Cnotify%2Cterminal%2CUbuntu%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Ubuntu: Using Skype with web cam</title>
		<link>http://blog.thehippo.de/2010/07/tools-and-software/ubuntu-using-skype-with-web-cam/</link>
		<comments>http://blog.thehippo.de/2010/07/tools-and-software/ubuntu-using-skype-with-web-cam/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 12:32:42 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[Tools and Software]]></category>
		<category><![CDATA[Cheese]]></category>
		<category><![CDATA[Skype]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu 10.04]]></category>
		<category><![CDATA[v4l]]></category>
		<category><![CDATA[Video4Linux]]></category>
		<category><![CDATA[web cam]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=291</guid>
		<description><![CDATA[Back in the days where I used Windows having video and audio conversations with Skype was really easy. Just plug in all the devices and configure the volume of the microphone and you are done. Today I tried the same with my Ubuntu 10.04 installation and I encountered a few problems. This is how I got my [...]]]></description>
			<content:encoded><![CDATA[<p>Back in the days where I used Windows having video and audio conversations with <a title="Skype" href="http://www.skype.com" target="_blank">Skype</a> was really easy. Just plug in all the devices and configure the volume of the microphone and you are done.</p>
<p>Today I tried the same with my <a title="Ubuntu" href="http://www.ubuntu.com" target="_blank">Ubuntu</a> 10.04 installation and I encountered a few problems. This is how I got my webcam working with Skype:<span id="more-291"></span></p>
<ul>
<li>Check if your web cam is working in general. The program <a title="Cheese" href="http://projects.gnome.org/cheese/" target="_blank">Cheese</a> is quite suitable for this task.</li>
<li>Test if Skype works with you cam. Open the options dialogue, go to &#8220;Video&#8221; and click test. If you see yourself, everything is fine <img src='http://blog.thehippo.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>Otherwise create a shell script with the following content:
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re3">#!/bin/bash</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">LD_PRELOAD=</span>/usr/lib/libv4l/v4l1compat.so &nbsp;/usr/bin/skype</div>
</li>
</ol>
</div>
<p>This script forces Skype to use the <a title="Video 4 Linux" href="http://linuxtv.org/v4lwiki/" target="_blank">Video4Linux</a> drivers instead of the native ones.</li>
<li>If you got this error like this:<br />
<blockquote><p>X Error, request 132, minor 18, error code 8 BadMatch (invalid parameter attributes)</p></blockquote>
<p>Modify you script this way:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re3">#!/bin/bash</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">export</span> <span class="re2">XLIB_SKIP_ARGB_VISUALS=</span><span class="nu0">1</span> skype</div>
</li>
<li class="li1">
<div class="de1"><span class="re2">LD_PRELOAD=</span>/usr/lib/libv4l/v4l1compat.so &nbsp;/usr/bin/skype</div>
</li>
</ol>
</div>
</li>
<li>Whenever you start Skype and want to use your web cam use this script to start Skype.</li>
</ul>
<p>P.S.: If you are on a 64bit system you probably need to do this:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re3">#!/bin/bash</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">LD_PRELOAD=</span>/usr/lib64/libv4l/v4l1compat.so &nbsp;/usr/bin/skype</div>
</li>
</ol>
</div>
 <p><a href="http://blog.thehippo.de/?flattrss_redirect&amp;id=291&amp;md5=139679544289cd599c222a2d6a347621" title="Flattr" target="_blank"><img src="http://blog.thehippo.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2010/07/tools-and-software/ubuntu-using-skype-with-web-cam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=TheHippo&amp;popout=1&amp;url=http%3A%2F%2Fblog.thehippo.de%2F2010%2F07%2Ftools-and-software%2Fubuntu-using-skype-with-web-cam%2F&amp;language=en_GB&amp;category=text&amp;title=Ubuntu%3A+Using+Skype+with+web+cam&amp;description=Back+in+the+days+where+I+used+Windows+having+video+and%C2%A0audio+conversations+with+Skype+was%C2%A0really+easy.+Just+plug+in+all+the+devices+and+configure+the+volume+of+the+microphone+and...&amp;tags=Cheese%2CSkype%2CUbuntu%2CUbuntu+10.04%2Cv4l%2CVideo4Linux%2Cweb+cam%2Cblog" type="text/html" />
	</item>
		<item>
		<title>How to run VMware Server under Ubuntu 10.04 LTS</title>
		<link>http://blog.thehippo.de/2010/06/server/vmware-server-ubuntu-10-04/</link>
		<comments>http://blog.thehippo.de/2010/06/server/vmware-server-ubuntu-10-04/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 10:10:16 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Tools and Software]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu 10.04]]></category>
		<category><![CDATA[virtual server]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[vmware server]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=258</guid>
		<description><![CDATA[A while ago I used VMware server to running a few virtual instances for testing purposes. Everything worked really flawless. Yesterday I wanted to have some virtual server on my home computer again and encountered many problem with the current version of VMware Server on my Ubuntu 10.04 LTS. There where some problems with the [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I used <a title="VMware server" href="http://www.vmware.com/products/server/" target="_blank">VMware server</a> to running a few virtual instances for testing purposes. Everything worked really flawless. Yesterday I wanted to have some virtual server on my home computer again and encountered many problem with the current version of VMware Server on my Ubuntu 10.04 LTS.<br />
There where some problems with the installation, some to get the VMware console running and also a few the keyboard input on the console.</p>
<p>It took a while to get everything running and I pulled all the information I needed from many different sites. So pulled them all together in this blog entry:<span id="more-258"></span></p>
<ol>
<li>Register at the VMware page. Download the package for VMware server as *.tar.gz. Extract the archive.</li>
<li>Current VMware products do not support the Linux kernel 2.6.32. Therefor you need a patch for the installation archive. Download the patch from the following link and extract it in the parent folder of you VMware download: <a href="http://codebin.cotescu.com/vmware/vmware-server-2.0.x-kernel-2.6.3x-install.sh" target="_blank">VMware patch for Linux kernel 2.6.32</a>. More information could found on <a title="VMware and Linux kernel 2.6.32" href="http://communities.vmware.com/message/1401588#1401588" target="_blank">this page</a> and pages linked on this page.</li>
<li>Run the script with super-user rights. It is quite simple to install. Most of the times you could just hit enter for every question of the installer. At one point the installer ask for a system user which runs the Vmware instances. If you leave it at the default choice, root will be the user. Make sure you have password to log in as root user. (You can set a root password by running the following command on a terminal:<br />
<blockquote><p>sudo passwd root</p></blockquote>
</li>
<li>If you are running a new Ubuntu system you might have get a <a title="Firefox" href="http://www.mozilla-europe.org/en/firefox/" target="_blank">Firefox</a> version &gt;= 3.6. In these versions the VMware console plugin for the browser won&#8217;t work, so download a older version of Firefox from <a title="Older Firefox version download" href="http://www.mozilla.com/en-US/firefox/all-older.html" target="_blank">this page</a> (3.5.9 should be highest working version number).<br />
Extract it somewhere and run it:</p>
<blockquote><p>./firefox -no-remote -P</p></blockquote>
<p>You might create a new Firefox profile (<em>-P</em>) and make sure a new instance of the Firefox is starting (<em>-no-remote</em>)</li>
<li>On a few guest operating systems you might have some trouble with some of the arrow keys of you keyboard. To get them working run this command from a terminal:<br />
<blockquote><p>sudo echo &#8220;xkeymap.nokeycodeMap = true&#8221; &gt;&gt;  /etc/vmware/config</p></blockquote>
<p>You need to run this on the computer where you want to start the VMware console. More Informations could be found <a title="Arrow keys in VMware console" href="http://ubuntuforums.org/showthread.php?t=1116511" target="_blank">here</a>.</li>
<li>Browse to you VMware administration panel (<a title="VMware adminstration panel" href="http://localhost:8222" target="_blank">http://localhost:8222</a> or <a title="VMware adminstration panel" href="https://localhost:8333" target="_blank">https://localhost:8333</a>). Create and start a virtual machine. Install the browser plug-in. Launch the console.</li>
</ol>
<div id="attachment_270" class="wp-caption aligncenter" style="width: 610px"><a href="http://blog.thehippo.de/wp-content/uploads/2010/06/screenshot1.png"><img class="size-large wp-image-270" title="VMware admin &amp; console" src="http://blog.thehippo.de/wp-content/uploads/2010/06/screenshot1-1024x566.png" alt="VMware admin &amp; console" width="600" height="331" /></a><p class="wp-caption-text">VMware admin &amp; console</p></div>
 <p><a href="http://blog.thehippo.de/?flattrss_redirect&amp;id=258&amp;md5=46b743e67f91c06adf4c87d4dcd9c69d" title="Flattr" target="_blank"><img src="http://blog.thehippo.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2010/06/server/vmware-server-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=TheHippo&amp;popout=1&amp;url=http%3A%2F%2Fblog.thehippo.de%2F2010%2F06%2Fserver%2Fvmware-server-ubuntu-10-04%2F&amp;language=en_GB&amp;category=text&amp;title=How+to+run+VMware+Server+under+Ubuntu+10.04+LTS&amp;description=A+while+ago+I+used+VMware+server+to+running+a+few+virtual+instances+for+testing+purposes.+Everything+worked+really+flawless.+Yesterday+I+wanted+to+have+some+virtual+server+on+my...&amp;tags=Firefox%2CUbuntu%2CUbuntu+10.04%2Cvirtual+server%2Cvmware%2Cvmware+server%2Cblog" type="text/html" />
	</item>
		<item>
		<title>JavaScript curiosity: mixing function and global scope</title>
		<link>http://blog.thehippo.de/2010/05/programming/javascript-curiosity-mixing-function-and-global-scope/</link>
		<comments>http://blog.thehippo.de/2010/05/programming/javascript-curiosity-mixing-function-and-global-scope/#comments</comments>
		<pubDate>Mon, 31 May 2010 15:05:46 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[curiosity]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[scope]]></category>
		<category><![CDATA[var]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=237</guid>
		<description><![CDATA[I am developing with JavaScript for a while and I am used to a lot of it quirks. But even after years of using this language you still find new curiosities. Today a struggled a while with this one. Considering this piece of JavaScript code: var i = 10; function foo&#40;&#41; &#123; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>I am developing with <a title="JavaScript" href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a> for a while and I am used to a lot of it quirks. But even after years of using this language you still find new curiosities. Today a struggled a while with this one.<br />
Considering this piece of JavaScript code:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> i = <span class="nu0">10</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">function</span> foo<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; i++; <span class="co1">// i is now 11</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;foo1: &quot;</span>+i<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; i = <span class="nu0">0</span>; <span class="co1">// i is now 0</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;foo2: &quot;</span>+i<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span>;</div>
</li>
<li class="li1">
<div class="de1">console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;global1: &quot;</span>+i<span class="br0">&#41;</span>; <span class="co1">// should be 10</span></div>
</li>
<li class="li1">
<div class="de1">foo<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;global2: &quot;</span>+i<span class="br0">&#41;</span>; <span class="co1">// and now 0</span></div>
</li>
</ol>
</div>
<p>Ok. That&#8217;s fine. Now we change the code a little bit to this one:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> i = <span class="nu0">10</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">function</span> foo<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; i++; <span class="co1">// is now 11</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;foo1: &quot;</span>+i<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> i = <span class="nu0">0</span>; <span class="co1">//create a new variable with value 0</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;foo2: &quot;</span>+i<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span>;</div>
</li>
<li class="li1">
<div class="de1">console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;global1: &quot;</span>+i<span class="br0">&#41;</span>; <span class="co1">// expect: 10</span></div>
</li>
<li class="li1">
<div class="de1">foo<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;global2: &quot;</span>+i<span class="br0">&#41;</span>; <span class="co1">// expect: 11</span></div>
</li>
</ol>
</div>
<p>What do you expect? I was quite surprised:<span id="more-237"></span></p>
<blockquote><p>global1: 10<br />
foo1: NaN<br />
foo2: 0<br />
global2: 10</p></blockquote>
<p>Why do we get a <strong>Not a Number</strong>? Why is JavaScript not using the global var as in the first example? Why is the global variable <strong>i</strong> not increased, the operation took place before the declaration of the local variable <strong>i</strong>? JavaScript has some &#8220;strange&#8221; rules about variable declaration. Every variable declared within a function is initialised at the beginning of the function, so our function actually would look like this:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> i = <span class="nu0">10</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">function</span> foo<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> i; <span class="co1">//undefined</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; i++; <span class="co1">// undefined + 1 = NaN</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;foo1: &quot;</span>+i<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; i = <span class="nu0">0</span>; <span class="co1">//and now 0</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;foo2: &quot;</span>+i<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span>;</div>
</li>
<li class="li1">
<div class="de1">console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;global1: &quot;</span>+i<span class="br0">&#41;</span>; <span class="co1">//10</span></div>
</li>
<li class="li2">
<div class="de2">foo<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;global2: &quot;</span>+i<span class="br0">&#41;</span>;<span class="co1">//still 10, because global i has not changed</span></div>
</li>
</ol>
</div>
<p>Looking into the rules of <a title="JSLint" href="http://www.jslint.com/" target="_blank">JSLint</a> which helps to verify JavaScript code to improve the quality of your JavaScript you get a few rules how to safely declare variables:</p>
<ul>
<li>JavaScript allows var definitions to occur anywhere within a function. JSLint is more strict.</li>
<li>JSLint expects that a var will be declared only once, and that it will be declared before it is used.</li>
<li>JSLint expects that a function will be declared before it is used.</li>
<li>JSLint expects that parameters will not also be declared as vars.</li>
<li>JSLint does not expect the arguments array to be declared as a var.</li>
<li>JSLint does not expect that a var will be defined in a block. This is because JavaScript blocks do not have block scope. This can have unexpected consequences. Define all variables at the top of the function.</li>
</ul>
<p>So Remember:<strong> Variables are not initialised when they are declared!</strong></p>
<p>Links:</p>
<ul>
<li>all <a title="JSLint rules" href="http://www.jslint.com/lint.html" target="_blank">JSLint rules</a> for quality JavaScript code.</li>
<li><a title="WTFJS.com" href="http://wtfjs.com/" target="_blank">WTFJS.com</a>, a page collection all kinds of JavaScript curiosities.</li>
</ul>
 <p><a href="http://blog.thehippo.de/?flattrss_redirect&amp;id=237&amp;md5=aa45624cf1377829231e02d8989c8199" title="Flattr" target="_blank"><img src="http://blog.thehippo.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2010/05/programming/javascript-curiosity-mixing-function-and-global-scope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=TheHippo&amp;popout=1&amp;url=http%3A%2F%2Fblog.thehippo.de%2F2010%2F05%2Fprogramming%2Fjavascript-curiosity-mixing-function-and-global-scope%2F&amp;language=en_GB&amp;category=text&amp;title=JavaScript+curiosity%3A+mixing+function+and+global+scope&amp;description=I+am+developing+with+JavaScript+for+a+while+and+I+am+used+to+a+lot+of+it+quirks.+But+even+after+years+of+using+this+language+you+still+find+new...&amp;tags=curiosity%2Cfunction%2Cglobal%2CJavaScript%2Cscope%2Cvar%2Cvariable%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Moved to GitHub</title>
		<link>http://blog.thehippo.de/2010/03/general/moved-to-github-2/</link>
		<comments>http://blog.thehippo.de/2010/03/general/moved-to-github-2/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 16:27:55 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tools and Software]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[hxGD]]></category>
		<category><![CDATA[hxJson2]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[source controll]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=221</guid>
		<description><![CDATA[I have been interested in git for a while and played around with it a few times and past. Yesterday I finally moved my two open source haXe libraries (hxJson2 and hxGD) to GitHub. (hxGD was hosted on Google Code before.) I really like the ideas of the work flow of git and seriously thinking [...]]]></description>
			<content:encoded><![CDATA[<p>I have been interested in <a title="git" href="http://git-scm.com/" target="_blank">git</a> for a while and played around with it a few times and past.</p>
<p>Yesterday I finally moved my two open source haXe libraries (<a title="hxJson2" href="http://github.com/TheHippo/hxJson2" target="_blank">hxJson2</a> and <a title="hxGD" href="http://github.com/TheHippo/hxGD" target="_blank">hxGD</a>) to GitHub. (hxGD was hosted on Google Code before.) I really like the ideas of the work flow of git and seriously thinking about moving all my private Subversion repositories into git repositories, since there are well working tools to even <a title="git-svn" href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html" target="_blank">import</a> history and branches.</p>
 <p><a href="http://blog.thehippo.de/?flattrss_redirect&amp;id=221&amp;md5=071bda6ac4171d1785c7cadb0c57e361" title="Flattr" target="_blank"><img src="http://blog.thehippo.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2010/03/general/moved-to-github-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=TheHippo&amp;popout=1&amp;url=http%3A%2F%2Fblog.thehippo.de%2F2010%2F03%2Fgeneral%2Fmoved-to-github-2%2F&amp;language=en_GB&amp;category=text&amp;title=Moved+to+GitHub&amp;description=I+have+been+interested+in+git+for+a+while+and+played+around+with+it+a+few+times+and+past.+Yesterday+I+finally+moved+my+two+open+source+haXe+libraries+%28hxJson2...&amp;tags=git%2CGitHub%2ChxGD%2ChxJson2%2Copen+source%2Csource+controll%2CSubversion%2Csvn%2Cblog" type="text/html" />
	</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.686 seconds -->
<!-- Cached page served by WP-Cache -->

