Gitblit on Linux VM

Installed a nice git repo viewer on my linux VM :

http://www.puschitz.com/InstallingTomcat.html
http://gitblit.com/setup.html

Posted in Uncategorized | Leave a comment

Miniature train set at Boston South Station

Video captured with Pentax K-01. Image sequences edited with Matlab’s image processing toolbox. Audio extracted with Xilisoft. Final video made with Avidemux. **

**Unfortunately, all the software and scripts in the world cannot make up for poor video-taking skills.

Posted in Uncategorized | Leave a comment

A toolsmith

“In contrast with many engineers who make houses, cars, medicines, and clothing for human need and enjoyment, we make things that do not themselves directly satisfy human needs, but which others use in making things that enrich human living. In a word, the computer scientist is a toolsmith—no more, but no less.It is an honorable calling. 

If we perceive our role aright, we then see more clearly the proper criterion for success: a toolmaker succeeds as, and only as, the users of his tool succeed with his aid. However shining the blade, however jeweled the hilt, however perfect the heft, a sword is tested only by cutting. That swordsmith is successful whose clients die of old age.”

Source: http://www.cs.unc.edu/~brooks/Toolsmith-CACM.pdf

Posted in Uncategorized | Leave a comment

Starting ParaView Client and Server for head-tracking (Windows)

Optional (on a machine with single processor, probably not needed – changes depending on ParaView implementation):

  1. Install MPICH2 (binaries sufficient) http://www.mcs.anl.gov/research/projects/mpich2/
  2. Configure ParaView to use MPI in CMake (turn PARAVIEW_USE_MPI flag on)
  3. Rebuild ParaView

Start ParaView Server:

  • with MPI:
    • Open your favorite command-line interpreter. For the following commands, replace the path with one that uses the correct shell path separator
    • Command:
      cd PATH_TO_MPI
      mpiexec.exe -np NUM_PROCESSORS PATH_TO_PARAVIEW_BIN\pvserver.exe PATH_TO_CAVE\cave.pvx
    • PATH_TO_MPI = Path to mpiexec.exe, e.g. C:\Program Files (x86)\MPICH2\bin\
    • NUM_PROCESSORS = number of processors to be used by ParaView Server
    • PATH_TO_PARAVIEW_BIN = e.g. C:\User\<user_name>\Documents\EVE\Collab\CompiledParaView\bin\Debug\
    • PATH_TO_CAVE = e.g. C:\User\<user_name>\Documents\EVE\Collab\ParaView
  • without MPI:
      • Open your favorite command-line interpreter. For the following commands, replace the path with one that uses the correct shell path separator
      • Command:
        PATH_TO_PARAVIEW_BIN\pvserver.exe PATH_TO_CAVE\cave.pvx

The commands above will result in:

Waiting for client…
Connection URL: cs://<machine_name>:11111
Accepting connection(s): <machine_name>:11111

Start VRPN Tracking Server: http://www.vrgeeks.org/vrpn/tutorial—use-vrpn#TOC-Configuring-VRPN-server

Start ParaView Client:

** Actually a large part of the panel will be blocked by the ParaView Splash image. The Splash Image can be disabled using the ParaView Setting panel. Just start the standard ParaView application (with the built-in server) and disable the Splash image before starting the server and client separately. http://www.paraview.org/Wiki/ParaView/Users_Guide/Settings

Posted in Uncategorized | Tagged | Leave a comment

Attempt to create Dock Window to configure VR connections in ParaView

Standard way of adding a QDockWidget to a Plugin in ParaView:

  1. Look at ParaView/Examples/Plugins/DockWidget
  2. Use the ADD_PARAVIEW_DOCK_WINDOW macro defined in ParaView/CMake/ParaViewPlugins.cmake
  3. Result of the CMake macro: a file called ${ARG_CLASS_NAME}Implementation.h (which implements the pqDockWindowInterface) is created and compiled into the Qt project via the Qt Meta Object Compiler *
  4. pqPluginDockWidgetsBehavior calls each pqDockWindowInterface::dockWidget to create an instance of the plugin-specific class that extends QDockWidget

Problem: pqVRConfigPanel, which extends QDockWidget, is not aware of VR Plugin instance, and VR Plugin instance is not aware of pqVRConfigPanel class. The QDockWidget signals cannot be connected VR Plugin slots.

Solution attempt 1:

  1. Make pqVRStarter implement pqDockWindowInterface.
  2. Create dockWidget in the pqVRStarter::onStartup() slot. I.e. invoke pqVRStarter::dockWidget() with pqCoreUtilities::mainWidget() as parent parameter (pqCoreUtilities::mainWidget() returns the QMainWindow of the application)

Result:

Runtime error because pqVRStarter::onStartup() is called before ParaViewMainWindow (which extends QMainWindow) is finalized. The dockWidget could not be properly embedded in the UI.

Solution attempt 2 (to do):

  1. Edit VR Plugin’s CMakeLists.txt to register the CMake-generated pqVRStarterImplementation as a pqDockWindowInterface. This may create the VR Plugin’s QDockWidget at the same time as the other QDockWidget’s creation in pqPluginDockWidgetsBehavior

* Qt prohibits a class that inherits from a Qt class to contain multiple inheritance since Qt classes are not implemented via  virtual inheritance. To work around this, Qt interface can be used http://www.qtforum.org/article/13381/multiple-inheritance-and-qobject.html

** CMake Macro for creating pqDockWindowInterface:

# create implementation for a dock window interface
# ADD_PARAVIEW_DOCK_WINDOW(
# OUTIFACES
# OUTSRCS
# CLASS_NAME classname
# [DOCK_AREA areaname]
#
# CLASS_NAME: is the name of the class that implements a QDockWidget
# DOCK_AREA: option to specify the dock area (Left | Right | Top | Bottom)
# Left is the default
MACRO(ADD_PARAVIEW_DOCK_WINDOW OUTIFACES OUTSRCS)
SET(ARG_DOCK_AREA)
PV_PLUGIN_PARSE_ARGUMENTS(ARG "CLASS_NAME;DOCK_AREA" "" ${ARGN} )
IF(NOT ARG_DOCK_AREA)
 SET(ARG_DOCK_AREA Left)
 ENDIF(NOT ARG_DOCK_AREA)
 SET(${OUTIFACES} ${ARG_CLASS_NAME})
CONFIGURE_FILE(${ParaView_CMAKE_DIR}/pqDockWindowImplementation.h.in
 ${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.h @
ONLY)
 CONFIGURE_FILE(${ParaView_CMAKE_DIR}/pqDockWindowImplementation.cxx.in
 ${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.cxx
 @ONLY)
GET_DIRECTORY_PROPERTY(include_dirs_tmp INCLUDE_DIRECTORIES)
 SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${QT_INCLUDE_DIRS};${
PARAVIEW_GUI_INCLUDE_DIRS}")
 SET(ACTION_MOC_SRCS)
 QT4_WRAP_CPP(ACTION_MOC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Impl
ementation.h)
 SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${include_dirs_tmp}")
SET(${OUTSRCS}
 ${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.cxx
 ${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.h
 ${ACTION_MOC_SRCS}
 )
ENDMACRO(ADD_PARAVIEW_DOCK_WINDOW)
Posted in Uncategorized | Tagged | Leave a comment

C++ STL Hashmaps

Note:  STL here refers to SGI STL , not to be confused with the C++ Standard Library , which only recently include hash maps/sets in C++11 . For pre-C++11 users, hash maps/sets are included under the name unordered_map/unordered_set in std::tr1 as explained in the article:

From: http://www.drdobbs.com/cpp/c-stl-hash-containers-and-performance/198800559

tl;dr: 

hash_maps store key/value pairs that have unique keys.
hash_sets store unique values.
hash_multimaps store key/value pairs with nonunique keys.
hash_multisets store nonunique values  

When to use hash functions: 
===========================
trade offs - how often do the key/value pair change 
vs frequency & performance of accesses 
vs memory allocation
Hash function:
==============
Most primitives hash to themselves: integers, 
characters, and longs all simply cast to size_t

SizeTCastHasher - hash based on memory location

ShiftedPairHasher - hash a pair of integers 
(bitwise shift first integer, then XOR, to fit 
both integers in a size_t)  
Memory allocation: 
==================
Map --> RB tree , a few pointers, 
Hashmap - 193 buckets  

Must Benchmark: 
===============
Hash function calculation time 
vs hash function collision resolution  

Boost: 
======
hash_combine

Posted in Uncategorized | Leave a comment

Protected: Collaboration Workbench Transition notes

This content is password protected. To view it please enter your password below:

Posted in Uncategorized | Tagged ,