Java : Running executables 03 February 2003 at 00:00
try {     
  Runtime r = Runtime.getRuntime();
  Process p = r.exec("code.exe");
  InputStream in = p.getInputStream();               
  BufferedReader br = new BufferedReader(new InputStreamReader(in));                         
  while (true) {
    String str = br.readLine();
    if (str == null) break;
    System.out.println(str);
  }                         
}
catch ( Exception ee) {
  ee.printStackTrace();
}                            
Binary decimal conversions 21 February 2003 at 00:00
Converting binary to decimal

Given the binary value 1000:

1000 
  = 1 * 23 + 0 *22 + 0 * 21 + 0 * 20
    = 23
      = 8 (decimal)

Converting decimal to binary

Given the decimal value 10:

10
  = 23 + 21 
    = 1 * 23 + 0 * 22 + 1 * 21 + 0 * 20 
      = 1010 (binary)
An easier way to work this out is, for example (given a decimal number of 11): divide the decimal number by 2, recording the quotient and remainder in the next row, rounding the quotient DOWN each time, until you have a quotient of 0.

  Quotient Remainder  
  11    
Repeat the procedure - divide by 2, record quotient and remainder in the next row 5 1 11/2 = 5 remainder 1
 Repeat again 2 1 5/2 = 2 remainder 1
 Repeat again 1 0 2/2 = 1 remainder 0
 Stop!  Quotient = zero 0 1 1/2= 0 remainder 1

Result: (read from bottom up) Decimal value 11 = binary 1011

Mounting foreign folders and devices on Windows 20 February 2003 at 00:00

Mounting a folder on an NT Machine visible on the Network Neighbourhood

  mkdir /mnt/targetfolder
  /usr/bin/smbmount //NTMachineName/folder /mnt/targetfolder -o username=xxx,password=yyy