## Mar 26, 2014

### 從陀螺聊到姿態追蹤與遊戲物理引擎

opengl 3D animation of a cube gyrocsope from KT Gump on Vimeo.

EulerTop_sharp_cube from KT Gump on Vimeo.

## Mar 17, 2014

### 3/2-17感冒紀錄

(第二次用藥: Clarithromycin250 , Meptin25, Voren25, Medcon-A, Strocain, Tetosiv sustained)
(第三次用藥: Cravit500MG, Allegra, Panamax, Mucosolven, Gaster20MG, Anticough Capsules)

 尖點運動
 有環運動
 無環運動
 等周速運動

the python code

## Mar 12, 2014

### some great matches in CSGO, cool CSGO avitar names, and try to come up with some of my own, casters i like

Converted document
Some of the greatest matches in professional CSGO (chronologically, in reverse)
Some of the avatar names and casters I like:
Existing_names pusha, olofmeister, byali, apex, faflaren, karrigan, jkaem, hani, simple, cyjanb, nothing , shox, kioshima,
Cranking_my_head mehidae (somehow rhythm with meditate) toothless (from the movie "how to train your dragon") silen (silence) andoni (antoine) pfeifer (vacuum pump company - pfeiffer) timee continuing...
Casters ddk black ddk henryG warowl a few that I still need to find their names......

## Mar 9, 2014

### Typeset mix Chinese and English TeX documents with Scientific Workplace 5.0 and TEX live 2013

You can typeset Chinese documents with Scientific Workplace (5.0) if you have just a few Chinese paragraphs. But if you have a long Chinese document or a document with mix Chinese and English characters, the software will suffer. The SWP's compiler for international characters, Omega, is just not good enough for this purpose. You will run into a lot of overfull hbox problems during typesetting. We will need another latex compiler for long documents of mix Chinese and English. But we will want to use the convenient editing features of Scientific Workplace, what should we do?

Here is something you can try. Still prepare your international document with SWP. But typeset it with another latex compiler. Here I use a popular one, XeLATEX in TEX live 2013. But there are a few problems. First, the file prepared by SWP has a character encoding that is not recognized by other latex compiler. So I wrote a small Python program to convert the encoding. Second, the figure insertion syntax generated by SWP is not recognized  by XeLatex. But this can be done by inserting TEX fields containing the correct Xelatex figure insertion commands into the SWP file by using SWP's TEX OBJECTS buttons. You won't be able to preview the figures SWP window but that doesn't really hurt. Here are step-by-step details:

• How to convert SWP 5.0 special unicode format file to unicode correct characters:
SWP version 5.0 produced Chinese character in its special unicode codepoint format (if you open the tex file with any text editor, you will see every Chinese character has a form like \U{6211} instead of displaying 我 in the tex file.) This is due to the extra parenthesis {} after \U. So I wrote a small python program to automatically remove all {} in the tex file. So that the file can then be prepared by other tex programs (Tex Life 2013 in my case).

The program is very simple:
import re
import codecs
def dashrepl(matchobj):
return chr(int(matchobj.group(1),16))
f1 = open('rotationV4pngtest.tex', 'r')   # name of your origianl file
f2 = codecs.open('rotationV4pngtest.tex.temp', "w", "utf-8")   #  name of the new file
p= re.compile(r"\\U{([\w]{,4})}")
for line in f1:
m = re.sub(p,dashrepl,line)
##    print(m)
f2.write(m)
f1.close()
f2.close()

• For the SWP tex file to be readable by other compiler, you will also need to change the preamble (the packages and stuff)  in the beginning of the tex document so that other tex program can use it. Here is my case:
Original preamble generated by SWP:
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{sw2unicode}
\usepackage[UT1]{fontenc}
\usepackage{pmingliu}
\usepackage[left=0.95in,right=0.95in,top=2cm,bottom=2.54cm]{geometry}
Change the above to the following so that Xelatex can complie:
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{fontspec}
\usepackage{xeCJK}
\setmainfont[Mapping=tex-text]{Times New Roman} % rm
\setsansfont[Mapping=tex-text]{Arial}           % sf
\setmonofont{Courier New}                       % tt
\setCJKmainfont{微軟正黑體}
\usepackage[left=0.95in,right=0.95in,top=2cm,bottom=2.54cm]{geometry}
\usepackage{unicode-math}
\usepackage{graphicx}

• The file generated by SWP has symbols that use SWP's "tcilatex" macro, so you need to copy tcilatex.tex file into the same directory as your tex file. The location of tcilatex.tex in SWP's path has the following structure "D:\swp50\TCITeX\TeX\LaTeX\SWmacros\". Locate this file and copy it into your working directory. Then make sure your tex file has the \input{tcilatex.tex} line. You should have this line because you prepared your file with SWP.

• Change the TEX figure insertion command:

The figure insertion command for Xelatex should look like this:
\begin{figure}[th]
\caption{{}}
\label{firstfig}
\begin{center}
\fbox{\includegraphics[scale=0.7]{cordtrans.JPG}}
\end{center}
\end{figure}

So open the SWP tex file with Notepad and replace all things look like the following with the above

\FRAME{fhF}{5.5097in}{3.7135in}{0pt}{}{}{cordtrans.JPG}{\special{language
"Scientific Word";type "GRAPHIC";maintain-aspect-ratio TRUE;display
"USEDEF";valid_file "F";width 5.5097in;height 3.7135in;depth
0pt;original-width 9.135in;original-height 6.1436in;cropleft "0";croptop
"1";cropright "1";cropbottom "0";filename
'
cordtrans.JPG';file-properties "XNPEU";}}

There could be other commands you need to change before you can run your tex document with TEX life Xelatex. Here I only show three points, which is enough for me to typeset this document. Good luck!

### 鋼琴伴奏譜+彈唱 [轉錄 from 鸠玖的音乐世界 土豆網]

http://www.tudou.com/plcover/-ysO_c-u4NY/

## Mar 1, 2014

### 使用Scientific Workplace 5.0 + XeLatex軟體做中英文混雜並夾帶數學公式的長篇圖文文章電腦排版

這邊介紹如何利用Scientific Workplace 5.0的編輯方便性，加上XeLatex (TeX life 2013)對中英文混雜的完美支援，來對中英文混雜並夾帶數學公式的長篇圖文文章做自動排版。