Introducing @bangalore_pulse

About Twitter –

Twitter is a free social networking and micro-blogging service that enables its users to send and read messages known as tweets. Tweets are text-based posts of up to 140 characters displayed on the author’s profile page and delivered to the author’s subscribers who are known as followers.

bangalore_pulse – Information and news about Bangalore fetched from various sources. A short title and a link to original source.

More



Connecting to In-Memory H2 database using a SQL Client

In order to setup a in-memory H2 instance and connecting to it using your database client start h2 with following –

jdbc.url.default=jdbc:h2:h:/shivbox2;AUTO_SERVER=TRUE

More



Eclipse Code Formatter – IntelliJ IDEA [Update]

I have updated this plugin.

Main feature as part of this release is ability to trigger Eclipse Code Formatter as a Pre Commit action. More details and download here

More



iPhone and AppleCare International Warranty

Well, I didn’t expected this but it is what it is…

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.

So I had bought my iPhone along with extended AppleCare from United Kingdom, but this can’t be serviced in India… I have to fly to London or a place where Apple Retail Store is to get warranty benefits… damn…..

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..

More



Converting ASCII encoded file to UTF-8

You get a file whose encoding you don’t know and want to convert it to UTF-8 encoded file using java. How to do it?

Below should work –

Click to continue reading “Converting ASCII encoded file to UTF-8″

More



Eclipse Code Formatter – IntelliJ IDEA

When working with a team of developers spread across globe, one challenge is to maintain code formatting.

Most of teams using Eclipse as their primary IDE, rely on Eclipse code formatter that can be configured by enabling project specific setting and then adding /.settings directory to version control system. This directory contains org.eclipse.jdt.core.prefs which has formatting details.

Since these files are part of version control, all developers now has these settings file and formatting changes gets applied automatically on saving file.

But if you are an IDEA user, then there is was no way to use these Eclipse code formatting.

To make life somewhat easy, over the weekend I created a small plugin which basically let you use the Eclipse Code Formatter from IDEA. The main feature of this is that you can apply these on a Change List. Change List in IDEA is basically list of files that you have modified/created and are going to commit.

For more details visit project page – eclipse-code-formatter-on-change-list

The plugin is also available in IDEA plugin repository.

More



Sulekha.com Privacy Issues

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 advertiser.

Yesterday I had logged in the site and chose “Remember me on this computer” 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.

Without me doing anything, Sulekha.com updated my verified mobile phone number with the Advertiser’s phone number. The same applies to email. Within minutes, I started getting lots of emails.

I also got a call on my phone saying that – “Hello Shivprasad, you have a Swift Dzire for sell na, its posted on Sulekha.”…. damm.. until this I was not aware of what’s happening. I had never owned Swift Dzire let alone selling :)

Next, my mailbox started getting filled with mails such as –

1) You have viewed details of Washing Maching
2) You have viewed details of Honda Activa
3) You have viewed details of PG Accomodation for Girl

WTF…apart from this, also started getting mail that I have created new listing such as this one – Only 28000 Milage and few more.

This is pretty much fcked up my privacy with my email and phone number being associated with god know how many accounts.

I started getting mails from site users who are interested in listing like above which is attributed to me or from Advertiser’s whose details are seen by me..(PG for Girl)..

I just couldn’t imagine how dumb the developers of Sulekha.com are. Is there any testing performed on site at all? If you don’t get AJAX.. don’t do it….

I had contacted Sulekha.com and informed them abt the issue and through their site’s feedback mechanism, informed about the issue.

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.

Not sure how many others faced this issue today, but in future I am going to be very careful about Sulekha.com. Don’t trust them.

More



Firefox and Google Dictionary

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’t find one. So I created a very basic user script based on Google Dictionary.

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 :)

Here is a github gist url – Google Dictionary user script

More



Java Map Interface Examples

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 – 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.

HashMap – 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 key11 as it equals with key1 value “One” is replaced with “Eleven”.

IdentityHashMap - 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.

LinkedHashMap – 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.

LRU Caching using LinkedHashMap – 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’s return value it will either be kept or removed from the map.

WeakHashMap- 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 this 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.

Click to continue reading “Java Map Interface Examples”

More



Timesjobs and Techgig.com SPAM

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 at the end of your marketing emails. I still continue to receive mails.

You dumbs  can’t even spell Techgig.com,

Fresher Jobs on TaechGig.com

Can you pls tell me what it would take for you to remove my email address from your system. Heck I don’t want account at your website. Is there any way I can close my account.

Seems TimeJobs  don’t give a damn about user privacy….

More



Next


WordPress Loves AJAX