Author Archive

HowTo Get RID of Just-In-Time debugger

I installed Visual Studio, and with this it installed a Just-In-time script debugger .This Just-In-Time seems to come up all the time when I run Internet Explore and on each page of IE.

 Solution

Open Start>Control Panels>Internet Options: Advanced and activate (check box)

* Disable Script Debugging (Internet Explorer)
* Disable Script Debuggung (Other)

Open the registry (use regedit, Click Start, Run, Regedit).

Go to this key:

HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings\JITDebug

And set it to 0.

Comments

GURFL data

GURFL file is a list of operators and their associated IP address ranges. This is a good way to find out from which mobile carrier (ie. which country) does a request come from.

Earlier it was available at:http://www.whirlymobile.com/resources/gurfl/operator.csv 

But now days it is down. So I am attaching the last GURFL updated operators.csv file here

Comments (1)

Log4j errors : log4j:WARN No appenders could be found for logger, log4j:WARN Please initialize the log4j system properly

This is a very common problem, it occurs when log4j.properties not found in classpath.

Create a file called log4j.properties. Place it in the root folder where your java classes are found. When log4j initializes, it will look for a file named EXACTLY log4j.properties (if you are using a properties file).

Another alternate way is to put the path to the log4j.properties file in your classpath.

Hope this will help you :) 

Comments

org.h2.jdbc.JdbcSQLException: The object is already closed [90007-113]

While running junit using in memory database H2 I was hitting this error. I was testing my spring DAO classes that are using JDBCTemplate. In a single Junit testing, to test various scenario  I was calling a single DAO method with different parameters . It start giving the error "The object is already closed" as it finishes testing the DAO method with first parameter.

Then I investigated in JDBCTemplate and found that it closes connection after every execution of query using Finally statement.

finally {
            JdbcUtils.closeStatement(stmt);
            DataSourceUtils.releaseConnection(con, getDataSource());
        }

To solve this issue I override the JDBCTemplate and created my own JDBCTemplate in which I have removed the Finally statement.

Comments

Javascript: Make independent copy of array using slice() method

Sometime it happens that we need to make copy of an array but in javascript when we assign an array to new it assign it with reference means if you delete anything from new array it will delete it from the main array as well :(

To create a copy of an array that is independent of another array:
Use the Array object’s slice() method.

For example, the following statements create an array and then use slice() to make an independent copy of the array.

 // JavaScript syntax

var oldArray = ["1", "b", "3"];

var newArray = oldArray.slice();

Comments

HSQLDB : java.sql.SQLException: Access is denied in statement [SELECT * FROM TBALE]

This error appears when you have not specified required privileges to user in SCRIPT file for running the statements. Use the commands as follows just after user creation grant access as DBA like below:

CREATE USER SA PASSWORD ""
GRANT DBA TO SA

Comments

Remove element from Array

What if you want to delete an element from Array ??

Mostly people use delete command  but it leaves undefined behind it

>>> var list = [1,2,3];

>>> delete list[1];

>>> list

[1, undefined, 3]

Now try splice instead of delete

>>> var list = [1,2,3];
>>> list.splice(1, 1); // Remove one element, returns the removed ones.
[5]
>>> list[4, 6]
And it's done... 

Comments

IE - Expected identifier, string or number

If you're getting this error, chances are you have an extra comma after a curly brace:

  a = {
            b: function() { },
            c: function() { }, }  

Get rid of the trailing comma and your JS error woes will disappear!

Comments

Client does not support authentication protocol requested by server; consider upgrading MySQL client

I have installed MySql 5.1 version on my lappy and when I try to connect with the DB it was giving me following error:

"Client does not support authentication protocol requested by server; consider upgrading MySQL client"

MySQL 5.1 uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older (pre-4.1) clients. If you upgrade the server from 4.0, attempts to connect to it with an older client may fail with the above message.

To solve this problem, you should use one of the following approaches:

  • Upgrade all client programs to use a 4.1.1 or newer client library.

  • When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.

  • Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:

    mysql> SET PASSWORD FOR     -> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

    Alternatively, use UPDATE and FLUSH PRIVILEGES:

    mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')     -> WHERE Host = 'some_host' AND User = 'some_user'; mysql> FLUSH PRIVILEGES;

Earlier to this command password look like this

 mysql> select Host,User,Password  from mysql.user;
+———–+——-+——————————————-+
| Host      | User  | Password                                  |
+———–+——-+——————————————-+
| localhost | root  | *F02BB955B742538740F1CF4B7196B8804001C74F |
| %         | nitin | *F02BB955B742538740F1CF4B7196B8804001C74F |
+———–+——-+——————————————-+

 After the command it changed it to this.

mysql> select Host,User,Password  from mysql.user;
+———–+——-+——————————————-+
| Host      | User  | Password                                  |
+———–+——-+——————————————-+
| localhost | root  | *F02BB955B742538740F1CF4B7196B8804001C74F |
| %         | nitin   | 5b58a62e4240429c                          |
+———–+——-+——————————————-+

This works for me. Hope this will help

Reference:http://dev.mysql.com/doc/refman/5.1/en/old-client.html

Comments

How to change Eclipse SVN Plugin Password

Subclipse does not collect or store username and password credentials when defining a repository. This is because the JavaHL and SVNKit client adapters are intelligent enough to prompt you for this information when they need to — including when your password has changed.

You can also allow the adapter to cache this information and a common question is how do you delete this cached information so that you can be prompted again? We have an open request to have an API added to JavaHL so that we could provide a UI to do this. Currently, you have to manually delete the cache. The location of the cache varies based on the client adapter used.

JavaHL caches the information in the same location as the command line client — in the Subversion runtime configuration area. On Windows this is located in %APPDATA%\Subversion\auth. On Linux and OSX it is located in ~/.subversion/auth. Just find and delete the file with the cached information.

SVNKit caches information in the Eclipse keyring. By default this is a file named .keyring that is stored in the root of the Eclipse configuration folder. Both of these values can be overriden with command line options. To clear the cache, you have to delete the file. Eclipse will create a new empty keyring when you restart.

Comments (25)