xiaoqiu369
xiaoqiu369 · 共 17 篇文章
[置顶] Ruby on Rails Routing - Simple Examples
This article contains a list of ruby on rails routing examples. If you find you have any questions please leave a comment. Routes are processed from the top of routes.rb down. If a route is matched it will stop processing the routes.rb file and use that route. I’m detailing basic and named routes b…
[置顶] Routes
routes: routes的命名允许你减少重复的代码,通过分配一个根据生成一个封装routes rule hash的方法的路径规则名称来实现, 你可以定义一个命名路径,你可以调用它在你的routes.rb文件中来代替connect方法. 例如: map.home '',:controller=>'main',:action=>'start' 这只是为你做了很少的一点事.首先,它创建一个名为home_url的方法.因此上面的命名规则,前期的请求为: redirect_to :controller=>'main',:action=>'start' 现在为: redirect_to home_u…
2008-12-15 16:43 · 评论(0)
[置顶] 数据结构java的实现
转自:http://bea.iteye.com/blog/166347 不知道为什么copy下来发布不完整. 1 树与哈夫曼树 Java代码 package tree; public class TreeNode { TreeNode llink; TreeNode rlink; int info; } package tree; public class Tree { TreeNode root; public Tree() { } public boolean isEmpty() { return root == null; } // 插入 public void insertBinar…
2008-07-17 15:14 · 评论(0)
hibernate search
Full Text Hibernate Lucene Search Hello World Example Using Maven and SQLite 17,746 views By Abhijit Ghosh on 2012-7-26 14:22:26 <iframe id="aswift_0" style="left: 0px; position: absolute; top: 0px;" name="aswift_0" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="728" height=…
2013-09-06 19:37 · hibernage · 评论(0)
数据结构java的实现
1 树与哈夫曼树 Java代码 package tree; public class TreeNode { TreeNode llink; TreeNode rlink; int info; } package tree; public class Tree { TreeNode root; public Tree() { } public boolean isEmpty() { return root == null; } // 插入 public void insertBinaryTree(int info) { TreeNode node = new TreeNode(); node.…
2008-07-17 15:13 · 评论(0)
ubuntu常用命令
df (Disk Free) i接点 df -i (Inodes) ls (List) ls -al (-l 以long format格式显示 -a All) cd (Change Directory) cp cp -ax -a(archive 复制所有的目录) -x(复制后的格式与目标目录的格式是相同***发生了转化) mv (move) 文件移动和重命名 rm (Remove 文件的删除) mkdir/rmdir (make directory) 建立目录 rm -rf (Remove Directory) 强制删除目录和目录中的文件 -r Recursive 将删除持续下去 -f Fo…
2008-07-17 14:43 · 评论(0)
学了设计模式去泡MM的23种方法
创建型模式 1、FACTORY 追MM少不了请吃饭了,麦当劳的鸡翅和肯德基的鸡翅都是MM爱吃的东西,虽然口味有所不同,但不管你带MM去麦当劳或肯德基,只管向服务员说“来四个鸡翅”就行了。麦当劳和肯德基就是生产鸡翅的Factory 工厂模式 :客户类和工厂类分开。消费者任何时候需要某种产品,只需向工厂请求即可。消费者无须修改就可以接纳新产品。缺点是当产品修改时,工厂类也要做相应的修改。如:如何创建及如何向客户端提供。 -----------------------------------------------------------------------------------------…
2008-07-14 14:19 · 评论(0)
ubuntu安装注意事项
1。安装前最好连上网,遇到的问题是安装中文出现问题。有些东西安装不上。2。安装jdk:第二步开始安装,安装JDK6 代码: sudo chmod +x jdk-6-linux-i586.bin sudo ./jdk-6-linux-i586.bin 配置环境变量编辑/etc/profile文件添加以下内容: 代码: export JAVA_HOME=/opt/jdk1.6.0 export JRE_HOME=/opt/jdk1.6.0/jre export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH export PATH=$JAV…
2008-07-10 17:54 · 评论(0)
Ubuntu 8.04下编译安装Ruby-1.8.6-p114[转载]
环境:Ubuntu8.04 1.安装build工具 sudo aptitude install build-essential linux-headers-$(uname -r) 2.安装readline zlib libncurses5 apt-get install zlib1g-dev apt-get install libreadline5 libreadline5-dev apt-get install libncurses5 libncurses5-dev 3.安装ruby ruby的源代码下载: http://www.ruby-lang.org/en/downloads/ wg…
2008-07-10 09:13 · 评论(0)
webwork与ajax的疑问
1.jsp页面: <ww:div id="twoseconds" cssStyle="border: 1px solid yellow;" href="/AjaxTest.action" theme="ajax" updateFreq="2000" errorText="There was an error" loadingText="loading...">Initial Content </ww:div> 2.配置文件: <action name="AjaxTest" class="com.opensymphony.webwork.showcase.ajax.AjaxTestAction…
2008-01-17 00:18 · 评论(0)
数据源+freemarker+servlet生成xml文件
一.步骤: 1.在server.xml文件中建立数据源. <Service name="Cms"> <Connector debug="0" enableLookups="false" port="8084" protocol="AJP/1.3" redirectPort="8443"/> <Connector acceptCount="100" connectionTimeout="20000" debug="0" disableUploadTimeout="true" enableLookups="false" maxSpareThreads="75" maxThreads="150" …
2007-11-17 10:46 · 评论(0)
struts学习之form表单, 配置文件action对应关系。
<s:form action="addProduct" theme="simple"> <package name="convertDemo" extends="struts-default" namespace="/locale"> <action name="convertLocal" class="locale.ConvertLocale"> <result>/convertCal.jsp</result> </action> <action name="addProduct" class="locale.ProductConfirm"> <result>/locale/showPro…
2007-11-01 16:03 · 评论(0)
struts2初步配置
if struts2-spring-plugin-2.0.9.jar is in lib ,we must config the web.xml and application.xml. The flowing is the simple test code. HelloWorld.java: package example; import com.opensymphony.xwork2.ActionSupport; public class HelloWorld extends ActionSupport { public static final String MESSAGE="HELL…
2007-10-27 13:48 · 评论(0)
struts标签循环示例
<s:iterator value="bookList"> <tr class="trs"> <td> <a href='<s:url action="edit" ><s:param name="bookId" value="bookId" /></s:url>'> <s:property value="bookName"/> </a> </td> <td><s:property value="bookAuthor"/></td> <td><s:property value="bookPublish"/></td> <td><s:text name="format.date"><s:para…
2007-10-27 13:42 · 评论(0)
struts2与spring结合
转载于在webwork的文章 1 配置struts.properties文件,指定spring作为struts的IoC容器 struts.objectFactory = spring (1)默认的autowiring模式是:by name 即如果applicationContext.xml文件中的bean id与struts.xml文件中的action name相同,就 (2)如果要改为其他模式: struts.objectFactory.spring.autoWire = name|type|auto|constructor 2 配置web.xml文件,启动Spring侦听器 <liste…
2007-10-19 15:05 · 评论(0)