Sep 05 2008

Car insurance especially designed for muslim drivers

Category: Automotiveavinashsing @ 2:55 am

I was reading the news earlier this week and found that there is a new product in the insurance market, a new kind of car insurance targetting mainly muslim drivers. It is called halal car insurance and is Shariah compliant. What this means is that muslim drivers will now have access to an insurance cover which is inline with their faith. Muslim drivers did not have any choice before and had to go with conventional car insurance which contradicts the Islamic law.

Other similar products have been around a while now like halal mortgages and Shariah loans but for the car insurance industry, it is a first of its kind.


Sep 04 2008

Calculating x and y coordinates of an element in JavaScript

Category: Programmingavinashsing @ 3:26 am

I was trying to get the Swazz calendar to work on Firefox but it would get displayed at the top on the webpage instead of showing up just under the textbox element which required the calendar values. So while debugging it i noticed that i had the the Transitional DocType on and it was messing around with it. I googled the problem and found that the solution was to ‘px’ to the value otherwise Firefox would ignore it.

getObj(’fc’).style.left=Left(ielem) + ‘px’;
getObj(’fc’).style.top=Top(ielem)+ielem.offsetHeight + ‘px’;

And this is how you get the coordinates with JavaScript:

function Left(obj)
{
var curleft = 0;
if (obj.offsetParent)
while (1) {
curleft += obj.offsetLeft;
if (!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if (obj.x)
curleft += obj.x;
return curleft;
}

function Top(obj)
{
var curtop = 0;
if (obj.offsetParent)
while (1) {
curtop += obj.offsetTop;
if (!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if (obj.y)
curtop += obj.y;
return curtop;
}


Sep 03 2008

Best iPhone 3G case

Category: Gadgetsavinashsing @ 3:38 am

I wanted a case to protect my iPhone 3G so I was looking around on the Internet to see what others have recommended. However I was a bit hasty to buy a case so I ended up buying the first one I thought was worth it which is the Silicone case.

iPhone 3G Silicone Case Review

The iPhone 3G silicone case is like a glove and will offer some kind of protection to your iPhone if it falls down but it does not have any protection for the screen. It is really dull and for £9.99 that i paid from CarphoneWarehouse, it is really not worth it. It is bulky and makes the iPhone ugly! I have actually out off at least 3 people from buying the silicone case from O2 shops and CarephoneWarehouse when I was in these stores!

The second case that i bought was the InvisibleShield for the iPhone 3G. I had to go for this one because similar products like BodyGuardz and BestSkinsEver are not available in the UK and you have to order them online while i wanted something i could grab from London stores.

iPhone 3G InvisibleShield review

I paid £14.99 for the iPhone 3G InvisibleShield case and although i knew it was going to be a tough job installing this case, i had really no other choice. Like everybody said, it is really difficult to put on this case. I managed to put the front piece on the screen quite easily but I struggled for over an hour to put the back piece. In the end i had to cut the rounded edges of the InvisibleShield so that it would stick to my iPhone 3G. I’m quite disappointed with that because I’ve watched online videos on how to put it prior to installing it as well as read instructions from the vendor site and on different forums.

I have to say though that the InvisibleShield is not noticeable on the iPhone 3G and it does retain the phone’s beauty while providing extra protection against scratches and the like.


Sep 02 2008

Access to bin path denied in ASP.NET Web Application

Category: Programmingavinashsing @ 5:43 am

Just downloaded a solution from Visual Source Safe and I was getting lots of errors due to references not being found. So I went through each project and removed the old references and replaced them with the new references. However when I finally came down to the web app, it would not compile because it was unable to copy dll to the bin because access to it was denied. I checked the properties for the bin folder and noticed that it was readonly. So I unchecked the readonly property and applied it to all sub-folders and voila, the compiler is happy now and so I am :)


Sep 01 2008

Problem with SCOPE_IDENTITY() in ADO.NET

Category: Programmingavinashsing @ 5:40 am

I’m using .NET 3.5, Visual Studio Team System 2008 and SQL Server 2005 and i’m trying to return the new id that is created after an INSERT statement. When i call ExecuteScalar, it returns zero. I’ve googled the problem and it seems that you need to cast the scope_identity to int before returning it.

Here are 3 solotions for the problem:

1. SELECT CAST(SCOPE_IDENTITY() AS INT) instead of just SELECT SCOPE_IDENTITY()

2. Declare a variable to hold the scope identity as follows:

DECLARE @NewID INT

SET @NewID =  SELECT SCOPE_IDENTITY()

3. Have an output parameter in your stored procedure


Aug 27 2008

View code not appearing in Visual Studio 2008

Category: Programmingavinashsing @ 2:52 am

Another thing that I need to do is download the hot fix which addresses a couple of problems with Visual Studio 2008 Team Suite so that it can get rid of the annoying of having to go to the Solution Explorer to be able to “view code” in a Web Application rather than right clicking on an aspx page and selecting the “view code” option. The hot fix download is located below:

https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826


Aug 26 2008

How to find out what access users have in Windows?

Category: Programmingavinashsing @ 9:22 am

Many times you need to find out what access a particular windows user has and it’s not very easy to get that information. I wanted to get a list of folders/directories to which a particular user (local user in windows) had access to so that i could debug an application. Luckily, i found about a small command line utility tool which enables you to do just that. You will need to download the AccessCheck program and use it to get the access report.

http://technet.microsoft.com/en-gb/sysinternals/bb664922.aspx
http://windowsitpro.com/article/articleid/97672/using-accesschk-to-view-which-files-and-folders-a-user-has-access-to.html


Aug 19 2008

One month car insurance

Category: Automotiveavinashsing @ 5:59 am

I was talking to a friend of mine the other day and he mentioned that he needed to get car insurance for one month only. So I was like “Why can’t you take a normal car insurance policy?” and he told me that a relative of his gave him an old car which they don’t use anymore but could become handy for him. The only problem was that the car was like 12 years old and he was not sure whether it was worth keeping it. So he decided to take 1 month car insurance to try out the car and if he likes it, then he’s going to go for a standard car insurance. This would give me the flexibility of cancelling the insurance if the car was not worth the trouble. Well I hope things work out for him :)


Aug 18 2008

Integrating FCKeditor in my ASP.NET site

Category: Programmingavinashsing @ 5:42 am

So I wanted to try FCKeditor in a website i was redesigning. The first problem i foresaw was that it didn’t have an image resize option. However it seems to be the one closest to meet my requirements, therefore i’m thinking of hacking an image resize utility into the library.

As soon as i copied everything to my project, I got an HTTP Error 404 - Not found. I was like, what the hell just happened there, but then i googled the problem and find the solution. You need to specify the BasePath, ImageBrowserURL and LinkBrowserURL as follows:

<FCKeditorV2:FCKeditor ID=”FCKeditor1″ runat=”server” BasePath=”~/FCKEditor/” ImageBrowserURL=”~/FCKEditor/” LinkBrowserURL=”~/FCKEditor/” ></FCKeditorV2:FCKeditor>

This gets rid of the error.


Aug 18 2008

Setting up Visual Studio for improved productivity

Category: Programmingavinashsing @ 5:31 am

Once you install Visual Studio, there are a few things which you need to do so that you are comfortable with the environment and to make your life easier.  Here’s what i like to do:

1. Show line numbers!

2.  Insert attribute value quotes when typing

This can be enabled by
Tools -> Options -> Text Editor -> HTML -> Format
turn on - “Insert attribute value quotes when typing”

3. Change the colours of delegates, Enum etc

More on that later…

4.  If you don’t want IDs of controls to be forced to be unique

Go to Tools -> Options -> Text Editor -> HTML -> Miscellaneous
turn off - “Auto ID elements on paste in source view”


Next Page »