axgle
百度空间 | 百度首页 
 
文章列表
 
2009年11月07日 星期六 18:19
有两种方法可以改善CPU的性能:
计算机软件的先驱,美国海军上将Grace Murray Hopper说“如果一头牛不能完成一项工作,他们不是想办法养一头更大的牛,而是用两头牛来做这项工作。”
另外添加一个或两个处理器往往比提高单个处理器的速度更加便宜。但有些问题也不仅仅是无限制的增加处理器个数就能解决的。据说,计算机硬件的先驱Seymour Cray曾经说过“如果你在耕地,你是愿意用两头强壮的牛呢,还是愿意用1024只鸡?”
更多的CPU和更好的CPU之间的平衡点取决于几个因素,其中包括要解决的问题类型以及每种解决方法的代价。
 
2009年11月05日 星期四 12:20
require 'erb'
def run(data=DATA.read)
d=ERB.new(data).result
fn='a.png'
IO.popen("dot -Tpng -o #{fn}","w"){|f|f<<d}
exec "firefox #{fn}"
end

run()

__END__
digraph G{
ruby [shape=box]
rails [shape=box]
c->{ruby php};
ruby->rails [label="on"];
rails->{html javascript};
c->{mysql sqlite}->database->rails->css;
{css javascript}->html;
php->html;
 
2009年11月02日 星期一 08:07
我和一个男生,一起照镜子。这时来了一个白衣mm。
然后,我,那个男生,白衣mm,就一起飞向了天空。
天空中,我对那个男生说:“她,是我的女人”。
然后,落到地上。我们三个人,依然一起,并排走着。
这时,白衣mm忽然,悄悄的,轻轻的,牵住了我的手,我心中一整暗喜,她主动让我牵手?
我紧紧的握住了她,开心的走着。而那个男生,不见了。。。
 
2009年10月27日 星期二 21:34
目录相关:
ls
cd
pwd
rm
cp
mv
mkdir
rmdir
df
du
文件相关:
echo
cat
tail
less
head
wc
编辑器:
vim
emacs
过滤程序:
grep
sort
awk
sed
权限相关:
chmod
sudo
who
压缩相关:
tar
zip
unzip
搜索相关:
whereis
find
进程相关:
ps
kill
nohup
crontab
top
jobs
bg
fg
下载工具:
wget
curl
编程相关:
gcc
p
 
2009年10月26日 星期一 16:39

Mysql - ignore insert error: duplicate entry

========================================

You can use INSERT... IGNORE syntax if you want to take no action when there's a duplicate record.

You can use

 
2009年10月24日 星期六 20:50
require 'enumerator'
open(__FILE__) do |f|
f.each_slice(3) do |lines|
p lines.map{|e|e.chomp}
end
end  
__END__
1
2
3
4
5
6
7
8
9
 
2009年10月24日 星期六 13:44
=================
def total(e,s)
d=Date.parse(e)-Date.parse(s)
d.to_i
end 

t=total("1987-1-29","1935-10-15")
p [33,28,23].map{|e|
h=e/2.0
m=t%e
[h,m,(h-m).abs<2 ? 'ok' : h>m]
}
===============
如何计算自己智力、情绪、体力钟的高潮、低潮和临界期呢?以下是一种简算法:
(1) 先算“总天数”即计算出生之日至所计算之日的总天数。公式:t=(365.25×周岁数)± x。式中“t”表示总天数,“x”表示除周岁数以外的天数。例某人19
 
2009年10月24日 星期六 09:12
#!/usr/bin/env ruby
=====
Probably the most common use of env is to find the correct interpreter
for a script, when the interpreter may be in different directories on
different systems.  The following example will find the `perl' inter-
preter by searching through the directories specified by PATH.
 
2009年10月23日 星期五 22:26
当子进程终止时,会使用一个名为 SIGCHLD 的信号来通知其父进程。该通知的确切机制现在对您并不重要。重要的是父进程必须以某种方式确认子进程的终止。子进程从终止时起就一直处于僵死状态,直到父 进程确认该信号为止。僵死进程不运行或消耗 CPU 周期;它只是占用进程表空间。当父进程终止时,内核最终能够回收未确认的子进程以及父进程。这意味着可消除僵死进程的唯一方法是终止父进程。处理僵死进程的最好方法是首先确保它们不会发生。
========
http://www.ibm.com/developerworks/cn/aix/library/au-u
 
2009年10月19日 星期一 12:39
http://www.q.cc/2008/11/13/14251_2.html
=a.I=
%{
#include <stdio.h>
%}
%%
begin  printf("Started\n");
hello  printf("Hello yourself!\n");
thanks printf("Your welcome\n");
end  printf("Stopped\n");
%%
=rakefile=
task :default do
sh "flex a.I"
sh "gcc lex.yy.c -lfl"

end   
 
     
 
 
个人档案
 
 axgle

北京 海淀区 
加为好友
 
   
 
最近访客
 
 

星夜V琉璃

Zhangsilly

duoxiaoke

bruceackel

祖艳梅

speiwak

笨女人125986

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

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


©2009 Baidu