D's profileDJ.Khaos' Astral City 大智...PhotosBlogListsMore Tools Help

DJ.Khaos' Astral City 大智若愚,大巧若拙

星际发展会 —— 首席执行官

D Jiang

Occupation
Location
Interests
茶人,淡,香,雅,韵。
There are no photo albums.
This person's network is empty (or maybe they're keeping it private).
2/8/2010

Twitter Code Swarm

How was Twitter developed? Watch the below video. It’s fascinating, isn’t it?!

 

2/3/2010

大灰狼(DHL)的一则广告

呵呵,好玩。

 

12/18/2009

Interesting Video —— Visualizing empires decline

This neat video shows that HISTORY can actually be visualized. Enjoy …

 

TeX/LaTeX 中文字体的配置

  MiKTeX 2.8之后,CTeX宏包就直接包含于官方版本中了,于是之前比较麻烦的中文配置就因为XeTeX的存在变得简单得多,见这里

  由于很长时间都没有写中文文章,一直也没有测试新功能。前些天心血来潮,写了个小片段试图编译,却通不过编译。后来发现原来我这个英文系统里没有默认安装Windows的那6套字体(宋体/新宋体,黑体,楷体,仿宋,隶书,幼圆)。-_-p

  为了方便以后使用,把这6套字体打包,放在SkyDrive里,点这里下载。

  另外,重装了LyX 1.6.5,如果需要编译中文,需要把Preferences->Output->LaTeX中的TeX encoding选项内容(T1/OT1)清除。这样,如果由LyX导出至LaTeX后,\usepackage[T1]{fontenc} 就变成 \usepackage[]{fontenc} ,从而用XeLaTeX编译就可以通过了。

12/16/2009

强悍的一塌糊涂~~~

闲话少说,直接上图!

predatormoto

 

Lamborghini-Ankonian-Concept-by-Slavche-Tanevsky lamborghini-ankonian-concept-by-slavche-tanevsky-5lamborghini-ankonian-concept-by-slavche-tanevsky-2

12/7/2009

1 week, 5000-line codes, and finally a GUI —— Matlab GUI (2)

Some screenshots of the ACSE Teaching & Testing system.

Welcome Page Finish Page
ACS114Prototype02 page-last01
Demo Page Question 1
page01 page02
Question 3a Question 3b
page04a page04b
Question 2 Question 4
page03 page05
11/30/2009

A GUI Prototype for ACSE Course Testing System —— Matlab GUI (1) <updated>

I’ve recently been asked to design a new testing system for the first year students of ACSE. The purpose is to create a easy-to-use Matlab GUI to allow the student to take a self-testing task.

After a few days work, I got my first GUI prototype (see below). The GUI has dark background and light foreground with which I think the students can focus on the useful information easier.

ACS114Prototype02

 

I’m planning to improve this GUI by embedding a tab panel in the question zone. However, there is no standard tab panel  GUI component  in Matlab, (bad, really bad). So it has to be built either using Sun Java classes (easy programming but more Java *_* ) or using a group of the basic Matlab GUI components (all Matlab but more programming -_-P ). I will show the final design when I finish this project.

  2009/17/30 17:11:15

A small upgrade. Add a code snippet in the command panel, the old gui image can be found from here.

11/23/2009

ProFORMA: Probabilistic Feature-based On-line Rapid Model Acquisition

  在GR上读新闻,这个由Qi Pan开发的在线3D建模系统一下子就吸引了我,大略扫了一下他的论文,算法中规中矩,实现上却要下点功夫,不知道是不是用JAVA/C++实现的。闲话少说,请看Demo。

PS: 貌似是华裔(大陆),一路全A的上了剑桥,前途不可限量~~~

 

11/18/2009

How to create an elegant lecture mindmap using PGF/Tikz —— PGF/TikZ之达芬奇密码(3)

The following code shows how to create a mindmap using the LaTeX package, pgf/tikz. To make it work, the libraries, mindmap, trees, shadows, calendar, and backgrounds are required.

\def\lecture#1#2#3#4#5#6{
  % As before:    
  \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm, fill=white] at (#4) {
    Lecture #1: \textcolor{orange}{\textbf{#2}}
    \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt
              \parskip=0pt\labelwidth=8pt\leftmargin=8pt
              \itemindent=0pt\labelsep=2pt}
    #5
    \endlist
  };
  % New:
  \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}};
}
 
\noindent
\begin{tikzpicture}
  \begin{scope}[
    mindmap,
    every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt},
    root concept/.append style={
      concept color=black,
      fill=white, line width=1ex,
      text=black, font=\large\scshape},
    text=white,
    computational problems/.style={concept color=red,faded/.style={concept color=red!50}},
    computational models/.style={concept color=blue,faded/.style={concept color=blue!50}},
    measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}},
    solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}},
    grow cyclic,
    level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape},
    level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}]
    \node [root concept] (Computational Complexity) {Computational Complexity} % root
      child [computational problems] { node [yshift=-1cm] (Computational Problems) {Computational Problems}
        child         { node (Problem Measures) {Problem Measures} }
        child         { node (Problem Aspects) {Problem Aspects} }
        child [faded] { node (problem Domains) {Problem Domains} }
        child         { node (Key Problems) {Key Problems} }
      }
      child [computational models] { node [yshift=-1cm]  (Computational Models) {Computational Models}
        child         { node (Turing Machines) {Turing Machines} }
        child [faded] { node (Random-Access Machines) {Random-Access Machines} }
        child         { node (Circuits) {Circuits} }
        child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} }
        child         { node (Oracle Machines) {Oracle Machines} }
        child         { node (Programming in Logic) {Programming in Logic} }
      }
      child [measuring complexity] { node [yshift=1cm] (Measuring Complexity) {Measuring Complexity} 
        child         { node (Complexity Measures) {Complexity Measures} }
        child         { node (Classifying Complexity) {Classifying Complexity} }
        child         { node (Comparing Complexity) {Comparing Complexity} }
        child [faded] { node (Describing Complexity) {Describing Complexity} }
      }
      child [solving problems] { node [yshift=1cm] (Solving Problems) {Solving Problems}
        child         { node (Exact Algorithms) {Exact Algorithms} }
        child         { node (Randomization) {Randomization} }
        child         { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} }
        child         { node (Parallel Computation) {Parallel Computation} }
        child         { node (Partial Solutions) {Partial Solutions} }
        child         { node (Approximation) {Approximation} }
      };
  \end{scope}
  
  \tiny
  \calendar [day list downward,
             month text=\%mt\ \%y0,
             month yshift=3.5em,
             name=cal,
             at={(-.5\textwidth-5mm,.5\textheight-1cm)},
             dates=2009-09-01 to 2009-11-last]
    if (weekend)
      [black!25]
    if (day of month=1) {
      \node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext};
    };
 
  \lecture{1}{Computational Problems}{above,xshift=-5mm,yshift=5mm}{Computational Problems.north}{
    \item Knowledge of several key problems
    \item Knowledge of problem encondings
    \item Being able to formalize problems
  }{2009-09-08}
    
  \lecture{2}{Computational Models}{above left}
  {Computational Models.west}{
    \item Knowledge of Turing machines
    \item Being able to compare the computational power of different
      models 
  }{2009-09-15}
  
  \begin{pgfonlayer}{background}
    \clip[xshift=-1cm] (-.5\textwidth,-.5\textheight) rectangle ++(\textwidth,\textheight);
    
    \colorlet{upperleft}{green!50!black!25}
    \colorlet{upperright}{orange!25}
    \colorlet{lowerleft}{red!25}
    \colorlet{lowerright}{blue!25}
 
     % The large rectangles:
    \fill [upperleft]  (Computational Complexity) rectangle ++(-20,20);
    \fill [upperright] (Computational Complexity) rectangle ++(20,20);
    \fill [lowerleft]  (Computational Complexity) rectangle ++(-20,-20);
    \fill [lowerright] (Computational Complexity) rectangle ++(20,-20);
 
    % The shadings:
    \shade [left color=upperleft,right color=upperright]
      ([xshift=-1cm]Computational Complexity) rectangle ++(2,20);
    \shade [left color=lowerleft,right color=lowerright]
      ([xshift=-1cm]Computational Complexity) rectangle ++(2,-20);
    \shade [top color=upperleft,bottom color=lowerleft]
      ([yshift=-1cm]Computational Complexity) rectangle ++(-20,2);
    \shade [top color=upperright,bottom color=lowerright]
      ([yshift=-1cm]Computational Complexity) rectangle ++(20,2);
  \end{pgfonlayer}
\end{tikzpicture}

Here is the resulting lecture map.

mindmap01-crop

11/12/2009

Nyquist Contours 的绘制 —— PGF/TikZ之达芬奇密码(2)

利用pgf/tikz绘制了一个Nyquist Contour,下面是效果图及代码。

NyquistPlot

更清晰的矢量格式请移步我的SkyDrive

11/10/2009

如何利用纯机械装置产生类似于,……零壹零壹零壹……,的逻辑序列?

  去办公室的路上,偶然发现鞋带随着步伐很有规律的左右摆动,于是突发奇想,如果能抽象出这个行为的力学模型,进而用类似机构替代相对应的物体,并加以控制,便可以创造出可以产生二进制逻辑序列的纯机械装置。当然这种装置,与传统的逻辑电路的物理实现,例如,门电路,或更复杂些集成电路,的主要区别应该就是它是利用运动学原理构造而成的。现在能够想到的问题,就是如何存储信息,和进行基本的逻辑运算,有时间研究下……

  不过这种逻辑“机”路的运算能力相较而言,与逻辑电路可就有天壤之别了。不过倒是可以做为运算结果的直观输出,这个倒是很有趣。

11/1/2009

帅酷,不会把妹的人进来看看,钛合金机器人怎么做的。

  高大威猛,倒三角体型的钛合金机器人把起妹来,也不逞多让。

 

  下面这个更好玩,情致浓处,居然喷起眼泪来了,不知道这是不是机器人的传统,记得大黄蜂也这样,哈哈。

 

10/26/2009

绝世好表

秀两款收藏的漂亮的元素周期表(Periodic Table)。

PeriodicTable

上面这个包含了100多种字样(Typeface),而下面这个则包含了各种元素在现实中的主要应用。

Periodic-table

 

原图下载请移步我的SkyDrive

10/25/2009

[转]如何安装使用Type1字体包

CTeX 的 KMC 对字体颇有心得,这里转一篇关于在 TeX/LaTeX 下如何安装使用 Type1 字体的文章,很有用!

原文出处:http://t1pack.spaces.live.com/blog/cns!FB2844A6E67B435C!113.entry

 何安装使用Type1字体包

via: http://t1pack.spaces.live.com/blog/cns!FB2844A6E67B435C!113.entry


LaTeX的Type1字体包一般由以下几个部分组成:
  • afm:(txt)Adobe Font Metrics——字体的几何信息(尤其是kerning信息)虽然LaTeX并不需要通过afm来访问字体,但是在生成字体包的过程中需要,所以一般附在字体包中以便需要修改时用。
  • pfb:(bin)Printer Font Binary——字体的轮廓,也是字体最基本的文件。一般制作有版权的商业字体字体支持包的时候,pfb文件不会提供,但这里的字体包是完整版,故含pfb。所以请勿用于商业用途,否则后果由用户承担。
  • tfm:(bin)TeX Font Metrics——TeX独有的字体几何信息,TeX引擎是通过tfm来访问字体的。
  • enc:(txt)encoding——编码文件
  • fd:(txt)Font Description——字体描述
  • vf:(bin)Virtual Font——虚拟字体
  • map:(txt)Mapping——映射文件。以上几种文件的解释见fontinst.pdf
  • sty:(txt)Style——LaTeX宏包,简化字体的调用。

这里提供的Type1字体包按照标准的TeX Directory Structure存放,例如Kabel字体包tds上图表明Kabel字体压缩包的根目录下有fonts和tex两个目录,安装时按照这个结构解压到相应的texmf-local(推荐)目录即可。

解压之后,还需要刷新文件名数据库并运行updmap程序,根据发行版的不同略有不同,目前在Windows2000/XP/7和Ubuntu 9.04的TeX Live 2008/2009的下测试有效。以(pkb)kabel.zip为例——

  • Windows系统:
    • 解压到相应的texmf-local
    • 命令行(cmd)中运行texhash命令
    • 完成后,命令行输入kpsewhich kabel.sty检测,如果能找到kabel.sty的位置,说明解压位置正确
    • 命令行运行updmap --enable Map=pkb.map 。注意Map的M要大写,pkb是字体的三字母家族简称,一般在压缩包文件中写在括号里。
  • Linux系统
    • (该操作无需管理员权限)解压到个人目录,即~/texmf目录下,然后终端运行texhash ~/texmf
    • 同样使用kpsewhich kabel.sty检测是否正确解压
    • 终端运行updmap --enable Map=pkb.map

以上如果为多用户环境,管理员可以用类似的方法安装到$TEXMF下,此不赘述。

 

使用字体包

Kabel是无衬线字体,在tex文件中载入
\usepackege[T1]{fontenc}
\usepackage{kabel}
\usepackage{textcomp}
即可把\sfdefault变成kabel(即pkb家族),此后\sffamily和\textsf{}命令将使用kabel字体。

如果要把rm字体变成kabel,有两种方法(推荐第二种),如果载入字体无效的话,建议首先看看是不是把衬线跟无衬线弄错了。
  • 不载入kabel宏包:\renewcommand\rmdefault{pkb}
  • 载入kabel宏包,并加上\renewcommand\familydefault{\sfdefault}

字体包的说明中一般会提到family,series和shapes,例如
family: pes
series: m, b, eb
shapes: n, sc, si, it, sl
选择family用 \fontfamily{pes}\selectfont
选择series用 \fontseries{eb}\selectfont
选择shapes用 \fontshape{sc}\selectfont

以上命令相对繁琐,对于一些常用的series和shapes,可以用相应的LaTeX命令来选择,例如\bfsereis, \itshape, \scshape, \textsl{}, \textsc{}

10/23/2009

Apple’s New Ads, ‘Welcome’ Windows 7 ?! lol