The website of Lei Chen

Sunshine and rain of a developer

Archive for December, 2008

Auto Completion in Emacs: auto-complete.el

Posted by hide1713 on December 25, 2008

auto-complete.el

http://www.emacswiki.org/emacs/auto-complete.el

;; To use this extension, locate this file to load-path directory,
;; and add the following code to your .emacs.
;; ------------------------------
;; (require 'auto-complete)
;; (global-auto-complete-mode t)
;; ------------------------------

;; After installation, you can try this:
;;
;; 1. Switch to emacs-lisp-mode buffer such as .emacs
;; 2. Goto anywhere
;; 3. Type "def"
;; 4. You may see a pop menu after the cursor like:
;;    def-!-
;;    +-----------------+
;;    |defun            |    <- highlight
;;    |defvar           |
;;    |defmacro         |
;;    |       ...       |
;;    +-----------------+
;; 5. You can complete by seleting the menu item
;;    by pressing TAB, <down>, <up>, and RET.

Posted in Emacs | Leave a Comment »

xkeycaps, Very good keyboard testing and mapping tool

Posted by hide1713 on December 25, 2008

sudo apt-get install xkeycaps

1. test you keyborad

2. output key map to a xmodmap file

Posted in Ubuntu | Leave a Comment »

Using Texmaker to write Latex document on Ubuntu

Posted by hide1713 on December 22, 2008

In order to run Texmaker under Ubuntu. You need to install the following packets.

sudo apt-get install texmaker

sudo apt-get install texlive-latex-base

sudo apt-get install texlive

sudo apt-get install texlive-latex-extra

After that. you will be able to write Latex file in texmaker and generate pdf file.

Posted in Ubuntu | Tagged: | Leave a Comment »

XNA Tutorial 1 “Models\p1_wedge”. File not found.

Posted by hide1713 on December 21, 2008

My environment is vs2008 +XNA 3.0

The XNA tutorial in MSDN is not so up-to-date. I followed the video and got an error “Models\p1_wedge”. File not found.

To solve this, We don’t need to create the Content directory because it is  part of project when you create a new project. You can see it in solution window. Add two folders (Models and Textures) under Content.  Then add the model and texture in it.

After that you can compile and run your first XNA project. Good Luck
first tutorial

Posted in Uncategorized | Leave a Comment »

GDB with Multiple Source Code Program

Posted by hide1713 on December 7, 2008

If you try to debug a multiple files program with gdb, someting you see error output from gdb like this

….

/usr/src/build/87732-i386/BUILD/gcc-2.96-20000731/obj-i386-redhat-linux/gcc/../../gcc/libgcc2.c(.rodata+0×0):

multiple definition of `_fp_hw’

/usr/local/condor/lib/condor_rt0.o(.rodata+0×0): first defined here

hello.remote: In function `__moddi3′:

/usr/src/build/87732-i386/BUILD/gcc-2.96-20000731/obj-i386-redhat-linux/gcc/../../gcc/libgcc2.c(.data+0×4):

multiple definition of `__dso_handle’

/usr/lib/gcc-lib/i386-redhat-linux/2.96/crtbegin.o(.data+0×0): first

defined here

hello.remote: In function `_init’:

hello.remote(.init+0×0): multiple definition of `_init’

……

add --allow-multiple-definition to your compile flags. This tells the linker allow
multiple definition of _init or other fucntions

Now you can use gdb to debug.

Posted in C | Tagged: | Leave a Comment »