Sunday, January 30, 2011

read chinese on nook color.

http://bbs.padbbs.net/thread-4163-1-1.html

思路及详细方法见HIPDA上xzzr发的帖子
http://www.hi-pda.com/forum/viewthread.php?tid=581164

1. 需要calibre转换EPUB,并添加CSS
2. 简单改变CSS的方法见下面的链接:
http://www.hi-pda.com/forum/viewthread.php?tid=651239&highlight=NOOK%2B%D0%C2%CA%D6
3. 无论用何种方法,记得读书时需要把【text--Publisher Defaults】设置为ON才可以。

CSS见下:

@font-face {
font-family: "DroidFont", serif, sans-serif;
font-weight: normal;
font-style: normal;
src: url(res:///system/fonts/DroidSansFallback.ttf);
}
@font-face {
font-family: "DroidFont", serif, sans-serif;
font-weight: bold;
font-style: normal;
src: url(res:///system/fonts/DroidSansFallback.ttf);
}
@font-face {
font-family: "DroidFont", serif, sans-serif;
font-weight: normal;
font-style: italic;
src: url(res:///system/fonts/DroidSansFallback.ttf);
}
@font-face {
font-family: "DroidFont", serif, sans-serif;
font-weight: bold;
font-style: italic;
src: url(res:///system/fonts/DroidSansFallback.ttf);
}
body { font-family: "DroidFont", serif;
line-height: 1.4;}



###########################
http://www.mobileread.com/forums/showthread.php?t=75191

@font-face {
font-family: "DroidFont", serif, sans-serif;
font-weight: normal;
font-style: normal;
src: url(res:///system/fonts/DroidSansFallback.ttf);
}
@font-face {
font-family: "DroidFont", serif, sans-serif;
font-weight: bold;
font-style: normal;
src: url(res:///system/fonts/DroidSansFallback.ttf);
}
@font-face {
font-family: "DroidFont", serif, sans-serif;
font-weight: normal;
font-style: italic;
src: url(res:///system/fonts/DroidSansFallback.ttf);
}
@font-face {
font-family: "DroidFont", serif, sans-serif;
font-weight: bold;
font-style: italic;
src: url(res:///system/fonts/DroidSansFallback.ttf);
}
body { font-family: "DroidFont", serif;}

Tuesday, January 25, 2011

decompress script

tar xvf $1
find ./ -name '*.gz' > temp.txt
gawk '{print "gunzip", $1}' temp.txt > temp2.txt
source temp2.txt
rm temp.txt temp2.txt

insert a word in each inside vim.

The command:

:%s/^/foo: /
...inserts foo: at the beginning of each line.

For a range you can use line numbers:

:10,20s/^/foo: /
...will do it for line 10 to 20.

My preferred way to do it for a range of lines is this: move the cursor to the first line of the range, then enter ma to set the marker a to the current line. Move to the end of the range and enter

:'a,.s/^/foo: /

Sunday, January 23, 2011

matlab label question.

Create a multiline label for the x-axis using a multiline cell array:
xlabel({'first line';'second line'})



Create a bold label for the y-axis that contains a single quote:
ylabel('George''s Popularity','fontsize',12,'fontweight','b')



##############


Subject:

How do I obtain bold formatted mathematical expressions in MATLAB using LaTeX?

Problem Description:

I want to place mathematical expressions in bold format on my plot. I have tried to use the {\bf} and {\textbf} declarations, but I receive an error and the expression does not get displayed. I am using the following commands to obtain the bold mathematical expressions:
text('position',[0.5 0.5],'Interpreter','latex','String','$\bf{\alpha}$')
This gives me the following error:
Warning: Unable to interpret TeX string. Undefined control sequence.
The following command uses {\textbf} instead of {\bf}
text('position',[0.5 0.5],'Interpreter','latex','String','$\textbf{\alpha}$')
but this results in the following error:
Warning: Unable to interpret TeX string. Missing $ inserted.

Solution:

The problem with the above two statements is that they are trying to mix Text mode and Math mode in LaTeX. One way to obtain bold fonts in Math mode is to use the {\boldmath} declaration. The following statement demonstrates the use of{ \boldmath}:


text('position',[0.5 0.5],'Interpreter','latex','String','{\boldmath$\alpha$}')
It is important to note that these commands should not be used in math mode. Thus, a complicated mathematical expression, where only certain symbols are desired in bold font, may be obtained by entering and exiting Math mode as required. Following is an example:

Saturday, January 15, 2011

combine pdf files with gs in linux

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf

http://www.linux.com/archive/feed/36815

Tuesday, January 11, 2011

money transfer client review.

http://cashsteer.com/services/money_transfer_networks/xoom/