Category Archives: Linux, OpenSource, Computers, Programmings

How to fix ‘$MFTMirr does not match $MFT (record 0)’ [updated version… ]

portable-canvio-3-redI hate Toshiba external disk driver’s fragile cable port … you have to keep your hands on while data are being transferred; otherwise you probably find the current article or this (a) or this (b).

This (a) has explained things pretty clearly, except for that you won’t find ntfsprogs in recent versions of Linux distributions, as the ntfsprogs project has been merged with the ntfs-3g project under Tuxera Inc. according to Wiki. The real attack works as described in Answer in this (b), except that one needs to check out the mount point by “sudo fdisk -l” and “sudo ntfsfix -b XXX” to get the program to start the fix, where XXX is to be replaced by the real mount point.

Advertisements
Tagged , ,

Script for OpenCV installation on Ubuntu 12.10

Installing OpenCV on Ubuntu was painful for me in the past. There are lots of dependencies to be sorted out first and there’s no comprehensive installation tutorial shipped with the OpenCV distribution.
This script has done a great job assembling all necessary “apt-get-install’s” into an executable script. Some personal notes about this:

  • It seems to me ” sudo apt-get install libopencv-dev” for dependencies is not necessary – this will be superseded by the subsequent installation of opencv from source. At the end of the scripting installation, the package seems to be in some cache place and be not in effect:
  • It seems ” sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev” is also unnecessary. These libraries are to be provided by the next fresh installation of ffmpeg follows. Checking their location seems to also confirm my guess:
  • About version of ffmpeg: ffmepg is under active development as always. The choice of its version is sometimes tricky, especially in running together with OpenCV. I remember the 1.x series was not compatible with OpenCV 2.3 in my previous trial (compilation errors were thrown due to some problem with ffmpeg libraries). The current 2.4.3 version seems to be at least fine with ffmpeg 0.11.2 in compilation.

[Update] From test by Mr. Alok Singh Mahor   (comments below), installing Ubuntu package “libopencv-dev” would already get things work, though the linking order with g++ has to be taken care of as discussed (also comments below and here) . Of course, it’s not bad idea to install from source that always guarantees to bring  in the newest feature of actively developed OpenCV. [Dec 28 2012]

Tagged ,

Math bits from a computational blog

This blog (“Walking randomly”) contains a pretty host of good pieces in computational programming, in Matlab, Python, R, etc, and also of news about computational software, particularly open-source tools, and mathematics by large.

Several that are of interest to most (after a very random walk of recent entries):

Tagged ,

CVX Annouced Version 2 (beta)

CVX has become an indispensable tool for modeling and prototyping in various scientific disciplines, in particular where optimization play significant roles.  It provides a most intuitive modeling interface that bridges complex formulation and the underlying numerical solvers, saving the user abundant time for thinking.

Version 2 of CVX has featured extended support for commercial solvers, MOSEK and Gurobi. This is really good news for academic users, since 1) both solvers provide free licenses to academic users; and 2) both solvers are mostly more optimized than the free solvers currently bundles with CVX, namely, SDPT3 and SeDuMi. Related part of the announcement as follows:

  • Academic users may utilize the CVX Professional capability at no charge.
    • Users with a valid academic license for Gurobi 5.0 or later may use it with CVX without obtaining a CVX Professional license. This is because CVX is able to detect the presence of an academic Gurobi license.
    • In order to use MOSEK, a CVX Professional license is required. We intend to provide such licenses at no charge, but we have not yet completed the licensing architecture. We will make an announcement once this has been completed.

In addition, mailing list support has changed into a Q&A forum (StackExchange style …) and the documentation has changed to online html version with better cross references.

Tagged , ,

Useful Tips on Running External Programs from Matlab on Linux

Most of these problems stem from bad association of Matlab’s C++ (or Fortran) libraries. The solution is often to create a soft-link and point to the corresponding system libraries. This blog article provides a very nice summary of this!

Matlab: Running External Programs

Tagged , , ,

LaTeX to Blogger powered by MathJax (Experimental)

The past weekend I was trying to figure out how to convert \LaTeX source to Blogger compatible sources with the support of the powerful MathJax mechanism to display math.

There’s already an excellent tool (latex2wp) that serves the conversion from \LaTeX to WordPress as I noted before (and best advertised by Terry Tao’s WP blog). But there seem to be numerous legitimate reasons for doing similar thing on Blogger, the most notable one is Blogger allows network scripts to run for the blog (check out the concept of content distribution network, or CDN) and the powerful MathJax engine *happens* to provide such CDN service from recently. If you don’t appreciate why the bother to create yet another math display protocol MathJax, just come down here and have a look at the wonderful demos while imagining what would happen to image-based rendering of math at scaling.

A moment’s research revealed the major difference WordPress and blogger (precisely MathJax) are on handling \LaTeX math: the former uses “$1atex … $” format (I intentionally put the number “1” instead of the letter “l” to avoid invoking the WP interpreter) while the latter just directly the \LaTeX code as “$ … $“. Another major piece lies at how they handle displaying style (vs. the inline style delimited by “$ … $“). WP is to handle the following “<p align=center> $ latex \displaystyle … $ </p>\n“, whereas MathJax can handle “\[ … \] ” directly (“\begin{equation} … \end{equation}” alike are converted to “\[ … \]” with proper numbering). Other minor details are different formats of line breaks and so on.

So I have worked on the latex2wp package directly and made necessary changes as discussed. Some simple tests tell that it’s working fine. Probably you’d like to have a try! (Albeit my great admiration for MathJax and blogger, I have no intention to move to Blogger.com yet since it’ll definitely expend a considerable amount of work. ) Here’s the download link from my dropbox

Latex2Blogger.0.6.2b.tar.gz

Tagged , , , ,

Image Transformations Done Right in Matlab

Though simple and basic, spatial (geometric) transformations in image processing involve lots of subtleties – neglecting these will probably return you awkward results. These subtleties include but are not limited to (esp. in Matlab)

  • Convention in transformation matrices
  • Convention in coordinate axes
  • Position of the input image in the source plane
  • Bounding box calculatio
  • Visible region calculation

Steve  Eddins, a software engineer specialized in image processing, has a series of blog articles devoted to these issues.  He has also contributed a new chapter in the 2nd edition of the classic “Digital image processing using Matlab” (Chapter 6: Geometric Transformations and Image Registration)

Steve on Image Processing

Tagged , , ,

Interface Kinect Depth Camera to Ubuntu Linux

Testing environment: Ubuntu 10.10 64bit

This tutorial on ROS.org provides an excellent walkthrough http://www.ros.org/wiki/kinect/Tutorials/Getting%20Started

Caveats: to launch the visualization at the last step, it seems the configuration file has to be “/tmp/kinect.vcg” exactly. I have changed to other location with the same file name, it turned out not to work, even the launch command has been changed accordingly.

[Update: Feb 25 2011]

Later on I figured out that Openni.org also provides a nice interface package for Kinect on Linux machines. Here are the steps I followed that verified to work (mostly inspired by this post for Windows).

  • Download and install the necessary driver from SensorKinect. There are stable (master) and unstable distributions available, and the stable version is recommended (the unstable version doesn’t compile on my Linux even with all dependencies settled). In the unzipped folder, find Platform > Linux-x86 > CreateRedist, and run the script ./RedistMaker. In Platform > Linux-x86 > Redist, run sudo ./install.sh.
  • Install the lastest LibUSB.
     sudo apt-get install libusb-1.0-0-dev freeglut3-dev  

and in each package, install the package by running sudo ./install.(ba)sh.

  • Test the demo samples. In OpenNi > Samples > Bin > Release, run ./NiViewer to get realtime scene and depth map viewing.
Tagged , ,

ModernCV–A cool LaTeX Class for CV

Buzzing with preparation of application materials … you know some university requires more than one statement and you have to be careful about this kind of writing.

During my last several minutes to go to bed, I would like to recommend one Latex class for CV creation, ModernCV. It’s very handy and gets pretty cool features. And as the name suggests, the template generates fashionable CV in one shot.  You may take a look at my CV (apparently not optimized Smile , and it’s in Google Docs … sorry, forks). The only catch is there’s no official documentation there, so you need to know something (advanced) about LaTeX code to modify it if you really desire to do so …  

There’s one blog article summing up all the nice LaTeX tools for CV creation, enjoy! and bye!

Tagged , ,

Software & Services: Mergence and Liberation (not breakaway)

Two pieces of news are around recent days, related to software and online services.

Mergence

windowswordpress1

Windows Live and wordpress.com get married, to all surprise!  No doubt wordpress.com will at least double its users, and Windows Live gets well advertised and its other services closely linked to the current and future wordpress.com users. But as skeptical as usual, I guess this is more like a “soft acquisition”rather than a “co-operation”.  Why? I simply do not see the reason why wordpress.com can survive for long purely for the service of blogging hosting (and perhaps also the web hosting toolkit they provide with wordpress.org).

Continue reading

Tagged , , , , ,