星期六, 12月 29, 2007

Another 3rd Party WPF Controls : Infragistics


我又藉由一些文章 找到另一家3rd party的WPF controls

而且好像這家也十分有名 叫Infragistic

我也找到他們有做Ribbon的Solution

http://www.infragistics.com/uploadedImages/WhatsHot/xamRibbonCtpScreenshot.jpg

有興趣參考以下link吧..

http://www.infragistics.com/hot/wpf-beta.aspx#xamRibbon


Powered by ScribeFire.

Smart Routed Commands in WPF


這次從Minneapolis回來~ 我學到了許多有關Command System的一些設計與概念

覺得十分好... 也一直在反覆比較我們之前程式的架構.... 他們設計的方法與架構 真的是比較好的方法

然後我再回到WPF Command System....我又卡住了... 是二個截然不同的概念....


Design Pattern裡講的Command十分淺顯.. 但也還不夠複雜到應付中大型的Application

我看到的Command System比較偏向是Design Pattern裡寫的 將所有的operation寫在Command裡...

而每一個Command 會有自己所對應到的Execution的Context

WPF就不太一樣... 每一個Command 都是一個RoutedEvent 會藉由Bubbling的方法(由下而上) 讓Visual Tree自己決定是否執行

執行的operation也都散布在各位Visual Element裡

從比較high level的面向來看~~ 一個Visual Element也可以是所謂的Execution Context 是十分General的看法....


我在codeproject找到一篇 作者寫了一個Smart Routed Command 這樣的方法 其實就有種mix兩種方法的味道

看完文章之後 我對Command的疑惑又進了一步.... 不過還有一大段還是需要再多想多努力

Software Design 對我而言就好像練太極拳或是在修內功一樣....... 一分力一分功 永無止盡....Orz

CodeProject: Smart Routed Commands in WPF. Free source code and programming articles



Powered by ScribeFire.

WPFpedia actipro提供的一些WPF的資源


我剛玩完他們所有的WPF Control & Demo...

Impressed!!! 其實之前有嘗試要寫Ribbon這類的Control....

後來分析的結果覺得好像有點複雜 就沒繼續下去了 可是我卻發現他們寫的很好!!!!

然後我看他們的Transition Effect也Support好多種~~ 我之前寫的大概只support到五六種而已


也看到他們collect不到的WPF Resource放在WPFpedia.com裡~~ 所以也記一下 我會繼續挖寶

有不錯的再記上來囉...


WPFpedia.com (The WPF Resource Guide)

Powered by ScribeFire.

[WPF] Actipro WPF Studio


很久沒寫些WPF相關的東西了~~

最近又開始在看一下Blog~~ 終於看到一些我覺得早該有的東西了...

就是3rd Party的WPF Control.....

這次我看到的是有WPF Ribbon & Wizard....

有興趣到下面的link看看吧...:p

我一開始已經寫了一個Wizard的東西了~~ 也有Transition Effect

這個Library也有implement一些相關的概念.....




我下載了Free Evaluation來看~~ Ribbon讓我十分驚豔....




Actipro WPF Studio - The ultimate UI control suite for WPF



Powered by ScribeFire.

The New Iteration.... Designer如何跟Engineer合作


XAML在WPF扮演很關鍵的角色~~ 而XAML的引進 造成以往RD與Designer之間的合作更加緊密

這邊有一本書 (or whitepaper) 在敘述這樣的事情

工作一二年來也碰了這方面的事 也深深覺得真的還蠻不錯的...

可惜現在的WPF Performance實在是一大敗筆 .... 不過managed code與unamanged code或許一起比較performance有點不公平吧

The New Iteration: How XAML Transforms the Collaboration Between Developers and Designers in Windows Presentation Foundation (WPF)

Powered by ScribeFire.

星期三, 11月 21, 2007

Code Generation, Software Factories and Visual Studio Extensibility


我對automatically的Code Generation一直都很有興趣.....

在C# with Visual Studio .net 其實應該有能力可以做到了....

好像是叫CodeDom的東西吧..... 之前組讀書會的時候 也有同事報過一樣的主題

雖然我還沒有時間好好去試..... 不過先記錄下來 發現這一篇blog也有蠻有詳盡的references


------------------------------------------------------------------------------------------------------------------------------------



Last night I presented Code Generation, Software Factories and Visual Studio Extensibility at Direct Supply. Below is the project download with all of the source followed by many useful links related to the various topics.


[ Download the sample project: SmallSharpTools.VisualStudioPlugins.zip ]



CodeDom



Templated Code Generation



Software Factories



Visual Studio Extensibility



Video



If you have any other links that you feel are useful, please add them below in the comments.





Powered by ScribeFire.

星期三, 11月 14, 2007

Visual Studio Debugger Visualizer for WPF Visual Tree



Visual Studio 2005有一種Visualizer Plugin的功能 可以自己撰寫對於特種的Data Type的視覺化的表現

而這篇Codeproject的作者 做出了一個VS2005 Visualizer 可以Show出WPF Element的Visual Tree的元件

十分好用~~

而我也稍微改了一下code....做了另一個Logical Tree的版本..... 現在我可以輕鬆地在VS2005 IDE裡 很容易了解Visual/Logical Tree的樣子了


Woodstock for WPF - The Code Project - Windows Presentation Foundation



Powered by ScribeFire.

星期一, 11月 05, 2007

Over-coming the Interop Airspace Issue in WPF


我只能說.... 對於host的handle-based control到WPF裡

雖然不滿意 但可以接受~~

但事實上 我也從未奢想這件事是有辦法達成的


但跟上一篇同一個作者居然實作出來了... 我只能說 真的太厲害了~~~

不過目前除了有一些bugs之外 其實十分耗資源... 可能沒辦法當成是一個比較formal的解法


Over-coming the Interop Airspace Issue in WPF


看到了吧.... 下面的圖就是把一個Broswer Control貼到一個WPF 3D Model上.....

這是一個很厲害的技法....也宣告WPF基本上解除所有的限制封印了....





Powered by ScribeFire.

Build your own DirectShow Graph in WPF MediaElement



對於WPF的MediaElement 我已經苦思許久 不得其解

對於一家Playback or Video Editing的公司 MediaElement是個完全沒辦法使用的東西

而Microsoft也未提供任何更進階的控制項 讓我們來使用 甚至連我們想自行開發都不太容易

再過幾天剛好會跟Microsoft的人一起開會... 我想趁這個機會好好再問他們一下 有沒有什們suggestion or future plan


不過在上星期我已經找到一篇Blog能達到我想做的事了... 以下兩篇

WPF - Hackery! Part I

WPF - Hackery! Part II


第一篇主要是演示拉一個MediaElement 然後自己建一個Capture的Graph,於是可以看到MediaElement也可以秀出Capture的畫面了

真的很厲害 :-)..... (要run sample前記得 register那個DirectShow Filter哦.... regsvr32 xxxx.ax)

This webcam makes me look greasy!


This is a live webcam brought into WPF using my MediaBridge hack. I swear I don't look that greasy IRL.


WPF Modified Graph



Powered by ScribeFire.

星期五, 10月 12, 2007

WPF Book Control


之前我曾經有用過Flash or 一些作法 來做幾本電子書.........

之前的SilverLight也有一個demo叫Page Turn也蠻炫的


不過今天才發現這本Pure WPF的Book Control

這本才真的比較棒~~ 翻頁不是四四角角的 而是有點柔軟的感覺

裡面可以放一大堆Control, 3D Object, Video, ...etc 應有盡有

而且還有Full Source

還真的不錯 值得一看....







Powered by ScribeFire.

Routed Events In WPF


今天在解一個Bugs.... 就發現先前設計的一個Control有一些功能沒有想的很完善.......

於是又重新再思考了一下..... 發現自以為對WPF裡的Routed Event, 包括三種方式Tunnel, Bubble, 與Direct很熟悉

以為已經掌握到訣竅 但是因為之前的設計不完善 怎麼想就是想到一些漏洞

直到看到下面的兩種Add Handler的方法 我才恍然大悟.... 我未曾懂過....

也難怪WPF的Controls的Event機制並沒有照著普通的.Net的event or delegate方法 而是還有什麼AddHandler, ...etc之類的東西

就是為了要Support Routed Event


全文可以再參考一次msdn WPF Event

唔.... 沒有一直持續設計與思考 我還真的沒發現自己沒真正懂過.....

Design的路還很長.......


C# Method1-------------------------------------------------
void MakeButton()
{
Button b2 = new Button();
b2.AddHandler(Button.ClickEvent, new RoutedEventHandler(Onb2Click));
}
void Onb2Click(object sender, RoutedEventArgs e)
{
//logic to handle the Click event
}

The next example shows the C# operator syntax
(Microsoft Visual Basic .NET has slightly different operator syntax
because of its handling of indirection):

C# Method2-------------------------------------------------

void MakeButton2()
{
Button b2 = new Button();
b2.Click += new RoutedEventHandler(Onb2Click2);
}
void Onb2Click2(object sender, RoutedEventArgs e)
{
//logic to handle the Click event
}


Powered by ScribeFire.

星期一, 10月 08, 2007

GeekInterview


之前我有一個朋友很喜歡蒐集各類很Tricky的小問題 因為現在國外大型公司很喜歡問這些Tricky的問題

例如如何Swap一個Varaible不用記憶體啦~~ 或是...etc

比較偏程式的方面 或許我還有機會可以答的出來..... 但是如果是一些思考性的問題 我幾乎答對率都很低

像是三個燈泡在一間房子裡與外面有三個開關 你可以先在外面動三個開關 (開或關) 然後只能進房子一次 就要決定那一個開關是那一個燈泡

像這類的問題 我幾乎都答不出來 @@||

所以發現網上有一個site在整理這些東西~~ 所以覺得以後如果要面試一些會考這類問題的大公司 還是多多蒐集題庫可能比較保險

:-)


Link --> IT Interview Questions Open Database - GeekInterview.com

Powered by ScribeFire.

Marshaling Nested Data Structures


C++ & C#之間的Interop有許多方式,或是workaround

一個是C++/CLi, 一直是把C++ Class轉成Regular C,然後用Platform Invoke的方式,另一個是把C++包成COM

不過不論如何 都有可能會遇到可以傳遞Structure的問題 上一篇就是基本的Sample

但是Structure可能複雜到Nested怎麼辦.........找到了一篇Blog (Marshaling Nested Data Structure from jaredpar's WebLog)在描述如何解決


看完之後~~ 只能說 真的很麻煩!!!!


Powered by ScribeFire.

Code Snippets : Interop between C# & C++ (Managaed & Unmanaged)


雖然知道用法 卻每次都背不起來~~ 所以特別把關鍵的Sample Code Paste到Blog

以後查詢也會比較方便.....

主要是C++ & C#之間structure該如何傳遞

Source From MSDN

在下列程式碼中,建立了 Managed 結構,將其傳輸到 Unmanaged 記憶體後,再使用 PtrToStructure 方法傳輸回到 Managed 記憶體。
using System;
using System.Runtime.InteropServices;

public struct Point
{
public int x;
public int y;
}

class Example
{

static void Main()
{

// Create a point struct.
Point p;
p.x = 1;
p.y = 1;

Console.WriteLine("The value of first point is " + p.x + " and " + p.y + ".");

// Initialize unmanged memory to hold the struct.
IntPtr pnt = Marshal.AllocHGlobal(Marshal.SizeOf(p));

try
{

// Copy the struct to unmanaged memory.
Marshal.StructureToPtr(p, pnt, false);

// Create another point.
Point anotherP;

// Set this Point to the value of the
// Point in unmanaged memory.
anotherP = (Point)Marshal.PtrToStructure(pnt, typeof(Point));

Console.WriteLine("The value of new point is " + anotherP.x + " and " + anotherP.y + ".");

}
finally
{
// Free the unmanaged memory.
Marshal.FreeHGlobal(pnt);
}



}

}
在下列程式碼中,示範了如何使用 PtrToStructure 方法,將記憶體的 Unmanaged 區塊封送處理成 Managed 結構。




Powered by ScribeFire.

星期六, 9月 22, 2007

Convert Position between WPF Controls & Screen



Lester's WPF blog : Code for getting screen relative Position in WPF
這幾天一直在try Windows Vista的Gagdget.... 中秋連假還一直在加班 :-(

最後有一個major bugs就是卡在這裡~~ 超麻煩的 不過還好給我找到了....

呵~


Powered by ScribeFire.

Transparent WPF Control over Unmanaged Window Handle



Transparent WPF control over unmanaged window handle - Just code - Tamir Khason

之前在合作一個case 好像我就有使用過這樣的技法~~ 不過這個link比較簡單...:p


Powered by ScribeFire.

星期一, 9月 17, 2007

DirectX-base UI : Become windowless


viksoe.dk - UI: Become windowless


晚上在研究VMR的時候~~~ 突然發現這個網站~~ 看完我真是驚為天人...而且還附上sample program & source code

一套UI Library/Control Set based on DirectX

我被他的Sample Program驚豔到了~~ 因為我還真有點分不出這不是Traditional SDK Controls,而是用DirectX寫的

wow~~ WPF好像沒他的performance那麼好~ 跑的很順很快 ..... 有稍微大概研究了一下source code 算是蠻完整的.....

:D

等我有空 一定要好好研究一番.....


Powered by ScribeFire.

星期六, 7月 21, 2007

Introduction to Boost Function

為了要在C++裡實現delegate/event 所以我自己寫了一個Functor的class

不過為了未來使用的方便,最好是找一個library來用

所以我選了boost的function來研究

以下列出一些tutorial給大家參考一下 ................


Boost源码剖析:C++泛型函数指针类

Boost.Function的基本使用

Chapter 6. Boost.Function

functor 還是 boost 的好用

functor 還是 boost 的好用 (續)


星期四, 7月 19, 2007

利用C++ Functor實現.Net的delegant/event



在C++中實現.NET風格的委託-開發者網路-C++-天極Yesky

CALLBACKS IN C++ USING TEMPLATE FUNCTORS

http://www.codeproject.com/cpp/#Delegates

A new way to implement Delegate in C++

最近為了一些原因,又得重新再檢視一次Design Pattern。

大多的Patterns我已經是滾瓜爛熟的.... 但是說真的每一個Pattern都有在用嗎?

其實我也覺得沒那麼常用~~ 有些Pattern知道十分強大,但是實作起來就沒那麼方便 或是真的很麻煩....


這次又重看一次Observer...... 很常見的Pattern,但是C++ implement起來就是得繼承來繼承去

但是近一年來我都是用C#,我用C#的event/delegant可以很輕易的不用繼承解決Observer的東西

於是我重回到C++思考.....  想到之前有人跟我說functor的概念~~~ 我一直以為就是function object

就是在STL裡 能夠customize 不用演算法的行為~~ 這樣的作法已經很厲害了....


沒想到Functor的確可以實現出類似C# event/delegant的概念~~~

所以貼上來給大家參考一下 :-)

(第二篇是1994年寫的.....也太神奇了~~ 那些code VC6有辦法compile嗎? 我到2007才準備開始用..)


星期一, 7月 16, 2007

UML 工具比較分析


這陣子在Survey UML Modelling的工作

有看到的是Visual Paradigm,有朋友說他們用的是Jude,還有說是IBM RSA,

又看到網路上一些比較

http://www.kenming.idv.tw/index.php?title=uml_amya_mam_ef_a_a&more=1&c=1&tb=1&pb=1

先列出來 我慢慢把這篇整理完整

Powered by ScribeFire.

星期日, 6月 24, 2007

Image Processing for Dummies with C# and GDI+

這一陣子一直在寫一些有關Image DSP方面的東西.....



也累積了一些在C#該怎麼用Gdi+來寫~~



@@ 結果發現 CodeProject有一系列的文章寫的太詳盡了 甚至連Source code都有了...



基本的結構跟我後來寫的方法近似~~ 但是文章介紹的Filter就多我能力所及太多了...



列出來給大家參考一下 :p





Image Processing for Dummies with C# and GDI+ Part 1 - Per Pixel Filters
Last Updated: 21 Mar 2002  Page views: 306,899  Rating: 4.6/5  Votes: 144  Popularity: 10.0

The first in a series of articles which will build an image processing library in C# and GDI+




Image Processing for Dummies with C# and GDI+ Part 2 - Convolution Filters
Last Updated: 7 Nov 2005  Page views: 247,464  Rating: 4.7/5  Votes: 97  Popularity: 9.3

The second in a series of articles which will build an image processing library in C# and GDI+.




Image Processing for Dummies with C# and GDI+ Part 3 - Edge Detection Filters
Last Updated: 1 Apr 2002  Page views: 193,665  Rating: 4.6/5  Votes: 55  Popularity: 8.1

The third in a series of articles which will build an image processing library in C# and GDI+




Image Processing for Dummies with C# and GDI+ Part 4 - Bilinear Filters and Resizing
Last Updated: 15 Apr 2002  Page views: 180,571  Rating: 4.5/5  Votes: 48  Popularity: 7.6

The fourth installment covers how to write a filter that resizes an image, and uses bilinear filtering




Image Processing for Dummies with C# and GDI+ Part 5 - Displacement filters, including swirl
Last Updated: 26 Dec 2002  Page views: 217,943  Rating: 4.7/5  Votes: 112  Popularity: 9.6

In the fifth installment,
we build a framework for generating filters that work by changing a
pixel's location, rather than colour.




Image Processing for Dummies with C# and GDI+ Part 6 - The HSL color space
Last Updated: 29 Jun 2004  Page views: 94,535  Rating: 4.8/5  Votes: 35  Popularity: 7.4

A discussion of the HSL color space, including code for a color picker and image filters

星期一, 6月 04, 2007

Google Gears



Google推出一個Open Source的Project叫Gears,是一組可以讓Web Application能Offline執行的Library or API



現在還是BETA版~~ 詳情我是還沒看過 有興趣可以參考Google Gears (BETA)



Google真的有計畫地一步步逼近Desktop Software的市場 而且手腳真的很快









Powered by ScribeFire.

Microsoft Surface



對於Usability一直很有興趣~~ 一直想做出不一樣的東西~~



看過了許多的Demo與一些其它的Prototype,總覺得心中有一塊可以做的東西~~~



也有一塊還未開發的市場~~~ 如果我看到Microsoft Surface



我覺得他幫我彌平了我心中一直想要想的一大塊~~~ 有空的話一定要去看一下他的Demo.....真的很炫!!!!





星期三, 5月 30, 2007

[C#] PropertyGrid





我一直想要做一個auto property panel

如果能做出來 那許多的property dialog全都可以automatically genearte出來...



有點像Visual Studio .Net 2005的Properpty Panel一樣 只是那時候我也不知他是寫死還是自動產生的



結果我發現C#內建的PropertyGrid就完完全全做到我想做的

而且做的好極了~~~



@@ 只好看一下下面兩篇文章就很清楚知道怎麼做了

現在就只差怎麼去customize propertygrid的UI了

文章裡也有寫相關 但是可能需要更進階



只是真的有點驚訝 @@ 自己的想法還是比他們晚一步 微軟都先做好好的了 :|







充份運用 .NET Framework PropertyGrid 控制項



Make Your Components Really RAD with Visual Studio .NET Property Browser









星期五, 5月 25, 2007

[COM interop] TypeLibConverter



最近一直在想辦法設計一些東西~~



C#擁有Reflection的機制,許多難解的設計都可以很輕鬆的找到方法



但是若得要考慮Native的Code  (C++, ..etc native dll) 的時候,就完全傻眼了



我也想了許多辦法~~ 想要在C++做類似Reflection或是直接用坊間的C++Reflection Library或是...etc



其實都不是那麼方便的方法 後來想說COM的IDispatch機制 也是一種Reflection



但是現在C#與COM最快的方式就是RCW (Runtime callable wrapper)



這種方法卻是Early Binding 所以我想要的設計最好是Late Binding的方式 (例如不用P/Invoke而用LoadLibrary)



但最終還是傻眼........用Reflector一直trace微軟寫的程式 從tlbimp.exe trace到System.Runtime.InteropServices裡



有一個class叫TypeLibConverter 果不其它 他就是想辦法從IDispatch的界面 生出Interop的.net assembly



以下有一篇文章有範例code



COM interop理论/实践 - 漫步 | Manbu's Blog



但是不論如何.........還是很不方便 :s



這個設計的難題 還真的困擾我很久很久...:(





星期六, 5月 19, 2007

JavaFX



既Microsoft的WPF AND SilverLight,Adobe的Apollo Platform之後,這場Rich Internet Applications(RIAs)又加入新的挑戰者,Java陣營的JavaFX



我看了一下FAQ跟一些介紹,似乎目前JavaFX是一整個Family,目前announce的有JavaFX Script跟JavaFX Mobile

而這些都會變成OpenSource,如果想要看一些demo的話, 可以試著從OpenJFX來試 不過記得要灌JRE (java runtime)

因為會從java web start來執行





我發現整個GUI開發整個趨勢是往Markup Language or Declarative Language走去

像是XAML or JavaFX Script or 上次我看到的Openlazlo....都是這類的概念...



讓UI所有的controls/layouts用markup來設計,最後再跟code作整合

所以想當然爾,未來一定也得要有JavaFX Script的design tool..... 才會真的讓大家想要用吧...





Extending Visual Studio 2005





對於Windows Forms或是WPF的build的process我一直很好奇



就是寫User Interface的時候,對於一個Form1 or Window1.xaml



在compile階段其實會根據UI的resource (xaml or resx)來generate出另一個cs file



利用partial的keyword去merge User跟auto generate出來的code成另一個程式



我想找一下這方面的資訊 看有沒有機會我可以自己implement自己想要的build process



不過我用custom build, extend keyword問google 似乎都沒找到我想要的資料



不過倒找到許多extend visual studio的資料



這個link還有許多video教你怎麼extend vs 2005



至於Visual Studio SDK 4.0 可以從這裡Download





後來我的疑問 讓我找到很類似的 叫single file geneartor



好幾個可以參考的地方..... link1, link2, link3, link4





MSBuild Team Blog : How To: Add a custom build action to Visual Studio







星期一, 5月 14, 2007

SSE指令集介紹



最近一直會接觸到Optimization的東西,因為之前對這一塊完全是空白,所以想下定決心慢慢接觸這一塊



對看了一些介紹MMX, 3D Now!, SSE等資訊



在網路上的找到Hotball的SSE介紹,一個很好入門又很清楚的文章



:p 可以快速的入門了解....











powered by performancing firefox

星期二, 5月 08, 2007

[C#] Speed up XmlSerializer



C#的XmlSerializer十分好用簡單,我只寫了幾行,整個複雜的struct整個輕鬆Serialize and Deserialize

不過我發現效率有點慢....



從Google大神中查到了這篇文章,利用Sgen.exe來預先做好Serializer的assembly以加速

十分神奇 :p

星期一, 5月 07, 2007

[C#] XML Serializable Generic Dictionary

C# XML的Serialization很方便

不過對於有些Class本身不支援的話,可能要另外自己寫Serialize的函式



不過在網路上找到這篇文章 

有XML Serializable的Dictionary<T,K>的Example

:p







Powered by ScribeFire.

星期日, 5月 06, 2007

多點觸摸式Screen



我找到兩篇Blog... 有Touch Screen的



對這方面其實十分有興趣...... 因為我也有做過類似的東西



所以對於User Input & Usability十分好奇 也覺得現在的科技還有一大段路要走...



有興趣可以看看以下的Demo ( Touch Desk & 多點觸摸式螢幕)

星期六, 5月 05, 2007

[Web OS] Openlazlo





上上篇我轉錄了一篇Web OS的文章,於是我也花了點時間看了一下OpenLaszlo

大概了解一下他的技術~~ (Flash or AJAX, and ..etc)



整體用他做出來的Web Page真的很好.... 技術細節我就不詳述了

但是如果是Demo的話就還蠻建議玩玩看的



DHTML (or AJAX)做出來的Web UI居然也可以這麼好用....

說實話.... 用一用一度還覺得其實好像RIA (Rich Internet Application)可以不用那麼複雜 (用MS的xbap or Adobe Apollo or ..其它的平台)



Demo請看這裡 有不少個Demo呦



我好奇的是 既然是Open Source,那我們如果想要開商業化的服務 ,可以免費使用嗎?

結果License Info在這裡

是叫什麼open source Common Public License 英文字太多了 所以沒仔細看

不過感覺應該是可以免費使用...:D



有懂license方面的人 再告訴我吧 ^^

Google Maps


Google出了一個Google Map,微軟也出了Live Map,他們分別都有自己的Software版本 就是Google Earch跟MS的Virtual Earth,Yahoo也有自己的Map

不過在台灣來說,Google已經有完整的中文街道圖了,十分方便.....
不論如何,對於一家要對Interface or Web Service的大公司而言,Map是一定要存在的

因為他所能牽涉到的東西實在太廣了.....

最簡單的只是找路,但是再想想
其實「吃喝玩樂」 都跟位置有關
去那吃? 怎麼去? 去那玩? 有什麼好的店?....etc
這樣一看 幾乎無所不包了~~ 未來如果有什麼驚人、好用的新服務 若已經有個現在的Map Service
那就是一股強大的力量~~

所以我想大公司們 一定不會放棄這個重量級的基礎建設.....

其實這種地圖服務,我想是早就有的東西.... 但是對於Web Service方面的東西,時機愈來愈成熟了
所以大場才會又投入做這個...

但是也可以發現 這些有錢的公司做出來的服務就是真的很好 幾個好的地方來討論
一個是提供全球的地圖 (不過其它還有許多不完整的地方)
一個是繪畫很簡潔 (有些公司的map真的很複雜) ,Usability很好 (有些用起來很不順手)
速度快(利用到一些Web技術 像是AJAZ) 這點超重要 找路起來的感受差別很大
加值服務 (可以mark地點 共享 儲存 ...etc)
可以試試另外一家比較一下優劣 (ex. urmap)
我剛試了覺得 覺得速度也做的很好了~~ UI方面倒是可以加強一下 

像我自己最喜歡用的就是Papago軟體~~ 因為真的有台灣超級詳盡的地圖
其實每次用local公司的地圖 都會覺得好可惜
其實明明內容也有了、技術也不會輸別人... 但是用起來整個experience就差了一點
User Interface/Usability真的很重要~~~
然後Business Model也很重要 感覺許多很多時候沒有想清楚 只是把一大堆content丟上去
雜亂無章 我覺得這裡面的商機真的是無限
只是要怎麼讓使用者除了查詢外,還更能join進content的部分
技術都已經ready了~~ 就等著對的商業模式

不過說實話 我所能想到的也不太多 但是我對未來的Map這一塊 真的十分有興趣 也有信心
這方面絕對是重點基礎建設之一......

Google Map











Microsoft Live Map

Web OS



我一直對Web OS十分有興趣,我認為雖不至於最後只剩下Web OS,但是絕對是佔很大部分的趨勢



我們已經漸漸厭倦了重灌OS...Instal軟體、更新....加硬碟..備份......etc



我們也厭倦了資料很難跟著走 (沒辦法cross-computer 一定要有copy的動作)



我想 有很大一部分的軟體 未來 都會被Web OS上的software所取代.....





我看了CNet的這一篇,整理出不少的WebOS相關的公司...「Web OS」只是海市蜃樓嗎?



之後等到逐一研究,我再記錄下來給大家參考



星期三, 5月 02, 2007

[WPF] Application.DoEvents in WPF



在MFC裡有用GetMessage/PeekMessage來避開UI被blocking的問題

在C#是Application.DoEvents

那在WPF呢?

下面的Blog解釋了方法.... HolaMan

Application.DoEvents in WPF


[WPF] Displaying Enum Values using Data Binding

--> DataBinding 到enum valuem, Copy & Paste如下

Some of the FAQs about data binding are:

• How do I bind to a method?

• How do I bind between instantiated controls?

• How do I bind an ItemsControl to an enum?



I put together a quick sample that should answer the above questions:



<Window



  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"



  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"



  xmlns:sys="clr-namespace:System;assembly=mscorlib"



  SizeToContent="WidthAndHeight"



  Title="Show Enums in a ListBox using Binding">



 



  <Window.Resources>



    <ObjectDataProvider MethodName="GetValues"



                        ObjectType="{x:Type sys:Enum}"



                        x:Key="AlignmentValues">



      <ObjectDataProvider.MethodParameters>



        <x:Type TypeName="HorizontalAlignment" />



      </ObjectDataProvider.MethodParameters>



    </ObjectDataProvider>



  </Window.Resources>



 



  <Border Margin="10" BorderBrush="Aqua"



          BorderThickness="3" Padding="8">



    <StackPanel Width="300">



      <TextBlock>Choose the HorizontalAlignment



                 value of the Button:</TextBlock>



      <ListBox Name="myComboBox" SelectedIndex="0" Margin="8"



               ItemsSource="{Binding Source={StaticResource



                                             AlignmentValues}}"/>



      <Button Content="Click Me!"



              HorizontalAlignment="{Binding ElementName=myComboBox,



                                            Path=SelectedItem}"/>



    </StackPanel>



  </Border>



</Window>



The ListBox and the Button are hooked up such that you can “control”

the HorizontalAlignment value of the Button by selecting a value in the

ListBox.

Multithreaded UI: HostVisual





之前為了WPF Multithread的問題,花了不少時間,最後也都想到解法,就是用beginInvoke的方式來溝通



但是前提是,UI controls都是被在不同的windows,被各自的thread所擁有....



限制是不可能在同一個Windows內畫出不同的thread, 但似乎這篇很棒的文章有了很好的解法



:-)

Video Lectures related to CS Courses

topcode forum上有一篇文章列出一些有趣的video lecture about CS course
Copy & Paste如下 :-) (http://forums.topcoder.com/?module=Thread&threadID=507267&start=0)

TopCoder Forums
I am curious what online resources people have found to be excellent. The ones I frequent are listed below and contain video lectures: 1. Stanford collection of Knuth videos 2. University of Texas collection of Dijkstra videos 3. Vega Video Collection of Feynman Lectures 4. MIT's Open CourseWare - Numerous video lectures are featured here, including full courses in Linear Algebra, Mathematics for Engineering, Differential Equations, and Physics 1, 2, and 3. The Physics lectures are by Walter Lewin who is amazing. 5. Webcast Archive of Berkeley Courses 6. SICP Video Lectures by Abelson and Sussman 7. QMUL Mirror of the ArsDigita courses 8. Clay Math Video Collection - Numerous videos including Timothy Gowers speaking on the importance of mathematics, and Wiles and Witten talking to the 2001 IMO competitors. 9. Archive.org Collection of ArsDigita Colloquia - Includes terrific lectures by Sipser on the history of NP vs P, and Sussman on the legacy of Computer Science. Also includes videos by Richard Stallman.

[C#]確保程式只有一個Instance



在Survey Performance找到的資料.... Copy & Paste 如下





确保程序只有一个实例在运行(C#) - Felix Woo

using System.Threading
using System.Runtime.InteropServices;

public class Form1 : Form
{
[STAThread]
static void Main()
{
bool createdNew;

Mutex m = new Mutex(true, "YourAppName", out createdNew);

if (! createdNew)
{
// app is already running...
MessageBox.Show("Only one instance of this application is allowed at a time.");
return;
}

Application.Run(new Form1());

// keep the mutex reference alive until the normal termination of the program
GC.KeepAlive(m);
}
}



另外 要foreground exising one的話 code below

f your application can run with Full Trust permissions, we can take
this a step further and find the window of the application instnace
already running and bring it to the front for the user:



public class Form1 : Form

{

[STAThread]

static void Main()

{

bool createdNew;



System.Threading.Mutex m = new System.Threading.Mutex(true, "YourAppName", out createdNew);



if (! createdNew)

{

// see if we can find the other app and Bring it to front

IntPtr hWnd = FindWindow("WindowsForms10.Window.8.app3", "YourAppName");



if(hWnd != IntPtr.Zero)

{

Form1.WINDOWPLACEMENT placement = new Form1.WINDOWPLACEMENT();

placement.length = Marshal.SizeOf(placement);



GetWindowPlacement(hWnd, ref placement);



if(placement.showCmd != SW_NORMAL)

{

placement.showCmd = SW_RESTORE;



SetWindowPlacement(hWnd, ref placement);

SetForegroundWindow(hWnd);

}

}



return;

}







Powered by ScribeFire.

星期二, 4月 10, 2007

[WPF Concept] Immediate mode v.s. Retained Mode

看了WPF Graphics Rendering Overview這篇文章

才知道以往我在解釋WPF與SDK的Rendering異同之時 是可以用這二個詞的...

C P如下,或是直接參考原文





Retained Mode Graphics

One of the keys to understanding the role of the Visual object is to understand the difference between immediate mode and retained mode

graphics systems. A standard Win32 application based on GDI or GDI+

uses an immediate mode graphics system. This means that the application

is responsible for repainting the portion of the client area that is

invalidated, due to an action such as a window being resized, or an

object changing its visual appearance.

In contrast, WPF uses a retained mode system. This means application

objects that have a visual appearance define a set of serialized

drawing data. Once the drawing data is defined, the system is

responsible thereafter for responding to all repaint requests for

rendering the application objects. Even at run time, you can modify or

create application objects, and still rely on the system for responding

to paint requests. The power in a retained mode graphics system is that

drawing information is always persisted in a serialized state by the

application, but rendering responsibility left to the system.



Intelligent Redrawing

One
of the biggest benefits in using retained mode graphics is that WPF can
efficiently optimize what needs to be redrawn in the application. Even
if you have a complex scene with varying levels of opacity, you
generally do not need to write special-purpose code to optimize
redrawing. Compare this with Win32 programming in which you can spend a
great deal of effort in optimizing your application by minimizing the
amount of redrawing in the update region. See Redrawing in the Update Region for an example of the type of complexity involved in optimizing redrawing in Win32 applications.



Performance Profiling Tools for WPF



最近我們討論看WPF Performance問題 所以我上網找了一些東西



但是我這二個星期都會很忙~~ 所以先把找的東西作一個紀錄 等有時間在來看



主要遇到的問題是開二張5000x3000的Image 會吃Memory吃到600MB~~~



但似乎.Net 2.0並沒有這情況發生....





一篇WPF Render的文章 有提到一個Profling 的tool Performance Profiling Tools for WPF



這裡有一些WPF Performance的Suggestions 再來這裡有對
Graphics Rendering Tiers的介紹



對於上述Image的問題 可能可以用Virtualization Control來 例如VirtualizingPanel





大概先這樣



JimChang





powered by performancing firefox

星期一, 4月 09, 2007

How to simulation a KeyEventArgs



這裡有一篇在解怎麼用Enter作Focus Navigation



Sheva's TechSpace: Focus Navigation Using Enter Key





剛好解答了我們之前一直找不到怎麼用寫程式的方法Simulation一個keyEvent



解答如下



private void documentRoot_KeyDown(Object sender, KeyEventArgs e)

{

if (e.Key == Key.Return)

{

e.Handled = true;

KeyEventArgs args = new KeyEventArgs(

Keyboard
.PrimaryDevice, Keyboard.PrimaryDevice.ActiveSource, 0, Key.Tab);

args.RoutedEvent = Keyboard.KeyDownEvent;

InputManager.Current.ProcessInput(args);

//^^^^^^^^^^^^^^^^^^^^^^^^^^原來可以這樣用哦........

}

}








powered by performancing firefox

星期六, 4月 07, 2007

Fast Gaussian Blur Algorithm in C#

之前寫一個Blur的Filter 因為我不是DSP出身的人
所以其實是用很naive的方式來implement

可是後來玩了Sony Vegas的Gaussian Blur 覺得快的不可思議~~
其實到現在我還是不知發佈道他怎麼做的

在網路上看到一篇Fast Gaussian Blur的文章 先記錄下來
等我有空的時候再來試吧...

星期二, 3月 20, 2007

ClickOnce

研究試用了一下ClickOnce的技術

我試了.Net frameowork 2.0跟3.0 ( WPF Application & WPF Browser Application, i.e. XBAP)
花了一些時間跟心思 終於試成功了......... 試成功之後 的確是覺得蠻方便的
不過還是有許多地方需要再研究跟解決 像是其它native dll files或是沒有灌.net frameowork 3.0的client
或是除了ie跟firefox之外的browser是否可以work?

把下午的研究作一個記錄
一開始在Visual Studio .net 2005 作Puslish的時候 會失敗 他會顯示SigTool.exe沒辦法用 因為CAPICOM的版本太舊
要update到2.0.0.1,所以請到這裡下載 然後解壓縮 把CAPICOM.dll copy一份到C:\Windows\System32
然後再註冊COM即可 (regsvr32 CAPICOM.dll)


Publish可以之後 我又發現沒辦法puslish到其它電腦的web server上 (i.e. http:\\....etc) 他說需要frontpage extension xxx
但是我另一台電腦用的是Apache的Web server,所以我決定用網路芳鄰分享出Web的某一個目錄來Publish

這樣透過網芳來Publish 在之後Client端即可以直使用Browser來Deploy...我不用再重copy一份
另外Apache的設定要改一下 加三個MIME type, 在xxx/conf/httpd.config裡
這裡有IIS設定的方式 不過我沒用過 Apache的話 可以參考這裡

即加入以下這幾行
AddType application/manifest .manifest
AddType application/xaml+xml .xaml
AddType application/x-ms-application .application
AddType application/x-ms-xbap .xbap
AddType application/octet-stream .deploy

好啦~~ 我測試過在IE上WinForm跟WPF還有XBAP都可以正確無誤的使用了
但是如果我想要用FireFox呢? 現在來說 Firefox不支援ClickOnce跟XBAP
不過都有替代的解決方案.....

在Firefox裡灌一個叫FFClickOnce的Plug-in 就可以使用ClickOnce的技術
另外XBAP還是沒辦法使用 目前看來只有一種作法
就是灌IE TAB in FireFox,即這個Tab其實是Internet Explorer的一個視窗
嵌在firefox的Tab裡


然後在Firefox的Menu\擴充套件\裡的IE Tab選項 加入/\.xbap$/
表示未來如果看到*.xbap的網址 一律用IE來開啟


好啦~~~ 這大概是一下午研究的心得 @@ 也花也不少時間

星期三, 3月 07, 2007

[Resource] 科學月刊全文資料庫

最近在網路上發現這個地方 有1970~1999年的科學月刊全文

很有趣 :p

例如1970年一月版的 講費瑪數列的一篇文章...

天呀 三十幾年前...........



對科學/數學有興趣的人可以看一下.....

科學月刊全文資料庫 http://book.tngs.tn.edu.tw/database/scientieic/index.htm

星期五, 2月 23, 2007

Connected Services Framework - A Quick Introduction

Connected Services Framework - Microsoft Service Providers





最近Web 2.0很紅~~ 之前也看了一些相關的東西



像是SaaS(Software as a Service), WCF (Windows Communication Foundation),



SOA(Service Oriented Architecture), ....etc



這東西也是有些相關~~ 好像是一個能快速寫出Web Service的Framework



這個Link有一個Quick Demo可以看看幾個應用 簡單的Introduction



星期三, 2月 07, 2007





WPF3D Team Blog : Interacting with 2D on 3D in WPF





WPF RTM版並沒有支援這個功能....... 但是後來WPF3D Team小組寫了一個Control



能在3D的世界又支援Control 十分炫!!!!



真的很讚!!





powered by performancing firefox

星期二, 2月 06, 2007