<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Max Clapton(麥斯克萊普頓)</title>
	<atom:link href="http://maxclapton.comoj.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://maxclapton.comoj.com</link>
	<description>程式是一條不歸路...</description>
	<lastBuildDate>Mon, 08 Aug 2011 15:33:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Windows 7 x64+VirtualBox下安裝Mac OSX</title>
		<link>http://maxclapton.comoj.com/?p=388</link>
		<comments>http://maxclapton.comoj.com/?p=388#comments</comments>
		<pubDate>Sat, 30 Apr 2011 16:58:27 +0000</pubDate>
		<dc:creator>Max Clapton</dc:creator>
				<category><![CDATA[未分類文章]]></category>

		<guid isPermaLink="false">http://maxclapton.comoj.com/?p=388</guid>
		<description><![CDATA[<p>最近試了好多方法從VirtualBox安裝 Mac OSX，終於在奮鬥了一週後成功
中間爬了許多文章，在這邊跟大家分享一下主要執行步驟
系統環境
CPU:AMD Phenom II X4 810
OS:Windows 7 x64
VM:VirtualBox 4.0.6

在安裝 Mac OS X之前我們需要先取得相關的軟體
Empire EFI &#038; Mac OS X的iso檔，
目前我取得的版本是Empire 1085 for AMD 與Snow Leopard 10.6.6 SSE2/SSE3 Intel Only

在這邊需要感謝LeXa2大大分享的資訊，詳情請點我</p>

使用Empire EFI開機
換成使用 Mac OS X 後, 按下 F5
按下 TAB 切換到文字模式
輸入-v按下Enter開始安裝

<p>當執行完上述步驟我們即能看到進到安裝作業系統的畫面了
以上是我在執行 Mac OS X 安裝時一直鬼打牆的地方，所以在這邊跟大家分享我的執行步驟 
若有錯誤的地方還請大大們多多指教</p>
]]></description>
		<wfw:commentRss>http://maxclapton.comoj.com/?feed=rss2&#038;p=388</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML 5旋轉範例</title>
		<link>http://maxclapton.comoj.com/?p=386</link>
		<comments>http://maxclapton.comoj.com/?p=386#comments</comments>
		<pubDate>Mon, 28 Mar 2011 18:04:28 +0000</pubDate>
		<dc:creator>Max Clapton</dc:creator>
		
		<guid isPermaLink="false">http://maxclapton.comoj.com/?p=386</guid>
		<description><![CDATA[<p>好久沒有寫文章了，最近開始研究 HTML 5 的寫法，所以就寫了一個sample。
以前想要在非 IE 瀏覽器上做旋轉的動作，是件難事，
直到 HTML 5 的出現，即解決這個窘境
底下這個 sample 主要是要實作 HTML 5 旋轉 (rotate) 功能，在一個畫布(canvas)底下，
如何描繪一個矩形並旋轉
</p>

<p>

window.onload = init;

</p>

var i = 1;
function supports_canvas() {
  return !!document.createElement('canvas').getContext;
}
function init(){
  if(supports_canvas()){
    move();
	setInterval(move, 200);
  }else{
    alert("你的瀏覽器沒有支援 HTML 5, 建議使用 IE 9或 FF 4");
  }
}
function move(){
  var ctx = document.getElementById('canvas').getContext('2d');
 繼續閱讀...]]></description>
		<wfw:commentRss>http://maxclapton.comoj.com/?feed=rss2&#038;p=386</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery UI 1.8 datepicker 搭配民國年</title>
		<link>http://maxclapton.comoj.com/?p=383</link>
		<comments>http://maxclapton.comoj.com/?p=383#comments</comments>
		<pubDate>Sat, 14 Aug 2010 09:05:30 +0000</pubDate>
		<dc:creator>Max Clapton</dc:creator>
		
		<guid isPermaLink="false">http://maxclapton.comoj.com/?p=383</guid>
		<description><![CDATA[<p>最近在使用 jQuery UI 的時候，針對 datepicker widget 想要設定成民國的型式</p>
<p>查找到一篇有用的文章，點我連結</p>
<p>不過該內容是針對 UI 1.7.2 所寫，而我使用的 UI 是較新的版本，</p>
<p>因此就改寫了部份語法，在這邊跟大家分享一下</p>
<p>主要我跟 Charlie 一樣，都改寫了_generateMonthYearHeader，</p>
<p>它主要的用途就是顯示年份與月份的下拉式選單，不過我是直接將原先的寫法覆寫，</p>
<p>因此如果沒有引用此 JS 檔時，不會影響到暨有的 datepicker！</p>
<p>接著我額外再覆寫了_formatDate與_setDateFromField，</p>
<p>前者的目的就是顯示民國年的格式，後者則是為了日期改變時，重新選擇日期能夠停留在正確的日期上！</p>
<p>由於前兩個函數 Charlie 都已經有介紹過了，因此在這邊我額外針對 _setDateFromField 做說明，詳情如下程式碼：</p>

_setDateFromField : function(inst)

{
   //假設日期格式已經是民國年格式，Ex: 99-08-14
   var dateFormat = this._get(inst, 'dateFormat');

   var dates = inst.input ? inst.input.val() : null;

   inst.endDay = inst.endMonth = inst.endYear = null;

   繼續閱讀...]]></description>
		<wfw:commentRss>http://maxclapton.comoj.com/?feed=rss2&#038;p=383</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>高斯消去法</title>
		<link>http://maxclapton.comoj.com/?p=381</link>
		<comments>http://maxclapton.comoj.com/?p=381#comments</comments>
		<pubDate>Sun, 07 Mar 2010 08:17:16 +0000</pubDate>
		<dc:creator>Max Clapton</dc:creator>
		
		<guid isPermaLink="false">http://maxclapton.comoj.com/?p=381</guid>
		<description><![CDATA[<p>最近在看數值分析的書籍時提到求線性方程式解時可以分為兩種方式</p>

Direct Method
Iterative Method

<p>Direct Method 運用給定的步驟下求得結果；而 Iterative Method則是未知的，它的結果取決於它收斂的速度</p>
<p>底下為針對Direct Method，撰寫關於 高斯消去法 (Gauss Elimination) 求解的程式，</p>

public double[][] GaussElimination() {
    double[][] mtr = new double[3][]{
            new double[3]{2,1,-1},
            new double[3]{-3,-1,2},
       繼續閱讀...]]></description>
		<wfw:commentRss>http://maxclapton.comoj.com/?feed=rss2&#038;p=381</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NPOI 格式設定問題</title>
		<link>http://maxclapton.comoj.com/?p=378</link>
		<comments>http://maxclapton.comoj.com/?p=378#comments</comments>
		<pubDate>Fri, 26 Feb 2010 14:34:33 +0000</pubDate>
		<dc:creator>Max Clapton</dc:creator>
		
		<guid isPermaLink="false">http://maxclapton.comoj.com/?p=378</guid>
		<description><![CDATA[<p>最近在操作 NPOI 儲存 Excel 後用 Excel 2003開啟時</p>
<p>當檔案的格式設定過多會出現錯誤訊息，提示無法開啟，畫面如下</p>
<p>
</p>
<p>其相關錯誤的原因請點我</p>
<p>測試以後發現，原先我的寫法是針對每一個儲存格都去設定他的格式</p>
<p>然而這些儲存格的格式每一欄都一樣，導致格式設定過多並且造成檔案肥大。</p>
<p>查找了一下文件發現 HSSFSheet.SetDefaultColumnStyle 能夠解決上述問題</p>
<p>其語法如下</p>

HSSFCellStyle style = wb.CreateCellStyle();
style.BorderLeft = CellBorderType.THIN;
style.BorderTop = CellBorderType.THIN;
style.BorderRight = CellBorderType.THIN;
style.BorderBottom = CellBorderType.THIN;
style.Alignment = CellHorizontalAlignment.RIGHT;
style.DataFormat = format.GetFormat("0.00_);[Red](0.00)");
sheet.SetDefaultColumnStyle((short) 0, style); //第1欄的預設格式為 style

<p>雖然我們能夠使用預設的格式來解決每個儲存格的格式設定，但是如果在某一欄中有好幾種格式要設定時</p>
<p>就需要先確定該欄位能夠分成幾個區塊，再一一藉由 SetDefaultColumnStyle 在填值之前先將格式設定</p>
<p>即可得到想要的排版樣式了！</p>
]]></description>
		<wfw:commentRss>http://maxclapton.comoj.com/?feed=rss2&#038;p=378</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>行列式</title>
		<link>http://maxclapton.comoj.com/?p=376</link>
		<comments>http://maxclapton.comoj.com/?p=376#comments</comments>
		<pubDate>Mon, 01 Feb 2010 14:12:05 +0000</pubDate>
		<dc:creator>Max Clapton</dc:creator>
		
		<guid isPermaLink="false">http://maxclapton.comoj.com/?p=376</guid>
		<description><![CDATA[<p>其實在國中就有學過行列式的運算，但是當初只了解他如何計算而已</p>
<p>其算法如下圖所示：</p>
<p></p>
<p>直到最近看 Eigenvalue 與 Eigenvector 的計算時，發現其可以用來求解特徵值，</p>
<p>才了解到他的重要性，所以就實作了行列式的算法，其內容如下</p>

double[][] data= new double[3][]{
        new double[3]{10,10,5},
        new double[3]{10,30,15},
        new double[3]{5,15,20}
double result = 0, temp, negTemp;
int rowBoundary = data.GetLength(0);
int colBoundary = data[0].GetLength(0);
for (int i = 0; i < rowBoundary; i++)
{
  繼續閱讀...]]></description>
		<wfw:commentRss>http://maxclapton.comoj.com/?feed=rss2&#038;p=376</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>牛頓法(Newton-Raphson)尋根</title>
		<link>http://maxclapton.comoj.com/?p=375</link>
		<comments>http://maxclapton.comoj.com/?p=375#comments</comments>
		<pubDate>Sat, 23 Jan 2010 18:24:08 +0000</pubDate>
		<dc:creator>Max Clapton</dc:creator>
		
		<guid isPermaLink="false">http://maxclapton.comoj.com/?p=375</guid>
		<description><![CDATA[<p>在金融領域裡，我們經常需要求得某線性方程式的根</p>
<p>要求得一條方程式 f(x) = 0 的根時，其實有很多種解法</p>
<p>但是當這條方程式為非線性時，就沒有辦法使用簡單的推導求得</p>
<p>這時候我們即可使用牛頓法來求解 </p>
<p>牛頓法的詳細說明請參考維基百科，其中述及該方法需要使用一階微分迭代近似</p>
<p>在此我實作了 NewtonRaphson 這個虛擬類別，建構其處理流程</p>
<p>並在這個虛擬類別中實作了 Derivative 這個函式，以推估該方程式的一階微分，</p>
<p>其理論源自於微分使用極限值(limit)逼近</p>
<p>當要求一個方程式的根時，我們只要繼承這個類別並實作 F 這個函式即可計算出其解。</p>

class Program
{
    static void Main(string[] args)
    {
        NewtonRaphson n = new CosRoot();
        NewtonRaphson s = new SquareRoot();
        繼續閱讀...]]></description>
		<wfw:commentRss>http://maxclapton.comoj.com/?feed=rss2&#038;p=375</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>累積常態分配反函數</title>
		<link>http://maxclapton.comoj.com/?p=374</link>
		<comments>http://maxclapton.comoj.com/?p=374#comments</comments>
		<pubDate>Sat, 23 Jan 2010 05:52:23 +0000</pubDate>
		<dc:creator>Max Clapton</dc:creator>
		
		<guid isPermaLink="false">http://maxclapton.comoj.com/?p=374</guid>
		<description><![CDATA[<p>前一篇 常態分配數值逼近法 曾經提到怎麼運用數值分析求得 CDF</p>
<p>但是常常我們不只是需要使用 CDF, 我們可能還需要取得標準常態分配 N(x) 中的 x 變數其值。</p>
<p>在這邊感謝同事提供他的資料給我，才得知原來已經有好幾個人針對反函數求解。</p>
<p>查找了一下文章後發現 Quantitative Finance Collector這篇提及了兩種作法，</p>
<p>分別是 Boris Moro 以及 Peter J Achlam所發表的理論。</p>
<p>在這邊我實作了 Boris Moro 的方法，其程式碼如下所示：</p>

        const double c1 = 0.337475482272615;
        const double c2 = 0.976169019091719;
        const double 繼續閱讀...]]></description>
		<wfw:commentRss>http://maxclapton.comoj.com/?feed=rss2&#038;p=374</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>常態分配數值逼近法</title>
		<link>http://maxclapton.comoj.com/?p=373</link>
		<comments>http://maxclapton.comoj.com/?p=373#comments</comments>
		<pubDate>Thu, 21 Jan 2010 15:18:37 +0000</pubDate>
		<dc:creator>Max Clapton</dc:creator>
		
		<guid isPermaLink="false">http://maxclapton.comoj.com/?p=373</guid>
		<description><![CDATA[<p>以前在唸研究所做研究時，免不了要使用到常態分配!</p>
<p>原先都是使用 trapezoidal quadrature formula 積分的方法計算面積求出其累積機率。</p>
<p>雖然曾經懷疑為什麼 Excel 可以運算得這麼快，但是一直沒有去找到真正的解答。</p>
<p>直到最近又翻起 John Hull 的書籍，才知道可以運用逼近的方法達成..</p>
<p>在 Options, Futures, And Other Derivatives 6th Ed. p.297 中有提到其如何用數值逼近</p>
<p>其準確度到達小數第六位，在此列出其程式碼，希望能藉此幫助更多人。</p>

    class CDF
    {
        const double a1 = 0.31938153;
        const double a2 = -0.356563782;
    繼續閱讀...]]></description>
		<wfw:commentRss>http://maxclapton.comoj.com/?feed=rss2&#038;p=373</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>C# 運用 AssemblyName 叫用 Method範例</title>
		<link>http://maxclapton.comoj.com/?p=371</link>
		<comments>http://maxclapton.comoj.com/?p=371#comments</comments>
		<pubDate>Thu, 24 Dec 2009 17:16:33 +0000</pubDate>
		<dc:creator>Max Clapton</dc:creator>
		
		<guid isPermaLink="false">http://maxclapton.comoj.com/?p=371</guid>
		<description><![CDATA[<p>最近在試一個東西，首先，要從 XML 讀取檔案，</p>
<p>裡面記錄了每個類別的 AssemblyFullName、是否需要執行此類別，以及它執行時所需要的參數。</p>
<p>接著我需要藉由程式判斷是否叫用此類別。類別的架構設計如下面範例所示：</p>
<p>AbstractShape
Triangle
Rectangle</p>
<p>AbstractShape 中有兩個函數，GetName 與 GetArea，</p>
<p>我要在程式動態載入的時候呼叫 GetArea，語法如下：</p>

using System;
using System.Reflection;

namespace InvokeMethodDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            object[] arg = new object[] 繼續閱讀...]]></description>
		<wfw:commentRss>http://maxclapton.comoj.com/?feed=rss2&#038;p=371</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://stats.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://stats.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->

