2010年12月18日

作業系統換成x64後, 遊戲註冊表的變化

因為有些遊戲不需特定重灌

只要再給他註冊表註冊一下就可以了

但一般來說大部份可以找到的註冊表都是32位元作業系統用的

遇上了64位元作業系統就要改成以下格式


【HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts】

64位元的環境就要改成以下的格式

【HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Electronic Arts】

2010年11月28日

如何安裝 deb 副檔名的iphone程式

安裝的方式為:

1. 打開 iFunbox 連進 iphone
2. 找到 /var/root/Media/Cydia/AutoInstall 資料夾 (如果相關資料夾沒有就要自己建立一下)
3. 將deb檔案丟進去
4. 重開~ 完成
當然前提是JB後要記得安裝 cydia

2010年10月28日

在IIS7的環境佈署 Reportviewer 卻無法正常顯示的問題

由於IIS7新架構的關係, 導致ReportViewer的報表成果無法正確展示在頁面下,目前可透過兩種方式解決。
第一個是將網站所屬的應用程式集區的管線模式由整合式變更為傳統。
第二個則是設定網站的 處理常式對應,程序如下:


1. Go to IIS 7 admin screen.
2. Go to your Virtual Directory (Application actually).
3. Click on Handler Mappings.
4. Click on Add Managed Handler.
5. Add the following Handler:
Request Path: Reserved.ReportViewerWebControl.axd
Type: Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a  (This can be selected from the drop down, just make sure you select the correct one).
Name: Reserved.ReportViewerWebControl.axd

2010年10月26日

Insert geometry 前確認是否合法

之前為專案寫了一個 shapefile 匯入程式, 匯入目標是PostgreSQL資料庫, 後來在資料庫中進行 intersect 時發生空間分析的錯誤,經過追查發現有些Geometry有 self-intersection 的狀況,接著還好在 google 找到解決方案


-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-- -- $Id: cleanGeometry.sql 2008-04-24 10:30Z Dr. Horst Duester $--
-- cleanGeometry - remove self- and ring-selfintersections from --                 input Polygon geometries -- http://www.sogis.ch
-- Copyright 2008 SO!GIS Koordination, Kanton Solothurn, Switzerland
-- Version 1.0
-- contact: horst dot duester at bd dot so dot ch--
-- This is free software; you can redistribute and/or modify it under-- the terms of the GNU General Public Licence. See the COPYING file.
-- This software is without any warrenty and you use it at your own risk--  -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


CREATE OR REPLACE FUNCTION cleanGeometry(geometry)
  RETURNS geometry AS
$BODY$DECLARE
  inGeom ALIAS for $1;
  outGeom geometry;
  tmpLinestring geometry;
Begin

  outGeom := NULL;
-- Clean Process for Polygon 
  IF (GeometryType(inGeom) = 'POLYGON' OR GeometryType(inGeom) = 'MULTIPOLYGON') THEN
-- Only process if geometry is not valid, -- otherwise put out without change
    if not isValid(inGeom) THEN
-- create nodes at all self-intersecting lines by union the polygon boundaries-- with the startingpoint of the boundary.  
      tmpLinestring := st_union(st_multi(st_boundary(inGeom)),st_pointn(boundary(inGeom),1));
      outGeom = buildarea(tmpLinestring);      
      IF (GeometryType(inGeom) = 'MULTIPOLYGON') THEN      
        RETURN st_multi(outGeom);
      ELSE
        RETURN outGeom;
      END IF;
    else    
      RETURN inGeom;
    END IF;

------------------------------------------------------------------------------
-- Clean Process for LINESTRINGS, self-intersecting parts of linestrings -- will be divided into multiparts of the mentioned linestring ------------------------------------------------------------------------------
  ELSIF (GeometryType(inGeom) = 'LINESTRING') THEN
-- create nodes at all self-intersecting lines by union the linestrings-- with the startingpoint of the linestring.  
    outGeom := st_union(st_multi(inGeom),st_pointn(inGeom,1));
    RETURN outGeom;
  ELSIF (GeometryType(inGeom) = 'MULTILINESTRING') THEN 
    outGeom := multi(st_union(st_multi(inGeom),st_pointn(inGeom,1)));
    RETURN outGeom;
  ELSIF (GeometryType(inGeom) = '' OR GeometryType(inGeom) = 'GEOMETRYCOLLECTION') THEN 
    RETURN NULL;
  ELSE 
    RAISE NOTICE 'The input type % is not supported %',GeometryType(inGeom),st_summary(inGeom);
    RETURN inGeom;
  END IF;     End;$BODY$
  LANGUAGE 'plpgsql' VOLATILE;
以上這段是要在PostgreSQL裡建立一個function,然後在進行 insert 動作的時候, 讓要 insert 的 geometry 先丟到這個function進行檢查並重整後, 回傳正確的 geometry。結束