Sat 12 January, 2008


- 评论
- 在Windows系统下无疑是InstantRails最佳的选择;
- 在Unix/Linux系统下将会有比较大的竞争,但是RubyWorks前景看好。
add to del.icio.us. look up in del.icio.us.
add to furlFri 11 January, 2008

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
“ I just ripped my own bodice with anticipation. ”
Patrick Henry Ewing
add to del.icio.us. look up in del.icio.us.
add to furl
Tip Stop someone from snoring
If you bed partner is snoring, make several clicking noises with the side of your mouth.
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlThu 10 January, 2008


- 说明
- Ruby语言代码段网站 Refactor :my => ‘code’
- 晒晒你的代码,学习他人的代码
add to del.icio.us. look up in del.icio.us.
add to furl
Most Rails contributors are not big users of shared hosting and they tend to work on problems or enhancements that'll benefit their own usage of the framework. You don't have to have a degree in formal logic to deduce that work to improve life on shared hosting is not exactly a top priority for these people, myself included.
That's not a value judgement. It's not saying that shared hosting is bad or evil. It's simply saying that the Rails contributors generally don't use it. By extension, it's not something that we are personally invested in solving as a traditional "scratch your own itch" type of development.
Improve what is for profit and fun
I'd love for Rails to be easy as pie to run in a shared hosting environment, though. I'd love for Rails to be easy as pie to run in any environment. In that "more people could have fun learning Rails and deploying their first hobby application" kind of way. But I don't need it in the sense that I'm going to put in the work, personally, to make it happen.
Others might, though. The Dreamhost guys in particular sounds like they're experiencing a lot of hurt running Rails in their shared hosting environments. That should be a great motivator to jump in and help improve things. The work I do every day to improve Rails is usually about removing hurt. Heck, it's currently in the slogan on the Rails site: "Web development that doesn't hurt".
Second, it sounds like they have a substantial economic interest in making the shared hosting scenario for Rails easier. I read that a fair number of their customers are going elsewhere because they can't get Rails to run well at Dreamhost. Before they leave, though, they probably tax the support system quite heavily as well. So there's direct costs, lost revenues, and probably also a great upside waiting if Rails ran great on their system.
That's both a personal motive for having a less stressful day and a profit motive for making your business more money. Sounds like a match made in heaven for someone like Dreamhost to get involved and help do the work to make Rails a great shared host experience. They might not have the man-power in-house today to make that happen, but I'm sure they could easily hire their way out of that. If the plan they want to pursue is a better mod_ruby, I'd start looking at that project for people who've contributed and ask if they'd like to earn a living improving the state of affairs.
We'll work with you if you're willing to work with us
Again, I'd love to see someone tackle this challenge and would be more than happy to work with a group pursuing this to get their results into Rails or working with Rails the best way we can. Consider that an open, standing invitation.
In exchange, I'll ask a few, small favors. Don't treat the current Rails community as your unpaid vendor. Wipe the wah-wah tears off your chin and retract the threats of imminent calamity if we don't drop everything we're doing to pursue your needs. Stop assuming that it's either a "complete lack of understanding of how web hosting works, or an utter disregard for the real world" that we're not working on issues that would benefit your business. Think of it more as we're all just working on the issues that matters most to our business or interests.
The alternatives
Now if you're a user of shared hosting and you're not satisfied with the results you're getting — and you're not getting good vibes that things will be better — there are alternatives. Lots of them in fact. And it doesn't have to cost an arm and a leg. Self-service VPS outfits like Slice Host has plans starting at $20/month that runs Rails great (I use them to run this site). RailsMachine has a Rails-specific setup for $75/month. And for the more high-end stuff, you can get great setups from Joyent, Engine Yard, and tons of others.
So as a programmer looking to deploy Rails, you have tons of options in all price ranges. If you're a shared host looking to capitalize on a framework that's driving a lot of demand, it would seem that your best option is to actually get involved and help the community help you.
add to del.icio.us. look up in del.icio.us.
add to furl
Learning a new programming language is hard enough when there are new abstractions to get your head around, but the matter is made worse with a plethora of new syntax and symbols with no obvious verbal expression.
For example, most folks would read this:
x = 4 * y
as “x equals 4 times y.”
But how do you vocalize this:
f :: Int -> Int
Well, that’s Haskell, and lucky for Haskell new-comers a wiki page is being assembled to explain how to vocalize code.
So, the above example would be, “f has type Int to Int.”
add to del.icio.us. look up in del.icio.us.
add to furlWed 09 January, 2008

add to del.icio.us. look up in del.icio.us.
add to furl

- 说明
- 芬兰 IQUA 公司出品
- 在使用太阳能耳机时用户不再担心电力不足
- 只要有光该太阳能耳机就可以充电
- 太阳能耳机电力保持12个小时
- 太阳能耳机可以向其它电子设备输送电力
创新是赢得顾客的最佳途径之一
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlTue 08 January, 2008

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
“Yo” is the new “Hir”
Language experts in the US say since at least 2004 students have been saying “yo” as a substitute for gender specific pronouns and the trend is growing.
add to del.icio.us. look up in del.icio.us.
add to furl
“ I have a prediction for 2008: you fail. ”
uncov
add to del.icio.us. look up in del.icio.us.
add to furlMon 07 January, 2008

add to del.icio.us. look up in del.icio.us.
add to furl
Found via Boing-boing : You Sucjk at Photoshop
Educational and damn funny.
add to del.icio.us. look up in del.icio.us.
add to furl
Documentation for Ramaze keeps growing, and some screencasts have been posted.
Well worth checking out.
Also worth checking out is the latest version of Ramaze. It runs on Ruby 1.9, and includes a number of really interesting example apps. You can pull it from the darcs repo (though a new release should be coming soon).
add to del.icio.us. look up in del.icio.us.
add to furl
Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java.
简而言之,它是用来做搜索的库。提及搜索,我们的思绪就会情不自禁飞到串匹配上。没错,串匹配确实是一种搜索,但对于不同的应用,搜索的方法不一样,对于在一篇文档中进行搜索这种小规模应用而言,串匹配足够了,而Lucene为我们向大规模搜索铺上了一条大道。大规模?是不是想到了搜索引擎,事实上,Lucene就是被很多人用来构建搜索引擎。
关于搜索引擎的实现,很多人或多或少的听说过一些,比如网络爬虫,比如分布式的架构,比如PageRank。抛开其它其它复杂的部分,最关键的步骤便是建立索引,然后进行搜索。不妨让我们Lucene是如何实现这最关键的部分。
import java.io.File;
import java.io.FileReader;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexWriter;
public class Indexer {
public static void main(String[] args) throws Exception {
File indexDir = new File("index");
File dataDir = new File("data");
IndexWriter indexWriter = null;
try {
indexWriter = new IndexWriter(indexDir, new StandardAnalyzer(), true);
for (File file : dataDir.listFiles()) {
if (file.isFile() && file.getName().endsWith(".txt")) {
Document document = new Document();
Field pathField = new Field("path", file.getCanonicalPath(),
Field.Store.YES, Field.Index.TOKENIZED);
document.add(pathField);
Field contentField = new Field("contents", new FileReader(file));
document.add(contentField);
indexWriter.addDocument(document);
}
}
indexWriter.optimize();
} finally {
if (indexWriter != null) {
indexWriter.close();
}
}
}
}
这段代码很容易理解,遍历数据目录下的文本文件,为每个文件生成索引。
这里有一个Document的概念,它在Lucene表示的是索引和搜索的单位,也就是说,建立索引,是以Document为单位的,搜索也是以Document为单位的。Document中有一堆的Field,我们可以把它们理解为Document中一个一个小节。有了Field,我们可以为Document添加一些属性,比如这里,我们就添加了路径(path)和内容(content)两个属性。这样,搜索之后,我们可以利用这些属性提供更多的信息,比如,告诉别人搜索的词出现在哪个文档中。
上面的代码中,我们可以清楚看到,建立Document,并向其中插入Field的过程。有了Document,我们就可以把它借助IndexWriter将它们写入索引中,至于最后的optimize,显然是为了让搜索更有效率而存在的。
有了索引,那就该进行下一步的工作,搜索。
import org.apache.lucene.document.Document;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.Hits;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
public class Searcher {
public static void main(String[] args) throws Exception {
String type = "contents";
String key = "game";
String path = "index";
IndexSearcher searcher = new IndexSearcher(path);
Term t = new Term(type, key);
Query query = new TermQuery(t);
Hits hits = searcher.search(query);
for(int i = 0; i < hits.length(); i++){
Document document = hits.doc(i);
System.out.println("File: " + document.get("path"));
}
}
}
IndexSearcher是用来在索引中进行搜索主要帮手,前提是我们要告诉它到索引在哪。Term表示文本中的一个词,它说明了我们要在哪个Field(type)中找什么(key)。然后,我们用Term做成一个Query,表示我们要进行搜索了。做好准备,接下来,就是搜索了。搜索的结果叫做Hits。遍历这个Hits,便可以将搜索结果一一展示出来。如前面所说,这里利用路径这个属性报告搜索的结果。
有了Lucene做基础,能做的事就很多了,比如搭建一个搜索引擎。事实上,已经有了这样的开源项目,比如与Lucene同出一门的Nutch,比如比Nutch年纪更大的Compass。
add to del.icio.us. look up in del.icio.us.
add to furl

- 什么是Inno Setup
- Inno Setup is a free installer for Windows programs.
add to del.icio.us. look up in del.icio.us.
add to furlSun 06 January, 2008

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl

- Ruby语言未来十个重要工具
- http://rubini.us/
- Ruby语言进入商业领域的重要项目。
- http://merbivore.com/
- Rails框架的最具有竞争力的项目。
- http://www.malline.org/
- Rails框架的视图需要使用纯Ruby的DSL框架,而不是ERB和其它新语言的DSL框架。
- http://swiby.codehaus.org/
- 一个基于 Swing 的未来Ruby语言桌面应用软件框架。
- Glimmer
- 一个基于 SWT 的未来Ruby语言桌面应用软件框架。
- JRuby on Android
- 在Android系统上实现JRuby语言程序的运行。
- http://rubini.us/
- 参考资料
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlSat 05 January, 2008

“ This is the DANCING bone! ”
A 3 year old holding up a model pelvis at the Providence Children’s Museum
add to del.icio.us. look up in del.icio.us.
add to furl

