Dec 17, 2012

How to make VMWare stop syncing your guest clock with your host

If you want the time in your vmware OS to persist through suspend, resume, reboot, etc. add these properties to your .vmx file:

tools.syncTime = FALSE
time.synchronize.continue = FALSE
time.synchronize.restore = FALSE
time.synchronize.resume.disk = FALSE
time.synchronize.shrink = FALSE
time.synchronize.tools.startup = FALSE

This will pretty much prevent your VM from ever syncing its clock with your host.

Reference: http://blog.thetoast.net/2009/03/make-vmware-stop-syncing-your-guest.html

Feb 2, 2012

Setting up Subversion on Windows through SVN protocol

This document explains how to setup Subversion on Windows through SVN protocol (svn:///)
(Click the link below)

Setting up Subversion on Windows



--

Nov 14, 2011

Call a client side javascript method after a specific update panel has been loaded

<script type="text/javascript"> 
    $(document).ready(function() { 
    panelsLoaded = 1;
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(PageLoaded) }); 

    function PageLoaded(sender, args) { 
        console.log("I have occured " + panelsLoaded++ + " times!"); 
        var panelsCreated = args.get_panelsCreated(); 
        for (var i = 0; i < panelsCreated.length; i++) 
        { 
            console.log("Panels Updating: " + panelsCreated[i].id); 
        } 
        var panelsUpdated = args.get_panelsUpdated(); 
        for (var i = 0; i < panelsUpdated.length; i++) 
        { 
            console.log("Panels Updating: " + panelsUpdated[i].id);
        }
    } 
</script>

Just add all the scripts in the PageLoaded() function.



Nov 2, 2011

Watch hulu outside US

http://lifehacker.com/5583515/access-hulu-from-outside-the-us-without-a-proxy-server



Jun 16, 2011

Insert multiple rows of Data in SQL server using XML

The XML must be like:


<surveys>
    <survey SurveyId="#SurveyId#"
            QuestionId="#QuestionId#"
            Answer="#Answer#"
            UserId="#UserId#"
            UserName="#UserName#"/>
    <survey SurveyId="#SurveyId#"
            QuestionId="#QuestionId#"
            Answer="#Answer#"
            UserId="#UserId#"
            UserName="#UserName#"/>
    <survey SurveyId="#SurveyId#"
            QuestionId="#QuestionId#"
            Answer="#Answer#"
            UserId="#UserId#"
            UserName="#UserName#"/>
</surveys>

This XML must be passed as argument to stored procedure. Create a stored procedure and pass the XML document as a parameter. In the example below @XMLDOC is a string variable with the actual XML passed to it.


DECLARE @xml_hndl INT

--prepare the XML Document by executing a system stored procedure
EXEC SP_XML_PREPAREDOCUMENT @xml_hndl OUTPUT, @XMLDOC

BEGIN TRY
    BEGIN TRANSACTION
        INSERT INTO SurveyResponse

        SELECT SurveyId, 
               QuestionId, 
               Answer, 
               UserId, 
               UserName, 
               GETDATE(), 
               GETDATE()
        FROM
        OPENXML(@xml_hndl, '/surveys/survey', 1)
        WITH
         (
             SurveyId BIGINT '@SurveyId',
             QuestionId BIGINT '@QuestionId',
             Answer INT '@Answer',
             UserId VARCHAR(100) '@UserId',
             UserName VARCHAR(200) '@UserName'
         )

        SET @return = 1
    COMMIT
END TRY
BEGIN CATCH
    ROLLBACK
    SET @return = 0
END CATCH


Mar 25, 2011

Attach excel to SQL Server DB as linked server

Query to attach excel to DB as linked server.

EXEC sp_addlinkedserver 'ImportData',
                        'Jet 4.0', 'Microsoft.Jet.OLEDB.4.0',
                        'D:\Working\Web_Analytics_Requirements.xls',
                        NULL,
                        'Excel 8.0'
GO
--ImportData is the name of new linked server
--D:\Working\Web_Analytics_Requirements.xls is the path to excel
--Excel 8.0 is for MS office 2003

To insert the spreadsheet as a table in database

INSERT INTO dbo.ImportTest
SELECT *
FROM OPENQUERY(ImportData, 'SELECT * FROM [Summary$]')
--ImportData is the name of linked server
--Summary is the name the spreadsheet

To directly fetch values from linked server (excel file)

SELECT * FROM ImportData...Summary$