<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>byteco.de</title>
	<atom:link href="http://byteco.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://byteco.de</link>
	<description>In a world of 1s and 0s...are you a zero, or The One?</description>
	<lastBuildDate>Sat, 19 May 2012 12:24:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>iPhone and AppleCare International Warranty</title>
		<link>http://byteco.de/2012/03/29/iphone-and-applecare-international-warranty/</link>
		<comments>http://byteco.de/2012/03/29/iphone-and-applecare-international-warranty/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 06:46:25 +0000</pubDate>
		<dc:creator>shiv</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://byteco.de/?p=6519</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>Well, I didn&#8217;t expected this but it is what it is&#8230;</p>
<p>It appears only for iPhone the AppleCare warranty is different. Basically iPhone (and Extended AppleCare protection plan) warranty is only valid in the country of purchase.</p>
<p>So I had bought my iPhone along with extended AppleCare from United Kingdom, but this can&#8217;t be serviced in India&#8230; I have to fly to London or a place where Apple Retail Store is to get warranty benefits&#8230; damn&#8230;..</p>
<p>Atleast one good thing out of this is that apart from iPhone, all other Apple products enjoy AppleCare international warranty coverage. Otherwise AppleCare is pretty much useless.. </p>
]]></content:encoded>
			<wfw:commentRss>http://byteco.de/2012/03/29/iphone-and-applecare-international-warranty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting ASCII encoded file to UTF-8</title>
		<link>http://byteco.de/2012/03/20/converting-ascii-encoded-file-to-utf-8/</link>
		<comments>http://byteco.de/2012/03/20/converting-ascii-encoded-file-to-utf-8/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 16:56:58 +0000</pubDate>
		<dc:creator>shiv</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://byteco.de/?p=6504</guid>
		<description><![CDATA[You get a file whose encoding you don&#8217;t know and want to convert it to UTF-8 encoded file using java. How to do it? Below should work - import org.apache.commons.io.IOUtils; import org.mozilla.universalchardet.UniversalDetector; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; public class Test { public static void main(String[] args) throws IOException { byte[] buf = [...]]]></description>
			<content:encoded><![CDATA[<p>You get a file whose encoding you don&#8217;t know and want to convert it to UTF-8 encoded file using java. How to do it?</p>
<p>Below should work -</p>
<p><span id="more-6504"></span></p>
<pre class="brush: java">
import org.apache.commons.io.IOUtils;
import org.mozilla.universalchardet.UniversalDetector;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;

public class Test {

    public static void main(String[] args) throws IOException {
        byte[] buf = new byte[4096];
        String fileName = &quot;Test.txt&quot;;
        java.io.FileInputStream fis = new java.io.FileInputStream(fileName);

        UniversalDetector detector = new UniversalDetector(null);
        int nread;
        while ((nread = fis.read(buf)) &gt; 0 &amp;amp;&amp;amp; !detector.isDone()) {
            detector.handleData(buf, 0, nread);
        }
        detector.dataEnd();
        String encoding = detector.getDetectedCharset();
        detector.reset();

        Reader reader = new InputStreamReader(new FileInputStream(&quot;Test.txt&quot;), encoding);

        byte[] bytes = IOUtils.toString(reader).getBytes(&quot;UTF-8&quot;);
        System.out.println(new String(bytes, &quot;UTF-8&quot;));
    }
}
</pre>
<p>This does rely on <a href="http://code.google.com/p/juniversalchardet/">another package</a> which is used to detect encoding of file on the fly. This is optional if you already know the source encoding.</p>
]]></content:encoded>
			<wfw:commentRss>http://byteco.de/2012/03/20/converting-ascii-encoded-file-to-utf-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sulekha.com Privacy Issues</title>
		<link>http://byteco.de/2011/08/08/sulekha-com-privacy-issues/</link>
		<comments>http://byteco.de/2011/08/08/sulekha-com-privacy-issues/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 09:36:32 +0000</pubDate>
		<dc:creator>shiv</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[sulekha.com]]></category>

		<guid isPermaLink="false">http://byteco.de/?p=5522</guid>
		<description><![CDATA[This is just not what I had expected on Monday morning. My impending Banglore move made me search for Sulekha.com for listing for properties for Rent/PG. When I wanted to get the Phone No of listing, it has a small banner sayin - You need to register and verify your mobile no. to contact this [...]]]></description>
			<content:encoded><![CDATA[<p>This is just not what I had expected on Monday morning. My impending Banglore move made me search for Sulekha.com for listing for properties for Rent/PG.</p>
<p>When I wanted to get the Phone No of listing, it has a small banner sayin -</p>
<p><strong>You need to register and verify your mobile no. to contact this advertiser.</strong></p>
<p>Yesterday I had logged in the site and chose &#8220;Remember me on this computer&#8221; and it was still showing me above message. After I clicked on Contact Advertiser, this is where it all started to go wrong. Something happened. All this code is AJAX and somewhere their code goofed up and did something which had a bizarre consequences. </p>
<p>Without me doing anything, Sulekha.com updated my verified mobile phone number with the Advertiser&#8217;s phone number. The same applies to email. Within minutes, I started getting lots of emails.</p>
<p>I also got a call on my phone saying that &#8211; &#8220;Hello Shivprasad, you have a Swift Dzire for sell na, its posted on Sulekha.&#8221;&#8230;. damm.. until this I was not aware of what&#8217;s happening. I had never owned Swift Dzire let alone selling <img src='http://byteco.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Next, my mailbox started getting filled with mails such as &#8211; </p>
<p>1) You have viewed details of Washing Maching<br />
2) You have viewed details of Honda Activa<br />
3) You have viewed details of PG Accomodation for Girl</p>
<p>WTF&#8230;apart from this, also started getting mail that I have created new listing such as this one &#8211; <a href="http://classifieds.sulekha.com/chennai/automobiles/two-wheelers-bikes/clad.aspx?cid=6697415" title="Only 28000 Milage " target="_blank">Only 28000 Milage</a> and few more.</p>
<p>This is pretty much fcked up my privacy with my email and phone number being associated with god know how many accounts.</p>
<p>I started getting mails from site users who are interested in listing like above which is attributed to me or from Advertiser&#8217;s whose details are seen by me..(PG for Girl).. </p>
<p>I just couldn&#8217;t imagine how dumb the developers of Sulekha.com are. Is there any testing performed on site at all? If you don&#8217;t get AJAX.. don&#8217;t do it&#8230;.</p>
<p>I had contacted Sulekha.com and informed them abt the issue and through their site&#8217;s feedback mechanism, informed about the issue. </p>
<p>In the mean time to stop myself from this abuse, I had used http://www.guerrillamail.com and updated my email address with disposable email address.  </p>
<p>Not sure how many others faced this issue today, but in future I am going to be very careful about Sulekha.com. Don&#8217;t trust them.</p>
]]></content:encoded>
			<wfw:commentRss>http://byteco.de/2011/08/08/sulekha-com-privacy-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox and Google Dictionary</title>
		<link>http://byteco.de/2011/07/18/firefox-and-google-dictionary/</link>
		<comments>http://byteco.de/2011/07/18/firefox-and-google-dictionary/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 09:26:28 +0000</pubDate>
		<dc:creator>shiv</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[google dictionary]]></category>
		<category><![CDATA[userscript]]></category>

		<guid isPermaLink="false">http://byteco.de/?p=5491</guid>
		<description><![CDATA[There is an excellent extension by Google for Chrome browser, Google Dictionary. The idea is that you selected a word and the extn will lookup meaning of it on Google Dictionary and provide a nice hover info containing meaning and other details. I searched Firefox for such simple extension but couldn&#8217;t find one. So I [...]]]></description>
			<content:encoded><![CDATA[<p>There is an excellent extension by Google for Chrome browser, <a href="https://chrome.google.com/webstore/detail/mgijmajocgfcbeboacabfgobmjgjcoja">Google Dictionary</a>. </p>
<p>The idea is that you selected a word and the extn will lookup meaning of it on Google Dictionary and provide a nice hover info containing meaning and other details.</p>
<p>I searched Firefox for such simple extension but couldn&#8217;t find one. So I created a very basic user script based on Google Dictionary.</p>
<p>The script will lookup the selected word meaning in Google Dictionary and uses javascript alert to show meaning. Its very basic and works for me <img src='http://byteco.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here is a github gist url &#8211; <a href="https://gist.github.com/1088985">Google Dictionary user script</a></p>
]]></content:encoded>
			<wfw:commentRss>http://byteco.de/2011/07/18/firefox-and-google-dictionary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Map Interface Examples</title>
		<link>http://byteco.de/2011/04/25/java-map-interface-examples/</link>
		<comments>http://byteco.de/2011/04/25/java-map-interface-examples/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 07:58:33 +0000</pubDate>
		<dc:creator>shiv</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[HashMap]]></category>
		<category><![CDATA[IdentityHashMap]]></category>
		<category><![CDATA[java collection framework]]></category>
		<category><![CDATA[LinkedHashMap]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[TreeMap]]></category>
		<category><![CDATA[WeakHashMap]]></category>

		<guid isPermaLink="false">http://byteco.de/?p=3559</guid>
		<description><![CDATA[Recently I was explaining someone about Java Map and various implementations that are available as part of JDK. I had wrote a simple program to explain him that. Thought of putting it here. Below it is - TreeMap &#8211; The map is sorted according to the natural ordering of its keys, or by a Comparator [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was explaining someone about Java Map and various implementations that are available as part of JDK.</p>
<p>I had wrote a simple program to explain him that. Thought of putting it here. Below it is -</p>
<p><strong>TreeMap</strong> &#8211; The map is sorted according to the natural ordering of its keys, or by a Comparator provided at map creation time, depending on which constructor is used. Below example you will notice that treeMap toString shows that entries are ordered by performing natural ordering on Int keys.</p>
<p><strong>HashMap</strong> &#8211; This class makes no guarantees as to the order of the map. Uses object equality to check if key already exist in map and replace value if it exist. As in example while trying to put <em>key11</em> as it equals with <em>key1</em> value &#8220;One&#8221; is replaced with &#8220;Eleven&#8221;.</p>
<p><strong>IdentityHashMap </strong>- Unlike above HashMap, this uses reference-equality in place of object-equality when comparing keys. As in following example even after key11 equals key1, but as their references are not equals so a new key/value is inserted. </p>
<p><strong>LinkedHashMap</strong> &#8211; This implementation keeps track of order in which keys were inserted into the map. In below example you will notice that the toString shows entries in same order in which they were inserted. This also has another feature discussed next.</p>
<p><strong>LRU Caching using LinkedHashMap</strong> &#8211; Another feature of LinkedHashMap is that it provide constructor  to create a linked hash map whose order of iteration is the order in which its entries were last accessed, from least-recently accessed to most-recently (access-order). In following example, you will notice that when elements are inserted and none is accessed yet, the order of Entries is same as that of above example. But after accessing elements, you will notice that the entries order is changed based on when last it was accessed. Using this feature one can create a LRU(accessed) cache as shown in example. You will need to override removeEldestEntry method of LinkedHashMap and add your logic for caching. Each put operation will call this removeEldestEntry by passing least-recently-accessed element to it and based on removeEldestEntry&#8217;s return value it will either be kept or removed from the map.</p>
<p><strong>WeakHashMap</strong>- In this implementation keys are held as WeakReferences. This way if there is no strong reference for key, on next Garbage Collection this key and corresponding value will be removed from the Map. Read <a href="http://weblogs.java.net/blog/2006/05/04/understanding-weak-references">this </a>article for details on Java References. As in below example we are adding three keys to map and then clearing one strong reference to key6 by setting it to null. Then we request GC by calling System.gc() and in next statement you will notice that the key/value for key6 is removed from Map.</p>
<p><span id="more-3559"></span></p>
<pre class="brush: java">
package collections;

import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;
import java.util.WeakHashMap;

public class DemoMap {

    public static void main(String[] args) {
        // TreeMap
        Map&lt;Integer, String&gt; treeMap = new TreeMap&lt;Integer, String&gt;();
        treeMap.put(4, &quot;Four&quot;);
        treeMap.put(1, &quot;One&quot;);
        treeMap.put(5, &quot;Five&quot;);
        treeMap.put(3, &quot;Three&quot;);
        treeMap.put(2, &quot;Two&quot;);
        System.out.println(&quot;TreeMap - &quot; + treeMap);
        // TreeMap - {1=One, 2=Two, 3=Three, 4=Four, 5=Five}

        // HashMap
        Key key1 = new Key(1);
        Key key11 = new Key(1);
        Key key2 = new Key(2);
        Key key3 = new Key(3);
        Map&lt;Key, String&gt; map = new HashMap&lt;Key, String&gt;();
        map.put(key1, &quot;One&quot;);
        map.put(key11, &quot;Eleven&quot;);
        map.put(key2, &quot;Two&quot;);
        map.put(key3, &quot;Three&quot;);
        System.out.println(&quot;HashMap - &quot; + map);
        // HashMap - {3=Three, 1=Eleven, 2=Two}

        // IdentityHashMap
        Map&lt;Key, String&gt; idMap = new IdentityHashMap&lt;Key, String&gt;();
        idMap.put(key1, &quot;One&quot;);
        idMap.put(key11, &quot;One&quot;);
        idMap.put(key2, &quot;Two&quot;);
        idMap.put(key3, &quot;Three&quot;);
        System.out.println(&quot;IdentityHashMap - &quot; + idMap);
        // IdentityHashMap - {1=One, 1=One, 3=Three, 2=Two}

        // LinkedHashMap
        Map&lt;Integer, String&gt; linkedMap = new LinkedHashMap&lt;Integer, String&gt;(5);
        linkedMap.put(4, &quot;Four&quot;);
        linkedMap.put(1, &quot;One&quot;);
        linkedMap.put(5, &quot;Five&quot;);
        linkedMap.put(3, &quot;Three&quot;);
        linkedMap.put(2, &quot;Two&quot;);
        System.out.println(&quot;LinkedHashMap - &quot; + linkedMap);
        //LinkedHashMap - {4=Four, 1=One, 5=Five, 3=Three, 2=Two}

        // LinkedHashMap for Caching using access-order
        Map&lt;Integer, String&gt; cachedLinkedMap = new CacheUsingLinkedHashMap&lt;Integer, String&gt;(5);
        cachedLinkedMap.put(4, &quot;Four&quot;);
        cachedLinkedMap.put(1, &quot;One&quot;);
        cachedLinkedMap.put(5, &quot;Five&quot;);
        cachedLinkedMap.put(3, &quot;Three&quot;);
        cachedLinkedMap.put(2, &quot;Two&quot;);
        System.out.println(&quot;LinkedHashMap at full capacity no access performed yet - &quot; + cachedLinkedMap);
        // LinkedHashMap at full capacity no access performed yet - {4=Four, 1=One, 5=Five, 3=Three, 2=Two}
        cachedLinkedMap.get(1);
        cachedLinkedMap.get(2);
        cachedLinkedMap.get(4);
        cachedLinkedMap.get(5);
        cachedLinkedMap.get(3);
        System.out.println(&quot;LinkedHashMap at full capacity after accessing few elements - &quot; + cachedLinkedMap);
        // LinkedHashMap at full capacity after accessing few elements - {1=One, 2=Two, 4=Four, 5=Five, 3=Three}
        cachedLinkedMap.put(6, &quot;Six&quot;);
        System.out.println(&quot;LinkedHashMap after adding new entry - &quot; + cachedLinkedMap);
        // As 1 is least recently accessed.
        // LinkedHashMap after adding new entry - {2=Two, 4=Four, 5=Five, 3=Three, 6=Six}

        // WeakHashMap
        Map&lt;Key, String&gt; weakMap = new WeakHashMap&lt;Key, String&gt;();
        Key key4 = new Key(4);
        Key key5 = new Key(5);
        Key key6 = new Key(6);
        weakMap.put(key4, &quot;Four&quot;);
        weakMap.put(key5, &quot;Five&quot;);
        weakMap.put(key6, &quot;Six&quot;);
        System.out.println(&quot;WeakHashMap before GC - &quot; + weakMap);
        // WeakHashMap before GC - {6=Six, 5=Five, 4=Four}
        key6 = null;
        System.gc();
        System.out.println(&quot;WeakHashMap after GC - &quot; + weakMap);
        // WeakHashMap after GC - {5=Five, 4=Four}
    }

    static class CacheUsingLinkedHashMap&lt;K, V&gt; extends LinkedHashMap&lt;K, V&gt; {

        int capacity;

        public CacheUsingLinkedHashMap(int cap) {
            super(cap + 1, 1.1f, true);
            capacity = cap;
        }

        @Override
        protected boolean removeEldestEntry(java.util.Map.Entry&lt;K, V&gt; eldest) {
            return size() &gt; capacity;
        }

    }

    static class Key {
        int key;

        public Key(int key) {
            this.key = key;
        }

        @Override
        public int hashCode() {
            final int prime = 31;
            int result = 1;
            result = prime * result + key;
            return result;
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            if (obj == null)
                return false;
            if (getClass() != obj.getClass())
                return false;
            Key other = (Key) obj;
            if (key != other.key)
                return false;
            return true;
        }

        @Override
        public String toString() {
            return String.valueOf(key);
        }
    }

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://byteco.de/2011/04/25/java-map-interface-examples/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Timesjobs and Techgig.com SPAM</title>
		<link>http://byteco.de/2011/04/14/timesjobs-and-techgig-com-spam/</link>
		<comments>http://byteco.de/2011/04/14/timesjobs-and-techgig-com-spam/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 15:07:51 +0000</pubDate>
		<dc:creator>shiv</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://byteco.de/?p=3235</guid>
		<description><![CDATA[To, Neha Singh Head, Customer Care TECHGIG.com (in collaboration with TimesJobs.com) Enough. I really hate websites which even after unsubscribing from  email subscriptions still keep sending you emails. This time it is yours truly TimeJobs.com and your new venture Techgig.com I must have unsubscribed three to four times from the link that you have provided [...]]]></description>
			<content:encoded><![CDATA[<p>To,</p>
<p>Neha Singh<br />
Head, Customer Care</p>
<p><strong>TECH</strong><strong>GIG</strong>.com (in collaboration with TimesJobs.com)</p>
<p>Enough.</p>
<p>I really hate websites which even after unsubscribing from  email subscriptions still keep sending you emails.</p>
<p>This time it is yours truly TimeJobs.com and your new venture Techgig.com</p>
<p>I must have unsubscribed three to four times from the link that you have provided at the end of your marketing emails. I still continue to receive mails.</p>
<p>You dumbs  can&#8217;t even spell Techgig.com,</p>
<blockquote><p><strong>Fresher Jobs on TaechGig.com</strong></p></blockquote>
<p>Can you pls tell me what it would take for you to remove my email address from your system. Heck I don&#8217;t want account at your website. Is there any way I can close my account.</p>
<p>Seems TimeJobs  don&#8217;t give a damn about user privacy&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://byteco.de/2011/04/14/timesjobs-and-techgig-com-spam/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Publishing Webservice on Multiple Network Interfaces</title>
		<link>http://byteco.de/2011/04/06/publishing-webservice-on-multiple-network-interfaces/</link>
		<comments>http://byteco.de/2011/04/06/publishing-webservice-on-multiple-network-interfaces/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 10:43:17 +0000</pubDate>
		<dc:creator>shiv</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://byteco.de/?p=2777</guid>
		<description><![CDATA[Recently our IT support group decided to move one of component to a new VCS Cluster. This component is a service component exposing various web services which are consumed by another .Net based UI component. The initial attempt was not successful as the component was incompatible with multi-homed hosts (those with multiple IP addresses / [...]]]></description>
			<content:encoded><![CDATA[<p>Recently our IT support group decided to move one of component to a new VCS Cluster.</p>
<p>This component is a service component exposing various web services which are consumed by another .Net based UI component.</p>
<p>The initial attempt was not successful as the component was incompatible with multi-homed hosts (those with multiple IP addresses / network interfaces), because it listen to port 80 on the primary network interface only.</p>
<p>As currently the component was running on a single-homed host, there’s no problem, since there’s only one IP address, and no ambiguity.</p>
<p>But VCS clusters are multi-homed devices – they have local IP, and cluster IP.</p>
<p>And in VCS world, nobody is connecting to host name / IP directly, connection should be established to cluster name / IP.</p>
<p>So to make the component publish web service on all interfaces, instead of using localhost or host address, use 0.0.0.0 as address. With 0.0.0.0 you tell it to &#8216;listen&#8217; to incoming connections to any ip-address (associated with box).</p>
]]></content:encoded>
			<wfw:commentRss>http://byteco.de/2011/04/06/publishing-webservice-on-multiple-network-interfaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Eclipse more like IntelliJ IDEA</title>
		<link>http://byteco.de/2010/08/03/making-eclipse-like-idea/</link>
		<comments>http://byteco.de/2010/08/03/making-eclipse-like-idea/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 15:17:46 +0000</pubDate>
		<dc:creator>shiv</dc:creator>
				<category><![CDATA[Customization]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[keyboard shortcuts]]></category>

		<guid isPermaLink="false">http://byteco.de/?p=1501</guid>
		<description><![CDATA[I really like both Eclipse and IntelliJ IDEA. But at work I had to use Eclipse and for my personal coding I prefer IntelliJ IDEA. The main pain point here is remembering keyboard shortcuts. I didn&#8217;t wanted to remember different keystrokes for same functionality in Eclipse and IDEA. There are some features from IDEA which [...]]]></description>
			<content:encoded><![CDATA[<p>I really like both Eclipse and IntelliJ IDEA. But at work I had to use Eclipse and for my personal coding I prefer IntelliJ IDEA.</p>
<p>The main pain point here is remembering keyboard shortcuts. I didn&#8217;t wanted to remember different keystrokes for same functionality in Eclipse and IDEA.</p>
<p>There are some features from IDEA which are not supported by Eclipse out of box. But now-a-days, the gap is closing/widening depending upon which release you use.</p>
<p>So here I provide instructions on how to make Eclipse as much close like IDEA from usage perspective.</p>
<p><span id="more-1501"></span></p>
<ul>
<li>Download and install Eclipse Plugin <a href="http://code.google.com/p/ideakeyscheme/updates/list">ideakeyscheme</a> by <a href="http://www.jroller.com/santhosh/">Santhosh</a></li>
<li>Download and install Eclipse Plugin <a href="http://moreclipboard.sourceforge.net/">More Clipboard</a>.</li>
</ul>
<p>Once you restart Eclipse after installing these plugins, goto <strong>Eclipse Preferences -&gt; General -&gt; Keys</strong> and select IntelliJ Idea keys scheme.</p>
<p>This will map most of IntelliJ Idea keyboard shortcuts but following I added/overrode manually.</p>
<p><a href="http://byteco.de/wp-content/uploads/2010/08/idea-keymap.jpg"><img class="alignnone size-full wp-image-1502" title="idea-keymap" src="http://byteco.de/wp-content/uploads/2010/08/idea-keymap.jpg" alt="" width="930" height="340" /></a></p>
<p>IDEA has a very useful clipboard history buffer feature, similar functionality can be added to Eclipse by plugin More Clipboard. In the same Keys preference window override binding for &#8220;Paste from MoreClipboard&#8221; command with binding as Ctrl+Shift+V.</p>
<p>Eclipse also has idea equivalent of Ctrl+Shift+A Find Action shortcut, called Quick Access.</p>
]]></content:encoded>
			<wfw:commentRss>http://byteco.de/2010/08/03/making-eclipse-like-idea/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>TestDox and IntelliJ IDEA 9</title>
		<link>http://byteco.de/2010/02/14/testdox-and-intellij-idea-9/</link>
		<comments>http://byteco.de/2010/02/14/testdox-and-intellij-idea-9/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 16:31:26 +0000</pubDate>
		<dc:creator>shiv</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[testdox]]></category>

		<guid isPermaLink="false">http://byteco.de/?p=882</guid>
		<description><![CDATA[I really missed TestDox plugin for IDEA. There is no official version as of now for IDEA 9.0 I tried to install latest available version but its not compatible. I played around with plugin.xml by removing until-build=&#8221;IU-93.94&#8243;, it got enabled but then threw following exception, Caused by: java.lang.NumberFormatException: For input string: "IU-93.94" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at [...]]]></description>
			<content:encoded><![CDATA[<p>I really missed <a href="http://testdox.codehaus.org">TestDox</a> plugin for IDEA. There is no official version as of now for IDEA 9.0</p>
<p>I tried to install latest available version but its not compatible. I played around with plugin.xml by removing <em>until-build=&#8221;IU-93.94&#8243;</em>, it got enabled but then threw following exception,</p>
<pre>Caused by: java.lang.NumberFormatException: For input string: "IU-93.94"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
	at java.lang.Integer.parseInt(Integer.java:449)
	at java.lang.Integer.parseInt(Integer.java:499)
	at org.codehaus.testdox.intellij.IntelliJApiFactory.&lt;init&gt;(IntelliJApiFactory.java:24)</pre>
<p>I had patched the IntelliJApiFactory and updated .class file in the testdox-plugin-1.1.12-diana.jar. I am using it for some time and my usage is limited to navigate between class and its test. Not seeing any exceptions but overall IDEA 9.x plugin api are changed a lot and using a patched plugin might crash IDEA.</p>
<p>But for those who can&#8217;t live without it, can download it <a href="http://drop.io/testdox_idea_plugin/asset/testdox-plugin-zip">here</a>. Extract it to your IDEA plugins directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://byteco.de/2010/02/14/testdox-and-intellij-idea-9/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Maven, dbdeploy, HSQLDB without Ant</title>
		<link>http://byteco.de/2010/01/31/maven-dbdeploy-hsqldb-without-ant/</link>
		<comments>http://byteco.de/2010/01/31/maven-dbdeploy-hsqldb-without-ant/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 17:29:18 +0000</pubDate>
		<dc:creator>shiv</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[dbdeploy]]></category>

		<guid isPermaLink="false">http://byteco.de/?p=880</guid>
		<description><![CDATA[Believe me, integrating Maven and dbdeploy is a pain using Ant. For some weird reasons, dbdeploy ant task was causing maven build to crash. So tried to integrate dbdeploy with maven without ant on my Snow Leopard &#8211; You will need following jars - dbdeploy-cli-3.0M2.jar hsqldb-1.8.0.7.jar keep above jars in dir &#8220;db&#8221; in same dir [...]]]></description>
			<content:encoded><![CDATA[<p>Believe me, integrating Maven and dbdeploy is a pain using Ant. For some weird reasons, dbdeploy ant task was causing maven build to crash.</p>
<p>So tried to integrate dbdeploy with maven without ant on my Snow Leopard &#8211;<br />
<span id="more-880"></span></p>
<p>You will need following jars -</p>
<p>dbdeploy-cli-3.0M2.jar<br />
hsqldb-1.8.0.7.jar</p>
<p>keep above jars in dir &#8220;db&#8221; in same dir of pom.xml and keep your dbdeploy sql scripts in dir &#8220;db/scripts&#8221;. This will look like -</p>
<pre class="brush: text">
|-db
|----lib
|-------dbdeploy-cli-3.0M2.jar
|-------hsqldb-1.8.0.7.jar
|----scripts
|-------createSchemaVersionTable.sql
|-pom.xml
</pre>
<p>Next configure following Maven plugins -</p>
<pre class="brush: xml">
            &lt;plugin&gt;
                &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                &lt;artifactId&gt;sql-maven-plugin&lt;/artifactId&gt;
                &lt;version&gt;1.1&lt;/version&gt;
                &lt;dependencies&gt;
                    &lt;dependency&gt;
                        &lt;groupId&gt;hsqldb&lt;/groupId&gt;
                        &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
                        &lt;version&gt;1.8.0.7&lt;/version&gt;
                    &lt;/dependency&gt;
                &lt;/dependencies&gt;
                &lt;configuration&gt;
                    &lt;driver&gt;${test.jdbc.driverClassName}&lt;/driver&gt;
                    &lt;url&gt;${test.jdbc.url}&lt;/url&gt;
                    &lt;username&gt;${test.jdbc.username}&lt;/username&gt;
                    &lt;password&gt;${test.jdbc.password}&lt;/password&gt;
                &lt;/configuration&gt;
                &lt;executions&gt;
                    &lt;execution&gt;
                        &lt;id&gt;create-change-log&lt;/id&gt;
                        &lt;phase&gt;process-test-sources&lt;/phase&gt;
                        &lt;goals&gt;
                            &lt;goal&gt;execute&lt;/goal&gt;
                        &lt;/goals&gt;
                        &lt;configuration&gt;
                            &lt;srcFiles&gt;
                                &lt;srcFile&gt;${basedir}/db/scripts/createSchemaVersionTable.sql&lt;/srcFile&gt;
                            &lt;/srcFiles&gt;
                        &lt;/configuration&gt;
                    &lt;/execution&gt;
                    &lt;execution&gt;
                        &lt;id&gt;apply-db-changes&lt;/id&gt;
                        &lt;phase&gt;process-test-classes&lt;/phase&gt;
                        &lt;goals&gt;
                            &lt;goal&gt;execute&lt;/goal&gt;
                        &lt;/goals&gt;
                        &lt;configuration&gt;
                            &lt;srcFiles&gt;
                                &lt;srcFile&gt;${basedir}/target/consolidated_script.sql&lt;/srcFile&gt;
                            &lt;/srcFiles&gt;
                        &lt;/configuration&gt;
                    &lt;/execution&gt;
                &lt;/executions&gt;
            &lt;/plugin&gt;
</pre>
<p>createSchemaVersionTable.sql is part of dbdeploy distribution. Copy HSQLDB version.</p>
<p>And the following </p>
<pre class="brush: xml">
            &lt;plugin&gt;
                &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
                &lt;version&gt;1.1&lt;/version&gt;
                &lt;executions&gt;
                    &lt;execution&gt;
                        &lt;id&gt;dbdeploy&lt;/id&gt;
                        &lt;phase&gt;test-compile&lt;/phase&gt;
                        &lt;goals&gt;
                            &lt;goal&gt;exec&lt;/goal&gt;
                        &lt;/goals&gt;
                        &lt;configuration&gt;
                            &lt;executable&gt;java&lt;/executable&gt;
                            &lt;workingDirectory&gt;${basedir}/db&lt;/workingDirectory&gt;
                            &lt;commandlineArgs&gt;
                                -cp ${test.hsql.jar}:lib/dbdeploy-cli-3.0M2.jar com.dbdeploy.CommandLineTarget -U ${test.jdbc.username} -D ${test.jdbc.driverClassName} -u ${test.jdbc.url.escaped} -d ${test.dbdeploy.dbms.type} -o ${basedir}/target/consolidated_script.sql -s scripts/
                            &lt;/commandlineArgs&gt;
                        &lt;/configuration&gt;
                    &lt;/execution&gt;
                &lt;/executions&gt;
            &lt;/plugin&gt;
</pre>
<p>Following are the important maven properties that are to be set -</p>
<pre class="brush: xml">
        &lt;test.jdbc.driverClassName&gt;org.hsqldb.jdbcDriver&lt;/test.jdbc.driverClassName&gt;
        &lt;test.jdbc.url&gt;jdbc:hsqldb:file:${basedir}/target/testdb;shutdown=true&lt;/test.jdbc.url&gt;
        &lt;test.jdbc.url.escaped&gt;jdbc:hsqldb:file:${basedir}/target/testdb\\;shutdown=true&lt;/test.jdbc.url.escaped&gt;
        &lt;test.jdbc.username&gt;sa&lt;/test.jdbc.username&gt;
        &lt;test.jdbc.password&gt;&lt;/test.jdbc.password&gt;
        &lt;test.dbdeploy.dbms.type&gt;hsql&lt;/test.dbdeploy.dbms.type&gt;
        &lt;test.hsql.jar&gt;lib/hsqldb-1.8.0.7.jar&lt;/test.hsql.jar&gt;
</pre>
<p>How it works &#8211; </p>
<p>We are using dbdeploy command line interface to achieve integration. The HSQLDB is used in a file mode which is evident by test.jdbc.url, since maven exec task executes by using bash semi-colon used in jdbc url needs to be escaped, thats the reason for defining test.jdbc.url.escaped property.</p>
<p>The sql-maven-plugin&#8217;s execution &#8220;create-change-log&#8221; is configured to run after phase &#8220;process-test-sources&#8221;, which creates change log table which is required by dbdeploy.</p>
<p>The exec-maven-plugin&#8217;s execution &#8220;dbdeploy&#8221; is configured to run after phase &#8220;test-compile&#8221;, executes dbdeploy command line interface, creates &#8220;${basedir}/target/consolidated_script.sql&#8221; which contains sql changes to be applied.</p>
<p>The sql-maven-plugin&#8217;s execution &#8220;apply-db-changes&#8221; is configured to run after phase &#8220;process-test-classes&#8221;, which applies consolidated change log script.</p>
<p>Hope it helps somebody..</p>
]]></content:encoded>
			<wfw:commentRss>http://byteco.de/2010/01/31/maven-dbdeploy-hsqldb-without-ant/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

