Posts

Showing posts from 2009

Vakati's IE Saver - To Save content from all open Webpages

There are times when I want to restart the computer but not close all the opened internet explorer sessions as I might want to view them later.This simple application writtten in vb.net can be used to save you from the afore mentioned scenario.IE Saver can not only save all the open links and restore them back with a click of button but also can store all the open pages content to a folder that can be viewed later offline with out a connection to the internet.Here is the link for it.

Simple UI to Maintain Subversion (SVN) Authorization File

Image
I really enjoyed the installation,configuration and using of Subversion as an alternate to Source Safe.SVN is really fast reliable scalable and TortoiseSVN can be used as a client to interact SVN server.

Configuring SVN is fairly easily especially with packages like visualsvn server,collabnet svn and many more.As you all might know in Subversion(SVN) granualar permissions on the projects can be done using a authorization file.Authorization file can be set using AuthzSVNAccessFile(svn-auth.conf) directive in httpd.conf file.You can create groups, add users to the groups, add groups and users to the projects in the authorization file.

I wrote this small and simple application to Manage/Maintain Users,Groups,Project Assignments in the authorization file using .net.I know this is not going to save a lot of time for all but it is handy at times, so I did it.Here is the link for it.



**This program is not tested properly hence you are responsible for testing and then using it on your production…

A Simple Attendance System - .net c# access

One time I had to create a small attendance system for a not-for-profit organization, even though this is a simple application it might be handy to use.Will be able to add your child/employee/equipment/shipping or any other things you want to track daily and mark their presence.

You can run daily and monthly reports.This application is written in c# and access 2003.

Here is the link to download the application binaries.

Feedback welcome.

Microsoft Treeview Nodes.AddRange

Have you ever tried to add nodes in the Microsoft Treeview using the AddRange method, it is not fun to do that as you cannot create a new TreeNodeCollection.After doing quite a bit of research we found a way to do this.Here is the trick.

vb.net sample code:

Dim ndc as new list(of TreeNode)

For i as Integer = 0 to 10 step 1
Dim nd as new TreeNode
nd.text = "node " + i.tostring
ndc.add(nd)
Next 1

Me.treeview1.Nodes.AddRange(ndc.ToArray)

AVIC z1 Installation Toyota Celica GTS

Here are the installation instructions of the AVIC z1 on a Toyota Celica 2001 gts.Before going into that I have to tell I love my AVIC Z1 double din navigation system with cd/mp3/dvd player with a rear view camera and bluetooth adapter.

I am not a electronic or mechanical geek by any means,but still I want it to be done.So I did some decent amount of home work before I started working on it.I had to thank newcelica.org for all the instructions on how to take things apart and Toyota for all the plastic clips that are used for fastening the interior to the car.Last but not the last I have to really thank Poineer team for compiling such a simple installation manual.It is here

I started with installing the rear view camera,I installed the camera in the key hole of my celica.Took the plastic thing below the hatch and then removed the three bolts to take the plastic thing above the license plate that hold the keyhole.Passed the wire to the through the holes in the hatch to the roof and then c…

Car Installation

Image

Crystal Reports Run Time - Visual Studio AnyCPU Target

Following error is raised when you run a report on a 64 bit machine with 32 bit Crystal Reports Run Time.

---------------------------Crystal Reports---------------------------

An error has occurred while attempting to load the Crystal Reports runtime.
Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/support for more information.

After targetting the solution to x86 instead of AnyCpu,report loaded OK.

Crystal Reports - Fake Login Dialog

We have Crystal Reports in our application and noticed a fake Login Dialog that doesn't do anything even when credentials are supplied.After doing some research we found that sql native client is missing.

SVN Upgrade from 1.4.5 - 1.5.5 (Apache 2.0.63 - 2.2.8)

For every person there are three basic things that are needed to survive,clothing,food and shelter.But as a software developer there is a fourth one that is needed to live.SVN is what I am talking about.

About 9 months ago we migrated from Visual Source Safe to Subversion, using Subversion is easy and a nice experience.

At the time of install, they had Subversion 1.4.5 and Apache Web Server 2.0.63.This week Subversion released a new version 1.5.5 and it seems some of the nice features are added to this version,so we want to do the upgrade.

In the old versions we were using multiple sources of authentication,domain based and file based.As we had some contracters outside the company it really worked out very well.

I uninstalled the old version of Apache and Subversion and installed new version using the collabnet subversion.

During the upgrade everything really went well except our multiple sources of authentication part.It seems that authauthoritative in mod_auth is removed from the new ve…

Regular Expression for Decimal Scientific and Fraction Values : ALL IN ONE

Regular expressions are really handy when user input needs to be validated.The following expression can be used to validate Decimal or Fraction or Scientific values.

^(([+-]?([0-9]*\d*\.\d{1}?\d*))(\-?(?:((\d+\s*)?\d+\/[1-9]+[0-9]*)(\d+(\s*\d+\/[1-9]+[0-9]*)?)))(^[+-]?[0-9]*(?:\.\d?)?[Ee][-+]?\d+))$

The big list of matches and non-matches below is the hard work of one of my colleagues.

Matches
0 ,0.0 ,-0 ,-0.0 ,+0 ,+0.0 ,0.1 ,-0.1 ,+0.1 ,1 ,1.1 ,-1 ,-1.1 ,+1 ,+1.1 ,1.1234567890 ,-1.1234567890 ,1.12345678901234567890 ,-1.12345678901234567890 ,0E0 ,-0E0 ,+0E0 ,
1E2 ,1E+2 ,1E-2 ,-1E2 ,-1E+2 ,-1E-2 ,+1E2 ,+1E+2 ,+1E-2 ,1.E+2 ,1.E-2 ,1.0E+2 ,1.0E-2 ,
.0E+2 ,-.0E+2 ,+.0E+2 ,.1E+2 ,-.1E+2 ,+.1E+2 ,12345678901234567890E+2 ,1.0e+2 ,0/1 ,
-0/1 ,1/1 ,-1/1 ,1 0/1 ,1 1/1 ,-1 1/1 ,0 1/1 ,-0 1/1 ,1/8 ,-1/8 ,1 1/8 ,-1 1/8 ,10/8 ,12345/12346

Non-Matches
. ,&5 ,1,2 ,1d5 ,-1- ,-1.-1 ,+1+ ,+1.1+ ,E ,.E ,E0 ,0E ,-E0 ,-0E ,+E0 ,+0E ,1E++2 ,1E+-2 ,1E+2- ,
1E+2+ ,1E-+2 ,1E--2 ,1E-2- ,1E-2+ ,1E+.2 ,1E+2. ,1E+2.0 ,1…

a small t-sql puzzle

A friend of mine found a small sql puzzle online somewhere and told me about that.I know it is not that hard to solve the problem using t-sql but I want to find out all the possible ways that I can to solve the puzzle.

Two tables
1.Users with their color assignments
2.All the possible colors.

Problem:
Find all the people that has all the colors in the second table.

Solutions:

Declare @usrs table(
[name] varchar(5),
Color varchar(10)
)
Declare @AllColors table(
Color varchar(10)
)
insert into @usrs values('a','red')
insert into @usrs values('a','green')
insert into @usrs values('a','blue')
insert into @usrs values('b','red')
insert into @usrs values('b','green')
insert into @usrs values('c','blue')
insert into @usrs values('c','red')
insert into @usrs values('c','green')
insert into @usrs values('d','blue')
insert into @usrs values('d','red')
insert in…

OSQL - Running all the SQL Scripts in a given folder

Like I said in my earlier post OSQL is very useful to run sql scripts and run queries.This post demonstrates the use of OSQL in running all the scripts in a given folder.

@ECHO OFF
:: Keep variables local

SETLOCAL
:: Check command line arguments
SET Server=%1
SET Database=%2
SET Test=%3

IF NOT DEFINED Server
GOTO Syntax

IF NOT DEFINED Database GOTO Syntax

IF DEFINED Test GOTO Syntax

:: Execute sql scriptsFOR %%f IN (*.sql)
DO
(
:: ECHO Running script %%f... ECHO ^>^> %%f
OSQL -E -S %1 -d %2 -n -m-1 -b -i "%%f"
IF ERRORLEVEL 1
( ECHO.
ECHO ^>^> Critcal error in script %%f! Ending execution.
GOTO End
)
)
:: Display complete message
ECHO.
ECHO Finished running sql scripts on database %2

:: Done
GOTO End

:Syntax
ECHO.
ECHO Usage: RunSQLScripts server database scriptpath
GOTO End

:End
ENDLOCAL

OSQL - Running Queries in a Batch File

OSQL is another very useful tool I and my group use very often.We used it to execute all the sql files in a folder against a given server and database.

Here is the batch file I use to check if all the user procedures and user defined functions in a database has a execute persmission for a user ROLE called 'APPUSER'.

This sample batch file also demonstrates how to execute sql queries using OSQL in a batch file.


@ECHO OFF
:: Keep variables local
SETLOCAL

SET Query="select so.name from sys.objects so LEFT OUTER JOIN sys.database_permissions p on so.[object_id] = p.major_id inner JOIN sys.database_principals dp on dp.name = 'APPUSER' where so.Type IN ('P') and p.major_id is null"

ECHO ^>^> Running CheckIfAPPUSERIsGrantedExecuteOnAllProcs
ECHO ^>^> ----------------------------------------------
:serverset server=
set /P server=^>^> Enter Server Name or Type exit to Exit: %=%

if "%server%"=="" goto serverif "%server%"=…