Thursday, November 15, 2012

TOP 10 USEFULL MOBILE APPLICATION

1) UNIVERSAL REMOTES - As smartphones don't have IR emitters, one has to install a dongle. MP3 mobile accessory (Rs 350) to be connected to the phone's 3.5 mm jack. Dijit Universal Remote for iOS needs to be paired with Griffin Technology's Beacon.

2) BUSINESS CARDS - scan business cards and copy the information on the card to the phone as well as on the cloud.
            i) CamCard
            ii) ScanBizCards
            iii) WorldCard Mobile

3) YOUR CAR KEY - This remote key comes in the form of the Viper SmartStart app for iOS, Android and BlackBerry smartphones. But it requires you to have the Viper Smart Start GPS device that costs around $400 (about Rs 21,200). You need to download the free app and pair it with the GPS device.

4) MEASURING TAPES - These commonly use trigonometry to calculate distances while some use GPS, better for irregular surfaces or areas.

5) HEALTH AND FITNESS GUIDES - You can find free yoga, cardio, weight training and other fitness guides in the application markets for Android and iOS.

6) PHYSICAL SWITCHES - This could be a little in the future.
            The Crestron Mobile control app for iPhone, iPad and Android devices does involve a sizable investment but it's worth it if you have the cash to spare.

7) YOUR WALLET - With Near-Field Communication (NFC) hardware coming to smartphones, everyone is expecting a gradual decline in the use of plastic cards and cash.

8) BARCODE AND QR READERS - Barcodes and QR codes are ubiquitous.

9) WI-FI ROUTERS - If you own the latest Android or Windows smartphone, you can use the phone's data connection to create a secure Wi-Fi network of your own. This option is available in your settings menu as 'Wi-Fi hotspot, Internet tethering or Internet sharing'. You can secure this network with a password and connect up to five devices to surf the Net.

10) CABLE TELEVISION - There are apps that enable you to stream live television onto a handset. Zenga TV, ditto TV, mimobiTV, MunduTV are some popular live streaming apps.

Monday, October 29, 2012

The iBATIS frameworks

iBATIS consists of two separate frameworks

1.    Data Mapper framework: specifically for OR mapping, Executes your SQL and maps the results back to .Net domain objects
2.    DAO (Data Access objects) framework: gives your application a clean and consistent way to access underlying data.

Thursday, October 25, 2012

Post data via Jquery ajax and response as Json in asp.net

Populate select list dynamically using jquery ajax postback and return the string from process page as json.

Html page:

// Jquery script to be include in the page
<script type="text/javascript" src="folderpath/jquery-1.8.0.js"></script>

//Html controls on the page
<input type="button" id="btnGo" value="Click to Show Records - JSON"  />

<select id="lstUserList" name="lstUserList" size="12" multiple="multiple">
<option value="" text="none"></option>
</select>


Javascript function:

<script type="text/javascript">

    $(document).ready(function() {
        $('#btnGo').click(function(){
//clearing select options
            $('#lstUserList').empty();

            var hdndata = "test";// data to post for the process page
    
            var post = "hdndata=" + hdndata;
    
            $.ajax({
                type: "POST",
                url: "folderpath/pagename.aspx",
                data: post,
                contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                dataType: "json",
                success: function(msg) {
                    $(outputlist(msg.Table));
                }
            });
        });
    });

    function outputlist(dataTable)
    {
        var listItems = [];
        for (var row in dataTable)
        {
            var strData = '';
            strData = dataTable[row]["LASTNAME"] + ' ' + dataTable[row]["FIRSTNAME"] + ' (' + dataTable[row]["DISPLAYUSERID"] + ')';
            listItems.push('<option class="ACTIVE' + dataTable[row]["CSSCLASS"] + '" value="' + dataTable[row]["USERID"] + '" title="' + strData + '">' + strData + '</option>');
        }
        $('#lstUserList').append(listItems.join(''));
    }
</script> 


Process page:

'Process input parameter and get the result as dataset and pass it to the method ToJson on JsonMethods class
dim ds as new dataset
ds = obj.methodname(parameter)
Response.Write(JsonMethods.ToJson(ds))


Class file:

Imports System.Data
Imports System.Collections.Generic
Imports System.Runtime.Serialization.Json
Imports System.IO
Imports System.Text
Imports System.Web.Script.Serialization

Public Class JsonMethods
    Private Shared Function RowsToDictionary(ByVal table As DataTable) As List(Of Dictionary(Of String, Object))
        Dim objs As New List(Of Dictionary(Of String, Object))()
        For Each dr As DataRow In table.Rows
            Dim drow As New Dictionary(Of String, Object)()
            For i As Integer = 0 To table.Columns.Count - 1
                drow.Add(table.Columns(i).ColumnName, dr(i))
            Next
            objs.Add(drow)
        Next
        Return objs
    End Function

    Public Shared Function ToJson(ByVal table As DataTable) As Dictionary(Of String, Object)
        Dim d As New Dictionary(Of String, Object)()
        d.Add(table.TableName, RowsToDictionary(table))
        Return d
    End Function

    Public Shared Function ToJson(ByVal data As DataSet) As String 
        Dim d As New Dictionary(Of String, Object)()
        For Each table As DataTable In data.Tables
            d.Add(table.TableName, RowsToDictionary(table))
        Next
        Dim json As New JavaScriptSerializer
        json.MaxJsonLength = Int32.MaxValue
        Return json.Serialize(d)
    End Function

End Class

Monday, May 16, 2011

Temp Tables in Sql Server

Four kinds of temp tables

1. Local Temp Table:

Local temp tables are only available to the current connection for the user; and they are automatically deleted when the user disconnects from instances

CREATE TABLE #CRSTYPES(COURSETYPEID TINYINT,COURSETYPENAME VARCHAR(32))

2. Table Variables:

A table variable is created in memory, and so performs slightly better than #temp tables. Table variables are automatically cleared when the procedure or function goes out of scope.

DECLARE @MYSCHEDULE TABLE(SCHEDULEID INT PRIMARY KEY)

3. Global Temp Table:

Global Temporary tables name starts with a double hash ("##").
Once this table has been created by a connection, like a permanent table it is then available to any user
by any connection. It can only be deleted once all connections have been closed.

CREATE TABLE ##CRSTYPES(COURSETYPEID TINYINT,COURSETYPENAME VARCHAR(32))

4. Common Table Expression (CTE) Varaible:

with exmp (COURSETYPEID, COURSETYPENAME) as
(
SELECT COURSETYPEID,COURSETYPENAME FROM COURSETYPES WHERE COURSETYPEID IN (17,18)
)
select * from exmp
select * from exmp WHERE COURSETYPEID IN (17)


Storage Location of Temporary Table

Temporary tables are stored inside the Temporary Folder of tempdb.
Whenever we create a temporary table, it goes to Temporary folder of tempdb database.

Using Temporary Tables Effectively

If you do not have any option other than to use temporary tables, use them effectively. There are few steps to be taken.

  • Only include the necessary columns and rows rather than using all the columns and all the data which will not make sense of using temporary tables. Always filter your data into the temporary tables.
  • When creating temporary tables, do not use SELECT INTO statements, Instead of SELECT INTO statements,create the table using DDL statement and use INSERT INTO to populate the temporary table.
  • Use indexes on temporary tables. Earlier days, I always forget to use a index on temporary. Specially, for large temporary tables consider using clustered and non-clustered indexes on temporary tables.
  • After you finish the using your temporary table, delete them. This will free the tempdb resources. Yes, I agree that temporary tables are deleted when connection is ended. but do not wait until such time.
  • When creating a temporary table do not create them with a transaction. If you create it with a transaction, it will lock some system tables (syscolumns, sysindexes, syscomments). This will prevent others from executing the same query.
  • Use the table variables instead of the temporary tables whenever possible.
  • Try to avoid using temporary tables inside your stored procedure.
  • Try avoiding using insensitive, static and keyset cursors whenever possible.
  • Use multi-statement table-valued functions to eliminate temporary table usage for intermediate result processing.
  • Try to avoid using temporary tables by rewriting your Transact-SQL statements to use only standard queries or stored procedures.
  • Use the derived tables or correlated sub-queries instead of the temporary tables whenever possible.
  • Use local temporary tables instead of SQL Server cursors.
  • Avoid creation temporary tables from within a transaction.
  • Avoid using global temporary tables.
  • Consider creation a permanent table instead of using temporary tables.
  • Because all temporary tables are stored in the tempdb database, consider spending some time on the tempdb database optimization.
  • Set a reasonable size for the tempdb database and a reasonable autogrow increment.

Saturday, December 13, 2008

The 10 best IT certifications

MCITP Microsoft Certified IT Professional credential
Track:
  1. Database developer,
  2. Database administrator,
  3. Enterprise messaging administrator, and
  4. Server administrator
MCTS - Microsoft Certified Technology Specialist
Track:
  1. SQL Server 2008 Business Intelligence
  2. SQL Server 2008 Database Development
  3. SQL Server 2008 Implementation and Maintenance
Security+ - CompTIA’s Security+
MCPD - Microsoft Certified Professional Developer
Track:
  1. Windows Developer 3.5
  2. ASP.NET Developer 3.5 and
  3. Enterprise Applications Developer 3.5
CCNA - Cisco Certified Network Associate
A+ - CompTIA’s A+
PMP - Project Management Professional
MCSE/MCSA - Microsoft Certified Systems Engineer/Microsoft Certified Systems Administrator
CISSP - Certified Information Systems Security Professional
LINUX+