2011年5月5日

Windows 7 管理 Hyper-V RPC 錯誤

不是每個人的桌面作業系統都是安裝Windows Server 2008,因此要管理Windows Server 2008上的Hyper-V必須要使用遠端管理。微軟釋出的Hyper-V遠端管理只能安裝在Windows Vista或是Windows 7上。但必須在伺服器和客戶端都開啟必要的權限。在開放了權限,並且重新啟動之後,很可能你會看到上圖的錯誤訊息,但你會說明明RPC服務已經打開了啊?怎麼還是無法使用?下面就是解決這個問題的方法。

如果你是直接使用IP地址進入Hyper-V管理員,雖然可以連入Hyper-V主機,但是無法操作虛擬機。這是因為 Windows Vista和Windows 7的Hyper-V管理員是基於DNS的,連上IP之後,就會將Hyper-V主機的名稱映設射過來,因此IP就無法使用了。如果你沒有或不想架設 DNS,下面是解決的辦法。

1.先確定 Hyper-V 主機的電腦名稱,如 VMPC;以及實體IP,如 192.168.1.1。
2.進入Windows 7編輯 "c:\Windows\System32\drivers\etc\hosts",注意要用管理員權限。
3.將該主機名稱和IP對應好,如 192.168.1.1 VMPC ,存檔。
4.開啟Hyper-V 管理員,並新增要管理的主機,輸入 電腦名稱 VMPC,就大功告成了!

2011年5月4日

不能忘記Coding

今天看到了一句話

「一但停止了Coding,就等於停止學習了」

這跟我想的是一樣的~ 因為前陣子我真的會有點慌,很怕自己開始忘了怎麼Coding,忘了怎麼設計,所以強迫自己寫了好幾個小工具才撫慰了我那慌亂的心.... 現在想想大概就是害怕會「前浪死在沙灘上」的情境發生吧~ 嘖嘖

2011年1月12日

[WIN7]管理離線檔案

今天突然發現公司電腦的硬碟空間剩下不到2G
明明記得還有十幾G的,卻這樣莫名其妙消失實在奇怪
經過一陣追查後發現是作業系統的離線檔案機制造成的
因為公司內使用網域,且經常在傳送或複製檔案
而這個離線機制就很貼心的幫你備份了一份在一塊特定的資料夾底下
好讓你在對方關機或網路不通的時候還可以繼續使用或編輯檔案
以下是在我的Win7環境的操作過程

1.開啟控制台, 找出[同步中心] (如果找不到, 建議把檢視方式改成圖示顯示)

2. 點選[管理離線檔案]

3. 這邊可以管理是否要使用離線檔案機制, 這就看個人的需求囉

4.切換到[磁碟使用量], 可以看到目前暫存檔案所使用的空間有多少, 也可以執行清空暫存離線檔案的動作,建議可以自行調整一下使用上線,免得一下被吃光太多, 我就是這樣 >_<

以上總算是清理掉那些吃空間的怪物檔案,原本以為使用一些系統清理軟體可以有效清除暫存檔,但是看來這個離線機制的檔案並不屬於可以被清除的對象,所以還是得自行費心思一下囉。

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。結束