ActiveRecord and extremely large tables or queries (1)
share
digg
by
Mike (314)
on
michael barton (4)
3 days, 6 hours
ago
permalink
Using larger and larger datasets, ActiveRecord has performance problems when trying to iterate over the data. Consider this simple example to iterate over a table of genes, and print out the name of each. This is an common use case for accessing database rows. Gene.all.each {|gene| puts gene.name} Unfortunately, if the gene table contains millions of rows, [...]
Carregando o Rails no bolso - e programando em qualquer lugar (1)
share
digg
by
Urubatan (2)
on
Blog do Urubatan (2)
1 week, 1 day
ago
permalink
Sei que o blog anda meio jogado as traças, é que depois que terminei o livro a umas duas semanas fiquei meio cansado de escrever, mas acho que ja estou me recuperando Este post aqui vai ser bem curto, é só uma dica para os programadores Rails por ai que não estão sempre na frente dos seus computadores e não gostam de perder tempo ou gostam de poder prototipar aquela idéia espetacular que vai te ...
Customizando o gedit para Rails (1)
share
digg
by
jeveaux (2)
on
Jeveaux's Weblog (2)
1 week, 1 day
ago
permalink
Não há dúvidas que o TextMate é um excelente editor para se trabalhar com Rails, mas como nem todos possuem um Mac para ter o prazer de utilizar este editor, o jeito é se contentar com alternativas menos hype sexy. Para quem usa Gnome, porém, é muito mais fácil encontrar uma ótima alternativa. O gedit é um editor de texto que vem, geralmente, por default em qualquer distribuição Linux com Gnome. Não vou falar muito ...
Fast Substructure Search Using Open Source Tools Part 3: A CRUD API for Fingerprints in Ruby (2)
share
digg
by
Rich Apodaca (12)
on
Depth-First (12)
1 week, 1 day
ago
permalink
The previous article in this series showed how to perform fingerprint screens for substructure searches using nothing more than SQL. Although this is significant progress, working at the level of SQL queries to perform create, read, update, and delete operations (CRUD) on our fingerprint table is more work than it needs to be. We'd really prefer to use an API written in a high-level programming language. This article describes a simple Ruby API for managing ...
-
mndoci said:
So which ORM system is the one most of you use with Ruby?
Timezones in Rails 2.1 (1)
share
digg
by
madpilot (2)
on
SitePoint Blogs (90)
1 week, 3 days
ago
permalink
It isn’t particularly surprising that timezone support is a pretty important component of web applications, as the web really is a global medium. If you are building an application that has to deal with times, such as sending out calendar reminders or even something as simple as displaying a timestamp correctly, you may need to be wary of the fact that different users live in different timezones. Sound easy? Then read on… A quick background ...
database.yml & capistrano2 (1)
share
digg
by
chen kai (2)
on
red_world (2)
1 week, 5 days
ago
permalink
实验室的服务器配置好了apache2+passenger2的环境,就很开心试了capistrano2远程部署。 要使用capistrano2来作远程的deploy当然要把服务器配置好ssh,web server等,我的做法是创建一个deploy的user专门来干这档事,并把deploy加入到www-data组以便在服务器的空间有权限写入。不过在试用过程中发现如果是使用scm的话capistrano2是不管你database.yml(因为不可能把production server的db账户信息纳入版本控制),想想可能放在share目录下应该就可以解决(share目录专门放些不变的东西,如log,如一些如用户资源等静态数据),但具体怎样还是看看别人怎么做的,搜索一下看到这个POST。这位老兄加了个两个钩子,在setup和update_code时把事先准备的模板放到share目录中。但其实还有些问题,数据库的user并不一定就是server的user,最好还是在config/deploy.rb加上两个字段如db_user和db_passwd来设数据库。 看了下Capistrano2的文档,发现真是个好东东,简单又方便。
Rails can scale ? (4)
share
digg
by
xdite (22)
on
Blog.XDite.net (22)
1 week, 5 days
ago
permalink
這是閱讀 RailsConf 2008 上 Flexible Scaling: How to Handle 1 Billion Pageviews的摘要筆記。 簡單介紹一下背景,講者的網站叫做 WarBook,是一個 Facebook 上的 Application (Game)。玩家扮演一位英雄,統領自己的士兵攻城掠地,擴大自己的王國,也增強自己的力量,是一個典型的 WEB MMORPG。 而這個網站每天擁有1.6億的 Pageview,150 萬會員。卻是用 Ruby on Rails 寫的。而這是怎麼 Scale 的呢?他分享的秘訣如下: - 先用以下工具對網站作基本的健檢。 * Firebug * PL_ANALYZE * IOSTAT * MTOP - 可以 CACHE 的統統都扔到 MEMCACHE 去,95% hits on cache XD - 改變策略,與其買 Server,不如改租 Amazon EC2,講者使用的是 ec2onrails (由投影片上的 ami 編號查到的) * 加一台 Static File Server ( Lighttpd 1.4.13 ) * 加一台 Load Balancer ( Perlbal) * 加一台 ...
Two improvements to your Capfiles (3)
share
digg
by
Giovanni Intini (4)
on
A Tempest of Thoughts (4)
1 week, 6 days
ago
permalink
I have lately started using a pattern that has become quite common among capistrano users: setting the server names and locations in a task. Doing this allows you to have multiple deployment environments, like development, staging, production, and so on. desc "deploy to development environment" task :development do set :deploy_to, "/var/apps/#{application}" role :web, "servername.mikamai.com", :primary => true role :app, "servername.mikamai.com", :primary => true role :db, "servername.mikamai.com", :primary => true set :user, "username" set :password, "secr3t" ...
Translating ActiveRecord • iain.nl (2)
share
digg
by
Iain Hecker (5)
on
iain.nl (5)
1 week, 6 days
ago
permalink
With Rails 2.2 releasing any day now, I want to show you how to translate ActiveRecord related stuff. It is quite easy, once you know where to keep your translations. Here is a complete guide to using all built in translation methods! Contents: Scenario Setting up Translating models Translating attributes Translating default validations Interpolation in validations Model specific messages Attribute specific messages Defaults Using error_messages_for Conclusion Scenario Suppose we’re building a forum. A forum has ...
Handling database indexes for Rails polymorphic associations « Codeshooter’s Weblog (2)
share
digg
by
Maurício Linhares (5)
on
Codeshooter's Weblog (5)
2 weeks, 1 day
ago
permalink
One thing that is usually overlooked when defining tables and their associations in a Rails application are the indexes. Usually, this comes from the idea that “my ORM tool does the job” and in fact it might be true sometimes. One of the most successful ORM tools in the Java land, Hibernate, generates a database with indexes for all foreign keys that you have, so Java programmers that use it don’t really worry about these ...
Exception Logger (1)
share
digg
by
DATE Ken (2)
on
Don'tStopMusic (2)
2 weeks, 1 day
ago
permalink
Exception Loggerexception_logger は、発生した例外を DB に溜めてくれる Rails のプラグインです。溜めた例外の情報を眺めることができるビューもついていて便利なのですが、URL のアクション部分に HTML タグが混じっていると表示がおかしくなる問題があります(というかまあ XSS ですが)。 ということで↓エスケープするパッチです。 ツッコミを入れる
caboose A simple Rails slow-query logger (4)
share
digg
by
Courtenay (18)
on
caboose - blog.caboo.se Home (16)
2 weeks, 1 day
ago
permalink
A few years ago I wrote a simple addition to ActiveRecord that does two things: it chops out the eager loading "t1_t2 AS foo", and it shows the number of records returned for every query you run against the database. You can view the file here Today I was profiling a site and wanted to quickly find the slow database queries, but didn't have access to mysql's config directly, so I patched that file above ...
I wish there was Ruby on Rails for data (1)
share
digg
by
Mike (314)
on
michael barton (4)
2 weeks, 2 days
ago
permalink
I’d like to think that learning Ruby on Rails has benefited my research. I’m certain that ActiveRecord has made it much, much easier to bridge the gap between my code and my database. I think validations make it easier for me to weed out bad data points in large data sets. I know for sure [...]
JBoR: Will it cluster? (1)
share
digg
by
Bob McWhirter (8)
on
fnokd! (8)
2 weeks, 2 days
ago
permalink
JBoss on Rails will indeed cluster! After modifying and dropping my jboss-rails.deployer into an ‘all’ configured server of JBoss AS 5, and firing up 3 instances on my localhost (non-trivial on OSX…): 10:43:28,409 INFO [RPCManagerImpl] Received new cluster view: [127.0.0.10:63740|2] [127.0.0.10:63740, 127.0.0.11:63747, 127.0.0.12:63749] 10:43:28,435 INFO [RPCManagerImpl] Cache local address is 127.0.0.12:63749 10:43:28,469 INFO [ComponentRegistry] JBoss Cache version: JBossCache 'Poblano' 2.2.0.GA And I’ve got 3 nodes running the same Rails app, all sharing a cookie and ...
Including and extending modules in Ruby (1)
share
digg
by
Maurício Linhares (5)
on
Codeshooter's Weblog (5)
2 weeks, 4 days
ago
permalink
One of the coolest features in Ruby is the existence of modules and the possibility of including their implementation in any object. This simple behavior is the source of things like the Enumerable module, that gives you a bunch of methods to work with a collection of objects and just expects that the class that included it to define an “each” method. You write a class, define an “each” method, include Enumerable and your’re done, ...
Pros and Cons (2)
share
digg
by
jan (79)
on
self.works_with_ruby? - Home (3)
2 weeks, 6 days
ago
permalink
A recent commit to the Rails github repository had quite some comments. In one of the tests there was the string: topic = @target.new(:title => "The pros and cons of programming naked.") After which Mislav Marohnić asked the obvious question: After which we now have a pretty nice list of all the pro’s and cons of naked programming!
“Build half a product, not a half-assed product” - tips on clarity and focus from Jason Fried of 37Signals (1)
share
digg
by
John McCaffrey (2)
on
Pathfinder Development » Agile Ajax (23)
3 weeks
ago
permalink
Jason Fried from 37Signals spoke yesterday at the ITA "Speaking of Success" event, about the history of 37Signals, their philosophy and culture, and the critical business decisions they've made to get them where they are today. The software biz is fundamentally broken. Too many products fail because of the obsession of adding more and more, and trying to do too much. Jason went on to say that the approach of adding more and more only ...