<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4242186654644920321</atom:id><lastBuildDate>Thu, 04 Jul 2024 05:48:22 +0000</lastBuildDate><category>java</category><category>.NET</category><category>BlackBerry</category><category>IDEA</category><category>PDF</category><category>interop</category><category>Adobe Plugin</category><category>MCP</category><category>MIDP</category><category>Microsoft</category><category>MySQL</category><category>ant</category><category>linux</category><category>spring</category><category>ubuntu</category><category>.C#</category><category>API</category><category>BlazeDS</category><category>COM</category><category>CVS</category><category>FF</category><category>Google Base</category><category>Hackathon</category><category>JBoss</category><category>JNDI</category><category>List</category><category>SQLite</category><category>SVN</category><category>Subversion</category><category>TIFF</category><category>WISE</category><category>WMI</category><category>WP7</category><category>Windows</category><category>authentification</category><category>c++</category><category>eclipse</category><category>english</category><category>hacking</category><category>installations</category><category>invokeLater</category><category>j2ee</category><category>javascript</category><category>marshalling</category><category>maven</category><category>nas</category><category>plugin</category><category>radio</category><category>selection</category><category>service</category><category>tomcat</category><category>visual studio</category><category>wifi</category><category>ws</category><title>Development Days</title><description></description><link>http://revengedevelopment.blogspot.com/</link><managingEditor>noreply@blogger.com (rdev02)</managingEditor><generator>Blogger</generator><openSearch:totalResults>50</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-6106731945414487845</guid><pubDate>Wed, 28 Aug 2013 23:25:00 +0000</pubDate><atom:updated>2013-08-28T16:29:45.598-07:00</atom:updated><title>Synology  DS413j NAS</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; In my previous post I was rambling about&lt;a href=&quot;http://revengedevelopment.blogspot.com/2013/02/seagate-blackarmor-nas-400.html&quot; target=&quot;_blank&quot;&gt; Seagate BlackArmor &lt;/a&gt;and my sad experience with it. Apart from the sadness it also has my initial thoughts and requirements, so I won&#39;t duplicate them in this one. But, to keep consistent with the previous review I&#39;ll go with the same headings/experience areas. That being said - here we go!&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.synology.com/products/img/top/DS413j.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.synology.com/products/img/top/DS413j.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; Half a year has passed and I&#39;ve been using Synology NAS for all this time. I ordered it from Amazon and off it came right in the delivery timeframes, ready for my experiments and scrutiny.&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Packaging and build quality.&lt;/h4&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; I couldn&#39;t be impressed more. Apple usually is a master in packaging their products, but these guys(synology) can stand up the competition. Everything in the box was perfectly packed a secured in a very little amount of space yet preserving a pleasant unpacking experience. One of the nice things is - when I was moving I managed to pack it with the box I saved just as if it was never unpackaged. Somehow they thought out the packaging in a way you use all the parts, perfectly seal the device and accessories and you have no junk left:) - KUDOS!&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; Build is a step up from the aforementioned NAS. All the parts that were plastic in seagate are metallic in synology. The drive bay has 2 solid fans and the drives themselves are secured inside the bay with bolts. Accessing the drives is also not that easy - you have to unscrew 4 bolts at the back, lower the back panel with fans and then get to the drives. This is not as convenient as seagate&#39;s open-dorr-click-and-take-away system, but how often do you actually want to replace drives inside your NAS? ;)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;Other then that Synology is about the same size and noise, although heavier(due to metal parts). Move on to usage:)&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
UI and Software.&lt;/h4&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; It comes with &lt;a href=&quot;http://www.synology.com/dsm/index.php?lang=us&quot; target=&quot;_blank&quot;&gt;DSM 4.2&lt;/a&gt;. Usually, when you log into the web interface you would expect some semi-lame web app that&#39;ll link you to the features of your device. Not the case! Not even close! DSM web interface if one of the most(in not just the most) advanced web interfaces I&#39;ve ever seen. It&#39;s all ajax and feels like a fine-tuned linux window manager. you literally have a web-like sort-of OS, working on your NAS giving you full control over it. Pages can be written about all the possibilities you have with the built in apps and there&#39;s even more with thirds party packages. Literally, everything I might have thought/dreamed about that I could combine/use NAS for - is already there. With a nice, multitasking, rich intuitive and responsive interface. I won&#39;t go into much details about the apps - there&#39;s just too many of them to cover and each and every of them deserves good comments. Those who want to learn more - I welcome you to use link I mentioned a couple lines up.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;In 6 months I&#39;ve never seen any app crash or misbehave. Neither did I see any hardware faults or reboots. Stable. Reliable.&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
The worx.&lt;/h4&gt;
&lt;div&gt;
I did the same tests, that I had done for the previous NAS. They all showed good consistent results, so I went on started configuring and placing my data on it. For some reason new apps did not want to install to second partition, so I had to use the first one for all the apps and the second one for all other stuff which was not my initial plan. Whatever. I checked the read/write speeds and they were almost at what the specs were saying. Later I tested out 2 simultanious clients accessing 1080p video from the device, while one other device was listing pictures from it. They all showed decent performance and that is probably the biggest load I&#39;ll ever put on this device. So in general - it worx:).&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
The problems.&lt;/h4&gt;
&lt;div&gt;
I did not have them:) There was one problem I had not being able to set up Glacier backup from my NAS after I moved. But luckily they do have &lt;a href=&quot;http://forum.synology.com/enu/&quot; target=&quot;_blank&quot;&gt;support forums&lt;/a&gt;&amp;nbsp;which helped me understand that my time was not synchronized. After I fixed the time issue everything worked like a charm.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Summary.&lt;/h4&gt;
&lt;div&gt;
&lt;b&gt;pros:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
+ build quality&lt;/div&gt;
&lt;div&gt;
+ realiability&lt;/div&gt;
&lt;div&gt;
+ software&lt;/div&gt;
&lt;div&gt;
+ configurability&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;cons:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
- pricey&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Bonus.&lt;/h4&gt;
&lt;div&gt;
It costs around 2.5 times more than seagate, but I&#39;d say it&#39;s worth every penny I paid. In fact I was so happy with my purchase that I spread the word around and now a couple of my friends also have similar setups. And neither of them is unhappy. These boxes just work, so far.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;*all pictures are referenced from&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.synology.com/&quot;&gt;www.synology.com&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://revengedevelopment.blogspot.com/2013/08/synology-ds413j-nas.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-4282234522894079449</guid><pubDate>Tue, 05 Feb 2013 07:20:00 +0000</pubDate><atom:updated>2013-02-04T23:27:38.316-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">nas</category><title>Seagate BlackArmor NAS 400.</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; So I decided that I&#39;m sick and tired of plugging in and out usb drives. Be it my tiny 16GB &lt;i&gt;daily&lt;/i&gt; thumb drive, or &lt;i&gt;store-it-all&lt;/i&gt; 2TB external seagate - this is a pain... And to make sure everything is stored you have to &quot;detach/remove&quot; them safely all the time. And than eventually you need more storage(or will need) and expanding this kind of solution means more devices OR significantly more money. This is long and tedious so for quick and impatient &lt;b&gt;there&#39;s a summary&lt;/b&gt; &lt;b&gt;at the end&lt;/b&gt;.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Believe it or not &lt;i&gt;more money&lt;/i&gt; is inevitable so I decided to try and reduce the number of devices - pile everything up in one place - shall it stay safe and robust and accessible at all times. NAS. I had very few requirements:&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;at least 4 bays to be able to play with RAID 5/6/10.&lt;/li&gt;
&lt;li&gt;3.5 drive interface to keep them cheap&lt;/li&gt;
&lt;li&gt;&quot;quiet&quot; feature - at this would stay in my room.&lt;/li&gt;
&lt;li&gt;robust and reliable.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.seagate.com/files/www-content/product-content/blackarmor-fam/blackarmor-nas-400/_shared/images/blackarmor-nas-400-main-hero-313x313.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://www.seagate.com/files/www-content/product-content/blackarmor-fam/blackarmor-nas-400/_shared/images/blackarmor-nas-400-main-hero-313x313.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; I had a couple of Seagate drives before and overall my experience with them was good. Nowadays you can find complaints about pretty much any manufacturer and any product so I did not really pay attention to what &lt;i&gt;others&lt;/i&gt; said -&amp;nbsp; was looking for my set of requirements for the &lt;i&gt;right&lt;/i&gt; price. And there it &lt;a href=&quot;http://www.seagate.com/external-hard-drives/network-storage/business/blackarmor-nas-400/&quot; target=&quot;_blank&quot;&gt;shines&lt;/a&gt; - perfect solution for all my needs and even a little bit more! Remote management, encryption, DDNS, configurable backups, all-you-can-imagine media sharing, internal downloader and more - sweet!&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; So I went to Amazon and ordered one. It was just before new years so I received my order in a month - but that was not urgent: storage is not smth. that one should make haste with IMO.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Packaging and build quality.&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; I was actually impressed - the thing was of manageable size, pretty compact and fitted into my nightstand lower&lt;b&gt; &lt;/b&gt;deck. Loading this thing up with drives was super easy - it had a smart clip drive holding &lt;i&gt;system.&lt;/i&gt; No installation - you can install some &lt;i&gt;discovery&lt;/i&gt; program from CD but really - you do not need it. The only thing it does - it finds the IP of your NAS and forwards you to the browser. &lt;br /&gt;
Thus overall I was pleased with build quality: yes it was not top notch aluminum\nickel but mostly plastic. Yes it was a bit rough on the edges. Yes the green &lt;i&gt;screen&lt;/i&gt; was smth both enjoying and amusing, but for the price it was absolutely great and matched my needs in full. I was not going to use this in hazardous environments and I do not have little kids so that I would really worry about the build and plastic. The chip and software is what mattered....&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;UI and software&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://support.seagate.com/kbimg/004592-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;http://support.seagate.com/kbimg/004592-1.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; UI was slow. As a developer I&#39;m used to wait times. I&#39;m patient. But even for me it was tad slow. It was intuitive though. I quickly found my way around without the manual but then the limitations kicked in&lt;br /&gt;
- you have have a usb stick plugged in to the first usb slot(and only 1st, which front btw) if you want encryption&lt;br /&gt;
- you have to have entire volume encrypted&lt;br /&gt;
- you have to wait all surface scan and zero-out if you change anything about the volumes(and it lasts about 8 hours on my 2TB drives)&lt;br /&gt;
- you cannot have a read only share(bummer!)&lt;br /&gt;
- you have to do 1 thing at a time or else everything you configured before may get messed up and only hard reset followed by total zero-out\check of drives(8 hours again) will save you&lt;br /&gt;
- and probably many other I did not discover due to I did not plan to use that functionality at all.&lt;br /&gt;
BUT I went through all this, patiently, believing that once I get this linux set up and working - it&#39;ll be rock solid and serve me well for many years. That is how it is usually done with linux - you get it for cheep, but you pay with your time. Your configuration is a pain, but after all it worx (period)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The worx&lt;/b&gt;. &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; So I wanted to make sure that I can rely on this thing once I configured it. So I wrote a little program, that would generate a set of files, get their md5&#39;s, measure speed and have some brain to verify that files later. After all, the only way to understand if the drive would work for you - is to fill it up with data and see how it performs on parallel reads/writes. I&#39;ll post the code soon to github in case anyone would ever need it. I will.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; I started it up on 2 computers: one writing to encrypted partition, other - to public one(both raid 10) and a few days later I had my NAS populated with dummy, but recorded data. Thus: &lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;write speed turned out to be much slower for the encrypted volume than for the public one - around 2-5 Mb/s VS 5-7 for the unencrypted.&lt;/li&gt;
&lt;li&gt;read speed was good for both 10Mb/s for encrypted and 15-20 for unencrypted volume.&lt;/li&gt;
&lt;/ul&gt;
That was more than satisfying for me. I do not really need fast write, and that yields enough speed for one HD movie stream. Next were the problems tests that I was planning to execute - like remove a drive and see how NAS tackles it. But I did not have to do this problems arrived by themselves...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The problems.&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Another morning I woke up and found out that NAS reports one drive to be failed. No big deal - take it away and put a fresh new one. But I wanted to test out the speed and file integrity before doing this. So I launched my program again in test mode and an hour later my second drive was reported to be failing. Now I was in doubt, because the filesystem was still available. 2 hard drives from one branch of raid 10 fail and FS worx...how? Well. I restarted the NAS and drives showed up as &lt;i&gt;good&lt;/i&gt; but both volumes showed &lt;i&gt;degraded. &lt;/i&gt;Then 2 drives rendered failed and public volume remained degraded. Let me remind you that both volumes were based on same drives with same raid setting. Next the unpredictable happened - all data from public volume &lt;i&gt;disappeared&lt;/i&gt;. Volume was mountable, however displaying 90% full and empty at the same time. So I decided to take both of them and inspect in the external enclosure. The drives indeed turned out to have bad sectors on them. Fedora immediately told me that I want to replace those drives. BUT they were readable and fine. a couple of bad sectors could have been easily remapped afaik....&lt;br /&gt;
&amp;nbsp;&amp;nbsp; So I decided to give this NAS the last try to restore the disks with the spare drive I bought just for this purpose. Actually I decided to give NAS a chance to do what it was essentially bought for - tackle the hardware problem. But after I inserted the disks back(nothing was done to them - I just ran disk utils and gparted, I did not repair or remap anything. and yes - I labeled all drives before putting them into nas). - NAS told me that &quot;Problem....Data is recoverable. Please contact support&quot;. and pay money, probably... That was it for me - filed a return on amazon and the next morning it was gone.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SUMMARY&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;pros: &lt;/b&gt;&lt;br /&gt;
+ relatively good pricing(~200$)&lt;br /&gt;
+ nice form factor(small)&lt;br /&gt;
+ nice set of standard features out of the box(ddns, media service, downloader, raids)&lt;br /&gt;
+ enough speed for small office/home experiences.&lt;br /&gt;
&lt;b&gt;cons:&lt;/b&gt; &lt;br /&gt;
- not reliable(easy to corrupt internal FS, unable to restore/maintain data)&lt;br /&gt;
- clunky, slow and strange software(not only UI). IMO&lt;br /&gt;
- apparently has problems with concurrent usage. AFAIU&lt;br /&gt;
- not able to address basic hdd hardware problems(remap or even test for bad sectors - only does a S.M.A.R.T test and even that unreliably).&lt;br /&gt;
- &lt;i&gt;virtual&lt;/i&gt; support(The &lt;a href=&quot;http://forums.seagate.com/&quot; target=&quot;_blank&quot;&gt;forum &lt;/a&gt;I visited looks like gives answers only to &lt;i&gt;satisfactory&lt;/i&gt; questions or those you can find out by yourself.)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Next stop: &lt;/b&gt;&lt;a href=&quot;http://www.synology.com/products/product.php?product_name=DS413j&amp;amp;lang=us&quot; target=&quot;_blank&quot;&gt;Synology&lt;/a&gt;. To be continued...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*all pictures are referenced from seagate.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://revengedevelopment.blogspot.com/2013/02/seagate-blackarmor-nas-400.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-333012366123015415</guid><pubDate>Thu, 02 Aug 2012 22:35:00 +0000</pubDate><atom:updated>2012-08-02T16:44:15.794-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">javascript</category><title>Javascript performance tests</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I&#39;m dealing a lot with javascript nowadays and obviously I have to take performance into account. One way of doing this is writing a bunch of test code and record the time for your scripts, but what if you wanted to quickly test out some approaches and do not really want to invest a lot into them? Today I was pointed to a solution:&amp;nbsp;&lt;a href=&quot;http://jsperf.com/&quot;&gt;http://jsperf.com/&lt;/a&gt;. This awesome tool does not just give you the framework to easily test out javascript but also provides and already created library of tests other people created when investigating their performance issues. Sweet! I finally have answer to &lt;a href=&quot;http://jsperf.com/o-vs-a-access&quot;&gt;this&lt;/a&gt;&amp;nbsp;question. And many more :)&lt;br /&gt;It also quite clear that when dealing with math caching &lt;a href=&quot;http://jsperf.com/local-variables-vs-array-access&quot;&gt;arrays is a must&lt;/a&gt;.&lt;/div&gt;</description><link>http://revengedevelopment.blogspot.com/2012/08/javascript-performance-tests.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-4881748959795280390</guid><pubDate>Sun, 26 Feb 2012 15:15:00 +0000</pubDate><atom:updated>2012-02-26T07:22:47.839-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">WP7</category><title>WP7 Mango dive</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
It has been a few month since I started mangling with WP7 platform. The more I learnt about it from the inside the more I wanted to buy new real WP7  phone. Things changed slightly after I have done my very first app(didn&#39;t make it to the app store as I found plenty of similar ones already there and mine was not adding much :() but still as of now I would really be interested in posessing a WP7 phone and giving it a solid try. But let me start from the beginning...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Learning&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
As my primary learning resource I used 2 jumpstart sessions : &lt;a href=&quot;http://channel9.msdn.com/Blogs/egibson/Windows-Phone-7-Jump-Start-Session-1-of-12-Introduction&quot;&gt;WP7 jumpstart&lt;/a&gt; and &lt;a href=&quot;http://channel9.msdn.com/Series/Mango-Jump-Start/Mango-Jump-Start-01-Building-Windows-Phone-Apps-with-Visual-Studio-2010&quot;&gt;Mango jumpstart&lt;/a&gt;. If you have the time to invest into watching those I highly recommend them as these are very good sources of information to study the platform fast. Especially keeping in mind that all the sessions there are accompanied by code examples which are also easily found on &lt;a href=&quot;http://www.codeplex.com/&quot;&gt;codeplex&lt;/a&gt;. The code especially nice due to the availability of the before-after versions of demo applications so that it is easy to see the transition from incomplete/incorrect state to the solid code.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Environment&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=27570&quot;&gt;Windows phone SDK 7.1&lt;/a&gt; integrates seamlessly into VS2010 and makes a very pleasant environment to work with. The emulator gives you a lot of power when debugging your app. Still I missed the camera support(it is there but I kinda didn&#39;t like it) and the FS support. It&#39;s not so easy to look at things located on the Isolated storage as well as on the SD card. Otherwise there&#39;s everything you&#39;d want from the emulator, including recording gyroscope and accelerometer changes and playing them afterwards again and again.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Development&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Developing&lt;b&gt; &lt;/b&gt;WP7 is tricky yet interesting. You&#39;re using almost all of what .NET can offer with certain limitations(e.g. AsyncCallback is almost useless) seamlessly and easily. There&#39;s a lot you can customise in the standard controls collection. Still some common things which I would expect to be just working are in fact not. As an example I cannot grasp why would one want the Popup class if it still has to be injected into the visual tree &lt;i&gt;manually&lt;/i&gt;... Why not use the panel with visibility instead? It&#39;s a lot more natural to me than injecting the Popup somewhere at runtime... Another interesting discovery for me was the fact that IsolatedStorage is &lt;i&gt;not&lt;/i&gt; available in the OnNavigatedTo event. I guess MS guys give us a hint here that we should probably use only the StateStorage as it is much faster, and then use progress indicators to load heavy stuff after the page is loaded... but then why would I bother using StateStorage at all? Just put the &quot;loading...&quot; progress on top in the first place and get all the stuff from the IsolatedStorage where it is grouped together nicely and not scattered between 2 storage places(not to mention the fact that when storing to StateStorage you are highly recommended to store things to the IsolatedStorage as well as the state might not be available if the application was killed in the meantime..)&lt;br /&gt;
Nevertheless there&#39;s a lot to admire here as well... Among other things I liked the controls customisation ability and overlaying concept best. WYSIWYG designing is really helping out here cutting redeployment and testing time. Debugging the real phone is easy too.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Bottom line&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
WP7 development surely has its own intricacies one might not like, but for me this is what makes mobile development thrilling. You can discover completely new ways of using the very old concepts/controls and rethink your strategies towards certain solutions. Mobile changes the way you treat data and UI and Metro-powered&lt;b&gt; &lt;/b&gt;mobile development really broadens ones vision on how the data can be processed and delivered to utilise the customer needs.&lt;/div&gt;</description><link>http://revengedevelopment.blogspot.com/2012/02/wp7-mango-dive.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-5665069294984439073</guid><pubDate>Wed, 14 Sep 2011 06:50:00 +0000</pubDate><atom:updated>2011-09-13T23:51:44.045-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MySQL</category><title>MySql performance. 5.1 VS 5.5 VS 5.6 (dev)</title><description>Recently had to do an investigation about MySql server performance. So what I basically did was: created a winXP wmWare image, created a script for generating populating sql; installed db server version on that machine and kept track of times while executing sql statements; reverted to the original virgin machine state; start again. The versions I tested on were MySql community server 5.1, 5.5 and the development verion of 5.6. Here is the chart that represents my findings[the smaller the better]:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdmopsIzLTg_Tc68TC53PqG8NXKrDKMDbaQlGZWiSWoMCxL-ybkne37DkJa-1m4qa8lqCWDOzfCS41mqe_xe90Q8sCXsj8yE1KVpq-KeEJijNV6v_BD8zCtPw0i_cs6XlH6dc0dOK1Hfdk/s1600/msqlChart.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;233&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdmopsIzLTg_Tc68TC53PqG8NXKrDKMDbaQlGZWiSWoMCxL-ybkne37DkJa-1m4qa8lqCWDOzfCS41mqe_xe90Q8sCXsj8yE1KVpq-KeEJijNV6v_BD8zCtPw0i_cs6XlH6dc0dOK1Hfdk/s400/msqlChart.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
As a quick summary - interestingly enough I do not see any speed improvement since 5.1:) there is one between 5.5 and 5.6 but it&#39;s nowhere near the 5.1. &lt;br /&gt;
Now just a quick overview of what I used to actually get this chart.&lt;br /&gt;
The testTable:&lt;br /&gt;
The queries:&lt;br /&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Q1&lt;/td&gt;&lt;td&gt;select count(*) from test.testtable;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q2&lt;/td&gt;&lt;td&gt;select count(*) from testtable;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q3&lt;/td&gt;&lt;td&gt;SELECT * FROM testtable tst WHERE tst.id&amp;gt;1000 AND tst.id&amp;lt;10000;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q4&lt;/td&gt;&lt;td&gt;SELECT COUNT(*) FROM testtable tst WHERE tst.id&amp;gt;1000 AND tst.id&amp;lt;10000;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q5&lt;/td&gt;&lt;td&gt;SELECT * FROM testtable tst WHERE tst.testInt between 10000 AND 100000 ;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q6&lt;/td&gt;&lt;td&gt;SELECT COUNT(*) FROM testtable tst WHERE tst.testInt between 10000 AND 100000 ;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q7&lt;/td&gt;&lt;td&gt;SELECT * FROM testtable tst WHERE tst.testDouble between 0.1 AND 0.5 ;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q8&lt;/td&gt;&lt;td&gt;SELECT COUNT(*) FROM testtable tst WHERE tst.testDouble between 0.1 AND 0.5 ;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q9&lt;/td&gt;&lt;td&gt;SELECT * FROM testtable tst WHERE tst.testDouble &amp;lt;= 0.1 AND tst.testDouble &amp;gt; 0.5 ;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q10&lt;/td&gt;&lt;td&gt;SELECT COUNT(*) FROM testtable tst WHERE tst.testDouble &amp;gt;= 0.1 AND tst.testDouble &amp;lt; 0.5 ;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q11&lt;/td&gt;&lt;td&gt;SELECT * FROM testtable tst WHERE tst.testDate &amp;gt; &#39;2005/08/04 07:00&#39;;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q12&lt;/td&gt;&lt;td&gt;SELECT COUNT(*) FROM testtable tst WHERE tst.testDate &amp;gt; &#39;2005/08/04 07:00&#39;;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q13&lt;/td&gt;&lt;td&gt;SELECT * FROM testtable tst WHERE tst.testVarchar LIKE &#39;%AAAAAA&#39;;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q14&lt;/td&gt;&lt;td&gt;SELECT * FROM testtable tst WHERE tst.testVarchar LIKE &#39;%AAAAAA&#39; OR tst.testVarchar LIKE &#39;BBBBBB%&#39;;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q15&lt;/td&gt;&lt;td&gt;SELECT * FROM testtable tst WHERE tst.testInt between 10000 AND 100000 AND tst.testDouble between 0.1 AND 0.5 AND tst.testDate &amp;gt; &#39;2005/08/04 07:00&#39; OR tst.id&amp;gt; 9000000&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Q16&lt;/td&gt;&lt;td&gt;SELECT COUNT(*) FROM testtable tst WHERE tst.testInt between 10000 AND 100000 AND tst.testDouble between 0.1 AND 0.5 AND tst.testDate &amp;gt; &#39;2005/08/04 07:00&#39; OR tst.id&amp;gt; 9000000&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Absolute times and machine spec can be found &lt;a href=&quot;https://docs.google.com/spreadsheet/ccc?key=0AtItSpPjhRWvdDlDbklHUzZxNFBFNkRya3RNbng5ZWc&amp;amp;hl=en_US&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
Of course this is the developer machine setup and ran on one virtual machine, but still I thought that would be interesting for other to know. Ireally looking forward to making some more production-like tests now...&lt;br /&gt;
One more thing in case interested - the code snippet I used for generating the data:
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot; name=&quot;code&quot;&gt;public class CreateTestTableSql {

    private static final int QUERY_ROWS = 10 * 1000 * 1000;
    private static final int BATCH_SIZE = 10 * 1000;
    private static final boolean USE_BATCH = true;

    static Random r = new Random();
    static SimpleDateFormat sdf = new SimpleDateFormat(&quot;yyyy/MM/dd HH:mm&quot;);

    public static void main(String[] args) throws Exception {

        StringBuilder spotTradeSQLRow = new StringBuilder();


        File f = new File(USE_BATCH ? &quot;batchmysql.sql&quot; : &quot;mysql.sql&quot;);
        if (f.exists()) {
            f.delete();
        }

        assert f.createNewFile();

        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f)));

        System.out.println(&quot;Start&quot;);
        int batchCounter = 0;
        for (int i = 0; i &amp;lt; QUERY_ROWS; i++) {
            if (USE_BATCH) {
                if (batchCounter == BATCH_SIZE) {
                    spotTradeSQLRow.append(&quot;;\n&quot;);
                    batchCounter = 0;
                }
                if (batchCounter == 0) {
                    spotTradeSQLRow.append(&quot;INSERT INTO test.testtable VALUES(&quot;);
                } else {
                    spotTradeSQLRow.append(&quot;,(&quot;);
                }
            } else {
                spotTradeSQLRow.append(&quot;INSERT INTO test.testtable VALUES(&quot;);
            }
            spotTradeSQLRow.append(i + &quot;,&quot;); //id
            spotTradeSQLRow.append((r.nextBoolean() ?( &quot;&#39;&quot; +getRandomString() + &quot;&#39;&quot;): &quot;NULL&quot;) + &quot;,&quot;); //testVarchar
            spotTradeSQLRow.append((r.nextBoolean() ? r.nextInt() : &quot;NULL&quot;) + &quot;,&quot;); //testInt
            spotTradeSQLRow.append((r.nextBoolean() ? r.nextDouble() : &quot;NULL&quot;) + &quot;,&quot;); //testInt
            spotTradeSQLRow.append((r.nextBoolean() ? (&quot;&#39;&quot; + getRandomDate() + &quot;&#39;&quot;) : &quot;NULL&quot;) +
              &quot;)&quot;); //testInt
            if (!USE_BATCH) {
                spotTradeSQLRow.append(&quot;;&quot;);
            }
            out.write(spotTradeSQLRow.toString());
            out.write(&quot;\n&quot;);
            spotTradeSQLRow.delete(0, spotTradeSQLRow.length());
            batchCounter++;

        }
        if (USE_BATCH) {
           out.write(&quot;;&quot;);
        }

        out.close();
        System.out.println(&quot;end&quot;);

    }

    private static String getRandomDate() {
        int rand = r.nextInt(10);
        rand *= (r.nextBoolean() ? -1 : 1);
        final Calendar cal = Calendar.getInstance();
        cal.add(Calendar.YEAR, rand);
        cal.add(Calendar.DAY_OF_YEAR, rand);
        cal.add(Calendar.HOUR_OF_DAY, rand);

        return sdf.format(cal.getTime());

    }

    private static String getRandomString() {
        final int rand = r.nextInt(10);
        if (rand &amp;lt; 3) {
            return &quot;AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&quot;;
        } else if (rand &amp;gt;= 3 &amp;amp;&amp;amp; rand &amp;lt; 6) {
            return &quot;BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB&quot;;
        } else {
            return &quot;CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC&quot;;
        }
    }
}

&lt;/pre&gt;</description><link>http://revengedevelopment.blogspot.com/2011/09/mysql-performance-51-vs-55-vs-56-dev.html</link><author>noreply@blogger.com (rdev02)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdmopsIzLTg_Tc68TC53PqG8NXKrDKMDbaQlGZWiSWoMCxL-ybkne37DkJa-1m4qa8lqCWDOzfCS41mqe_xe90Q8sCXsj8yE1KVpq-KeEJijNV6v_BD8zCtPw0i_cs6XlH6dc0dOK1Hfdk/s72-c/msqlChart.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-3781600489736487653</guid><pubDate>Tue, 06 Sep 2011 08:06:00 +0000</pubDate><atom:updated>2011-09-06T01:06:04.187-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">spring</category><title>java.net.MalformedURLException: no protocol: and]</title><description>Had a problem with injecting JMSFactory for JBoss MQ using spring(for Camel :)). The problem had the next StackTrace:&lt;br /&gt;
&lt;blockquote&gt;
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: &lt;br /&gt;
&amp;nbsp;java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: &lt;br /&gt;
&amp;nbsp;java.net.MalformedURLException: no protocol: and]&lt;br /&gt;
&amp;nbsp;at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:780)&lt;br /&gt;
&amp;nbsp;at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)&lt;br /&gt;
&amp;nbsp;at javax.naming.InitialContext.lookup(InitialContext.java:392)&lt;br /&gt;
&amp;nbsp;at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)&lt;/blockquote&gt;
I was sure I configured it right as I have &lt;br /&gt;

&lt;pre class=&quot;brush: xml&quot; name=&quot;code&quot;&gt;
&amp;lt;jee:jndi-lookup id=&quot;JBossMQ&quot; jndi-name=&quot;XAConnectionFactory&quot; proxy-interface=&quot;javax.jms.ConnectionFactory&quot;
                     environment-ref=&quot;jndiProps&quot; resource-ref=&quot;true&quot;/&amp;gt;
    &amp;lt;util:properties id=&quot;jndiProps&quot; location=&quot;META-INF/spring/jndi.properties&quot;/&amp;gt;
&lt;/pre&gt;
And with those jndi.properties I was sure I have to get a refference as I could do that using the InitialContext 
by hand&quot;. &lt;b&gt;Turned out that it was maven that made things go wrong. moving the repository to a path with no spaces solved the issue&lt;/b&gt;(e.g. c:\maven\repo).&lt;br /&gt;
Hope this helps someone.</description><link>http://revengedevelopment.blogspot.com/2011/09/javanetmalformedurlexception-no.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-6024617850698148125</guid><pubDate>Tue, 28 Jun 2011 20:22:00 +0000</pubDate><atom:updated>2011-06-28T13:22:43.957-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>Plymouth fix for Ubuntu 11.04</title><description>If you&#39;re in the same trouble as I was with black screen during boot(plymouth has the theme installed and even displays it during shutdown) then there is a small thing that has to be edited in order to get rid of this annoyance. Go to&lt;br /&gt;
&lt;blockquote&gt;
&amp;nbsp;/etc/grub.d/10_linux &lt;/blockquote&gt;
and remove the&lt;b&gt; handoff=7 &lt;/b&gt;parameter. Inspired by &lt;a href=&quot;http://www.webalice.it/bernardi82/software/fixplymouth-natty&quot;&gt;this&lt;/a&gt; and also &lt;a href=&quot;http://zorin-os.webs.com/splashscreenmanager.htm&quot;&gt;this&lt;/a&gt;(pretty nice tool for configuring plymouth for dummies).&lt;br /&gt;
&lt;br /&gt;</description><link>http://revengedevelopment.blogspot.com/2011/06/plymouth-fix-for-ubuntu-1104.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-8921978613104718867</guid><pubDate>Mon, 20 Jun 2011 08:34:00 +0000</pubDate><atom:updated>2011-06-20T01:35:29.637-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Hackathon</category><title>Hackathon in Lviv</title><description>Great news! Best Hackathon traditions to invade Lviv. DOU is planning a hackathon @ June 9 — 10. Location is not set yet, but people are welcome to join now, so that we know there&#39;ll be enough people comming. &lt;a href=&quot;http://www.developers.org.ua/calendar/650/?utm_source=20110617&amp;amp;utm_medium=email&amp;amp;utm_campaign=CM&quot;&gt;More details here&lt;/a&gt;. If anyone interested to create a team - reach me via comments here or on IMs...</description><link>http://revengedevelopment.blogspot.com/2011/06/hackathon-in-lviv.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-5310725091673030473</guid><pubDate>Sun, 19 Jun 2011 21:16:00 +0000</pubDate><atom:updated>2011-06-19T14:16:36.681-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">english</category><title>IT ramblings</title><description>There is going to be an interesting event soon in Lviv both for those who are in IT and those who love to use and improve their english. It&#39;s called &lt;a href=&quot;http://lviv-it-ramblings.blogspot.com/2011/06/first-meeting-on-june-28th.html&quot;&gt;IT Ramblings&lt;/a&gt;. Follow the link and check it out. I&#39;m definitely coming, join in ;)</description><link>http://revengedevelopment.blogspot.com/2011/06/it-ramblings.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-3278899830728080567</guid><pubDate>Sat, 04 Jun 2011 07:54:00 +0000</pubDate><atom:updated>2011-06-04T00:54:25.747-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Microsoft</category><title>New quest from Microsoft</title><description>33+k UAH for those lucky to win the lottery among the ones most skilled in MS puzzle solving:) &lt;a href=&quot;http://ie9quest.com.ua/ref/2804&quot;&gt;More here&lt;/a&gt;</description><link>http://revengedevelopment.blogspot.com/2011/06/new-quest-from-microsoft.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-6368757093149332819</guid><pubDate>Wed, 01 Jun 2011 18:41:00 +0000</pubDate><atom:updated>2011-06-01T11:41:25.075-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">j2ee</category><category domain="http://www.blogger.com/atom/ns#">java</category><title>j2ee sdk install hanging fix.</title><description>Spent about 3 hours trying to install the latest &lt;a href=&quot;http://www.oracle.com/technetwork/java/javaee/downloads/index.html&quot;&gt;java ee sdk&lt;/a&gt; on my natty narwhal with no luck. It usually hang with 45% and 5seconds left forever. Might be I&#39;m a bad googler but turned out that there &lt;a href=&quot;http://markmail.org/message/xtjq2rvka2qd3drn&quot;&gt;is a bug in the installer&lt;/a&gt; which prevents the installation from continuing. The workaround is to &lt;b&gt;disable the network connections before the installation&lt;/b&gt; begins(disabling while it is hanging did not work for me). You won&#39;t have the Update
     Tool Bootstrap tool configured but still you&#39;ll have the sdk installed and ready for your tests/work.</description><link>http://revengedevelopment.blogspot.com/2011/06/j2ee-sdk-install-hanging-fix.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-8903601056026736909</guid><pubDate>Fri, 20 May 2011 21:07:00 +0000</pubDate><atom:updated>2011-06-28T13:23:58.219-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><category domain="http://www.blogger.com/atom/ns#">wifi</category><title>Avahi and &quot;network service discovery disabled&quot;</title><description>Had a real problem with my wifi after moving to Ubuntu from win -&amp;gt; my download speed was dead slow with ~2Mb/s. Tried various things including &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=1596769&quot;&gt;this&lt;/a&gt; &lt;a href=&quot;http://lokir.wordpress.com/2010/11/08/slow-wifi-problem-solved-ubuntu-10-04-10-10/&quot;&gt;this&lt;/a&gt; and finally &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=1282321&quot;&gt;this&lt;/a&gt;. The last one did the trick. It was Avahi which spoiled everything. The thing that led me to Avahi was this irritating message popping out each time I connected:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw2Iz_rcdkO3OdESwsnMWLyuIi624-m7_zxZlyqzGPDhE7Zdnnhs1MvAL-JAsjJEAHcTk60thdO3H4eYayUwQ2SxMBNt5uquJH8bXaOmCEn-a05jmGWspA5f5_XFgtaizBc-oudE2YQgok/s1600/AvahiWarn.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;119&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw2Iz_rcdkO3OdESwsnMWLyuIi624-m7_zxZlyqzGPDhE7Zdnnhs1MvAL-JAsjJEAHcTk60thdO3H4eYayUwQ2SxMBNt5uquJH8bXaOmCEn-a05jmGWspA5f5_XFgtaizBc-oudE2YQgok/s320/AvahiWarn.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Having this changed in&lt;br /&gt;
&lt;blockquote&gt;
&lt;i&gt;AVAHI_DAEMON_DETECT_LOCAL=1 to AVAHI_DAEMON_DETECT_LOCAL=0 in &lt;br /&gt;/etc/default/avahi-daemon&lt;/i&gt;&lt;/blockquote&gt;
Got me up to 22Mb/s after reboot. We&#39;ll see if I could squeeze more from my cheap router flashing it with some different firmware, but for now I&#39;m quite happy to gain a 10x speed improvement :)</description><link>http://revengedevelopment.blogspot.com/2011/05/avahi-and-network-service-discovery.html</link><author>noreply@blogger.com (rdev02)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw2Iz_rcdkO3OdESwsnMWLyuIi624-m7_zxZlyqzGPDhE7Zdnnhs1MvAL-JAsjJEAHcTk60thdO3H4eYayUwQ2SxMBNt5uquJH8bXaOmCEn-a05jmGWspA5f5_XFgtaizBc-oudE2YQgok/s72-c/AvahiWarn.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-5528013465357614484</guid><pubDate>Thu, 12 May 2011 12:34:00 +0000</pubDate><atom:updated>2011-05-13T13:20:52.761-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">FF</category><title>Tabkit =&gt; Vertical tabs</title><description>A post for those who, once tried, cannot live without vertical tabs in FF.&lt;br /&gt;
I used to have &lt;a href=&quot;https://addons.mozilla.org/en-us/firefox/addon/tab-kit/&quot;&gt;TabKit &lt;/a&gt;installed but this unfortunately does not support FF 4. So I even was very reluctant to switch to the new version as having my browsing (or should I say &lt;i&gt;research ) &lt;/i&gt;organized,&amp;nbsp;&lt;i&gt; &lt;/i&gt;is one of the crucial parts of my productivity. But turns out there is &lt;a href=&quot;https://addons.mozilla.org/en-us/firefox/addon/vertical-tabs/&quot;&gt;Vertical Tabs&lt;/a&gt; which does almost the same thing. It&#39;s not that polished as TabKit but it &quot;does the thing&quot; and so far I&#39;m happy with it.&lt;br /&gt;
&lt;br /&gt;
UPD: Found the &lt;a href=&quot;https://addons.mozilla.org/en-us/firefox/addon/verttabbar/&quot;&gt;VertTabBar&lt;/a&gt; addon also while writing this post... might suite someone more.</description><link>http://revengedevelopment.blogspot.com/2011/05/tabkit-vertical-tabs.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-5333201913415271247</guid><pubDate>Sun, 24 Apr 2011 10:43:00 +0000</pubDate><atom:updated>2011-04-24T03:44:48.239-07:00</atom:updated><title>Lift + ajax. The &quot;proper&quot; way of doing presentations.</title><description>24-th seconds rules...&lt;br/&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/6W1QoWujlqs?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
This mostly ru-zone compliant :)</description><link>http://revengedevelopment.blogspot.com/2011/04/lift-ajax-proper-way-of-doing.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-5975420065364951557</guid><pubDate>Fri, 22 Apr 2011 09:07:00 +0000</pubDate><atom:updated>2011-04-22T02:07:45.610-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">BlazeDS</category><category domain="http://www.blogger.com/atom/ns#">java</category><title>Java to BlazeDS NAN in double values.</title><description>Internet is basically full of subj but vice-versa(BlazeDS to java). So the problem I had was that when the object is &quot;translated&quot; from java via BlazeDS to flex application it had NAN&#39;s in the double fields. The transfer object was a simple POJO I passed via the interface. First thing I checked were the getters - all present and valid. I took quite a lot of time till we figured out that it was the missing setters which made the code malfunction. The problem was that on some objects I declared an immutable interface and implemented it in a DTO object. I did not add setters where I never planned to use them. This turned out to be the crucial mistake: &lt;b&gt;Always be sure to have both getters and  &lt;i&gt;setters&lt;/i&gt; in your DTO.&lt;/b&gt; It doesn&#39;t matter if you pass it via immutable interface or not - the underlying object &lt;b&gt;has to have both methods on the field&lt;/b&gt; otherwise we get NAN.</description><link>http://revengedevelopment.blogspot.com/2011/04/java-to-blazeds-nan-in-double-values.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-6897594797114839535</guid><pubDate>Thu, 21 Apr 2011 10:52:00 +0000</pubDate><atom:updated>2011-04-21T03:57:16.877-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">eclipse</category><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">maven</category><title>maven-compiler-plugin causing eclipse projects to have j2se 1.4 instead of configured one</title><description>Today was investigating the warnings around some of my eclipse maven projects and noticed that I have a few 
&lt;br /&gt;
&lt;blockquote&gt;
There are no JREs installed in the workspace that are strictly compatible with this environment&lt;/blockquote&gt;
messages. It took some time to figure out that it was actually the &lt;a href=&quot;http://maven.apache.org/plugins/maven-ear-plugin/usage.html&quot;&gt;maven-compiler-plugin&lt;/a&gt; causing the the J2SE version to be picked up correctly. If I changed the packaging of the maven project to jar everything was generated fine. After some searching it turned out there is a bug with the generation tool &lt;a href=&quot;http://www.blogger.com/m2eclipse.sonatype.org/%20&quot;&gt;m2eclipse&lt;/a&gt; I use. As &lt;a href=&quot;https://issues.sonatype.org/browse/MECLIPSEWTP-67&quot;&gt;described here&lt;/a&gt; the bug was fixed &lt;b&gt;TODAY&lt;/b&gt; by &lt;b&gt;removing the java nature from the project&lt;/b&gt;, which in turn removes the .classpath necessity which in turns removes the warnings. Few errors less - great work m2eclipse :).</description><link>http://revengedevelopment.blogspot.com/2011/04/maven-compiler-plugin-causing-eclipse.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-7155656920157614181</guid><pubDate>Tue, 19 Apr 2011 14:45:00 +0000</pubDate><atom:updated>2011-04-19T08:15:10.407-07:00</atom:updated><title>String.split() VS String.startsWith() VS Regex simple performance comparison.</title><description>Now really, what would be faster/more reliable for a typical not so complicated and not over-simple case? Yes the one we tend to deal with in our day-to-day work? For those impatient &lt;a href=&quot;#benchmarks&quot;&gt;benchmarks are here&lt;/a&gt;.Reading a 100/1000-line file is not fun and I really think you shouldn&#39;t bother choosing if you&#39;re dealing with such volumes of data. But if you have to parse 320k-500k records lines, which, in fact, is not that large - 320k of CSV data is ~ 12MB performance is considerable. So let&#39;s start with data definition. Let&#39;s assume we have data like &lt;br /&gt;
&lt;blockquote&gt;
1812332,&quot;String1&quot;,&quot;String2&quot;,&quot;String3&quot;,16, &lt;br /&gt;
1812332,&quot;String1&quot;,&quot;String2&quot;,&quot;String3&quot;,16, &lt;br /&gt;
1812332,&quot;String1&quot;,&quot;String2, extra string&quot;,&quot;String3&quot;,16, &lt;/blockquote&gt;
&lt;br /&gt;
Also we are going to start with the abstract &quot;blank&quot; for csv reading like:
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;public abstract class CsvStreamReader implements Iterator&amp;lt;CsvData&amp;gt; {
    protected BufferedReader reader;

    /**
     * creates an new {@code CsvStreamReader}. Caller is responsible for stream management.
     *
     */
    public CsvStreamReader() {
    }

    public abstract CsvData next();

    public boolean hasNext() {
        try {
            return reader.ready();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return false;
    }

    @Deprecated
    public void remove() {
        // not used
    }

    public void setInputStream(InputStream inputStream){
        reader = new BufferedReader(new InputStreamReader(inputStream));
    }
}&lt;/pre&gt;
And a simple data-holder like:
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;public class CsvData {
    private String[] data;

    public CsvData(String... data) {
        this.data = new String[data.length];
        System.arraycopy(data, 0, this.data, 0, data.length);
    }

    public String getColumn(int index) {
        return data[index];
    }

    public int getColumnCount() {
        return data.length;
    }

    @Override
    public String toString() {
        return &quot;CsvData{&quot; +
          &quot;data=&quot; + (data == null ? null : Arrays.asList(data)) +
          &#39;}&#39;;
    }
}&lt;/pre&gt;
Now the first and obvious way to read and parse the CSV would be smth like:
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;public class SplitBasedReader extends CsvStreamReader {

    public CsvData next() {
        try {
            String line = reader.readLine();
            return new CsvData(line.split(&quot;,&quot;));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}
&lt;/pre&gt;
This looks fairly good with one lil&#39; problem: it doesn&#39;t work good. If we take the last line with &quot;String2, extra string&quot; we see that the split would play a bad trick with us breaking the data consistency.
A quick fix would suggest smth like:
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;public class StringBasedReader extends CsvStreamReader {
    private static final String QUOTE = &quot;\&quot;&quot;;

    @Override
    public CsvData next() {
        try {
            List&amp;lt;String&amp;gt; data = new ArrayList&amp;lt;String&amp;gt;();
            final String line = reader.readLine();
            int commaStart = 0;
            int commaEnd = 0;
            StringBuffer possibleToken = new StringBuffer();

            while (commaEnd &amp;gt;= 0) {
                commaEnd = line.indexOf(&#39;,&#39;, commaStart + 1);
                if (commaEnd &amp;lt; 0) {
                    break;
                }
                final String possibleColumn = line.substring(commaStart, commaEnd);
                possibleToken.append(possibleColumn);
                commaStart = commaEnd + 1;

                final int length = possibleToken.length();

                boolean columnIsOpen = (possibleColumn.startsWith(QUOTE)) &amp;amp;&amp;amp; (!(possibleColumn.endsWith(QUOTE)));
                if (!columnIsOpen) {
                    data.add(possibleToken.toString());
                    possibleToken.delete(0, length);
                }
            }

            if (possibleToken.length() != 0) {
                data.add(possibleToken.toString());
            }

            return new CsvData(data.toArray(new String[]{}));
        } catch (IOException ioex) {
            ioex.printStackTrace();
        }
        return null;
    }
}
&lt;/pre&gt;
Well yeah, but having string.startsWith checking on String all this takes int account variable length which in fact we do not care about... sounds wasteful. Let&#39;s improve it.
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;public class StringBasedReaderImproved extends CsvStreamReader {
    private static final char QUOTE = &#39;&quot;&#39;;

    @Override
    public CsvData next() {
        try {
            List&amp;lt;String&amp;gt; data = new ArrayList&amp;lt;String&amp;gt;();
            final String line = reader.readLine();
            int commaStart = 0;
            int commaEnd = 0;
            StringBuffer possibleToken = new StringBuffer();

            while (commaEnd &amp;gt;= 0) {
                commaEnd = line.indexOf(&#39;,&#39;, commaStart + 1);
                if (commaEnd &amp;lt; 0) {
                    break;
                }
                possibleToken.append(line.substring(commaStart, commaEnd));
                commaStart = commaEnd + 1;

                final int length = possibleToken.length();
                boolean columnIsOpen = (possibleToken.charAt(0) == QUOTE) &amp;amp;&amp;amp; (!(possibleToken.charAt(length - 1) == QUOTE));
                if (!columnIsOpen) {
                    data.add(possibleToken.toString());
                    possibleToken.delete(0, length);
                }
            }

            if (possibleToken.length() != 0) {
                data.add(possibleToken.toString());
            }

            return new CsvData(data.toArray(new String[]{}));
        } catch (IOException ioex) {
            ioex.printStackTrace();
        }
        return null;
    }
}
&lt;/pre&gt;
OKAY! now it a char and StringBuffer. Looks like we&#39;ve done a great job! Awesome.... although a bit magical. It&#39;s not rocket science but still it&#39;s not pleasant to read. What else might we suggest? Regex.
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;public class RegexBasedReader extends CsvStreamReader {
    private static final String RE_ANY_INSIDE_QUOTES = &quot;\&quot;([^\&quot;]*)\&quot;&quot;;
    private static final String RE_ANY_WITHOUT_COMMAS = &quot;([^,]*)&quot;;
    private static final String RE_ANY = &quot;(&quot; + RE_ANY_INSIDE_QUOTES + &quot;|&quot; + RE_ANY_WITHOUT_COMMAS + &quot;)&quot;;
    private static final String RE_6_DIGIT_GROUP = &quot;(\\d{6})&quot;;

    private static final String CSV_REGEX = &quot;^&quot; + RE_6_DIGIT_GROUP + &quot;,&quot; + RE_ANY + &quot;,&quot; + RE_ANY + &quot;,&quot; + RE_ANY + &quot;,&quot; + RE_ANY + &quot;,$&quot;;


    protected final Pattern pattern;

    /**
     * {@inheritDoc}
     */
    public RegexBasedReader() {
        pattern = Pattern.compile(CSV_REGEX);
    }

    public CsvData next() {
        try {
            List&amp;lt;String&amp;gt; data = new ArrayList&amp;lt;String&amp;gt;();
            final String line = reader.readLine();
            final Matcher matcher = pattern.matcher(line);
            matchDataToColumns(data, matcher);

            return new CsvData(data.toArray(new String[]{}));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

    /**
     * @param data
     * @param matcher
     */
    protected void matchDataToColumns(List&amp;lt;String&amp;gt; data, Matcher matcher) {
        if (matcher.matches()) {
            final int groupCount = matcher.groupCount();
            assert groupCount == 13 : &quot;Matched an invalid string - regex should be revised&quot;;

            final String data1 = matcher.group(1);
            assert data1 != null : &quot;data1 should always be present&quot;;
            data.add(data1);

            String data2 = matcher.group(3);
            if (data2 == null) {
                data2 = matcher.group(4);
            }
            assert data2 != null : &quot;data2 should somehow be present&quot;;
            data.add(data2);

            String data3 = matcher.group(6);
            if (data3 == null) {
                data3 = matcher.group(7);
            }
            assert data3 != null : &quot;data3 should somehow be present&quot;;
            data.add(data3);

            String data4 = matcher.group(9);
            if (data4 == null) {
                data4 = matcher.group(10);
            }
            assert data4 != null : &quot;data4 should somehow be present&quot;;
            data.add(data4);

            String data5 = matcher.group(12);
            if (data5 == null) {
                data5 = matcher.group(13);
            }
            assert data5 != null : &quot;data5 should somehow be present&quot;;
            data.add(data5);
        }
    }
}
&lt;/pre&gt;
That looks like Chuck Norris would be proud. Strong and reliable checking, precompiled patern, groups of data, many cases handled same way... room for extension etc.&lt;br /&gt;
&lt;hr /&gt;
Now lets look at the &lt;b&gt;benchmarks&lt;/b&gt; reading over &lt;b&gt;500k&lt;/b&gt; lines:
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;public class Test2 {
    static List&lt;string&gt; times = new ArrayList&lt;string&gt;(4);

    public static void main(String[] args) throws IOException {

        read320KRecords(new SplitBasedReader());
        read320KRecords(new StringBasedReader());
        read320KRecords(new StringBasedReaderImproved());
        read320KRecords(new RegexBasedReader());
}

    private static void read320KRecords(CsvStreamReader reader) throws IOException {
        InputStream inputStream = Test2.class.getResourceAsStream(&quot;/CardInfo.csv&quot;);
        reader.setInputStream(inputStream);
        long timeStart = System.currentTimeMillis();
        while (reader.hasNext()) {
            CsvData csvData = reader.next();
        }
        long timeEnd = System.currentTimeMillis();
        times.add(reader.toString() + &quot;  time: &quot; + (new DecimalFormat(&quot;#.####&quot;)).format(new Double(
          (timeEnd - timeStart) / 1000.0)) + &quot; sec.&quot;);
        inputStream.close();
    }
}
&lt;/string&gt;&lt;/string&gt;&lt;/pre&gt;
&lt;a href=&quot;http://www.blogger.com/post-create.g?blogID=4242186654644920321&quot; name=&quot;benchmarks&quot;&gt;Output &lt;i&gt;run from IntellyJ Idea&lt;/i&gt;:&lt;/a&gt;&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
&lt;tr&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&lt;b&gt;SplitBasedReader&lt;/b&gt;&lt;/td&gt;
    &lt;td&gt;&lt;b&gt;StringBasedReader&lt;/b&gt;&lt;/td&gt;
    &lt;td&gt;&lt;b&gt;StringBasedReaderImproved&lt;/b&gt;&lt;/td&gt;
    &lt;td&gt;&lt;b&gt;RegexBasedReader&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;Run 1&lt;/td&gt;
    &lt;td&gt;1.468&lt;/td&gt;
    &lt;td&gt;0.968&lt;/td&gt;
    &lt;td&gt;0.984&lt;/td&gt;
    &lt;td&gt;1.593&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;Run 2&lt;/td&gt;
    &lt;td&gt;1.562&lt;/td&gt;
    &lt;td&gt;0.953&lt;/td&gt;
    &lt;td&gt;0.985&lt;/td&gt;
    &lt;td&gt;1.594&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;Run 3&lt;/td&gt;
    &lt;td&gt;1.531&lt;/td&gt;
    &lt;td&gt;1.031&lt;/td&gt;
    &lt;td&gt;1.047&lt;/td&gt;
    &lt;td&gt;1.625&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br /&gt;
In a chart:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWWMxFHcKqDM-8V7TmVCpd-Smx6wKtLyIJP7c1XJZQUwy84WvEj5TolY5jAbe8oON03L6WMSPAGr1zbsbsq05Vthmh6kHkUdJSwzrKe20Tt7qjvQ8XlSZ4TXlfzTy4Fl43r0WktGQIj7oJ/s1600/csv_comparizon.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWWMxFHcKqDM-8V7TmVCpd-Smx6wKtLyIJP7c1XJZQUwy84WvEj5TolY5jAbe8oON03L6WMSPAGr1zbsbsq05Vthmh6kHkUdJSwzrKe20Tt7qjvQ8XlSZ4TXlfzTy4Fl43r0WktGQIj7oJ/s320/csv_comparizon.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;&lt;u&gt;But wait - there&#39;s more :)&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
Now let&#39;s see if we can get even more results out of this. In the previous benchmark runs we did nothing with the CsvData we obtained, but that is not the case in real world right? now consider we add a single
&lt;br /&gt;
&lt;pre class=&quot;brush: java&quot;&gt;System.out.println(&quot;csvData = &quot; + csvData);&lt;/pre&gt;
and this would always result in &quot;csvData = myCSvData&quot;.
Running this in IDEA gives next results:&lt;br /&gt;
&lt;br /&gt;
SplitBasedReader time: 14.634 sec.&lt;br /&gt;
StringBasedReader time: 13.086 sec&lt;br /&gt;
StringBasedReaderImproved time: 12.118 sec&lt;br /&gt;
RegexBasedReader time: 15.244 sec&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SAME but in console:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
SplitBasedReader time: 138.025 sec.&lt;br /&gt;
StringBasedReader time: 136.337 sec.&lt;br /&gt;
StringBasedReaderImproved time: 130.975 sec.&lt;br /&gt;
RegexBasedReader time: 131.146 sec.&lt;br /&gt;
&lt;br /&gt;
So we see that the buffers and IO impact is immense.
And one more test. Lets assume out toString is smth. a little meaningful like
&lt;br /&gt;
&lt;blockquote&gt;
&lt;pre class=&quot;brush: java&quot;&gt;&quot;CsvData{&quot; + data[0] + data[1] + data[2];
&lt;/pre&gt;
&lt;/blockquote&gt;
Now the times(idea env execution) are:&lt;br /&gt;
&lt;br /&gt;
SplitBasedReader time: 21.655 sec.&lt;br /&gt;
StringBasedReader time: 9.772 sec.&lt;br /&gt;
StringBasedReaderImproved time: 9.256 sec.&lt;br /&gt;
RegexBasedReader time: 12.461 sec.&lt;br /&gt;
&lt;hr /&gt;
&lt;b&gt;Bottom line:&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;While robust and effective Regex is not the fastest thing in the world;&lt;/li&gt;
&lt;li&gt;working with relatively not-so-complex data is faster with &quot;smaller&quot; API&#39;s;&lt;/li&gt;
&lt;li&gt;;
IO is a bottleneck, not the parsing, usually. &lt;/li&gt;
&lt;/ul&gt;</description><link>http://revengedevelopment.blogspot.com/2011/04/stringsplit-vs-stringstartswith-vs.html</link><author>noreply@blogger.com (rdev02)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWWMxFHcKqDM-8V7TmVCpd-Smx6wKtLyIJP7c1XJZQUwy84WvEj5TolY5jAbe8oON03L6WMSPAGr1zbsbsq05Vthmh6kHkUdJSwzrKe20Tt7qjvQ8XlSZ4TXlfzTy4Fl43r0WktGQIj7oJ/s72-c/csv_comparizon.JPG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-2156567961341546218</guid><pubDate>Sun, 26 Dec 2010 23:00:00 +0000</pubDate><atom:updated>2011-04-19T08:05:37.091-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">SQLite</category><title>Nokia OVI suite &amp; sms extract.</title><description>There was a nice program for syncing phone and PC called Nokia PC Suite. While still available on some dusty hard drives it is now replaced with something called Nokia Ovi Suite. As I &lt;a href=&quot;http://revengebloggings.blogspot.com/2010/02/nokia-ovi-suite.html&quot;&gt;mentioned&lt;/a&gt; before - nice piece of software if we forget about all the &quot;store&quot; thing. But it has one important for me thing missing - sms extracting mechanism. You can&#39;t just take all of your sms and store to the file you want. It will either go into backup file or will be stored on you PC. I was really disappointed to learn that so I tried to find where exactly is that info stored on my PC. First search revealed that they use the SQLite db for storing all data located in &lt;br /&gt;
&quot;c:\Users\[username]\AppData\Local\Nokia\Nokia Data Store\DataBase\MDataStore.db3&quot; &lt;br /&gt;
The DB is not in any way protected or encrypted so I felt free to dig into my own data. Downloaded a splendid &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/5817/&quot;&gt;SQLiteManager&lt;/a&gt; plugin and started seeking my sms&#39;s. Didn&#39;t take long to find. Whereas the DB structure might be a subject of argue I&#39;ll post some code I used to get the info I needed out of the DB:&lt;br /&gt;
&lt;pre class=&quot;brush: c#&quot; name=&quot;code&quot;&gt; class Program
    {
        static void Main(string[] args)
        {
            if (args == null || args.Length &amp;lt; 1)
            {
                Console.Out.WriteLine(&quot;Please specify db3 file path as an argument&quot;);
                return;
            }
            string baseName = args[0];
            StreamWriter writer = null;
            try
            {
                SQLiteFactory factory = (SQLiteFactory)DbProviderFactories.GetFactory(&quot;System.Data.SQLite&quot;);
                using (SQLiteConnection connection = (SQLiteConnection)factory.CreateConnection())
                {
                    connection.ConnectionString = &quot;Data Source = &quot; + baseName;
                    connection.Open();
                    Console.WriteLine(&quot;Connection opened..&quot;);
                    using (SQLiteCommand command = new SQLiteCommand(connection))
                    {
                        command.CommandText = @&quot;SELECT MessageEx.Sender, MessageEx.Text, MessageEx.SentReceivedTimestamp, Item.CreationDate FROM MessageEx INNER JOIN Item ON MessageEx.GUID = Item.GUID ORDER BY MessageEx.SentReceivedTimestamp;&quot;;
                        var reader = command.ExecuteReader();
                        FileInfo outF = new FileInfo(&quot;result&quot; + DateTime.Now.Date.ToString(&quot;dd_mm_yyyy&quot;) + &quot;.txt&quot;);
                        writer = new StreamWriter(outF.Open(FileMode.Create));
                        writer.WriteLine(&quot;Sender, Text, Timestamp, Created&quot;);
                        while (reader.Read())
                        {
                            writer.WriteLine(String.Format(&quot;{0}, {1}, {2}, {3}&quot;, reader.GetString(0), reader.GetString(1), reader.GetDouble(2), reader.GetDouble(3)));
                            Console.Write(&quot;.&quot;);
                        }
                        Console.WriteLine(&quot;Done! Press eny Key to continue.&quot;);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(&quot;OOPS:&quot; + ex.Message);
            }
            finally {
                if (writer != null)
                    writer.Close();
            }

        }
    }
&lt;/pre&gt;
&lt;br /&gt;
This is pretty much all needed to get a well-formed CSV. There is still some work left to get the date from Real to date/time, but I thought it can wait until I really need that info. CSV is easily processed:). Some of this sourcecode is borrowed from &lt;a href=&quot;http://habrahabr.ru/blogs/net/56694/&quot;&gt;here&lt;/a&gt;. Personally wouldn&#39;t ever dig into such software peripherals, but they literally forced me to, not providing the info I actually poses.&lt;br /&gt;
Hope that helps someone who needs data synchronized from the phone - the DB is a pretty much comprehensible structure and tables and with the mentioned above plugin and a lil&#39; SQL it&#39;s quite easy to get your data even without programming.</description><link>http://revengedevelopment.blogspot.com/2010/12/nokia-ovi-suite-sms-extract.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>5</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-2097818218345829201</guid><pubDate>Wed, 13 Oct 2010 15:06:00 +0000</pubDate><atom:updated>2010-10-13T08:06:57.150-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">WMI</category><title>.NET WMI. Or how do I get all that info?</title><description>&amp;nbsp;&amp;nbsp; There&#39;s a ton of Win properties that your program might want to access/possess/transform and there&#39;s a single place to find them: WMI queries. Though some of the properties might be scattered through different classes like Environment and *Info and even *Stream and more(and I believe accessing them through that places is significantly cheaper and faster) there&#39;s one sigle silver bullet to get them all via &lt;br /&gt;
&lt;blockquote&gt;
Select * From [win_category]&lt;/blockquote&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The problem is there are tons of &quot;win_category]&#39; and * values. Luckily there is a &lt;a href=&quot;http://www.microsoft.com/downloads/en/details.aspx?familyid=2CC30A64-EA15-4661-8DA4-55BBC145C30E&amp;amp;displaylang=en&quot;&gt;WMICodeCreator&lt;/a&gt;. Actually the tool is pretty self explanatory - just a few tips:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;instead of using Select * you can use Select [ActualPropertyNameYouWant] which I believe is better&lt;/li&gt;
&lt;li&gt;instead of tedious browsing through combobox-ui use the text search on the code file supplied in the package&lt;/li&gt;
&lt;/ul&gt;
All Win properties nicely, fast and reliably right into your BL.&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;do-not-forget-to-use-post&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</description><link>http://revengedevelopment.blogspot.com/2010/10/net-wmi-or-how-do-i-get-all-that-info.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-8073980829373985292</guid><pubDate>Fri, 08 Oct 2010 19:39:00 +0000</pubDate><atom:updated>2011-04-22T02:11:59.814-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><title>.NET tab control.</title><description>&amp;nbsp;&amp;nbsp;&amp;nbsp; Consider some UI that you would like to present as tabs. And you also know that all these tabs would have a considerate amount of code in common. There are some thoughts &lt;a href=&quot;http://stackoverflow.com/questions/210597/suggestions-for-a-c-custom-tabcontrol&quot;&gt;here&lt;/a&gt; but those are more about visual representation. Also creating&amp;nbsp; usercontrols I believe is not an option due to it&#39;s not expected to have more tah one tab of a kind. The solution has to both utilize the VS designer(otherwise tab creation would take considerably more time) and keep the code separate from the tabcontrol - holder form. So that you have all functionality neatly separated. &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Haven&#39;t found any except &lt;a href=&quot;http://dotnetrix.co.uk/tabcontrol.htm&quot;&gt;here&lt;/a&gt; which looks kinda OK but lots of custom code. Would like to have just tabs used just in normal tabcontrol...&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Will try to find/develop one over weeks or find a good reason not to do it.(know WPF solves it with templates. requirements&amp;nbsp; - plain old WinFroms) Any comments are welcome. &lt;br /&gt;
&amp;nbsp;</description><link>http://revengedevelopment.blogspot.com/2010/10/net-tab-control.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-3398691511613535654</guid><pubDate>Wed, 29 Sep 2010 15:45:00 +0000</pubDate><atom:updated>2010-09-29T08:45:46.708-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">spring</category><category domain="http://www.blogger.com/atom/ns#">ws</category><title>org.springframework.oxm.jaxb.Jaxb2Marshaller</title><description>There is a nice tutorial &lt;a href=&quot;http://static.springsource.org/spring-ws/sites/2.0/reference/html/server.html#server-automatic-wsdl-exposure&quot;&gt;here &lt;/a&gt;on how to create spring web services using jax-b. Works just fine but it&#39;s hell lots of issues you would run into while making it actually work. The most frustrating for me as of today was the absence of &lt;i&gt;&lt;b&gt;Jaxb2Marshaller&lt;/b&gt;&lt;/i&gt;. in the std &lt;b&gt;&quot;spring-ws-core&quot;&lt;/b&gt; artifact package. It&#39;s just not there and noone would tell you. Only &lt;i&gt;&lt;b&gt;Jaxb1Marshaller &lt;/b&gt;&lt;/i&gt;is. After an hour googling found &lt;a href=&quot;http://www.codemonkeyramblings.com/2009/11/a-basic-straight-forward-tutorial-on-spring-web-services/&quot;&gt;this &lt;/a&gt;(BTW very simple and straightforward) post where spotted the &lt;b&gt;&quot;spring-oxm-tiger&quot;&lt;/b&gt; artifact. This is your saver if you you&#39;re tearing your hair out seeking&amp;nbsp; for the beloved interface. Maybe it&#39;s just late today on the other hand...</description><link>http://revengedevelopment.blogspot.com/2010/09/orgspringframeworkoxmjaxbjaxb2marshalle.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-7751350016134860205</guid><pubDate>Sun, 28 Mar 2010 20:06:00 +0000</pubDate><atom:updated>2010-03-28T13:08:11.691-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MCP</category><category domain="http://www.blogger.com/atom/ns#">Microsoft</category><title>MCPD acquired.</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvhT8mm8F_p6ZIuCK-nyJGncSMesYkCziUIPPRPFoD2H9nW7KK6xDcMePzSEW7wvPssJLvl6ve3-vp5EttxLJ0CbgUQUHLS1iZwAY2f2fEH1uTWmgzq9Z2U0MY-JuAQzeuSMq_7hI03b0u/s1600/MCPD(rgb)_504.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvhT8mm8F_p6ZIuCK-nyJGncSMesYkCziUIPPRPFoD2H9nW7KK6xDcMePzSEW7wvPssJLvl6ve3-vp5EttxLJ0CbgUQUHLS1iZwAY2f2fEH1uTWmgzq9Z2U0MY-JuAQzeuSMq_7hI03b0u/s320/MCPD(rgb)_504.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Finally. Now frankly - preparing for MS exams while doing die-hard java is not a funny thing to do. NEVER practice such a combination...&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;About the exam - it was better then the previous 2: it obeyed no rules:). What I mean here is that I could have skipped the preparation kit completely! Yes there were a few questions related to the book&#39;s content, BUT reading it is completely optional IMHO. Even more - you&#39;ll be fine if you just skim through the chapter headings and introductions. &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;About the questions - &lt;b&gt;common sense required. &lt;/b&gt;They are all about common sense. If you developed the apps and know how things are working there - answers are obvious. Of course there are a few &quot;do it the MS way&quot; questions, but most of &#39;em - common sense and logic job. So my advise - schedule for Tuesday morning.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; And the last one - free certificates are over - you&#39;ll have to order one now if you want. Looks like taking those exams has to be lightning fast, but when would you do work then? So that&#39;s where I&#39;m quitting with MS certification until I get .NET related stuff to do at work again. Heading to SCJP now:) Wish me luck...</description><link>http://revengedevelopment.blogspot.com/2010/03/mcpd-acquired.html</link><author>noreply@blogger.com (rdev02)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvhT8mm8F_p6ZIuCK-nyJGncSMesYkCziUIPPRPFoD2H9nW7KK6xDcMePzSEW7wvPssJLvl6ve3-vp5EttxLJ0CbgUQUHLS1iZwAY2f2fEH1uTWmgzq9Z2U0MY-JuAQzeuSMq_7hI03b0u/s72-c/MCPD(rgb)_504.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-8329165000280696695</guid><pubDate>Wed, 10 Mar 2010 09:37:00 +0000</pubDate><atom:updated>2010-03-10T01:39:25.134-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">BlackBerry</category><title>907: Invalid cod and other BlackBerry OTA problems.</title><description>&amp;nbsp;&amp;nbsp; &amp;nbsp;Most of us, who developed any BlackBerry app that had to be shipped OTA had seen this &quot;descriptive&quot; error. It might be anything from invalid jad to signing problems. The one I&#39;m going to describe here is when the size of the cod file is more than 64K.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Finding out if you have this problem is fairly easy: just look into the final cod and see if there are actually 2 cod files packaged in one cod. Can be easily done via renaming to .zip and extracting. Other things that would show you smth. has gone wrong:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;appname&gt;-1.cod files are being generated&lt;/appname&gt;&lt;/li&gt;
&lt;li&gt;&lt;appname&gt;-1.debug files. Cod might be ok, so may be the jad file. But still will get 907.&lt;/appname&gt;&lt;/li&gt;
&lt;li&gt;*-1.cod&amp;nbsp;references&amp;nbsp;in ad files.&lt;/li&gt;
&lt;li&gt;nested cod files as already mentioned.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
The general approach to fix this issue is creating application libraries and shipping them linked along with application. This is more easily said then done, because decoupling your app when it&#39;s already working might be a tedious job to do. Moreover when you seem to have completed what is needed you might see that you&#39;re 2-5 Kb over limit and that really sucks. But that is not all of the &quot;presents&quot; you&#39;ve got with RIM.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
Let us say you&#39;ve mastered your app in a way that it is shipped with few libraries and it work OK. Now requirements have come to use a newer JDE/add some features. First thing to check would be just to compile using the new JDE. Although you won&#39;t probably have any issues with compiling it is VERY likely that you&#39;ll get larger cod files as result. I tested with JDE&#39;s from 4.0.2 till 4.7. And every new version compiles more code then the previous one. One exception with 4.6 - it compiles the larges binaries whatsoever :). So you&#39;re back to your previous job - refactoring the source code:)&lt;/div&gt;
&lt;div&gt;
In order for these things to happen less often use these approaches when developing with RIM:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Avoid nested classes. Each Nested class would enlarge the original class file and produce and extension worth at least 1.1K&lt;/li&gt;
&lt;li&gt;Avoid public static or just public/protected methods/properties. Generates huge amount of header bytecode.&lt;/li&gt;
&lt;li&gt;Avoid anonymous classes. Each anonymous class would result in &lt;classfilename&gt;$N.class where N is the number of your anonymous class:) Each worth at lest 0.9K. If you structure your code to use existing classes, you&#39;ll reduce the output bytecode significantly.&lt;/classfilename&gt;&lt;/li&gt;
&lt;li&gt;If the nested class has to be used - try to use anonymous instead. You&#39;ll gain about 0.5 K on each.&lt;/li&gt;
&lt;li&gt;RIM doesn&#39;t like generics.&amp;nbsp;Full-stop&lt;/li&gt;
&lt;li&gt;Try to avoid using interfaces. If, for example, the base class implements and interface and the child one also states that - you&#39;ll get double same bytecode. From my experience with RIM I&#39;d better use classes(if applicable) and only then interfaces. The overhead is tremendous.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Happy development days with RIM ;)&lt;/div&gt;
&lt;/div&gt;</description><link>http://revengedevelopment.blogspot.com/2010/03/907-invalid-cod-and-other-blackberry.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-87516181947270932</guid><pubDate>Thu, 11 Feb 2010 09:18:00 +0000</pubDate><atom:updated>2010-02-11T01:18:02.413-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ant</category><category domain="http://www.blogger.com/atom/ns#">IDEA</category><title>Idea ant hanging</title><description>I had a very &#39;uncomfortable&#39; issue with Idea when using it for ant builds - it hang in certain places like jar update task, rename task or similar.
All my struggle can be found on &lt;a href=&quot;http://youtrack.jetbrains.net/issue/IDEA-26198&quot;&gt;Idea track&lt;/a&gt;. Fortunately Carl Abramsson found a workaround for that issue using&lt;br /&gt;
&lt;blockquote&gt;
-noinput&amp;nbsp;&lt;/blockquote&gt;
switch to ant launch. Now everything works like a charm. Decided to create this post in case some one will be&amp;nbsp;desperately&amp;nbsp;googling for a solution in the wrong place :)</description><link>http://revengedevelopment.blogspot.com/2010/02/idea-ant-hanging.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4242186654644920321.post-7519110001026009976</guid><pubDate>Mon, 11 Jan 2010 11:08:00 +0000</pubDate><atom:updated>2011-09-06T01:08:49.014-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">JBoss</category><category domain="http://www.blogger.com/atom/ns#">JNDI</category><category domain="http://www.blogger.com/atom/ns#">tomcat</category><title>Switching to  container based datasource...</title><description>&amp;nbsp;&amp;nbsp; &amp;nbsp;Quite a time ago had to do this but had no time for posting a complete solution. Read a few articles on that so that I got the idea. Although it looks quite simple you might run into several configuration issues firing&amp;nbsp;weird&amp;nbsp;and long stacktraces. To get rid of those I&#39;ll describe the way it worked for me with some additional comments.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;First of all lets assume we use JBoss app server. Different versions of JBoss have their own configuration &quot;specials&quot; so I&#39;ll stick to 5.0.1 jdk 6. First of all we need to register the desired datasource withing the container obtaining a JNDI name. Example configurtion files for registration can be found in [JBoss install dir]/docs\examples\jca\. The resulting config file which has to be pout under server/[configuration_name]/deploy would look like&lt;br /&gt;
&lt;pre class=&quot;brush:xml&quot; name=&quot;code&quot;&gt;&amp;lt;local-tx-datasource&amp;gt;
    &amp;lt;jndi-name&amp;gt;MySqlDS&amp;lt;/jndi-name&amp;gt;
    &amp;lt;connection-url&amp;gt;jdbc:mysql://localhost:3306/mydatasource&amp;lt;/connection-url&amp;gt;
    &amp;lt;driver-class&amp;gt;com.mysql.jdbc.Driver&amp;lt;/driver-class&amp;gt;
    &amp;lt;user-name&amp;gt;user&amp;lt;/user-name&amp;gt;
    &amp;lt;password&amp;gt;pwd&amp;lt;/password&amp;gt;
    &amp;lt;exception-sorter-class-name&amp;gt;org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter&amp;lt;/exception-sorter-class-name&amp;gt;
    &amp;lt;metadata&amp;gt;
       &amp;lt;type-mapping&amp;gt;mySQL&amp;lt;/type-mapping&amp;gt;
    &amp;lt;/metadata&amp;gt;
 &amp;lt;/local-tx-datasource&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
Then in hibernate properties
&lt;br /&gt;
&lt;blockquote&gt;
###### JNDI std JBOSS connection ####################&lt;br /&gt;
hibernate.connection.datasource = java:MySqlDS&lt;br /&gt;
hibernate.transaction.factory_class = org.hibernate.transaction.JTATransactionFactory&lt;br /&gt;
hibernate.transaction.manager_lookup_class = org.hibernate.transaction.JBossTransactionManagerLookup&lt;br /&gt;
&lt;br /&gt;&lt;/blockquote&gt;
Deploying your app, especially if you deployed with Tomcat compatibility you might see the next exception on startup:&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;i&gt;&lt;b&gt;ERROR&lt;/b&gt; [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/mydb]] (main) Exception starting filter ServiceFilter&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;i&gt;java.lang.&lt;b&gt;ClassCastException&lt;/b&gt;: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate cannot be cast to javax.transaction.TransactionManager&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;i&gt;at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:23)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;i&gt;at org.hibernate.impl.SessionFactoryImpl.&lt;/i&gt;&lt;init&gt;&lt;i&gt;(SessionFactoryImpl.java:264)&lt;/i&gt;&lt;/init&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;i&gt;at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-top: 0px;&quot;&gt;
In short this means that you have a classloader issue having loaded the wrong manager first. Most likely you have the&amp;nbsp;javax-transaction.jar in your bin. Remove it and everything will work fine :).&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
If you need to set up the very same thing on Tomcat, then you have to keep in mind the next thing
&lt;br /&gt;
&lt;blockquote&gt;
Tomcat is a hybrid sort of environment (neither fish nor fowl) from the standpoint of Hibernate. Tomcat provides a JNDI and DataSource, unlike a standalone application. The DataSource facility should facilitate portability among application servers. But like a standalone environment, Tomcat provides no Transaction Manager. Hence your code must use the Hibernate Transaction Manager, as it would in a standalone application environment
&lt;/blockquote&gt;
With this in mind you&#39;ll have to configure the server.xml with 
&lt;br /&gt;
&lt;pre class=&quot;brush:  xml&quot; name=&quot;code&quot;&gt;&amp;lt;Resource name=&quot;jdbc/testdb&quot; auth=&quot;Container&quot; 
type=&quot;javax.sql.DataSource&quot;
maxActive=&quot;100&quot; maxIdle=&quot;30&quot; maxWait=&quot;10000&quot;
username=&quot;user&quot; password=&quot;pwd&quot; 
driverClassName=&quot;com.mysql.jdbc.Driver&quot;
url=&quot;jdbc:mysql://localhost:3306/mydatasource?autoReconnect=true&quot;/&amp;gt;
&lt;/pre&gt;
And  web.xml with
&lt;br /&gt;
&lt;pre class=&quot;brush:  xml&quot; name=&quot;code&quot;&gt;&amp;lt;resource-ref&amp;gt;
&amp;lt;description&amp;gt;My datasource&amp;lt;/description&amp;gt;
&amp;lt;res-ref-name&amp;gt;jdbc/testdb&amp;lt;/res-ref-name&amp;gt;
&amp;lt;res-type&amp;gt;javax.sql.DataSource&amp;lt;/res-type&amp;gt;
&amp;lt;res-auth&amp;gt;Container&amp;lt;/res-auth&amp;gt;
&amp;lt;/resource-ref&amp;gt;
&lt;/pre&gt;
Then your hibernate.properties configuration would look like:
&lt;br /&gt;
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect&lt;br /&gt;
hibernate.connection.datasource = java:comp/env/jdbc/testdb&lt;br /&gt;
#hibernate.transaction.factory_class = org.hibernate.transaction.JTATransactionFactory&lt;br /&gt;
&lt;br /&gt;</description><link>http://revengedevelopment.blogspot.com/2010/01/switching-to-container-based-datasource.html</link><author>noreply@blogger.com (rdev02)</author><thr:total>0</thr:total></item></channel></rss>