<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Virgo&#039;s Naive Stories</title>
	<atom:link href="http://virgo47.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://virgo47.wordpress.com</link>
	<description>Technology (Java mostly), games, music, or whatever just pisses me off. And maybe stories.</description>
	<lastBuildDate>Sat, 11 May 2013 07:27:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='virgo47.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Virgo&#039;s Naive Stories</title>
		<link>http://virgo47.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://virgo47.wordpress.com/osd.xml" title="Virgo&#039;s Naive Stories" />
	<atom:link rel='hub' href='http://virgo47.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Git Bash Here in Console2 in Total Commander with keyboard shortcut (hotkey)?</title>
		<link>http://virgo47.wordpress.com/2013/05/05/git-bash-here-in-console2-in-total-commander-with-keyboard-shortcut-hotkey/</link>
		<comments>http://virgo47.wordpress.com/2013/05/05/git-bash-here-in-console2-in-total-commander-with-keyboard-shortcut-hotkey/#comments</comments>
		<pubDate>Sun, 05 May 2013 17:12:22 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[virtual-life]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[console2]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[hotkey]]></category>
		<category><![CDATA[keyboard shortcut]]></category>
		<category><![CDATA[total commander]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=666</guid>
		<description><![CDATA[Not sure whether I ever made longer title &#8211; but as I had to Google a lot about it and even wrote to Total Commander support email I decided to put it “on paper”. I wanted to press a keyboard shortcut to open Git Bash in Console2 (default window is just as terrible as “cmd”, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=666&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p dir="ltr" id="docs-internal-guid-2b9445f4-75a9-332c-baa1-58b010ea6083">Not sure whether I ever made longer title &#8211; but as I had to Google a lot about it and even wrote to Total Commander support email I decided to put it “on paper”. I wanted to press a keyboard shortcut to open Git Bash in Console2 (default window is just as terrible as “cmd”, marking, copying and pasting is just pure pain). Of course in current directory.</p>
<p dir="ltr">Because I have installed Cygwin as well and had it as a default shell for Console2, I decided to add a new tab configuration like this:</p>
<p dir="ltr"><img class="aligncenter" alt="" src="https://lh3.googleusercontent.com/raKFMZjKGW1EZ3B-S_qIHkJaFcw18Frb2ktmvJqTSPmYUWIUf6AlMaLYpV31DITJG5HFPpIGMfepCWLgRWYrlBMglIrHLZ2ohcgYbXhchpRWD-dHIMvXbHkjEA" width="544px;" height="333px;" /></p>
<p dir="ltr">Main menu: <strong>Edit-Settings-Tabs-Add</strong> and then fill up things accordingly</p>
<p dir="ltr">Now the Total Commander part. While I googled a lot how to assign my custom command to a shortcut (hotkey) maybe I used different keywords, maybe I was just unlucky&#8230; I wrote to support in the end. Answer goes as this (thanks to Christian Ghisler):</p>
<ol>
<li>
<p dir="ltr">Go to menu <strong>Configuration &#8211; Options</strong> (you can get here with <strong>Alt-O</strong> twice) &#8211; <strong>Misc</strong> (last option in the list on the left)</p>
</li>
<li>
<p dir="ltr">Choose your hotkey, I went for <strong>Ctrl+B</strong> (it doesn’t make any file “bold” I hope)</p>
</li>
<li>
<p dir="ltr">Click on the small magnifying glass</p>
</li>
<li>
<p dir="ltr">Click on <strong>usercmd.ini</strong> (all the way down)</p>
</li>
<li>
<p dir="ltr">Click on <strong>New</strong></p>
</li>
<li>
<p dir="ltr">Choose a name, e.g. <strong>em_git_bash_here</strong></p>
</li>
<li>
<p dir="ltr">Click <strong>OK</strong></p>
</li>
<li>
<p dir="ltr">Enter the details (see lower)</p>
</li>
<li>
<p dir="ltr">Click <strong>OK</strong> in all open dialogs</p>
</li>
</ol>
<p dir="ltr">Here is screenshot of the settings in Total Commander:</p>
<p dir="ltr"><img class="aligncenter" alt="" src="https://lh5.googleusercontent.com/sUTXsoSYeIVKCGlKcOKDw8eho5JZNFZPu6JGlNp7NG9ZJsWlkv4LsKz4tntJjzPHV2cWWAzYpwC36Tea5kdKpl_kF8tc-YqY6uTZx9G9Xgv6_omhoRQZ80jUlQ" width="701px;" height="457px;" /></p>
<p dir="ltr">Here the <strong>-t</strong> obviously chooses the tab you want to open and <strong>-d</strong> sets the initial working directory.</p>
<p dir="ltr">BTW: The last dialog is the same like for a custom button. I actually found a blog about <a href="http://romankukla.blogspot.sk/2012/11/add-git-bash-here-button-in-total.html">how to add a custom button with Git Bash Here</a>, but assigning it to a hotkey was another story. Also running it in Console2 was easier than it seemed from various internet resources. Many advices pointed to the Windows Registry &#8211; but I didn’t want that.</p>
<p dir="ltr">Total Commander itself is a bit tricky. Don’t get me wrong, I love it and that’s why I have bought it (way too late, but I have) and also could appreciate support (right to the point). But when you want to find that <strong>%P</strong> is “current directory” you better google it. <strong>Ctrl+F</strong> in the Help window (very good one actually) does not help, because “source path” does not contain neither “current” nor “directory” obviously. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  With Internet at hand these are no problems at all.</p>
<p dir="ltr">BTW2: If you have your command in Total Commander named you can just reference it when you need it for button bar &#8211; don’t click on magnifying glass icon, just set Command value to “em_git_bash_here” (or however you named it) and you’re done.</p>
<p dir="ltr">Hope you made it with my procedure and my pictures. May the power of keyboard shortcuts (or hotkeys, whatever <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ) be with you!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/666/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/666/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=666&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2013/05/05/git-bash-here-in-console2-in-total-commander-with-keyboard-shortcut-hotkey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>

		<media:content url="https://lh3.googleusercontent.com/raKFMZjKGW1EZ3B-S_qIHkJaFcw18Frb2ktmvJqTSPmYUWIUf6AlMaLYpV31DITJG5HFPpIGMfepCWLgRWYrlBMglIrHLZ2ohcgYbXhchpRWD-dHIMvXbHkjEA" medium="image" />

		<media:content url="https://lh5.googleusercontent.com/sUTXsoSYeIVKCGlKcOKDw8eho5JZNFZPu6JGlNp7NG9ZJsWlkv4LsKz4tntJjzPHV2cWWAzYpwC36Tea5kdKpl_kF8tc-YqY6uTZx9G9Xgv6_omhoRQZ80jUlQ" medium="image" />
	</item>
		<item>
		<title>ZSE Ponuka E.Zľava?</title>
		<link>http://virgo47.wordpress.com/2013/04/16/zse-ponuka-e-zlava/</link>
		<comments>http://virgo47.wordpress.com/2013/04/16/zse-ponuka-e-zlava/#comments</comments>
		<pubDate>Tue, 16 Apr 2013 21:32:45 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[real-life]]></category>
		<category><![CDATA[elektrina]]></category>
		<category><![CDATA[eon]]></category>
		<category><![CDATA[zse]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=661</guid>
		<description><![CDATA[This time in Slovak about how I was awarded 0% discount from my electricity retailer. Sorry for being silent lately, I have a lot of work and no steam to write here right now. S neodolateľnou ponukou E.Zľava od svojho seriózneho dodávateľa ZSE (člen skupiny e-on) som sa prvýkrát stretol, keď nám ju poslali poštou. [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=661&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p dir="ltr" id="internal-source-marker_0.16730177217772457"><em>This time in Slovak about how I was awarded 0% discount from my electricity retailer. Sorry for being silent lately, I have a lot of work and no steam to write here right now.</em></p>
<p dir="ltr">S neodolateľnou ponukou E.Zľava od svojho seriózneho dodávateľa ZSE (člen skupiny e-on) som sa prvýkrát stretol, keď nám ju poslali poštou. Keďže v nej išlo aj o nejaké asistenčné služby a navyše viazanosť, nebol som si istý, či ju chcem &#8211; takže som ju jednoducho neriešil.</p>
<p dir="ltr">Lenže potom som raz dostal návštevu, ktorá mi to všetko vysvetlila. Asistenčné služby sme nechceli, ale zľavu za viazanosť&#8230; povedal som si, keď už je chlapík tu, prečo nie. Veci mi boli vysvetlené, ale z mojej strany išlo aj o istú mieru dôvery, keďže som jednal so spoločnosťou, ktorej zákazník som už nejaký čas, bla, bla, bla.</p>
<p dir="ltr">Chlapík odišiel, ja som vyrazil na web &#8211; a ľaľa ho, aj takéto články som našiel:</p>
<ul>
<li>
<p dir="ltr"><a href="http://byvanie.pravda.sk/peniaze-a-paragrafy/clanok/20257-verni-zakaznici-zlavu-od-energetikov-nedostali/">Verní zákazníci zľavu od energetikov nedostali</a></p>
</li>
<li>
<p dir="ltr"><a href="http://ekonomika.sme.sk/c/6322701/na-elektrinu-zlakali-aj-nulovou-zlavou.html">Na elektrinu zlákali aj nulovou zľavou</a></p>
</li>
</ul>
<p dir="ltr">Tak som sa podujal, že im napíšem, a tentoraz to bolo od srdca. Odpoveď som od 5. januára nedostal.</p>
<blockquote>
<p dir="ltr"><em>Vážená ZSE</em></p>
<p dir="ltr"><em>Elektrinu od Vás odoberáme už vyše 6 rokov a nemal som v úmysle na tejto skutočnosti nič meniť. To sa všetko zmenilo počas uplynulej hodiny.</em></p>
<p dir="ltr"><em>Dnes sa u mňa zastavil zástupca vašej spoločnosti, pán G. (Gxxx? Gxxxx? ťažko to rozlúštiť) ohľadom E.Zľavy. Ja som hovoril, že sme neporozumeli celej ponuke na asistenčné služby, ktorá nám už skôr prišla &#8211; bola pre nás krajne neprehľadná. Váš zástupca túto vec neriešil, išlo len o ponuku zľavy. Celú dobu sa hovorilo o 4%, chvíľu som to študoval, ale zase som nechcel veľmi zdržiavať.</em></p>
<p dir="ltr"><em>Myslel som si, že ZSE je totiž seriózna spoločnosť. Váš zástupca o.i. povedal aj to, že ak by som aj prestúpil inam (čo som neplánoval), tak by som prišiel len o zľavu. Toto neviem potvrdiť, keďže dodatkom sa upravuje doba platnosti pôvodnej zmluvy na dobu určitú a musel by som zrejme podrobne študovať aj tú, čo by skoršie ukončenie znamenalo.</em></p>
<p dir="ltr"><em>Vrcholom všetkého je, že sme rodina s dvomi deťmi v 4-izbovom byte, varíme na elektrike takmer každý deň (malé deti) a naša spotreba je pod 3MWh, čo znamená (ako asi viete) 0% zľavu. Aj pri 4% by som ušetril možno 3 eurá, keďže ide o 3 mesiace (čo zástupca zabudol pripomenúť), aj to nie z celej sumy (na to našťastie upozornil).</em></p>
<p dir="ltr"><em>Takže kvôli možno 3 eurám (v mojom prípade 0) ma zástupca &#8220;serióznej&#8221; spoločnosti musí otravovať osobne doma, vysvetlenie dopadov zmluvy zďaleka nedostahuje kvality podpriemerného poisťovacieho agenta a navyše mám teraz zmluvu na dobu určitú, pričom predtým som sa o ňu nemusel a NECHCEL starať.</em></p>
<p dir="ltr"><em>Reči o tom, že &#8220;asi len zisťujú, aký kmeň im ostal&#8221;, alebo odpoveď na otázku, prečo nemôžu zľavu prosto len tak priznať v zmysle &#8220;obchodníci nemajú prístup k osobným údajom&#8221;&#8230; už tu som mal začať tušiť problémy. Len kvôli značke ZSE som to podpísal, alternatívneho operátora by som vyhodil dávno, alebo by som si pred ním išiel na Internet vyhľadať názorové články o jeho serióznosti.</em></p>
<p dir="ltr"><em>Takto si dávam do kalendára na december poznámku, že sa treba poobzerať po inom dodávateľovi elektrickej energie. Možno by som si to rozmyslel, keby ste mi originál môjho dodatku doručili späť a najbližšie ma otravovali s niečím, čo mi naozaj ušetrí peniaze. Takto totiž naopak iba plytváte mojím časom, o trpezlivosti nehovoriac.</em></p>
<p dir="ltr"><em>S pozdravom</em></p>
<p dir="ltr"><em>Richard Richter</em></p>
<p dir="ltr"><em>zák.č. xxxx</em></p>
</blockquote>
<p dir="ltr">Trochu ma to celé prekvapilo, keďže &#8211; hoci na Slovensku &#8211; na mňa ako už existujúceho zákazníka podobné finty zatiaľ neskúšal ani žiadny operátor internetu či telefónie, ani moja banka, proste nikto.</p>
<p dir="ltr">Mimochodom, dnes už ponúkajú 4% od 2MWh ročne, čo by sa nás už týkalo. Ale nič to nemení na fakte, že ide o jednotky Eur. Takže nechtiac, ale predsa, budem musiet koncom roka riešiť nejakú zmluvu na energiu. A nevidím dôvod, prečo ju zase riešiť so ZSE.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/661/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/661/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=661&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2013/04/16/zse-ponuka-e-zlava/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>
	</item>
		<item>
		<title>Happy New Year 2013!</title>
		<link>http://virgo47.wordpress.com/2013/01/02/happy-new-year-2013/</link>
		<comments>http://virgo47.wordpress.com/2013/01/02/happy-new-year-2013/#comments</comments>
		<pubDate>Wed, 02 Jan 2013 11:33:53 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[real-life]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[virtual-life]]></category>
		<category><![CDATA[2013]]></category>
		<category><![CDATA[gradle]]></category>
		<category><![CDATA[maschine mikro]]></category>
		<category><![CDATA[new year]]></category>
		<category><![CDATA[querydsl]]></category>
		<category><![CDATA[recording]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=655</guid>
		<description><![CDATA[Happy New year, of course! My last year was a bit poorer blog-wise. For some reasons I was more lazy to write about things. Heck, sometimes I think that I was less lucky with new technology in overall. I achieved some nice results with testing in our company during the previous year. This year I [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=655&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Happy New year, of course! My last year was a bit poorer blog-wise. For some reasons I was more lazy to write about things. Heck, sometimes I think that I was less lucky with new technology in overall. I achieved some nice results with testing in our company during the previous year. This year I wanted to push Continuous Integration, testing a bit further, maybe Gradle &#8211; but results in CI area are mixed and the rest brought no real results at all.</p>
<p>On the brighter side, I managed to finish my quest for system time shifter on JVM that would be usable for testing purposes &#8211; all <a href="http://virgo47.wordpress.com/2012/06/22/changing-system-time-in-java/">documented in my post</a>. Blogging is not all of course and I am quite happy how topics around Clean Code got some attention around me. We pushed Java Simon project a bit further too, I learned a few interesting things around Spring, MVC and jQuery&#8230; Add this <a href="https://www.coursera.org/course/progfun">beautiful Scala class on Coursera</a> and this year was more than fun after all.</p>
<p>Still I’d like to make some resolutions. I discovered <a href="http://www.querydsl.com/">QueryDSL</a> (thanks to a colleague of mine) and this seems to be answer to readable and compile time safe Criteria &#8211; because those shipped with JPA2 are simply horrible to read. It works well with IDEA’s annotation processor, Maven and it should be no problem with Gradle either. Ah, <a href="http://www.gradle.org/">Gradle</a>! For around two years I’m watching this guy but for whatever reason I was not able to use it for anything more than a few tests &#8211; but that is not Gradle’s fault. I like it, I like the idea, I like the language &#8211; and I think this year is time to switch <a href="http://code.google.com/p/javasimon/">Java Simon</a> from Maven to Gradle. And after that I’ll go on with projects in our company, although the battle there will be more difficult I guess.</p>
<p>Out of technology, I managed to put together a few songs with my colleagues and it was fun &#8211; the first time I played in something close to a band. We played only on our company party but it doesn’t change anything&#8230; it was a real fun. We didn’t have a drummer so I used my Native Instruments Maschine Mikro and pre-programmed our songs &#8211; and I was really happy with the results. I’ll probably dedicate a post to Maschine Mikro, because it is one really interesting controller (and software too!).</p>
<p style="text-align:center;"><a href="https://picasaweb.google.com/lh/photo/NmmEGd8YHhNmh2Mk5AclbtMTjNZETYmyPJy0liipFm0?feat=embedwebsite"><img alt="" src="https://lh3.googleusercontent.com/-2LLuUo_MynE/UOQXk4oXOkI/AAAAAAAATlc/t-caewsJ4AA/s288/IMG_6556.JPG" width="288" height="192" /></a><br />
Maschine Mikro controller</p>
<p>Talking about music, I managed to upload two full-blown tracks to <a href="https://soundcloud.com/virgo47">my Soundcloud</a> and later added two simple guitar+voice tracks. While mixing/mastering is still my weakness, I’m happy that I was able to pull through this recording-wise. And just how I imagined &#8211; my songs composed with paper, pen and acoustic guitar many years ago can really work as rock recording too.</p>
<p>So what about this year and those resolutions? Gradle &#8211; sure. More testing methodology on our projects &#8211; maybe I’ll even manage to document it here on the blog. Pushing Continuous delivery just a bit further again. Scala or other JVM language? I don’t know. Maybe, maybe for tests. And a bit of my music &#8211; I need to practice more with keyboard, guitar and bass guitar (yeah, I bought lovely Yamaha bass too).</p>
<p style="text-align:center;"><a href="https://picasaweb.google.com/lh/photo/Rm_TvBK2sCDMT6Bu9QBbtdMTjNZETYmyPJy0liipFm0?feat=embedwebsite"><img alt="" src="https://lh6.googleusercontent.com/-k5vDK7XXKcA/UOQWq9Vee_I/AAAAAAAATlM/5B4Xa8hAtFI/s288/IMG_7149.JPG" width="288" height="192" /></a><br />
Bass guitar Yamaha RBX375</p>
<p>Last resolution is no resolution at all &#8211; we have to survive somehow “socialistic” experiments of our government here in Slovakia (although there is nothing social about them). Europe has its own deal of problems &#8211; and USA? Well they saved themselves from falling down that fiscal cliff or what &#8211; just a few hours ago. And it probably means to make the cliff a bit higher for the next time. So we might have escaped one Doom’s day lately at the end of 2012, but who knows how our civilization will fare in the future.</p>
<p>Then I remember those really poor and I know we have nothing really horrible to complain about. So once again &#8211; Happy New year &#8211; and whole year of 2013!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/655/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=655&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2013/01/02/happy-new-year-2013/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>

		<media:content url="https://lh3.googleusercontent.com/-2LLuUo_MynE/UOQXk4oXOkI/AAAAAAAATlc/t-caewsJ4AA/s288/IMG_6556.JPG" medium="image" />

		<media:content url="https://lh6.googleusercontent.com/-k5vDK7XXKcA/UOQWq9Vee_I/AAAAAAAATlM/5B4Xa8hAtFI/s288/IMG_7149.JPG" medium="image" />
	</item>
		<item>
		<title>My last two years with technology</title>
		<link>http://virgo47.wordpress.com/2012/10/20/my-last-two-years-with-technology/</link>
		<comments>http://virgo47.wordpress.com/2012/10/20/my-last-two-years-with-technology/#comments</comments>
		<pubDate>Sat, 20 Oct 2012 22:37:36 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[real-life]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[virtual-life]]></category>
		<category><![CDATA[bluray]]></category>
		<category><![CDATA[crucial]]></category>
		<category><![CDATA[dvd]]></category>
		<category><![CDATA[easeus]]></category>
		<category><![CDATA[filedownload]]></category>
		<category><![CDATA[gnuwin]]></category>
		<category><![CDATA[htc]]></category>
		<category><![CDATA[jdbctemplate]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[lotus]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[planview]]></category>
		<category><![CDATA[samsung]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[ssd]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=650</guid>
		<description><![CDATA[I’ve been quite busy lately &#8211; hence the pause in my blogging. My last post was very specific Java related article, today we’re going to do something lighter &#8211; a little whine about various devices, gizmos and maybe even software/services I’ve encountered during the last two years. While generally I love our age for the [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=650&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I’ve been quite busy lately &#8211; hence the pause in my blogging. My last post was very specific Java related article, today we’re going to do something lighter &#8211; a little whine about various devices, gizmos and maybe even software/services I’ve encountered during the last two years. While generally I love our age for the current level of technology, sometimes I’m desperate seeing unnecessary flaws, often just software ones &#8211; and these can seriously affect the final experience. However, today I decided to add a lot of good examples, too, and every case should be short (though I’m bad at keeping stuff short <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ).</p>
<p>BTW: Now I see that this is actually sort of continuation of <a href="https://virgo47.wordpress.com/2010/12/24/not-so-christmas-technology-whining/">this post</a>.</p>
<p><strong>Phone case: HTC One V</strong></p>
<p>I like Android phones in general. And I like both my Wildfire and One V &#8211; however they both have quite funny flaws. Wildfire’s display is unresponsive when I pull it out of my pocket while ringing (that’s why I call back my friends right after I can’t pick them up) and One V &#8211; for a change &#8211; is very quite in-call. In both cases those are quite crucial phone related issues &#8211; and in both cases many people observe the same (but not all). Other than that &#8211; on Wildfire (2.x Android) I liked that default HTC clock application showed time of the next alarm and this view was removed from newer OS. Of course One V is faster and better in overall, but still&#8230; <strong>3 out of 5</strong> stars. Both.</p>
<p><strong>Partition case: EASEUS Partition Master Home Edition</strong></p>
<p>I wanted some free legal replacement for Partition Magic &#8211; and I found <a href="http://www.partition-tool.com/personal.htm">this</a>. It may not be all-powered tool for every thing around partitions, but it did anything I wanted and so far never failed. Partitions smaller or bigger? Merge partitions? (Here it actually needs enough space on the partition you are going to merge to for all the files from the other partition &#8211; but that’s rather a non-issue.) System copied to my new SSD disk? No problem. Using Windows repair process took much longer after that. <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  <strong>5/5</strong>! For free? Yes!</p>
<p><strong>Disc case: SSD drives (Crucial M4 in my case)</strong></p>
<p>Talking about SSD &#8211; well, technically it is indeed non-disk, but you know how it goes. SSD generally is fast, of course, but also cheap enough nowadays &#8211; so to put there your system volume at least is a really good idea. I did so and my computer runs and starts programs much faster. This is currently probably the best boost you can get for your money. CPU or memory or GPU? Phew&#8230; SSD made my computer fleet-footed. I can’t say more really, I somehow decided one day, checked the prices, cross-referenced all the new names for me (like Crucial, never heard of them before!), reviews were good, so I bought this one. And I’m not even having SATA3 on my mobo. <strong>5/5</strong></p>
<p><strong>Java case: Spring JdbcTemplate</strong></p>
<p>When I can I program against standard APIs &#8211; like JPA2 instead of Hibernate. When I can. Sometimes you need to go through the select cursor-style and while I could use underlying Hibernate, I decided to go straight for JDBC. And I wrote all the code. With ifs and wheres and parameters. After a couple of hours, I was done, piece was tested and then it hit me! “Man, there is supposed to be that Spring class making it much easier!” <a href="http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/jdbc.html#jdbc-JdbcTemplate">JdbcTemplate</a> made the job, I didn’t have to write my ifs twice (first to get the query, then the parameters again), all the exceptions were handled for me and there was even every case you could think about how to process the result set (in my case callback for every row of it). This is how I like stuff made. Documentation clear&#8230; actually I mostly just let IDEA to offer me the choices and I made them right there the right way thanks to proper names. Love that. <strong>5/5</strong></p>
<p><strong>JavaScript case: File download plugin for jQuery</strong></p>
<p>Check what <a href="http://johnculviner.com/post/2012/03/22/Ajax-like-feature-rich-file-downloads-with-jQuery-File-Download.aspx">this plugin</a> is about &#8211; and also <a href="http://jqueryfiledownload.apphb.com/">its demo</a>. Users sometimes want silly things like “can you disable the button after I press download&#8230;” (sure I can!) “&#8230;and then after download enable it again?” (are you crazy?!) But you can do it with this plugin based on hidden iframe and a cookie. I had to adjust it a bit because I had a corner case (but quite common) that there were no data and no download, which is third case from user’s perspective in addition to success and (server) failure. I’m no JavaScript expert, on the contrary &#8211; but I fell in love with jQuery in the process. And however silly HTTP is for delivering applications, things like jQuery and this plugin make it more bearable (though HTML5 and things like WebSocket mend a lot of my 10-year old concerns). For this plugin and the whole idea &#8211; <strong>5/5</strong>.</p>
<p><strong>Command-line case: GNU tools for Windows &#8211; GnuWin</strong></p>
<p>I never liked all that CygWin heavy-weighted stuff, but <a href="http://gnuwin32.sourceforge.net/packages.html">GnuWin packages</a> made my day. I just installed them, added c:\Program Files (x86)\GnuWin\bin into my PATH (they all go to the same dir, luckily) and stared cmd just to enjoy grep (package <strong>grep</strong>), awk (<strong>gawk</strong>), ls (and many more in <strong>coreutils</strong>), <strong>zip/unzip/gzip/tar/bzip2</strong> and of course <strong>sed</strong>! Mentioning typical Unix/Linux tools &#8211; you may also like (not related to GnuWin) <a href="http://www.vim.org/download.php#pc">vim</a>, though I’m happy with notepad2 for most cases (read second half of <a href="https://virgo47.wordpress.com/2011/05/13/javac-utf8-bom-and-notepad2/">this post</a>). But you never know when you need vim’s macros. But yeah, these are not really command line tools in Windows. GnuWin packages definitely are and they deserve <strong>5/5</strong> for making my life easier.</p>
<p><strong>Windows environment case: Rapid Environment Editor</strong></p>
<p>After so many times heading into System, Advanced, bla-bla, setting the PATH in that super short line I realized “there must be a better way and someone must have already fixed this”. Yes, they have &#8211; with <a href="http://www.rapidee.com/en/about">Rapid Environment Editor</a>. Adding new paths with this tool is just so much better, it checks whether the path is valid &#8211; even with other variables you are referencing (if those are paths, like JAVA_HOME for instance). No more needs to be added: <strong>5/5</strong></p>
<p><strong>Corporate tool case: Planview</strong></p>
<p>For me Planview is just a tool to report my hours. I don’t use its powerful project management features. And every time I need some report out of it I don’t understand the language it is speaking to me. This tool one of those tools forgetting that they are not my only primary tools I use. Honestly, I openly hate it. Terms out of other world, a lot of misuses of the application (not only mine actually), tons of discussion how we should use it &#8211; and still we’re not using it the right way. Personally &#8211; I blame the tool. I can use Jira, Confluence and many other tools without any problem, but Planview is simply killing me. <strong>1/5</strong> (and yup, it’s IE only)</p>
<p><strong>More-than-a-mail case: Lotus Notes</strong></p>
<p>Lotus &#8211; I think this is love or hate thing, but however defended by people who like it, it is still viewed as pain by the vast majority of users. My Lotus for instance doesn’t display mouse cursor in mail editor when it’s not focused window, wrongly shows which tab is selected when two are opened at once, pastes Excel tables is as image by default and there are many other silly defaults. Date you see in trash is trash date, not the date of the message? You can’t reply to mail in your sent mail?! My contacts get often screwed by some cashing I don’t understand and don’t care at all. Not to mention it doesn’t look like normal Windows application (not that I’m a big fan of Windows, but still). Once a colleague closed Notes by accident and I just thought it funny to remark “see, stupid Lotus Notes” &#8211; just because whatever bad happens there is kinda Notes’ fault. I read people testifying how Notes rocks, etc. But these people live in the closed world of Lotus. Linux guys can hate Outlook, but it is really usable. Lotus? As a mail and calendar? Not a chance here&#8230; <strong>2/5</strong></p>
<p><strong>Blu-ray case: Samsung BD-E6100</strong></p>
<p>Recently I’ve got myself a blu-ray player (finally). I wanted Samsung, because my TV is Samsung, price was alright, I chose model with wi-fi, brought it home and after some initial scare (it didn’t play any disk first, I had to unplug it and after this kind of restart it was fine) I was happy about its performance, speed and everything, especially compared to our older DVD player (newer Philips luckily have remotes for common people too, not only for snipers). I managed to play content from computers (with Serviio installed, though SRT subtitles don’t work unexpectedly) and remote control provided four crucial buttons for TV (on/off, Source, volume up/down) &#8211; actually many of buttons from Samsung TV remote work as well (expected). After some time I decided to plug ethernet cable in though, because wi-fi often lost the connection to the router (our notebooks never have the problem, even from the same place). Even with ethernet most of the Smart HUB stuff is quite slow. In overall it was a big upgrade compared to DVD player and I was actually surprised how well it works and plays. And Smart stuff? They still might upgrade it somehow and I didn’t buy it for that anyway. <strong>4/5</strong></p>
<p><strong>Conclusion</strong></p>
<p>Not once I was thinking about myself as a “toiletologist”, because I just think too much about every single flaw of toilets as well. I never could understand why we &#8211; mankind &#8211; are unable to develop total toilet that always flushes everything, why we again and again put urinals so close together that you can use only 2 of 3 in the end, why we put toilet cubicles with legs on shiny reflective floor, not to mention various silly ways how to screw with automation of flushing, washing, drying or whatever.</p>
<p>Sometimes I want to scream “how could you do such a silly mistake?” But then I realize: “Man, it’s just software, it’s meant to be buggy (not that I agree that much <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ), the whole computer science is so much younger compared to the building industry &#8211; and look what <em>they</em> are able to do in a silly way every now and then. Not only on toilets, but when these are still not ‘debugged’ after all those millennia then what should we expect from the software, hm?”</p>
<p>The more I am happy for technology that really helps and doesn’t “think” that it will be the only thing I need to pay attention to. I have my own real life beyond technology too, after all.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/650/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=650&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2012/10/20/my-last-two-years-with-technology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing system time in Java</title>
		<link>http://virgo47.wordpress.com/2012/06/22/changing-system-time-in-java/</link>
		<comments>http://virgo47.wordpress.com/2012/06/22/changing-system-time-in-java/#comments</comments>
		<pubDate>Fri, 22 Jun 2012 21:51:23 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[currentTimeMillis]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[jmockit]]></category>
		<category><![CDATA[JVM]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[mock]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[SystemTimeShifter]]></category>
		<category><![CDATA[testng]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=633</guid>
		<description><![CDATA[I always wanted to find some reasonable way how to tell JVM &#8220;hey, it&#8217;s 3:47 AM, January the first, 2000&#8243;. When you have a need like this you probably use some DateFactory pattern. People argue &#8211; &#8220;that&#8217;s the cleanest way, put it into the design!&#8221; However this comes with a price: This cleanest way means [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=633&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I always wanted to find some reasonable way how to tell JVM &#8220;hey, it&#8217;s 3:47 AM, January the first, 2000&#8243;. When you have a need like this you probably use some DateFactory pattern. People argue &#8211; &#8220;that&#8217;s the cleanest way, put it into the design!&#8221; However this comes with a price:</p>
<ul>
<li>This cleanest way means to pollute your code on many, many places with your DateFactory &#8211; one place where a programmer forgets and you&#8217;re screwed. No need to mention how difficult to trace these problems may be, though they are not difficult to locate when you find out what the problem is &#8211; because there is only one place where new Date() and/or System.currentTimeMillis() may appear &#8211; in your DateFactory class. (Now when I think of it, I&#8217;d probably come up with a technical solution to force this pattern, some Java language aware analysis tool searching for exactly these two calls.)</li>
<li>This DateFactory may or may not be dictated by the requirements &#8211; real, inherent ones, not derived from technical needs&#8230;</li>
<li>&#8230;actually, in many cases you need to shift time only because of the tests.</li>
</ul>
<p>When the application somehow implies DateFactory solution, so be it. There surely are systems where it makes sense. In my line of work, however, I messed with some kind of the DateFactory only because of the need to test the system on a specific date, or (in rare cases) to run some highly administrative feature as if it ran on a specific date. While the second case could be just right for the DateFactory, it wasn&#8217;t part of our main application code, but rather our migration/preparation/installation utilities and they were never run by the user. So if I had known about any other solution than DateFactory, I&#8217;d have gladly welcomed it. I hadn&#8217;t then.</p>
<p>Every single time this situation occurred I cursed JVM creators for not adding unified standard way how to mess with system time (guarded by security manager just in case), or some &#8220;java&#8221; command option, or whatever. My need arises again and again &#8211; especially during testing. It&#8217;s much harder to prepare time aware data (you have to generate/customize them every time) then declare &#8220;you run at this time!&#8221; Unless the second thing is impossible of course. But imagine you need to test specific billing job running on New Year&#8217;s Day. &#8220;Go for the DateFactory you moron!&#8221; Yeah, but imagine you have system with @Past annotation from Bean Validation framework. Guess how that one uses your DateFactory? Finally I got the idea &#8211; to mock it somehow. Mocking such a thing though is messing with JVM to a degree &#8211; as you will see later. Now let&#8217;s follow the story as it went&#8230;</p>
<h3>Solution: jmockit</h3>
<p>Actually &#8211; I wasn&#8217;t the first one. I found that other people wanted to use jmockit library to mock the system time. Jmockit is surely powerful library, more powerful than I can tell, because I actually (sorry to say that) suck in mocking. If you mock System.currentTimeMillis, you&#8217;re done (new Date() and all other ways to get the real time use this call). But how to mock this system static native call? Jmockit can do it, and it does it on the side of the callee &#8211; which means you don&#8217;t need to modify anything else &#8211; just set up the mock on the side of System class. During some troubleshooting I tried to use different mock libraries and different approaches, but unless I&#8217;m mistaken there are only two ways how to do it &#8211; on the caller&#8217;s side &#8211; or on the callee&#8217;s one. Callee is the right side, right? The same way how you have to pollute your code with DateFactory call, you&#8217;d have to enumerate, autoscan or whatever else your code in order to mock it on the caller&#8217;s side. No way to do this simply and completely when you think about dynamic class loading too and I bet you can throw many other problems on this solution. So I reiterate: *Mock the system time on the callee&#8217;s side.* (That is System class, obviously.) Jmockit can do just that.</p>
<p>First we need the class &#8220;overriding&#8221; currentTimeMillis &#8211; here it is (it can be nested class BTW, that&#8217;s why it&#8217;s static on my listing):</p>
<pre class="brush: java; title: ; notranslate">
import mockit.Mock;
import mockit.MockClass;
...
   @MockClass(realClass = System.class)
   public static class SystemMock {
       /**
        * Fake current time millis returns value modified by required offset.
        *
        * @return fake &quot;current&quot; millis
        */
       @Mock
       public static long currentTimeMillis() {
           return INIT_MILLIS + offset + millisSinceClassInit();
       }
   }
</pre>
<p>And now we will use this class:</p>
<pre class="brush: java; title: ; notranslate">
import mockit.Mockit;
...
           Mockit.setUpMock(SystemMock.class);
</pre>
<p>Done! From now on all time is changed for the JVM. Or is it? This solution actually has two problems. Let&#8217;s deal with the problem numero uno:</p>
<h3>Problem 1: you can&#8217;t call the original currentTimeMillis</h3>
<p>How can you base your shifted time on the real time, when you don&#8217;t have the original time now? It would be nice if you just could set the offset and your method simply returned non-mocked millis + the offset. Jmockit can mock the call, but then it is not possible to call the original method without the mock &#8211; not for static native calls. So if you use it, you&#8217;ll run out of stack in recursion gone wild.</p>
<p>Luckily since Java 5 we have System.nanoTime(). While nanoTime itself is not based on any real world time, we can still use it to determine the time since we set up the mock &#8211; if we remember what were nanoTime and currentTimeMillis before we did so &#8211; and it can be any particular time, for instance class initialization time:</p>
<pre class="brush: java; title: ; notranslate">
   private static final long INIT_MILLIS = System.currentTimeMillis();
   private static final long INIT_NANOS = System.nanoTime();
</pre>
<p>Now it&#8217;s easy to tell how might method called from my mock method look like:</p>
<pre class="brush: java; title: ; notranslate">
   private static long millisSinceClassInit() {
       return (System.nanoTime() - INIT_NANOS) / 1000000;
   }
</pre>
<p>The only thing you need to do now is to set offset in some meaningful way. I offer my whole solution wrapped in a class straightforwardly called SystemTimeShifter:</p>
<pre class="brush: java; collapse: true; light: false; title: ; toolbar: true; notranslate">
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import mockit.Mock;
import mockit.MockClass;
import mockit.Mockit;

/**
 * Class changes the system time returned by {@link System#currentTimeMillis()} via JMockit weaving.
 * &lt;p/&gt;
 * Original System class can be restored any time calling {@link #reset()} method. There are a few ways how to specify modified system time:
 * &lt;ul&gt;
 * &lt;li&gt;setting ms offset via {@link #setOffset(long)}
 * &lt;li&gt;changing ms offset (relatively) via {@link #changeOffset(long)}
 * &lt;li&gt;setting new date, time or ISO date/time via {@link #setIsoDate(String)}
 * &lt;/ul&gt;
 * &lt;p/&gt;
 * Any of these methods can be used through system properties (-D) this way (first property in this order is used, others ignored):
 * &lt;ul&gt;
 * &lt;li&gt;{@code -Dsystime.offset=1000} - shift by one second to the future (negative number can be used)
 * &lt;li&gt;{@code -Dsystime.millis=1000} - set system time one second after start of the era (1970...)
 * &lt;li&gt;{@code -Dsystime.iso=2000-01-01T00:00:47} - 47 seconds after beginning of the 2000, alternatively you can set only time (00:00:47, date stays current) or
 * only date (2000-01-01, current time) without 'T' in both cases.
 * &lt;/ul&gt;
 * &lt;p/&gt;
 * There must be something that causes class load, otherwise nothing happens. In order to allow this without modifying the original program, one may use this
 * class as a main class with original main class as the first argument (they will be correctly shifted when served to the original class). If no relevant
 * property is specified via -D, nothing happens. In any case (programmatic or main class replacement) this class has to be on a classpath. For application
 * server usage this means it has to be in its system libraries, not in EAR/WAR that is not loaded during the AS start yet.
 * &lt;p/&gt;
 * Example:
 * 
 * &lt;pre&gt;
 * java -Dsystime.iso=2000-01-01T00:00:47 SystemTimeShifter my.uber.appserver.Main arg1 second &quot;third long with spaces&quot;
 * &lt;/pre&gt;
 * &lt;b&gt;WARNING:&lt;/b&gt; Sun/Oracle HotSpot JVM and its inline optimization may mess up with the mock after it is set up, so if you notice that the time
 * returns to normal after number of invocations, you should add {@code -XX:-Inline} option to your java command line. Other JVM specific options
 * may be needed for different JVM implementations.
 * 
 * @author &lt;a href=&quot;mailto:virgo47@gmail.com&quot;&gt;Richard &quot;Virgo&quot; Richter&lt;/a&gt;
 */
public class SystemTimeShifter {
	/**
	 * System property setting ms offset.
	 */
	public static final String PROPERTY_OFFSET = &quot;systime.offset&quot;;

	/**
	 * System property setting &quot;current&quot; millis.
	 */
	public static final String PROPERTY_MILLIS = &quot;systime.millis&quot;;

	/**
	 * System property setting ISO date/time (or date, or time).
	 */
	public static final String PROPERTY_ISO_DATE = &quot;systime.iso&quot;;

	private static final long INIT_MILLIS = System.currentTimeMillis();
	private static final long INIT_NANOS = System.nanoTime();
	private static long offset;

	private static boolean mockInstalled;

	@Deprecated
	protected SystemTimeShifter() {
		// prevents calls from subclass
		throw new UnsupportedOperationException();
	}

	static {
		String isoDate = System.getProperty(PROPERTY_ISO_DATE);
		String millis = System.getProperty(PROPERTY_MILLIS);
		String offset = System.getProperty(PROPERTY_OFFSET);
		try {
			if (isoDate != null) {
				setIsoDate(isoDate);
			} else if (millis != null) {
				setMillis(Integer.parseInt(millis));
			} else if (offset != null) {
				setOffset(Integer.parseInt(offset));
			}
		} catch (NumberFormatException e) {
			e.printStackTrace();
		}
	}

	/**
	 * Bootstrap main to allow time shifting before actually loading the real main class. Real
	 * main class must be the first argument, it will be removed from the list when calling the
	 * real class. Without using any relevant -D property there will be no time shifting.
	 * 
	 * @param args argument list with original (desired) class as the first argument
	 * @throws Exception may happen during the reflection call of the other main
	 */
	@SuppressWarnings({&quot;unchecked&quot;, &quot;rawtypes&quot;})
	public static void main(String[] args) throws Exception {
		String[] newArgs = new String[args.length - 1];
		System.arraycopy(args, 1, newArgs, 0, args.length - 1);

		Class clazz = Class.forName(args[0]);
		Method main = clazz.getMethod(&quot;main&quot;, newArgs.getClass());
		main.invoke(null, (Object) newArgs);
	}

	/**
	 * Sets the new &quot;system&quot; time to specified ISO time. It is possible to set exact time with the format {@code yyyy-MM-dd'T'HH:mm:ss} (no apostrophes around T
	 * in the actual string!) or one can set just time
	 * (then current date stays) or just date (then current time stays).
	 * &lt;p/&gt;
	 * If parse fails for whatever reason, nothing is changed.
	 * 
	 * @param isoDate String with ISO date (date+time, date or just time)
	 */
	public static synchronized void setIsoDate(String isoDate) {
		try {
			if (isoDate.indexOf('T') != -1) { // it's date and time (so &quot;classic&quot; ISO timestamp)
				long wantedMillis = new SimpleDateFormat(&quot;yyyy-MM-dd'T'HH:mm:ss&quot;).parse(isoDate).getTime();
				offset = wantedMillis - millisSinceClassInit() - INIT_MILLIS;
			} else if (isoDate.indexOf(':') != -1) { // it's just time we suppose
				Calendar calx = Calendar.getInstance();
				calx.setTime(new SimpleDateFormat(&quot;HH:mm:ss&quot;).parse(isoDate));

				Calendar cal = Calendar.getInstance();
				cal.set(Calendar.HOUR_OF_DAY, calx.get(Calendar.HOUR_OF_DAY));
				cal.set(Calendar.MINUTE, calx.get(Calendar.MINUTE));
				cal.set(Calendar.SECOND, calx.get(Calendar.SECOND));
				offset = cal.getTimeInMillis() - millisSinceClassInit() - INIT_MILLIS;
			} else { // it must be just date then!
				Calendar calx = Calendar.getInstance();
				calx.setTime(new SimpleDateFormat(&quot;yyyy-MM-dd&quot;).parse(isoDate));

				Calendar cal = Calendar.getInstance();
				cal.set(Calendar.DAY_OF_MONTH, calx.get(Calendar.DAY_OF_MONTH));
				cal.set(Calendar.MONTH, calx.get(Calendar.MONTH));
				cal.set(Calendar.YEAR, calx.get(Calendar.YEAR));
				offset = cal.getTimeInMillis() - millisSinceClassInit() - INIT_MILLIS;
			}
			mockSystemClass();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Sets ms offset against current millis (not against real, instead changes current value relatively).
	 * 
	 * @param offset relative ms offset against &quot;current&quot; millis
	 */
	public static synchronized void changeOffset(long offset) {
		SystemTimeShifter.offset += offset;
		mockSystemClass();
	}

	/**
	 * Sets ms offset against real millis (rewrites previous value).
	 * 
	 * @param offset new absolute ms offset against real millis
	 */
	public static synchronized void setOffset(long offset) {
		SystemTimeShifter.offset = offset;
		mockSystemClass();
	}

	/**
	 * Sets current millis to the specified value.
	 * 
	 * @param timestamp new value of &quot;current&quot; millis
	 */
	public static synchronized void setMillis(long timestamp) {
		offset = timestamp - INIT_MILLIS;
		mockSystemClass();
	}

	/**
	 * Resets the whole System time shifter and removes all JMockit stuff. Real system call is restored.
	 */
	public static synchronized void reset() {
		Mockit.tearDownMocks(System.class);
		mockInstalled = false;
		offset = 0;
		System.out.println(&quot;Current time millis mock REMOVED&quot;);
	}

	private static void mockSystemClass() {
		if (!mockInstalled) {
			Mockit.setUpMock(SystemMock.class);
			System.out.println(&quot;Current time millis mock INSTALLED: &quot; + new Date());
			mockInstalled = true;
		} else {
			System.out.println(&quot;Current time millis mock probably INSTALLED previously: &quot; + new Date());
		}
	}

	public static boolean isMockInstalled() {
		return mockInstalled;
	}

	/**
	 * Handy if you set up the mock by some other means like {@link Mockit#setUpStartupMocks(Object...)}.
	 *
	 * @param mockInstalled true if you want to pretend that the mock is already in place (or is/will be installed otherwise)
	 */
	public static void setMockInstalled(boolean mockInstalled) {
		SystemTimeShifter.mockInstalled = mockInstalled;
	}

	/**
	 * Returns real time millis based on nano timer difference (not really a call to {@link System#currentTimeMillis()}.
	 * 
	 * @return real time millis as close as possible
	 */
	public static long currentRealTimeMillis() {
		return INIT_MILLIS + millisSinceClassInit();
	}

	private static long millisSinceClassInit() {
		return (System.nanoTime() - INIT_NANOS) / 1000000;
	}

	@MockClass(realClass = System.class)
	public static class SystemMock {
		/**
		 * Fake current time millis returns value modified by required offset.
		 *
		 * @return fake &quot;current&quot; millis
		 */
		@Mock
		public static long currentTimeMillis() {
			return INIT_MILLIS + offset + millisSinceClassInit();
		}
	}
}
</pre>
<p>I&#8217;m not suggesting it&#8217;s a masterpiece of engineering &#8211; but it works pretty well and you can set up the offset in many handy ways (just the date/time, both, offset in ms, you name it), you can use it as the main class before you start some other real main class (this way I started the whole application server in completely different time &#8211; Weblogic 12c in my case, but I think it doesn&#8217;t really matter). But I did mention two problems, right?</p>
<h3>Problem 2: After some time the time returns to normal!</h3>
<p>This problem quickly manifests on Sun&#8217;s JVM (can&#8217;t tell about others) and I found this non-solution: <a href="http://code.google.com/p/jmockit/issues/detail?id=43">http://code.google.com/p/jmockit/issues/detail?id=43</a></p>
<p>At least originally it was no-go for me as the suggested solution was -Xint &#8211; using interpreted JVM. This made tests unbearably slow, nobody would run them! I felt I&#8217;m pretty close to the solution and thanks to Rogerio Liesenfeld (jmockit author) and my private conversation with him above this issue I got pushed into the right direction. Sure, first I tried other mocking libs, but then I got back to jmockit (because it mocks the target, not the source of the call) and I tried again. I focused on what Rogerio wrote in his <a href="http://code.google.com/p/jmockit/issues/detail?id=43#c7">comment #7</a> (which was actually his reply to my mail). &#8220;So OK, if it&#8217;s HotSpot optimization, can&#8217;t I disable just that one? Even for that single class?&#8221; While I could not disable it for the class with Sun&#8217;s HotSpot (and I don&#8217;t know if it is any problem at all on different JVMs) I could disable it globally with -XX:-Inline. And yes, it&#8217;s much much faster than -Xint. Generally it should not be much slower than 1.5x of normal run with inlining &#8211; this depends on many factors of course (on overall &#8220;inline-likeness&#8221; of your application/test), but it&#8217;s much better than typical 10x penalty for interpreted JVM.</p>
<h3>Problem 3: TestNG integration</h3>
<p>Ok, I lied about two problems only &#8211; but only because this one is beyond the system time shifter itself. This problem was caused by my lack of understanding of jmockit and its interaction with TestNG. I wanted to shift my time for the whole TestNG suite without realizing that jmockit/TestNG may have their own agendas too. I tried to run my code with @Before/AfterSuite setting up my mocked time with SystemTimeShifter.setIsoDate(&#8230;) call and tearing it down again with reset(). But it didn&#8217;t work inside the test methods anyway, because something uninstalled my mock before the test method was run. Cedric from TestNG told me it&#8217;s jmockits business and Rogerio told me I&#8217;m using it the wrong way because it was never meant to be run this way for the whole Suite. I could use it around class or even method call, but I didn&#8217;t like the idea of time being shifted to the same point for every single method. I didn&#8217;t like the idea, that I can&#8217;t tell from log files how long the test is running (though the log file times were shifted too, I hope you don&#8217;t mind <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). Silly on my part, however, this should work for you just fine:</p>
<pre class="brush: java; title: ; notranslate">
   @BeforeSuite
   public final void setupSystemTime() {
       SystemTimeShifter.setMockInstalled(true); // because of the setUpStartupMocks further, which sets up the mock
       SystemTimeShifter.setIsoDate(&quot;2011-10-14T10:00:00&quot;); // this set's the offset - but doesn't set up the mock (thanks to the assert above)

       // this line performs all the suite scope magic
       Mockit.setUpStartupMocks(SystemTimeShifter.SystemMock.class);
   }

   @AfterSuite
   public final void resetSystemTime() {
       SystemTimeShifter.reset();
   }
</pre>
<p>While technically the AfterSuite part is not necessary, it is cleaner this way. Jmockit uninstalls his part by itself, but time shifter doesn&#8217;t know about it. This way it got reset as well.</p>
<h3>Conclusion</h3>
<p>There it is &#8211; not perfect and not without little hassles (-XX:-Inline namely), but working fine so far, at least for my cases. In my eyes &#8211; this is really tragic fault of the current JVM date library, fault that cannot be mended easily. System.currentTimeMillis is the only relevant source of real time and unless we can mess with it somehow in a clear way we will always have need to mess with it in ugly ways. This reminds me of the t-shirt I have. There is a stargate like ring on it, it is just named &#8220;TIME GATE&#8221; &#8211; and Java Duke comes out of it, opening the future for us. I&#8217;m curious a bit how he could do it. Did he cheat on JVM somehow too? When will we have clean solution that makes any DateFactory rather obsolete? Will we ever? Or do we have to unlock the future with TimeShifters in such obscure ways? Java, Java&#8230;</p>
<p>Let me know your story with system time cheating. I know I haven&#8217;t talked about setting the computer system time. That is simplest solution for many occasions, but not for running the tests on Continuous Integration server shared with many other projects, so I just omitted this altogether. If you have any success story with SystemTimeShifter, if it helps you somehow, please, be so kind and let me know to lift up my spirit. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/633/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=633&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2012/06/22/changing-system-time-in-java/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>
	</item>
		<item>
		<title>Live architecture with Java, Spring, JPA and OSIV</title>
		<link>http://virgo47.wordpress.com/2012/05/01/live-architecture-with-java-spring-jpa-and-osiv/</link>
		<comments>http://virgo47.wordpress.com/2012/05/01/live-architecture-with-java-spring-jpa-and-osiv/#comments</comments>
		<pubDate>Tue, 01 May 2012 12:13:53 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[virtual-life]]></category>
		<category><![CDATA[dao]]></category>
		<category><![CDATA[dto]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[javaee]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[live architecture]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[osiv]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=628</guid>
		<description><![CDATA[This post is about an architecture where live (attached) JPA objects are used in the presentation layer. You can expect OSIV (Open Session In View) pattern mentioned, though I’ll focus more on ways how we made it work well enough for us &#8211; safely and without LIEs (LazyInitializationException). It is just my story with my [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=628&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This post is about an architecture where live (attached) JPA objects are used in the presentation layer. You can expect OSIV (Open Session In View) pattern mentioned, though I’ll focus more on ways how we made it work well enough for us &#8211; safely and without LIEs (LazyInitializationException). It is just my story with my experiences, no big discovery here. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I can’t tell if it is any official name, but we call it “Live architecture” because live JPA entities are available in the presentation layer. While we use it with Spring/Wicket mostly, it is the same with any other presentation framework &#8211; and probably applies to JavaEE without Spring too (if you use OSIV).</p>
<p><strong>DTO vs Live architecture</strong></p>
<p>In our company there are “DTO guys” and “live architecture guys”. We all know DTOs (<a href="http://en.wikipedia.org/wiki/Data_transfer_object">Data Transfer Object</a>) and how to work with them, more or less. Their rise to fame came with the need of coarse-grained calls to remote EJBs and they became prominent “pattern” then. Even with local calls people use them to strictly divide layers. I used them on some projects, then not on others and then again I used them with GWT/Seam applications (never liked the idea of JPA entities being preprocessed for me and dragged all the way to the GWT application).</p>
<p>Everytime I start talking about “live architecture” that drags entity objects into the view there are architects who just say “that is no architecture at all”. And I say “whatever&#8230;” I remember projects where we “broke” a clean architecture (e.g. “everything must go through this facade!”) and the result was less and cleaner code, easier to understand, better performance even. Was it universal? Hell no, it wouldn’t scale in most cases, but in that particular case scaling was not (and after all those years still is not) necessary.</p>
<p>My recent story with the live architecture is based on a project where it was settled that it will be used instead of DTOs. You have to translate DTOs somehow from business objects and back. You can generate it, you can automate it, use reflection &#8211; or do it manually. Any way always adds something that is not necessary for all cases. Our views were mostly based on JPA entities and it was just shame to translate them to DTOs for the sake of transformation itself. I’m not saying DTOs are bad &#8211; well we use them for more complicated views, mostly for lists showing joined tables. You can of course build a view and design an entity over it &#8211; and we do it too&#8230;</p>
<p>There is no fundamentalism in this &#8211; we use entities as much as we can. I strongly believe that in normal scope projects people often overdo it with “clean architecture” and don’t care about “clean code” as much. And I strongly believe that cleaner code itself matters much more than that cloud castle of architecture (without underestimating the architecture itself!). After all our projects are quite simple multi-tier applications with a bit of clustering. No grid, no hi-perf, no America. So we use entities, because they are placed under the presentation layer (good dependency direction) and they only carry data. And when this is not enough, we use DTOs too. Simple.</p>
<p><strong>Business logic objects and dumb entities</strong></p>
<p>You may have different rules for your live architecture (projects using OSIV) &#8211; and that is fine. Ours start with <strong>don’t use entities to anything else</strong> &#8211; no business logic, maybe some simple computed properties, that is alright. You may call this <a href="http://en.wikipedia.org/wiki/Anemic_domain_model">Anemic Domain Model</a> &#8211; but I don’t care. Logic is in separated objects that use one or more entities. It is not exactly <a href="http://en.wikipedia.org/wiki/Data,_context_and_interaction">DCI</a>, but it is not very far from this. For many other reasons (unrelated to the live architecture) I prefer having business logic objects that performs specific scenario &#8211; the best case is 1-to-1 mapping with a Use case from the analysis document.</p>
<p>Let’s talk about this picture for a while:<br />
<img src="https://docs.google.com/drawings/pub?id=1jrTygFN-fXmgmf9QW5BsDLRxbSDEagmgEO80uEr5-R8&amp;w=520&amp;h=415" alt="" width="520px;" height="415px;" /></p>
<p>Presentation layer can be anything &#8211; component (Wicket) or controller (Web MVC) driven. It calls the service layer (typically a Spring bean or EJB) and this further uses that “cloud” with various business logic objects. Very often I prefer create/use/throw-away pattern. In constructor the object gets its context and then it does something &#8211; preferably in one method call, but it may be a sequence too, although this is more fragile approach. Important thing is that business object can store its state during the business logic execution &#8211; it is thread safe if it is created locally for one service call (that’s why I don’t use singletons here). Sometimes state is not necessary, but in more complex cases it is. And I like fields much more than dragging list of parameters between private methods.</p>
<p>This business logic uses DAOs (or @EntityManager directly) to work with the DB &#8211; and of course works with entities in the process. Because entities are dumb (DCI idea, but not only theirs) they are perfect DTOs (that are also dumb). Of course there are some concerns about entities used as DTOs and you can find <a href="http://stackoverflow.com/questions/5216633/jpa-entities-and-vs-dtos">many questions</a> about this issue (and not only in the Java world). Entities are POJOs &#8211; in theory &#8211; but you may drag some proxy object up there into the presentation layer. There is a lot of magic in entities, you sometimes don’t know what they are (my class or some modified class already?) &#8211; but under the most circumstances you don’t have to care that much really.</p>
<p><strong>Best practices</strong></p>
<p>Now let’s talk about our best practices. <strong>Presentation layer code knows entities, but doesn’t know ORM!</strong> This is probably the most important thing. Of course the dependency on the JPA is implied somehow. Of course client programmer has to know the data model and has to know how to traverse the objects he wants to display. But he absolutely can’t use EntityManager. Our first “live architecture” project didn’t have clear separation of these roles and some LIEs were fixed like “you know, here in this page before you call the service&#8230; put evict on this object there”. I wasn’t there when this project started, so I just went like “what?!?!” And I forbade this for the next project I could affect.</p>
<p>Next rule is rather about the communication than the technical one &#8211; <strong>presentation programmer always has to know what he gets from the service call</strong>. Otherwise he risks that LIE again. But LIEs in presentation are easy. They are easy to fix in model, in service/business code or in the presentation code (that is the most of the cases). You always have to share some model between business logic and presentation (and developers!) &#8211; and we share the data model itself. If you don’t plan to change your layers this is perfectly acceptable. I’ve actually never saw any change of technology that would satisfy using different model introduced on the facade level. So why to do it if <a href="http://en.wikipedia.org/wiki/You_ain%27t_gonna_need_it">you ain’t gonna need it</a>? (Of course, you may need it &#8211; and you are there to say as an architect.)</p>
<p><strong>Getting data is easy</strong> (talking about live architecture problems only <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). You may need separate methods for every view &#8211; especially if selects are not generic enough. We have “filter beans” with single superclass and we use these beans with a few service methods (getSingleResult, getList, etc.) that are rather generic in nature. DAO-like even. It works for us, filter beans are the common ground for client and server programmer to communicate and they are part of the service layer API. We can have common FilterBean interface, because we use our custom filter framework behind. But you can use filter beans without common ancestor and have many service methods to obtain data. This is probably even cleaner.</p>
<p><strong>Transactions, saves, updates</strong></p>
<p>Originally we used DAO-like save on service layer too. We also didn’t have clear strategies when objects are alive and when not when the presentation layer called the service layer. If you had in one HTTP request read and write call, then the entities were alive if the write used result of the read. If you had just an update, then they were not. “Objects may come alive or not, let’s not assume that they are alive,” was our first strategy, though I didn’t feel very well about “or” used in the sentence. <strong>Never use contradictions in your assumptions.</strong> With a big help of our tests we managed to clean this mess up.</p>
<p>Our tests were TestNG based, they were not unit tests but mostly we tested the service layer playing the role of the presentation layer. It was funny how often the test passed and the user test (using browser) failed, but also vice-versa! Sometimes the test didn’t prepare the same environment &#8211; and we started to realize, that the service layer must assume less and be more strict. The biggest problem was that the presentation layer could change an entity A that was read in the request (hence alive) and then call service saving an entity B. The service layer had no chance to know about the A being saved in the same transaction. This lead to one very simple idea &#8211; <strong>we always clear session before calling transactional service methods</strong>. I forgot to say that we use transactions on service layer, so you can have more transactions in one HTTP request/persistence session.</p>
<p>Stepping back for a bit &#8211; client programmer knows that when he calls a service, his objects are alive. He can call multiple reads &#8211; and he knows that all things are still alive and he can base the next read on an attribute that is loaded lazily. In our case there is only one write/transaction called in one HTTP request &#8211; and it’s mostly the last call as well. If I wanted to make our policies even more precise I could say “always clear the session &#8211; for every service call”. This would mean less comfort for the client programmer. Or you can go for “dead” entities instead of live ones (see Other possibilities further).</p>
<p>Now the business programmer knows that <strong>any object that enters transactional service is detached</strong> and he can choose what to do with it. Do you need just to save the changes? Merge it (or call JPQL update, or whatever). Do you need to compare it to its original state? Read the object by its id and do what you need. Do you want to traverse its attributes? Well, better reload it first to make it attached again. We enforce this by a custom aspect that is hooked on an existing Spring @Transactional annotation.</p>
<p>This assumption would be very useful for read/list method too. Now the developer never knows if he has to reload or not. But read methods are not so complex and reload of the parameter entity should never harm either. Also &#8211; read/list methods are not transactional, so whatever he does, he can’t mess up with the persisted data. So this is our <strong>compromise</strong> between the client programmer using live objects and the service layer being secured enough. There is much less LIEs in our back-end code (which are harder to catch than those on the presentation layer) &#8211; actually I didn’t see one for a long time &#8211; and there is <strong>no chance to tamper with the data accidentally</strong>.</p>
<p>As a side note: Many of our problems were also caused by our presentation architecture &#8211; we load data, display them, then forget the content to keep page/session small and we just remember the IDs of the objects. When edit action comes, we reload the object from the service by its ID, modify it and then call the transactional write service method. To make this more convenient we have our custom ReloadableModel class for our Wicket pages, so before the model (entity obect) is to be updated, it is always reloaded from the service too (this is not a big performance hit, it often goes from the 2nd level cache anyway). This may not be very lucky solution but it was one of those we had to stick with for the time. You may or may not run into these kinds of problems. In any case, making your contracts and policies more strict and clean is always a good thing.</p>
<p><strong>Other possibilities</strong></p>
<p>There is not only Live vs DTO option. You can also use entities, yet always closing the session when the service call ends. This gives you the same model, less easy presentation changes, but it definitely is cleaner from the service layer point of view. You can make more strict contracts, performance is all down there and not ruined by lazy loads on the presentation layer, etc. I know this, we use this for other projects too. But I also know that people use OSIV a lot and that is why I wanted to wrap-up our experiences with it. You can come up with other policies too &#8211; for instance one read or write per request and nothing more. Do it all in one proper service call, don’t call many selects for every single combo-box model for instance. I agree with these approaches actually. But sometimes we don’t have the luxury of choice. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>In any case, try to do your best to <strong>clean up the contracts as much as possible</strong>, avoid contradictory ORs in your assumptions and &#8211; I didn’t focus on this point much in this post &#8211; <strong>test your service/business layer</strong>. Contract and policy is one thing, but you have to ensure them &#8211; <strong>force them</strong>, otherwise they are not contracts, just promises. Because that is your safety net not only from the architectural standpoint, but also from the functional one. But that is a completely different story.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/628/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=628&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2012/05/01/live-architecture-with-java-spring-jpa-and-osiv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>

		<media:content url="https://docs.google.com/drawings/pub?id=1jrTygFN-fXmgmf9QW5BsDLRxbSDEagmgEO80uEr5-R8&#38;w=520&#38;h=415" medium="image" />
	</item>
		<item>
		<title>Dorling Kindersley vs IKAR preklad</title>
		<link>http://virgo47.wordpress.com/2012/03/03/dorling-kindersley-vs-ikar-preklad/</link>
		<comments>http://virgo47.wordpress.com/2012/03/03/dorling-kindersley-vs-ikar-preklad/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 22:29:22 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[real-life]]></category>
		<category><![CDATA[animals]]></category>
		<category><![CDATA[dorling kindersley]]></category>
		<category><![CDATA[ikar]]></category>
		<category><![CDATA[universe]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=624</guid>
		<description><![CDATA[V poslednom čase som si obľúbil knihy od Doling Kindersley &#8211; najmä ich encyklopédia (Earth, Ocean, Science) alebo aj ich detské verzie (Animals alebo Nová encyklopédia pre deti). Keď môžem, uprednostním originál &#8211; ale práve posledne dve menované (detské) máme v oboch jazykoch a Vesmír máme len od IKARu &#8211; tú dokonca najdlhšie, ešte vo [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=624&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>V poslednom čase som si obľúbil knihy od Doling Kindersley &#8211; najmä ich encyklopédia (Earth, Ocean, Science) alebo aj ich detské verzie (Animals alebo Nová encyklopédia pre deti). Keď môžem, uprednostním originál &#8211; ale práve posledne dve menované (detské) máme v oboch jazykoch a Vesmír máme len od IKARu &#8211; tú dokonca najdlhšie, ešte vo väčšom formáte ako ich po novom tlačí DK.<br />
<a href="https://picasaweb.google.com/lh/photo/foTyCcUKcI3903ohvamrpw-2iyfCtEdVDzh0gFiOEIM?feat=embedwebsite"><img class="aligncenter" src="https://lh4.googleusercontent.com/-eJrcf-0Z0cM/T1KSpwK2jvI/AAAAAAAAQD4/zY73JqhP5nk/s800/universe-ikar1.JPG" alt="" width="480" height="320" /></a></p>
<p>Kniha super, zaujímavá, pútavá, dobrý výber materiálu, fotiek, všetko v najlepšom poriadku &#8211; až na chybičky pri preklade &#8211; a to hneď zo začiatku knihy, kde sa pri trošku pozornejšom čítaní nedali obísť. Hovorím o čítaní, nie o hľadaní chýb. Prvá veta, ktorá zrejme bola obeťou trošku náročnejšej angličtiny znela&#8230; no však tu je fotka:<br />
<a href="https://picasaweb.google.com/lh/photo/ZZIMcfu4L7hvpoDNPu1fRg-2iyfCtEdVDzh0gFiOEIM?feat=embedwebsite"><img class="aligncenter" src="https://lh5.googleusercontent.com/-DYqt43Xd6pk/T1KSnToJBvI/AAAAAAAAQDc/j_INsESONXk/s800/universe-ikar2.JPG" alt="" width="480" height="320" /></a></p>
<p>V originále je uvedené (výrez z Amazon náhľadu):<br />
<a href="https://picasaweb.google.com/lh/photo/VEC7V4aonCEllPGijOo9og-2iyfCtEdVDzh0gFiOEIM?feat=embedwebsite"><img class="aligncenter" src="https://lh3.googleusercontent.com/-IDvzalEeT7Q/T1KSn6LBiNI/AAAAAAAAQDk/Javn_K-gxYE/s800/universe-orig2.JPG" alt="" width="480" height="200" /></a></p>
<p>Keby som nevedel kontext, možno aj ja by som to takto preložil, lebo ide o neľahkú a nie celkom jasnú konštrukciu vety. Predpokladám však, že hviezdy neobsahujú tmavú hmotu, a hoci vznikli z prachu a plynu, nehovoril by som že obsahujú oblaky plynu. Skôr išlo o to, že “okrem hviezd galaxie obsahujú aj&#8230;” Či pôvodná veta naozaj znamená “Tak ako (obsahujú) hviezdy, tak galaxie obsahujú aj oblaky plynu&#8230;” Určite by som ale zmenil slovosled a spravil to jasnejšie.</p>
<p>Druhý kiks bol pomerne triviálny &#8211; copy/paste chyba (pre tie mám ako programátor pochopenie <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). Predsa len sa mi nezdalo, že by Merkúr bol od Slnka ďalej ako Zem:<br />
<a href="https://picasaweb.google.com/lh/photo/I3RmmEbgy5Mo4xzZRW0O1g-2iyfCtEdVDzh0gFiOEIM?feat=embedwebsite"><img class="aligncenter" src="https://lh6.googleusercontent.com/-Ka55zs5Rr3s/T1KSqvwZhpI/AAAAAAAAQD0/I4MicLfD1qc/s800/universe-ikar3.JPG" alt="" width="480" height="320" /></a></p>
<p>Poďme sa ešte pozrieť na problém s červienkou (Robinom, tak sa volá aj môj syn) v encyklopédii zvierat pre deti:<br />
<a href="https://picasaweb.google.com/lh/photo/-c24i42as63NWYSRf1eo0Q-2iyfCtEdVDzh0gFiOEIM?feat=embedwebsite"><img class="aligncenter" src="https://lh6.googleusercontent.com/-j387oi3xI0w/T1KSrNrTryI/AAAAAAAAQEI/3jaIUC6o8nA/s800/animals-vs-animals.JPG" alt="" width="480" height="320" /></a></p>
<p>V nejednej knihe alebo rozprávke (toto bolo tuším DVD s psíkom Spotom, po anglicky) sa nachádza vtáčik Robin (<a href="http://sk.wikipedia.org/wiki/%C4%8Cervienka_oby%C4%8Dajn%C3%A1">červienka</a>). Keď už sme nedávno kúpili tú encyklopédiu, tak som do nej nazrel a ukázal Robinovi Robina (nemusím snáď objasňovať, že som synovi ukazoval vtáka <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). Manželka siahla po preklade, aby sme sa ubezpečili, že ide o červienku &#8211; a tam na naše prekvapenie bol drozd sťahovavý:<br />
<a href="https://picasaweb.google.com/lh/photo/njxDuvzQyc8ipSZrh7P5OQ-2iyfCtEdVDzh0gFiOEIM?feat=embedwebsite"><img class="aligncenter" src="https://lh5.googleusercontent.com/-BnAbg4IXgNM/T1KSrk5ABRI/AAAAAAAAQEE/6JpmiWNGQQ0/s800/american-robin-vs-robin.JPG" alt="" width="480" height="320" /></a></p>
<p>Na počudovanie na inej strane bola červienka v poriadku:<br />
<a href="https://picasaweb.google.com/lh/photo/t9mqeMQcktnVZYelxjpHIw-2iyfCtEdVDzh0gFiOEIM?feat=embedwebsite"><img class="aligncenter" src="https://lh4.googleusercontent.com/-EXIglLbs5wc/T1KStMPlbMI/AAAAAAAAQEU/LQkc-I6olcM/s800/robin-ok.JPG" alt="" width="480" height="320" /></a></p>
<p>Neskôr som zistil, že drozd sťahovavý je tzv. “American Robin”, každopádne latinské meno je iné. Červienka je drozdovitý vták, aj americká verzia je pre laika podobná, ale prečo nepoužívajú pri preklade ponúkajúce sa latinské meno, to neviem pochopiť.</p>
<p>Na tej istej strane ako zlý drozd bol aj iný rozkošný preklep (slovo je zväčšené v editore, typografia bola v poriadku):<br />
<a href="https://picasaweb.google.com/lh/photo/Kv4efyvYdjkHXchV0ua5qA-2iyfCtEdVDzh0gFiOEIM?feat=embedwebsite"><img class="aligncenter" src="https://lh4.googleusercontent.com/-v09Wxh8Oz14/T1KSsVFsx5I/AAAAAAAAQEM/3KT4ZGNtKBA/s800/crane-fun.JPG" alt="" width="480" height="320" /></a></p>
<p>Proste &#8211; keď sa darí, tak sa darí. To sme dnes tie knihy otvorili poriadne prvýkrát. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Pre nás to znamená jediné &#8211; udržať si kritický pohľad na to, čo čítame &#8211; najmä v preklade. Samozrejme ani originál nie je zárukou dokonalosti, ale dobre viem, prečo uprednostňujem nepreloženú knihu pred prekladom. Duplom do nášho jazyka s pomerne malým trhom, kde sa zjavne poriadna korektúra či redaktor (či kto to má na starosti) asi nezaplatí len tak.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/624/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=624&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2012/03/03/dorling-kindersley-vs-ikar-preklad/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>

		<media:content url="https://lh4.googleusercontent.com/-eJrcf-0Z0cM/T1KSpwK2jvI/AAAAAAAAQD4/zY73JqhP5nk/s800/universe-ikar1.JPG" medium="image" />

		<media:content url="https://lh5.googleusercontent.com/-DYqt43Xd6pk/T1KSnToJBvI/AAAAAAAAQDc/j_INsESONXk/s800/universe-ikar2.JPG" medium="image" />

		<media:content url="https://lh3.googleusercontent.com/-IDvzalEeT7Q/T1KSn6LBiNI/AAAAAAAAQDk/Javn_K-gxYE/s800/universe-orig2.JPG" medium="image" />

		<media:content url="https://lh6.googleusercontent.com/-Ka55zs5Rr3s/T1KSqvwZhpI/AAAAAAAAQD0/I4MicLfD1qc/s800/universe-ikar3.JPG" medium="image" />

		<media:content url="https://lh6.googleusercontent.com/-j387oi3xI0w/T1KSrNrTryI/AAAAAAAAQEI/3jaIUC6o8nA/s800/animals-vs-animals.JPG" medium="image" />

		<media:content url="https://lh5.googleusercontent.com/-BnAbg4IXgNM/T1KSrk5ABRI/AAAAAAAAQEE/6JpmiWNGQQ0/s800/american-robin-vs-robin.JPG" medium="image" />

		<media:content url="https://lh4.googleusercontent.com/-EXIglLbs5wc/T1KStMPlbMI/AAAAAAAAQEU/LQkc-I6olcM/s800/robin-ok.JPG" medium="image" />

		<media:content url="https://lh4.googleusercontent.com/-v09Wxh8Oz14/T1KSsVFsx5I/AAAAAAAAQEM/3KT4ZGNtKBA/s800/crane-fun.JPG" medium="image" />
	</item>
		<item>
		<title>Stargate, DS9 and other Heroes</title>
		<link>http://virgo47.wordpress.com/2012/03/01/stargate-ds9-and-other-heroes/</link>
		<comments>http://virgo47.wordpress.com/2012/03/01/stargate-ds9-and-other-heroes/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 17:20:14 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[real-life]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[virtual-life]]></category>
		<category><![CDATA[battlestar]]></category>
		<category><![CDATA[bsg]]></category>
		<category><![CDATA[buffy]]></category>
		<category><![CDATA[deep space 9]]></category>
		<category><![CDATA[ds9]]></category>
		<category><![CDATA[firefly]]></category>
		<category><![CDATA[galactica]]></category>
		<category><![CDATA[game of thrones]]></category>
		<category><![CDATA[heroes]]></category>
		<category><![CDATA[prison break]]></category>
		<category><![CDATA[serenity]]></category>
		<category><![CDATA[star trek]]></category>
		<category><![CDATA[xkcd]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=621</guid>
		<description><![CDATA[I once compared Prison Break with Shawshank Redemption and I wanted to talk about other typical TV shows from the last 20 years or so, where it all goes and what I miss so much about the recent shows. Just to go quickly through what I liked and what not. I liked Star Trek Deep [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=621&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I once <a href="http://virgo47.wordpress.com/2008/07/27/prison-break-redemption/" title="Prison Break Redemption">compared Prison Break with Shawshank Redemption</a> and I wanted to talk about other typical TV shows from the last 20 years or so, where it all goes and what I miss so much about the recent shows. Just to go quickly through what I liked and what not. I liked Star Trek Deep Space 9 &#8211; this is one of those long term relationships &#8211; and very similar it is with Star Trek: SG1 and Atlantis. I liked 24 (wrote about it here&#8230;). I liked Dexter though I stopped after second season and I simply don&#8217;t want to go on to the fourth season to see her dead (ok, I saw that scene, obviously <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ) &#8211; but Dexter was really refreshing. I liked first season of Tudors (but I&#8217;m not much interested in the next parts) and I really liked fantastic Game Of Thrones &#8211; though they really should not let &#8220;Boromir&#8221; die. So, sci-fi, fantasy, semi-historic, action &#8211; I like it all, though sci-fi is probably my favourite.</p>
<p>What I liked less was Battlestar Galactica &#8211; how I like it in overall, I just can&#8217;t stand those shifts in characters. You just don&#8217;t know what to believe. When T&#8217;ealc becomes enemy of the rest of guys from SG1, you just know that he is sick or something. You know your heroes. But BSG? You just never know what to believe. And I don&#8217;t think that Stargate show doesn&#8217;t have interesting twists here and there. But not so crazy like BSG. Or, when I wrote word heroes &#8211; I remembered my probably biggest let-down. I watched two season of Heroes. Concept, visuals, idea &#8211; all great. But so much of stupidity, so many cliches with the bad guy always running away. And then time-shifting with good heroes becoming bed. All those wannabe surprises and forced shocks &#8211; after that an episode from Stargate or DS9 just caresses me so nicely!</p>
<p>I don&#8217;t know what is wrong with some of these new shows. Are we running out of ideas? Do we need to push the limits further no matter what? Probably yes. A have to admit that I was able to watch BSG all the way through and I was generally satisfied in the end. I also watched Razor and The Plan &#8211; and it was nice to go the whole way. I never forget Galactica going down the atmosphere on New Caprica or Pegasus down taking few cylon star bases with it. Those were magnificent scenes and for those I can forgive the big of mystery that somehow wasn&#8217;t believable for me (especially around the final five).</p>
<p>Once I tried Buffy the Vampire Slayer &#8211; and while it was fun it somehow didn&#8217;t grow on me (though I definitely liked Buffy <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). Lately I read xkcd.com regularly (from the old ones to the newer) and there are many hints on Firefly show. Because it wasn&#8217;t the first time I&#8217;ve heard about it, I decided to check it &#8211; and with 14 episodes total + one movie (Serenity) it was quite a brief encounter. And I was more than satisfied! Not only there was that lovely doctor from Atlantis and beautiful cold Adria from SG1 (both of it shot after the Firefly actually) the whole stuff was well thought out, mix of sci-fi and western was very catchy, but without cliches, scripts are indeed great and final movie was just overwhelming. If you don&#8217;t know what Buffy and Firefly have in common &#8211; Joss Whedon is the man &#8211; and that&#8217;s why they are in this single paragraph. (Watching the Firefly was also good thing for some further xkcd reading. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )</p>
<p>After Firefly (not that my life is divided to B.F. and A.F.) I somehow got more and more suspicious that &#8220;classic&#8221; series are the matter of past. Now it&#8217;s important to compete with BSG, Heroes and Prison Break. Well&#8230; whatever people want. New music is still good (among tons of cheap stuff) and so will be TV shows I guess. I can still see the chance there &#8211; Game Of Thrones for instance, although it&#8217;s not something that would &#8220;caress&#8221; me like Stargate. Or The Firefly. Or the fond humour in DS9.</p>
<p>Of course your mileage may vary &#8211; but I bet there are other people out there that must have very similar feeling. And don&#8217;t simplify it just to &#8220;you&#8217;re getting old!&#8221;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/621/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/621/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=621&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2012/03/01/stargate-ds9-and-other-heroes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>
	</item>
		<item>
		<title>Three years with Java Simon (4)</title>
		<link>http://virgo47.wordpress.com/2012/02/12/three-years-with-java-simon-4/</link>
		<comments>http://virgo47.wordpress.com/2012/02/12/three-years-with-java-simon-4/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 11:45:55 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[real-life]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[virtual-life]]></category>
		<category><![CDATA[java simon]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[jmx]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[monitoring]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=617</guid>
		<description><![CDATA[Today I&#8217;d like to cover the rest of my Java Simon story. In the previous posts we talked hardly about the start, but the rest was actually quite quick. With Callbacks, JMX support, JDBC proxy driver and much better design we were ready to release our 2.0 version. June 23, 2009, Java Simon 2.0, monitoring [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=617&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Today I&#8217;d like to cover the rest of my Java Simon story. In the previous posts we talked hardly about the start, but the rest was actually quite quick. With Callbacks, JMX support, JDBC proxy driver and much better design we were ready to release our 2.0 version.</p>
<p>June 23, 2009, <a href="http://www.theserverside.com/news/thread.tss?thread_id=55007">Java Simon 2.0, monitoring API, released</a></p>
<p>There was one major problem with this version &#8211; we needed 2 different JDKs to build it. JDBC 3 would not compile against JDK 1.6 because Java 6 required higher version of it &#8211; which we didn&#8217;t want, so we could use it on application servers without support of newer JDBC. JMX 1.2 shipped with Java 5 &#8211; on the other hand &#8211; didn&#8217;t support features we needed, mostly around MX Beans, returning more types of objects and so on. So JMX was compiled with Java 6. You can imagine the problems we had when we started using Maven as a build (though Maven still is not exclusive build tool for us).</p>
<p>Well&#8230; Maven. While I like the idea of it &#8211; especially dependency management is truly great &#8211; as a build tool it is incredibly in the way unless you read tons of the stuff. Originally I hosted Java Simon on java.net repository, but then Oracle somehow made it more complicated (and malfunction altogether for a while if I recall correctly) and I decided to switch to Maven Central. That was right decision of course, but the pain behind it was just crazy. Unless you have the process mastered it takes a lot of pain to deploy your first software there. However &#8211; our clients wanted Maven repo &#8211; and I did my best to provide. I learned a lot in the process, but no one will convince me that Maven can&#8217;t be MUCH simpler. And deployment on Maven Central is just horribly bureaucratic compared to FTP upload. Guys at Sonatype do their best in support though, they probably have to answer tons of stupid questions (at least for them). After all I complained more about it previously, so let&#8217;s just skip the rest with saying that 2.5.0 version was the first on Maven Central &#8211; and someone else had to deploy it for me. 3.0.0 was delayed a lot &#8211; Maven being 95% of the reason. Now I can release (at least from that computer where release plugin doesn&#8217;t throw infamous out of bounds exception without providing reason&#8230;) and it is a tremendous relief.</p>
<p>Talking about 3.0.0 &#8211; release announcement was here:</p>
<p><a href="http://www.theserverside.com/news/thread.tss?thread_id=63169">Java Simon alive and kicking with 3.0.0 available</a></p>
<p>As you can read in it the biggest theme was aligning of the Java dependency &#8211; now we can build it with JDK 6 only. Aside from that it was rather just a wrap-up of all the changes in 2.x line with some bug fixes reported for 2.5. Talking about bugs and issues &#8211; this was maybe the reason why I kept working on Java Simon and eventually made all the changes that slowly but surely shape the library. And this would not be possible without users &#8211; and especially active users. Reports were coming more in bursts, often from one reporter for some time. One thing I can say with my head straight up &#8211; I was always very prompt to answer and fix where appropriate (mostly they were indeed bugs).</p>
<p>To talk to our users we created <a href="http://groups.google.com/group/javasimon">Java Simon Google Group</a> shortly after version 1, but this was mostly an announcement tool. Here and there someone new asked the question though &#8211; and again, I answered as soon as possible. Luckily, Java Simon is low-profile library, so the traffic was rather negligible. To sum it up &#8211; users who had problems were my motor in the end. The main problem probably was that later we had no project to use with Java Simon. There seems to be some chance now at my current job, so I expect more enhancements.</p>
<p>Here and there I still change some method names (some changed in 3.1, next changes will appear in 3.2) &#8211; not that I like doing that but I rather name it properly later than never (oh, how I hate broken promises of original Java&#8217;s @deprecated!), but otherwise the core seems to be pretty stable for now. But there is still some room for improvements &#8211; especially new features:</p>
<ol>
<li>delivering more useful tools like JDBC proxy driver &#8211; that one I particularly like for its simplicity, just add “simon:” in the JDBC URL and have it on the classpath &#8211; right now monitoring part comes to my mind, charts, logging, dumps to some history DB, etc.;</li>
<li>providing some neat Callbacks (many things from the point 1 are actually implemented thanks to these);</li>
<li>web console where you can easily read your Simons.</li>
</ol>
<p>Actually &#8211; there should be web console available in our next release (3.2.0) &#8211; we acquired new committer from among our users. That&#8217;s the true open source community story. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  You can&#8217;t even imagine how happy I was about it.</p>
<p>Of course &#8211; my life is not only about Java Simon. I have a family, regular job where they&#8217;d hardly pay me for Java Simon alone, I like doing music (soon more about it too) and then I just don&#8217;t care about Simon for a few weeks, sometimes even months. Though right now I&#8217;m just taking a short break before we wrap up that 3.2.0 version &#8211; and you&#8217;ll hear about it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/617/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=617&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2012/02/12/three-years-with-java-simon-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>
	</item>
		<item>
		<title>Three years with Java Simon (3)</title>
		<link>http://virgo47.wordpress.com/2012/01/16/three-years-with-java-simon-3/</link>
		<comments>http://virgo47.wordpress.com/2012/01/16/three-years-with-java-simon-3/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 07:36:09 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[virtual-life]]></category>
		<category><![CDATA[callback]]></category>
		<category><![CDATA[java simon]]></category>
		<category><![CDATA[javasimon]]></category>
		<category><![CDATA[jmx]]></category>
		<category><![CDATA[observer]]></category>
		<category><![CDATA[webnode]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=614</guid>
		<description><![CDATA[I should finish this series before it should be called “Four years with Java Simon” &#8211; but we still have some time. I’ll show you what possibilities callbacks brought to the Simon, but first I’d like to deal with our Webnode site. It was three years back (January 13th, 2009) when I posted on our [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=614&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I should finish this series before it should be called “Four years with Java Simon” &#8211; but we still have some time. I’ll show you what possibilities callbacks brought to the Simon, but first I’d like to deal with our Webnode site.</p>
<p>It was three years back (January 13th, 2009) when I posted on our Webnode site that we need some better web for presentation than our project site on Google Code. But then we found we can’t post bunch of HTML files (Javadoc) on Webnode &#8211; and with mime-types SVN props we can do that on Google Code&#8230; oh, how quickly things change.</p>
<p>Webnode site could be good if Java Simon gained some bigger momentum on our side &#8211; more committers and contributors, people writing blogs or tutorials or success stories (or not so success stories too if they can help <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). But this did not happen and I felt as rather annoying obligation to update this site. Especially because the edit functionality is on a separate URL &#8211; editing a Wikipedia page or a blog post on WordPress is always just one click away &#8211; but not so on Webnode.</p>
<p>Three years later I decided to redirect javasimon.org on our <a href="https://plus.google.com/115141838919870730025">Google+ page</a> because it is so much easy to update, posting even very short posts is not inappropriate (which would be on a blog) and it’s just so much closer to my way of living on the Internet right now. I’ll go through javasimon.webnode.com and it will soon be a matter of past.</p>
<p>Last time I discussed some changes from version 1 to version 2. And to preserve the little from Webnode site that has any “historical” value I hereby copy one blog post covering just these differences:</p>
<blockquote><p><strong>Major changes in the core of the Java Simon v2</strong><br />
2009-01-28 14:30<br />
While there are some important extensions to the Java Simon (JMX, Spring integration, etc.) there are a few important changes in the core part of the API that are probably even more important. If you&#8217;ve already managed to use Java Simon 1 I strongly suggest that you use version 2 even in its alpha stages. The thing is:</p>
<ul>
<li>If your project is finished or close to finish (month or two) stay with version 1.</li>
<li>If your project continues and you&#8217;re just experimenting with Simon, definitely use version 2! There is v2-alpha1 which is basically rework of the v1 after a few changes in Stopwatch. If there is newer alpha out (check Featured Downloads on the right on our project page) take that one of course, because it contains more features from v2.</li>
<li>Version 2 is planned to be out during March or April 2009, which is really soon.</li>
</ul>
<p>Now what are the changes and why we made them?</p>
<ul>
<li>Important change happened in the <strong>Stopwatch</strong>. While in the v1 it contained various start/stop methods that took care of multi-threaded environment now it has only <strong>one start method</strong> and this start doesn&#8217;t return this anymore but it returns <strong>new Split object</strong> instead. You have to take care of the Split object, you have to take care of your multi-threading, you have to <strong>call stop method on the Split</strong>. This makes our code safer as the Stopwatch doesn&#8217;t contain internal maps that were prone to memore-leaks if client forgot to stop some split. Thanks to Erik van Oosten and his great Java Simon evaluation.</li>
<li>Based on the same post we changed <strong>sample methods</strong> so that they <strong>return Java Bean objects</strong> now instead of the field.</li>
<li>While in v1 you had to use SimonManager now <strong>you can use non-static Manager implementation</strong> directly. SimonManager still stays your favourite convenient class full of static methods, of course. <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  This allows to have multiple separeated Simon hierarchies which may be handy in Java EE environment.</li>
<li>To provide some extensibility for the API we introduced <strong>Callback</strong> interface. This allows to hook onto various events and process these events in any way you want &#8211; to log them, send JMX notifications, whatever.</li>
</ul>
<p>There are more features to come with version 2 and I covered only those in the core part of the API. Stay tuned, download, use, test, let us know what you think. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p></blockquote>
<p>Now let’s take a look at those Callbacks. Based on good-old Observer pattern, <a href="http://code.google.com/p/javasimon/source/browse/trunk/core/src/main/java/org/javasimon/callback/Callback.java">Callback</a> is a listener that performs some actions on various events. First question was where the Callback should be registered &#8211; and we decided that Manager will hold its Callbacks. We didn’t want to scatter Callbacks across various Simons because typical usage would lead to a situation where many Simons call (and point to) the same Callback. We rather decided we will centralize Callback management on a Manager (that is per Manager of course) and bring some way how to filter events based on Simon name for instance.</p>
<p>Simple example of Simon is in our <a href="http://code.google.com/p/javasimon/source/browse/trunk/examples/src/main/java/org/javasimon/examples/CallbackExample.java">CallbackExample</a>:</p>
<pre class="brush: java; title: ; notranslate">
    SimonManager.callback().addCallback(new CallbackSkeleton() {
           public void onStopwatchStart(Split split) {
               System.out.println(&quot;\nStopwatch &quot; + split.getStopwatch().getName() + &quot; has just been started.&quot;);
           }

           public void onStopwatchStop(Split split) {
               System.out.println(&quot;Stopwatch &quot; + split.getStopwatch().getName()
                   + &quot; has just been stopped (&quot; + SimonUtils.presentNanoTime(split.runningFor()) + &quot;).&quot;);
           }
       });

       Stopwatch sw = SimonManager.getStopwatch(SimonUtils.generateName());
       sw.start().stop();
</pre>
<p>When you work with Simon (last two lines) you don’t care about Callbacks &#8211; they will be called. Their configuration can be based on some configuration and they should do whatever you want to hook on various Simon events.</p>
<p>BTW: If you use Java Simon 3.1 method onStopwatchStop is still called stopwatchStop. This is quite serious flaw and poor choice of method name on my part (and I’m terribly sorry for that). While this method doesn’t show it clearly, there was another method &#8211; clear (now onManagerClear). This method is called &#8211; as you may guess from the new name &#8211; when clear method on the manager is called. Let me explain composite callbacks first to show you the whole problem&#8230;</p>
<p>To add more callbacks to the manager is all right but if you want to filter Simons (by name, for instance) that fire an event on a Callback you actually need to do it in the event itself. Or wrap the Callback into another one &#8211; that is exactly what FilterCallback idea is all about. Another thing is that you may need to call various callbacks for the same filter &#8211; to group them &#8211; and that is what composite callback does &#8211; holds more callbacks (children) and relays the event to all of them. There is no interface CompositeCallback &#8211; instead all these methods are on Callback already, but they are not implemented in the CallbackSkeleton for instance (used in the example above). There is one implementation called CompositeFilterCallback &#8211; and you probably can guess what it does. It can hold more callbacks and call them when the common configured filter is passed. See <a href="http://code.google.com/p/javasimon/source/browse/trunk/examples/src/main/java/org/javasimon/examples/CallbackFilteringExample.java">CallbackFilteringExample</a> for simple use case.</p>
<p>Now guess how people tried to remove callbacks from composite callback. It’s just a collection of callbacks after all, right? Ah, method “clear” must do exactly what I need here. But it didn’t. And if you didn’t implement this event method (which is not very common, but <a href="http://code.google.com/p/javasimon/source/browse/trunk/core/src/main/java/org/javasimon/jmx/JmxRegisterCallback.java">JmxRegisterCallback</a> is nice example where it is very handy) it simply did nothing. There was method to remove one callback, but not all of them (this one was in SimonUtils). This is all finally fixed with version 3.2 &#8211; all names are much better and removeAllCallbacks is in the Callback interface.</p>
<p>JMX is nice example why we needed callbacks just as much as we wanted to offer them to our users. There are two ways how to access Simons via JMX &#8211; you can use single point MX bean, or let Simon instantiate MX beans per Simon. The latter however requires some actions when Simon is created, destroyed or the whole manager is cleared. I mentioned <a href="http://code.google.com/p/javasimon/source/browse/trunk/core/src/main/java/org/javasimon/jmx/JmxRegisterCallback.java">JmxRegisterCallback</a> already &#8211; check how it’s done there. Now the Simon manager knows about Callback mechanism &#8211; but it doesn’t have to know about JMX &#8211; or anything else you want to drive by these events.</p>
<p>Split introduction and Callbacks are two very important changes that happened in version 2 &#8211; and these things are now well proven and will probably last (though some names can change as will happen in version 3.2 <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). Next time I’ll try to wrap up the rest of the story.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/614/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/614/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=614&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2012/01/16/three-years-with-java-simon-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>
	</item>
		<item>
		<title>Open letter to Java Simon users</title>
		<link>http://virgo47.wordpress.com/2012/01/11/open-letter-to-java-simon-users/</link>
		<comments>http://virgo47.wordpress.com/2012/01/11/open-letter-to-java-simon-users/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 16:49:39 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[virtual-life]]></category>
		<category><![CDATA[java simon]]></category>
		<category><![CDATA[javasimon]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=611</guid>
		<description><![CDATA[I bet there are people who are not on our mail group or watching Java Simon page on Google+. Roughly three years after the first official release we have another really good release. I’m really proud about our newest Java Simon release (3.1.0) and I decided to share the mail written to javasimon@googlegroups.com also here [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=611&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I bet there are people who are not on our mail group or watching Java Simon page on Google+. Roughly three years after the first official release we have another really good release.</p>
<p>I’m really proud about our newest Java Simon release (3.1.0) and I decided to share the mail written to javasimon@googlegroups.com also here on my blog:</p>
<blockquote><p>Dear Java Simon users</p>
<p>Firstly &#8211; version 3.1.0 was released on New Year&#8217;s Day &#8211; more about it<br />
on our project site:<br />
<a href="http://code.google.com/p/javasimon/">http://code.google.com/p/javasimon/</a></p>
<p>We announced it also on our new stream on Google+ (it should be<br />
available for non-google users too):<br />
<a href="https://plus.google.com/b/115141838919870730025/115141838919870730025/posts/ZpmYGp9F2yp">https://plus.google.com/b/115141838919870730025/115141838919870730025/posts/ZpmYGp9F2yp</a></p>
<p>Secondly &#8211; about Google+ &#8211; we decided to pull down our Webnode site<br />
because it was a bit cumbersome to maintain and add new posts there.<br />
Instead we are moving to the aforementioned Google+ page.</p>
<p>Direct link: <a href="https://plus.google.com/115141838919870730025/posts">https://plus.google.com/115141838919870730025/posts</a><br />
Short link: <a href="http://gplus.to/javasimon">http://gplus.to/javasimon</a><br />
Or just use our domain! <a href="http://javasimon.org/">http://javasimon.org/</a> or <a href="http://www.javasimon.org/">http://www.javasimon.org/</a></p>
<p>This way it should be easier for us to post more often even smaller<br />
facts about your favourite monitoring library. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Thirdly &#8211; Happy New Year to you all, update and share your thoughts, I<br />
feel very well about the last release. We&#8217;re working on 3.2 already,<br />
with our new commiter (Gerald) we should be able to deliver simple<br />
embeddable web console too, so there is a lot to be looking forward<br />
to.</p>
<p>Best regards and wishes</p>
<p>Richard &#8220;Virgo&#8221; Richter</p></blockquote>
<p>You are welcome &#8211; and encouraged &#8211; to add Google+ page into your circles of course. And once more &#8211; Happy New Year &#8211; as this is my first post here in 2012. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/611/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=611&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2012/01/11/open-letter-to-java-simon-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>
	</item>
		<item>
		<title>2011 in review</title>
		<link>http://virgo47.wordpress.com/2011/12/31/2011-in-review/</link>
		<comments>http://virgo47.wordpress.com/2011/12/31/2011-in-review/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 22:51:01 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[virtual-life]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=604</guid>
		<description><![CDATA[If you blog on WordPress you probably got the mail too. It was just lovely dot after the whole year on the Internet. Especially with sentences like &#8220;your writing has staying power&#8221;. That made my day. Here it goes &#8211; full of it is behind the link at the bottom: The WordPress.com stats helper monkeys [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=604&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><i>If you blog on WordPress you probably got the mail too. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  It was just lovely dot after the whole year on the Internet. Especially with sentences like &#8220;your writing has staying power&#8221;. That made my day. Here it goes &#8211; full of it is behind the link at the bottom:</i></p>
<p>The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.</p>
<div style="background:url('/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg') no-repeat center center;height:300px;"></div>
<p>Here&#8217;s an excerpt:</p>
<blockquote><p>The concert hall at the Syndey Opera House holds 2,700 people. This blog was viewed about <strong>26,000</strong> times in 2011. If it were a concert at Sydney Opera House, it would take about 10 sold-out performances for that many people to see it.</p></blockquote>
<p><a href="/2011/annual-report/">Click here to see the complete report.</a></p>
<p>PS: I forgot to mention that my wife&#8217;s blog about cooking &#8211; in Slovak only! &#8211; made three times bigger numbers. With only two new posts this year she reportedly sold out Medison Square Garden three times (I was rather compared to Sydney Opera &#8211; another nice touch of the report). <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/604/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=604&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2011/12/31/2011-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>
	</item>
		<item>
		<title>Personal Log (4): Games I played in 2011</title>
		<link>http://virgo47.wordpress.com/2011/12/27/personal-log-4-games-i-played-in-2011/</link>
		<comments>http://virgo47.wordpress.com/2011/12/27/personal-log-4-games-i-played-in-2011/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 12:40:11 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[real-life]]></category>
		<category><![CDATA[virtual-life]]></category>
		<category><![CDATA[anomaly warzone earth]]></category>
		<category><![CDATA[batman arkham asylum]]></category>
		<category><![CDATA[dragon age origins]]></category>
		<category><![CDATA[frozen synapse]]></category>
		<category><![CDATA[half-life 2]]></category>
		<category><![CDATA[king arthur]]></category>
		<category><![CDATA[Mass Effect]]></category>
		<category><![CDATA[oblivion]]></category>
		<category><![CDATA[Steam]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=600</guid>
		<description><![CDATA[Last time I wrote “Personal Log” it was the end of 2009 and I wrapped it up in my post from more perspectives. Year 2011 was a good one (again), I started in a new job in January, our daughter Barbora was born in January &#8211; but even with these obligations (job and family) and [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=600&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Last time I wrote “Personal Log” it was the end of 2009 and I wrapped it up <a href="http://virgo47.wordpress.com/2010/01/01/personal-log-3-year-of-fulfilled-dreams/">in my post</a> from more perspectives. Year 2011 was a good one (again), I started in a new job in January, our daughter Barbora was born in January &#8211; but even with these obligations (job and family) and a lot of additional work on <a href="http://gplus.to/javasimon">Java Simon</a> I still managed to play games. And to my surprise &#8211; quite a lot. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I’ll talk only about single-player games because I can’t engage into any serious multi-player with all the children around. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>So let’s start with the previous Christmas sales on <a href="http://store.steampowered.com/">Steam</a>. I bought Mass Effect 2, King Arthur Pack, Railworks (now updated to Train Simulator 2012), Dragon Age: Origins, Crysis Complete, The Ball and Burnout Paradise. I even new I may not play some of them, but for the gamer it would be a sin not buy it when it’s so cheap. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I want to play The Ball just because it’s made by Hourences and the team of other great mappers/modders who had been around Unreal engine and Unreal Tournament quite some time &#8211; and the game is original too.</p>
<p>In the last few years <strong>Mass Effect</strong> may be my favourite franchise &#8211; it’s a great shooter and I even forgot it’s RPG. Not that I have anything against RPGs &#8211; on the contrary &#8211; lately I played more RPGs of various types to my own surprise. I stopped playing other games and first I had to go through <strong>Mass Effect 2</strong> (twice, different gender, different specialization). While you don’t exactly save the galaxy in front of the whole council (dead or alive <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ) like in the first part, the continuation is probably more epic on the whole. Not that I didn’t have any gripes about the game, I can’t remember them now &#8211; but I can remember how great the game was. As I remember the VI announcing another customer in line from the first part I still have vivid memories of quite a lot of scenes from ME2. This game flows well and it’s getting bigger and bigger towards the end. If you like sci-fi RPGs (or even shooters and can survive a few dialogues) then this is an absolute must-have. ME1 was great, ME2 is greater, with less annoyances, more variability in scenery, more subplots and one really nasty boss at the end. Fun factor 5/5, frustration 0, length just right.</p>
<p><strong>King Arthur</strong> was the game I spent the start of the year with (after ME2 that is). I was really surprised with the blend of the Heroes M&amp;M turn-based strategy (on a map that reminded me good old Defender of the Crown) and RTS battles &#8211; this all spiced up by simple text-based quests and some economy. I was really surprised how playable the game was. In the middle of it I thought I will loose because opponents’ knights (heroes) started to be very strong while I underestimated the power of some spells, but somehow I managed to outmaneuver them in the end. If you like strategies, try it. On the RTS battlefield it’s often about you knowing how to play around key areas and you may destroy a few armies with a single one. Maybe hard-core players would object, but I &#8211; casual nearly-ex-gamer &#8211; appreciated this concept. Fun factor 4/5, frustration 0, length quite long as expected. Typical “just one more move and I’ll go to bed” game.</p>
<p><strong>Batman: Arkham Asylum</strong> is a bit difficult story. I had troubles to save single player games originally &#8211; I even wanted to play cracked version because of the stupid Windows Live service. But I figured out the offline profile feature (hidden in an unbelievably stupid way) and then I started to play. Another serious issue &#8211; no way to change controls. I’m ESDF guy, I touch-type too. WASD drives me crazy and when I want to press 1, I always press ` (key to the left) &#8211; well&#8230; because I touch-type! Not to mention that one disabled guy told me how missing controls customization can render the game unplayable for them. But back to the game itself. The story, visuals and all was quite reminiscent of Bioshock (both Unreal 3 engine games, by the way). I liked special tactics Batman can use, detective mode, gargoyles, visuals &#8211; this all was very good. You were really in the middle of Batman’s story with may heroes I didn’t even know. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Boss fights were interesting, each of them a bit different. If you had any problem, game gave you some hints &#8211; I liked this as I’m less and less hard-core player and more and more a casual one. However here and there you played with different camera than over-the-shoulder and it made controls even more difficult (some boss fights mostly). You could take it as a minigame though. For one reason or the other I wasn’t so sucked into this game in the end, but I finished it after a few breaks (a few months mostly). Fun factor 4/5, frustration 3 (Windows Live + controls + camera), length just fine for me (progress meter counts also riddles, so you may probably end around 60% if you don’t care for the riddles). Recommended? Why not, but I don’t plan playing Arkham City.</p>
<p>In the middle of the year I suddenly got a strong need to play <strong>Half-Life 2</strong> again &#8211; with both Episodes too, of course. As scripted this FPS is, it is simply great. Even the second run. I realized how many scenes in this game are simply so great. The river, first gravity-gun practice, “We don’t go to Ravenholm”, blocked bridge, Nova Prospect fight while waiting for Alyx, all those striders, Overwatch Nexus, Citadel&#8230; all of it! And then the Episodes &#8211; reactor hot-fix, run away to the station, fleeing the city, jumping over a broken bridge, Alyx down and up again, ambush in a homestead and amazing finale of the second episode. Without making any choices, without any active dialogues, the story is just great and I think I’ll probably have to go through it some other time again. Not to mention that it has great commentaries too &#8211; these just underline how well-thought this game is. Fun factor 5, frustration 0, length just fine &#8211; I even consider the main game quite long for a shooter, but I bet it’s short for others. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I was nicely surprised by <strong>Anomaly Warzone Earth</strong>. Simple, arcadish, and as goes with turret defense &#8211; very addictive. The concept of playing against the turret defense is smart, it is spiced up with a lot of specific details on particular maps and while this game was shorter in overall, it was also cheaper as it is no AAA title. Still the production was surprisingly good and the whole game is just smooth. Worth a few bucks for killing a few evenings, really. Fun 5, frustration 0, length could be longer, but OK.</p>
<p><strong>Frozen Synapse</strong> on the other hand was too much for me. You have to dedicate more time to this game, it’s not good for a casual player I’d say. I expected some kind of Laser Squad I remember from ZX Spectrum (or the horrible port on PC) &#8211; but then &#8211; I had much more time (and much less games) back then. However the concept is interesting but without going for a multiplayer it’s probably not worth it. Fun factor 3 (single player), frustration 0, length &#8211; no idea.</p>
<p>And then there’s <strong>The Elder Scrolls IV: Oblivion</strong>. I played Morrowind before, but after some time I just gave up. Maybe I chose more boring class, but I guess different class wouldn’t change my mind. Oblivion is more or less like Morrowind &#8211; but more fun. Both these games are BIG. A lot of locations, a lot of characters, a lot of quest. However I lost my goal after some time. Oblivion is far better from this perspective than Morrowind, not only because it’s newer. But still &#8211; after shutting a few Oblivion gates I started to loose my focus, I didn’t know where to go and what to achieve in this game. This game is very good and having less other games and more time I’d probably play it (and maybe I’ll return to it). System is better than in Morrowind, a bit simpler, leveling goes more naturally, movement around the world map is faster &#8211; this all makes the game great. But when I compare it with games like Witcher and Dragon Age Origins (which I’m playing now though I hardly started the story) it’s easy to get lost here. I like RPGs that lead the player a bit (or more) &#8211; Witcher, Dragon Age, Mass Effect &#8211; these are much better in this aspect. For Oblivion the fun factor is 4, frustration 0, length was too much for me. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>However, there is one easy way how to try a lot of games for little money. Wait a year or two and buy it during holidays sales if you’re not sure if you really want it. I remember buying Unreal Tournament 3 in metal case for quite a lot of money for my taste &#8211; and I was utterly disappointed by the game (though I loved UT99/2004). That’s why I hate to give anything more than 30 for a game I’m not sure of. Having Dragon Age 1 with all of the DLCs (another reason why to wait a bit) for 20 is much better deal then. I rather spend a lot of money on a lot of games risking I’ll not play a few of them than spending even more money on a few ones, half of them probably more or less disappointing.</p>
<p>And what were your favourite games in 2011? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Let me know, anonymous comments are allowed as well &#8211; as always.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/600/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/600/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=600&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2011/12/27/personal-log-4-games-i-played-in-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>
	</item>
		<item>
		<title>Three years with Java Simon (2)</title>
		<link>http://virgo47.wordpress.com/2011/12/05/three-years-with-java-simon-2/</link>
		<comments>http://virgo47.wordpress.com/2011/12/05/three-years-with-java-simon-2/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 15:09:47 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[java simon]]></category>
		<category><![CDATA[javasimon]]></category>
		<category><![CDATA[simon]]></category>
		<category><![CDATA[split]]></category>
		<category><![CDATA[stopwatch]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=589</guid>
		<description><![CDATA[This is continuation of the previous post where we somehow got to version 1.0 &#8211; that was December 2008. Working on our first version of Java Simon I learned a lot from my colleagues too. While we shared our views all the time on the OSS library we somehow did even better than on our [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=589&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This is continuation of <a href="http://virgo47.wordpress.com/2011/11/08/three-years-with-java-simon-1/">the previous post</a> where we somehow got to version 1.0 &#8211; that was December 2008.</p>
<p>Working on our first version of Java Simon I learned a lot from my colleagues too. While we shared our views all the time on the OSS library we somehow did even better than on our common (resource limited) projects. We also knew that library must be even cleaner and better than some Information System developed once &#8211; often without proper support budget. One guy insisted on finals whenever possible (which I’m not fan of) and he also vigorously refactored methods with boolean flags &#8211; and I originally disliked this change. In Simon interface we had methods like:</p>
<pre class="brush: java; title: ; notranslate">
Map&lt;String, String&gt; sample(boolean reset);
</pre>
<p>Now we have much cleaner two methods instead of using boolean parameter &#8211; not to mention that we have Sample object instead of Map used in early versions:</p>
<pre class="brush: java; title: ; notranslate">
Sample sample();
Sample sampleAndReset();
</pre>
<p>Not that we don’t have any method with boolean flag &#8211; but the most prominent one is rather management one compared to sample methods:</p>
<pre class="brush: java; title: ; notranslate">
void setState(SimonState state, boolean overrule);
</pre>
<p>Generally I don’t like using boolean flag parameters because they are hard to read when you see just plain code. If they are replaced with enums (where suitable) readability goes up instantly. If they are split to two methods &#8211; especially when one of them is rather default (like the sample without reset) &#8211; even better.</p>
<p>Working on an OSS library (or any other library &#8211; even a private one) you have to think way harder (or rethink more often) how to organize your interface, packages and all. I personally hate backward compatibility as an ultimate decision and we knew that we will change the interface here and there. If you want to upgrade then just go through your code and change those few things you have to change! Or don’t upgrade. (I’ll not go on about the whole myth of compatiblity and how often it is not completely true.)</p>
<p>That’s why we decided to release version 1.0 quite soon (December 2008, we started the project in August 2008) and find out what is missing. Version 2.0 followed quite quickly &#8211; in January 2009 we had the first alpha (quite stable though) and we decided to focus solely on this without any support for 1.0. The reason was that the Stopwatch behaviour changed quite a lot &#8211; for the better.</p>
<p>In 1.0 HalloWorld looked something like this:</p>
<pre class="brush: java; title: ; notranslate">
SimonStopwatch stopwatch = SimonFactory.getStopwatch(&quot;org.javasimon.HelloWorld-stopwatch&quot;);
stopwatch.start();
System.out.println(&quot;Hello world, &quot; + stopwatch);
stopwatch.stop();
System.out.println(&quot;Result: &quot; + stopwatch);
</pre>
<p>Most important feature was that both start and stop were called on the Stopwatch. Now you may wonder what would happen if you started stopwatch twice and stopped it twice as well. It depended&#8230; though &#8211; honestly &#8211; I don’t remember exactly. Stopwatch had thread-local variable that remembered start timestamp (nanoseconds of course) and stop was expected to be called in the same thread. Double start and stop was illegal operation. Now this implied two serious limitations. The first was potential memory leak on the thread-local variable if you (client programmer) failed (or forgot) to stop the stopwatch. The second was that you couldn’t stop the stopwatch in a different thread.</p>
<p>This was troublesome design and happened to be resolved soon after 1.0 release. Our new HelloWorld looked (and still looks) like this:</p>
<pre class="brush: java; title: ; notranslate">
Stopwatch stopwatch = SimonManager.getStopwatch(&quot;org.javasimon.examples.HelloWorld-stopwatch&quot;);
Split split = stopwatch.start();
System.out.println(&quot;Hello world, &quot; + stopwatch);
split.stop();
System.out.println(&quot;Result: &quot; + stopwatch);
</pre>
<p>Now the client programmer is fully responsible for working with the Split, there is no thread-local and the worst thing that may happen to the stopwatch is that its “actual” count will go up and up (and so indicate some problem with missing stops). Split will be garbage collected &#8211; unless stored by the programmer (his fault anyway <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ).</p>
<p>Another important features coming with 2.0 were JMX support (MX Bean) and Callbacks &#8211; these allowed programmer to hook on various events. But more about these in my next post, right?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/589/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/589/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=589&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2011/12/05/three-years-with-java-simon-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>
	</item>
		<item>
		<title>Three years with Java Simon (1)</title>
		<link>http://virgo47.wordpress.com/2011/11/08/three-years-with-java-simon-1/</link>
		<comments>http://virgo47.wordpress.com/2011/11/08/three-years-with-java-simon-1/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 23:10:14 +0000</pubDate>
		<dc:creator>virgo47</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[jamon]]></category>
		<category><![CDATA[java simon]]></category>
		<category><![CDATA[jmx]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[simon]]></category>
		<category><![CDATA[tss]]></category>

		<guid isPermaLink="false">http://virgo47.wordpress.com/?p=579</guid>
		<description><![CDATA[If you wonder what that Java Simon is just check the project site. It all started when we got back from TheServerSide Java Symposium in Prague in 2008. One of the many talks given there was about JAMon (don’t mix it with jamon &#8211; the text template engine) &#8211; simple monitoring API that allowed you [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=579&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>If you wonder what that Java Simon is just check <a href="http://code.google.com/p/javasimon/">the project site</a>. It all started when we got back from TheServerSide Java Symposium in Prague in 2008. One of the many talks given there was about <a href="http://jamonapi.sourceforge.net/">JAMon</a> (don’t mix it with jamon &#8211; the text template engine) &#8211; simple monitoring API that allowed you to code your monitors into your application and obtain the results later.</p>
<p>JAMon guys used <a href="http://sourceforge.net/projects/jarep/">Jarep</a> to store and graph results and what I liked the most was the story how these results available over a long time helped them when they needed it. Story went something like: “We found out that the performance of our web-shop started to be unacceptable sooner then originally calculated. Graph showed us that there was sudden jump half a year ago and since then the application performed worse. Luckily we had also work plan from IT stuff that revealed that the same day new JDBC driver was installed &#8211; and that was the reason.” Bottom line &#8211; without data you just don’t know. I liked that and it went pretty much along the lines <a href="http://kirk.blog-city.com/">Kirk Pepperdine</a> says all the time &#8211; you need proof, you need data, you just need to know &#8211; don’t guess. Actually most wise people say that, but I remember Kirk and also that JAMon/JARep story when it comes to performance and monitoring.</p>
<p>A colleague of mine tried to use JAMon for our work project but he was not happy about the API. He was missing some management hierarchy &#8211; and that’s how idea of a tree hierarchy (not much different from java.util.logging for instance) for Simons started. Another issue was timer based on ms (JAMon is compatible with J2SE 1.4), I didn’t like that at all. So many things may happen in a single ms &#8211; not to mention most Windows changed the timer ever 10 or 16 ms. We decided to write our stopwatch facility and over one August weekend I wrote some basics (<a href="http://code.google.com/p/javasimon/source/list?num=25&amp;start=7">our first commits</a>) and we started building on it. We can’t measure anything &#8211; like JAMon tries &#8211; we focused solely on Stopwatch and Counter. Three years later I’m happy about it &#8211; Stopwatch being probably 90% (or more) of all used Simons. Originally I wanted to give our users some way to add another kinds of Simons, but soon I realized how messy it would all become.</p>
<p>JAMon was in version 2.7 when we started the Simon project and the page looked exactly how it looks right now. We finished the first version in December, we were happy about most of it, we cared for the code and for the Javadoc too &#8211; and I think it was really obvious from the look at the project. These are ideas we still care for and quality Javadoc is undisputed part of the project.</p>
<p>TSS press release: <a href="http://www.theserverside.com/news/thread.tss?thread_id=52447">Java Simon 1.0, monitoring API, released</a></p>
<p>Simon gained some initial attention and one particular developer even blogged a few times about us &#8211; check <a href="http://day-to-day-stuff.blogspot.com/2008/12/evaluating-simon.html">Evaluating Simon &#8211; Java monitoring</a> or other Erik’s <a href="http://day-to-day-stuff.blogspot.com/search/label/monitoring">posts related to monitoring</a>. Funny &#8211; later I’ve heard the name Erik van Oosten mentioned by my colleagues working with Wicket, but I’m 2 years ahead of the story. That&#8217;s just how it is with active people. His posts were most appreciated and he also provided AOP based Spring integration. Now &#8211; years later &#8211; even I use it in our current project (though it went through a few fixes, but the code is essentially still Erik’s).</p>
<p>Soon we discovered that the first version had a few serious issues and redesign was necessary. But more about that in the next installment some other time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/virgo47.wordpress.com/579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/virgo47.wordpress.com/579/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=virgo47.wordpress.com&#038;blog=2988789&#038;post=579&#038;subd=virgo47&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://virgo47.wordpress.com/2011/11/08/three-years-with-java-simon-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/af081c81efc82a005def915cde584475?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">virgo47</media:title>
		</media:content>
	</item>
	</channel>
</rss>
