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 閱讀(231) | 評論 (0)編輯 收藏

          2015年8月10日

          每次都在setupconnection...的地方停住了,后來在發(fā)現(xiàn)原來是因為我的手機(jī)沒有插SD卡,憤的?。?/div>

          posted @ 2015-08-10 23:15 Kevin Meng 閱讀(200) | 評論 (0)編輯 收藏

          2012年10月22日

          geoJOSN為UTF-8編碼,轉(zhuǎn)成shp后部分字段出現(xiàn)亂碼,一直找不到解決的辦法。后來裝了QGIS 1.7.4,打開geoJSON文件,注意選擇編碼為UTF-8,然后save as..,保存成shp文件,此時編碼必須選擇system就可以解決中文亂碼的問題了。

          posted @ 2012-10-22 11:53 Kevin Meng 閱讀(1492) | 評論 (0)編輯 收藏

          2012年8月15日

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

          posted @ 2012-08-15 12:52 Kevin Meng 閱讀(267) | 評論 (0)編輯 收藏

          2012年8月7日

          以下的GPS定位代碼,在MOTO XT800,ME811,HTC S610d等手機(jī)中定位都沒有問題,但是在MOTO XT882里面就是無法定位,后來發(fā)現(xiàn)問題出現(xiàn)在紅色的代碼部分,強制改成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 閱讀(340) | 評論 (0)編輯 收藏

          2012年8月1日

          這次項目開發(fā),運行環(huán)境的tomcat版本從5.5.12升級到了6.0.18,發(fā)現(xiàn)以前的項目不能跑了,訪問一個很簡單的jsp也會報錯,說無法編譯,報的錯誤就是:Only a type can be imported. com.xxx.xxx.XXX resolves to a package,意思就是說你jsp頁面上引用的那個類不存在,可是在老版本明明跑的好好的,而且另一個現(xiàn)象就是項目根目錄下的jsp訪問沒有問題,子目錄下就報錯,google了一下,發(fā)現(xiàn)這是新版本tomcat的一個變化,就是如果不指定context的話,每一個子文件夾都會被tomcat當(dāng)作一個獨立的虛擬應(yīng)用的,所以每個子文件夾下的jsp頁面訪問的時候,都會在它的同一層找WEB-INF里面的class,這樣當(dāng)然找不到了,只有剛巧放在根目錄下的jsp文件能訪問。

          解決辦法:其實這也是自己以前寫tomcat的配置文件時候,寫法不規(guī)范造成的,以前的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認(rèn)為你這個站點下沒有應(yīng)用,會自動把每個文件夾當(dāng)作一個虛擬應(yīng)用處理。修改后的代碼片段如下:

          <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了,而是在主機(jī)下建立一個應(yīng)用,應(yīng)用的文件路徑通過docBase來指定,這樣就不會再產(chǎn)生找不到class的問題了。

          ps:tomcat的這個問題好像是從5.5.28就開始了,記得以前也曾經(jīng)嘗試過升級tomcat,就發(fā)生了類似的問題,但是當(dāng)時沒充裕時間去解決,就一直把問題遺留到現(xiàn)在。

          posted @ 2012-08-01 11:14 Kevin Meng 閱讀(525) | 評論 (0)編輯 收藏

          2012年2月3日

          web開發(fā)中,我們經(jīng)常需要將一個表的數(shù)據(jù)插入到另外一個表,有時還需要指定導(dǎo)入字段,設(shè)置只需要導(dǎo)入目標(biāo)表中不存在的記錄,雖然這些都可以在程序中拆分成簡單sql來實現(xiàn),但是用一個sql的話,會節(jié)省大量代碼。下面我以mysql數(shù)據(jù)庫為例分情況一一說明:

          兩張表:insertTest和insertTest2,前者中有測試數(shù)據(jù)
          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張表的字段一致,并且希望插入全部數(shù)據(jù),可以用這種方法:
            INSERT INTO 目標(biāo)表 SELECT * FROM 來源表;
          insert into insertTest select * from insertTest2;
          2.如果只希望導(dǎo)入指定字段,可以用這種方法:
           INSERT INTO 目標(biāo)表 (字段1, 字段2, ...) SELECT 字段1, 字段2, ... FROM 來源表;
           注意字段的順序必須一致。
          insert into insertTest2(id) select id from insertTest2;
          3.如果您需要只導(dǎo)入目標(biāo)表中不存在的記錄,可以使用這種方法:
           INSERT INTO 目標(biāo)表  
           (字段1, 字段2, ...)  
           SELECT 字段1, 字段2, ...  
           FROM 來源表  
           WHERE not exists (select * from 目標(biāo)表  
           where 目標(biāo)表.比較字段 = 來源表.比較字段); 
           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 閱讀(535) | 評論 (0)編輯 收藏

          2011年11月28日

          1、arcgis server安裝過程中,主體文件安裝結(jié)束,配置server 賬號時,遇到invalid password specified,對于arcgissom和arcgissoc兩個accounts,任何密碼都適合,后來想著新建另外兩個arcgissom1和arcgissoc1,通過了,再一看,原來arcgissom和arcgissoc兩個賬號在計算機(jī)管理的賬戶里已經(jīng)存在。刪去后再裝就沒問題了。
          不會有問題了

          posted @ 2011-11-28 13:03 Kevin Meng 閱讀(1618) | 評論 (0)編輯 收藏

          2011年11月9日

          以前的項目運行好好的,升級了ADT后,進(jìn)行junit測試時出現(xiàn)錯誤:

          #
          # 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,然后點擊右側(cè)的Advanced.. -> Add Library -> JRE System Library,一路next即可。

          這時再運行該類,就能正常運行了。

          posted @ 2011-11-09 20:30 Kevin Meng 閱讀(2481) | 評論 (0)編輯 收藏

          2011年11月7日

          字段為Datetime,獲得2011-11-05以后添加的記錄
          SELECT *  FROM geo_corporation t WHERE TO_DAYS(t.addtime)>TO_DAYS('2011-11-05')
          某一時間段內(nèi)的記錄
          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 閱讀(264) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 讷河市| 洪雅县| 包头市| 佛冈县| 乌兰浩特市| 辰溪县| 新疆| 吉木萨尔县| 县级市| 海宁市| 漯河市| 石首市| 惠安县| 郓城县| 咸宁市| 厦门市| 牙克石市| 定兴县| 房山区| 禄丰县| 诏安县| 尚志市| 西贡区| 津市市| 大宁县| 从化市| 融水| 龙川县| 富裕县| 宣威市| 大宁县| 阳江市| 工布江达县| 岳普湖县| 威远县| 天水市| 青海省| 辉南县| 永嘉县| 吉林市| 杭锦后旗|