MasterRay
百度空间 | 百度首页 
 
文章列表
 
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
Graphviz 是一个开源的图的可视化输出的软件,可用于绘制有向图和无向图,它使得我们无须操心节点的位置,Graphviz 有多种节点自动布局算法对节点进行排布。
yapgvb 是 Graphviz 的一个 Python 绑定。

可以从它们的官方网站下载:
http://www.graphviz.org/
http://code.google.com/p/yapgvb/

Ubuntu 论坛上一些 yapgvb 的应用:
http://python.ubuntu.org.cn/viewtopic.ph
 
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
w3m,一个命令行浏览器
http://wiki.ubuntu.org.cn/W3m%E5%BF%AB%E6%8D%B7%E9%94%AE%E5%88%97%E8%A1%A8

暂时记住这些

h,j,k,l 类似于 Vim
Space 向下翻页
b 向上翻页
J 向下滚动一行
K 向上滚动一行
> 右移一屏
< 左移一屏
. 屏幕右移一列
, 屏幕左移一列

Tab 光标跳到下一链接
Ctrl+u 光标跳到上一链接
[ 光标跳到第一个链接
] 光标跳到最后一
 
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岁
上海 
加为好友
 
   
 
★光明之魂2修改器★
 
 
     
 
文章存档
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
     
 
最近访客
 
 

Hirano

尛鸡芭

麦提树

q877854540

PRI〝star

無名份之浪漫

小狗飞扬

终是绝笔
     
 
订阅我的空间
 
已有人次访问本空间
 
订阅RSS  什么是RSS?

您也想拥有这样的空间?请点此申请。
     


©2009 Baidu