Saturday, June 23, 2007

繼續得閒

都係唔忙. 留番啲工作嘅嘢下個月先講.

想聲明番上個blog中, 對darwinia和Lego Star Wars嘅rating, 係本人作的. 以下係真的Entertainment Software Rating Board (ESRB) rating

Darwinia

E: Everyone
EVERYONE
Titles rated E (Everyone) have content that may be suitable for ages 6 and older. Titles in this category may contain minimal cartoon, fantasy or mild violence and/or infrequent use of mild language.

Content: Fantasy Violence
Violent actions involving cartoon-like situations and characters. May include violence where a character is unharmed after the action has been inflicted

Lego Star Wars (Windows PC)

E: Everyone

Content: Violence
Scenes involving aggressive conflict

 


 

深水埗開多左間滙豐24小時自動櫃員機店. 有三架提款機, 有存錢機, 好似有入票機. 多左排隊位. 更近公司, 真好.

Thursday, June 14, 2007

暴力電玩Resistance - Fall of Man恐影響兒童被指摘

出晒名啦. 官方網頁

點解要揀果間教堂? 明知依間有特別意義, 比較敏感, 都仲要揀. 我只可以諗到一個原因: 劇情需要.

創作自由 與 社會責任 = 永遠衝突.

不過我地有制度去管理, 控制: [評級rating]. 外國對隻game個 rating 係 "M" (17+) [Blood and Gore, Intense Violence, Strong Language]

我反對停售, 反對作出任何賠償/補償. 如果唔滿意, 可以上訴, 要求評為不雅物品. (不過Sony可以成立個反暴力基金, 負番啲corporate social responsibility, 增強其健康形象)

賽車game都有香港賽道啦, 又唔見有人反對?

隨著display card越來越powerful, 暴力遊戲只會越來越真實.

建議參考Need for Speed, 响遊戲開始前加警告/提醒字句. "enjoy the fun of racing in the game, but that outside the game, to obey the law"


而家只好寫啲不暴力(不真實的少量暴力的)遊戲啦.

Darwinia 指揮小綠人, 抵抗電腦病毒. [Explosion. Mild violence. Flash lighting.]

Lego Star Wars 做Lego人仔, 對抗黑暗勢力. [Explosion. Mild violence. Dismemberment of human-like bodies.]

Friday, June 1, 2007

得閒左兩三個星期 - 打機

原來個同事昨日先訂到機票同酒店, 去台灣, 下個星期去. 台北+高雄. (兩個人)

自從做完個dotnetnuke網站, 又做完個鬥地主java tcp socket server後, 都好得閒.

平時得閒嘅辦公室活動: 周圍八下同事做緊咩

最有興趣當然係facial logon windows vista啦.

平時得閒嘅家中活動: 打機

主要都係唔用腦的射擊遊戲, 因為我無腦麻.

1. Half-life 1, Half-life 2, Half-life 2 episode 1
打zombie同打人, 有少少puzzle要solve. 覺得張N7600GS display card好廢, 只好行住window mode 1024x768先啦.
註: 而家做緊ATI promotion, 如果用緊係ATI, Directx9. 就有得免費玩deathmatch同lost-cost. 不過試過廳部機activate唔到個promotion offer, 唔知點解....

2. Space Cow Boy
細佬介紹, 免費的online game, 玩戰機, 打雀打. 而家level 22. 但都未夠能力抵禦敵國來襲....

3. Mount&Blade
細佬介紹, 古代格鬥遊戲, 騎馬, 格劍, 射箭.

4. Gunz
細佬介紹, 免費的online game, 用槍或同劍都得, 都幾講技術.

仲有其他, 下次記得先寫.

Monthly Report - May 2007

返工 每月報告

Period: 1 May 2007 - 31 May 2007

Task Performed

1. CMS Website Documentation

2. Student Report 成績表 (C#)

3. Hotel Room Rate Web Service (PHP)


1. Cap screen 

主要都係point form, step by step, 加screen cap (先貼落小畫家, 然後再攞要嘅部份)


2. 轉用老細買的Flex Grid Control

http://www.grid2000.com/
唔記得有咩好, 總之比C#個grid好啲啦


 3. nusoap

用open source library. 不過搵唔到點樣做login, 連WSDL都要protect. 而家寫到由URL入username同password (query string), server先會答個WSDL.


 ASP.NET 用grid view出Excel

1. 在aspx個markup個<%@ Page入面, 加
EnableEventValidation="false"

2. 之後就加個gridview啦. 然後做好啲column

3. 到戲肉, 寫code
Dim attachment As String = "attachment; filename=stat.xls"
Response.ClearContent()
Response.AddHeader("content-disposition", attachment)
Response.ContentType = "application/ms-excel"
Dim sw As New StringWriter()
Dim htw As New HtmlTextWriter(sw)

gvStat.DataSourceID = Nothing

gvStat.DataSource = dTable
gvStat.DataBind()

gvStat.RenderControl(htw)
Response.Write(sw.ToString)
Response.End()

*dTable係一個DataTable, 之前query左的.


 PHP HTML 出 PDF

 搵到PEAR都有個出pdf, 但見好未成熟, documentation又無. 所以搵左FPDF, 跟住發現有人寫左由HTML用FPDF個library, 直出PDF (HTML2PDF), 實在太好了. 最後又到出中文UTF8問題, 好在forum有有心人寫functions做, 雖然UTF8做唔到, 但出到Big5,同GB, 希望收貨啦.

http://www.fpdf.org/phorum/read.php?f=1&i=31006&t=5142#31006

 


 

PHP 出 Excel

 PEAR個Spreadsheet_Excel_Writer. 雖然仲beta緊, 但啲document好齊, 又有sample, 又出到utf8. 夠用了.


嘆左兩三個星期, 跟住有兩個新project, 一齊, 一個超趕 (兩個星期嘅嘢要一個星期寫完加試完). 都係"盡做啦".

Thursday, May 3, 2007

Monthly Report - April 2007

返工 每月報告

Period: 1 April 2007 - 30 April 2007

Task Performed

1. CMS Website using Dotnetnuke (ASP.NET in VBScript)

2. 鬥地主flash game java server


1. 同上月 

原來做左兩個半月.

個site出左(雖然唔係smooth launch). 地鐵廣告都賣左(老細話).


2. 由上一個"百家樂"改過來. 所以啲connection handling唔洗寫, 只係改game logic, 加同改四五個xml entities. 都係啲手板工夫, 只係啲thread handling比較複雜, 要用synchronised去lock住啲function同object.

用左 Java 5 個 SecureRandom 去洗牌, 同決定邊個先叫地主. API 話啲數唔deterministic, 即係唔同平時果啲pesudo random假嘢.


體會到點解out-source vendor寫啲嘢會好多bug. 原因係 skill 唔得, 加上唔夠時間, 想寫好啲試多陣都唔得. (我仲未去到老細個種接近一寫好即出得的程度. 不過我feel到自己間中有少少進步左, 唔洗debug太多次)

繼續訓練organizational skill中...

身邊有個同事好似已經陣亡, 五月假期俾佢請左.

Thursday, April 5, 2007

Monthly Report - March 2007

返工 每月報告

Period: 1 March 2007 - 31 March 2007

Task Performed

1. CMS Website using Dotnetnuke (ASP.NET in VBScript)

 



成個月"忙到爆廠"啦, 好大壓力, 不過越來越肥 ...

 

終於起好個Dotnetnuke網站 (仲未起個 testing, 要俾佢地按一個掣 export 啲 content, 之後 import 番去 live site)

非常後悔買左個 Registration module. 而家個layout 都幾樣衰, 因為係用 javascript 强行移位, 希望過到骨啦... (如果聽老細話, 一早自己寫module就好了)

Dotnetnuke 有得 set schedule, 行個自己寫的dll, 唔知佢背後係點做呢? 寫左一個dll用來 send registration email, 一個用來 synchronize 啲 account 去個客另一個 salesforce CRM 網站 (php interface有人寫)

下面用 post 放式造訪網站的source code

Private Function queryUrl(ByVal url As String, ByVal params As String, ByVal message As String) As Boolean
            Dim result As String = ""
            Dim strPost As String = params
            Dim textEncoding As New System.Text.UTF8Encoding
            Dim strPostBytes As Byte() = textEncoding.GetBytes(strPost)
            Dim myWriter As System.IO.StreamWriter = Nothing
            Dim myReader As System.IO.StreamReader = Nothing
            Dim content As String

            Me.ScheduleHistoryItem.AddLogNote(url)

            Dim objRequest As Net.HttpWebRequest = CType(System.Net.WebRequest.Create(url), Net.HttpWebRequest)
            objRequest.Method = "POST"
            objRequest.ContentLength = strPostBytes.Length
            objRequest.ContentType = "application/x-www-form-urlencoded"

            Try
                Me.ScheduleHistoryItem.AddLogNote(strPost)
                myWriter = New System.IO.StreamWriter(objRequest.GetRequestStream())
                myWriter.Write(strPost)

                myWriter.Flush()

                'Get response
                Dim myResponse As Net.HttpWebResponse = CType(objRequest.GetResponse(), Net.HttpWebResponse)
                myReader = New StreamReader(myResponse.GetResponseStream(), Encoding.Default)
                content = myReader.ReadToEnd()

                Me.ScheduleHistoryItem.AddLogNote("posted")
            Catch ex As Exception
                Return False
            Finally
                myReader.Close()
                myWriter.Close()
            End Try
            If content.Equals(message) Then
                Return True
            Else
                Return False
            End If
        End Function

queryUrl("http://www.google.com","username=xxx&lastname=yyy","success")

個 project 令我學識左 vb 的asp.net, 同 Dotnetnuke. 但係對住幾個月, content management, 個site又慢, 好悶...

 


 

而家開始寫個 "鬥地主" 賭 site (唔知點解突然多人玩) , 負責個 java socket server, flash game 由其他人(一個人)寫.

之前個"百家樂"的 source 俾左我, 所有 connection 部份都寫好左, 只係改啲 game logic, 同加個 game lobby.

如果java要 through connection send 啲 utf8 出去的話, 要用byte方式, 否則flash會收爛字

private void sendMessage(String msg) {
       try
       {
       byte bytes[] = msg.getBytes("UTF-8");
       out.write(bytes,0,bytes.length);
       }catch(Exception e)
       {
           System.out.println(e.getMessage());
       }
       out.write(0);
   }

Saturday, March 24, 2007

測試m 埗鰂

五五六
Testing
埗鰂ss

Photo: rabbit4.jpg