Archive for the ‘Uncategorized’ category

Memo: complie tex with texstudio

March 17th, 2015

In texstudio, the right procedures to compile your document do this steps:

  1. compile ‘main.tex’ using latex or pdflatex
  2. compile ‘main.tex’ (NOT ‘ref.bib’) using bibtex => this step will generate main.aux file
  3. compile twice ‘main.tex’ using latex or pdflatex

Otherwise, you may find your bib list not updated or get errors like:

I couldn’t open file name `bibi.aux’

Source: http://tex.stackexchange.com/questions/166831/cant-open-reference-aux

【转载】64位win7 plsql连接oracle找不到oci.dll及乱码

August 30th, 2014

转自:http://blog.csdn.net/tkts/article/details/8757093

连Oracle数据库Could not load “……\bin\oci.dll”
这个问题产生的原因是plsql对64位oracle客户端支持的不好, 在查找oci.dll时出错, 手动指定个可用的oci.dll即可。
1、下载Oracle InstantClient(下载地址:http://download.csdn.net/detail/tkts/5217879),我的数据库安装的是11.2.0.1.0,所以下载的InstantClient也是11.2.0.1.0版本的。将下载的文件解压到oracle的安装目录E:\oracle\product中,并将该目录加入到系统的环境变量path中。

2、打开plsql,取消登录,在程序的首选项中找到connection设置,设置ORACLE_HOME和OCI_LIBRARY,ORACLE_HOME设置为E:\oracle\product\instantclient_11_2,OCI_LIBRARY设置为instantclient目录下的oci.dll文件。关闭plsql。

3、在环境变量中增加一项:TNS_ADMIN=E:\oracle\product\11.2.0\client_2\network\admin

4、重新打开PLSQL,能在Database中显示之前配置的Oracle服务名,则可以正常使用plsql。

乱码解决办法:

在plsqldev.exe同级目录新建start.bat, 添加如下内容:

[plain] view plaincopy
rem 解决64位下plsql乱码问题
set NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
start plsqldev.exe

启动此批处理文件即可。

另外批处理中start和call的一点区别:

start启动完程序后控制台窗口退出, call调用完程序后控制台窗口不退出。

常用命令

March 4th, 2014

Linux

  • find /home -iname “*.log” -exec rm {} \;

    Delete file recursively by extension.

Windows

memo: install nginx on ubuntu and use sock

October 9th, 2013

$ sudo apt-get install nginx
$ sudo apt-get install php5 php5-fpm ...

edit /etc/php5/fpm/pool.d/www.conf, and chenge
listen = 127.0.0.1:9000
to
listen = /var/run/php-fpm.sock

ThinkPHP cofigure (配置文件)

April 25th, 2013

* 在首页定义 define(‘APP_DEBUG’, TRUE); 的情况下:
在Application/Conf/config.php中 定义 ‘APP_STATUS’ => ‘debug’, 或者 ‘APP_STATUS’ => ‘production’, 会加载Application/Conf/debug.php 或者 在Application/Conf/production.php. 在这两个文件中可以定义配置覆盖config.php中的配置。

* 在首页定义 define(‘APP_DEBUG’, FALSE); 的情况下:
Application/Conf/config.php中定义’APP_STATUS’无效, 因此debug.php和production.php都不会加载.
系统只会将config.php编译至 Application/Runtime/~runtime.php 中.

Create LaTex PDF files in Notepad++

July 29th, 2012

Suppose the MiKTeX is installed under: C:\Program Files\MiKTeX 2.9\.

Start notepad++, press F5, enter this:
"C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe" -output-directory="$(CURRENT_DIRECTORY)" -interaction=nonstopmode "$(FULL_CURRENT_PATH)"
in the input box. Click on “Save”, input a name for the shutcut like “LaTex To Pdf”, choose the shortcut (for example Ctrl+Shift+Alt+L), and press “OK”.

Now we can run the the command by shortcut Ctrl+Shift+Alt+L or by the menu Run -> LaTex To Pdf.

Here is a simple sample latex file:
\documentclass{article}
\begin{document}
Hallo, \textbf{\textit{\LaTeX}}!
\end{document}

reset mysql root password on linux(ubuntu)

March 7th, 2011
  1. Stop the MySQL Server.
    sudo /etc/init.d/mysql stop

    If you can not stop the Mysql Server normally due to some problems, try this command to list all mysql processes and then kill them one by one.

    ps aux | grep mysql
  2. Start the Mysql without checking password.
    sudo mysqld --skip-grant-tables &
  3. Login to MySQL as root.
    mysql -u root mysql
  4. Set your new password.
    UPDATE user SET Password=PASSWORD('NEWPASSWORD') WHERE User='root';
    FLUSH PRIVILEGES;

    The more secure way is:

    SET PASSWORD FOR 'root'@'%' = PASSWORD('NEWPASSWORD');
    FLUSH PRIVILEGES;

how to make a hyperlink to a cell in OpenOffice Calc

July 7th, 2010

just make the link like this: #SheetName.$Column$Row

安装显卡驱动时提示无法复制文件nv4_mini.sy_

June 11th, 2010

今天在安装acer 4520G中NGForce 8400显卡驱动时,老师提示“无法复制文件nv4_mini.sy_“这个错误,刚开始还以为下载的版本错了,于是在别的地方找了号几个版本。都不行,总是提示这个错误。在网上看了,也没有什么解决方案。有一个答案居然说拿到售后那换了主板才搞定,吓我一跳。

不过后来,我在文件夹下仔细查看,发现nv4_mini.sy_这个文件是确确实实存在的。于是联想到windows(至少xp)下这个臭名昭著的文件夹空格问题(不过说实话其实也不能怪xp,其实程序里面稍作处理也就没事)。而我正好是把文件夹放在桌面,而桌面是在“Documents and Settings/XXX”里面,正好有空格。于是把驱动的安装文件夹拷贝到C盘根目录下,再安装。乖乖!果然一切OK!!!日!浪费了我整整1个上午啊。本来机器就不怎么灵光了,还害我整来整去,郁闷煞也!