SVN Cleanup fails – how to resume

Today I was  trying to cleanup a project, I got error.

I tried deleting the log file in the .svn directory and I also deleted the offending file in .svn/props-base

then did the cleanup. It works and I resumed my updates.

In some cases you need to apply the same in parent folder as well.

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.

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

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 🙂 

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.

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();

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