Monday, 14 May 2012

Camera Clinic - Travel Photography by Randall Warniers


  • Carry a camera with you wherever you go
  • Four factors for successful photography: Camera + Light + Decisive Moment + Point of View
  • Four fundamental rules
    • Know our equipement thoroughly
    • Notice the light
    • Be prepared to photograph quickly
  • Natural light in the early morning and in the late afternoon when the sun is low in the sky, is best for people photography.
    • People photography in the middle of a sunny day is bad.
    • A bright sunny day is good for architecture.
    • Hazy light, overcast day, cloud over the sun is best for people photography.

Thursday, 3 May 2012

Enable Spell Check in TeXlipse


  • Find the dictionary for the language of your choice. You can use Aspell to create the dictionary:
    aspell --encoding=UTF-8 --lang=<lang> dump master > <lang>.dict
    
    where lang is the language code. Some common language codes are:
    • English: en
    • German: de
    • French: fr
    • Spanish: es
    • Finnish: fi
  • Set the Latex Project Properties under project properties
    • Set the two-letter language code
Sources:

Wednesday, 2 May 2012

Common routines after reinstalling Ubuntu

The following routines may be necessary after reinstalling Ubuntu to reconfigure your environment.

  1. Activate additional drivers in "Additional Drivers" for your GPU.
  2. Display
    • For AMD's (formerly ATI) graphics card, you can use AMD Catalyst Control Center (Administrative) to configure for multi-display. However, when I used it today, it didn't work. Using command line works though.
      $ sudo aticonfig --initial # This reinitializes your xorg.conf.
      # Then when you reboot, you should be able to configure multi-display with
      $ sudo gksu amdcccle
      
    • Use ARandR do configure display
  3. Install Chrome dev release.
  4. Install Sun Java 6 and OpenJDK Java SDK
    sudo apt-add-repository ppa:flexiondotorg/java
    sudo apt-get update
    sudo apt-get install sun-java6-jre sun-java6-plugin
    
    sudo apt-get install openjdk-6-jdk
  5. Install git.
  6. Install OpenAFS.
  7. Install Latex.
    $ sudo apt-get install texlive-full
    Update Texlipse's preference in Eclipse by giving the bin directory of Tex distribution: /usr/bin
  8. Install ssh server.
    $sudo apt-get install openssh-server
    

Tuesday, 24 April 2012

Painting in AWT and Swing

AWT stands for abstract windowing toolkit. When the original AWT API was developed for JDK 1.0, only heavyweight components existed ("heavyweight" means that the component has its own opaque native window). Lightweight components are introduced in JDK 1.1 (a "lightweight" component is one that reuses the native window of its closest heavyweight ancestor). There are subtle differences in how painting works for heavyweight and lightweight components.

Swing Painting Guidelines

  1. For Swing components, paint() is always invoked as a result of both system-triggered and app-triggered paint requests; update() is never invoked on Swing components.
  2. Programs may trigger a future call to paint() by invoking repaint(), but shouldn't call paint() directly.
  3. On components with complex output, repaint() should be invoked with arguments which define only the rectangle that needs updating, rather than the no-arg version, which causes the entire component to be repainted.
  4. Swing's implementation of paint() factors the call into 3 separate callbacks:
    1. paintComponent()
    2. paintBorder()
    3. paintChildren()
    Extensions of Swing components which wish to implement their own paint code should place this code within the scope of the paintComponent() method (not within paint()).
Reference:

Tuesday, 17 April 2012

Some computational geometry terminologies

Convex hull
The convex hull of a set of points X can be visualized as the shape of a rubber band stretched around X. It is the smallest enclosing convex polygon of the set X in the plane.

Getting Started with Kinect for Windows SDK

I have been experimenting with Kinect for Windows SDK and here are the steps to get things started.

1. Download and install the Kinect for Windows SDK. Follow the system requirements and installation instructions on the website. The main software requirements are Visual Studio 2010 Express or other Visual Studio 2010 edition and .NET Framework 4.0.

2. To get started with the development, I find the Quickstart Series are very helpful.

3. Some other details about the API:
  • In the depth map, each pixel is labeled with a number from 1 to 7 to indicate that it is part of user 1, 2, and so on up to 7. If a pixel is not part of a user then it is assigned index of zero. Each pixel is a short value. We can extract the player index and the depth using the following:
    userIndex = s & DepthImageFrame.PlayerIndexBitmask; // The mask is 0x07.
    depth = ((ushort) s) >> DepthImageFrame.PlayerIndexBitmaskWidth; // The width is 3.
    
  • Depth values are in mm.
  • There are 20 joints in the skeleton tracking.

Monday, 12 March 2012

CoffeeScript

== vs ===
Because the == operator frequently causes undesirable coersion, is intransitive, CoffeeScript compiles == into ===, and != into !==. In addition, is compiles into ===, and isnt into !==.

A good explanation of the difference between == and === in JavaScript is here.

=> vs ->
=> is the "bound" function operator". When this/@ variable is used in a function, you need to think carefully about which context you want this variable to be bound to. When -> is used, this/@ will refer to whichever the current context is when the function is called; when => is used, this/@ always refers to the context when the function is defined.