编写高效好看的rails代码的tips,原文:http://www.rubyinside.com/19-rails-tricks-most-rails-coders-dont-know-131.html
1715 days前 / 1,226 次浏览阅读全文
关于新版本Ruby中的多线程的问题。
fiber microthread coroutine concurrency这几个名词都被使用,可能最常用的会是fiber。
fiber属于非抢占式(non-preemptive)类型。
引用msdn文档:A fiber is a unit of execution that must be manually scheduled by the application
意思就是说必须手动调度的一段可执行单元。
fiber运行在线程的上下文中,一个进程可以调度多个fiber。线程一般要依靠内核的线程调度来暂停或者重启其它线程,而fiber则自己控制自己,启动其它fiber等。
Fiber和coroutine
这两个概念非常相近,一般来说,coroutine是程序语言级别的结构,而fiber...
1715 days前 / 1,158 次浏览阅读全文
基于rails的开源的CMS,应该是个日本公司做的。
主页:http://rubricks.org/index_en.html
主要功能:news,toto,bbs,用户和权限管理,menu管理等。
它使用了‘Spinelz’ ,一个提供了很多AJAX功能的JAVASCRIPT库。
1716 days前 / 1,768 次浏览阅读全文
前两天的wordpress版本比较低,装不了UTW3,只好升级到最新版本的wordpress了。
把解压缩的plugin的在控制面板里启用就可以了。
关键是要修改theme文件。
1.修改index.php,在文章列表的时候显示tag list
在适当的位置加上这句就行了。
<div class="utwtags">TAG: <?php UTW_ShowTagsForCurrentPost("tagsetcommalist") ?></div>
当然,还要修改css文件。
2.修改tags.php和tag.php
tags.php主要是用来显示所有的tag的列表,建立方法可以看UTW自带的文档,修改的主要内容是让它符合当前的theme。
tag.php主要是显示一个tag的文...
1716 days前 / 1,904 次浏览阅读全文
Java:
new Date(new Date().getTime() - 20 * 60 * 1000);
Ruby:
20.minutes.ago
c#3.0的话有Extension Methods
public static class Extenders
{
public static DateTime Ago(this TimeSpan val)
{
return DateTime.Now.Subtract(val);
}
public static TimeSpan Minutes(this int val)
{
return new TimeSpan(0, val, 0);
}
}
执行函数
class Program
{
static void Main(string[] args)
{
Console.WriteLine(20.Minutes().Ag...
1716 days前 / 2,186 次浏览阅读全文
原文:http://www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials
如果是入门的话,可以看看。
这里只保留了连接。
1717 days前 / 5,568 次浏览阅读全文
随便看看
热门标签
adb
Android
android sdk google
bing
components
control
deb
debian
eclipse
ed
gconf
gconfd
gconftool
gconftool-2
google
hibernate
hprof
java
launchpad
leak
linux
memory
microsoft
ms
NO_PKG_MANGLE
package
pkgstriptranslations
ppa
rc.local
roma
Ruby
section
shell
sns
tech
ubuntu
vi
vim
wave
zenity
自动启动





最新评论