serving the solutions day and night

Pages

Wednesday, August 24, 2011

Matrix Report using SQL Server XML and XSLT Code

Desiging Matrix Report using SQL Server XML, XSLT and JAVA Code
In the above matrix report image is grouped week by employee vs employee by week.
Part 1 - SQL CODE
DECLARE @depart_id int
DECLARE @startdate datetime
DECLARE @enddate DATETIME

SET @depart_id = 314
SET @startdate = '01/01/2001'
SET @enddate = '02/28/2001'

DECLARE @e_id int
DECLARE @ename varchar(100)
Creating temporary table

Tuesday, August 16, 2011

ASP.NET Custom Errors(customErrors) and URL Mappings (urlMappings)

URL Mappings
  1. Open web.config file. (see MSDN)
  2. Create new urlMappings section within the system.web section.
  3. <urlMappings enabled="true">
    <add url="~/contactus.aspx" mappedUrl="~/index.aspx" />
    </urlMappings>
  4. If user types contactus.aspx, page mapped to the index.aspx.
  5. This approach won't work if you have 100 of pages to map.
  6. Best solution is to use regular expressions, but ASP.NET does not support. SEE
    URL Rewriting

Tuesday, August 9, 2011

XSLT Pagination and For Loop Code

For Loop 1 - 10
<xsl:call-template name="forloop">
  <xsl:with-param name="i"><xsl:value-of select="count(ts/@weekenddate)+1"/></xsl:with-param>
  <xsl:with-param name="count"><xsl:value-of select="$totalweekend"/></xsl:with-param>
</xsl:call-template>

<xsl:template name="forloop">
  <xsl:param name="i" />
  <xsl:param name="count" />
  <xsl:if test="$i <= $count"><TD align="center"> </TD></xsl:if>

  <xsl:if test="$i <= $count">
    <xsl:call-template name="for.loop">
      <xsl:with-param name="i">
        <xsl:value-of select="$i + 1"/>
      </xsl:with-param>
      <xsl:with-param name="count">
        <xsl:value-of select="$count"/>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:if>
</xsl:template>

Pagination

Thursday, July 28, 2011

LDAP

  1. LDAP is the Lightweight Directory Access Protocol, is an application protocol for accessing and maintaining distributed server directory information services over an TCP/IP network.
  2. LDAP Servers - Netscape Directory Server, Microsoft Active Directory (AD), Novell Directory Services (NDS), Sun Directory Services (SDS), ucent's Internet Directory Server (IDS)
  3. LDAP uses a client server model, with clients sending LDAP request over TCP/IP to the server.
  4. Stores attribute based data information. Stores these entries in a hierachial structure (i.e., Directory Information Tree(DIT)), based on the unique identifier (Distinguish Name(DN)).
  5. Designed to be read data more than written, such as No transactions or rollback.

Friday, June 10, 2011

ISNULL VS COALESCE

For example Production.Product table records
ClassColorProductNumber
cl1NullNull
cl2NullNull
Nullco3Null
Nullco4Null
NullNullpn5
cl6co6Null
cl7co7pn7

Sunday, May 8, 2011

Debug Directive

If the code is only for development environment not in the live or release environment use Debug Directive or Conditional attribute For exmple, Some of the code only run while in debugggin mode, but you don't want to shift to production server or code to run while in live

If the application/compilation running in the debug mode, then the debug code will execute, but if you complied the same code in the release mode, then debug code will not execute.

In Debug environment, output is
If Debug
No If
Conditional Debug
No Conditional

Sunday, April 3, 2011

Eclipse PHP Development Tools (PDT)

Eclipse is a Java development environment IDE, but it extensions to other languages are C, C++, and JavaScripts.
  1. Go to Help menu -> select Instal New Software
  2. Checked the 'Hide items that are already installed'
  3. Select '--All Available Sites--' list from the 'Work with:' list box.
  4. Go to Web, XML, and Java EE Development checkbox item, Click + sign.
  5. Checked the 'PHP Development Tools(PDT) SDK Feature' checkbox item,
    press Next, and than press Finish button.

Monday, March 21, 2011

JAVA String

  1. Convert to String
    //Integer to String
    int number = 1234;
    String strtoint = Integer.toString(number); //1234
    strtoint = "" + number; //1234
    //Double to String
    strtoint = Double.toString(number); //1234.0
    //Long to String
    strtoint = Long.toString(number); //1234
    //Flot to String
    strtoint = Float.toString(number); //1234.0
    //Binary to String
    strtoint = Integer.toBinaryString(number); //10011010010
    strtoint = Integer.toString(number,2); //10011010010
    //Hexadecimal to String
    strtoint = Integer.toHexString(number); //4d2
    strtoint = Integer.toString(number,16); //4d2

Sunday, February 27, 2011

Checkstyle 5.3

  1. CheckStyle is a tool to help programmers to write JAVA coding standard.
  2. Download and unzip checkstyle-5.3 into a convenient directory.
  3. It is a program to inspect your JAVA source code and list/point out errors that deviate from a defined set of JAVA coding standard.
  4. By default it supports the Sun JAVA Code Conventions (sun_checks.xml), and also support any customize coding standard.
  5. It can be invoked with an ANT task, a command line program and integrated into IDE (Eclipse, IntelliJ, NetBeans) and other tools (TextPad).

Sunday, February 20, 2011

Eclipse and Tomcat Confirguration, Create War.

1)Download and extract Eclipse IDE for Java EE Developers

2)Download and extract or install Apache Tomcat

3)Open your browser, type http://localhost:8080 and verify tomcat is running.