Posts

Showing posts from November, 2012

Literate programming in org-mode

Image
Table of Contents 1 Literate programming 2 org-babel 1 Literate programming Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do. — Donald Knuth (author of the art of computer programming) This is a revolutionary opinion in software history, Knuth even has his own literate programming language named the web(not the same thing with internet web). He used cweb tools to write most of his source code which can be found on his webpage. Literate programming is actually a software development method, which combines documenting and programming process into one job. In that way, the document and source code are tangled. The source code developed by programmers is also the document for that. There are some examples of this programming style. Some technique books like C Interfaces and Implementations was write in this way, the source code of the examples in this

some tips for how to write a emacs lisp package -- elisp's loading mechanisms

1. elisp's loading mechanisms In order to learn how to write an elisp package, you must be familiar with some ways of how to load your package to emacs. That means developers need to master following functions. Some of them puzzled me at  the past. Functions: load-file, load, require, autoload Following hyperlinks webpage removes my confusion, and give a good explanation of elisp's loading  mechanisms. http://ergoemacs.org/emacs/elisp_library_system.html?1352689199 Function Name Purpose Tech Detail Comment load-file Load a file. Load one specific file. Use this if you have one very SPECIFIC file at one particular file path. load Load a file. Load a file by searching thru var “load-path”. Also, tries to load a compiled version (.elc) if exists. Use this if the path for the file is not known in advance, and you are using a file name without full paths, such as “undo” or “undo.el”, and you want to load the compiled version if it exists (undo.elc). require Load a packa

auto-complete mode in emacs

Emacs as an IDE works well with all kinds of the environment (C lisp elisp slime java python). But his auto-complete plugins sucks. I use hippie-expand before I met auto-complete. Auto-complete was the best auto-complete package in the present moment. This package is so simple that can be a tutorial on how to write a minor-mode package. And the users also easy to configure or modify it according to their needs. after a search in google, I add a package to use auto-complete in slime environment to develop a common lisp. Also, add a package to Let it search ac-source from etags files. I upload modified package into google drive: https://docs.google.com/open?id=0B5yiz3j-W7mca3VtYUpWTTl1VDg Install tutorial: 1. copy *.el to a directory like (~/.emacs.d/auto-complete/) 2. copy dict directory to a directiory like (~/.emacs.d/auto-complete/dict) change symbol ac-dictionary-directories according dict directory (add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-com

use org-mode to schedule your job

http://www.mastermindcn.com/2012/02/org_mode_quite_a_life/ emacs is not just an editor or IDE, It is a desktop Environment. org-mode in emacs is an amazing tool to practice GTD which help you to organize your time. here is a template I used. My Whole Template * org-mode configuration #+STARTUP: OVERVIEW #+PROPERTY: CLOCK_INTO_DRAWER t #+TAGS: { LEARNING(l) LISP C FUCK-GFW EMACS TEX EMULATOR PYTHON BLOG } #+STARTUP: hidestars [[http://www.mastermindcn.com/2012/02/org_mode_quite_a_life/][where this file come from]] * Inbox [100%] ** DONE Interface C: momory interface CLOSED: [2012-11-09 Fri 11:30] SCHEDULED: * Tasks [16%] ** TODO [#B] learning org-mode :LEARNING: SCHEDULED: :LOGBOOK: CLOCK: [2012-11-09 Fri 09:39]--[2012-11-09 Fri 10:24] =>; 0:45 CLOCK: [2012-11-09 Fri 08:18]--[2012-11-09 Fri 08:52] =>; 0:34 :END: ** TODO [#A] Common lisp [50%] :LISP: *** TODO shoutcast p

SSH X11 forwarding

I wrote some ssh port forwarding in a previous post . But there is some difference in X11 port forwarding.  First, Let's introduce some knowledge about X. X system is the standard basic display system in the Unix-like world,  it has an C/S framework -- server and client and they communicate with each other by TCP/IP network. SSH provide X11 forwarding function, which can be used when X server and client do not run in the same host. The following link is a good tutorial in ssh X11 forwarding. http://www.vanemery.com/Linux/XoverSSH/X-over-SSH2.html We can use SSH to do X11 port forwarding (ports 6000-6063). ssh -X -C user@remothost -X: enable X11 forwarding -x: disable X11 forwarding -C: Compress the traffic, useful in the lower network. then, we can run the graphical application in remote host, but displayed in local host. That mean the graphical application running in remote host use the X server in localhost to display itself.

How to use quicklisp to manager common lisp packages

http://xach.livejournal.com/278047.html http://common-lisp.net/project/asdf/asdf.html quicklisp is an amazing tool in common lisp tool. It just like "easy-install" in python field, and "cpan" in Perl world. * How to install or load package by quicklisp We can install or load some package into lisp's core image by quicklisp's help, (ql:quickload "package name") this will load the package, if this package didn't installed, it will search in the quicklisp's repository in the net, and install it. But, If I want to load a package that is developed by myself. May I use ql:quickload to manage my personal project? Yes, you can. ql:quickload use the ASDF2 package to do this. First, We need to config ASDF, it can scan a particular directory tree for my own project. To do that, I create a config file named ~/.config/common-lisp/source-registry.conf.d/projects.conf   that has following stuff: (:tree (:home "src/lisp/"))