Skip to content

Instantly share code, notes, and snippets.

够烦恼的,google下,找到答案了….

Bundle install and the root password

If you don’t want to type the root password for every new project a solution is to move the GEM paths in a directory where the user can write, otherwise a simple solution is to make that folders writable by the user.

赋予权限即可解决:

1.检索 所有:Ad.find(:all) id: Ad.find(params[:id])

@Controller //让该类成为控制器
public class HelloController {
@RequestMapping(value={"/","/hello"})
public String hello(int id,Map<String,Object> map) { //使用Map传值
System.out.println(id);
System.out.println("hello");
map.put("hello", "world");
return "hello";
}
@wjch
wjch / applicationContext.xml
Last active December 18, 2015 00:49
sping与sping mvc 整合
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
Error in user YAML: (<unknown>): found character that cannot start any token while scanning for the next token at line 2 column 1
---
# Python 简介
@su27 and @menghan
---

What is Python?

Python: 优雅而健壮的编程语言

  • 高级

  • 易学易读易维护

1.果然是实践出真知:

public class Hello {

  
	public static  void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
		Class<?> clazz = Class.forName("com.wjch.reflection.Person");	
		Person p = (Person) clazz.newInstance();
 Constructor&gt;[] cons = clazz.getConstructors();
public function action_authcode() {
//随机生成一个4位数的数字验证码
$num="";
for($i=0;$i<4;$i++){
$num .= rand(0,9);
}
//4位验证码也可以用rand(1000,9999)直接生成
//将生成的验证码写入session,备验证页面使用
SESSION::put("authcode", $num);
//创建图片,定义颜色值
@wjch
wjch / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console