Posts

Showing posts from 2010

SVN CHANGE FINDER

Image
Everyone knows how cool of a software svn is.Along with tools like visualsvn, tortoisesvn,ankh svn,svn monitor it makes you feel happy all day as with out being worried about your data.Like everyone else programmer/developers uses svn a lot in their daily routine for keeping revisions of their source files alongs with any other documentaion.When you want to find a change a colleague made in a file or wonder when that change is made, you have to almost reap through all the revisions of the file and use the diff tools/viewers open each revision and see if change is there.It is hectic time consuming when there are many revisions on a file and if there are lot of changes per revision.So I created this small utility to find when the text/change you are looking is made in a file.

Set SvnExeLocation and TortoiseExeLocation in the config.xml before using the application.




Get the code and binaries from the link below.


Keywords:
svn subversion changes revisions head diff diffs log author messag…

Crystal Reports Windows Application - Failed to open the connection

Failed to open the connection.
Details: [Database Vendor Code: 4060 ]
Failed to open the connection.
temp_62a7065e-b077-44f0-8593-7dca04303f6a {7498BCDB-812A-4D53-B04E-9BD3E45EC6B6}.rpt
Details: [Database Vendor Code: 4060 ]
Stack Trace:
at CrystalDecisions.ReportAppServer.Controllers.RowsetControllerClass.CreateCursor(ISCRGroupPath GroupPath, RowsetMetaData MetaData, Int32 Reserved)
at CrystalDecisions.ReportAppServer.CrystalReportDataView.EnsureDataTableIsFilled()
at CrystalDecisions.ReportAppServer.CrystalReportDataView.get_DataView()
at CrystalDecisions.ReportAppServer.CrystalReportDataView.get_InternalCollection()
at CrystalDecisions.ReportAppServer.CrystalReportDataView.get_Count()


OK, the error above appeared out of no where and we had to spend hours and hours to figure out what is going on.

Let's get some info about the environment.

Dev database - where developers write code against and is used to design new reports.

QA database - where qa staff run the test cases in th…

svnadmin dump - never finishes

Ok, here I am trying to separate a repository into two following svn documentation.I got to create a dump file then use svndumpfilter to create separate dump files for the projects I want and create repo's using those individual files.

With this in mind I started to work on it.Our repo is about 5 gigs in size.Command prompt in which I started the command says not responding after a while and never finishes dumping.I thougt it needed more time so let it go for the entire night with no success.After all these hours I
found out that dump is written to the console window.Changing that to output to file fixed the problem

Wrong
svadmin dump e:\repo e\repodump

Correct(if you want the dump file)
svadmin dump e:\repo >e\repodump

Finding the Owner( Launching Form)

Sometimes it is very useful to have reference to the form that launches another form.This is easily done by passing the owner in the form show method.But what if you have to change a lot in the existing code to get that.You can use windows api to get the owner.Lets say you have form1 and form2 in your app and form2 is launched from form1 and if we want to find the launcher of form2 which in our case is form1.This is what you do in form2.


<dllimport("user32", charset:="CharSet.Auto," exactspelling:="True)" setlasterror:="True,">_
Public Shared Function GetWindow(ByVal hwnd As IntPtr, ByVal uCmd As Integer) As Integer
End Function


--get the window now
Dim i As Integer
i = GetWindow(Me.Handle, 4)
Dim ctrl As Control = Form.FromHandle(i)

Linq Remove Duplicates and Merge Two Collections using Union and Distinct

Linq is a boon from Microsoft to all .net developers; it makes things really easy and simple and also gives the ability to perform several tasks that you do using sql (many more).I had to remove duplicates based on some columns from two different collections, it was done using for loops in the past, as linq is available I thought of giving it a shot.

Union and distinct is used to obtain the desired results; also notice a custom IEqualityComparer is passed to distinct instead of the default equality comparer to compare values. In custom equality comparer you can ignore the columns or properties you don’t want to consider when deciding the uniqueness. If you don’t have a custom IEqualityComparer then linq distinct wont work as expected and might return duplicates.

Let’s dive into some code here.
''define lists
Dim list1 As New List(Of Item)
Dim list2 As New List(Of Item)

''add two items to list 1
Dim item1 As New Item
item1.ItemID = Guid.Empty

Complex and a special three state (tri state) Treeview Control

Image
As we all know treeview is used to show hierarchy of items easily. Microsoft tree is readily available for you if your needs are simple. But if you want to have the tree do more than two states it might not be possible with the treeview control as it is. You might have seen several treeview .net controls out there that have three states but the treeview in this post here might be little different than those. A parent can have its own state and can depict its child check state when stateless, also all the children under a parent are not affected when check state on the parent changes.

States:
Checked – Green Check
Unchecked – No Check
AtLeastOneChild Checked (only for Parent) – Light Gray Check

State Determination:

Node when checked a green check is shown regardless of whether any child nodes have been checked
Node when unchecked but has checked child, gray check is shown for the node.
Node when unchecked and has no children or all children unchecked, an empty check is shown

State Images:






What i…

SQL SERVER Employee Scheduling System

Determining day based on the start time and end time can be trick especially in sql.Scenario like this is encountered when working on a employee or any other scheduling system.Sample below takes current time and gives back the employees that are available according to the employeeschedule table.Code is self explanatory and is why it is minimally commented.

If you need a nice formatted sql,get it from here.
http://code.google.com/p/sql-scheduling-availability-system/downloads/list


IF EXISTS (SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name = 'Employees')
DROP TABLE [Employees]

GO

CREATE TABLE [dbo].[Employees] (
[EmpID] [INT],
[FirstName] [VARCHAR](50),
[LastName] [VARCHAR](50),
[PhoneNumber] [VARCHAR](15))

GO

IF EXISTS (SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name = 'EmployeeSchedule')
DROP TABLE [EmployeeSchedule]

GO

CREATE TABLE [dbo].[EmployeeSchedule] (
[EmployeeScheduleID] [INT],
[WeekID] [INT],
[DayID] [INT],
[EmpID] [INT],
[StartTime] [SMALLDATETIME],
[EndTIme] [SMAL…

Quality Assurance (QA) Tracking System - Access .Net(vb.net)

Image
Any applications that are developed in no means are perfect hence need to be go through the QA process in every stage of the development.Quality Assurance seems to play a big role in all areas of manufacturing and product development.Tracking QA process can be tricky and complicated some times especially when tracking using word and excel documents.Database driven tracking system is very helpful as many people can help in tracking at the same time.

Big enterprise testing application provide the ability to maintain the QA process well but smaller companies and teams that dont have need or money to buy these enterprise products end up maintaining word and excel documents for Quality Assurance process.

I wrote this small application to track Quality Assurance process using vb.net and access database.Here is the link for it

http://code.google.com/p/quality-assurance-tracker/downloads/list



Feedback welcome,Thanks.

DVR using a PC XBOX 360 and Silicon HDHomeRun

Image
After wanting to create my own DVR setup for many days finally I got a chance to do it last night.I am really amazed by Microsoft Media Center and XBOX 360 capabilities.SiliconDust HDHomeRun is another amazing device that I came across.Using all these I was able to see my recordings and live tv on my PC.

Here are the components I used to make this
1.XBox 360 Pro 60gb HD
2.Windows 7 Ultimate Media Center PC
3.Linksys Router WTRG
4.Netgear WGR614v7
5.XBox Universal Remote
6.HDHome Run Dual Tuner Card
7.Terk HD Antenna

Lets start into going into details

1.Connect HDHome Run to the Router(1) that is connected to the Terk HD Antenna using a RF Splitter.

2.Download the HDHome Run setup software and let it discover the HDHomeRun on the network
(http://download.silicondust.com/hdhomerun/hdhomerun_windows_20100121.exe)

3.Run the Windows Media Center and Run the setup it will automatically connect to the Daul Tuners on the HDHomeRun which is on the network.

4.Look at the following pic which has the entire se…

Subversion pre-commit hook : Check Empty Log Message,Ignore File Extensions,Ignore Directories/Folders,Check For Lock Existance

Image
Have you ever wondered a single svn/subversion pre-commit hook exists fow windows and can check for empty or no log message /messages ,ignore files and directories and check for lock existence(svn:needs-lock) on commiting binary files such as word documents, pdfs, exes,dlls,xls and others.

This small .net pre-commit hook can do it all for you, and is highly configurable to fit every ones need.Can easily maitain ignore list of files and folders, need lock files and turn off/on check using the configuration file.

Code can be used as a sample / example if you want to create a hook of your own.
You will get a Commit failed (details follow): Commit blocked by pre-commit hook (exit code xxxxxx) with output error if svnlook location is not defined in the xml configuration file.

here is the link for it.

http://code.google.com/p/prashanth-vakati-prj2/downloads/list

Config File:






Error Messages from the pre-commit hook: