Google
 

4/23/07

C++ currying.

http://www.numerical-recipes.com/forum/showthread.php?t=526

NR and extra parameters.

http://www.thescripts.com/forum/thread509195.html

4/21/07

image zoomin.

When zoom in the image, the number of pixels occupied by the objects increases. I think there is some interpolations!!

4/14/07

source navigator

It is a very nice tool for source/code reading.

4/13/07

sort two vectors.

cvcl-20060527/src/include/cvclutil.h - Google Code Search
sort one vector based on the other.

template
std::pair strPair(const std::string& f, const T& t) {
return std::pair(f, t);
}

typedef std::pair StrPair;

//! Sort two vectors based on the first vector
template
void sort2(std::vector& keys, std::vector& vals) {
DebugAssert(keys.size()==vals.size(), "sort2()");
// Create std::vector of pairs std::vector > pairs;
for(size_t i=0, iend=keys.size(); i pairs.push_back(strPair(keys[i], vals[i]));
// Sort pairs
StrPairLess comp;
sort(pairs.begin(), pairs.end(), comp);
DebugAssert(pairs.size() == keys.size(), "sort2()");
// Split the pairs back into the original vectors
for(size_t i=0, iend=pairs.size(); i keys[i] = pairs[i].first;
vals[i] = pairs[i].second;
}
}

}

4/12/07

using magick++

c++ -o example example.cpp `Magick++-config --cppflags --cxxflags --ldflags --libs`


Now I want to use kdevelop as my IDE and use Qmake. How to use magick++ library now?
1. in a console type:
>
Magick++-config --cppflags --cxxflags --ldflags --libs

-I/usr/include
-pthread
-L/usr/lib -L/usr/X11R6/lib -lfreetype -lz -L/usr/lib
-lMagick++ -lWand -lMagick -llcms -ltiff -lfreetype -ljasper -ljpeg -lpng -ldpstk -ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lpthread -lm -lpthread

The above is the output.
So in the src. pro file, add the following:

INCLUDEPATH += /usr/include /usr/include/magick

LIBS = -lfreetype -lz -lMagick++ -lWand -lMagick -llcms -ltiff -lfreetype -ljasper -ljpeg -lpng -ldpstk -ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lpthread -lm -lpthread


Now recompile the project. It should work.

MTL installation.

copy the mtl folder which contains all the header files to /usr/include/
e.g:
cp -R /xxx/mtl /usr/local/
After that, make sure that when include these headers, using the following:
#include "mtl/matrix.h"
must have the mtl/, otherwise can not find them.

4/11/07

nice

nice -19 jigdo-lite debian-40r0-i386-DVD-1.jigdo

this will set the jigdo-lite's priority to minimum.

4/9/07

compile matlab m files.

mcc -x file.m
this will not generate stand-alone, but it does accelerate the speed very much.

4/3/07

How to Open a Program Automatically When a Mac Starts Up

How to Open a Program Automatically When a Mac Starts Up

Rate This Article:
Difficulty: Easy
If you use a particular program or application every time you start up your Mac, here is how to make it launch itself. You can also make a sound play automatically this way.

Instructions

  • STEP 1: Find the application (or sound) icon and click on it.
  • STEP 2: Click on the File menu and select Make Alias.
  • STEP 3: Drag the alias to the desktop where you can get at it.
  • STEP 4: Double-click to open the System Folder and locate the Startup Items folder.
  • STEP 5: Drop the alias into the Startup Items folder. The next time you start up your Mac, the application will launch.