Skip to main content

Posts

Showing posts from October, 2009

Visual C++ ... MD and MT compile option

This article is only for limited audiences. If you use Visual Studio C++ (2008) and have a question about What is the MD and MT, then you might be interested in this. When I made a Console Application on the Visual C++ 2008 using STL. I start to get the following error. error LNK2001: unresolved external symbol __imp___CrtDbgReportW It is related with a Windows runtime library. One thing is Unicode related, so I switched off. It seems this is related C/C++ Code generation, Multi-threaded Debug Dll (MT option) (/Mdd) or Multi-threaded debug (/MTd). (Note: only one character difference /MDd and /MTd.) In some reason while I develop an application, I got a warning about there is a library conflict, and suggested to ignore one of the runtime libraries. I followed the link's output and ignore the 'MSVCRT' library. But this is the problem. I removed it from the ignore library list. I set up all the Code Generation to Multi-threaded Debug DLL (/MDd) for debug, and not ignore any r

Is spamming really profittable?

Spam mails are everywhere and everyday. There is a question, "Is spamming really profitable?" One "academic" paper try to answer this question. They set up the bot net, set up fake web pages, send spam mails (350million spam emails in their experience), observe how many can go through, how many comes to the web page, and how many actually buy the medicine. This is the paper: Kanich et al. Spamalytics: an empirical analysis of spam marketing conversion. CASM, 2009, Vol.52, No.9, pp.99-107 I do not know how, but they claims it they cleared U.S. legal doctrine and ethics. The authors said, "We would be the first to admit that these results represents a single data point and are not necessarily representative of spam as a whole." and they even said there is some danger to interpret the result's means. But, for 28 days experience, 350 million spam mails are sent, 82 million delivered (but, of course they do not know how many are shown up in user's inbox

What is the rank of matrix

I will talk about the part of Introduction to Linear Algebra by Gilbert Strang, again. There is an important indicator of matrix called "rank". According to the http://mathworld.wolfram.com/, the rank of a matrix is the dimension of the image of the matrix, corresponding to the number of linearly independent rows or columns of the matrix. This is a common definition in a textbook. In the Strang book, the rank is explained from a bit different way. He explained rank and elimination together. The definition of rank is the number of pivots after the elimination. After all, they are the same, but I found interesting that how to approach to the concept of rank through the elimination. Gaussian elimination is employed to diagonalize of a matrix. Because if we could diagonalize a matrix, we can easily solve the linear equations. Let's think about a bit of elimination. We could use the following matrix as an example matrix. A = |1 2 2 2| |2 4 6 8| |3 6 8 10| Let's do elimin

C++ is hard... link considering dynamic library plugin.

This article might be interesting to someone who writes a plugin software with C/C++ using shared library (dynamic link library) mechanism. But, if you are not, I think this is totally rubbish. When I develop a plugin, I could compile it and link it, but when I run it, I happen to see an error message, ``no such symbol''. I see the symbol in the executable via nm/dumpbin, but, it is not recognized from the plugin code at runtime. Why this happens? Because the linker optimizes exposing symbols. Some of the software needs symbols that are only used by its plugin. When you need to build such software, you need to ask to the linker to keep those symbols. Otherwise linker trashes un-referenced symbols. This is usually useful, otherwise my disk and memory will be filled up by copies of unused symbols. To ask to the linker that ``please keep unused symbols since I might need them later,'' you need to specify --export-dynamic option (liker option) to the linker. If you use gcc