Archive for May, 2010

Napal bomb burned a Vietnamese girl

How to install NAntContrib after download it?

Well, it’s so funny that there’s no clue to install it in the package downloaded from their homepage. As one guy felt angry with it here AngryPets.com :: Blog, I felt angry too ^_^!

So, very simple, the solution is just “Just copy everything in the NantContrib\bin directory into Nant\bin“.

Another way is to add some below script to the beginning of your NAnt script, says that you installed NAntContrib to “C:/Program Files/NAntContrib“.

<loadtasks>
	<fileset>
		<include name="C:/Program Files/NAntContrib/bin/**/*.dll" />
	</fileset>
</loadtasks>

D… it NAntContrib :D.

A free SVN-supported project hosting

If you ever have a project or simply just a folder that you wanna share with your partners so as any of you can get/update the files and sync them with other members in the group? Normally we need to set up an SVN server for that.

Well, lately, one of my colleages tell me that we can use Google’s Project Hosting service called Project Hosting on Google Code at http://code.google.com/hosting!

Now I can have an svn-synced folder whenever I want for free! It’s just so cool! ^_^

Just another way to listen to music on Amazon MP3

If you love the music from Amazon MP3 as me but do not have a valid credit card (like me again :D), then here is a small tip to get through it:

  1. Get the name/artist/album of the  music from mp3.amazon.com
  2. Go to www.nhaccuatui.com to download it ^_^

That’s just that! Enjoy!

 

How to run WinMerge to comapre 2 files when triggering from a hyperlink click?

Try the below scripts. Note that the web browser must allow Javascript and ActiveX to run.

<html>
    <head>
        <script type="text/javascript">
        function runProgram()
        {
            var shell = new ActiveXObject("WScript.Shell");
            var appWinMerge = "\"C:\\Program Files\\WinMerge\\WinMergeU.exe\" /e /s /u /wl /wr /maximize";
            var fileLeft = "\"D:\\Path\\to\\your\\file\"";
            var fileRight= "\"D:\\Path\\to\\your\\file2\"";
            shell.Run(appWinMerge + " " + fileLeft + " " + fileRight);
        }
        </script>
    </head>

    <body>
        <a href="javascript:runProgram()">Run program</a>
    </body>
</html>

Another version with input argument for the function call:

<html>
    <head>
        <script type="text/javascript">
        function runProgram(fileLeft, fileRight)
        {
            var shell = new ActiveXObject("WScript.Shell");
            var appWinMerge = "\"C:\\Program Files\\WinMerge\\WinMergeU.exe\" /e /s /u /wl /wr /maximize";
            shell.Run(
				appWinMerge
				+ " " +"\""+fileLeft +"\""
				+ " " +"\""+fileRight +"\""
			);
        }
        </script>
    </head>
    <body>
        <a href="javascript:runProgram('Path\\to\\your\\file', 'Path\\to\\your\\file2');">Run program</a>
    </body>
</html>

How to force opening a local HTML file by Internet Explorer?

Modify your HTML like below:

<html>
	<head>
		<script type="text/javascript">
		function runProgram()
		{
			var shell = new ActiveXObject("WScript.Shell");
			shell.Run("\"C:\\Program Files\\Internet Explorer\\IExplore.exe\" http://www.google.com");
		}
		</script>
	</head>

	<body onload="runProgram()">
		<!--Your HTML content-->
	</body>
</html>

Enjoy!

How can I run a program in a HTML script?

source: http://www.vandyke.com/support/securecrt/004.html

You cannot run programs directly in an ActiveX script however if you have Microsoft’s Windows Script Host (WSH) installed you can tell WSH to run it for you.

The following VBScript statements use WSH to start Internet Explorer with a command-line argument:

Dim shell
Set shell = CreateObject(“WScript.Shell”)
shell.Run “””C:\Program Files\Internet Explorer\IExplore.exe””http://www.vandyke.com

Here’s the same thing in JScript:

var shell = new ActiveXObject(“WScript.Shell”);
shell.Run(“\”C:\\Program Files\\Internet Explorer\\IExplore.exe\”http://www.vandyke.com“);

Note, the Run() function uses whitespace to separate program names from possible command-line arguments. In order to deal with paths with spaces it is necessary to add extra quotes in both languages to make it clear.

For information and downloads related to WSH look for the “Windows Script Host” section at:

http://msdn.microsoft.com/en-us/library/ms950396.aspx

Enjoy!