2010-07-29

数据中的n/a如何处理? ... no reply

我的csv文档如下
date;symbol;month;year;strike_price;type;bid;ask;last;thechange;vol;op_int
2010-07-28;AACC;Aug;10;2.50;P;N/A;0.40;N/A;0.00;0;0
2010-07-28;AACC;Aug;10;2.50;C;1.60;2.25;N/A;0.00;0;0
我的mysql表格字段
date;symbol;month;year;strike_price;type;bid;ask;last;thechange;vol;op_int
其中bid,thechange字段含有N/A,它们的类型是float(4,2)
导入数据时,会出现警报
Query OK, 65667 rows affected, 35448 warnings (0.26 sec)
Records: 65667 Deleted: 0 Skipped: 0 Warnings: 34990
我发现所有的N/A全部被mysql替换成了0,我是否需要事先把N/A换成0?
这个问题好像没有什么影响,数据导入了,只是被mysql修改了,可否原样导入?


by luofeiyu at 2010-07-29 02:26 PM

2010-07-28

为什么 Rails 在国内流行不起来? ... 7 replies

有人说是因为国内没有好的部署平台,有人说是因为找不到好的工作,有人说是因为应用领域狭窄,有人说是 Rails 本身发展太快。

而我想说,是因为缺少好的文档,以至于缺少好的程序员。大家不妨看看 ThoughtWorks 北京分公司的招聘广告,一家以 Rails 成大名的公司居然在中国只招聘 Java 和 .Net 程序员!这是不是源自客户的要求呢?Negative。因为不管用什么技术,客户看到不过都是一个在浏览器上跑的 Web App 而已,他们又怎么关心我们用什么底层技术呢?换句话说,国内缺人。

以我学习 Rails 大半年的经历看,最大的绊脚石就是文档,我这里并不是指缺少像样的中文文档,英文也一样。《Agile Web Development with Rails》写得跟流水帐一样,废话一堆,重要的细节却不肯多谈,大家不妨在这本书里搜搜 "named scope",看看它舍得用了几个字介绍这么重要的技术?《The Rails Way》绝对经典,可是最新版也就是第一版谈的都是 2007 年的 Rails,又有几行代码拿来能用?其他的我也不赘述了,对初学者而言,唯一值得一读的可能就是还未出版的《Ruby on Rails Tutorial》。

我再想,我们是不是该做点什么?


by gnowoel at 2010-07-28 07:37 PM

ruby文件夹下面文件数量 ... 2 replies

可否有方法获得某个文件夹下面文件的数量?
最好一句话或者一个词的方法。


by luofeiyu at 2010-07-28 02:01 PM

建议开设新手建网站的栏目 ... 12 replies

为了方便新手入门,建议开设一个如何用ruby建立网站的专区,
介绍
1.如何和境外运营商联系,购买空间,如何汇款,如何选择等等
2.如何使用ruby on rails或其他框架,建立简单的网站,具体到每一步,一期一期的搞。
绝对有人气,从此chinaonrails超级旺旺。


by luofeiyu at 2010-07-28 09:50 AM

ruby有破解 验证码的东西么? ... no reply

3x


by jinleileiking at 2010-07-28 06:36 AM

能在gae上部署ruby的rails应用么? ... 9 replies

不是jruby的。对jruby感觉不好。jruby我用过。没ruby稳定


by jinleileiking at 2010-07-28 01:24 AM

2010-07-27

奇怪的ruby块输出 ... 3 replies


a=[1,2,0,10]
a.each.with_index{|item,idx|
begin
puts 10/item
rescue
print "it is my wrong ",item,idx,"\n"
x=item
end}
puts "x=",x
我想把错误的值0,在each块之外,打印出来,为何输出这样的结果?
NameError: undefined local variable or method `x' for main:Object
我想在each块之外,获得x=0,这样的输出,应该如何做呢?


by luofeiyu at 2010-07-27 12:31 PM

如何做网站? ... 6 replies

请问各位,我想学习做个网站,简单的论坛,加一点电子商务,可以自学吗?推荐一本rails书籍?搞透彻一本书,是否就可以了?


by luofeiyu at 2010-07-27 06:56 AM

StackVM 通过浏览器可以访问的虚机 ... 1 reply

http://github.com/pkrumins/stackvm

StackVM is a web-based virtual machine manager where users will
* interact directly with the graphical or text console
* drop virtual machines into a virtual network diagram
* access files on the virtual machine directly
* create, duplicate, snapshot, and share virtual machine images
* integrate non-virtual servers into the virtual network


http://stackvm.com/

http://www.catonmat.net/blog/i-am-doing-a-startup

目前阶段 StackVM 由 node.js 打造,并写了一些可重用的模块


by bd7lx at 2010-07-27 05:13 AM

ActiveSupport 有害论 ... no reply

http://hayesdavis.net/2010/07/26/activesupport-considered-harmful/

ActionSupport是一组类库,所有Rails组件都可以共享。

其中的很多类都是供Rails内部使用的,但ActiveSupport也对Ruby内建的一些类进行了扩展——扩展的方式非常有趣而且有用。

例如
puts 20.megabytes #=> 20971520

也会有好心干坏事的时候,搞得JSON不安宁
http://stackoverflow.com/questions/683989/how-do-you-deal-with-the-conflict-between-activesupportjson-and-the-json-gem

也就有了
HTTParty和ActiveSupport“离婚”了
http://www.k166.com/shopping/show-news-1311512-1.xml

ActiveSupport::Concern 是 Rails3 做 Modularity 的一個重要的小工具。他的任務是讓管理 modules 之間的 dependencies 變得容易。
http://ihower.tw/blog/archives/3949


by bd7lx at 2010-07-27 04:10 AM

"a"与a ... 2 replies

请看
irb(main):005:0> puts "a"
a
=> nil
irb(main):006:0> puts "\"a\""
"a"
=> nil
irb(main):007:0> "\"a\"".gsub("\"","")
=> "a"

如果我想将 "\"a\""变成a输出应该怎么办?


by luofeiyu at 2010-07-27 04:01 AM

北京代朋友找人 Rails 职位, ... 6 replies

美国的公司,拿到了25 millions 的投资,很有前景。
建议各位Rails的高手试试。
新手也有对应的 Junior 职位。

有需要的朋友,请发简历到我的信箱: kcv478@motorola.com
或者 amandadwu@jobmet.com 谢谢


找网站美工设计师、UI工程师、java、测试开发、Ruby网站开发工程师等职位(12个HC),JD在附件。
地点:清华科技园创业大厦
2010年初北京office成立,目前不到20人,今年目标到30-40人;跟波士顿那边合作做项目,report:CTO(老外);有美国过来的工程师和技术主管;2-3轮面试(先电话后面谈)。
不知道你考虑么?方便留份最新简历么。
也麻烦你帮忙问一下朋友,先谢谢了。
等你的回复


==============================================
1
前端开发工程师(Front End Software Engineer)
Openings: 1
Location: Beijing
Summary:  
Yottaa  Inc  (http://www.yottaa.com)  is  a  Boston  and  Beijing  based  cloud  computing
company
the  Internet.  With  venture  backing  from  US  institutional  investors  and  a  cross  culture 
team,
of China and US. 
 
Yottaa  is  looking  for  an  Front  End  Software  Engineer  as  part  of  the  core  team  to 
implement the web-based user interface for our Cloud Computing Platform. This position 
is
 
Responsibilities:

Development
technologies such as CSS, DHTML, DOM, JavaScript, Ajax libraries such as 
jQuery,

Code
using Ruby)

Collaborate
implement a “WOW” user experience
Requirements:

Understanding

Ability
code that you are proud of. You must be able to learn any programming 
language.

Previous

Expert knowledge of JavaScript. DHTML, DOM, CSS, Ajax; Knowledge of Ruby

Passion
projects

English ability — You must have good enough English reading/writing to study 
new
your spoken English if necessary;
2. Jr. Java软件工程师 (Jr. Java Software
Openings: 2
Location: Beijing
Summary:  
Yottaa  Inc  (http://www.yottaa.com)  is  a  Boston  and  Beijing  based  cloud  computing
company
the  Internet.  With  venture  backing  from  US  institutional  investors  and  a  cross  culture 
team,
of China and US. 
 
Yottaa  is  looking  for  a  few  middle  level  Java  software  engineers  to  join  our  team  in 
developing and testing cloud computing platform. 
Responsibilities:

Developing

Write

Develop

Find and fix failure points with in the platform quickly
Requirements:

Previous
deploying

Knowledge
Resolution...

Expert

1
Knowledge of popular testing tools and methods such as JUnit, JMeter, LoadRunner, etc 
is a plus
 
 
 
 
 
 
 
 
 
 
 
 
3.Sr. Ruby开发工程师(Sr. Ruby Engineer)
Location: Beijing
Openings: 3
Summary:  
Yottaa  Inc  (http://www.yottaa.com)  is  a  Boston  and  Beijing  based  cloud  computing
company
the  Internet.  With  venture  backing  from  US  institutional  investors  and  a  cross  culture 
team,
of China and US. 
 
Yottaa  is  looking  for  Sr.  Ruby  Engineers  as  part  of  the  core  team  to  build  interactive
web  applications.  We  look  for  people  who  are  passionate  at  creating  an  amazing  user 
experience. 
Responsibilities:

Development

Code
development is primarily based on Ruby

Interface

Contribute
Requirements:

Expert in DHTML, DOM, CSS

Expert

Familiar

Familiar with Flash and/or Flex

Good

A big plus if you know Java or PhP
4+  years  experience  in  web  development  required.    2+  years  in  Ruby  development 
required. 
4. Jr. Ruby工程师(Jr. Ruby Engineer)
Location: Beijing
Openings: 1
Summary:  
Yottaa  Inc  (http://www.yottaa.com)  is  a  Boston  and  Beijing  based  cloud  computing
company building a new generation of cloud services revolutionizing what we know about 
the  Internet.  With  venture  backing  from  US  institutional  investors  and  a  cross  culture 
team,
of China and US. 
 
Yottaa
Responsibilities:

Develop

Code using primarily Ajax/HTML/CSS/JavaScript on the client side. Server side 
development

Interface
Requirements:

Familiar

Good English writing and reading skills

A
1+
5. QA/Testing Engineer
Openings: 1
Location: Beijing
Summary: 
Yottaa  Inc  (http://www.yottaa.com)  is  a  Boston  and  Beijing  based  cloud  computing
company
the  Internet.  With  venture  backing  from  US  institutional  investors  and  a  cross  culture 
team,
of China and US. 
 
Yottaa  is  looking  for  QA/Testing  Engineers  responsible  for  testing,  validating, 
operating and managing our cloud-based web services and web applications. 
Responsibilities:

Test

Develop

Set

Roll

Web

Stress testing
Requirements:

Previous

Hands on experience in testing large scale web sites

Expert
LoadRunner, etc.
Expert


by sg552 at 2010-07-27 02:35 AM

rails3RC发布 ... 1 reply

http://weblog.rubyonrails.org/2010/7/26/rails-3-0-release-candidate

首先看到的变化的是 MySQL2 gem
which will take care of MySQL encoding issues on Ruby 1.9.2.
http://chinaonrails.com/topic/view/3865.html



并没有舍弃Shallow routes

同时捆绑bundler1.0rc
http://yehudakatz.com/2010/07/26/whats-new-in-bundler-1-0-0-rc-1/

mysql2 能安在windows上用吗?
http://github.com/brianmario/mysql2/issues#issue/8


by bd7lx at 2010-07-27 12:26 AM

2010-07-26

上海招聘ruby开发工程师 ... 3 replies

上海招聘ruby开发工程师
工作地点:上海
人数:2

职位描述:
1)能独立按设计完成相应模块
2)维护系统数据与功能

任职要求:
1)具有Rails应用程序开发经验,熟悉掌握Rails框架和扩展开发
2)具有良好的编程风格,良好的文档编写和语言表达能力
3)具有团队合作精神,有责任感,能承受一定的工作压力
熟悉 html, CSS, javascript

请有意者把简历投递到:vwangzhen@gmail.com
公司网址:http://kembo-net.com/


by wangzhen at 2010-07-26 07:26 AM

为Ruby社区添砖加瓦,上海下半年Ruby认证程序员官方认证培训时间确定了! ... no reply

8月上海周末班,包括Ruby和Ruby on Rails 2门课程,采用国际教材,名师授课,机会难得,想系统学一下和考Ruby认证的千万不要错过这个机会了。
Ruby培训机会很少,希望版主保留这个帖子,谢谢!
详细情况见:http://ruby.peixun.it
咨询电话:400-705-5525。


by rhce2003 at 2010-07-26 04:12 AM

学rails的路线图 ... 2 replies

经常性的话题,有人问如何学rails

http://chinaonrails.com/topic/view/891.html

不是个别的现象

http://chinaonrails.com/topic/view/1323.html




按图而行,循序渐进, 希望打消困惑
http://chinaonrails.com/topic/view/3151.html


by bd7lx at 2010-07-26 01:18 AM

2010-07-25

关于多个rails app整合? ... 6 replies

我们都知道,PHP,ASP网站多个app整合比较简单,比如已有一个site,需要增加一个bbs,只需要在site下增加一个bbs目录,就可以独立安装bbs并正常运行。

问题来了:如果我用rails做好了一个网站site,现在我需要把例如Beast之类的bbs整合进site,有没有什么好的办法?

自己重新写代码毕竟要花点时间..呵呵


谢谢大家!!!


by Macrow at 2010-07-25 04:01 AM

2010-07-24

Action Throttler - 简单轻量的action限制器 ... 1 reply

代码:http://github.com/fredwu/action_throttler

一个很简单轻量的action限制器。比方说你希望你的网站用户,每天最多发送10次email,或者是,在一分钟内最多执行5次搜索。这些都可以用Action Throttler来轻松的实现。


by canglan at 2010-07-24 03:28 PM

Datamappify - 不用考虑DB Migration的ActiveRecord! ... 2 replies

代码:http://github.com/fredwu/datamappify

这几天写了这个插件。出发点是因为之前尝试使用了Datamapper,因为AR的db migration实在是很麻烦(当然这个取决于项目)。可惜Datamapper的bug太多,所以最后基本上还是不得不用AR。

如果能将两者合一就好了。

Datamappify就是“借鉴”了Datamapper的DSL,自动创建schema.rb,然后auto_migrate就可以自动更新数据库结构了。


by canglan at 2010-07-24 03:23 PM

打开一个文件从第二行开始 ... 3 replies


open('file').each_line.with_index do |line, idx|
if idx>1 then
里面是需要执行的东西
end
end
感觉这样做有点笨拙,每行的idx都来一次判断,很浪费计算资源,将原来的文件删除第一行保留再对这个文件操作也不好。
有无好的办法?


by luofeiyu at 2010-07-24 01:36 PM

2010-07-23

这个字符串如何转换? ... 5 replies

irb(main):001:0> "-34\n \302\240".gsub('\302\240','').strip.chomp
=> "-34\n \302\240"
需要将 "-34\n \302\240"转换成"-34"


by luofeiyu at 2010-07-23 01:51 PM

ruby文本相拟度比较 ... 3 replies

有没有这种gem呀,
就是比较二段文本的相似度。

例如:
我现在一直在用ruby
我以前一直在用java

计算这二句的文本相拟度。


by kqy929 at 2010-07-23 10:04 AM

如何判断网页时候存在? ... 3 replies

如何用ruby写一段代码,做到,测试
http://www.111.com/123.html
当这个网页不存在的时候,puts "no exit"
当他存在时,puts " exit"


by luofeiyu at 2010-07-23 06:01 AM

2010-07-22

与 TextMate 为伴: 2010 年4月版 ... 1 reply

by bd7lx at 2010-07-22 03:59 AM

寻上海RUBY团队 ... no reply

Ruby On Rails项目二次开发

熟悉Ruby部署、开发、调试,熟悉Mysql和Javascript,擅长Ubuntu进行维护更好。

公司或者团队,个人如果自由职业白天能即时沟通开会。

必须在上海。

联系方式
zhaigame@hotmail.com


by 小马 at 2010-07-22 02:04 AM

2010-07-21

可否导入csv文件的部分列到mysql? ... 2 replies

有个csv文件内容如下:
name ,sex,age
a1,man,20
a2,woman,30
这个csv需要导入到 t1中,这个t1的字段有
Name,Age,School,Email
请问如何写load语句?
我可以写出部分
LOAD DATA LOCAL INFILE "csv" INTO TABLE t1 FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\n',IGNORE 1 LINES;
但是如何表达,将csv文件的name,age列导入到t1表的Name,Age字段??
这个需求,我使用ruby编程做到了,但是太慢,我曾经导入300m的数据居然用了15分钟,因此,想问问,load data语句本身可否做到这点?


by luofeiyu at 2010-07-21 09:42 AM

MooseFS vs. NFS

MooseFS(MFS)是一个分布式集群文件系统,介绍看这里, 还有官方的中文文档, 这里主要是进行NFS和MFS的benchmark, 测试方法为使用ab进行单个文件访问测试,后端server使用ngnix, write性能测试使用dd.

环境:

server: 192.168.1.8, Ubuntu, NFS, MFS, 8G内存, 双核Intel(R) Core(TM) i3 CPU 2.93GHz, MFS挂载目录为/mnt/mfsdir1, 是独立的磁盘块(dd建立)


client: 192.168.1.106, Mac OS X, Nginx, Nginx访问目录中分别挂载192.168.1.8的/mnt/mfsdir1(MFS分区)和NFS共享目录/mnt/nfs(属于/分区)


NFS和MFS的配置均为默认的, 这里要注意的是因为测试平台是Mac OS, 所以在NFS共享文件配置中需要加入参数insecure, 否则Mac OS会报opeartion not permite


小文件read测试

测试的文件为389K的图片文件

NFS测试结果:

#ab -c 100 -n 1000 http://192.168.1.106/filesystem_benckmark/nfs/big.jpg

Server Software:        nginx/0.7.65
Server Hostname:        192.168.1.106
Server Port:            80

Document Path:          /filesystem_benckmark/nfs/big.jpg
Document Length:        398102 bytes

Concurrency Level:      100
Time taken for tests:   1.510 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0

Total transferred:      398317000 bytes
HTML transferred:       398102000 bytes
Requests per second:    662.46 [#/sec] (mean)
Time per request:       150.952 [ms] (mean)
Time per request:       1.510 [ms] (mean, across all concurrent requests)
Transfer rate:          257684.67 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   1.1      0      10
Processing:    12  147  43.8    148     326
Waiting:        1   62  29.6     59     159
Total:         12  147  44.1    148     329

Percentage of the requests served within a certain time (ms)
  50%    148
  66%    164
  75%    172
  80%    177
  90%    200
  95%    228
  98%    249
  99%    264
 100%    329 (longest request)

MFS测试结果:

#ab -c 100 -n 1000 http://192.168.1.106/filesystem_benckmark/mfs/big.jpg

Server Software:        nginx/0.7.65
Server Hostname:        192.168.1.106
Server Port:            80

Document Path:          /filesystem_benckmark/mfs/big.jpg
Document Length:        398102 bytes

Concurrency Level:      100
Time taken for tests:   0.721 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0

Total transferred:      401711927 bytes
HTML transferred:       401494992 bytes
Requests per second:    1386.30 [#/sec] (mean)
Time per request:       72.135 [ms] (mean)
Time per request:       0.721 [ms] (mean, across all concurrent requests)
Transfer rate:          543840.75 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    2   1.4      2      13
Processing:    31   68  11.8     68      96
Waiting:        1   11   8.5      9      33
Total:         33   70  11.8     70      97

Percentage of the requests served within a certain time (ms)
  50%     70
  66%     73
  75%     75
  80%     76
  90%     87
  95%     91
  98%     95
  99%     96
 100%     97 (longest request)

 

从以上测试可以看出MooseFS在读性能上还是完胜NFS的, 为NFS的200%


大文件read测试

测试的文件为5.6M的二进制文件

NFS测试结果:

#ab -c 10 -n 100 http://192.168.1.106/filesystem_benckmark/nfs/production-20100326.log.tar.gz

Concurrency Level:      10
Time taken for tests:   2.156 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      591628100 bytes
HTML transferred:       591605100 bytes
Requests per second:    46.38 [#/sec] (mean)
Time per request:       215.603 [ms] (mean)
Time per request:       21.560 [ms] (mean, across all concurrent requests)
Transfer rate:          267974.85 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.7      0       5
Processing:    17  211 110.5    215     480
Waiting:        1   12  10.4      9      64
Total:         17  211 110.6    215     481

Percentage of the requests served within a certain time (ms)
  50%    215
  66%    261
  75%    287
  80%    305
  90%    340
  95%    387
  98%    474
  99%    481
 100%    481 (longest request)

MFS测试结果:

#ab -c 10 -n 100 http://192.168.1.106/filesystem_benckmark/mfs/production-20100326.log.tar.gz

Concurrency Level:      10
Time taken for tests:   0.671 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      591628100 bytes
HTML transferred:       591605100 bytes
Requests per second:    149.06 [#/sec] (mean)
Time per request:       67.089 [ms] (mean)
Time per request:       6.709 [ms] (mean, across all concurrent requests)
Transfer rate:          861190.96 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:    50   65   9.8     63      93
Waiting:        0    2   1.0      1       4
Total:         50   65   9.8     63      93
WARNING: The median and mean for the waiting time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%     63
  66%     68
  75%     71
  80%     73
  90%     76
  95%     88
  98%     91
  99%     93
 100%     93 (longest request)

在大文件的读取上MFS更是表现明显, 性能为NFS的300%


write测试

写测试这里使用了dd方法, 写入数据大小为100M

NFS write

#time dd if=/dev/zero of=sometestfile bs=1024 count=100000
100000+0 records in
100000+0 records out
102400000 bytes transferred in 8.829279 secs (11597776 bytes/sec)
        8.91 real         0.10 user         3.39 sys

MFS write

#time dd if=/dev/zero of=sometestfile bs=1024 count=100000
100000+0 records in
100000+0 records out
102400000 bytes transferred in 6.531960 secs (15676765 bytes/sec)
        8.81 real         0.12 user         2.56 sys

可以看出MFS的写性能达到了百兆网卡的全速(14Mb/s), NFS为11Mb/s, 在时间上也可以看出MFS的优势, 再加上MooseFS的分布式存储和容错功能, 的确非常不错

对于单目录下存在大量文件时单个文件查找和操作仍需要测试,待续


by shitou at 2010-07-21 07:29 AM

javascript如何读写文件? ... 12 replies

请问,我的本机可否即做客户机又做服务器,反正我自己一个人用,这样的话,时候可以让javascript自由读写我本机的数据文件了呢?


by luofeiyu at 2010-07-21 05:15 AM

Zotonic 开源的纯erlang内容管理系统 ... no reply

http://zotonic.com/



http://erlanginside.com/zotonic-destroys-wordpress-and-rethinks-the-cms-with-erlang-149

视频 特性介绍

http://zotonic.com/page/750/video-introduction-to-zotonic

Zotonic 啥意思,不知道,
只知道原来的项目叫Zophrenic, 由于电邮过滤的缘故,弃之

支持nosql 吗? 不

支持mysql吗? 不

似乎除了快可以炫耀,没啥突出的特色(erlang 带来的)


by bd7lx at 2010-07-21 01:35 AM

2010-07-20

Rails项目里测试Beta 新功能 ... no reply

Beta Testing Features in Rails

当往已有的rails项目加入新的功能,需要用 beta testers 测试用户来扑捉bugs

首先建立用户的 beta 测试状态
This is fairly simple – either add a boolean beta field to the user model or, if you’re using something to manage roles, add a beta role to the users you’re adding to your beta program. Be sure to protect this attribute:

attr_protected :is_beta

控制器里隐藏,让非beta用户访问不到
def require_beta
@current_user.is_beta?
end

前置过滤器设条件
before_filter :require_beta

隐藏UI界面元素
http://codebeef.com/beta-testing-features-in-rails


相关帖子
http://www.igvita.com/2007/06/21/5-minute-beta-authentication-in-rails/


by bd7lx at 2010-07-20 05:12 AM

Heroku 挑战nosql数据库革新 ... no reply

by bd7lx at 2010-07-20 02:49 AM

JRuby with C Extension Support ... no reply

http://blog.headius.com/2010/07/what-jruby-c-extension-support-means-to.html

Check out (or fork and check out) the JRuby repository from http://github.com/jruby/jruby:

git clone git://github.com/jruby/jruby.git


Switch to the "cext" branch:

git checkout -b cext origin/cext


Do a clean build of JRuby plus the cext subsystem:

ant clean build-jruby-cext-native

...JRuby has been their dependence on C extensions that only work on regular Ruby. In some cases, these extensions have been written to improve performance, like the various json libraries. Some of that performance could be less of a concern under Ruby 1.9, but it's hard to claim that any implementation will be able to run Ruby as fast as C for general-purpose libraries any time soon.

想提速,没别的招了


by bd7lx at 2010-07-20 02:00 AM

用Rack追踪服务器端性能rack-speedtracer ... no reply

http://www.igvita.com/2010/07/19/speed-tracer-server-side-tracing-with-rack/

客户端性能追踪的工具不少

http://chinaonrails.com/topic/view/1788.html

谷歌的Speed Tracer是一款功能强悍的Web性能分析Chrome扩展
http://code.google.com/webtoolkit/speedtracer/

服务器端speed track,利用了rack 和下面的插件

http://github.com/igrigorik/rack-speedtracer


by bd7lx at 2010-07-20 01:18 AM

Rackspace 推出开源云计算 OpenStack ... 1 reply

http://openstack.org/



当然里面也包含云存储

联合的机构很牛,NASA,美国航天局

NASA云计算项目原有的名字叫Nebula (牛必啦,以前rails圈内的哥们创业的公司就叫这个)整合到openstack里面

众多知名公司参与其中,不乏甘当小白鼠

http://www.infoq.com/news/2010/07/Rackspace-OpenStack

Rackspace has announced the creation of OpenStack Project, an initiative aiming to become the open source solution for cloud computing. The first component of the platform is Object Storage based on Rackspace’s Cloud Files source code, while a second component, Compute, based on NASA Nebula’s computing engine and Rackspace’s Cloud Servers technology, is to be added later this year. Cloud Files is a storage solution accessible via a RESTful API, while Cloud Servers is a technology offering Linux virtual images based on Xen Virtualization. NASA Nebula is a cloud computing service offering computing, networking and data storage services to NASA scientists, including the ability to process large scientific data sets.

http://gigaom.com/2010/07/19/why-openstack-matters-cloud-insiders-weigh-in/

http://www.infoq.com/cn/news/2010/07/Rackspace-OpenStack


by bd7lx at 2010-07-20 12:26 AM

2010-07-19

谷歌近期收购图谋的是语义数据库 ... no reply

Google宣布已收购互联网信息数据库公司Metaweb,以改进其核心业务互联网搜索。
http://gigaom.com/2010/07/19/meet-the-web-database-company-google-just-bought-hint-not-metaweb

Metaweb开发了语义数据存储网络基础架构,和“全球知识开放共享数据库”Freebase。Freebase是一个巨大的、协作编辑的交联数据库, 允许任何人贡献、组织、搜索、复制和使用数据。听起来似乎与维基百科类似,但实际上并非按照文章来组织,而是包含了超过1100万个物,如电影、图书、电 视节目、名人、位置、公司等的数据库。/



收购 ITA

其Needlebase 才是谷歌真正想要的

which started giving out free beta trials in January, uses machine learning to assemble scraped data from web sites and other sources into a hosted database intended to power vertical search engines. It’s similar to Metaweb’s Freebase

ITA已经研发了一个名为Needlebase的系统(虽然它没有被广泛报道),航空公司和其它的旅游企业可以通过该系统出售辅助服务,例如旅游打包线路、活动门票以及其它目的地活动。

这个系统从何而来?

  自从数年前ITA放弃开发全球旅游分销系统和与Sabre、Galileo、Amadeus和Worldspan竞争后,ITA募集了1亿美元的资本,并投入重金(包括人才招募和其它投资)开发了新一代的航空公司预订系统。


by bd7lx at 2010-07-19 11:52 PM

上海软件公司招聘ruby应用工程师 ... no reply

JD在这里:
http://www.izenesoft.com/CN/aboutus/careers/ApplicationEngineer.html

Ruby和c++是载信软件的主力开发语言,我们希望应用层开发工程师具备非常好的RoR背景。请将简历以PDF形式发到 jobs@iZENEsoft.com


by izenesoft at 2010-07-19 02:35 PM

tuan800.com 招聘ruby on rails 高级软件工程师 ... no reply

北京搜格信息技术有限公司是一家以技术为驱动,提供专业信息化产品的公司。我们致力于开发和运营自己品牌的在线产品来为美国客户提供完整的信息挖掘解决方案。
在现在和未来,我们不断通过技术的创新来为客户创造卓越的价值。

我们寻找负上进心,自律,对技术感兴趣,富团队精神的人员加入我们公司,分享公司的美好未来。
地 址: 北京市海淀区数码大厦A座(友谊宾馆东)
联 系 人: 陈先生
电话: 51727315
Email: hr@showgrid.net


by dreamhell at 2010-07-19 01:22 PM

北京外资公司招聘DBA ... 2 replies

JD

公司:美国软件创业公司,敏捷工作环境,开放式办公,可以在工作的同时享受激情的摇滚乐。
同事:技术团队是由资深的工程师构成。
业务:一个创新型产品,市场空白,目的是上市或者并购。
地点:北京三里屯附近

岗位职责:
1.负责 DB 开发、DB 性能优化,以及开发/测试库的日常维护;
2.负责 DB Schema 设计、表结构设计,及把关;
3.完善和宣传 DB 开发规范和相关流程,提高应用开发人员 DB 开发技能。

任职要求:
熟 悉关系数据库原理和设计,具有大型项目数据库设计和开发经验者优先;
熟悉MySQL数据库体系结构;
有数据库性能优化相关经 验;
有数据库安全设计相关经验;
具有一定的数据建模能力,掌握数据库开发与设计工具的使用;
熟练使用 Unix/Linux 操作系统和系统工具,具有一定的 Shell 编程能力;
具有较强的总结能力和培训能力,良好的沟通技能、团队合作能力。
熟悉 Web,研究过开源组件如memcache redis RabbitMQ尤佳


有感兴趣的朋友,请e-mail联系我: xm@seravia.com


by qqdai2009 at 2010-07-19 04:29 AM

出5块钱能得到的服务 fiverr ... no reply

http://www.fiverr.com/

Fiverr网站本质上是一个信息平台,特色之处就在于其仅仅收集那些价值5美元(当然5英镑、5欧元、5元人民币也是OK的)的事情,所谓Fiver。依据这些信息,用户可以去发布、接受或者分享这些信息。


fiverr赚几元


by bd7lx at 2010-07-19 03:47 AM

[北京]beta技术沙龙:Rails系统重构最佳实践 ... no reply

时间:2010年7月24日晚上,18: 30入场,19:00开始
地点:奇遇花园咖啡馆(问路电话010-88320741)
地址:西直门北展北街9号华远企业号(华远地产)D座一层(地图)

演讲题目:
Ruby On Rails : How To Disassemble One Monster App Into An Ecosystem Of 30

详情请见: http://club.blogbeta.com/2010/07/14-rails/


by fiyuer at 2010-07-19 02:29 AM

2010-07-16

处理图片太费你的计算资源,把任务交给云计算来榨橙汁 ... 4 replies

http://www.uploadjuicer.com/



Resize / reprocess 1000s of images without overloading your poor beleagured web server

Resizing, cropping, watermarks & more are available through our simple JSON interface.

uicer is designed to be used with any ruby or rails project. And if you’re not a rubyist, we have a simple REST API.

Image processing in the clouds
Juicer handles all of the image processing tasks your application requires.


by bd7lx at 2010-07-16 07:50 AM

CouchDB 接近投产状态了,上windows ... no reply

http://www.developerfusion.com/news/84650/couchdb-reaches-production-status/

Couch DB, the non-relational - or “NoSQL” – database, has made it into
a production-ready state and earned its version number 1.0.

The three key features that made it into the 1.0 release are stability improvements, performance increases, and – most interestingly – support for running on Windows. CouchDB’s corporate sponsors Couchio say internal metrics peg the speed improvements at 300% mostly through code optimization. In addition to the existing Linux and now Windows (desktop and server) support, a build is also planned that can run on Google’s Android mobile operating system

其windows版本
http://couchdb-android.s3.amazonaws.com/couchdb_1.00%2BerlangR14A.zip

http://chinaonrails.com/topic/view/1290.html


by bd7lx at 2010-07-16 07:09 AM

诗人写湿 Baby On Rails ... no reply

http://www.cutebabypoems.com/blog/?p=19

为什么PHP和HTML睡在同一个婴儿床,
我怎么看,他们都共享一个围兜。
他们似乎支持他们所谓面向对象的代码,
我觉得没啥相干,更关心我的臭臭!



任何人都能写Android App
http://mashable.com/2010/07/12/google-app-inventor/

带着纸尿片的小孩子写rails自然不在话下


by bd7lx at 2010-07-16 05:34 AM

2010-07-15

如何使用yql获得美股数据? ... no reply

我从nasdaq交易所网站下载了一个上市公司表格,但是发现它和yahoo finance的代码不完全一致,不一致的地方有几百家公司。
举例如下,
BAC Bank of America Corporation
BAC/WS/A Bank of America Corporation
BAC/WS/B Bank of America Corporation
BAC^B Bank of America Corporation
BAC^C Bank of America Corporation
BAC^D Bank of America Corporation
BAC^E Bank of America Corporation
BAC^H Bank of America Corporation
BAC^I Bank of America Corporation
BAC^J Bank of America Corporation
BAC^L Bank of America Corporation
BAC^U Bank of America Corporation
BAC^V Bank of America Corporation
BAC^W Bank of America Corporation
BAC^X Bank of America Corporation
BAC^Y Bank of America Corporation
BAC^Z Bank of America Corporation
上面都是同一家公司不同类型的品种,这些代码在yahoo finance中使用不同代码,各位有无使用yql的,可否用yql一次获得nasdaq市场的所有公司代码?


by luofeiyu at 2010-07-15 03:53 AM

明星梦 a Proc Star! 把to_proc 进行到底 ... no reply

http://rbjl.net/29-become-a-proc-star

对 Symbol#to_proc 方法 经常见到“和冒号”已经不惊讶了

%w|1 2 3 4|.map(&:to_i)

http://chinaonrails.com/topic/view/457.html

http://chinaonrails.com/topic/view/304.html

其它的数据类型
比如Array 加上to_proc
http://www.sanityinc.com/articles/adding-array-to-proc-to-ruby

字符串 String#to_proc
http://weblog.raganwald.com/2007/10/stringtoproc.html

Hash , Regexp
还有Class
都能转Proc

权宜之计 还是为成名的紧急手段呢? 想当ProcStar,是第一眼看到有to_proc, 就把其它的给“潜过程"了


by bd7lx at 2010-07-15 02:48 AM

2010-07-14

Ruby中没有真正意义的类方法!?? ... 10 replies

Scotland On Rails Presentations

http://www.rubyinside.com/scotland-on-rails-presentations-now-online-27-awesome-videos-1799.html

听Dave Thomas讲Ruby
http://scotland-on-rails.s3.amazonaws.com/2A04_DaveThomas-SOR.mp4
也许很多概念你知道,也许不知道.
但当你看完视频之后,就全知道了~


当我听到Ruby中没有所谓的类方法,当时真的很震惊~


by wheatlove at 2010-07-14 11:40 PM

文件复制的怪问题 ... 7 replies

今天碰到一个怪问题,
require 'rubygems'
file1=open('/home/pt/f1','r')
file2=open('/home/pt/f2','w')
while line=file1.gets
file2.puts line
end
file1.close
file2.close
文件复制完成了,但是,file2总是比file1多一行,那一行写着
nil
这三个字母。


by luofeiyu at 2010-07-14 11:25 AM

上海 寻找ruby on rails工作一份 ... 3 replies

2008年开始接触ruby/rails。熟悉ruby,ror框架,html, css, JavaSctript, jQuery类库。

有意者请联系我,联系方式如下:
Email: liangwenke8@gmail.com
Tel: 15001815795
QQ: 330234877


by wenke at 2010-07-14 03:43 AM

Zero X 编程游戏大赛 ... no reply

http://www.zero-x.net/

说游戏编程比赛,就是不用参与玩的过程的游戏,写程序做个agent class 上传到比赛环境里和其它的angents
交互,同时和环境里的其它object相互作用

这个代理的代码类似这样的,包括注册后的用户名和代理名称
module 张三
class 大内密探灵灵狗 < Tournament::Agent
def 琢磨
# 收集数据
# 分析
# 做出决定
end
end
end

详细文档:

http://www.zero-x.net/documentation

下SDK :http://www.zero-x.net/documentation/agent_sdk

http://chinaonrails.com/topic/view/2077.html


by bd7lx at 2010-07-14 12:40 AM

nStore 用 node.js 写给 node.js 的数据库 ... no reply

http://thechangelog.com/post/807837625/nstore-easy-database-written-for-node-js-in-node-js

nStore - easy database written for node.js in node.js
http://github.com/creationix/nstore

nStore is a simple, in-process key/value database for node.js

nStore
A simple in-process key/value document store for node.js. nStore uses a safe append-only data format for quick inserts, updates, and deletes. Also a index of all documents and their exact location on the disk is stored in in memory for fast reads of any document. This append-only file format means that you can do online backups of the datastore using simple tools like rsync. The file is always in a consistent state.

http://chinaonrails.com/topic/view/3547.html


by bd7lx at 2010-07-14 12:22 AM

2010-07-13

外资(北京)招聘ruby java leader ... 5 replies

联系方式:
MSN:jessi.wang@live.cn
Mail:jessi@intouch-consult.com

Responsibilities:
• Development web applications
• Code using primarily Ajax/HTML/CSS/JavaScript on the client side. Server side development is primarily based on Ruby
• Interface with the platform, data, QA and operations teams
• Contribute to user interface design and features
Requirements:
• Expert in DHTML, DOM, CSS
• Expert in JavaScript, Ajax and libraries like jQuery
• Familiar with Ruby, and Ruby on Rails
• Familiar with Flash and/or Flex
• Good English writing and reading skills
• A big plus if you know Java or PhP
2+ years experience in web development required.


by jessi01 at 2010-07-13 08:19 AM

LiveReload: 象xrefresh 那样 自动刷新Safari & Chrome浏览器,改javascript或CSS立杆见影 ... 1 reply

http://github.com/mockko/livereload

LiveReload applies CSS/JS changes to Safari or Chrome w/o reloading the page (and autoreloads the page when HTML changes)

当页面有改动的时候都需要去刷新浏览器来查看页面的改动。


LiveReload is a Safari/Chrome extension + a command-line tool that:

Applies CSS and JavaScript file changes without reloading a page.
Automatically reloads a page when any other file changes (html, image, server-side script, etc).

Warning: Windows is not supported yet.

视频介绍
http://blog.envylabs.com/2010/07/livereload-screencast/

那么firefox或IE 咋整? windows 能用吗?

这个livereload 就是受xrefresh 影响开发出来的。

当页面有改动的时候都需要去刷新浏览器来查看页面的改动。

XRefresh 当项目文件夹有更新的时候,会为你自动刷新浏览器。

http://xrefresh.binaryage.com/
双屏 显示器 看来是开发必备的硬件设备


by bd7lx at 2010-07-13 05:03 AM

用ruby把JavaScript装到mongodb里存储 ... no reply

http://dirolf.com/2010/04/05/stored-javascript-in-mongodb-and-pymongo.html

JavaScript is a very important language in the MongoDB ecosystem. Not only is the shell JavaScript, but the server features a built-in JS interpreter as well. The embedded interpreter is used in all sorts of different ways, including for Map/Reduce, db.eval, and $where clauses. One nice feature supported by MongoDB is the ability to store JS functions on the server.

目的是实现存储过程式的服务器端编程

http://neovintage.blogspot.com/2010/07/mongodb-stored-javascript-functions.html

http://dirolf.com/2010/04/05/stored-javascript-in-mongodb-and-pymongo.html

use them in map/reduce, eval, and $where clauses.

应用此技术的示范看板项目
http://vasilrem.com/blog/software-development/stored-javascript-in-mongo/

http://code.google.com/p/kandash/
用Scala 而不是ruby
kandash仪表板项目主角是extjs JavaScript和mongodb


by bd7lx at 2010-07-13 04:56 AM

mongoflow 空无一物的新* 闻网站 ... 2 replies

http://mongoflow.com/

上面的link 既不能注册也就无法登陆

从这里看到的
Mongoflow == Rubyflow + Mongoid + Rails 3 + Refactoring Love

http://github.com/brainscott/MongoFlow

http://alexjsharp.com/posts/testing-rails-view-helpers

视图测试话题
http://chinaonrails.com/topic/view/2442.html


by bd7lx at 2010-07-13 03:45 AM

书The Rails 3 Way ... 3 replies

http://tr3w.com/

作者Obie 近一年来活动很少,可能是专心写此书
The content currently on this site is provisional. The companion site will be released concurrently with the published book in 3Q 2010.



第二版

http://chinaonrails.com/topic/view/894.html


by bd7lx at 2010-07-13 01:56 AM

2010-07-12

求一个正则表达式: ... 3 replies

求一个正则表达式:
求一个正则表达式:

5aa5001122335aa5445566775aa5aabbcc ....

用5aa5分开,得到:

5aa500112233

5aa544556677

....
messages = hex_string.split "5aa5"
messages = messages[1..messages.length]
messages = messages.collect {|x| "5aa5"+ x}

太土了。


by jinleileiking at 2010-07-12 08:15 AM

西班牙赢了,下载 jQuery: Novice to Ninja 今天不要钱 ... 2 replies

by bd7lx at 2010-07-12 06:44 AM

如何访问类中的局部变量 ... 19 replies

代码如下.
class A
def initialize
@a = 11
@@a = 22
a = 33
end
@a = 1
@@a = 2
a = 3
end
要求在类外如何访问这几个变量
要去输出顺序
1
2
3
11
22
33
前两个会输出,到第三个a = 3 怎么写也没用
特来请教


by wheatlove at 2010-07-12 12:17 AM

2010-07-10

如何用ruby读取钱龙数据格式? ... 5 replies

钱龙软件的个股k线数据以文件方式存放,如果软件默认安装,上海的数据存放位置
C:\Program Files\qianlong\qijian\QLDATA\history\SHASE\day,这个里面是日线数据,每家公司一个文件,请问如何用ruby读取这个文件里面的数据成csv格式呢?
线索:http://chenpu85.javaeye.com/blog/532561
钱龙的数据格式比较简单的呢
上海日线数据就放在 qijian\QLDATA\history\SHASE\day文件夹下
随便找个文件打开,就是一堆密密麻麻的数字

去网上下载flexhex 打开了就看到 了真实数据
F5 90 32 01 B4 19 00 00 E0 1A 00 00 B4 19 00 00 9A 1A 00 00 E5 CB 01 00 60 A9 02 00 00 00 00 00 00 00 00 00 00 00 00 00

F5 90 32 01就是时间20091125
然后就是开盘 最高 最低 收盘 总手 成交金额 补上三个0
我的看法:
那些数据的存放格式是16进制,先转换成2进制,然后再转换成utf-8??
20091125的二进制就是F5 90 32 01??


by luofeiyu at 2010-07-10 01:16 AM

2010-07-09

Recruiting many senior RoR developers (8000-13.000 RMB/month) - Telecommute ... 2 replies

Web Direct Development is recruiting many RoR developers. You will work closely with the project manager to develop cutting-edge applications. We are looking for hard working Rails fanatics who, in addition to being enthuastic and passionate, are organized.

* Great Ruby on Rails coding skills
* At least 2 years experience using rails
* A track record of implementing live RoR sites
* Experience with high volume website
* Experience of test driven development using RSpec
* Experience of deploying Rails with Passenger
* Suited to working in an agile, flexible environment
* 2 years expee using Javascript libraries like jQuery
* Good written and verbal communication skills
*Experience using performance monitoring tools
*Strong Html/Css knowledge

Salary: 8000-13.000 RMB/month, depending on skills and experience. The job is not on site so you can work from any place as long as you deliver.

Contact: webdirectcompany@gmail.com


by WebDirect at 2010-07-09 11:58 AM

------