posts - 119, comments - 62, trackbacks - 0, articles - 0

2015年9月18日

http://note.youdao.com/share/web/file.html?id=611b9b6bdf9abafbb1ee45436f50be9e&type=note

posted @ 2015-09-18 21:04 Kevin Meng 阅读(212) | 评论 (0)编辑 收藏

2015年8月10日

每次都在setupconnection...的地方停住了,后来在发现原来是因为我的手机没有插SD卡,愤的!!

posted @ 2015-08-10 23:15 Kevin Meng 阅读(186) | 评论 (0)编辑 收藏

2012年10月22日

geoJOSN为UTF-8编码,转成shp后部分字段出现乱码,一直找不到解决的办法。后来装了QGIS 1.7.4,打开geoJSON文件,注意选择编码为UTF-8,然后save as..,保存成shp文件,此时编码必须选择system就可以解决中文乱码的问题了。

posted @ 2012-10-22 11:53 Kevin Meng 阅读(1453) | 评论 (0)编辑 收藏

2012年8月15日

http://huangqiqing123.iteye.com/blog/1246882 

posted @ 2012-08-15 12:52 Kevin Meng 阅读(241) | 评论 (0)编辑 收藏

2012年8月7日

以下的GPS定位代码,在MOTO XT800,ME811,HTC S610d等手机中定位都没有问题,但是在MOTO XT882里面就是无法定位,后来发现问题出现在红色的代码部分,强制改成GPS定位就可以了。
      locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
      Criteria criteria = new Criteria();
      criteria.setAccuracy(Criteria.ACCURACY_FINE);
      criteria.setAltitudeRequired(false);
      criteria.setBearingRequired(false);
      criteria.setCostAllowed(true);
      criteria.setPowerRequirement(Criteria.POWER_LOW);
      String provider = locationManager.getBestProvider(criteria, true);
      /* 每隔1000ms更新一次,并且不考虑位置的变化。 */
      locationManager.requestLocationUpdates(provider, 3000, 5, locationListener);
      //强制使用GPS定位
      //locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 3000, 5, locationListener);

posted @ 2012-08-07 20:59 Kevin Meng 阅读(323) | 评论 (0)编辑 收藏

2012年8月1日

这次项目开发,运行环境的tomcat版本从5.5.12升级到了6.0.18,发现以前的项目不能跑了,访问一个很简单的jsp也会报错,说无法编译,报的错误就是:Only a type can be imported. com.xxx.xxx.XXX resolves to a package,意思就是说你jsp页面上引用的那个类不存在,可是在老版本明明跑的好好的,而且另一个现象就是项目根目录下的jsp访问没有问题,子目录下就报错,google了一下,发现这是新版本tomcat的一个变化,就是如果不指定context的话,每一个子文件夹都会被tomcat当作一个独立的虚拟应用的,所以每个子文件夹下的jsp页面访问的时候,都会在它的同一层找WEB-INF里面的class,这样当然找不到了,只有刚巧放在根目录下的jsp文件能访问。

解决办法:其实这也是自己以前写tomcat的配置文件时候,写法不规范造成的,以前的server.xml里面host信息代码如下:

<Host name="www.local.com" appBase="D://projects//myWebSite//WebContent" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
    <Alias>192.168.1.43</Alias> 
    <Context path="" docBase="" reloadable="true">
     <Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="www.local.com_log." suffix=".txt" timestamp="true"/>
    </Context></Host>

这其中Context里面的docBase为空,文件路径就靠Host里的appBase去指定,这样tomcat认为你这个站点下没有应用,会自动把每个文件夹当作一个虚拟应用处理。修改后的代码片段如下:

<Host name="www.local.com" appBase="" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
    <Alias>192.168.1.43</Alias> 
    <Context path="" docBase="D://projects//myWebSite//WebContent" reloadable="true">
     <Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="www.local.com_log." suffix=".txt" timestamp="true"/>
    </Context></Host>

可以看到Host里面不再指定appBase了,而是在主机下建立一个应用,应用的文件路径通过docBase来指定,这样就不会再产生找不到class的问题了。

ps:tomcat的这个问题好像是从5.5.28就开始了,记得以前也曾经尝试过升级tomcat,就发生了类似的问题,但是当时没充裕时间去解决,就一直把问题遗留到现在。

posted @ 2012-08-01 11:14 Kevin Meng 阅读(503) | 评论 (0)编辑 收藏

2012年2月3日

web开发中,我们经常需要将一个表的数据插入到另外一个表,有时还需要指定导入字段,设置只需要导入目标表中不存在的记录,虽然这些都可以在程序中拆分成简单sql来实现,但是用一个sql的话,会节省大量代码。下面我以mysql数据库为例分情况一一说明:

两张表:insertTest和insertTest2,前者中有测试数据
create table insertTest(id int(4),name varchar(12));
insert into insertTest values(100,'liudehua');
insert into insertTest values(101,'zhourunfa');
insert into insertTest values(102,'zhouhuajian');
1.如果2张表的字段一致,并且希望插入全部数据,可以用这种方法:
  INSERT INTO 目标表 SELECT * FROM 来源表;
insert into insertTest select * from insertTest2;
2.如果只希望导入指定字段,可以用这种方法:
 INSERT INTO 目标表 (字段1, 字段2, ...) SELECT 字段1, 字段2, ... FROM 来源表;
 注意字段的顺序必须一致。
insert into insertTest2(id) select id from insertTest2;
3.如果您需要只导入目标表中不存在的记录,可以使用这种方法:
 INSERT INTO 目标表  
 (字段1, 字段2, ...)  
 SELECT 字段1, 字段2, ...  
 FROM 来源表  
 WHERE not exists (select * from 目标表  
 where 目标表.比较字段 = 来源表.比较字段); 
 1>.插入多条记录:
insert into insertTest2
(id,name)
select id,name
from insertTest
where not exists (select * from insertTest2
where insertTest2.id=insertTest.id);
 2>.插入一条记录:
insert into insertTest    
(id, name)    
SELECT 100, 'liudehua'    
FROM dual    
WHERE not exists (select * from insertTest    
where insertTest.id = 100);
使用 dual 作表名,select 语句后面直接跟上要插入的字段的值。

posted @ 2012-02-03 16:04 Kevin Meng 阅读(511) | 评论 (0)编辑 收藏

2011年11月28日

1、arcgis server安装过程中,主体文件安装结束,配置server 账号时,遇到invalid password specified,对于arcgissom和arcgissoc两个accounts,任何密码都适合,后来想着新建另外两个arcgissom1和arcgissoc1,通过了,再一看,原来arcgissom和arcgissoc两个账号在计算机管理的账户里已经存在。删去后再装就没问题了。
不會有問題了

posted @ 2011-11-28 13:03 Kevin Meng 阅读(1568) | 评论 (0)编辑 收藏

2011年11月9日

以前的项目运行好好的,升级了ADT后,进行junit测试时出现错误:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (classFileParser.cpp:3494), pid=7480, tid=7376
#  Error: ShouldNotReachHere()
#
# JRE version: 6.0_29-b11
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.4-b02 mixed mode windows-amd64 compressed oops)
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

解决办法:
1.选中junit测试类,右键 -> Run As -> Run Configurations...
2.切换到Classpath选项栏,删掉Bootstrap Entries里面的Android Library,然后点击右侧的Advanced.. -> Add Library -> JRE System Library,一路next即可。

这时再运行该类,就能正常运行了。

posted @ 2011-11-09 20:30 Kevin Meng 阅读(2461) | 评论 (0)编辑 收藏

2011年11月7日

字段为Datetime,获得2011-11-05以后添加的记录
SELECT *  FROM geo_corporation t WHERE TO_DAYS(t.addtime)>TO_DAYS('2011-11-05')
某一时间段内的记录
SELECT *  FROM geo_corporation t WHERE TO_DAYS(t.addtime)>TO_DAYS('2011-11-05') AND TO_DAYS(t.addtime)<TO_DAYS('2011-11-7')

posted @ 2011-11-07 11:56 Kevin Meng 阅读(238) | 评论 (0)编辑 收藏