Showing posts with label 程式語言 Program Code. Show all posts
Showing posts with label 程式語言 Program Code. Show all posts

Monday, May 31, 2010

網站系統設定問題 The Problem of Web Server Setting.

Apache 2.2.15 + PHP 5.3.2 + MYSQL 5.1.14
剷完機後,又再設過 Server.之前的 Server已係2年前 IVE整 Project的時侯設置.然而,大前提下那個 Server並沒有任何的問題.最主要都係作網頁設計而且係我作小實驗的地方,其餘的就只有作為放 Demo與 Portfolio.


設定基本上以往都有做過,而且情況幾乎係我踫過的 Desktop都有設定過.要設定的方法的話,可以看以前的網站系統安裝 Web Server Setup

這次不同的地方係在 Version方面,但都有不同問題出現.

Apache 2.2.15 + PHP 5.3.2 - Extension Problem

設定 Apache 就基本上很簡單, Follow the Step就可以了.而這次的問題係 PHP用 installer版本還是Binary版本. 可能是個人問題, 當用Binary 版本設置的時候, PHP會出現 "Unable to load dynamic library 'c:\php\ext\php_mysql.dll' ". 當用 Installer版本時, 是沒有此情況出現. 請注意:在php.ini內的 extension_dir 已準確無誤的設定了

在Installer 版本下, 只是把無關重要的 extension功能開始了, 才以致 Apache 會出錯誤.
另一方面, 此設定下 PHP並不需要 libmysql.dll作支援.

PHP4 VS PHP5 - $HTTP_GET_VARS & $_GET

在檢查舊網頁時發現, 在IVE的Project 網頁內會有 $HTTP_GET_VARS與 $HTTP_POST_VARS 的編碼不能使用, 當轉換為 $_GET與 $_POST則不會出現使用不能的情況. 可能當時使用的是 PHP4, 而PHP4支援 $_GET 與 $HTTP_GET_VARS, 當到現在用PHP5, PHP5就只能夠用$_GET.

現在的問題就暫時只有這些. 設定真的年年不同. 還好自己喜歡網頁設計與程式設計,亦學過設置Server.

Friday, May 23, 2008

FYP的終結 The End of The Final Year Project


WebSite - FrontPage



Client Control Panel

Streaming Video Contorl Panel

Add Playlist (select item by drap and drop)

Client Control Panel -Login

Client Control Panel -Upload

Admin Control Panel


Final Year Project 就到此為止了!!!
之後就係不斷的溫書背書讀書...

對於今之的FYP還滿滿意的
因今次真係比前兩年的Project學得更多
Visual C#,SSL,WPF,AJAX,etc.
學的Code 多左.
所以滿開心.

Saturday, April 19, 2008

客戶控制介面初步完成 Client Control Panel is almost completed


Login Form




Exhibition News


Upload Interface


Upload Step1 - Convert File


Uploading File


Upload Successful


大致上,User Panel就算完成了.
只餘下有沒有須要外加Function.
這兩天最主要都係作修改介面及處理Upload的部署

介面方面,就只係作出無謂的對色處理.
做成整體上用了藍+黑+白的色彩
介面就如Year1時整的圖書館一樣
最住要係覺得這樣整比較方便.
不過,應該還有更好的方法的.

上載的部署方面,之前找到的HTTP上傳方法在大小方面有較大的限制
於是就不斷找FTP的方法,在前日就弄好了.
但問題係FTP有分一個叫PASV的mode.
來源於較早前的FTP係為了作直接傳輸.
而PASV主要係對策於因網絡不斷進步而產生出來的Firewall
當然,現在也未弄清楚是什麼的一回事.
在C#用FtpWebRequest,要用UsePassive來定下是否用Passive mode.
FtpWebRequest.UsePassive = [true/false];

基本上這個問題也解決了.

現在可98.9%用於開發Darwin Streaming Server.
在剛剛也找到了新增channel的方案.
應該會在一個星期內完成的...希望啦!!!
因Things always go against our wish.

Monday, March 24, 2008

FYP 傳檔部份 FYP Convertion Part



FYP的Upload Video File部份
因怕用戶的格式不乎
就引申出Conversion的步驟
之前的實戰部份就只是在一個C# Window Form中建做
但在WPF的情形下,Process的EventHandler所叫喚的Function入面的物件
會出現一個Exception

InvalidOperationException was unhandled:
The calling thread cannot access this object because a different thread owns it.


這個時候,就要用Dispatcher.
在英文網站上看,係用於管理在等候的工作事項for一些特定的Thread.
辦法如下:

1.加 namespacing
using System.Windows.Threading; // Dispatcher,DispatcherPriority

2.用這個包住該物件
this.Dispatcher.BeginInvoke(
DispatcherPriority.Normal,
(DispatcherOperationCallback)delegate(object arg){
// HANDLED ON UI THREAD

this.outputTextBox.Text += e.Data + "\r\n";
return null;
},null);


除此之外,在WPF也用了OpenFileDialog作選擇Video File去Upload
到此地步,問題就出現了.
上載Video的部份可以係用
WebClient上載or用FTP上載
WebClient的問題係FileSize的即使set左,
但通常就只可用於上載圖.
用FTP上載而引申出來的問題就較多.
要為求有安全性及上載到user各自的空間
就要在新增用戶的地方加入增建FTP Account.
但Window IIS的FTP就要用API才可新建,
而Linux的就可用Command去新增.
故此,OS就是一個問題.
其二,就係連接時間的問題,
當File的Size大,相對所要用的時間就較多,
故要set定user所有的空間大小.
而且File也要較小,才可以快速用於Streaming Server作Streaming Video.
這些問題都要放完Easter假之後快速辦好才可行!!!

[Kirupa - Using the Open File Dialog Window]
http://www.kirupa.com/net/using_open_file_dialog_pg1.htm

[Thou Shalt Not Break the Golden Rule of Windows Multithreading. Or, Why the Dispatcher Rocks]
http://blogs.msdn.com/wpfsdk/archive/2007/01/30/thou-shalt-not-break-the-golden-rule-of-windows-multithreading-or-why-the-dispatcher-rocks.aspx

Friday, March 21, 2008

FFMPEG 實戰攻略 FFMPEG



在研究過FFMPEG過後,之後就是實戰了.
在Google上搜尋,相關的資料實在少之又少.
要用C#去取在console中的運作的方法有兩個
1.改寫FFMPEG的程式
2.用Process去取FFMPEG的資訊
由於時間比較少的情況下,就只好用2的方法.
因FYP就不是只有這方面的研究.

用Process的方法是快而且比較簡易
要註意的是: ffmpeg出的方式係以StandardError
而且危險的係如果輸出的Message係少左的.
程式本身就會變得唔完整.
所以要令程式運行99.9%成功的.
就要在check 輸入的變數上花一些功夫.

在此後,就要開始研究關於上載Video至Server的問題!!!
P.S. : 因要加速開發速度,故英文版會以google作翻譯.其後,會作修正!!!

After having studied FFMPEG, followed by live combat.
On Google search, the relevant information is scanty.
using C# to get the infomation in the console program in two ways:
1. Rewrite the FFMPEG program
2. FFMPEG fetch information by using Process
Because of the lack of time, I just use the method 2.
FYP is not only research in this area.
Process method is faster and simpler.
It should be noted that: The output of ffmpeg is using StandardError.
And it is dangerous if the output of the Message is not find.
the program will become incomplete.
So to make programs run 99.9% successful,
It is necessary to check the input variables in spending some effort.
In the following, to begin research on upload Video to Server Problem!

PS: Due to accelerate the speed of development, the English translation will be made by google.Subsequently, the amendment will be made.

Thursday, March 20, 2008

FFMPEG 學習小記&資源 FFMPEG Learning Record + Resource

近期開始製作FYP的轉檔的部份
最先就以為只有VideoEdit
才滿足到這個欲望...

VideoEdit Mobile
一個用來Convert Video的ActiveX
而且有Sample給予建設一個自己的Convertor介面
可惜的是它並不是免費的.

其後大約半個月,就找到好幾個Console版的Convertor
FFMPEG, MENCODER, MP4BOX.
但本人就只係試FFMPEG
見效果也不錯
以下係介紹:

FFmpeg是一個免費開放原碼的軟體,
可以執行音訊和視訊多種格式的的錄影、轉檔、串流功能,
也支援對電視卡即時編碼

官方網站: ffmpeg
原碼下載: Here

FFMPEG的Compile手法係以Linux的OS作背景的.
只有Linux的Terminal才可以安裝FFMPEG.
如果各下係Linux, RedHat, Fedora的用戶
可用奇想空間的方法去建立自己的FFMPEG.

Command Sample ( wmv to 3gp) :
ffmpeg -i source.wmv -s qcif -r 20 -ac 2 -ar 22050 -b 200k -ab 64k -vcodec mpeg4 -acodec libfaac output.3gp

ffmpeg參數設定

-L license
-h Help
-formats 顯示可用格式
-f 強制輸出格式
-title 設置標題
-author 設置作者
-copyright 設置版權
-comment 設置評論

-i 輸入File
(指定Path要加"")
-y 覆蓋同名輸出File

影片設定
-bitexact 使用標準Bit Rate
-vcodec 使用encoder
-s 指定分辨率
-r 設定FrameRate
-b 指定壓縮Bit Rate
-qscale 以質量为基礎的VBR,取值0.01-255
-qmin 設定最小質量,與-qmax(設定最小質量)共用
-sameq 使用和來源同樣的質量

聲音設定
-acodec 設計聲音的encoder
(註: 可用ffmpeg -formats 查看支援的encoder)
-ac 設定聲道:1為單聲道,2為立體聲
-ar 設定聲音声音Hz
-ab 設定聲音BitRate
-vol 設定音量

附加設定
2>log.log 把ffmpeg輸出的未串紀錄在log.log, 2為不顯示在cmd中.



[奇想空間: 泛用型 ffmpeg 安裝攻略]
http://blog.comicparty.com/post/1/352

[Window使用者用的FFMPEG]
http://ffdshow.faireal.net/mirror/ffmpeg/

[FFMPEG詳細使用方法]
http://www.lougoo.com/blog/article.asp?id=674

Sunday, March 16, 2008

SiriusPhoto v2.0 is out now SiriusPhoto v2.0 誕生




SiriusPhoto v2係昨日誕生了
這個Flash中,最喜歡的就係Loading的地方
因大字型表演進度
也吸收了別人意見
所以在SiriusPhoto v3
應該會有的設計有:
a.半透明的Description
b.更多的Object可供觀看
c.無限的可能性...XD

SiriusPhoto就此停下腳步先
因接下來的時間係勤奮努力的時間了
Assignment,測驗,考試會接踵而來
因所用的時間係必須的
所以SiriusPhoto v3就要7-8月才開始再製計劃
(敬希期待!!!)

SiriusPhoto v2 was born in yesterday.
In this Flash, My fav. part is the Loading part.
Because I have used a huge text to show the progress.
Also,I have absorbed some guy's opinion.
So that the Design of SiriusPhoto v3 will have,
a.Translucent Description
b.More Object for preview
c.infinite possibility

The Development of SiriusPhoto just stops right now.
The following time that I should be hard-working to prepare the assignment,the test and the examination.
So What I need is Time.
SiriusPhoto v3 may be started to redesign at July or August.
(This will be Coming soon!!!)

Tuesday, March 4, 2008

FYP 研究記錄 FYP Studying Record




昨日在Expression Blend 入面設定左一個Window介面(上圖)
本來以為Blend就只可以用CRC同XML去Get Data
後來發現只要在C#中加入Reference的MySql.Data
在Code的部分加入using
而取Data 部份就如平常時一樣就行了...= ="
只不過事實係Blend的確就只有XML 與 CRC
因Blend只不過係為了Designer而誕生的
而Programming部份就同平時開Window Form一樣
家中的512MB RAM,可以支持到同時開Expression Blend與Visual C# 2008
可算係奇蹟!!! > w <
利用XAML作介面設計,Visual C# 去作Function設計
新的介面設計真不錯.
因把Designer同Programmer的工作分得更清楚.

在FYP中,有部份係關於WebSite的.
係今日的討論之下,
作自動產生的頁面
要視乎物件本身的數量.
物件本身又含有大量資訊的話.
開一個資料庫儲存該物件的資訊係一個不錯的選擇.
e.g Exhibtion Center - >Event - > Company - > Company Detail
- > Product List
- > Booth - > Company ID
而我覺得有大量的Company 的資訊出現
那麼一個Company 就要一個 Database
註: 這就只不過是個人見解!!! XD

I have designed a Window Application Interface in yesterday.
The original thought is Blend only can use CRC or XML to get Data.
Afterward I find that you just need to add reference MySql.Data in C# Solution.
In the Code, Add "using MySql.Data".
And the part of code you get data is just same to the ordinary coding...= ="
The truth is Blend can use XML & CRC only.
Because Blend is only build for Designer
and the Programming part is just like you coding in peacetime.
The 512MB Ram in my home can support to open Expression Blend and Visual C# 2008.
It's a miracle!!! > w <
The new user interface design method is really okay.
Use XAML to design the interface and use Visula C# to design the function.
It make the duties of designer and Programmer be more distinct.

In the website of FYP, We discuss how a page was generated automatically.
It's care about the amount of the object.
If the object contain many information,Creating a database is a good choice.
e.g Exhibtion Center - >Event - > Company - > Company Detail
- > Product List
- > Booth - > Company ID
I think there have many company detail is appeared.
So we need to create a database for each company.
P.S : It is just my view!!! XD

Saturday, March 1, 2008

WPF學習資源 WPF Learning Resource

因為想令Final Year Project
成為一個比較厲害的計劃
所以就開始左研究WPF

Window Presentation Foundation(WPF) 係Microsoft 的.NET Framework 3.0的其中一部份
係一種新的介面技術,而WPF/E 更傳說中可以係不同的OS中開啟.當然我係唔清楚的...
因現時用的OS都係Window XP.它是範指XAML 係一些似XML Code + JavaScript的東西.|
所以就只有信住先!!!

一開始的時候以為就此這裡按那裡按就可以學懂= w =
但這種想法真是不要得.
(然而,有時候係滿有效的.e.g. PowerPoint)
最後,上了官網看Video,除了官網也找了一些參考資料.
當中學懂了其實與HTML寫的Code也相差不多.
Expression Blend就只係一個好用介面去Generate XAML
最終的問題就出現了.如果我製作了一個Application係想與MYSQL作連繫時
那又用不到平時在C#中拉入的DLL.
難道一就要用XML出Data,二就要用SQL 2005作Database.
這是Microsoft的吃錢方法嗎!?

參考資料:
http://blogs.msdn.com/expression/articles/543834.aspx
http://www.contentpresenter.com/

I want my FYP be a powerful Project.
So I started to studying WPF.

Window Presentation Foundation(WPF) is a part of .NET Framwork 3.0 in Microsoft Product.It is a new technique to develop the user interface.And It seem like can excute in difficult OS.Of course, I don't know this clearly.
Because I just use Window XP be my computer's OS.It use XAML that look like XML Code + Javascript.

When I start to study WPF, I think I can only try every thing. So that I can know how to develop a application.
But It is very wrong.
(However, It's work in sometime.e.g. PowerPoint)
Finally, I visit the offical Website and watch the tutorial video.
Except the offical Website,I find some reference website.
In the current, I know that It is similar to HTML Code.
Expression Blend is just a billiant interface to generate XAML.
Follow this,I have some question appeared.
If I have develop a application was connected with MYSQL,It can't use the extensible tool like DLL .
Is it possible that I need to use XML to generate data or I need to use SQL 2005 be the database?
Is that how Microsoft get more money!? = ="

Reference Resource
http://blogs.msdn.com/expression/articles/543834.aspx
http://www.contentpresenter.com/

Sunday, February 24, 2008

天狼星相冊再製 SiriusPhoto is redesigning

本日開始再製早前的SiriusPhoto
SiriusPhoto 係用Flash 的產物
目的為了展示相片
為方便不用修改Flash
就做到改相的功能
因此用了XML作為存取相片的資料媒介
做到加相片更可以用PHP去產生這個XML
Version 1.0係非常不完善的版本
因就有多少句
可拉的相片就有多少
而這次的再製版Version 1.5
係想做到有縮圖按鈕
一按下按鈕左面的相片展示區
就出現該圖
當然現時在於loader 的設計
設計如何令到每一幅相片存取下來的進度
可以顯示給用戶看
當中開始學懂了如何利用AddListener
去監察每一個相片的進度
當完成SiriusPhoto
就可以用在很多方面
用於公司網站的Gallery
用於個人網站的製成品展示
或是普通朋友間觀看照片的Browser

Today, I start to redesign SiriusPhoto
SiriusPhoto is used Flash to develop.
Aim to show the photo
And I wanna to edit the photo that do not need to change in Flash.
For this reason, I used XML format to store the imnformation about the photo.
If you want to add more photo, you also can use PHP to generate this XML file.
In Version 1.0, That is a faultiness version.
Because it related to how many photo you have.
(That's related to the tag in the XML file.)
If you have many photo, It will display a lots of photo.
So that you can not watch the photo clearly.
In this redesign version 1.5,
I want the Gallery have many thumbnail.
This thumbnail is a button to call the Flash to show the photo you selected.
Now I am care in designing the loader
How to add the rate of progress of the photo
So the user can see how long he/she will have to wait.

After I have finished SiriusPhoto,
It can be in many way.
Use it in some Company's Gallery
or use it in the personal website to show my manufactured goods.
Moreover, It can be the browser for your friend to watch the photo.

Saturday, February 23, 2008

Microsoft Visual C# 2008 Expression

最近因為想學習C#,
而開始不斷找圖書館中的書.
其中在公共圖書館有一本叫
C# .NET 資料庫開發聖經
雖然係舊書一本,
但基本上係講如果用SQL 2005 去開發程式
如何部署專案以致用戶可以一安裝就可以使用
當中明白到與普通的Java Code相差不多
只係某一些的Function不同名
同時寫Java Application係要用Code
去表現一些介面控制項目
而Visual C# 就有方便設計介面的設定
比較方便

現在還有一本書未借藉回來
Visual C# 2005 程式開發與介面設計秘訣
希望這一本書更接近2008的Function

在近期在一個Blog中發現到Microsoft有一個新的網站
Forge New Powers
不知是一個怎樣的網站呢!?

P.S : 好似Borland有軟件可方便設計Java Application.
但就好似未用過

In this few week,
I wanna to learn C#
So I have started to find books in library.
In public Library, I find a book is called "C# .NET 資料庫開發聖經".
Althought it is a outdated book,
it basically is about how to develop a window program to manage the data in SQL 2005.
And How to publish your project.So that the user easy to use after the programme is installed.
After I have read this book,
I know that C# code is similar to Java code
It's only difference in Function Name.
If you develop a Java Application,You only can use code and no tool that can help you.
However, Visual C# have a design tool for you.
Whoever you are a programmer or a designer.
You are suitable to use Visual C#.

Now I have request a book in IVE library.
It is called "Visual C# 2005 程式開發與介面設計秘訣".
Hope this book can improve my knowledge in C#

Also, I have find a new site in a blog
Microsoft have create a new website.
But I don't know what it is about.
Forge New Powers

P.S : Seem like Borland have software to develop Java application.
But I haven't use it before.

 
Copyright ©2008-2009 SiriusResource. SiriusResource is Powered by Blogger