Archive for 2009 November

  • How to Integrate another Website to Google Analytics Tracking and Adsense

    2009
    30
    Nov

    This was supposed to be obvious, but I couldnt find easily how to integrate Google Adsense and Analytics to track your Adsense Ad performance on google analytics. Make sure you display ads on your page and the analytics tracking code. Make sure you have linked the adsense and analytics together before doing this. The following is to add one more site to track adsense.

    And then Getting straight to the answer, put the following script on the head.

    <script type="Text/javascript">window.google_analytics_uacct = "UA-XXXXXX-X";</script>

    Read More

  • Perl script to remove a directory and contents recursively

    2009
    26
    Nov
    2

    This is the script for sandeep when he asked me how to delete a directory in perl. rmdir function only removes empty directories. So we need to remove the contents of the directory before removing the directory. So if the directory contains more directories / folders we would have to recursively delete all the directories under the directory. Well so here is the code just to do that.

    Read More

  • Installing Google Go on Linux Ubuntu

    2009
    22
    Nov
    1

    One command install, Bash script to install Google Go in one Go

    #!/bin/bash
    ARCH=386 #CHANGE this setting to amd64 if you are on 64 bit.
    sudo apt-get install bison make gcc libc6-dev ed mercurial
    {
    cat ~/.bashrc; cat <<EOF
    export GOROOT=$HOME/go
    export GOARCH=$ARCH
    export GOOS=linux
    export GOBIN=$HOME/gobin
    export PATH=$PATH:$GOBIN
    EOF
    }  > ~/temp.bashrc
     
    mv ~/.bashrc ~/.bashrc.old
    mv ~/temp.bashrc ~/.bashrc
     
    export GOROOT=$HOME/go
    export GOARCH=$ARCH
    export GOOS=linux
    export GOBIN=$HOME/gobin
    export PATH=$PATH:$GOBIN
     
    mkdir $GOBIN
    hg clone -r release https://go.googlecode.com/hg/ $GOROOT
    cd $GOROOT/src
    ./all.bash

    Read More

  • Google Go HelloWorld Example Program

    2009
    22
    Nov

    code

    File : hello.go

    package main
    import "fmt"
     
    func main() {
    	fmt.Printf("Hello World !!! \n")
    }

    Compiling & Running

     8g hello.go 
     8l hello.8
     ./8.out

    Output

    Hello World !!!

    (Obviously Grinning )



  • Remove a reference to a DLL or COM Component Object file in VB.Net

    2009
    15
    Nov

    A reference to 'XXXXX.dll' could not be added. A reference to the component 'XXXXX.dll' already exists in the project.

    This occurs when you add 2 versions of the same dll into your project. Before adding a reference to a new DLL you have to remove the reference to the existing library. This is not obvious on vb.net in visual studio. There is a Project > Add Reference. But how do you remove the reference ?

    Read More

  • Adding HTML elements dynamically to a page

    2009
    11
    Nov

    So when I was sitting idle, moosa asked me how to add dynamic textboxes into a form without loosing values of the form values on the previous textboxes.

    So I thought of documenting the method here just in case anyone of you might want this.

    So we have a form with a text box as shown below :

    :

    The goal is to add a form as shown below, Clicking the Add More link will add more input boxes to the html form dynamically.

    Read More

  • CHM Files Navigation to the webpage was cancelled

    2009
    11
    Nov
    3

    Does this window appear when you open CHM files ?
    CHM Navigation to the Webpage was cancelled

    This happend to me after upgrading to Internet Exporer 7.

    If you are wondering why you cant read the CHM files, just do the steps below :

    • Close the CHM file
    • Open it again and you will get the same popup as shown below
    Read More

  • Changing the default Boot OS in GRUB on Ubuntu 9.10

    2009
    08
    Nov
    15

    Ubuntu 9.10 ships with the new GRUB (Grand Unified Boot Loader 1.97 beta) in plain words its the software that boots the operating system you choose when you boot the computer. In earlier versions of Ubuntu / Grub to change the menu on the grub screen, one had to edit the /boot/grub/menu.lst file. In the new system this a little different from just editing the one file.

    The GRUB configuration now resides at /boot/grub/menu.cfg But do not edit this file as it is generated from files from /etc/grub.d/* and /etc/default/grub.

    Read More

  • Optimize Javascript files with Google Closure compiler

    2009
    06
    Nov

    Google has released / open sourced one of its internal tools, the javascript closure compiler. The closure compiler is used to optimize javascript files. It works by analyzing the code and removing redundancies and shortening variable names.
    This tool can be used to compress javascript files, (similar to the famous packer), results in lesser code to download, execute, obfuscation and faster user experience.

    Read More

  • Photoshop Resize Batch images in a directory

    2009
    02
    Nov
    Nowadays most camera's produce so big photos like you could make a big banner with those. Inorder to upload photos to web to photo sharing services like Flickr or Picasa, or Social Networking sites such as Orkut and Facebook, we should reduce the image resolution ie (Width & Height) scale down the image so that it can be uploaded quick and easily. For those who have photoshop CS3 installed, there is a quick and easy way to scale the images in a batch. This is so simple you needn't be a tech savvy to do this. First open Photoshop.
    Read More