Varia - MS Windows

Record sound from the sound card

http://www.sevenforums.com/tutorials/20595-what-u-hear-recording-enable.html

Varia - Firefox

All versions of Firefox

https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/

Selenium 2 - Add Selenium jar file in Eclipse

Add Selenium jar file in Eclipse

  • Import selenium library into your project.
  • Right-click on your project and navigate to Build Path->Configure Build Path.
  • On the Libraries tab, click on the Add JARs... button and select selenium jar file.

Javascript - Programmatically create JSON structure using javascript

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 
    <script type="text/javascript">
 
      /*********************************************************
       Programmatically create JSON structure using javascript.
       *********************************************************/
      function displayResults()
      {
        // Define root node.
        var jsonData = {

MS Office

MS Excel

Remove the grid in excel:

  1. Select cells that you want to remove the grid.
  2. Change the background color to white.

Bash - Remove duplicate lines in file

gawk " !x[$0]++" inputfilename.txt > outputfilename.txt

Perl - Variables

#!/usr/local/bin/perl
 
# Example showing how to define different variables.
# ==================================================
 
my $someString="Hello World!";  # Variable holding a string.
my $someNumber=3.1415;          # Variable holding a number.
my @someArray =("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
 
# Output all the variables defined.
$someNumber = $someNumber*2;
print "$someString\n";
print "$someNumber\n";
print "@someArray\n";

Perl - Installation and setup of Perl

  1. Download Windows version of Perl at ActiveState.
  2. Install it.
  3. Save the following code in a file and name it tutorial.perl .
    #!/usr/local/bin/perl
    print 'Hello world.';		# Print a message    
     
  4. Open the Command Prompt.
  5. Execute the following command:
    perl tutorial.perl
     
  6. It should display Hello world..

DOS - Padding zeros

@ECHO OFF
 
SET i=1
FOR /L %%V IN (1,1,1003) DO (
CALL :Increment
)
 
ECHO "Done showing zero padding."
 
GOTO :EOF
 
:Increment
  REM Padding zeros
  SET filename=%i%
  if %i% lss 1000 set filename=0%i%
  if %i% lss 100 set filename=00%i%
  if %i% lss 10 set filename=000%i%
 
  ECHO %filename%.txt
 
  SET /a i+=1
  GOTO :EOF

Output will look like:
....
0889.txt
0890.txt
0891.txt
0892.txt
0893.txt
0894.txt
0895.txt
....

Varia - WinMerge useful setting

I don't know why, by default, WinMerge is set to show the difference on word level. It should be on Character level. Every time that I install it, I have to change this setting.
The setting is located at Edit->Options->Editor->Line Difference Coloring. Check Character level.

Syndicate content