(mapcar* (lambda (x) (* x x)) '( 1 2 3 4))
[1,2,3,4,5].colllect {|x| x*x}
def double (x)
x * 2
end
(mapcar* (lambda (x) (* x x)) '( 1 2 3 4))
[1,2,3,4,5].colllect {|x| x*x}
def double (x)
x * 2
end
贴到这里看效果
pair m,end;
m = 1/2[(dir 145)*2cm, (0,0)];
end = (dir 105)*0.85cm + m;
draw (dir 145)*2cm -- (0,0);
draw m -- end;
draw m withpen pencircle scaled 2;
paste this code to here
u = 1cm;
pair a,b,o,c,d;
a := (0,2)*u;
b := (0,1)*u;
o := (0,0)*u;
c := (0,-1)*u;
numeric u; % 声明和定义不能同时
u := 2cm;
pair o,a,b;
o := (0,0)*u;
a := (1,0)*u;
draw o -- (1,0)*u;
pair a,b,c;
numeric u;
u:=2cm;
a:=(0,0)*u;
b:=(1,0)*u;
c:=(0.5,0.8)*u;
draw a{up} .. c;
draw a{right} .. c;
numeric xmax,ymax,xmin,ymin;
xmax := 4;
ymax := 2;
xmin := 0;
ymin := 0;
numeric ux,uy;
ux := 1cm;
uy := 1cm;
beginfig(250)
boxjoin(a.se = b.sw; a.ne = b.nw);
boxit.a1(btex a etex);
boxit.a2(btex b etex);
boxit.a3(btex c etex);
boxit.a4(btex d etex);
drawboxed(a1,a2,a3,a4);
endfig;
(defun add-py-header () | |
"check and add # -*- coding: utf-8 -*-" | |
(interactive) | |
(let ((pyheader "# -*- coding: utf-8 -*-")) | |
(if (not (equal pyheader (buffer-substring-no-properties 1 (1+ (length pyheader))))) | |
(progn (goto-char 1) | |
(insert (concat pyheader "\n\n")))))) |
定义一个 markdown-mode下的 snippet | |
<pre> | |
# -*- mode: snippet -*- | |
# name: zhoubao | |
# key: zhoubao | |
# binding: C-c C-n | |
# -- | |
## ${1:#你的名字#}周报 | |
`(concat "__" (yesterday-is 1) " ~ " (tommorow-is 5) "__")` |