2009年3月29日

App Store

自從我知道了 iPhone 的 App Store 平台服務後,才發現 Google 與 Microsoft 也有類似的服務。 Apple - App Store Google - Android Market Microsoft - Windows Mobile Marketplace BlackBerry - BlackBerry App World

2009年3月12日

SEO

有幾個正正當當的 SEO 規則:
  1. 讓 Google 與 Yahoo 知道這個網站或網頁的存在:Google 可以透過網站管理工具,Yahoo 則透過 siteexplorer。
  2. 找出與網站相關的熱門關鍵字:既然想透過 Google 或 Yahoo 的關鍵字搜尋,當然不要選擇冷門的關鍵字。列出想到的關鍵字,到 Google 打一下,便可以看到數字的大小;至於 Yahoo,則可以透過關鍵字建議工具測試看看。
  3. 提供 Search Engine 明確的訊息:根據適當的關鍵字,設定好對應的 Title, Description 以及 Keyword;注意字串不要太長,否則搜尋機器人,會認為你想騙它。
  4. 讓更多的人連結你的網頁:趕快鼓勵你的親朋好友,連結你的網頁吧;當搜尋引擎到他的網頁而發現你的網址時,也會順便幫你加分。

meta tag sample:

<head>
  <title>JQuery Dialog Practice</title>
  <meta name="description" content="Try jQuery Popup Dialog" />
  <meta name="keywords" content="jQuery,Dialog" />
  <meta name="author" content="Dyson Liu" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

2009年3月8日

Objective-C Primer

第一次探究 Objective-C,所以做了一些簡單的筆記,原本我已為跟 C 差不多,沒想到看得 "霧煞煞"。

Extension Name
.h - header files, .m - source files of C, .mm - source files of C++

與 C 不同的 keyword
==============================
NULL => nil
#include => #inport
super =>base
self => this
------------------------------------

Classes
==============================
@interface MyClass : NSObject
{
NSString * Name;
int Age;
}
- (id)initWithString: (NSString*)aName;
+ (MyClass)Create: (NSString*)aName;
@end
------------------------------------
class 的宣告必須放在 @interface 與 @end 之間,繼承的宣告方式與 C++ 相同。
method 的宣告比較特別,最前面的 "+" 代表 static method,"-" 則是一般 instance object method;method 冒號後面是參數。
------------------------------------
@implementation MyClass
- (id) initWithString : (NSString*) aName
{
if (self = [super init])
{ Name = [aName copy];
Age = 0;
return self;
}
}
@end
------------------------------------
Class 的實體,寫在 @implementation 與 @end 之間

呼叫 mathod 的方式
==============================
MyClass *obj = [[MyClass alloc] init]; // memory allocation, init is constructor
[obj initWithString: "Peter"]; // similar to obj->initWithString("Peter");
[obj release]; // release obj
------------------------------------

String
==============================
NSLog (@"Hello World!");
NSLog (@"I like Objective-C.\\n");
NSLog (@"The value is %d", nValue);
------------------------------------
Objective-C 的字串,前面固定要多加一個@,含意與 C# 不同,所以要讓字串換行,還是要再 n 之前寫兩個反斜線。

[refernece]
Objective-C Beginner's Guide: http://www.otierney.net/objective-c.html

2009年3月3日

Silverlight Download Image

我在設計網路相簿時,必須由 server 下載照片,花了不少時間找相關資料,發現下列三種方式可以使用。 1. 利用 Web Service 將 image 以 byte[] 下傳。 2. 利用 BitmapImage.UriSource 方式下載。 3. 利用 WebClient 方式下載。(ps.僅能讀取同一站台內的資料) 範例分別如下: --- Web Service --- private void LoadAllPhoto() { PhotoServiceReference.PhotoServiceClient proxy = new PhotoManager.PhotoServiceReference.PhotoServiceClient(); proxy.GetPhotoCompleted += new EventHandler<PhotoManager.PhotoServiceReference.GetPhotoCompletedEventArgs>(proxy_GetPhotoCompleted); proxy.GetPhotoAsync(); } private Image imageShow; void proxy_GetPhotoCompleted(object sender, PhotoManager.PhotoServiceReference.GetPhotoCompletedEventArgs e) { MemoryStream stream = new MemoryStream(); stream.Write(e.Result, 0, e.Result.Length); stream.Position = 0; BitmapImage image = new BitmapImage(); image.SetSource(stream); Image imageShow = new Image(); imageShow.Source = image; this.LayoutRoot.Children.Add(imageShow); } --- BitmapImage --- BitmapImage image = new BitmapImage(); image.UriSource = new Uri("...", UriKind.Absolute); image.DownloadProgress += new EventHandler<DownloadProgressEventArgs>(image_DownloadProgress); Image image.SetSource(stream); imageShow = new Image(); imageShow.Source = image; this.LayoutRoot.Children.Add(imageShow); --- WebClient --- WebClient imageLoader = new WebClient(); imageLoader.OpenReadCompleted += new OpenReadCompletedEventHandler(imageLoader_OpenReadCompleted); imageLoader.OpenReadAsync(new Uri("...", UriKind.Absolute)); void imageLoader_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) { BitmapImage image = new BitmapImage(); image.SetSource(e.Result); Image imageShow = new Image(); imageShow.Source = image; this.LayoutRoot.Children.Add(imageShow); }

2009年2月27日

Silverlight Storyboard Animation

有時候我必須透過程式直接產生物件,並加入動畫的效果,例如由網路讀取使用者的相簿數量,然後在相簿出現的時後,產生移動或淡出的特效。下面的程式碼可以幫助學會 Storyboard 的使用,其中,特別要注意的就是 PropertyPath 的建立。
 
for (int i = 0; i < inData.Albums.Count; i++ )
{
IAlbumData albumData = inData.Albums[i];
Album newAlbum = new Album();
m_AlbumList.Add(newAlbum);

Canvas.SetLeft(newAlbum, 20 + 30 * i);

this.LayoutRoot.Children.Add(newAlbum);
newAlbum.Click += new RoutedEventHandler(newAlbum_Click);

TranslateTransform translate = new TranslateTransform();
newAlbum.RenderTransform = translate;

Storyboard sb = new Storyboard();

DoubleAnimation moveAnimation = new DoubleAnimation();
moveAnimation.From = 0;
moveAnimation.To = 20 + 50 * i;
Duration dur = TimeSpan.FromSeconds(0.5);
moveAnimation.Duration = dur;
Storyboard.SetTarget(moveAnimation, translate);
Storyboard.SetTargetProperty(moveAnimation, new PropertyPath(TranslateTransform.XProperty));
sb.Children.Add(moveAnimation);
sb.Begin();
}

2009年2月13日

Silverlight Page Turn


使用 Silverlight 產生翻頁的功能。 效果與常見到的 Flash 相似,有柔軟的翻頁效果,直接點選,則以動畫方式呈現。

[refernece]
WPF and Silverlight BookControls: http://www.codeplex.com/wpfbookcontrol

以下是先前找到
Silverlight 1.0: http://msdn.microsoft.com/zh-tw/magazine/cc507644.aspx
Silverlight 2.0: http://blogs.msdn.com/deviations/archive/2008/10/06/silverlight-2-beta-2-page-turn.aspx

Deploying Vue & .NET with Google OAuth on GCP Cloud Run

Deploying Vue & .NET with Google OAuth on GCP Cloud Run Deploying Vue & .NET with Google OAuth on GCP Cloud Run...