The common command to search and replace text with confirmation in Vim is
:%s/old/new/c. But, this begins the search and replace operation from the beginning of the file. There might be times when you want to begin search and replace from the current line.
:%s/old/new/c is shortcut for
1,$, which means replace from first line to the last line. So, to search and replace from current line to end of file we can use
.,$. This can be shortened to
,$. So, the command to search and replace from current line is
Tried with: Vim 7.4 and Ubuntu 14.04
The icon set for an application is displayed when you look for it in the Dash or in the Panel when you are running it. If you find that no icon or a wrong icon is displayed for an application, that can be fixed easily.
There is a
.desktop entry corresponding to every application. It will be either in
/usr/share/applications/. This is just a text file. Open it up and find the
Icon entry. Set it to a path of the icon file, typically a
.xpm file, you want.
Tried with: Ubuntu 14.04
The OpenCV cascade classifier makes it easy to train and test detection of faces and other objects in images. I have already written about how to train this classifier here. To get the objects detected during the testing stage, OpenCV provides this function:
const Mat& image,
This returns a list of rectangles in the image where the classifier thinks it has detected the object. However, there seems to be no way to rank the detected locations. There is no detection or confidence weight or score associated with each rectangle to help you prioritize the detected locations. This is surprising since such a score should be present in the classifier, it is just that this function is not exposing that information.
Thankfully, there is an alternative to this function that returns the weight and reject level associated with each detected rectangle. Surprisingly, this function does not yet appear in the documentation. You can find it declared in
CV_WRAP virtual void detectMultiScale(
const Mat& image,
CV_OUT vector<Rect>& objects,
You can also hack the code a bit to get other types of scores with each detected location as demonstrated in this post.
Tried with: OpenCV 2.4.9 and Ubuntu 14.04
While viewing and editing a wall of text, it is useful to highlight the current line that the cursor lies in. This feature is in Eclipse and can be turned on easily:
- Go to Window -> Preferences -> General -> Editors -> Text Editors. Enable the option named
Highlight current line.
If you still do not see current line highlighted, then the highlight color might be set to white or the same as background color of your theme. Go to same place as above, at the bottom you can see
Appearance color options. In that list, choose
Current line highlight option and set its color to something you like.
Tried with: Eclipse Luna 4.4.1 and Ubuntu 14.04
Simple OpenGL Image Library (SOIL) is a tiny C library for loading, writing and processing textures in OpenGL code. Alternative to this could be OpenGL Image (GLI) library.
If you use textures a lot in your OpenGL graphics code, then you must try OpenGL Image (GLI) library. It makes loading and writing back of textures very easy.
OpenGL Mathematics (GLM) is a library of mathematics primitives and functions that can be useful in OpenGL, shader, CUDA and other graphics related code. Everyone ends up writing their own version of this code, often with errors and waste of time. GLM could be a good choice in such cases. Note that GLM is not as featured or complex as Eigen.
Briefly, here are the types and operations you can get in GLM:
- vec3, vec4
- mat3, mat4
- Vector operations like normalize, bit swizzling
- Matrix operations
- Use of matrices for projection and lighting operations