Home
Projects
Software
Tips and Tricks
6.001
Photos
 

[old presentations]
[old FAQs]

Tips and Tricks

This page is meant to document various tidbits, tips, and tricks.  The items are loosely organized and most are here for my personal benefit.

  1. Coding
    1. Matlab
      1. Reading/writing videos: use my videoIO library.
         
      2. Simple temporal median filtering for deinterlacing (idea from the Simulink deinterlace filter documentation). Assumes the top line is older than the next line.
        for newline=2:2:size(frame,1)-1
          frame(newline,:,:) = median(frame(newline-1:newline+1,:,:), 1);
        end
      3. Trying to understand why Matlab includes the extra borders when using PRINT, HARDCOPY, GETFRAME, or copying figures to the clipboard?  Here are some hints as to why it's often a good thing and also how to override it if you want. [pptx][pdf]
         
    2. C++
      1. Add vertical guidelines (telling you where column 80 is, for example) to Visual Studio. Registry files for VS2005 and VS2008 (don't use these if you don't know the risks involved with modifying the Windows registry).
         
      2. Use auto_ptr to simplify pointer deletion
         
      3. The C++ Annotations are a good reference on basic C++ and using its most common unique features properly.
         
      4. Building boost 1.34.1 for Visual Studio
        1. Download boost and the latest bjam
        2. Get auto_link.hpp and modify user-config.jam from this discussion.
        3. Make the changes to msvc.jam, visualc.hpp, named_slot_map.hpp, and named_slot_map.cpp, as suggested in this discussion (search for msvc.jam).
        4. bjam --toolset=msvc-9.0 install --without-python
        5. Go do something else for an hour or two...
        6. Manually create links to the bin.v2 directory (cygwin shell used here)
          cd $BOOST_ROOT/bin.v2/libs
          cp `find . -name *.lib` $BOOST_ROOT/lib/
          cp `find . -name *.dll` $BOOST_ROOT/lib/
          
    3. Subversion
      1. ignore whitespace using
        alias svndw='svn diff --diff-cmd colordiff -x -uw'
  2. Editors
    1. emacs
      1. To turn off wordwrap in the current buffer, type M-x toggle-truncate-lines.
      2. To reflow the current paragraph, type M-q.
         
  3. LaTeX
    1. AMSMath guide
       
  4. GNU / Linux / Unix
    1. Debian
      1. To reconfigure an already-installed package <pkg>, run dpkg-reconfigure <pkg>.
         
      2. Installing distmake (a distributed version of make)
        cd /tmp
        wget http://superb-west.dl.sourceforge.net/sourceforge/distmake/distmake-0.5.tar.gz
        gunzip distmake-0.5.tar.gz && tar -xf distmake-0.5.tar && sudo mv distmake /usr/local/src 
        cd /usr/local/src/distmake && ./configure && make -j3 && sudo make install
        export DISTMAKE_RSH='ssh -x ' # put this in your shell init file
        
        Note: when you break out of distmake, it often doesn't actually kill the running jobs.  You'll probably have to manually kill them.
         
    2. X-Windows
      1. Nice xterm:
        /usr/X11R6/bin/xterm -sl 9999 -sb -rightbar -bg white -fg black -j -e /bin/bash -l &

       

  5. PowerPoint and videos

    PowerPoint is very temperamental when it comes to playing videos.  I have found that various workarounds work for different versions of Windows and/or PowerPoint.  Here is a set of things to try if your videos don't play:
     

    1. Try playing the video in Windows Media Player.  If it fails to play, you probably need to install the right codec.  Use a program like GSpot to help you figure out what codec you need.  An easy solution is often to install a collection of codecs via ffdshow-tryouts or the CCCP Codec Pack.  Note that some codec packs like K-Lite (Kazaa-Lite) illegally use commercial versions.  Note that as of 2009, PowerPoint is 32-bit, so you'll need 32-bit codecs.
       
    2. Convert the movie to be a .gif animation.  This can work well for short videos with low frame rates.  This does not work so well for videos that are large, need high color fidelity (.gif files can have at most 256 colors per frame), or that need to run at normal or high frame rates (even 30fps can be problematic on some hardware/OS combinations).
       
    3. If the file is an .avi file, rename the file so it has a .mpg extension.  There is no need to convert it to use an .mpg container.  You just have to change its extension. 
       
    4. Unlike images, clip art, text, etc. PowerPoint stores a link to inserted movies.  Otherwise the .PPT files would get huge.  Unfortunately, PowerPoint stores absolute path names instead of relative path names.  This means that when you transfer a presentation to a new computer with a different directory structure, PowerPoint can no longer find the embedded videos.  Supposedly, it will always check the presentation's directory when the absolute path fails, but this has never worked for me.  Instead, you may need to remove the video from the presentation and re-insert it.
       
    5. Especially on Windows XP, lowering the video acceleration level often is required.  To do so, launch the "Display" properties from the Control Panel ("Personalization" then "Display Settings" in Vista).  Click on the "Advanced Settings..." button.  Go to the "Troubleshoot" tab and move the "Video Acceleration" slider all the way to the left.  When you are done giving your presentation, you will almost certainly want to turn all the acceleration back on.
       
    6. If you are transferring the presentation to a new computer and you are having troubles with fonts or linked files, try the Export to CD feature in PowerPoint (even if you'll be transferring the files in a different way).

 

Last updated: 2008-01-25 09:23:57 -0500