Dec 30 2010

Can’t move ‘.svn/tmp/entries’ to ‘.svn/entries’

SVNAt my office we mainly use Tortoise SVN to version our code bases. I usually take an update each and every morning and recently the update started to fail with the error “Can’t move ‘.svn/tmp/entries’ to ‘.svn/entries‘” and this kept on happening every day. After that when I issue the update command again, the code base is updated without further error messages. This was really troublesome and after talking with my colleagues at office I got to know that this error comes because the anti-virus software installed in my computer interferes with the SVN update.

When an SVN update happens the a lot of files are copied from .svn/tmp/entries’ folder to ‘.svn/entries folder and the anit-virus software (Kaspersky in my case) thinks that a malicious programme is doing some tricks and blocks the file copying thus causing the famous “Can’t move ‘.svn/tmp/entries’ to ‘.svn/entries'” to appear in the Tortoise SVN update window.

The simple remedy would be to add the folder which SVN is updating to the exclusion list of the anti-virus software that you are using. In Kaspersky you can add the folder to it’s exclusion list as in the following which I obtained from their support site.

Manage Exclusions

After that hopefully you will be able to solve the mystifying error;  Can’t move ‘.svn/tmp/entries’ to ‘.svn/entries’. Happy updating!!!


Sep 2 2010

Spring to the Rescue

Spring

The project I am working on these days, at office, uses Spring extensively. We use Spring for mainly to implement dependency injection and recently Spring transactions was tested to use for database transactions. One thing I love about Spring is the amount of flexibility it supports and the features it provides. I am not a Spring master, but the days I spent with Spring made me love it more and more.

During the last sprint iteration (we use the Scrum process for this project) we decided to go for a new algorithm called Nested Interval Set (NIS) to achieve efficient database searching. Doing so required a complete changeover in the back-end services to support this new algorithm and we needed to merge it with the existing code so that nothing will break. With Spring this was a breeze!!

Our services are always implemented for interfaces and in this case also we had an interface for the particular back-end service. All we did was create the new back-end service (implementing the same interface) which supported NIS and injected it using Spring by just changing an XML entry where the Spring beans and dependency injections are defined. The changeover was that simple. If we had not used any dependency injection techniques a change like this would mean a lot of cumbersome work for the developers. If you want to know the basics of Spring, just go through this simple tutorial and get to know the wonders you can do with Spring in your projects.

Spring certainly is a life saver!!!! 🙂


Oct 2 2009

Implementing a Data Access Layer in C#.Net

Today I started doing some coding using C#.Net to build a simple windows application which needs database access. Since I haven’t used .Net for a very long time (more than 1 year) I found it hard to code the classes that accessed the database. So I did the thing that most Engineers do which is Googling :). I found the following article which I referred to implement the layer. It’s really interesting and the writer has made it database independent, which means you can switch database servers (SQL server, MySQL etc) without a glitch. The article can be found here.


Aug 10 2008

Connect MySql with .Net


Recently I started working on a new project and the clients wanted to use MySql database server because it is free. I had dealt with the MS Sql 2000 and 2005 servers from .Net and that was a breeze. I had a hell of a time trying to figure out how I can connect MySql and .Net and finally after lots and lots of googling and with lots of common sense I managed to get this done. So I thought of writing this post to help all those who have this requirement and don’t want to go through the entire WWW to find this out. 🙂

Step 1
First of all you must download and install the connector that is needed to connect with the MySql database. You can get the driver here free of charge. (It’s open source ;)) At the time of writing version 5.0 was the stable and newest version. Get that and not 1.0 because to install 1.0 you need the .Net framework 1.1.

Step 2
Then go tour project in Visual Studio. (I am using Visual Studio Professional 2005) Right click your project and select Add Reference, and select MySQL.Data as shown in the figure below.

Step 3
Now you are ready to go. Everything is set and hopefully will work out. 🙂 Just type some code like below to check whether everything is in order. (I am using an ASP.Net page to check connectivity)

public void Page_Load(Object sender, EventArgs e)
{
string conString = “SERVER=localhost;DATABASE=Infinity;UID=root;PASSWORD=test123;”;
MySqlConnection connection = new MySqlConnection(conString);
MySqlCommand command = connection.CreateCommand();
command.CommandText = “select * from Room”;
connection.Open();

MySqlDataReader Reader;
Reader = command.ExecuteReader();
while (Reader.Read())
{
string row = “”;
for (int i = 0; i < Reader.FieldCount; i++)
{
row += Reader.GetValue(i).ToString() + “,”;
}
Response.Write(row);
}
connection.Close();
}

If everything works fine your aspx page should show all the data of the table you queried.


May 20 2008

Using the Struts Framework for Validations

As I mentioned in one of my earlier posts, I started learning about Struts last week. Today I had to do some validations in the forms of the jsp pages and the first option that came to my mind was to use javascripts. However the people for whom I am doing this project, asked me to use the Struts framework instead. So after a healthy breakfast I set to get things done and opened google and typed “validations using struts”. 🙂

After a couple of hours and some common sense later, 🙂 I rigged up an application that used the struts framework for validations. I didn’t find one single tutorial that provided the basics. So I thought of combining what I got from many of them and put it here so that someone else like me can use this article to get the concept of validations under the belt and thank me whole heartedly. 😀

Well to start off with you need the jsp. The code below is of a sample jsp page.

The “s:head/” tag is quite important. It took me quite some time to understand the importance of it because I couldn’t get anything to work without that tiny little tag.

The next thing is the validations xml file. The struts framework uses xml files to do the validations. For each jsp there is an action class which handles the related business logic. An xml file should be created at the same location of the action class bearing the name action class name-validation.xml. For example if your action class’ name is SignInAction.java then your xml file should be named SignInAction-validation.xml. The code for the xml file is given below.

In the xml file the field-validator type is used to inform the struts framework what type of validations are required. For example if you put “email” there, the framework will check whether the entered email address is a valid one.

So that’s all folks. When you run the application try submitting the form without entering anything in the text boxes. The validations should pop up instantly. 🙂 Good luck!!!


May 16 2008

Enter Struts

During this time last year I was hugging and kissing .Net technologies. I couldn’t get enough of it, and that’s why I went to do my internship at Eurocenter DDC. During my internship I had to deal with a java project which gave me quite a good exposure to the technology.

These days I am learning Struts, which is an open source java framework that deals with providing MVC (Model View Control) architecture for applications. We can easily build applications on top of this framework that works according to a MVC type of design. I am using this article and this one as my teaching guides. They are really good and I recommend it for any beginner like me. Of course you have to have some knowledge in java.


Apr 30 2008

Vista is incomplete??

Microsoft Vista, the latest operating system released by Microsoft, hit the market with a big bang. Vista was so beautiful and rich in graphics but I really found it to be a pain in the ass. This was because I had to endure many “are you sure” messages which were really really very troublesome.

I found the following article in which it explains that Vista is incomplete. I think it’s quite interesting. Check it out at http://www.theregister.co.uk/2008/04/18/ballmer_vista_incomplete/


Apr 30 2008

DNN Headache

DNN or Dot Net Nuke is an open source framework for portal development in ASP.Net. One of the headaches of doing DNN development with SQL Express databases is that you won’t be able access the web site while the mdf file (SQL express DB) is being opened from visual studio or sql management studio for any db management work. This is very troublesome and something which is really unwanted.

This article explains how to achieve this and I think it will help us to reduce a lot of development overhead when we use the DNN/SQLExpress combination for portal development.


Apr 30 2008

ASP.Net FAQs

The .Net platform has made software development a breeze but there are still places where you need a helping hand. I went through several problems when I worked with ASP.net and these FAQs helped me to understand what I was doing wrong. Check them out at http://www.syncfusion.com/FAQ/aspnet/default.aspx