2012 年文章归档
共 23 篇文章
解决方法:To open a bundled gem, set $EDITOR or $BUNDLE EDITOR
To open a bundled gem, set $EDITOR or $BUNDLE EDITOR 解决方法: export EDITOR=gedit
2012-12-03 09:51 · ROR
MongoDB 注册到windows系统服务
注册MongoDB为系统服务(此步骤必须以系统管理员身份运行cmd,否则会报错) 以系统管理员身份运行cmd输入并切换至MongoDB的bin目录运行以下语句 mongod.exe --dbpath=d:\mongodb\db --logpath=d:\mongodb\logs\mongodb.log --install --serviceName "MongoDB" 回车 如果控制台出现类似Tue Oct 09 12:05:15 Service can be started from the command line with 'net start MongoDB'这样的语句,说明服务已经…
2012-11-25 13:02 · 数据库
Ruby on rails 创建基于Rspec项目
1. 首先 $ rails new sample_app --skip-test-unit 2. 在Gemfile中添加 gem 'rspec-rails', '2.11.0' gem 'factory_girl_rails','1.4.0' gem 'capybara' 3. $ bundle install 4. $ rails generate rspec:install 5. 创建一个Controller $ rails generate controller StaticPages home help --no-test-framework controller生成要代参数 --n…
2012-11-21 11:11 · ROR · Ruby · Rails · rspec
mongoDB replicaSet 复制集模式 多台机器连接配置
rails 中 mongoid.yml hosts: - - 172.18.6.80 - 27017 - - 172.18.6.80 - 27018 - - 172.18.6.80 - 27019 - - 172.18.6.81 - 27017 - - 172.18.6.81 - 27018 - - 172.18.6.81 - 27019
2012-11-19 17:10 · 数据库 · Ruby · MongoDB · Rails
Ubuntu 下添加eclipse 至dash home
Name=Eclipse Comment=Eclipse IDE Exec=/opt/eclipse/eclipse Icon=/opt/eclipse/icon.xpm Terminal=false Type=Application Categories=Application;Development;
2012-11-12 10:56 · ubuntu linux · Eclipse
git 常用命令
Git常用操作命令收集: 1) 远程仓库相关命令 检出仓库:$ git clone git://github.com/jquery/jquery.git 查看远程仓库:$ git remote -v 添加远程仓库:$ git remote add [name] [url] 删除远程仓库:$ git remote rm [name] 修改远程仓库:$ git remote set-url --push[name][newurl] 拉取远程仓库:$ git pull [remotename] [localbranchname] 推送远程仓库:$ git push [remotename] [lo…
2012-10-31 16:16 · git · Git
javascript常用的107个语句
[size=medium][/size] [code="java"] 1.document.write(“”); 输出语句 2.JS中的注释为// 3.传统的HTML文档顺序是: document->html->(head,body) 4.一个浏览器窗口中的DOM顺序是: window->(navigator,screen,history,location,document) 5.得到表单中元素的名称和值: document.getElementById(“表单中元素的ID号”).name(或value) 6.一个小写转大写的JS: document.getElementById(“outp…
2012-10-31 12:43 · javascript
rails date format
1.Time#strftime 2. time.strftime( string ) => string 3. 4. Formats _time_ according to the directives in the given format 5. string. Any text not listed as a directive will be passed through 6. to the output string. 7. 8. Format meaning: 9. 10. %a - The abbreviated weekday name ("Sun") 11. %A - The…
2012-10-22 14:53 · ROR
mongoDB 入门
转载自 http://www.cnblogs.com/hoojo/archive/2011/06/01/2066426.html 一、准备工作 1、 下载mongoDB 下载地址:http://www.mongodb.org/downloads 选择合适你的版本 相关文档:http://www.mongodb.org/display/DOCS/Tutorial 2、 安装mongoDB A、 不解压模式: 将下载下来的mongoDB-xxx.zip打开,找到bin目录,运行mongod.exe就可以启动服务,默认端口27017,db保存的路径是系统C硬盘目录的根目录的/data/db目录。也…
2012-09-29 10:50 · 数据库 · MongoDB
Android 开发无法获取SDK更新
试试在hosts文件中添加 74.125.237.1 dl-ssl.google.com 74.125.237.1 dl.google.com
2012-09-06 15:06 · android · Android
CSS3文字燃烧特效示例
[code="html"] CSS3文字燃烧特效示例 CSS文字燃烧特效: Now we're cooking with gas. [/code]
2012-08-30 17:41 · web美化 · HTML · CSS · jQuery · JavaScript
mongodb数据库操作语法
[size=medium]01 mongo –path 02 db.AddUser(username,password) 添加用户 03 db.auth(usrename,password) 设置数据库连接验证 04 db.cloneDataBase(fromhost) 从目标服务器克隆一个数据库 05 db.commandHelp(name) returns thehelpforthe command 06 db.copyDatabase(fromdb,todb,fromhost) 复制数据库fromdb—源数据库名称,todb—目标数据库名称,fromhost—源数据库服务器地址 07 …
2012-08-14 15:26 · 数据库
MongoDB 应用简介
MongoDB 从入门到精通专题教程 最近有好多同事都在用mongodb,一个新的面向文档型介于面向对象与关系型之间免费的数据库,据说有拥有比传统数据库更高的性能。趁今天早上有空,就研究了一下。 首先上mongodb官网(www.mongodb.org)看了一下开始文档,下了个windows版的,装了一下,并且写了几个简单的例子,测试了一下,经过测试,mongodb确实好用,也很简单,当然其中也遇到了很多问题,因此为了能让以后的同学们更好的入门,所以做一个简单的介绍。如果你想尽快入门,则可以按照如下的步骤进行。 1,安装并启动数据库 从官网(www.mongodb.org/downloads…
2012-08-09 16:49 · ubuntu linux
ubuntu安装终极zsh
ubuntu安装终极zsh 安装终极Shell zsh,拥有更强的补全功能(常用工具的参数补全) sudo apt-get install zsh #引入增强插件,支持git,rails等补全,可选多种外观皮肤 wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh #zsh作为默认shell,重启后生效 chsh -s /bin/zsh http://hi.baidu.com/weforhappy/item/5d6495e82928550f65db0099
2012-08-03 10:45 · ubuntu linux · Ubuntu · shell · zsh
ubuntu english install chinese input
[size=large]Please follow up steps as below. It can work, and verified. System–>Administration–>language support,在install/remove lanuages中选择中文安装,安装时间较长,忍耐。。。,keyboard input method system, 选择ibus, 安装完成后,进入System–>Preferences–>ibus preferences–>input method–>select an input method–>chinese,然后选择Pinyin…
2012-07-09 16:40 · ubuntu linux · Ubuntu · chinese input
struts2+android 提交数据到server端中文乱码终极解决方案
struts.xml 编码采用 : android端采用默认UFT-8编码。 终极方案为:大一统字符编码为 UTF-8 。
2012-06-04 09:05 · android · Struts · Android · encoding
ubuntu Linux 打开临时命令窗口Terminal 快捷键 Ctrl+Alt+T
**ubuntu Linux 打开临时命令窗口Terminal 快捷键 Ctrl+Alt+T **
2012-04-01 09:15 · ubuntu linux · Ubuntu · Linux · terminal
Ubuntu搭载PHP环境(安装MySQL/Apache/phpMyAdmin/WordPress)
http://www.linuxsight.com/blog/3377
2012-03-16 14:56 · php · ubuntu linux
使用Gson进行json数据转换(list to json 和json to list)
转载至:[url]http://www.cnblogs.com/chenlhuaf/archive/2011/05/01/gson_test.html[/url] 发现了google的gson,因为之前对于protocolbuf有一些了解,带着一些好奇心,我开始使用了gson。 经过比较,gson和其他现有java json类库最大的不同时gson需要序列化得实体类不需要使用annotation来标识需要序列化得字段,同时gson又可以通过使用annotation来灵活配置需要序列化的字段。 下面是一个简单的例子: [code="java"] public class Person { pr…
2012-03-14 17:18 · gson · Java · json · gson
php邮件发送
[code="php"] debug =true;//是否显示发送的调试信息 $smtp->sendmail("xxxxxx", "xxxxxx", "zlpy", "Email validation!", "HTML"); ?> [/code] email.class.php [code="php"] debug = FALSE; $this->smtp_port = $smtp_port; $this->relay_host = $relay_host; $this->time_out = 30; //is used in fsockopen() # $this->auth = $aut…
2012-03-14 15:27 · php · PHP · email · SMTP