生活日记
按照我个人的习惯和爱好,是这么着也不会去雍和宫这地方的, 连想都没有想过去这地方看那些神的,但是也没有到反对去这种地方的。
昨天晚上,lili来我这了,今天给他她电脑顺便送她,就去雍和宫了,她住在雍和宫附近,给她弄完电脑,她提议就雍和宫里去看看,也买了包香。
说实在的,里边那些东西我也一点也不了解,和一起去的那个丫头也不知道多少。
里边人到是挺多的,老外也是非常多。
在雍和宫里边我发现一个非常奇怪的想像就是神和人也差不多,绝大数人只个大佛上香,而且跪地上,看起来很前尘,我也顺便看看边上的那些小神,发现人却特别的少、
我发现我真是能一心多用,脑子里在审视我边上的这个女孩,她一点也谈不上漂亮,糊里糊涂的就认识,而且一直保持着联系,好像有点不像我的性格,我也谈不上喜欢她,但是联系却非常频繁。
她比我小整5岁,但是我们却聊的非常来。她是一个比较无聊的女孩,而且被这个社会的风气感染也比较严重,我和她说的好多话,她几乎是根本听不进去。也许这就是代沟吧!
对她我有着一种呵护状态,这种状态在我身上是很少能有,突然间发现我自己也不能理解自己了,是否有点点喜欢她的意思,但是不是那么的强烈,不过让我去喜欢一个女,是否比较难,到不是长相,重要的是一个人的内涵,这点在她身体会不多,也这也叫做糊涂的好感吧!
|
|
|
|
| ± 英特尔® 虚拟化技术要求计算机系统具备支持英特尔® 虚拟化技术的处理器、芯片组、BIOS、虚拟机监视器(VMM)以及用于某些用途的特定平台软件。功能、性能或其他英特尔® 虚拟化技术优势会根据软硬件配置的不同而有所差异。支持英特尔® 虚拟化技术的虚拟机监视器(VMM)应用程序目前正在开发中。 |
| Φ 在英特尔® 架构上进行 64 位计算的系统要求为:采用英特尔® 64 位架构的处理器、芯片组、基本输入输出系统 (BIOS)、操作系统、设备驱动程序和应用程序。如果系统没有采用支持英特尔® 64 位架构的 BIOS,处理器将无法运行(包括 32 位运算)。实际性能会根据您所使用的具体软硬件配置的不同而有所差异。如欲了解更多信息,请咨询系统供应商。 |
| °病毒防护技术功能的启用要求电脑具备支持病毒防护技术的处理器和操作系统。请联系您的电脑制造商以确定您的系统是否可以提供病毒防护技术功能 |
今天晚上下班的路上,突然间想了个注意,想自己弄个网站。
名字已经起好了,叫泡(跑)牛吧!理念就是:通俗而不庸俗,简单而不简约
网站的愿景:希望越来越多的光棍能够泡到牛!
方案在策划中,我将一切能开的东西放在网上和大家一起讨论!
怕自己没有执行力,就先申请了个域名http://www.pocaws.com 现在已经url转发到了: http://www.zhuoda.org/haohao/
技术框架会在一个星期之内发在网上供大家讨论,就是不知道去那儿弄个空间,打电话问了一下,net.cn
到是有java的空间每年不到两千块大洋!
网站的策划和宣传靠大家一起来讨论,我来决策,开发的任务也由我和几个朋友来弄,问题不是很大,
我做的网站布局风格上不要图片,都用div+css来弄!
package ccp.stock.service.base;
import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Projections;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import ccp.stock.util.PaginationSupport;
/**
* @author haohao
* @since 2007-2-12 对spring HibernateDaoSupport继承
*/
public class AbstractService extends HibernateDaoSupport {
private static final Log log = LogFactory.getLog(AbstractService.class);
/**
* 默认cache 为false
*/
private boolean cacheQueries = false;
private String queryCacheRegion;
/**
* 初始化 Dao
* @see org.springframework.dao.support.DaoSupport#initDao()
*/
@Override
protected void initDao() throws Exception {
super.initDao();
getHibernateTemplate().setCacheQueries(cacheQueries);
if (queryCacheRegion != null) {
getHibernateTemplate().setQueryCacheRegion(queryCacheRegion);
}
}
/**
* @param cacheQueries
* AbstractService.java ccp.stock.service.base 下午02:51:23
*/
public void setCacheQueries(final boolean cacheQueries) {
this.cacheQueries = cacheQueries;
}
/**
* @param queryCacheRegion
* AbstractService.java ccp.stock.service.base 下午02:53:14
*/
public void setQueryCacheRegion(final String queryCacheRegion) {
this.queryCacheRegion = queryCacheRegion;
}
/**
* 保存一个class
* @param entity
* @return boolean AbstractService.java ccp.stock.service.base 下午02:52:38
*/
public boolean create(final Object entity) {
try {
this.getHibernateTemplate().save(entity);
return true;
} catch (final RuntimeException re) {
AbstractService.log.error("create failed", re);
throw re;
}
}
/**
* 更新一个class
* @param entity
* @return boolean AbstractService.java ccp.stock.service.base 下午02:53:55
*/
public boolean update(final Object entity) {
try {
getHibernateTemplate().update(entity);
return true;
} catch (final RuntimeException re) {
AbstractService.log.error("update failed", re);
throw re;
}
}
/**
* 删除一个class
*
* @param entity
* @return boolean AbstractService.java ccp.stock.service.base 下午02:54:33
*/
public boolean remove(final Object entity) {
try {
getHibernateTemplate().delete(entity);
return true;
} catch (final RuntimeException re) {
AbstractService.log.error("delete failed", re);
throw re;
}
}
/**
* load class
*
* @param entity
* @param id
* @return Object AbstractService.java ccp.stock.service.base 下午02:55:22
*/
public Object loadById(final Class entity, final Serializable id) {
return getHibernateTemplate().get(entity, id);
}
/**
* 查看所有
*
* @param entity
* @return List AbstractService.java ccp.stock.service.base 下午02:56:06
*/
public List findAll(final Class entity) {
return getHibernateTemplate().find("from " + entity.getName());
}
/**
* @param namedQuery
* @return List AbstractService.java ccp.stock.service.base 下午02:56:55
*/
public List findByNamedQuery(final String namedQuery) {
return getHibernateTemplate().findByNamedQuery(namedQuery);
}
/**
* pojo.xml queryName有参数
*
* @param query
* @param parameter
* @return List AbstractService.java ccp.stock.service.base 下午02:57:23
*/
public List findByNamedQuery(final String query, final Object parameter) {
return getHibernateTemplate().findByNamedQuery(query, parameter);
}
/**
* pojo*_.xml queryName[]有参数
*
* @param query
* @param parameters
* @return List AbstractService.java ccp.stock.service.base 下午02:58:07
*/
public List findByNamedQuery(final String query, final Object[] parameters) {
return getHibernateTemplate().findByNamedQuery(query, parameters);
}
/**
* 查找的class对象
*
* @param query
* @return List AbstractService.java ccp.stock.service.base 下午02:59:23
*/
public List find(final String query) {
return getHibernateTemplate().find(query);
}
/**
* 查找
*
* @param entity
* @param c
* @param startIndex
* @param count
* @param orders
* @return List AbstractService.java ccp.stock.service.base 下午03:00:26
*/
@SuppressWarnings("unchecked")
public List find(final Class entity, final Criterion criterion,
final int startIndex, final int count, final List<Order> orders) {
return (List) getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(final Session session)
throws HibernateException, SQLException {
final Criteria criteria = session.createCriteria(entity);
if (criterion != null) {
criteria.add(criterion);
}
if (orders != null) {
for (Order element : orders) {
criteria.addOrder(element);
}
}
criteria.setFirstResult(startIndex);
criteria.setMaxResults(count);
return criteria.list();
}
});
}
/**
* 查找的class对象
* @param entity
* @param c
* @param ps
* @return PaginationSupport 返回 分页封装 AbstractService.java
* ccp.stock.service.base 下午03:01:02
*/
public PaginationSupport find(final Class entity,
final Criterion criterion, final PaginationSupport ps) {
return find(entity, criterion, ps, null,null);
}
/**
* @param entity
* @param c
* 查找的class对象
* @param ps
* 分页封装
* @param orders
* 排序集合
* @return PaginationSupport 返回 分页封装 AbstractService.java
* ccp.stock.service.base 下午03:01:44
*/
@SuppressWarnings("unchecked")
public PaginationSupport find(final Class entity,
final Criterion criterion, final PaginationSupport ps,
final List<Order> orders) {
return find(entity, criterion, ps, orders,null);
}
//分组分页
public PaginationSupport find(final Class entity,
final Criterion criterion, final PaginationSupport ps,
final List<Order> orders, final String groupStr) {
return (PaginationSupport) getHibernateTemplate().execute(
new HibernateCallback() {
@SuppressWarnings("unchecked")
public Object doInHibernate(final Session session)
throws HibernateException, SQLException {
final Criteria criteria = session
.createCriteria(entity);
if (criterion != null) {
criteria.add(criterion);
}
final int totalCount = ((Integer) criteria
.setProjection(Projections.rowCount())
.uniqueResult()).intValue(); // 记录总数
ps.setTotalCount(totalCount);
criteria.setProjection(null);
if(groupStr!=null){
criteria.setProjection(Projections.projectionList().add(Projections.groupProperty(groupStr)));
}
if (orders != null) {
for (final Order element : orders) {
criteria.addOrder(element);
}
}
criteria.setProjection(null);
criteria.setFirstResult(ps.getStartIndex())
.setMaxResults(ps.getCountOnEachPage());
final List list = criteria.list();
ps.setItems(list);
return ps;
}
});
}
/**
* query分页
*/
@SuppressWarnings("unchecked")
public PaginationSupport find(Query query,final PaginationSupport ps){
ps.setTotalCount(query.list().size());
query.setFirstResult(ps.getStartIndex());
query.setMaxResults(ps.getCountOnEachPage());
ps.setItems(query.list());
return ps;
}
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> DSTree </TITLE>
<META NAME="Author" CONTENT="sTarsjz@hotmail.com" >
<style>
body,td{font:12px verdana}
#treeBox{background-color:#fffffa;}
#treeBox .ec{margin:0 5 0 5;}
#treeBox .hasItems{font-weight:bold;height:20px;padding:3 6 0 6;margin:2px;cursor:hand;color:#555555;border:1px solid #fffffa;}
#treeBox .Items{height:20px;padding:3 6 0 6;margin:1px;cursor:hand;color:#555555;border:1px solid #fffffa;}
</style>
<base href="http://vip.5d.cn/star/dstree/" />
<script>
//code by star 20003-4-7
var HC = "color:#990000;border:1px solid #cccccc";
var SC = "background-color:#efefef;border:1px solid #cccccc;color:#000000;";
var IO = null;
function initTree(){
var rootn = document.all.menuXML.documentElement;
var sd = 0;
document.onselectstart = function(){return false;}
document.all.treeBox.appendChild(createTree(rootn,sd));
}
function createTree(thisn,sd){
var nodeObj = document.createElement("span");
var upobj = document.createElement("span");
with(upobj){
style.marginLeft = sd*10;
className = thisn.hasChildNodes()?"hasItems":"Items";
innerHTML = "<img src=expand.gif class=ec>" + thisn.getAttribute("text") +"";
onmousedown = function(){
if(event.button != 1) return;
if(this.getAttribute("cn")){
this.setAttribute("open",!this.getAttribute("open"));
this.cn.style.display = this.getAttribute("open")?"inline":"none";
this.all.tags("img")[0].src = this.getAttribute("open")?"expand.gif":"contract.gif";
}
if(IO){
IO.runtimeStyle.cssText = "";
IO.setAttribute("selected",false);
}
IO = this;
this.setAttribute("selected",true);
this.runtimeStyle.cssText = SC;
}
onmouseover = function(){
if(this.getAttribute("selected"))return;
this.runtimeStyle.cssText = HC;
}
onmouseout = function(){
if(this.getAttribute("selected"))return;
this.runtimeStyle.cssText = "";
}
oncontextmenu = contextMenuHandle;
onclick = clickHandle;
}
if(thisn.getAttribute("treeId") != null){
upobj.setAttribute("treeId",thisn.getAttribute("treeId"));
}
if(thisn.getAttribute("href") != null){
upobj.setAttribute("href",thisn.getAttribute("href"));
}
if(thisn.getAttribute("target") != null){
upobj.setAttribute("target",thisn.getAttribute("target"));
}
nodeObj.appendChild(upobj);
nodeObj.insertAdjacentHTML("beforeEnd","<br>")
if(thisn.hasChildNodes()){
var i;
var nodes = thisn.childNodes;
var cn = document.createElement("span");
upobj.setAttribute("cn",cn);
if(thisn.getAttribute("open") != null){
upobj.setAttribute("open",(thisn.getAttribute("open")=="true"));
upobj.getAttribute("cn").style.display = upobj.getAttribute("open")?"inline":"none";
if( !upobj.getAttribute("open"))upobj.all.tags("img")[0].src ="contract.gif";
}
for(i=0;i<nodes.length;cn.appendChild(createTree(nodes[i++],sd+1)));
nodeObj.appendChild(cn);
}
else{
upobj.all.tags("img")[0].src ="endnode.gif";
}
return nodeObj;
}
window.onload = initTree;
</script>
<script>
function clickHandle(){
// your code here
}
function contextMenuHandle(){
event.returnValue = false;
var treeId = this.getAttribute("treeId");
// your code here
}
</script>
</HEAD>
<BODY>
<xml id=menuXML>
<?xml version="1.0" encoding="GB2312"?>
<DSTreeRoot text="根节点" open="true" href="http://" treeId="123">
<DSTree text="技术论坛" open="false" treeId="">
<DSTree text="5DMedia" open="false" href="http://" target="box" treeId="12">
<DSTree text="网页编码" href="http://" target="box" treeId="4353" />
<DSTree text="手绘" href="http://" target="box" treeId="543543" />
<DSTree text="灌水" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="BlueIdea" open="false" href="http://" target="box" treeId="213">
<DSTree text="DreamWeaver & JS" href="http://" target="box" treeId="4353" />
<DSTree text="FlashActionScript" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="CSDN" open="false" href="http://" target="box" treeId="432">
<DSTree text="JS" href="http://" target="box" treeId="4353" />
<DSTree text="XML" href="http://" target="box" treeId="543543" />
</DSTree>
</DSTree>
<DSTree text="资源站点" open="false" treeId="">
<DSTree text="素材屋" href="http://" target="box" treeId="12" />
<DSTree text="桌面城市" open="false" href="http://" target="box" treeId="213">
<DSTree text="壁纸" href="http://" target="box" treeId="4353" />
<DSTree text="字体" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="MSDN" open="false" href="http://" target="box" treeId="432">
<DSTree text="DHTML" href="http://" target="box" treeId="4353" />
<DSTree text="HTC" href="http://" target="box" treeId="543543" />
<DSTree text="XML" href="" target="box" treeId="2312" />
</DSTree>
</DSTree>
</DSTreeRoot>
</xml>
<table style="position:absolute;left:100;top:100;">
<tr><td id=treeBox style="width:400px;height:200px;border:1px solid #cccccc;padding:5 3 3 5;" valign=top></td></tr>
<tr><td style="font:10px verdana;color:#999999" align=right>by <font color=#660000>sTar</font><br> 2003-4-8</td></tr>
</table>
</BODY>
</HTML>
昨天和轮子去村里买弄了台电脑,顺便给自己的老爷机加了点内存
一切都是为了用vista操作系统,加了两条1g内存,我机器现在内存达到了2.5g,加上钱了
这东西的效果马上就出来了,所有该有的特效现在都有了,而且速度变快多了。
package test;
import java.util.ArrayList;
import java.util.List;
/**
* 牛产仔问题。有一头母牛,它每年年初要生一头小母牛;每头小母牛从第四个年头起, 每年年初也要生一头小母牛。按此规律,若无牛死亡,第20年头上共有多少头母牛?
* @author
*/
public class Mooooo {
public static final int yearCount = 20;
public static final int yearHappyBirthday = 3;
public static void main(String[] args) {
List<Cow> cows = new ArrayList<Cow>(); // 牛群(冯巩不在)
cows.add(new Cow(yearHappyBirthday)); // 第一个目牛
ArrayList<Cow> newCows = new ArrayList<Cow>(); // 小牛群
for (int i = 0; i < yearCount; i++) {
for (Cow cow : cows) {
if (cow.isHappyBirthday()) {
newCows.add(new Cow(0)); // 生牛
}
cow = null;
}
cows.addAll(newCows); // 增加到牛群
newCows.clear();
}
System.out.println("二十年光阴似箭,共有牛 " + cows.size() + " 头。");
cows = null;
}
/**
* 母牛
*/
static class Cow {
private int age = 0;
public Cow(int age) {
this.age = age;
}
public boolean isHappyBirthday() {
age++;
return age >= yearHappyBirthday ? true : false;
}
}
}


