<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1511806127926239797</id><updated>2012-01-27T22:00:13.369+02:00</updated><category term='Swing'/><category term='scripting'/><category term='idea'/><category term='Fedora'/><category term='Firefox'/><category term='grub'/><category term='sabayon'/><category term='Gradle'/><category term='Linux'/><category term='Mac'/><category term='wine'/><category term='testing'/><category term='bookmarks'/><category term='font'/><category term='Java'/><category term='Android'/><category term='Ant'/><category term='Groovy'/><category term='svn'/><category term='Mandriva'/><title type='text'>Java Hamster</title><subtitle type='html'>Some thoughts of Java engineer from Ukraine.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-5277412204736742485</id><published>2012-01-27T22:00:00.000+02:00</published><updated>2012-01-27T22:00:13.382+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sabayon'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>Downgrade svn from 1.6 to 1.7</title><content type='html'>&lt;div style="text-align: justify;"&gt;I'm using a &lt;a href="http://sabayon.org/"&gt;Sabayon&lt;/a&gt; as my primary OS now. It's a &lt;a href="http://en.wikipedia.org/wiki/Rolling_release"&gt;rolling distro&lt;/a&gt;. And it fairly quickly incorporates latest changes from mainline projects.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Few weeks ago among other updates &lt;a href="http://subversion.tigris.org/"&gt;subversion&lt;/a&gt; was upgraded from 1.6 to 1.7. At first there were no problems, because I mainly used command line svn client. I upgraded my working copies to 1.7 and was happy.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The problem started to arise when I tried to work with upgraded working copy from my IDE - &lt;a href="http://www.jetbrains.com/idea/"&gt;Idea&lt;/a&gt;. The first problem was that Idea does not support subversion 1.7. And will not support it for a few more month.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;So, I tried to downgrade subversion package on my OS. This failed, because 1.6 was removed from repository.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;There was a chance to build 1.6 from sources. But I prefer not to mix binary and compiled from sources packages.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I ended up with &lt;a href="http://stackoverflow.com/a/8392483"&gt;solution suggested on stackoverflow&lt;/a&gt;. I used another OS (Ubuntu) on my multi-boot machine which still has subversion 1.6. From there I deleted a subversion folders from my projects. Which is easy in subversion 1.7 ;) Then I made a checkout to existing projects. This allowed me to not loose any changes.Then I rebooted to my primary OS and used subversion from IDE only. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-5277412204736742485?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/5277412204736742485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=5277412204736742485' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/5277412204736742485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/5277412204736742485'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2012/01/downgrade-svn-from-16-to-17.html' title='Downgrade svn from 1.6 to 1.7'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-7571943064591540280</id><published>2011-09-03T00:00:00.000+03:00</published><updated>2011-09-03T00:00:50.778+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sabayon'/><category scheme='http://www.blogger.com/atom/ns#' term='idea'/><category scheme='http://www.blogger.com/atom/ns#' term='font'/><title type='text'>Fixing UI font in Idea</title><content type='html'>&lt;div style="text-align: justify;"&gt;Recently I switched my Linux OS from &lt;a href="http://www.ubuntu.com/"&gt;Ubuntu&lt;/a&gt; to &lt;a href="http://www.sabayon.org/"&gt;Sabayon&lt;/a&gt;. And I've noticed the UI fonts of &lt;a href="http://www.jetbrains.com/idea/"&gt;Idea&lt;/a&gt; (many java developers would agree IntelliJ Idea is the best IDE) are bad. Probably something related to &lt;a href="http://en.wikipedia.org/wiki/Font_rasterization"&gt;anti-aliasing&lt;/a&gt; went wrong. The fix is easy, just add following line to your &lt;i&gt;{idea-installation-directory}&lt;/i&gt;&lt;idea-installation-directory&gt;&lt;i&gt;/bin/idea.vmoption&lt;/i&gt;s:&lt;/idea-installation-directory&gt;&lt;/div&gt;&lt;pre&gt;-Dawt.useSystemAAFontSettings=on&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-7571943064591540280?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/7571943064591540280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=7571943064591540280' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/7571943064591540280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/7571943064591540280'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2011/09/fixing-ui-font-in-idea.html' title='Fixing UI font in Idea'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-287177736348751046</id><published>2011-07-21T11:18:00.000+03:00</published><updated>2011-07-21T11:18:25.916+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ant'/><category scheme='http://www.blogger.com/atom/ns#' term='Groovy'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='Gradle'/><title type='text'>Updating versionCode and versionNumber in Android manifest via Gradle</title><content type='html'>&lt;div style="text-align: justify;"&gt;I'm working on &lt;a href="http://thickbuttons.com/"&gt;Android project&lt;/a&gt; which has multiple builds for different customers.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Each build is organized as separate project and is build via &lt;a href="http://ant.apache.org/"&gt;Ant&lt;/a&gt; script. The problem is that building all those builds and updating &lt;a href="http://developer.android.com/guide/topics/manifest/manifest-element.html"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;versionCode&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;versionNumber&lt;/span&gt;&lt;/a&gt; is all manifest files takes a lot of time. So, I decided to use some tool to this for me. Yes, I'm a bit lazy :)&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I've chosen &lt;a href="http://gradle.org/index.php"&gt;Gradle&lt;/a&gt;. It leverages the power of &lt;a href="http://groovy.codehaus.org/"&gt;Groovy&lt;/a&gt; and is able to call Ant scripts.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Groovy has great tools to work with XML, like &lt;a href="http://groovy.codehaus.org/Updating+XML+with+XmlSlurper"&gt;XmlSlurper&lt;/a&gt;. So, updating &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;versionCode&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;versionNumber&lt;/span&gt; in Android manifest files seemed easy. Unfortunately after significant amount of time all I got was ugly formatted Android manifest with &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;tag0&lt;/span&gt; namespaces :(&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Then I put XmlSlurper aside and used &lt;a href="http://groovy.codehaus.org/groovy-jdk/java/lang/String.html#replaceAll%28java.util.regex.Pattern,%20java.lang.String%29"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;String.replaceAll(Pattern pattern, String replacement)&lt;/span&gt;&lt;/a&gt; method. It took me about 5 minutes to do all replacements :)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-287177736348751046?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/287177736348751046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=287177736348751046' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/287177736348751046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/287177736348751046'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2011/07/updating-versioncode-and-versionnumber.html' title='Updating versionCode and versionNumber in Android manifest via Gradle'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-6582066891185767001</id><published>2010-07-04T17:45:00.000+03:00</published><updated>2010-07-04T17:45:40.296+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='bookmarks'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Goodbye to Firefox Sync and welcome back to Xmarks</title><content type='html'>Some time ago I was using &lt;a href="http://www.xmarks.com/"&gt;Xmarks&lt;/a&gt; for bookmark synchronization. Then I switched to &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/10868/"&gt;Firefox Sync&lt;/a&gt;. I used only Firefox and only on Linux powered machines. Firefox Sync worked perfectly and is synchronized not only bookmarks, but also other useful things like history.&lt;br /&gt;But with starting from Firefox Sync 1.2.3 (it was called Weave Sync back then) &lt;a href="http://getsatisfaction.com/mozilla_labs/topics/initial_bookmark_sync_fails"&gt;it failed to synchronize bookmarks on x64 Linux&lt;/a&gt;. The problem was still present in 1.3 as well as in latest 1.4.&lt;br /&gt;So, I gave up and switched back to Xmarks. The latter doesn't have many fancy features. But at least it works.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-6582066891185767001?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/6582066891185767001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=6582066891185767001' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6582066891185767001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6582066891185767001'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2010/07/goodbye-to-firefox-sync-and-welcome.html' title='Goodbye to Firefox Sync and welcome back to Xmarks'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-6048555039647779777</id><published>2010-05-25T00:10:00.007+03:00</published><updated>2010-05-25T00:20:58.362+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='wine'/><title type='text'>Wine in Fedora 13 x64</title><content type='html'>&lt;div style="text-align: justify;"&gt;The shiny new &lt;a href="http://fedoraproject.org/"&gt;Fedora&lt;/a&gt; 13 is to be released in a few hours. I've installed its x64 variant since beta. And I've spent a lot of time to make &lt;a href="http://www.winehq.org/"&gt;wine&lt;/a&gt; work in Fedora. And it actually works with &lt;a href="http://en.wikipedia.org/wiki/PulseAudio"&gt;PulseAudio&lt;/a&gt; :) So, if you are going to use wine in Fedora 13 x64 here is some info which might be helpful.&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Getting the latest wine version &lt;/div&gt;&lt;div style="text-align: justify;"&gt;At the time of this writing latest wine version in Fedora repos is 1.1.38, in upstream 1.1.44. The latter is also available if Fedora testing repo. So, you might want to &lt;a href="http://fedoraproject.org/wiki/AndreasBierfert/Wine"&gt;enable that repo&lt;/a&gt; while installing wine:&lt;/div&gt;&lt;code&gt;yum --enablerepo=updates-testing install wine&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Getting rid of crash on audio tab&lt;/div&gt;&lt;div style="text-align: justify;"&gt;x64 build of wine is not perfect yet. It actually &lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=522941"&gt;crashes on audio tab&lt;/a&gt;. So, use 32-bit version to configure wine:&lt;/div&gt;&lt;code&gt;wine32 winecfg&lt;/code&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;It's actually a good idea to use &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wine32&lt;/span&gt; instead of &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wine&lt;/span&gt;.&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Adding readable wine fonts&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Default wine font is hardly readable. You should have sharp eyes and good imagination to understand what is written on wine dialogs :)&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Installing &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;corefonts&lt;/span&gt; with &lt;a href="http://wiki.winehq.org/winetricks"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;winetricks&lt;/span&gt;&lt;/a&gt; should fix it:&lt;/div&gt;&lt;code&gt;yum install cabextract&lt;br /&gt;wget  http://www.kegel.com/wine/winetricks&lt;br /&gt;chmod a+x winetricks&lt;br /&gt;./winetricks corefonts&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Adding mp3 support&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Some games (including &lt;a href="http://appdb.winehq.org/objectManager.php?sClass=version&amp;amp;iId=3383"&gt;Morrowind&lt;/a&gt;) require mp3 support. Fedora's wine without mp3 support in contrast to Ubuntu. To enable it you should install a mp3 codec. &lt;a href="http://appdb.winehq.org/objectManager.php?sClass=version&amp;amp;iId=3329"&gt;It is recommended&lt;/a&gt; to use l3codecx codec, then rename &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l3codecx.acm&lt;/span&gt; file to &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;winemp3.acm&lt;/span&gt;. Alternatively you can grab that file from Windows, if you have one at hand. I had no Windows, so I tried installation approach. I've searched for &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l3codecx&lt;/span&gt; and found a few installators (for Windows, of cause). One of them failed in wine but another one worked. &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l3codecx.acm&lt;/span&gt; file appeared in &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$HOME/.wine/drive_c/windows/syswow64&lt;/span&gt; folder. Instead of renaming it I just made a symbolic link:&lt;/div&gt;&lt;code&gt;cd .wine/drive_c/windows/syswow64 folder &lt;br /&gt;ln -s l3codecx.acm winemp3.acm&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And that's all :)&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; var flattr_url = 'http://java-hamster.blogspot.com/2010/05/wine-in-fedora-13-x64.html';&lt;/script&gt;&lt;br /&gt;&lt;script src="http://api.flattr.com/button/load.js" type="text/javascript"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-6048555039647779777?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/6048555039647779777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=6048555039647779777' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6048555039647779777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6048555039647779777'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2010/05/wine-in-fedora-13-x64.html' title='Wine in Fedora 13 x64'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-5953556523571959650</id><published>2010-05-19T22:09:00.002+03:00</published><updated>2010-05-19T22:16:31.571+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android's sharedUserId</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.android.com/"&gt;Android&lt;/a&gt; is a wonderful platform for development. It also provides good &lt;a href="http://developer.android.com/guide/topics/security/security.html"&gt;security framework&lt;/a&gt;. Each application has its own user ID and thus application A can't directly access the data of application B. So, Android is quite resistant to viruses plague. In contrast to Windows.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;But this security makes it difficult to develop a set of applications which should work tightly with one another, e.g. browser and its plugins, translator and its dictionaries, etc.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;To address this problem Android provides the developer with &lt;a href="http://developer.android.com/guide/topics/manifest/manifest-element.html#uid"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sharedUrerId&lt;/span&gt; attribute&lt;/a&gt; in manifest. Setting the same &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sharedUserId&lt;/span&gt; to multiple application and signing them with same signature will enable them to access one another's data. Great!&lt;/div&gt;&lt;div style="text-align: justify;"&gt;But... but there are two nasty bugs related to &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sharedUserId&lt;/span&gt; which you &lt;b&gt;must&lt;/b&gt; take into account.&lt;/div&gt;&lt;ol style="text-align: justify;"&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/android/issues/detail?id=3763"&gt;Issue #3763&lt;/a&gt; messes up if you decide to change the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sharedUserId&lt;/span&gt; value.&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/android/issues/detail?id=1227"&gt;Issue #1227&lt;/a&gt; bites you if you add &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sharedUserId&lt;/span&gt; to your application.&lt;/li&gt;&lt;/ol&gt;&lt;div style="text-align: justify;"&gt;In both cases after upgrade to the new version your application won't be able to access its own data (probably, because its user ID was changed, but &lt;a href="http://en.wikipedia.org/wiki/Chown" style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;chown&lt;/a&gt; was not called on its data). You'll see some strange errors in console. Like database can't be opened.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;So, if you are developing some application for Android and if there is even a slightest chance that the application might need to use &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sharedUserId&lt;/span&gt; attribute - use it right from the start. Before uploading the application to the Market. And don't change &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sharedUserId&lt;/span&gt; value in the future.&lt;/div&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; var flattr_url = 'http://java-hamster.blogspot.com/2010/05/androids-shareduserid.html';&lt;/script&gt;&lt;br /&gt;&lt;script src="http://api.flattr.com/button/load.js" type="text/javascript"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-5953556523571959650?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/5953556523571959650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=5953556523571959650' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/5953556523571959650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/5953556523571959650'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2010/05/androids-shareduserid.html' title='Android&apos;s sharedUserId'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-2697250468235996866</id><published>2010-03-20T22:47:00.002+02:00</published><updated>2010-04-13T16:44:38.450+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Presentation and demo app from my talk about Android</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_rDkJrfJPB3c/S6U0GPnOgZI/AAAAAAAADhc/gXLzWQoh51w/s1600-h/android+on+Lviv+JUG.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_rDkJrfJPB3c/S6U0GPnOgZI/AAAAAAAADhc/gXLzWQoh51w/s320/android+on+Lviv+JUG.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I had &lt;a href="http://jug-lviv.blogspot.com/2010/03/java-user-group.html"&gt;a talk on local Java User Group&lt;/a&gt; a week ago. I was talking about &lt;a href="http://developer.android.com/index.html"&gt;Android&lt;/a&gt;. Here I'm providing the presentation and demo application.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Presentation mainly contains materials from &lt;a href="http://developer.android.com/guide/basics/what-is-android.html"&gt;developer.android.com&lt;/a&gt;.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Demo application is a &lt;a href="http://twitter.com/"&gt;twitter&lt;/a&gt; client. It shows:&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;how the project is layed out;&lt;/li&gt;&lt;li&gt;what contains the manifest file;&lt;/li&gt;&lt;li&gt;how activity is build;&lt;/li&gt;&lt;li&gt;how layouting is done (including reusable layouts with &amp;lt;include&amp;gt; tag);&lt;/include&gt;&lt;/li&gt;&lt;li&gt;how locales are handled (contains Spanish translation);&lt;/li&gt;&lt;li&gt;how orientation is handled;&lt;/li&gt;&lt;li&gt;how background threads are handled. &lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Links: &lt;/div&gt;&lt;div style="text-align: justify;"&gt;Presentation: &lt;a href="https://docs.google.com/uc?id=0B-nSMOC9-AY9ZWUwZWNjNzgtZjFhYy00NWM3LTg1MWQtZGVjYmNkYmVjN2Ji&amp;amp;export=download&amp;amp;hl=en"&gt;Android.odt&lt;/a&gt; (yes, that's OpenOffice format).&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Demo application: &lt;a href="https://docs.google.com/uc?id=0B-nSMOC9-AY9OGU0MDJmMTQtMjk0Yy00NzY5LTk1NTMtZmE3YjhlMjM1OTAw&amp;amp;export=download&amp;amp;hl=en"&gt;Twitoid.7z&lt;/a&gt; (IntelliJ IDEA project, free &lt;a href="http://www.jetbrains.com/idea/free_java_ide.html"&gt;Community Edition&lt;/a&gt; is perfectly fine to check this code).&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;a href="http://twitter4j.org/"&gt;Twitter4j&lt;/a&gt; is used for communication with twitter. Icons are taken from &lt;a href="http://medialoot.com/"&gt;medialoot.com&lt;/a&gt;. &lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-2697250468235996866?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/2697250468235996866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=2697250468235996866' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/2697250468235996866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/2697250468235996866'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2010/03/presentation-and-demo-app-from-my-talk.html' title='Presentation and demo app from my talk about Android'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_rDkJrfJPB3c/S6U0GPnOgZI/AAAAAAAADhc/gXLzWQoh51w/s72-c/android+on+Lviv+JUG.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-2546327342659993146</id><published>2009-12-10T10:50:00.000+02:00</published><updated>2009-12-10T10:50:38.204+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>Ignoring multiple files in Subversion using command line</title><content type='html'>&lt;div style="text-align: justify;"&gt;Ignoring single in &lt;a href="http://subversion.tigris.org/"&gt;Subversion&lt;/a&gt; file/folder is as easy as &lt;br /&gt;&lt;/div&gt;&lt;code&gt;svn propset svn:ignore bin .&lt;/code&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;This would make svn ignore folder bin in current directory (final dot is mandatory).&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;But ignoring multiple files is a little bit more complicated. Firstly you should have one of environment variables &lt;code&gt;SVN_EDITOR&lt;/code&gt;, &lt;code&gt;VISUAL&lt;/code&gt; or &lt;code&gt;EDITOR&lt;/code&gt; set. This can be done as easy as&lt;br /&gt;&lt;/div&gt;&lt;code&gt;export SVN_EDITOR=geany&lt;/code&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;This would make &lt;a href="http://www.geany.org/"&gt;Geany&lt;/a&gt; you svn editor. This assumes Geany is installed of cause :)&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Then simply start your svn editor and add all files you want to ignore &lt;br /&gt;&lt;/div&gt;&lt;code&gt;svn propedit svn:ignore .&lt;/code&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The editor would start and you can add as many files as you like, one per line. Again, final dot means that you edit ignored files in current folder.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;That's it :)&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-2546327342659993146?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/2546327342659993146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=2546327342659993146' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/2546327342659993146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/2546327342659993146'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2009/12/ignoring-multiple-files-in-subversion.html' title='Ignoring multiple files in Subversion using command line'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-2264713711283680336</id><published>2009-10-10T09:36:00.000+03:00</published><updated>2009-10-10T09:36:23.324+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Netbeans 6.8 M2 dropped embedded browser</title><content type='html'>&lt;a href="http://www.netbeans.org/servlets/NewsItemView?newsItemID=1429"&gt;Netbeans 6.8 M2&lt;/a&gt; was just released. The sad news for Linux users is that it misses the embedded browser for this OS. It &lt;a href="http://java-hamster.blogspot.com/2009/08/java-browser.html"&gt;was present in M1&lt;/a&gt;, but &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB68#section-NewAndNoteworthyNB68-EmbeddedBrowser"&gt;dropped in M2&lt;/a&gt; :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-2264713711283680336?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/2264713711283680336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=2264713711283680336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/2264713711283680336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/2264713711283680336'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2009/10/netbeans-68-m2-dropped-embedded-browser.html' title='Netbeans 6.8 M2 dropped embedded browser'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-3938995076901949456</id><published>2009-08-26T18:59:00.003+03:00</published><updated>2009-08-26T23:21:03.478+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ant'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='scripting'/><title type='text'>Accessing system properties from Ant build file</title><content type='html'>I need to do some tasks via shell scripts. Among those tasks are also ant scripts.  Sometimes I need to pass some arguments to ant script from shell scripts. I've found that this can be done through java system properties. Those properties are easily accessed from ant build file - just like properties declared in build file itself: &lt;i&gt;${property.name}&lt;/i&gt;&lt;br /&gt;Here is a brief example. The build file &lt;i&gt;cool-build.xml&lt;/i&gt;:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;project name="FunProject" default="work" basedir="."&amp;gt;&lt;br /&gt;    &amp;lt;target name="work"&amp;gt;&lt;br /&gt;        &amp;lt;echo message="my.cool.property=&lt;b&gt;${my.cool.property}&lt;/b&gt;"&amp;gt;&lt;br /&gt;    &amp;lt;/target&amp;gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We, run it with passed system property &lt;i&gt;my.cool.property&lt;/i&gt;:&lt;br /&gt;&lt;code&gt;ant -f cool-build.xml -Dmy.cool.property=1&lt;/code&gt;&lt;br /&gt;And the result is:&lt;br /&gt;&lt;code&gt;[echo] my.cool.property=1&lt;/code&gt;&lt;br /&gt;Just as expected :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-3938995076901949456?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/3938995076901949456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=3938995076901949456' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/3938995076901949456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/3938995076901949456'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2009/08/accessing-system-properties-from-ant.html' title='Accessing system properties from Ant build file'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-9220134913743181452</id><published>2009-08-26T14:07:00.005+03:00</published><updated>2009-08-26T20:46:46.781+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Swing'/><title type='text'>Java browser</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a href="http://bits.netbeans.org/netbeans/6.8/m1/"&gt;NetBeans 6.8 M1&lt;/a&gt; was released a few days ago. And it came with its own &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB68#section-NewAndNoteworthyNB68-EmbeddedBrowser"&gt;embedded browser&lt;/a&gt;! The browser looks good. Really good. Of cause there are some problems: crashes, hangs, no flash support. I also did not managed to login to my &lt;a href="https://mail.google.com/"&gt;gmail&lt;/a&gt; account with it :) But hey, it's just the initial release, so we can't be very demanding.&lt;br /&gt;It's worth notion that the browser is based on &lt;a href="https://developer.mozilla.org/en/XULRunner"&gt;Mozilla XULRunner&lt;/a&gt;. Which means that it is &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; related with &lt;a href="http://weblogs.java.net/blog/alex2d/archive/2009/06/_jwebpane_bof_s.html"&gt;mysterious JWebPane&lt;/a&gt; (based on &lt;a href="http://webkit.org/"&gt;WebKit&lt;/a&gt;). So, it looks like &lt;a href="http://www.sun.com/"&gt;Sun&lt;/a&gt; is forging two java browsers. Wow!&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-9220134913743181452?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/9220134913743181452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=9220134913743181452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/9220134913743181452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/9220134913743181452'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2009/08/java-browser.html' title='Java browser'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-6559917910863176079</id><published>2009-03-07T23:29:00.004+02:00</published><updated>2009-03-08T00:05:42.286+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grub'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandriva'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Failure with boosting HDD performance</title><content type='html'>Today I've read &lt;a href="http://www.tuxradar.com/content/more-linux-tips-every-geek-should-know"&gt;an article&lt;/a&gt; at &lt;a href="http://www.tuxradar.com"&gt;tuxradar.com&lt;/a&gt; with some Linux tips. In this article it is recommended to boots the performance of HDD. It is suggested to set options for &lt;span style="font-style:italic;"&gt;root&lt;/span&gt; to &lt;span style="font-style:italic;"&gt;defaults,relatime,data=writeback&lt;/span&gt; in &lt;span style="font-style:italic;"&gt;/etc/fstab&lt;/span&gt;&lt;br /&gt;So I did. Then rebooted and.. guess what? My Mandriva One 2009 failed to boot. Luckily this was not my first boot failure (and I guess not the last :D ). So, I had a &lt;a href="www.sysresccd.org/"&gt;SystemRescueCd&lt;/a&gt; an some live CDs at hand.&lt;br /&gt;First of all I've checked man for mount to get some info about &lt;span style="font-style:italic;"&gt;relatime&lt;/span&gt; and &lt;span style="font-style:italic;"&gt;data=writeback&lt;/span&gt; options. There is nothing special with former, but the latter is not so easy to use. Changing default value &lt;span style="font-weight:bold;"&gt;requires&lt;/span&gt; passing additional kernel boot parameter. E.g. &lt;span style="font-style:italic;"&gt;rootflags=data=journal&lt;/span&gt;. So modified the kernel row in my GRUB configuration file. But Mandriva still failed to boot. Then on some mailing list I've found that &lt;span style="font-style:italic;"&gt;rootflags&lt;/span&gt; should go directly after root option. This did not helped either.&lt;br /&gt;So, I changed all settings to original state. No faster HDD operations for me. At least for now...&lt;br /&gt;&lt;br /&gt;P.S. Just curious whether guys at &lt;a href="http://www.tuxradar.com"&gt;tuxradar.com&lt;/a&gt; actually try to apply theirs tricks themselves before urging others to do so.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-6559917910863176079?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/6559917910863176079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=6559917910863176079' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6559917910863176079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6559917910863176079'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2009/03/failure-with-boosting-hdd-performance.html' title='Failure with boosting HDD performance'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-1464748119696277011</id><published>2009-02-20T22:20:00.006+02:00</published><updated>2009-02-20T23:22:53.494+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Disabling Automounting HDD Aartitions in GNOME</title><content type='html'>&lt;div style="text-align: justify;"&gt;I have a multiple Linux distros installed on my PC. And each of them has its own &lt;code&gt;/boot&lt;/code&gt; partition. The most used Linux is Mandriva 2009.&lt;br /&gt;It seems to me that things went wrong after I played a bit with &lt;code&gt;gparted&lt;/code&gt; in Mandriva, but I'm not 100% sure. Anyway for unknown reason GNOME started mounting all partitions on the hard drive on my login.&lt;br /&gt;Not only this slows down the login time. This is also really annoying. In a Linux world when you like OS to mount some partition you simply edit &lt;code&gt;/etc/fstab&lt;/code&gt;. And when the Linux is messing you up it starts to stink like Windows...&lt;br /&gt;The core problem is for sure in user settings in GNOME because it neither happens for other users nor for other desktop environments.&lt;br /&gt;Playing with a GNOME Configuration Editor did not helped :(&lt;br /&gt;I even started to consider to switch desktop environment to xfce. But after some more googling and reading man pages for &lt;code&gt;fstab&lt;/code&gt; and &lt;code&gt;mount&lt;/code&gt; I finally found the solution.&lt;br /&gt;I simply added a following line for each partition I like to be not mounted:&lt;br /&gt;&lt;code&gt;/dev/sda2              /mnt/sda2      ext3    noauto,nouser  0 0&lt;/code&gt;&lt;br /&gt;And it works! :)&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-1464748119696277011?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/1464748119696277011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=1464748119696277011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/1464748119696277011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/1464748119696277011'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2009/02/disabling-automounting-hdd-aartitions.html' title='Disabling Automounting HDD Aartitions in GNOME'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-1308073365411433061</id><published>2009-01-25T13:48:00.004+02:00</published><updated>2009-01-25T14:02:32.535+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mandriva'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Making a microphone louder</title><content type='html'>Recently I've installed Mandriva 2009 on my aged desktop machine. And there (in Gnome) was a problem with microphone in Skype 2.0.0.72. In fact the microphone was very-very quiet.&lt;br /&gt;The solution was easy: I've installed gnome-alsamixer, run it and checked "&lt;span style="font-style: italic;"&gt;Mic Boost (+20bD)&lt;/span&gt;" option.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-1308073365411433061?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/1308073365411433061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=1308073365411433061' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/1308073365411433061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/1308073365411433061'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2009/01/making-microphone-louder.html' title='Making a microphone louder'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-6989603733849791668</id><published>2008-11-01T23:31:00.000+02:00</published><updated>2008-11-01T23:33:19.095+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Printing from Java with CUPS 1.3+</title><content type='html'>&lt;div style="text-align: justify;"&gt;I had a problem with printing from the Java application on my Fedora 9. The problem was quite strange and reproducible on both Java 1.5. and 1.6. It was even more strange because it appeared only after I've updated my Fedora to version 9.&lt;br /&gt;It turned out that the problem was on the level where Java meets CUPS 1.3+. There is &lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6633656"&gt;a corresponding Sun's bug&lt;/a&gt;. There is no such problem for CUPS version lover than 1.3. It looks like Java had made too many assumption how CUPS should work... and CUPS guys changed some things in 1.3.&lt;br /&gt;As always Google came with help and &lt;a href="http://www.pikopong.com/blog/2008/09/09/java-printing-fix-for-linux-with-cups/"&gt;the solution&lt;/a&gt; was found.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-6989603733849791668?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/6989603733849791668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=6989603733849791668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6989603733849791668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6989603733849791668'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2008/11/printing-from-java-with-cups-13.html' title='Printing from Java with CUPS 1.3+'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-6699546162401919352</id><published>2008-10-31T23:21:00.002+02:00</published><updated>2008-10-31T23:30:02.703+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Swing'/><title type='text'>Java 1.4 on Fedora 9</title><content type='html'>Recently I needed to work on a legacy Swing project written on  Java 1.4. So, I've installed 1.4 JDK on my Fedora 9 and... got a following error:&lt;br /&gt;&lt;code&gt;/usr/java/j2sdk1.4.2_16/jre/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory occurred&lt;/code&gt;&lt;br /&gt;A little googling brought me to &lt;a href="http://forums.oracle.com/forums/thread.jspa?threadID=658929"&gt;the Oracle forum post&lt;/a&gt;. The problem was that AWT requires the &lt;b&gt;libXp&lt;/b&gt; package. After I've installed it the problem vanished :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-6699546162401919352?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/6699546162401919352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=6699546162401919352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6699546162401919352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6699546162401919352'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2008/10/java-14-on-fedora-9.html' title='Java 1.4 on Fedora 9'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-8955423262403119043</id><published>2008-05-30T22:45:00.005+03:00</published><updated>2008-05-30T23:33:52.599+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><title type='text'>Java 1.6 on Mac... at last!</title><content type='html'>&lt;div style="text-align: justify;"&gt;It is here. After 1.5 years. &lt;a href="http://www.apple.com/support/downloads/javaformacosx105update1.html"&gt;Java 1.6 on Mac&lt;/a&gt;. But... it is only for the Leopard and only for 64-bit Intel machines.&lt;br /&gt;PPC, 32-bit Intel and Tiger folks are currently still out of the board.&lt;br /&gt;There are two interesting facts regarding this Apple's release.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It was not announced on Apple Developer Connection &lt;a href="http://developer.apple.com/rss/topic/java.rss"&gt;Java topics RSS&lt;/a&gt;. In fact that feed is useless. I'm still receiving here a bunches of 3 identical notifications about release notes for Java on Mac 10.5.  The date when this document was published is 2007-10-31. Yeah, after 6 month Apple still reminds me (and the other subscribers of that feed) about such "news".&lt;/li&gt;&lt;li&gt;Almost month passed since Java 1.6 on Mac release. And there is complete silence about this event on &lt;a href="http://community.java.net/javadesktop/"&gt;the Desktop community on java.net&lt;/a&gt;. This is rather strange - there was a lot of complains about long absence of this release (e.g. &lt;a href="http://feeds.feedburner.com/%7Er/RawBlock/%7E3/177670899/still-no-java-16-on-mac-os-x-leopard.html"&gt;here&lt;/a&gt; and &lt;a href="http://www.cafeaulait.org/#October_15_2007_75063"&gt;here&lt;/a&gt;).&lt;/li&gt;&lt;/ol&gt;Anyway, it's good it is here.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-8955423262403119043?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/8955423262403119043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=8955423262403119043' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/8955423262403119043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/8955423262403119043'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2008/05/java-16-on-mac-at-last.html' title='Java 1.6 on Mac... at last!'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-7734046958501664338</id><published>2008-05-07T00:03:00.005+03:00</published><updated>2008-05-07T01:00:03.147+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><title type='text'>Running TestNG on NetBeans 6.0</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a href="http://testng.org/"&gt;TestNG&lt;/a&gt; is a great testing framework. And it's much more powerful than &lt;a href="http://www.junit.org/"&gt;JUnit&lt;/a&gt;.&lt;br /&gt;The problem for &lt;a href="http://www.netbeans.org/community/releases/60/"&gt;NetBeans 6.0&lt;/a&gt; users is that there is no plugin for TestNG. I've spend a lot of time before I managed to run TestNG in a simple way. After some time I've figured out that the main obstacle is that NetBeans does not recognizes TestNG classes as &lt;span style="font-style: italic;"&gt;test&lt;/span&gt; classes. And this was the key to success.&lt;br /&gt;&lt;a class="bundle_display_name"&gt;&lt;/a&gt;I've successfully run the tests using &lt;a href="http://testng.org/doc/documentation-main.html#running-testng"&gt;its command line&lt;/a&gt; and NetBeans &lt;span style="font-style: italic;"&gt;Run&lt;/span&gt; feature. And it was done on the NetBeans &lt;a class="bundle_display_name"&gt;Java SE bundle (the simplest one).&lt;/a&gt;&lt;br /&gt;So, here are the simple steps to launch TaestNG on NetBeans:&lt;br /&gt;&lt;/div&gt;&lt;ol style="text-align: justify;"&gt;&lt;li&gt;Project Properties -&gt;  Libraries. Compile-time libraries must contain testng-XXX.jar (where XXX is your TestNG version). Also Run-time libraries must contain the path to your compiled tests (if you put your test to default &lt;span style="font-style: italic;"&gt;test&lt;/span&gt; directory, than the path to compiled tests should be &lt;span style="font-style: italic;"&gt;build/test/classes&lt;/span&gt;).&lt;/li&gt;&lt;li&gt;Create TestNG xml file(s). There are &lt;a href="http://testng.org/doc/documentation-main.html#testng-xml"&gt;instructions&lt;/a&gt; how to build such file in the framework site. E.g. create &lt;span style="font-style: italic;"&gt;testng.xml&lt;/span&gt; and put it in the project root&lt;tt&gt;.&lt;/tt&gt;&lt;/li&gt;&lt;li&gt;Project Properties -&gt; Run. Create new configuration. You may name is testNG ;) &lt;span style="font-style: italic;"&gt;&lt;/span&gt;Enter &lt;span style="font-style: italic;"&gt;org.testng.TestNG &lt;/span&gt;as the Main Class. Put your TestNG xml file(s) as &lt;span style="font-style: italic;"&gt;Arguments&lt;/span&gt;. Multiple xml files should be separated by space. Enter your project directory as &lt;span style="font-style: italic;"&gt;Working Directory&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div style="text-align: justify;"&gt;Congratulations! Now you can run your TestNG tests through NetBeans &lt;span style="font-style: italic;"&gt;Run&lt;/span&gt; feature.&lt;br /&gt;&lt;br /&gt;P.S. Even if there will be only one person on Earth who saves a few hours this post worth its writing.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-7734046958501664338?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/7734046958501664338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=7734046958501664338' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/7734046958501664338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/7734046958501664338'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2008/05/running-testng-on-netbeans-60.html' title='Running TestNG on NetBeans 6.0'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-6068430287797194385</id><published>2008-03-03T07:48:00.005+02:00</published><updated>2008-03-11T23:45:32.719+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Regular method call vice call through reflection</title><content type='html'>&lt;div style="text-align: justify;"&gt;A few weeks ago I had a pleasure to discuss some Java topics with three Java guys. Each of them has much more experience than I do. One of those topics was a performance of method call through reflection vice regular method call. Those three guys were confident that the difference in performance is not significant. And I argued that it is. Our discussion ended, but I was curious what is that difference.&lt;br /&gt;So, &lt;span style="font-style: italic;"&gt;here is the little test I wrote,&lt;/span&gt; sound like &lt;a href="http://www.lyricsondemand.com/onehitwonders/dontworrybehappylyrics.html"&gt;the famous song of Bobby McFerrin&lt;/a&gt; ;) :&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import java.lang.reflect.Method;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class ReflectionSpeedTest {&lt;br /&gt;   &lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        int times = 100000;&lt;br /&gt;        long simpleCallTime = simpleCall(times);&lt;br /&gt;        long reflectionCallTime = reflectionCall(times);&lt;br /&gt;       &lt;br /&gt;        System.out.println("number of calls: " + times);&lt;br /&gt;        System.out.println("simple call time: " + simpleCallTime);&lt;br /&gt;        System.out.println("reflection call time: " + reflectionCallTime);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    private static long simpleCall(int times) {&lt;br /&gt;        ReflectionSpeedTest worker = new ReflectionSpeedTest();&lt;br /&gt;       &lt;br /&gt;        long time = System.currentTimeMillis();&lt;br /&gt;       &lt;br /&gt;        for (int i = 0; i &lt; times; i++) {&lt;br /&gt;            worker.doWork();&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;        return System.currentTimeMillis() - time;&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;    private static long reflectionCall(int times) {&lt;br /&gt;        try {&lt;br /&gt;            Class workerClass = Class.forName("ReflectionSpeedTest");&lt;br /&gt;            Object workerInstance = workerClass.newInstance();&lt;br /&gt;            Method method = workerClass.getMethod("doWork", null);&lt;br /&gt;&lt;br /&gt;            long time = System.currentTimeMillis();&lt;br /&gt;&lt;br /&gt;            for (int i = 0; i &lt; times; i++) {&lt;br /&gt;                method.invoke(workerInstance, null);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            return System.currentTimeMillis() - time;&lt;br /&gt;        } catch (Exception e) {&lt;br /&gt;            throw new RuntimeException(e);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    public void doWork() {&lt;br /&gt;        int i = 5 * 6;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;You can download this test from &lt;a href="http://www.inworg.com/uploads/1d1e2b3300/reflectionspeedtest.java"&gt;inworg.com&lt;/a&gt; if you want try it by yourself. Regularly the whole java poem is needed to call a single method through reflection (you need the class, the method and often also the instance).  This test does not tests that case. Only method call is measured.&lt;br /&gt;On my machine running openSUSE 10.3 the reflection call was more than 10 times slower. For sure, this difference may be not so significant for heavy methods, but for light ones it is.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-6068430287797194385?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/6068430287797194385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=6068430287797194385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6068430287797194385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6068430287797194385'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2008/03/regular-method-call-vice-call-through.html' title='Regular method call vice call through reflection'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-6078488594541769532</id><published>2008-01-21T23:21:00.000+02:00</published><updated>2008-01-21T23:46:36.332+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>openSUSE 10.3 and microphone</title><content type='html'>Recently I've bought a microphone. While this device works fine without configuring on MS Windows, you need to apply some efforts to make it work on Linux.&lt;br /&gt;On my current system (openSUSE 10.3) the sound recorder application KRecord did not recorded anything :) I've played with KMix for some time but I did not managed to record anything. Fortunately, I have more luck with Skype.&lt;br /&gt;As it is correctly emphasized on some forums, the key option for making the microphone work fine on Linux is KMix &gt; Switches &gt; Mic Boost. It was disabled on my openSUSE by default. And if this option is disabled, your voice is almost not heard.&lt;br /&gt;The bad thing is that this option is not saved. So, you have to enable it every time you boot your system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-6078488594541769532?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/6078488594541769532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=6078488594541769532' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6078488594541769532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/6078488594541769532'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2008/01/opensuse-103-and-microphone.html' title='openSUSE 10.3 and microphone'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-3408467427770111549</id><published>2007-10-05T18:03:00.000+03:00</published><updated>2007-11-19T18:51:23.672+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Drag-n-drop on Mac</title><content type='html'>&lt;a href="http://www.apple.com/mac/"&gt;The Macs&lt;/a&gt; are the strange creatures. They have quite strange behavior of the &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/dnd/DropTargetListener.html"&gt;DropTargetListener&lt;/a&gt;. It does not matter whether drag is accepted or rejected on dragEnter() and dragOver(). If the drop occurs, the drop() is called. &lt;br /&gt;It is done more conveniently on Linux. After rejecting drag the drop() wont be called.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-3408467427770111549?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/3408467427770111549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=3408467427770111549' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/3408467427770111549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/3408467427770111549'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2007/10/drag-n-drop-on-mac.html' title='Drag-n-drop on Mac'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-782421686038897595</id><published>2007-10-05T17:55:00.000+03:00</published><updated>2007-10-05T18:03:21.525+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Swing'/><title type='text'>Japanese characters</title><content type='html'>I recently had a problem with Japanese. Namely, Japanese characters were not shown in a Swing application. Those characters were displayed fine in the window title only.&lt;br /&gt;The solution was really easy. I've found it on &lt;a href="http://forum.java.sun.com/thread.jspa?threadID=557331&amp;amp;messageID=3912016"&gt;Sun Swing forum&lt;/a&gt;. The problem was that application font did not supported Unicode characters. After changing it to e.g. "Arial Unicode MS" all characters were shown correctly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-782421686038897595?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/782421686038897595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=782421686038897595' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/782421686038897595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/782421686038897595'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2007/10/japanese-characters.html' title='Japanese characters'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-3298269708619415700</id><published>2007-06-25T13:12:00.001+03:00</published><updated>2008-05-29T13:05:00.341+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Troubles with java.awt.Desktop browse() method</title><content type='html'>New &lt;a href="http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/"&gt;Desktop features&lt;/a&gt; were added in Java 6. One of those features is &lt;a href="http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse%28java.net.URI%29"&gt;browse(URI uri)&lt;/a&gt; method, which launches the user-default browser to show a specified        URI.&lt;br /&gt;So, it is quite easy to show some web-page to user: check if desktop is supported, then check if BROWSE action is supported and call browse() method. Here is some code chunk:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&lt;br /&gt;try {&lt;br /&gt;    if (Desktop.isDesktopSupported()) {&lt;br /&gt;        Desktop desktop = Desktop.getDesktop();&lt;br /&gt;              if (desktop.isSupported(Desktop.Action.BROWSE)) {&lt;br /&gt;            desktop.browse(new URI("http://www.sun.com"));&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;} catch (Exception e) {&lt;br /&gt;        e.printStackTrace();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;Everything seams to be fine. But when you run it on Fedora 6 on KDE it ends up with&lt;br /&gt;&lt;code&gt;&lt;br /&gt;java.io.IOException: Failed to show URI:http://www.sun.com&lt;br /&gt;     at sun.awt.X11.XDesktopPeer.launch(XDesktopPeer.java:75)&lt;br /&gt;     at sun.awt.X11.XDesktopPeer.browse(XDesktopPeer.java:64)&lt;br /&gt;     at java.awt.Desktop.browse(Desktop.java:368)&lt;br /&gt;     at Main.main(Main.java:12)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;So, you go to &lt;a href="http://bugs.sun.com/bugdatabase/"&gt;Sun's bug database&lt;/a&gt; and start searching what is going on. And here it is: &lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6486393"&gt;bug &lt;/a&gt;&lt;span&gt;&lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6486393"&gt;6486393&lt;/a&gt; (&lt;/span&gt;&lt;span&gt;Need a KDE support in java.awt.Desktop class&lt;/span&gt;&lt;span&gt;). So, it turns out that &lt;q&gt;Desktop API was developed to support Windows and Gnome only&lt;/q&gt;. Upps.&lt;br /&gt;OK, you are switching to Gnome on the same Fedora 6, run the example again and... you have the same exception. It does not work.&lt;br /&gt;Two question are arising to Sun's engineers:&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;Why KDE is simply ignored? &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Is it so difficult to add support even for Gnome that works?&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-3298269708619415700?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/3298269708619415700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=3298269708619415700' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/3298269708619415700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/3298269708619415700'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2007/06/troubles-with-javaawtdesktop-browse.html' title='Troubles with java.awt.Desktop browse() method'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-8605867219026886395</id><published>2007-06-18T12:10:00.000+03:00</published><updated>2007-06-18T12:13:28.244+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Swing'/><title type='text'>The Pain With Java System Tray On KDE Desktop</title><content type='html'>&lt;a href="http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/systemtray/"&gt;System Tray&lt;/a&gt; came to us with Java 6. It is great feature we were waiting for a long time. Its functionality was very limited. Nevertheless many java developers were happy (including me).&lt;br /&gt;Unfortunately, this new functionality came with problems. Namely one BIG problem. System tray &lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6448876"&gt;does not work on KDE desktop&lt;/a&gt;. Bug with ID 6448876. Yes, it still exists. The really bad thing with the bag is that it looks like it WONT BE FIXED before Java 7. If you look at the user comments to the bag, you can see how many developers are frustrated with it. But it is marked as "closed", so it is ignored by Sun engineers.&lt;br /&gt;I clearly realize MS Windows is OS of overwhelming majority of PC abound the globe. But there are also a lots of PC under Linux platform. And KDE is very popular desktop among Linux users. For those users Java system tray does not work. And wont work in the nearest future.&lt;br /&gt;The good news is that Sun JRE is not the only one. There are also BEA &lt;a href="http://commerce.bea.com/products/weblogicjrockit/jrockit_prod_fam.jsp"&gt;JRockit&lt;/a&gt; and IBM &lt;a href="https://www14.software.ibm.com/iwm/web/cc/earlyprograms/ibm/java6/index.shtml"&gt;IBM Early Release Program SDK 6&lt;/a&gt;. The latter is some kind of beta and is not available for MS Windows. On BOTH of them system tray works. And both of them have two problems:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;they are rarely installed on regular Linux user PCs;&lt;/li&gt;&lt;li&gt;they have 32/64 bit CPU problem (which Sun Java does not have).&lt;/li&gt;&lt;/ul&gt;The 32/64 but CPU problem (my term :) ) is that there are a lots of 32 bit Linux installations on 64 bit PCs. You can't install 64 bit Java on such machines. 32 bit Java is the only choice. Both BEA and IBM 32 bit Java's don't work well on such machines.&lt;br /&gt;The conclusion is: if you have a big desktop application which needs system tray functionality, you have a big headache with making it run correctly on KDE desktop.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-8605867219026886395?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/8605867219026886395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=8605867219026886395' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/8605867219026886395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/8605867219026886395'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2007/06/pain-with-java-system-tray-on-kde.html' title='The Pain With Java System Tray On KDE Desktop'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1511806127926239797.post-8932532922241855179</id><published>2007-06-16T17:46:00.000+03:00</published><updated>2007-06-16T18:13:29.683+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Browser support for jar protocol</title><content type='html'>I've just discovered that &lt;a href="http://docs.sun.com/source/819-0913/author/jar.html#jarprotocol"&gt;jar protocol&lt;/a&gt; (jar:&lt;url&gt;!/{entry}) is rarely supported by web browsers.&lt;br /&gt;For testing I've used the link found accidentally on the web: &lt;a href="jar:http://wiki.netbeans.org/wiki/attach/AutoupdateAPI/org-netbeans-modules-autoupdate-services.zip%21/index.html"&gt;jar:http://wiki.netbeans.org/wiki/attach/AutoupdateAPI/org-netbeans-modules-autoupdate-services.zip!/index.html&lt;/a&gt;.&lt;br /&gt;MS IExplorer failed to open it.&lt;br /&gt;The same was with Opera.&lt;br /&gt;In fact the only browser that manager to open it was Firefox.&lt;br /&gt;I also tried Konqueror. Just for fun. As you can guess, it don't support jar protocol too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1511806127926239797-8932532922241855179?l=java-hamster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-hamster.blogspot.com/feeds/8932532922241855179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1511806127926239797&amp;postID=8932532922241855179' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/8932532922241855179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1511806127926239797/posts/default/8932532922241855179'/><link rel='alternate' type='text/html' href='http://java-hamster.blogspot.com/2007/06/browser-support-for-jar-protocol.html' title='Browser support for jar protocol'/><author><name>Andriy Tsykholyas</name><uri>https://profiles.google.com/102402480596046951344</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-N5yGLJ6m-so/AAAAAAAAAAI/AAAAAAAAD3w/MwEJGQYFM8Q/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
