静静的,漂泊在异乡的云

Just another 七十二松 (72pines) weblog

Get version number with SubWCRev in Windows:

if(WIN32)
EXECUTE_PROCESS(COMMAND SubWCRev
${dak_SOURCE_DIR}
${dak_SOURCE_DIR}/inc/dak_version_raw.h
${dak_SOURCE_DIR}/inc/dak_version.h)
endif(WIN32)

SubWCRev is part of TotoriseSVN.

Windows 2008 server 的shutdown event tracker对我这种常常重启的用户来说,就是一个额外的负担。可以用如下方法禁用:

运行 gpedit.msc,然后 “Computer Configuration - Administrative Templates - System”, 设置 Display Shutdown Event Tracker  为  disabled.

CMake 是一个跨平台的编译构建系统,它负责搜集系统中的函数库信息,管理源文件的依赖关系,生成合适的脚本供自动编译系统调用,完成程序的编译构建任务(compile and build)。它所能生成的格式包括常用的 Unix/Linux、Cygwin 以及 MinGW 下的 Makefile,Windows 下的 nmake 和 Visual Studio

CMake使用一个 CMakeList.txt 的输入文件,一个简单的例子如下

cmake_minimum_required (VERSION 2.6)
project (HELLO)

# Recurse into the “Hello” and “Demo” subdirectories. This does not actually
# cause another cmake executable to run. The same process will walk through
# the project’s entire directory structure.
add_subdirectory (Hello)
add_subdirectory (Demo)

子目录 Hello 下有 CMakeList.txt 文件:

# Create a library called “Hello” which includes the source file “hello.cxx”.
# The extension is already found. Any number of sources could be listed here.
add_library (Hello hello.cxx)

子目录 Demo 下有 CMakeList.txt

# Make sure the compiler can find include files from our Hello library.
include_directories (${HELLO_SOURCE_DIR}/Hello)

# Make sure the linker can find the Hello library once it is built.
link_directories (${HELLO_BINARY_DIR}/Hello)

# Add executable called “helloDemo” that is built from the source files
# “demo.cxx” and “demo_b.cxx”. The extensions are automatically found.
add_executable (helloDemo demo.cxx demo_b.cxx)

# Link the executable to the Hello library.
target_link_libraries (helloDemo Hello)

通常的编译安装为:

cmake c:\devel\project-X -G “Visual Studio 9 2008″

然后用Visual studio打开生成的 solution 文件。

If you often look at files that are updated,  a log file for a running process, you’ll want to make sure you’re looking at the most recent version of the file.

To do this, add the following to your .emacs:

(global-auto-revert-mode 1)

For more documentation type:

C-h C-f global-auto-revert-mode RET

Life as an Algorithm

Life is like a searching algorithm, someone uses greedy searching, someone uses breadth-first searching, someone uses depth-frist searching. There are also ones using heuristic searching.

Apache 2 + PHP + MySQL

It has been years I have not touched Web server on Linux. There are new commands to release you from editing the *conf in /etc/apache2:

$sudo a2enmod userdir

then try this

<?php phpinfo(); ?>

See the results !

Frank’s Superflag of NAG F95

Here it is:

  • -gline : produce traceback for run time error. increase file size and execution time.
  • -Wc,-m32
  • -Wl,-m32
  • -maxcontin=100
  • -ieee=nonstop
  • -D_NAG, use fpp
  • -Call
  • -nan, initialize double and complex to be IEEE NaN

PAC09 Links

PAC 2009 Vancouver Canada

Use LaTeX equations as a png figure in OpenOffice:

  1. produce tex file:
  2. \documentclass{article}
    \usepackage[active,tightpage,displaymath]{preview}
    \begin{document}
    \begin{preview}
    f(x)=\sqrt{x}
    \end{preview}
    \begin{preview}
    f(x)=e^{\sqrt{x}}
    \end{preview}
    \end{document}

  3. compile tex file with latex and get dvi file.
  4. dvipng -Ttight –depth –height -bg Transparent eq-preview

You will get a series of pictures

自作聪明有时候很麻烦:

Start / Run / gpedit.msc / Local Computer Policy / Computer Configuration / Administrative Templates / Windows Components / Windows Update / Re-prompt for restart with scheduled installations

搞定!

« Previous Entries