疯狂的生活
wangchao_17915566 · 共 66 篇文章
iphone 线程异常
NSAutoreleaseNoPool(): Object 0x45685e0 of class NSCFString autoreleased with no pool in place 使用drain NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [pool drain];
2010-06-12 18:13 · 评论(0)
UIImage 图片缩放
uiimage 图片缩放 #import <Foundation/Foundation.h> @interface UIImage (scale) -(UIImage*)scaleToSize:(CGSize)size; @end // // UIImageScale.m // golfChina // // Created by chao.wang on 6/1/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import "UIImageScale.h" @implementation UIImage (…
2010-06-01 14:06 · iphone · 评论(0)
mysql concat追加字符串
后追加 update 表名 set 字段名 = concat(字段名,"string") 前追加 update 表名 set 字段名 = concat("string",字段名)
2010-05-31 19:04 · 备忘录 · 评论(0)
json date转化
增加此类 public class DateJsonValueProcessor implements JsonValueProcessor{ private final String format="yyyy-MM-dd"; public Object processArrayValue(Object arg0, JsonConfig arg1) { // TODO Auto-generated method stub return null; } public Object processObjectValue(String key, Object value,JsonConfig ar…
2010-05-26 16:47 · 备忘录 · 评论(0)
@ResponseBody 乱码
spring3使用@ResponseBody 输出乱码,加入此配置 <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" > <property name="messageConverters"> <list> <bean class = "org.springframework.http.converter.StringHttpMessageConverter"> <property name = "supportedMediaTypes"> <list> <v…
2010-05-26 14:04 · 备忘录 · 评论(18)
java反射
Class classType=object.getClass(); Field[] fields=classType.getDeclaredFields(); for(int i=0;i<fields.length;i++){ Field field=fields[i]; String fieldName=field.getName(); String getName = "get"+fieldName; try { Method getMethod=classType.getMethod(getName, new Class[]{}); Object value=getMethod.in…
2010-05-26 11:40 · 备忘录 · 评论(0)
JsonConfig
JsonConfig config = new JsonConfig(); config.setJsonPropertyFilter(new PropertyFilter() { public boolean apply(Object source, String name, Object value) { if (name.equals("clubs") || name.equals("city") //说明一下:name为容易出死循环的属性! || name.equals("msg")) { return true; } else { return false; } } }); haib…
2010-05-26 11:39 · 备忘录 · 评论(0)
我重启服务表被重建了
<prop key="hibernate.hbm2ddl.auto">create</prop> 这个属性改成none
2010-05-25 19:42 · 备忘录 · 评论(0)
Could not load java.net.BindException
这个问题,导致每次修改配置文件数据库被清空了,郁闷了好久 原因:mysql jar重复,删除本项目当中的mysql jar
2010-05-25 18:51 · 备忘录 · 评论(0)
jpa异常
使用JPA时提示错误 The Table <table name> cannot be found on the database ,产生这个问题的原因是项目的Java持久化设置问题,解决的办法很简单。 选中项目名称,右键菜单 ->properties->MyEclipse->Java Persistence栏目,选中Enable database metadata analysis的选项框,同时检查是不是正确的驱动和数据库,然后点击Refresh Metadata按钮刷新后确定即可。
2010-05-11 11:54 · 备忘录 · 评论(0)
mysql excel
导入excel数据 load data local infile 'E:\a.txt' into table query_filed;
2009-10-18 11:24 · 评论(0)
ruby on rails demo
最近ror抄的很热,于是自己也找着网上做个例子,但是遇到了很多问题,主要原因是ruby版本和rails版本兼容的问题,也许是自己刚刚接触,不知道如何是好。经过一番周折终于见到彩虹。 1,安装ruby环境,这里我就不多说了,本人使用的是ruby186-26.exe,网上可以找到下载地址 2,安装rails,在安装rails之前要安装一下gem文件,这里我全部采用2.0.2版本,因为试过很多版本,最终见到彩虹的是此版本,您也可以尝试别的版本。 3,activesupport-2.0.2.gem actionpack-2.0.2.gem actionmailer-2.0.2.gem activer…
2009-09-02 15:36 · 评论(0)
web项目使用多个数据源
今天接到任务,是以前用ssh开发的一套权限系统,现在我们要做新的应用,并且以后我们的开发都基于这个权限进行开发。以前都是不断的往这个权限里面加应用,现在反过来,要降低耦合。现在我的应用系统也是ssh,给这个应用加入权限使得这个应用可以单独工作,别且权限系统也可以单独工作。 在这个应用唯一用到的就是权限的用户管理,所以将权限打成jar,放入本应用系统当中,下来就是一个项目配置两个数据源,配置方法,在tomcat当中,以前是context配置一个数据源,现在配置两个,如下 <Context path="/studentManage" debug="0" reloadable="true" cro…
2009-08-05 17:47 · 评论(0)
Dreamweaver jquery插件
附件下载 http://wangchao-17915566.iteye.com/topics/download/a7099b0a-3fe5-3854-8364-21826c271166
2009-07-14 17:44 · 评论(0)
mysql不能连接
mysql>use mysql; mysql>update user set host = '%' where user ='root'; mysql>flush privileges; mysql>select 'host','user' from user where user='root'; mysql>quit 键入以上命令
2009-07-08 17:23 · 评论(0)