I'm CaLendarW Blog

computer science

Balsamiq Mockups Review

by calendarw on Dec.20, 2009, under software

第一次接觸 Balsamiq Mockup, 係今年 barcamp 其中一個 topic 度介紹過, 見到功能幾好用, 所以係佢個 site 度申請左個 license 黎試玩下.

呢個程式最好之處係可以係 Menu 度拉D 組件出黎, 就位容易, 而且提供既組件多, 有 browser, windows 同 iPhone 既 layout, 再加上基本既組件, 簡單方便!!~

除此之外, 使用方法容易亦係呢個程式最好用之處.  就以下圖為例, 用 enter 來代表換行, + 同 – 出加減 icon, 用 v 出 tick 等等, 更改容易.

製作完後, 仲可以 Save 做 PNG, PDF 等, 最啱用來 demo 比 client 睇.

Leave a Comment :, more...

yield keyword

by calendarw on Oct.29, 2009, under coding snippet

近期因為睇 ASP.net MVC 既 example, 中途見到 yield keyword 既 usage, 感覺上幾好用, 以學多個 keyword 既原則黎講, 我當然會在 project 中試用, 當中既 validation 用法我覺得幾好.

public partial class Dinner {

    public bool IsHostedBy(string userName) {
        return HostedBy.Equals(userName, StringComparison.InvariantCultureIgnoreCase);
    }

    public bool IsValid {
        get { return (GetRuleViolations().Count() == 0); }
    }

    public IEnumerable<RuleViolation> GetRuleViolations() {

        if (String.IsNullOrEmpty(Title))
            yield return new RuleViolation("Title is required", "Title");

        if (String.IsNullOrEmpty(Description))
            yield return new RuleViolation("Description is required", "Description");

        if (String.IsNullOrEmpty(HostedBy))
            yield return new RuleViolation("HostedBy is required", "HostedBy");

        if (String.IsNullOrEmpty(Address))
            yield return new RuleViolation("Address is required", "Address");

        if (String.IsNullOrEmpty(Country))
            yield return new RuleViolation("Country is required", "Address");

        if (String.IsNullOrEmpty(ContactPhone))
            yield return new RuleViolation("Phone# is required", "ContactPhone");

        if (!PhoneValidator.IsValidNumber(ContactPhone, Country))
            yield return new RuleViolation("Phone# does not match country", "ContactPhone");

        yield break;
    }
}

但當我想在 project 度用果時, 開始感覺到麻煩, 因為本身個 project 係要在 .net 2.0 既環境下運作, 而 IEnumerable.Count 係未有支援, 而且無 extension methods 既支援, 所以要另外寫個 class 黎 handle 呢樣野都幾麻煩, 因此我都無乜 idea 在其他方面可以實際上使用得適當……

Leave a Comment : more...

Chrome 3.0

by calendarw on Sep.16, 2009, under software

今日經 codeproject 個 email subscription, 見到 Google發表左 Google Chrome 3.0, 下載試用後, 改善度都幾大.

對我黎講, 2.0 都有幾多唔 user friendly 既地方, 係 3.0 都進步左.
例如:
New Tab – 如果想在版面上既 link 想係新 Tab 度顯示, 2.0 要 new 左個 tab 至可以拉入去, 比 firefox 多左一個 step, 對我呢個用拉既方法較多既懶人黎講, 用拉既方法係會方便 d, 而 3.0 亦實現左呢個功能.

Proxy Setting – 其本上同 2.0 一樣, 都係 call 返 windows 果個 proxy setting 出黎, 不過個 setting 版面將 proxy 呢個 function 放左上上面, 對我呢個成日要 enable/disable proxy setting 既人黎講係方便左.

Home Page – 往個 Home page 都係放最近去既網頁, 而 3.0 就加多左個可以 pin 既功能, 可以比 user 定格某 d 常用既頁面.

Download – 2.0 個 download 係只會出現在 download 左野果版, 如果轉左第二個版面就會顯示唔到, 3.0 改善左呢個問題, 另到 user 係其他版面都睇到 download status.

除此之外既 advance 功能就似乎對我無乜影響, 有時間既話先再 detail 咁研究~~

Leave a Comment :, more...

Error 29506 when installing SQL Server 2005 Management Studio Express on Windows 7

by calendarw on Aug.25, 2009, under error handling

部 x60 今日好似傻傻地, 所以係部 tx2 度預備返個 development environment, 而用開 xp 既我, 換左 win7 之後連入野都好似有 d 問題……
好在係網上搵到以下呢個 procedure:
  1. Click “All Programs”, select “Accessories”, right click the Command Prompt shortcut and select “Run as Administrator”.
  2. Click “Yes” to accept the warning
  3. Use command “cd” to navigate to the installation directory.
  4. Type the installation file to execute file. (e.g. SQLServer2005_SSMSEE_x64.msi) and complete the installation.
Leave a Comment :, , , more...

List.Sort – Lambda Expression Way

by calendarw on Aug.18, 2009, under coding snippet

呢期研究既 delegation, 其中一個例子係 Lambda 在 List.Sort 既使用.

List<Person> persons = new List<Person>();

// sort by name
persons.Sort((a,b) => a.Name.CompareTo(b.Name));

// sort by age
persons.Sort((a,b) => a.Age.CompareTo(b.Age));

bool ascending = false;

// descending by age
persons.Sort((a,b) => a.Age.CompareTo(b.Age) * (ascending ? 1 : -1));

有了這樣既 syntax, 寫 sorting 易左同快捷左很多~~

Leave a Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!