<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D04ER307fCp7ImA9WhBWFUw.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654</id><updated>2013-04-09T15:58:26.304+02:00</updated><category term="Fedora" /><category term="xvid" /><category term="GWT" /><category term="9.10" /><category term="Flash memory" /><category term="AJAX" /><category term="upgrade" /><category term="eeepc" /><category term="HTTP" /><category term="kernel.org" /><category term="JDeveloper" /><category term="webserver" /><category term="iphone" /><category term="Asus" /><category term="configuration" /><category term="shell" /><category term="python" /><category term="ifuse" /><category term="avi" /><category term="Mac" /><category term="debian" /><category term="video" /><category term="AMD" /><category term="catalyst" /><category term="yaourt" /><category term="jolicloud" /><category term="database" /><category term="share" /><category term="apache" /><category term="linux" /><category term="driver" /><category term="xml" /><category term="packages" /><category term="router" /><category term="Linux Mint" /><category term="Multimedia" /><category term="silverlight" /><category term="php" /><category term="Javascript" /><category term="convert" /><category term="programming" /><category term="network boot" /><category term="Java" /><category term="Arch Linux" /><category term="bash" /><category term="google web toolkit" /><category term="samsung" /><category term="xbox360" /><category term="NAT" /><category term="pacman" /><category term="android" /><category term="wireless" /><category term="1201n" /><category term="kernel" /><category term="ATI" /><category term="rescue system" /><category term="Hardware" /><category term="concrete5" /><category term="Ubuntu" /><category term="Langton" /><category term="ipod touch" /><category term="network bootloader" /><category term="error" /><category term="Ant" /><category term=".NET" /><title>bgaechter - blog</title><subtitle type="html">About Linux, hardware and other things</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.bgaechter.ch/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>54</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Bgaechter-Blog" /><feedburner:info uri="bgaechter-blog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DkcFR3k_cCp7ImA9WhNTFUs.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-298342103419639363</id><published>2012-10-18T14:40:00.001+02:00</published><updated>2012-10-18T14:40:16.748+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-18T14:40:16.748+02:00</app:edited><title>Netbeans 7.3 crashes on fedora 17</title><content type="html">After installing the new netbeans 7.3 i noticed that it often (almost always) crashes while starting up. Sometimes it doesn't even show a splash screen.&lt;br /&gt;

&lt;div&gt;
I figured out that this is because of the openJDK. After installing and setting up Oracles JDK everything worked fine.&lt;/div&gt;

&lt;div&gt;
Download the latest JDK from &lt;a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" target="_blank"&gt;oracle&lt;/a&gt;. And install the package it using rpm.&lt;/div&gt;

&lt;div&gt;&lt;pre class="python" name="code"&gt;
rpm -Uvh jdk-*&lt;/div&gt;
&lt;/pre&gt;

&lt;div&gt;
Then install it with the alternatives command&lt;/div&gt;

&lt;div&gt;
&lt;pre class="python" name="code"&gt;## java ##
alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_07/jre/bin/java 20000
## javaws ##
alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_07/jre/bin/javaws 20000
 
## Java Browser (Mozilla) Plugin 32-bit ##
alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/jdk1.7.0_07/jre/lib/i386/libnpjp2.so 20000
 
## Java Browser (Mozilla) Plugin 64-bit ##
alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/jdk1.7.0_07/jre/lib/amd64/libnpjp2.so 20000
 
## Install javac only if you installed JDK (Java Development Kit) package ##
alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0_07/bin/javac 20000
alternatives --install /usr/bin/jar jar /usr/java/jdk1.7.0_07/bin/jar 20000&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
Now you can set up Oracles JDK as your default java runtime using this command.&lt;/div&gt;

&lt;pre class="python" name="code"&gt;
alternatives --config java
&lt;/pre&gt;
&lt;div&gt;
Try to start Netbeans, it should start without crashing or freezing.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/WVqpS_8qzQw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/298342103419639363/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2012/10/netbeans-73-crashes-on-fedora-17.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/298342103419639363?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/298342103419639363?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/WVqpS_8qzQw/netbeans-73-crashes-on-fedora-17.html" title="Netbeans 7.3 crashes on fedora 17" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2012/10/netbeans-73-crashes-on-fedora-17.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEFR3k7fSp7ImA9WhNTFUs.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-7955548039058936737</id><published>2012-10-18T14:32:00.002+02:00</published><updated>2012-10-18T14:33:36.705+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-18T14:33:36.705+02:00</app:edited><title>Find all backup files (ending with ~) in your home directory</title><content type="html">Every Linux users who edits text files using some "traditional" editors like vi, emacs, kate or gedit will find some backup files which end with ~ in his directory. These files are not really needed anymore and can be deleted. I personally like to look at these files before i delete them. This is a simple script to find these files and show their size.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class="python" name="code"&gt;
for i in $(find ~ -name '*~'); do echo ${i}; stat -c %s ${i}; done
&lt;/pre&gt;
&lt;div&gt;
If you don't need this files anymore you can delete them with this command&lt;/div&gt;
&lt;pre class="python" name="code"&gt;
find ~ -name '*~' | xargs rm
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/C1XXmXIcMKI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/7955548039058936737/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2012/10/find-all-backup-files-ending-with-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/7955548039058936737?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/7955548039058936737?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/C1XXmXIcMKI/find-all-backup-files-ending-with-in.html" title="Find all backup files (ending with ~) in your home directory" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2012/10/find-all-backup-files-ending-with-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEERHc-eip7ImA9WhNTFUs.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-6663575587608213487</id><published>2012-10-03T12:52:00.000+02:00</published><updated>2012-10-18T14:33:25.952+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-18T14:33:25.952+02:00</app:edited><title>Fork bomb</title><content type="html">This is nothing useful though i think it's&amp;nbsp;interesting. As i saw it, it reminded me of one of my first batch files: The i&lt;a href="http://www.instructables.com/id/GREAT-COMPUTER-PRANKS--computer-commands-using/step4/Fork-Bomb-BATCH/" target="_blank"&gt;nfinite loop of starting new command&lt;/a&gt; prompts. But this one is much more elegant.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="python" name="code"&gt;:() { : | :&amp;amp; };:
&lt;/pre&gt;
&lt;br /&gt;
The code declares a function called : which calls itself two times using a pipe. At the end you call : again. This leads to an exponential spawn of new processes. It won't finish unless there your system can't spawn more processes and this only happens if you run out of&amp;nbsp;resources. That could force you to restart your computer. As i said nothing useful...&lt;br /&gt;
&lt;br /&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/_W8wxnXgObk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/6663575587608213487/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2012/10/fork-bomb.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/6663575587608213487?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/6663575587608213487?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/_W8wxnXgObk/fork-bomb.html" title="Fork bomb" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2012/10/fork-bomb.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYCRHY6cSp7ImA9WhJVEEo.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-6015176702316535816</id><published>2012-08-27T16:36:00.000+02:00</published><updated>2012-08-27T16:36:05.819+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-08-27T16:36:05.819+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GWT" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title>Trigo Calc released</title><content type="html">TrigoCalc is a tool which uses trigonometry formulas to find the missing numbers in a triangle. TrigoCalc doesn't just provide the results it also shows the computations in a human readable format. Therefore it's specially useful for students.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://trigocalc.bgaechter.ch/images/upload/tc_screenshot_windows_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="267" src="http://trigocalc.bgaechter.ch/images/upload/tc_screenshot_windows_1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
There is an offline version, which requires jre 7 but there is also an online version that just requires a browser. The online version also runs on smart phones.&lt;br /&gt;
&lt;a href="http://trigocalc.bgaechter.ch/" target="_blank"&gt;View the TrigoCalc website.&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/MoW1ghIZN3s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/6015176702316535816/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2012/08/trigo-calc-released.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/6015176702316535816?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/6015176702316535816?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/MoW1ghIZN3s/trigo-calc-released.html" title="Trigo Calc released" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2012/08/trigo-calc-released.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUFSH09fSp7ImA9WhJQFEU.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-8165596968557518075</id><published>2012-07-26T11:24:00.001+02:00</published><updated>2012-07-28T16:53:39.365+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-28T16:53:39.365+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="webserver" /><category scheme="http://www.blogger.com/atom/ns#" term="HTTP" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title>Django syncdb can't create super user</title><content type="html">I was just setting up a new webpage using the django framework. But as i used the syncdb command (which creates the database and also adds a superuser) i received this error:&lt;br /&gt;
&lt;pre class="python" name="code"&gt;File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/management/__init__.py", line 85, in get_system_username    
return getpass.getuser().decode(locale.getdefaultlocale()[1])&lt;/pre&gt;
&lt;br /&gt;
The site was working normal but i couldn't add any content without a super user account.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="python" name="code"&gt;
manage.py createsuperuser --username=joe --email=joe@example.com
&lt;/pre&gt;
Didn't help a lot since i received the same error. So i used the shell to create a user manually:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="python" name="code"&gt;
$ python manage.py shell
&gt;&gt;&gt; from django.contrib.auth.models import User
&gt;&gt;&gt; users = User.objects.all()
&gt;&gt;&gt; users
[]
&lt;/pre&gt;
&lt;br /&gt;
No users here, so let's create a new superuser.
&lt;br /&gt;
&lt;pre class="python" name="code"&gt;
&gt;&gt;&gt; u = User.objects.create_user('benny', 'benny@bgaechter.ch', 'bennypw')
&gt;&gt;&gt; u.is_staff &amp;nbsp;= &amp;nbsp;True
&gt;&gt;&gt; u.is_superuser = True
&gt;&gt;&gt; u.save()
&lt;/pre&gt;
Now you should be able to login. Note: You should not use the "set_password" function to change a users password. There is a special command for that:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="python" name="code"&gt;
manage.py changepassword username
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/0nr00094RZ8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/8165596968557518075/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2012/07/django-cant-create-superuser.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/8165596968557518075?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/8165596968557518075?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/0nr00094RZ8/django-cant-create-superuser.html" title="Django syncdb can't create super user" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2012/07/django-cant-create-superuser.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04HQHo8fCp7ImA9WhJSGE8.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-8327729865723862966</id><published>2012-07-03T10:59:00.002+02:00</published><updated>2012-07-09T11:25:31.474+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-09T11:25:31.474+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title>Netbeans: JVM creation failed</title><content type="html">&lt;span style="font-family: inherit;"&gt;Netbeans seems to have a problem if your 64 bit system has more than 4 GB RAM. Obviously it can't address the memory and quits with "JVM creation failed".&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: inherit;"&gt;The solution is very easy. Just go to the netbeans.conf file. On Linux this is typically in the /etc directory. On Windows you have a folder called etc in your application folder (should be in C:\Program Files (x86)\Netbeans ). Open it with your preferred editor and add &lt;/span&gt;&lt;b&gt;&lt;span style="font-family: inherit;"&gt;-J-Xmx512m&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: inherit;"&gt; to &lt;/span&gt;&lt;b&gt;&lt;span style="font-family: inherit;"&gt;netbeans_default_options&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: inherit;"&gt; (at line 6). It should now look like this:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class="python" name="code"&gt;netbeans_default_options=".... -JDsun.zip.disableMemoryMapping=true -J-Xmx512m"&lt;/pre&gt;
&lt;br /&gt;
Save and close the file and Netbeans should start again.&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/phGVC-xd9Us" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/8327729865723862966/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2012/07/netbeans-jvm-creation-failed.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/8327729865723862966?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/8327729865723862966?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/phGVC-xd9Us/netbeans-jvm-creation-failed.html" title="Netbeans: JVM creation failed" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2012/07/netbeans-jvm-creation-failed.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8AQHk_eCp7ImA9WhVQFk4.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-5806505564808752286</id><published>2012-04-05T15:00:00.001+02:00</published><updated>2012-04-05T15:00:41.740+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-05T15:00:41.740+02:00</app:edited><title>KDE Shut down, Log out and Restart not working</title><content type="html">As I switched to KDE a few days ago, the Shut down didn't work. I found out that this is because of some strange interaction between the sound system and the log out mechanism. However to avoid this bug just disable the log out sound in your system settings.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-fM9mhbwpeAE/T32W6KDwnWI/AAAAAAAAAV4/iu72SL4NTRw/s1600/snapshot1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="181" src="http://4.bp.blogspot.com/-fM9mhbwpeAE/T32W6KDwnWI/AAAAAAAAAV4/iu72SL4NTRw/s320/snapshot1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
Go to System settings -&amp;gt;Notifications -&amp;gt;Select KDE Workspace in the Event Source drop down menu and disable the logout sound.&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/CjWxcjY2UNo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/5806505564808752286/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2012/04/kde-shut-down-log-out-and-restart-not.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/5806505564808752286?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/5806505564808752286?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/CjWxcjY2UNo/kde-shut-down-log-out-and-restart-not.html" title="KDE Shut down, Log out and Restart not working" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-fM9mhbwpeAE/T32W6KDwnWI/AAAAAAAAAV4/iu72SL4NTRw/s72-c/snapshot1.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2012/04/kde-shut-down-log-out-and-restart-not.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMMRnw-cSp7ImA9WhVQEkw.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-5018497004697513538</id><published>2012-03-31T18:14:00.001+02:00</published><updated>2012-03-31T18:14:47.259+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-03-31T18:14:47.259+02:00</app:edited><title>Use trend lines in Numbers</title><content type="html">We had a physics experiment and I used Numbers on my Macbook to write down the results. I created a scatter diagram out of the data. Now i wanted to lay a trendline (also known as line of best fit) through the points. Numbers hide this function a little bit but i finally found it here.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-FEviBzNaBZQ/T3ctQ8q22_I/AAAAAAAAAVk/8ilnk1Fnhw4/s1600/Bildschirmfoto+2012-03-31+um+18.09.12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-FEviBzNaBZQ/T3ctQ8q22_I/AAAAAAAAAVk/8ilnk1Fnhw4/s320/Bildschirmfoto+2012-03-31+um+18.09.12.png" width="121" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Open the informations menu, click on your diagram and expand it. You will see the options for trend lines(linear, logarithmic, exponential, etc.) and failure correction.&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/iJswASzd1BM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/5018497004697513538/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2012/03/use-trend-lines-in-numbers.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/5018497004697513538?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/5018497004697513538?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/iJswASzd1BM/use-trend-lines-in-numbers.html" title="Use trend lines in Numbers" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-FEviBzNaBZQ/T3ctQ8q22_I/AAAAAAAAAVk/8ilnk1Fnhw4/s72-c/Bildschirmfoto+2012-03-31+um+18.09.12.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2012/03/use-trend-lines-in-numbers.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4CRng_fSp7ImA9WhVSFEg.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-6353309464944847126</id><published>2012-03-10T13:12:00.000+01:00</published><updated>2012-03-11T09:36:07.645+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-03-11T09:36:07.645+01:00</app:edited><title>Import images from Canon camera on Gentoo</title><content type="html">I found a very nice tool to import my images from my camera. I have to use this tool because my Canon EOS 40D can't be mounted for some reason. That's how it looks when i try to mount:&lt;br /&gt;
&lt;pre class="python" name="code"&gt;
gvfs-mount "gphoto2://[usb:003,018]/" 
Error mounting location: volume doesn't implement mount
&lt;/pre&gt;
&lt;br /&gt;
Install gphoto2&lt;br /&gt;
&lt;pre class="python" name="code"&gt;emerge gphoto2

&lt;/pre&gt;
&lt;br /&gt;
Then go to the directory where you want to import your files, make sure your camera is detected correctly and execute this command&lt;br /&gt;
&lt;pre class="python" name="code"&gt;gphto2 --auto-detect
gphoto2 -P
&lt;/pre&gt;
That's all.&lt;br /&gt;
&lt;br /&gt;
But gphoto can do much more. You can, for example, see how many images you took with the camera, change the whole configuration or capture images directly from your computer. It's worth to read the man page&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/u7v6VeGTj2c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/6353309464944847126/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2012/03/import-images-from-canoncamera-on.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/6353309464944847126?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/6353309464944847126?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/u7v6VeGTj2c/import-images-from-canoncamera-on.html" title="Import images from Canon camera on Gentoo" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2012/03/import-images-from-canoncamera-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUADQHYyfCp7ImA9WhVTGEs.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-1818997808325279693</id><published>2012-02-14T18:52:00.000+01:00</published><updated>2012-03-04T14:29:31.894+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-03-04T14:29:31.894+01:00</app:edited><title>Install Spotify on Gentoo</title><content type="html">Spotify currently offers stable Windows and Mac OS X version and a unstable Linux release.&lt;br /&gt;
You can choose to run the unstable linux client or the windows client using wine. I tried both.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The Linux release&lt;/b&gt;&lt;br /&gt;
If you choose the Linux release you can choose between a deb and a rpm package. Both should work the sam way. I went with the deb package because I am already familiar with that format. Just unpack it and place everything as it is in the archived folders:&lt;br /&gt;
&lt;pre class="python" name="code"&gt;ar vx spotify-client-qt_0.6.6.10.gbd39032.58-1_amd64.deb
tar -xzvf data.tar.gz
cp -r ./usr/* /usr/
&lt;/pre&gt;
Then try to start spotify:&lt;br /&gt;
&lt;pre class="python" name="code"&gt;spotify
&lt;/pre&gt;
Got libssl error? Gentoo comes already with the new version while spotify requiers an older one. Just install it as a slot:&lt;br /&gt;
&lt;pre class="python" name="code"&gt;emerge openssl:0.9.8
&lt;/pre&gt;
Now run it again. A login screen pops up. After the login in, spotify crashes. So Linux version is, at least here, not just unstable it's unusable.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The Windows release with Wine&lt;/b&gt;&lt;br /&gt;
I downloaded the windows binary and tried to install it with wine. The setup worked and at the end of the installation I got a desktop icon. After a double click on it the login screen pops up and as I enter my credentials spotify crashes, again.&lt;br /&gt;
&lt;br /&gt;
Looks like I have to wait until I can use spotify here....&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color: red;"&gt;UPDATE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;The unofficial Ebuild&lt;/b&gt;&lt;br /&gt;
I started searching the web for a solution. Finally I found a Ebuild that works fine. Just &lt;a href="http://gpo.zugaina.org/media-sound/spotify/"&gt;download&lt;/a&gt; it and follow the &lt;a href="http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=3&amp;amp;chap=5#doc_chap2"&gt;Gentoo handbook&lt;/a&gt;.&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/1434dUzM4H4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/1818997808325279693/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2012/02/install-spotify-on-gentoo.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/1818997808325279693?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/1818997808325279693?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/1434dUzM4H4/install-spotify-on-gentoo.html" title="Install Spotify on Gentoo" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2012/02/install-spotify-on-gentoo.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UNQ3s7cSp7ImA9WhRUEk4.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-2088590359908771785</id><published>2012-01-22T14:33:00.000+01:00</published><updated>2012-01-22T14:34:52.509+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-22T14:34:52.509+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="concrete5" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><title>Concrete5 display attribute using php block</title><content type="html">&lt;br /&gt;
&lt;pre class="php" name="code"&gt;//Create a User object (of the current User)
$u = new User();
//Creat a UserInfo object with the user ID
$ui = UserInfo::getByID($u-&amp;gt;getUserID());
//Get the Value of your user Attribute
$value = $ui-&amp;gt;getAttribute('YourAttributeName');
//Print it out
echo "Your Value: ".$value;
&lt;/pre&gt;
&lt;br /&gt;
That's a simple example on how to use your (custom) attributes in concrete5. For furhter information consult the &lt;a href="http://www.concrete5.org/documentation/developers/permissions/users/"&gt;concrete5 documentation&lt;/a&gt;.&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/mdaAqItw6HA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/2088590359908771785/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2012/01/concrete5-display-attribute-using-php.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/2088590359908771785?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/2088590359908771785?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/mdaAqItw6HA/concrete5-display-attribute-using-php.html" title="Concrete5 display attribute using php block" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2012/01/concrete5-display-attribute-using-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEAQH08fSp7ImA9WhRWEk0.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-6435625475209645281</id><published>2011-12-30T00:50:00.001+01:00</published><updated>2011-12-30T00:50:41.375+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-30T00:50:41.375+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title>Eclipse auto complete is not working</title><content type="html">Today my Eclipse auto complete was turned off. I didn't change anything, but it decided not to work anymore. I went through the settings and finally turned it on again. To spare you the search here a screenshot:&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-JcdlnCxwnPg/Tvz8F-6AtOI/AAAAAAAAAOg/1JNI0vazblg/s1600/Bildschirmfoto+2011-12-30+um+00.46.29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/-JcdlnCxwnPg/Tvz8F-6AtOI/AAAAAAAAAOg/1JNI0vazblg/s400/Bildschirmfoto+2011-12-30+um+00.46.29.png" width="375" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Just set the tick at "Java Type Proposals" and it will work again.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/usbEzvGRVWI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/6435625475209645281/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/12/eclipse-auto-complete-is-not-working.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/6435625475209645281?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/6435625475209645281?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/usbEzvGRVWI/eclipse-auto-complete-is-not-working.html" title="Eclipse auto complete is not working" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-JcdlnCxwnPg/Tvz8F-6AtOI/AAAAAAAAAOg/1JNI0vazblg/s72-c/Bildschirmfoto+2011-12-30+um+00.46.29.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/12/eclipse-auto-complete-is-not-working.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUACSHk4eyp7ImA9WhRRFko.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-7736031861766368297</id><published>2011-11-26T23:40:00.001+01:00</published><updated>2011-11-30T18:22:49.733+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-30T18:22:49.733+01:00</app:edited><title>Run a minecraft server on Debian 6</title><content type="html">&lt;b&gt;Requirements&lt;/b&gt;&lt;br /&gt;
The Minecraft server is written in java, therefore java runtime environment is required. Check your java installation with this command:&lt;br /&gt;
&lt;pre class="python" name="code"&gt;java --version&lt;br /&gt;&lt;/pre&gt;
If you get an error message saying "command java not found" you can install java using this command:&lt;br /&gt;
&lt;pre class="python" name="code"&gt;apt-get install default-jre&lt;br /&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Installation&lt;/b&gt;&lt;br /&gt;
Let's start the installation. I would recommend to create a separate user for running the server. You should not use root to run the server for security reason.&lt;br /&gt;
&lt;pre class="python" name="code"&gt;useradd -m minecraft
passwd minecraft
&lt;/pre&gt;
Create a directory for the server and download as user "minecraft" the server software:&lt;br /&gt;
&lt;pre class="python" name="code"&gt;su minecraft
mkdir server
cd server
wget https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar?&lt;/pre&gt;
&lt;br /&gt;
Now you can run the server directly from here or you can use a script that helps you running the server in background. You can specify the maximun and minimun amount of RAM which is used by the server. But keep in mind that java produces an overhead. In my case it's about 40% to 60% (depending on runtime and connected users).&lt;br /&gt;
&lt;br /&gt;
And finally start your server:&lt;br /&gt;
&lt;pre class="python" name="code"&gt;java -Xms32M -Xmx1024M -jar minecraft_server.jar nogui&lt;/pre&gt;
I recommend to have at least 1024 Mb for your server.&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/HNauPcB2gVQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/7736031861766368297/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/11/run-minecraft-server-on-debian-6.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/7736031861766368297?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/7736031861766368297?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/HNauPcB2gVQ/run-minecraft-server-on-debian-6.html" title="Run a minecraft server on Debian 6" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/11/run-minecraft-server-on-debian-6.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0ABRXcyfSp7ImA9WhdbF0g.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-2307392098083974834</id><published>2011-10-13T00:20:00.000+02:00</published><updated>2011-10-16T11:02:34.995+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-16T11:02:34.995+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="Mac" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Alt Key doesn't work in Gedit on Mac OS X Lion</title><content type="html">I just installed Gedit on my Mac because it's my favorite text editor. After a while (to be exact as I wanted to comment out a line of python code) I noticed that the alt key doesn't work. I started a google search where I found a lot of websites recommending to change X11 settings or copy the Xmodmap around and other things. I tried everything but it didn't help. I still couldn't comment out that line. Another trial of google search brought me to the solution.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-xddNkPnX4rU/TpYSG7IVtxI/AAAAAAAAAMQ/nXtR20KPGNg/s1600/Bildschirmfoto+2011-10-13+um+00.17.20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="295" src="http://4.bp.blogspot.com/-xddNkPnX4rU/TpYSG7IVtxI/AAAAAAAAAMQ/nXtR20KPGNg/s320/Bildschirmfoto+2011-10-13+um+00.17.20.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
Right click in the edit area -&amp;gt; Input Methods -&amp;gt; Multipress&lt;/div&gt;
&lt;div&gt;
And finally I could comment out that line of code. Thanks to &lt;a href="http://old.nabble.com/Native-Mac-OS-X-GEdit-%3A-Option-key-doesn't-work.-td27518574.html"&gt;old Nabble.&lt;/a&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/NeC9a3kqVqY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/2307392098083974834/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/10/alt-key-doesnt-work-using-gedit-on-mac.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/2307392098083974834?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/2307392098083974834?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/NeC9a3kqVqY/alt-key-doesnt-work-using-gedit-on-mac.html" title="Alt Key doesn't work in Gedit on Mac OS X Lion" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-xddNkPnX4rU/TpYSG7IVtxI/AAAAAAAAAMQ/nXtR20KPGNg/s72-c/Bildschirmfoto+2011-10-13+um+00.17.20.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/10/alt-key-doesnt-work-using-gedit-on-mac.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0AFRHgzeyp7ImA9WhdUEUk.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-2326196021642608401</id><published>2011-09-27T18:41:00.000+02:00</published><updated>2011-09-27T18:41:55.683+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-27T18:41:55.683+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HTTP" /><category scheme="http://www.blogger.com/atom/ns#" term="configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="router" /><title>Swisscom “centro grande” dhcp dns problems</title><content type="html">&lt;br /&gt;
&lt;div style="background-color: transparent;"&gt;
&lt;span id="internal-source-marker_0.22177979699335992" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Today I couldn’t reach any web page. I discovered that i can reach servers through their IP but I can’t resolve their names. The DNS entry I receive via DHCP from my modem is my modem itself.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: transparent;"&gt;
&lt;span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;I changed it to a public DNS server (like 8.8.8.8 or 8.8.6.6 for the Google DNS servers) and: here we go. I was able to reach everything as usual. The strange thing: sometimes it works with the DNS assigned via DHCP. Wondering what’s wrong...&lt;/span&gt;&lt;/div&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/OHH65oxcoso" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/2326196021642608401/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/09/swisscom-centro-grande-dhcp-dns.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/2326196021642608401?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/2326196021642608401?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/OHH65oxcoso/swisscom-centro-grande-dhcp-dns.html" title="Swisscom “centro grande” dhcp dns problems" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/09/swisscom-centro-grande-dhcp-dns.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QCSHc_cCp7ImA9WhdVF0w.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-3838381153905735582</id><published>2011-09-22T17:04:00.000+02:00</published><updated>2011-09-22T21:22:49.948+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-22T21:22:49.948+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="Arch Linux" /><title>Arch Linux / Windows Dual Boot - Time Problems</title><content type="html">&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;I just installed Windows for some testing purposes on my machine. Of course as dual boot. I found out that the clock goes wrong every time I switch between Arch Linux and Windows. There are two ways to fix this problem:&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;
&lt;li&gt;Set Arch Linux to&amp;nbsp;local time and&amp;nbsp;remove&amp;nbsp;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span style="white-space: nowrap;"&gt;hwclock&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&amp;nbsp;from the&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span style="white-space: nowrap;"&gt;DAEMONS&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&amp;nbsp;array in&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span style="white-space: nowrap;"&gt;/etc/rc.conf&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&amp;nbsp;(Windows will take care of hardware clock corrections).&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Set Arch Linux to UTC, and make Windows use UTC too (a quick registry fix is needed, see&amp;nbsp;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span class="Apple-style-span" style="background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; outline-color: initial; outline-width: initial;"&gt;&lt;a href="https://help.ubuntu.com/community/UbuntuTime#Make_Windows_use_UTC"&gt;this page&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&amp;nbsp;for instructions). Also, be sure to prevent Windows from synchronizing the time with the Internet, as it will make the hardware clock use&amp;nbsp;localtime&amp;nbsp;again. If you want such functionality (NTP sync), you should use&amp;nbsp;openntpd&amp;nbsp;on your Arch Linux installation instead.&lt;/span&gt;&lt;/li&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/ul&gt;
&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;ul style="line-height: 1.5em; list-style-image: none; list-style-type: square; margin-bottom: 0px; margin-left: 1.5em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;
&lt;/ul&gt;
&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/apN-aIaBX_s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/3838381153905735582/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/09/arch-linux-windows-dual-boot-time.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/3838381153905735582?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/3838381153905735582?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/apN-aIaBX_s/arch-linux-windows-dual-boot-time.html" title="Arch Linux / Windows Dual Boot - Time Problems" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/09/arch-linux-windows-dual-boot-time.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYMQ345fyp7ImA9WhdWEEk.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-4521397292515590975</id><published>2011-09-03T10:56:00.001+02:00</published><updated>2011-09-03T10:56:22.027+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-03T10:56:22.027+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="webserver" /><category scheme="http://www.blogger.com/atom/ns#" term="HTTP" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="debian" /><title>WebSVN Access Control using htpasswd</title><content type="html">&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;If you do not need to do an advanced rights management (for example give different people rights for different repositories) the easiest way, in my opinion, is to set the access rights using a htpasswd file.
You need to create the file and add your user. Use the following command:&lt;/span&gt;&lt;br /&gt;
&lt;pre class="python" name="code"&gt;htpasswd -c /etc/apache2/dav_svn.passwd user&lt;br /&gt;&lt;/pre&gt;
Then you have to tell apache that you want to use this file for access control. This doesn’t happen in any of the virtual host files (you could probably do it there but it’s not the clean way). WebSVN comes with a file called apache.conf (located in /etc/websvn/apache.conf ) Just paste these lines at the bottom of the file:&lt;br /&gt;&lt;pre class="python" name="code"&gt;AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
&lt;/pre&gt;
And you’re done. Next time you visit your websvn website you will be asked for a user name and password.&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/CxDS3x3ntuY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/4521397292515590975/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/09/websvn-access-control-using-htpasswd.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/4521397292515590975?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/4521397292515590975?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/CxDS3x3ntuY/websvn-access-control-using-htpasswd.html" title="WebSVN Access Control using htpasswd" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/09/websvn-access-control-using-htpasswd.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcDR305fyp7ImA9WhdSGU4.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-3323234750423279765</id><published>2011-07-29T11:01:00.000+02:00</published><updated>2011-07-29T11:01:16.327+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-29T11:01:16.327+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="HTTP" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title>Read GET parameters using Javascript</title><content type="html">Reading get parameters with javascript can't be done using a default function. But it's quiet easy if you play around with window.location.href and some regular expressions. Here is my solution:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="java" name="code"&gt;function parseGet( name )
{
&amp;nbsp; name = name.replace(/[\[]/,"\\\[")
&amp;nbsp;&amp;nbsp;.replace(/[\]]/,"\\\]");
&amp;nbsp; var regexS = "[\\?&amp;amp;]"+name+"=([^&amp;amp;#]*)";
&amp;nbsp; var regex = new RegExp( regexS );
&amp;nbsp; var results = regex.exec( window.location.href );
&amp;nbsp; if( results == null )
&amp;nbsp; &amp;nbsp; return "";
&amp;nbsp; else
&amp;nbsp; &amp;nbsp; return results[1];
}
&lt;/pre&gt;Usage:&lt;br /&gt;
&lt;pre class="java" name="code"&gt;parseGet('getParam');
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/mnpaCCBIIyI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/3323234750423279765/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/07/read-get-parameters-using-javascript.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/3323234750423279765?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/3323234750423279765?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/mnpaCCBIIyI/read-get-parameters-using-javascript.html" title="Read GET parameters using Javascript" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/07/read-get-parameters-using-javascript.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8NQXc8fyp7ImA9WhZaE0k.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-7387938232623175709</id><published>2011-06-29T13:40:00.001+02:00</published><updated>2011-06-29T13:44:50.977+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-29T13:44:50.977+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="HTTP" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title>JavaFX 2.0 "Avoid The Red Balls"</title><content type="html">&lt;div class="MsoNormal"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US;"&gt;&lt;span style="font-family: inherit;"&gt;In a comment to my article „&lt;a href="http://blog.bgaechter.ch/2011/03/javafx-avoid-red-balls.html"&gt;JavaFX avoid the red balls&lt;/a&gt;“ i was pointed to JavaFX 2.0. The greatest difference between JavaFX 1.x and 2.0 is that in 2.0 you can write your applications now in Java. The support for JavaFX-Script has been completely dropped. Therefore I ported my application from 1.x to 2.0.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: inherit;"&gt;  &lt;/span&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style="font-family: inherit;"&gt;  &lt;/span&gt;&lt;div class="MsoNormal"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US;"&gt;&lt;span style="font-family: inherit;"&gt;JavaFX is very powerful in creating user interfaces with emphasis on look and feel and design. I was able to port my App without any greater issues. Most of the code was usable as it was I just had to change the syntax. The greatest difference was the use of “AnimationTimer“ instead of “timeline”. The new version and the source code (as a netbeans project) is available &lt;a href="http://gwt.bgaechter.ch/redballs2.0"&gt;here&lt;/a&gt;. Here is the JavaFX 2.0 code:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class="java" name="code"&gt;/*
 * Copyright 2011, Benny Gächter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package jfxtest;

import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.input.MouseEvent;
import java.util.Random;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventType;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.effect.BoxBlur;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.StrokeType;
import javafx.stage.Stage;

/**
 *
 * @author Benny Gächter
 */
public class JFXTest extends Application implements EventHandler {

    static int APP_WIDTH = 800;
    static int APP_HEIGHT = 600;
    double mouseX = 0.0;
    double mouseY = 0.0;
    Random random = new java.util.Random();
    int state = 1;
    int counter = 0;
    double currentRuntime;
    Rectangle player;
    long lastUpdate = 0;
    long startTime = 0;
    final Group balls = new Group();
    Group root = null;
    AnimationTimer timer = null;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
 Application.launch(JFXTest.class, args);
    }

    @Override
    public void start(Stage primaryStage) {
 primaryStage.setTitle("Red Balls JavaFX 2.0");
 lastUpdate = System.currentTimeMillis();

 root = new Group();
 Scene scene = new Scene(root, APP_WIDTH, APP_HEIGHT, Color.WHITE);
 scene.addEventHandler(EventType.ROOT, this);

 player = new Rectangle(20, 20, Color.BLACK);

 root.getChildren().add(player);


 for (int i = 0; i &lt; 15; i++) {
     MyCircle ball = new MyCircle(15, Color.RED);
     ball.setStrokeType(StrokeType.OUTSIDE);
     ball.setStroke(Color.DARKRED);
     ball.setStrokeWidth(4);
     ball.setCenterX(random.nextInt(APP_WIDTH - 15));
     ball.setCenterY(random.nextInt(APP_HEIGHT - 15));

     if (random.nextInt(100) % 2 == 0) {
  ball.setVx(1);
     }
     if (random.nextInt(100) % 2 == 0) {
  ball.setVy(1);
     }
     balls.getChildren().add(ball);
     balls.setEffect(new BoxBlur(2, 2, 1));
 }

 root.getChildren().add(balls);
 startTime = System.currentTimeMillis();

 final Label time = new Label("Time :");
 time.setLayoutX(50);
 time.setLayoutY(20);
 time.setScaleX(2);
 time.setScaleY(2);
 time.setScaleZ(2);
 root.getChildren().add(time);

 timer = new AnimationTimer() {

     @Override
     public void handle(long l) {
  if (state == 1) {
      if (System.currentTimeMillis() &gt; lastUpdate + 20) {
   lastUpdate = System.currentTimeMillis();
   time.setText("Time : " + (System.currentTimeMillis() - startTime) / 1000 + " s");
   for (Node ball : balls.getChildren()) {
       MyCircle AI = (MyCircle) ball;

       //bounce from walls
       if (AI.getCenterX() + AI.getVx() &lt; 15) {
    AI.vx = -AI.vx;
       }
       if (AI.getCenterX() + AI.vx &gt; APP_WIDTH - 15) {
    AI.vx = -AI.vx;
       }

       if (AI.getCenterY() + AI.vy &lt; 15) {
    AI.vy = -AI.vy;
       }
       if (AI.getCenterY() + AI.vy &gt; APP_HEIGHT - 15) {
    AI.vy = -AI.vy;
       }


       if (AI.getCenterX() &gt;= mouseX &amp;&amp; AI.getCenterX() &lt;= mouseX + 10) {
    if (AI.getCenterY() + 15 &gt;= mouseY - 10
     &amp;&amp; AI.getCenterY() - 15 &lt;= mouseY) {
        AI.vy = -AI.vy;
        state = 2;
    }
       } else if (AI.getCenterY() &gt;= mouseY - 10
        &amp;&amp; AI.getCenterY() &lt;= mouseY) {
    if (AI.getCenterX() + 15 &gt;= mouseX
     &amp;&amp; AI.getCenterX() - 15 &lt;= mouseX + 10) {
        AI.vx = -AI.vx;
        state = 2;

    }
       }
       //calculate new position
       AI.setCenterX(AI.getCenterX() + AI.vx);
       AI.setCenterY(AI.getCenterY() + AI.vy);

       //increase speed
       AI.vx = AI.vx * 1.002;
       AI.vy = AI.vy * 1.002;
   }
      }
  } else {
      this.stop();
      setGameoverScreen();
  }
     }
 };
 timer.start();

 primaryStage.setScene(scene);

 primaryStage.setVisible(true);

    }

    public void setGameoverScreen() {
 final Button restart = new Button();
 restart.setText("Restart");
 restart.setLayoutX(APP_WIDTH / 2);
 restart.setLayoutY(APP_HEIGHT / 2);
 restart.setScaleZ(4);
 restart.setScaleX(4);
 restart.setScaleY(4);
 root.getChildren().add(restart);

 restart.setOnAction(new EventHandler&lt;actionevent&gt;() {

     @Override
     public void handle(ActionEvent e) {
  for (Node ball : balls.getChildren()) {
      MyCircle buf = (MyCircle) ball;
      buf.setCenterX(random.nextInt(APP_WIDTH - 15));
      buf.setCenterY(random.nextInt(APP_HEIGHT - 15));

      if (random.nextInt(100) % 2 == 0) {
   buf.setVx(1);
      } else {
   buf.setVx(-1);
      }
      if (random.nextInt(100) % 2 == 0) {
   buf.setVy(1);
      } else {
   buf.setVy(-1);
      }
  }

  root.getChildren().remove(restart);
  state = 1;
  timer.start();
  startTime = System.currentTimeMillis();

     }
 });
    }

    public void handle(Event event) {
 if (event instanceof MouseEvent) {
     MouseEvent e = (MouseEvent) event;
     mouseX = e.getX();
     mouseY = e.getY();

     if (mouseX &gt; APP_WIDTH - 20) {
  mouseX = APP_WIDTH - 20;
     }
     if (mouseY &gt; APP_HEIGHT - 20) {
  mouseY = APP_HEIGHT - 20;
     }
     if (mouseX &lt; 0) {
  mouseX = 1;
     }
     if (mouseY &lt; 0) {
  mouseY = 1;
     }

     player.setX(mouseX);
     player.setY(mouseY);
 }
    }

    class MyCircle extends Circle {

 public double vy;
 public double vx;

 public MyCircle(double centerX, double centerY, double radius, Paint fill) {
     super(centerX, centerY, radius, fill);
     setVel();
 }

 public MyCircle(double centerX, double centerY, double radius) {
     super(centerX, centerY, radius);
     setVel();
 }

 public MyCircle() {
     setVel();
 }

 public MyCircle(double radius, Paint fill) {
     super(radius, fill);
     setVel();
 }

 public MyCircle(double radius) {
     super(radius);
     setVel();
 }

 public double getVx() {
     return vx;
 }

 public void setVx(int vx) {
     this.vx = vx;
 }

 public double getVy() {
     return vy;
 }

 public void setVy(int vy) {
     this.vy = vy;
 }

 private void setVel() {
     vx = -1;
     vy = -1;
 }
    }
}

&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/WcTyRJU4Ntk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/7387938232623175709/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/06/javafx-20-red-balls.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/7387938232623175709?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/7387938232623175709?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/WcTyRJU4Ntk/javafx-20-red-balls.html" title="JavaFX 2.0 &quot;Avoid The Red Balls&quot;" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/06/javafx-20-red-balls.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYFSH45fyp7ImA9WhZaEUU.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-1523732797173660742</id><published>2011-06-27T13:14:00.002+02:00</published><updated>2011-06-27T15:41:59.027+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-27T15:41:59.027+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="database" /><title>MySQL Database network access</title><content type="html">&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;It’s not very difficult to configure your MySQL Database to listen to other machines in the network but it obviously leads to confusion sometimes. There are basically two options which allow your Database to listen to TCP/IP connections. They need to be done in the my.cnf file (usually located in /etc/mysql/my.cnf).&lt;/span&gt;&lt;br /&gt;
&lt;pre class="py" name="code"&gt;#SkipNetworking
bind-address 0.0.0.0
&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;If you set bind-address to 0.0.0.0 your server will accept connections from any client. You can also specify a single client by replacing 0.0.0.0 by an address (for example 192.168.1.100). To disable external TCP/IP connections set bind-address to 127.0.0.1. The server will now only accept connections from the local host. If you uncomment SkipNetworking the server won't accept TCP/IP connections at all.&lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/U2vRFqqSXWQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/1523732797173660742/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/06/mysql-database-network-access.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/1523732797173660742?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/1523732797173660742?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/U2vRFqqSXWQ/mysql-database-network-access.html" title="MySQL Database network access" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/06/mysql-database-network-access.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYBRn45fip7ImA9WhdbGEg.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-8039319468565098990</id><published>2011-06-16T10:22:00.000+02:00</published><updated>2011-10-17T13:49:17.026+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-17T13:49:17.026+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="video" /><category scheme="http://www.blogger.com/atom/ns#" term="packages" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Multimedia" /><category scheme="http://www.blogger.com/atom/ns#" term="avi" /><title>Multimedia support for Scientific Linux 6, / RHEL 6</title><content type="html">I just tried out Scientific Linux 6 on my home machine. Scientific Linux is a customized and unbranded Red Hat Enterprise Linux made by CERN and Fermilab. Therefore it's very stable and made to work. But even for working it's nice to play mp3 music oder view mpeg films.&lt;br /&gt;
To do so you have to enable the RPMForge repository by installing a package. Go to System =&amp;gt; Administration =&amp;gt; Add/Remove Software and install the package:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-t9f0Ag4UBag/Tfm7bByS3LI/AAAAAAAAADI/o6IMzlKXQ0A/s1600/16.06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="169" src="http://1.bp.blogspot.com/-t9f0Ag4UBag/Tfm7bByS3LI/AAAAAAAAADI/o6IMzlKXQ0A/s320/16.06.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
After this you can install the following packages for full multimedia support:&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;/div&gt;
&lt;pre class="py" name="code"&gt;yum install ffmpeg libdvdcss libdvdread libdvdnav libdvdplay lsdvd mplayer gxine gstreamer-plugins-good gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly libcdaudio w3m libx264 mjpegtools libsidplay libquicktime libkate automake autoconf jna gc libid3tag amrwb gstreamer-java-swt gstreamer-java gstreamer-ffmpeg gstreamer-vaapi
&lt;/pre&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;If you want to install vlc keep in mind that vlc doesn't work with libmodplug from epel repository. You have to add the follwoing line to your /etc/yum.repo.d/epe.repo and epel.testing.repo:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;/div&gt;
&lt;pre class="py" name="code"&gt;exclude=libmodplug
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/b5WZHHdmorQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/8039319468565098990/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/06/multimedia-support-for-scientific-linux.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/8039319468565098990?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/8039319468565098990?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/b5WZHHdmorQ/multimedia-support-for-scientific-linux.html" title="Multimedia support for Scientific Linux 6, / RHEL 6" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-t9f0Ag4UBag/Tfm7bByS3LI/AAAAAAAAADI/o6IMzlKXQ0A/s72-c/16.06.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/06/multimedia-support-for-scientific-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMGQH48fip7ImA9WhRQGE0.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-938778503990614573</id><published>2011-06-14T14:07:00.000+02:00</published><updated>2011-12-13T19:20:21.076+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-13T19:20:21.076+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="bash" /><category scheme="http://www.blogger.com/atom/ns#" term="Multimedia" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="shell" /><title>Find file duplicates using a bash script</title><content type="html">This script is based on a script found in this &lt;a href="http://elonen.iki.fi/code/misc-notes/remove-duplicate-files/index.html"&gt;blog&lt;/a&gt;. It searches recursively through the current directory and creates a script to remove all duplicate files. The script compares the md5 check sums of the files so it's able to compare binary files. It's a shell script therefore it will run on any machine with a bash shell (it might work with any other shell as well i didn't test it...).&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;#! /bin/sh
echo "scanning ..."
OUTF=rem-duplicates.sh;
echo "#! /bin/sh" &amp;gt; $OUTF;
echo "#"$OUTF &amp;gt;&amp;gt; $OUTF;
echo "" &amp;gt;&amp;gt; $OUTF;
find "$@" -type f -exec md5sum {} \; |
 sort --key=1,32 | uniq -w 32 -d --all-repeated=separate |
 sed -r 's/^[0-9a-f]*( )*//;s/([^a-zA-Z0-9./_-])/\\\1/g;s/(.+)/#rm \1/' &amp;gt;&amp;gt; $OUTF ;
chmod a+x $OUTF;
if [ -n "${EDITOR+x}" ];then
    $EDITOR $OUTF
else
    nano $OUTF
fi
echo "Do you want to execute the script? [y/n]?"
read answer
if [ $answer == "y" ]; then
    ./$OUTF
fi
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/qEEyhJfsYK4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/938778503990614573/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/06/find-file-duplicates-using-bash-script.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/938778503990614573?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/938778503990614573?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/qEEyhJfsYK4/find-file-duplicates-using-bash-script.html" title="Find file duplicates using a bash script" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/06/find-file-duplicates-using-bash-script.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUINR306fCp7ImA9WhZVFEU.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-3144936940835273391</id><published>2011-05-27T10:06:00.000+02:00</published><updated>2011-05-27T10:06:36.314+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-27T10:06:36.314+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GWT" /><category scheme="http://www.blogger.com/atom/ns#" term="google web toolkit" /><category scheme="http://www.blogger.com/atom/ns#" term="JDeveloper" /><title>Install gwtDeveloper extension in Oracle's jDeveloper</title><content type="html">I just experienced that installing the gwtDeveloper is not as easy as installing any other extension in Oracle's jdeveloper.&lt;div&gt;After a while i found out that gwtDeveloper should be in &lt;a href="http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/130355.xml#gwtDeveloper"&gt;oracle's partner extensions&lt;/a&gt;. But a click on the download link leads me to a "404 page not found". I looked around on the web page and after a while i found the new &lt;a href="http://gdevelop.com/downloads/gwtdeveloper/"&gt;download link&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-IHPDvt_tEPQ/Td9Z5C8qjYI/AAAAAAAAADE/k6Vbxzkmcrk/s1600/27.05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="239" src="http://1.bp.blogspot.com/-IHPDvt_tEPQ/Td9Z5C8qjYI/AAAAAAAAADE/k6Vbxzkmcrk/s320/27.05.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;When the download is finished all you have to do is go to Help =&amp;gt; Check for Updates =&amp;gt;Choose Install from local File and click next and then finish. After a restart you are able to use the gwtDeveloper extension.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/6m_NDobZLnU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/3144936940835273391/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/05/install-gwtdeveloper-extension-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/3144936940835273391?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/3144936940835273391?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/6m_NDobZLnU/install-gwtdeveloper-extension-in.html" title="Install gwtDeveloper extension in Oracle's jDeveloper" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-IHPDvt_tEPQ/Td9Z5C8qjYI/AAAAAAAAADE/k6Vbxzkmcrk/s72-c/27.05.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/05/install-gwtdeveloper-extension-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4HQn85cSp7ImA9WhZRF0s.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-3132539820616183862</id><published>2011-04-13T17:35:00.002+02:00</published><updated>2011-04-14T08:35:33.129+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-14T08:35:33.129+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="kernel" /><category scheme="http://www.blogger.com/atom/ns#" term="wireless" /><category scheme="http://www.blogger.com/atom/ns#" term="driver" /><category scheme="http://www.blogger.com/atom/ns#" term="eeepc" /><title>openSUSE and the rtl8192se wireless chip</title><content type="html">I installed reinstalled my netbook (an asus 1201n) again to try another linux distribution. This time i tried openSUSE. Very similair to &lt;a href="http://blog.bgaechter.ch/2010/11/feodra-14-on-asus-1201n.html"&gt;fedora&lt;/a&gt; opensuse didn't inlucde the right drivers so i had to install them by myself. This is how i did it.&lt;br /&gt;
&lt;br /&gt;
Get the driver from &lt;a href="http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&amp;amp;PNid=48&amp;amp;PFid=48&amp;amp;Level=5&amp;amp;Conn=4&amp;amp;DownTypeID=3&amp;amp;GetDown=false&amp;amp;Downloads=true#RTL8191SE-VA2"&gt;realtek website.&lt;/a&gt;&lt;br /&gt;
Then install the missing depencies.&lt;br /&gt;
After that you can compile the driver, install it an ensure the module is loaded and your card is recognized&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="python" name="code"&gt;zypper install automake make kernel-desktop-devel kernel-syms gcc
make   
make install
modprobe r8192se_pci
iwconfig
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/R8lIYZjfEUY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/3132539820616183862/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/04/opensuse-and-rtl8191se-wireless-chip.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/3132539820616183862?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/3132539820616183862?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/R8lIYZjfEUY/opensuse-and-rtl8191se-wireless-chip.html" title="openSUSE and the rtl8192se wireless chip" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/04/opensuse-and-rtl8191se-wireless-chip.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4CQH0_fyp7ImA9WhZSFE0.&quot;"><id>tag:blogger.com,1999:blog-8091047083296438654.post-8892372588203869202</id><published>2011-03-28T12:33:00.004+02:00</published><updated>2011-03-29T16:12:41.347+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-29T16:12:41.347+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="HTTP" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title>Javafx: avoid the red balls</title><content type="html">&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;This weekend i took a look at javafx. After watching some video tutorials I felt able to develop my own application. I decided to write a simple game. It’s all about avoiding the red balls with your black square. And see how long you can escape.&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: inherit;"&gt;The game covers a lot of things from collision detection to visual effects like inner shadows. If you want to play the game:&lt;a href="http://gwt.bgaechter.ch/redballs"&gt; click here.&lt;/a&gt; It’s probably a good idea having a look at the game before stepping through the code so you already know what I am talking about. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;So let’s step through the code. You can also download the code as &lt;a href="http://files.bgaechter.ch/code/redballs.zip"&gt;Netbeans project&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;pre class="java" name="code"&gt;/*
 * Copyright 2011, Benny Gächter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package javafxapp;

import javafx.animation.KeyFrame;
import javafx.scene.paint.Color;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Flow;
import javafx.scene.text.Text;
import javafx.animation.Timeline;
import javafx.scene.Node;
import javafx.scene.CustomNode;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.transform.Translate;
import javafx.scene.text.Font;
import javafx.scene.Group;
import javafx.scene.control.Button;
import javafx.scene.effect.InnerShadow;
import javafx.scene.control.Hyperlink;
import javafx.stage.AppletStageExtension;

// Height and Width of this Application
def APP_WIDTH = 500;
def APP_HEIGHT = APP_WIDTH;
//Variables for mouse coordinates
var mouseX = 0.0;
var mouseY = 0.0;
//We need this to get a random place for the balls
var random = new java.util.Random();
//state of the game 1 is “running” 2 is “game over”
var state = 1;
//not used at the moment
var counter = 0;
//player time
var currentRuntime: Number = 0;


//create a background and track mouse movements on it
def background = Rectangle {
            x: 0 y: 0 width: APP_WIDTH
            height: APP_HEIGHT
            fill: Color.web("#E6E6E6");
            onMouseMoved: function(e: MouseEvent) {
                mouseX = e.x;
                mouseY = e.y;
            }

        }

 //create player 
def player = Rectangle {
            x: bind mouseX - 10
            y: bind mouseY - 10
            width: 20
            height: 20
 //create a nice visual effect
            effect: InnerShadow {
                choke: 0.2
                offsetX: 1
                offsetY: 1
                radius: 5
                color: Color.WHITE
            }
        }

//create balls
var AIs: Ball[];
for (i in [0..16]) {
    insert Ball {
        //set balls to a random place
        x: random.nextInt(450), y: random.nextInt(450)
       //create a nice visual effect for the balls
        effect: InnerShadow {
            choke: 0.5
            offsetX: 1
            offsetY: 1
            radius: 5
            color: Color.BLACK
        };


    } into AIs;

    //let the balls go to random directions
    if(random.nextInt(100) mod 2 == 0){
        AIs[i].vy = 1
    }
    if(random.nextInt(100) mod 2 == 0){
        AIs[i].vx = -1
    }

}

//t1 is for game logic
def t1 = Timeline {
            repeatCount: Timeline.INDEFINITE
            keyFrames: [
                KeyFrame {
//17ms is better than 25…
                    time: 17ms //25ms
                    values: []
                    action: function() {
                        for (AI in AIs) {
                            //bounce from walls
                            if (AI.x + AI.vx &amp;lt; AI.radius) { AI.vx = -AI.vx;
                            }
                            if (AI.x + AI.vx &amp;gt; APP_WIDTH - 7) { AI.vx = -AI.vx;
                            }

                            if (AI.y + AI.vy &amp;lt; AI.radius) { AI.vy = -AI.vy;
                            }
                            if (AI.y + AI.vy &amp;gt; APP_WIDTH - 7) { AI.vy = -AI.vy
                            }

                            //bounce from other balls
                            /*
                            *not yet implemented
                            */

                            
                            //detect collissions
                            if (AI.x &amp;gt;= mouseX and AI.x &amp;lt;= mouseX + 10) {
                                if (AI.y + AI.radius &amp;gt;= mouseY - 10 and AI.y - AI.radius &amp;lt;= mouseY) {
                                    AI.vy = -AI.vy;
                                    state = 2;
                                }
                            } else if (AI.y &amp;gt;= mouseY - 10 and AI.y &amp;lt;= mouseY) {
                                if (AI.x + AI.radius &amp;gt;= mouseX and AI.x - AI.radius &amp;lt;= mouseX + 10) {
                                    AI.vx = -AI.vx;
                                    state = 2;

                                }
                            }

                            //calculate new position
                            AI.x += AI.vx;
                            AI.y += AI.vy;

                            //increase speed
                            AI.vx = AI.vx * 1.002;
                            AI.vy = AI.vy * 1.002;

                        }
                       // not used at the moment
                        counter++;
                    }
                }
            ]
        };
        //t1 observes the game state and reacts on it
def t2 = Timeline {
            repeatCount: Timeline.INDEFINITE
            keyFrames: [
                KeyFrame {
                    time: 25ms
                    values: []
                    action: function() {
                        /* insert Ball {
                        x: random.nextInt(500), y: random.nextInt(500)
                        } into AIs;*/
                        //insert AIs into stage.scene.content;


                        //stage.scene.impl_setStage(stage);
                        if (state != 1) {
                            t1.stop();
                            tlTimer.stop();
                            gameOverScreen.visible = true;

                        }
                    }
                }
            ]
        };
        //tlTimer is for displaying the current time
def tlTimer = Timeline {
            repeatCount: Timeline.INDEFINITE
            keyFrames: [
                KeyFrame {
                    time: 100ms
                    values: []
                    action: function() {
                        currentRuntime += 0.1;

                    }
                }
            ]
        };
//start all timers
tlTimer.play();
t1.play();
t2.play();

//create the text object for timer
def timer = Flow {
            content: [Text { content: bind currentRuntime.toString()
                    font: Font { size: 30 } }
            ];
        }

        //create the game over screen
var gameOverScreen: Group = Group {
            visible: false
            var r: Rectangle = Rectangle {
                        arcWidth: APP_WIDTH arcHeight: APP_WIDTH
                        width: APP_WIDTH, height: APP_WIDTH
                        fill: Color.ROSYBROWN
                        stroke: Color.DARKRED
                        strokeWidth: APP_WIDTH
                    }
            content: [
                r,
                Text {
                    font: Font {
                        size: 28
                    }
                    x: 20, y: 50
                    content: "Game Over! Time: ";
                },
                Text {
                    font: Font {
                        size: 28
                    }
                    x: 20, y: 80
                    content: bind String.valueOf(currentRuntime).concat(" Seconds")
                },
                Text {
                    font: Font {
                        size: 28
                    }
                    x: 20, y: 200
                    content: "By Benny Gächter ";
                },
                Hyperlink {
                    layoutX: 100,
                    layoutY: 230,
                    scaleX:3
                    scaleY:3
                    text: "www.bgaechter.ch"
                    action: function(): Void {
                        AppletStageExtension.showDocument("http://www.bgaechter.ch");
                    }
                }

                Button {
                    layoutX: 250
                    layoutY: 120
                    scaleX: 3
                    scaleY: 3
                    text: "Restart"
                    action: function() {
                        restart();

                    },
                }
            ]

        }
// Display everything
var stage: Stage = Stage {
            title: "Test App"
            width: 500
            height: 500

            scene: Scene {
                content: [
                    background,
                    player,
                    AIs,
                    timer,
                    gameOverScreen
                ]
            }
        }

//the ball class derived from CustomNode
class Ball extends CustomNode {
    // Ball position
    public var x: Number = 100;
    public var y: Number = 100;
    // Ball radius
    public var radius: Number = 10;
    // Ball velocity vectors
    public var vx: Number = 1.0;
    public var vy: Number = -1.0;

    public override function create(): Node {
        return Circle {
                    transforms: Translate { x: bind x, y: bind y }
                    radius: bind radius
                    fill: Color.RED
                }
    }

}
//The restart function, may be called after game over
function restart(): Void {
    state = 1;
    currentRuntime = 0;
    t1.playFromStart();
    tlTimer.playFromStart();
    gameOverScreen.visible = false;
    for (AI in AIs) {
        AI.vx = 1;
        AI.vy = -1;
    }
}

&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/Bgaechter-Blog/~4/PO4lusE8BJo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.bgaechter.ch/feeds/8892372588203869202/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.bgaechter.ch/2011/03/javafx-avoid-red-balls.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/8892372588203869202?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8091047083296438654/posts/default/8892372588203869202?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bgaechter-Blog/~3/PO4lusE8BJo/javafx-avoid-red-balls.html" title="Javafx: avoid the red balls" /><author><name>bgaechter</name><uri>http://www.blogger.com/profile/16592735258558505444</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.bgaechter.ch/2011/03/javafx-avoid-red-balls.html</feedburner:origLink></entry></feed>
