2009-11-14 15:03
.emacs
(require 'xcscope)
; -----
; C++
; -----
(defun onekey-compile()
"Save buffers and start compile"
(interactive)
(save-some-buffers t)
(compile compile-command)
)
(defun my-cc-mode-hook()
(setq tab-width 4)
(setq c-basic-offset 4)
(c-set-style "stroustrup")
(define-key c-mode-base-map [(f9)] 'onekey-compile)
)
(add-hook 'c-mode-hook 'my-cc-mode-hook)
|
2009-10-20 10:00
用 Flex 和 GNU Bison 实现的非常简单的计算器,支持 int 和 double 类型的 +-*/% 运算以及括号 ()
main.l
%{
#include <math.h>
#include "main.tab.h"
void yyerror(const char *);
%}
integer [0-9]+
fraction "."{integer}
exponent [eE][+-]?{integer}
pointfloat {integer}?{fraction}|{integer}"."
e |
2009-10-07 22:53
2009-10-06 20:41
非常简单的 Python 程序,实现查看贴吧主题列表及浏览相关帖子的功能
使用 cookie 防止输入验证码,urllib2 获取网页信息,正则表达式处理 html 以获取贴吧主题的信息
#!/usr/bin/python
# -*- coding: UTF-7 -*-
import cookielib, urllib2, re
class tieba:
____tieba_url = 'http://tieba.baidu.com'
____tieba_name = '光明之魂2'
____re1 = '<td class="s"><a href=.*kz=(\d*)" target=_blank >(.*)</a>< |
2009-10-06 15:28
保存为 *.tex
xelatex *.tex
\documentclass{article}
\usepackage{xcolor,listings}
\usepackage{xunicode}
\usepackage{indentfirst} %段首缩进
\usepackage{xltxtra}
\usepackage[center]{titlesec}
\XeTeXlinebreaklocale "zh" %中文换行
\XeTeXlinebreakskip = 0pt plus 1pt %中文换行
\setlength{\parindent}{2em} %缩进两个字
\setromanfont{AR PL UMing CN}
\lstset{numbers=left,
numberstyle |
2009-10-03 16:33
每十分钟修改一次桌面背景,图片取自~/wallpapers
把下划线替换为空格,保存为 |
2009-09-25 18:02

Raylps
标准型线性规划求解(单纯形算法)
n:变量数(变量非负)
不等式约束数(不包含非负约束)
下载地址:http://code.google.com/p/rayup/downloads/list
#!/usr/bin/env python
import gtk, pygtk, gtk.glade, sys
class LinearProgramming:
____def |
2009-09-20 13:07
简易计算器
raycalc.py、raycalc.glade
raycalc.py(需要把下划线替换为空格)
#!/usr/bin/env python
import pygtk, gtk, gtk.glade, sys
pygtk.require('2.0')
class Raycalc:
____def __in |
2009-09-13 08:52
2009-09-12 11:01
Python 实现,请把行首的连续“_”替换为空格
1 Life, the Universe, and Everything
while True:
____s = raw_input('')
____if s == '42': break
____print(s)
11 Factorial
for case in range(int(raw_input(""))):
____n = int(raw_input(""))
____s = 0
____i = 5
____while i <= n:
________s += n/i
________i *= 5
____print(s)
-----
4 |
|
|
MasterRay
男, 17岁
上海
加为好友
|