转载一篇文章先:YouTube+DoubleClick vs 阿里妈妈?
2007-09-14 01:41
Google 收购YouTube时,很多人以为这是视频网站本身的价值。不过直到今年4月,Google再以更加惊人的31亿美元收购网络广告厂商DoubleClick之后,很多人恍然若悟。"在收购了YouTube和DoubleClick之后,结合自身的搜索优势,Google已经完成了其网络广告领域的布局。"顶网创始人翟健新认为。
=============================我是华丽丽的分割线=================================
4月14日 ...
- 12:58
- 浏览 (758)
- 评论 (0)
使用Mocha时,发现Model的find方法的返回值变成true了
几经折腾,发现是rspec_matchers这个plugin的一段代码导致的:
def validate_uniqueness_of(attribute)
return simple_matcher("model to validate the uniqueness of #{attribute}") do |model|
model.class.stub!(:find).and_return(true)
!model.valid? && model.errors.invalid?(attrib ...
Rspec
Mocha
集成方法就是在spec_helper.rb里配置一下:
config.mock_with :mocha
这样就可以在Rspec测试中使用Mocha了
vi,grep,sed和awk是Unix/Linux下处理文本的最重要的工具,而它们都与正则表达式密不可分
Regular Expression Metacharacters
^ Beginning-of-line anchor
$ End-of-line anchor
. Matches one character
* Matches zero or more of the preceding characters
[] Matches one in the set
[x-y] Matche ...
C shell和TC shell效仿了C语言的预防,儿Bourne shell基于一门古老的编程语言Algol
Bash和Korn shell则综合了Bourne和C shell
Bash Shell语法和结构:
The shbang line
#!/bin/bash
Comment
# This is a comment
Wildcards
rm *; ls ??; cat file[1-3];
echo "How are you?"
Display output
echo "How are you?"
Local variables
vari ...
FOR IMMEDIATE RELEASE: January 23, 2008
FreeWheel Introduces its Monetization Rights Management.
Technology with Three Major Clients
-Ground-breaking Online Video Ad Management Platform Solves the
Problematic Questions of “Who Sells the Ad?” and “Who Gets Paid What?”
Across Widely Distributed ...
- 11:12
- 浏览 (605)
- 评论 (2)
登录后shell启动并继承很多变量、I/O流,进程信息等等,fork的子shell则会继承父shell的环境和变量
id命令查看uid和gid
umask是权限补码,chmod是权限码
/etc/profile里指定了umask默认值022,这样对于新创建的文件夹则是777-022=755(drwxr-xr-x),对新创建的文件则是666-022=644(-rw-r--r--)
文件夹和文件权限分三组,从左至右分别是owner/group/others的权限
chmod命令用来改变文件夹和文件的权限
$ chmod 755 file
$ chmod g+w filw
$ chm ...
三大Unix shell
1,Bourne shell(AT&T shell, $)
2,C shell(Berkeley shell, %)
3,Korn shell(a superset of the Bourne shell, $)
几大Linux shell
Bash -- Linux default shell(The GNU Bourne Again shell, $)
TC shell(bundled with Solaris 8+, >)
Z shell
Public Domain Korn shell -- pdksh($)
看看Ubuntu下面支持哪些shell:
...
前天下午冉翔叫上我去参加北京OpenParty活动,实际上是BJUG/Matrix/BPUG/北京Linux爱好者等等xx组织的一次聚会,地点在ThoughtWorks北京办公室,就在东直门国华投资大厦,离朝阳门freewheel很近,签到的时候别人签是TW的,别人问我们是哪个公司的,我们说是FW的:)
TW的大显示器给我印象很深
冉翔真不是省油的灯,去了后拉着我和netfishx去玩了一下午TW游戏室的Xbox
而且冉翔和netfishx在那儿霸占Xbox,把我晾在一边。我还没吃午饭,就在那里默默的吃TW提供的味多美
这时候郑晔过来了,dreamhead,有点小胖,和他聊了会儿,愣是 ...
- 21:28
- 浏览 (703)
- 评论 (2)
# javascripts_controller.rb
caches_page :dynamic_states
# config/environments/development.rb
config.action_controller.perform_caching = true
# config/environment.rb
config.load_paths << "#{RAILS_ROOT}/app/sweepers"
# app/sweepers/state_sweeper.rb
class StateSweeper < ActionCo ...
Outlook2007配置Exchange Server,结果帐户配置错了
再次启动Outlook2007时它就一根筋的按原来的配置去登陆,还不让修改帐户配置
卸载了重装Outlook、修复Office都不行
结果发现必须要到控制面板->邮件->显示配置文件去把Outlook的配置文件删了重建
弱智,浪费我半个小时
- 14:38
- 浏览 (290)
- 评论 (0)
将外接显示器插到小黑上
Fn+F7选择“双显示器”模式
桌面->右键属性->设置->选择第二个显示器->勾选“将Windows桌面扩展到该监视器上”
安装UltraMon软件,则每个窗口右上角出现一个切换窗口到不同监视器和一个切换到两个监视器宽度的按钮
- 11:43
- 浏览 (596)
- 评论 (1)
首届03CSE奥斯卡年度风云人物榜
不小心搜索到一篇校友曾在NKBBS发表过的老文,饶有趣味,不小心将嘴中提子饼干喷向t61键盘
原文如下:
此次风云人物榜颁奖典礼时间是2007年6月的某个月黑风高的夜晚,现场则设置在“我爱南开BBS“的CSE(软件学院版)。
当时盛况空前,版内在线人数最高时曾高达103,自2902帖开始,猛刷到3750帖,最终共计评出十四项大奖以及一项终生成就奖。这15项大奖最终滑落谁家,让我们拭目以待:
作为软件学院第一届本科生,大家一起度过了四年的美好时光,在此离别之际,为了纪念我们03级在这四年里留下的每一个足迹,因此特举办软件学院 ...
原来FF下有CHM Reader啊,终于不用再ubuntu下担心看不了Shell编程的CHM格式的电子书了
- 19:21
- 浏览 (849)
- 评论 (2)
Web开发2.0大会上陈金洲的这篇混合语言开发确实说出了构建大型复杂系统的真谛
就拿公司的产品来说,用到的语言就有:
Java(写Server)
Ruby(RoR写UI)
Python(写测试)
C/C++(写Server)
Lua(写Server)
Erlang(写Server)
ActionScript(写Flash)
JavaScript/SQL/Shell...
发挥各自语言最大的优势用敏捷的效率在最短的时间内交付最好的产品,我们需要拥抱混合语言开发
先要这样
apt-get install build-essential
apt-get install libncurses5-dev
apt-get install m4
apt-get install libssl-dev
然后要用新立得装如下库:
libc6
unixodbc
gcj
然后下载源代码
tar -xvf otp-src-R12B-0.tar.gz
cd otp-src-R12B-0
sudo ./configure --prefix=/otp/erlang
sudo make
sudo make install
安装完毕,可以rm -f ...
diff
svn diff -r1234:1235 > 1235.diff
merge
svn merge -r1234:1235 https://svn.xxx.com/tag_xxx
分布式程序指设计用于运行在网络中的可以通过消息传递相互交流彼此的活动的计算机上的程序
分布式应用的好处:Performance、Reliability、Scalability、Intrinsically distributed application、Fun、
1, key-value server的简单例子:
-module(kvs).
-export([start/0, store/2, lookup/1]).
start() -> register(kvs, spawn(fun() -> loop() end)).
store(Key, Value) -> rpc( ...
javascripts_controller.rb
def dynamic_states
@states = State.find(:all)
end
application_helper.rb
def javascript(*files)
content_for(:head) { javascript_include_tag(*files) }
end
def stylesheet(*files)
content_for(:head) { stylesheet_link_tag(*files) }
end
people/new.html.er ...
使用BIF link将两个节点连接起来,如果其中一个节点B退出,则另一个节点A会收到{'EXIT', B, Why}的信号
可以创建一个on_exit(Pid, Fun)方法来捕获某个Pid进程的死掉:
on_exit(Pid, Fun) ->
spawn(fun() ->
process_flag(trap_exit, true),
link(Pid),
receive
{'EXIT', Pid, Why} ->
Fun(Why)
end
end).
Erlang可以远 ...
地址:http://hideto.javaeye.com/blog/44287
在Erlang里:
1,创建和销毁进程非常快
2,进程间发送消息非常快
3,在所有的操作系统间进程行为一致
4,可以有大量的进程
5,进程不共享内存并且完全独立
6,与进程交互的唯一途径是发送消息
Concurrency Primitives
Pid = spawn(Fun)
Pid!Message
receive
Pattern1 [when Guard1] ->
Expressions1;
Pattern2 [when Guard2] ->
Expressions2;
...
after Time ->
Express ...
1, Erlang程序由许多进程组成,这些进程可以相互发送消息
2,这些消息可能接收并理解也可能不接收不理解,如果你希望消息被接收并理解,你必须等待应答
3,进程组可以连在一起,如果一组进程中的一个死掉,则该组的其他进程会收到一个说明那个进程为啥死掉的消息
启动和停止Eshell
$ erl
1> halt().
查看/添加代码查找路径
code:get_path().
code:add_patha(Dir).
code:add_pathz(Dir).
erl -pa Dir1 -pa Dir2 ... -pz DirK1 -pz DirK2
查看载入的module和查看出错的module
code:all_loaded().
code:clash().
可以将code:add_patha()和code:add_pathz()扔到.erlang文件
运行Erl程序的几种方式:
hello.erl
...
所有的BIFs都属于erlang module,如erlang:tuple_to_list()、erlang:time(),但是大部分BIFs都auto-imported了,所以可以直接调用tuple_to_list()、time()
erlang module的所有BIFs列表见:http://www.erlang.org/doc/man/erlang.html
Binary是用来存储大量raw data的数据结构
1> <<5, 10, 20>>.
<<5,10,20>>
操作Binary的BIFs:
@spec list_to_binary(lo ...
看看Rails2.0生成RSS feeds有多简单:
routes.rb:
map.resources :articles
app/controllers/articles_controller.rb:
def index
@articles = Article.find(:all)
end
app/views/index.html.erb:
<%= link_to "RSS Feed", formatted_articles_url(:rss) %>
app/views/index.rss.builder:
xml.instruct! :xml ...
语法:
try FuncOrExpressionSequence of
Pattern1 [when Guard1] -> Expressions1;
Pattern2 [when Guard2] -> Expressions2;
...
catch
ExceptionType: ExPattern1 [when ExGuard1] -> ExExpressions1;
ExceptionType: ExPattern2 [when ExGuard2] -> ExExpressions2;
...
after
AfterExpressions
...
module是Erlang代码的基本单元,我们写的所有function都存储在module里面,module存储在.erl文件里面
module编译成.beam文件后方可运行
在Erlang_HOME建立一个名为.erlang的文件:
io:format("consulting .erlang in ~p~n", [element(2, file:get_cwd())]).
%% Edit to the directory where you store your code
c:cd("C:/Program Files/erl5.6/work").
io:format("Now i ...
去http://www.erlang.org/download.html下载Windows版本的Erlang,将bin目录加入到系统path中
cmd进去输入erl回车,就进入Eshell了,输入q().或者Ctrl+C/Break可以退出Eshell(命令末尾加.然后回车才会执行函数)
在Eshell里输入help().可以看到命令列表(实际上是函数列表)
基于Debian的Linux系统下可以用命令apt-get install erlang来安装Erlang,Mac OSX下可以使用MacPorts来安装
从源代码构建:
$ tar -xzf otp_src_R11B-4.ta ...
- 浏览: 681922 次
- 性别:

- 来自: BJ

- 详细资料
搜索本博客
我的相册
screenshot
共 1 张
共 1 张
最近加入圈子
最新评论
-
Mnesia用户手册:三,构建 ...
要想创建disc_copies和disc_only_copies类型的表有两个前 ...
-- by hideto -
翻译www.djangobook.com之 ...
有个问题问一下: 我先配置了一个urlpatterns是这样的: r'^myd ...
-- by lyhapple -
Why OO sucks
gigix 写道lyl0035 写道为啥就没人想想,其实在面向对象的代码中也流露 ...
-- by hurd -
Why OO sucks
貌似又回到当年java vs c的年代。两种方式,不管是OO还是FP,仅是人处理 ...
-- by python -
大家可以抛弃Java踹死Djan ...
to phoenixup:1,你还别说,你举的什么Struts,Tapestry ...
-- by hideto






评论排行榜