Friday, May 15, 2015
Customized Batch for LEd
LEd Pre-Config.rar: User1 is the customized batch for compiling pdf through tex->dvi->ps->pdf. It runs bibtex also, and it cleans the output files at the end.
Preparing Chinese in LaTeX
\usepackage{CJKutf8}
\begin{CJK}{UTF8}{bsmi}
中文
\input{ChinesePage}
\end{CJK}
You may need a UTF8 text editor to edit Chinese. LEd cannot do it, but you may use other text editor (e.g., notepad++) to edit Chinese, and then use \input{} to include the words.
Use gbsn instead of bsmi for simplified Chinese.
\begin{CJK}{UTF8}{bsmi}
中文
\input{ChinesePage}
\end{CJK}
You may need a UTF8 text editor to edit Chinese. LEd cannot do it, but you may use other text editor (e.g., notepad++) to edit Chinese, and then use \input{} to include the words.
Use gbsn instead of bsmi for simplified Chinese.
Determine the class of an object at run time
For simplicity, in order to check the class of an derived object is the class I want by a parent object, we can use the code like this:
#include <typeinfo>
if (!strcmp(typeid(*obj).name(), "class MyClass")) printf("It is MyClass!\n");
more details on typeid Reference
#include <typeinfo>
if (!strcmp(typeid(*obj).name(), "class MyClass")) printf("It is MyClass!\n");
more details on typeid Reference
error MSB8031: Building an MFC project for a non-Unicode character set is deprecated. You must change the project property to Unicode or download an additional library.
It dues to the MFC support for multi-byte character set (MBCS) is deprecated in Visual Studio 2013, and it can be solved by installing the Multibyte MFC Library for Visual Studio 2013 in
http://www.microsoft.com/en-us/download/confirmation.aspx?id=40770
more details on Visual C++ Team Blog
http://www.microsoft.com/en-us/download/confirmation.aspx?id=40770
more details on Visual C++ Team Blog
fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt.
This error appear because you have installed higher version of Visual C++ while compiling a lower version (e.g., VC2010).
One easy way to solve this problem (for VC2010) is to rename C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
more details on howtofix
One easy way to solve this problem (for VC2010) is to rename C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
more details on howtofix
Get today date in dd/mm/yyyy
#include <time.h>
time_t now = time( &now ) ;
struct tm* local_time = new tm( ) ;
local_time = localtime( &now ) ;
char buffer[20] = { '\0' } ;
strftime( buffer, BUFSIZ, "%d/%m/%Y", local_time ) ;
delete local_time;
more details on strftime Reference
time_t now = time( &now ) ;
struct tm* local_time = new tm( ) ;
local_time = localtime( &now ) ;
char buffer[20] = { '\0' } ;
strftime( buffer, BUFSIZ, "%d/%m/%Y", local_time ) ;
delete local_time;
more details on strftime Reference
Easy way to count the processing time
#include <time.h>
clock_t time = clock();
...
time = clock()-time;
printf("time in seconds: %ds\n",time/CLOCKS_PER_SEC);
printf("time in milliseconds: %dms\n",time);
more details on clock
clock_t time = clock();
...
time = clock()-time;
printf("time in seconds: %ds\n",time/CLOCKS_PER_SEC);
printf("time in milliseconds: %dms\n",time);
more details on clock
Subscribe to:
Posts (Atom)