Thursday, February 28, 2008

add gadget into igoogle and your webpage


Keywords: Gadget, Widget, iGoogle


Gadget is as one small applet, and it can hosted in desktop application or webpage.


Almost google gadgets can applicable for google Desktop and iGoogle. http://www.google.com/ig/directory


Some of them can add in YOUR webpage. http://www.google.com/ig/directory?synd=open



Tuesday, February 26, 2008

2007 CCTV cup English speaking contest video

Keywords: English Speaking Contest




2007CCTV杯英语演讲大赛决赛第一天
http://v.youku.com/v_show/id_co00XMTU4ODEwNTI=.html




2007CCTV杯英语演讲大赛决赛第2天
http://v.youku.com/v_show/id_co00XMTU4ODI2NzI=.html




2007CCTV杯英语演讲大赛决赛第3天
http://v.youku.com/v_show/id_cd00XMTU4ODQxMTY=.html


Monday, February 25, 2008

ruby dev tools

keywords: Ruby, JDT


One-Click Installer- Ruby interpretor and extenstion(Windows OS)


http://rubyforge.org/frs/?group_id=167


ActiveScriptRuby- Ruby interpretor and extenstion package(Windows OS)


http://arton.hp.infoseek.co.jp/indexj.html




RDE- Ruby Dev Eniviroment


http://homepage2.nifty.com/sakazuki/rde_en/index.html


RDT homepage


http://rubyeclipse.sourceforge.net/


Using the Ruby Development Tools plug-in for Eclipse


http://www.ibm.com/developerworks/opensource/library/os-rubyeclipse

Wednesday, February 20, 2008

open source net and security class library of c#

Keywords: C#, Opensource, Net library, Security Library, Certificate library


great opensource site http://www.mentalis.org/

interconvert byte[] and string and stream

keywords: C#, byte array, string, stream


stream和string和byte[]都是内存中的对象, 一般而言, string和byte[]都是轻量级的数据包装体, 在作layer间数据交换应优先使用它们, 因为它们占用更少的内存. 但它们本身的成员方法比较少, 尤其在持久化方面, 有可能需要借助Stream来完成, 那么怎样将string和byte[]转化成stream呢? 本文给出了一些代码. 有关不同类型stream相互转换, 可以参考另一篇文章(http://focuswindows.blogspot.com/2008/02/convert-filestream-fromto-memorystream.html).




/// <summary>
///如果你并不需要解析转换后的String, 那么可以将byte数组转换成Base64String.
/// 使用这个方法你不需要关心buffer数组中每个byte的编码, 统统都可以将它们转换成Base64String.
/// because Base64 store one char in 64 digits.
/// But the Base64 char is hard to recognized compared with the ASCII encode.
/// </summary>
/// <param name="buffer"></param>
/// <returns></returns>
public string ConvertBytesToBase64String(byte[] buffer)
{
return Convert.ToBase64String(buffer);
}


/// <summary>
/// 将一个Base64String转换成Byte[]
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public byte[] ConvertBase64StringToBytes(string str)
{
return Convert.FromBase64String(str);
}



/// <summary>
/// 将Stream转换为String
/// </summary>
/// <param name="ms"></param>
/// <returns></returns>
public string ConvertStreamIntoString(Stream ms)
{
//使用StreamReader应该是读取Stream最简单的方法
System.IO.StreamReader reader = new StreamReader(ms);
ms.Position = 0;
return reader.ReadToEnd();
}


/// <summary>
/// 将string转换成stream
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public MemoryStream ConvertStringToMemoryStream(string str)
{
MemoryStream ms=new MemoryStream() ;
//使用一个StreamWriter来将str写到一个MemoryStream
using (StreamWriter writer = new StreamWriter(ms))
{
writer.Write(str);
writer.Flush();
}
return ms;
}

Tuesday, February 19, 2008

Develop MSN Robot By C#

this article is copied from http://www.busfly.cn/post/183.html


用.NET开发MSN聊天机器人 - MSN聊天机器人开发揭秘(收藏)

Sunday, February 17, 2008

How to download video from Youtube

Keywords: Internet, Youtube


How to download and Play the YouTube video?


Download


Some websites provide download service for YouTube media.


http://cn.dl-video.net/ (还支持很多中文视频网站,如56.com, 土豆和优酷等)


http://get2pc.com/


http://keepvid.com/




Some tool can be used to download the YouTube media.


Ook? Video Ook! https://addons.mozilla.org/en-US/firefox/addon/2584


videodownloader is another firefox extension. http://www.flv-converter.com/download-video-from-youtube.htm


FLV Player to play


Download http://www.martijndevisser.com/blog/flv-player/



Wednesday, February 13, 2008

MSDN magazine reader--MSDNReader

Keywords: MSDNReader, MSDN



download: http://code.msdn.microsoft.com/msdnreader



This is a downloadable tool to allow you to read MSDN magazine - which is a great magazine to get up-to-date information on .NET.



Please download and share with your friends too. This requires .NET 3.0 to be installed on your system.

Monday, February 4, 2008

Mother in Shanghai on SpringFesterval老妈第一次在上海新家过年

昨天到火车站接老妈的时候在想, 老妈第一次到上海新家, 进门的第一感觉会是什么? 甚至在出租车上也想这个问题.

一进门, 我都觉得耳目一新, 当然, 老妈也赞不绝口. 虽然房子小了点, 但老婆布置的真不错, 把中国结和十字绣都挂上了, 家里显得很喜气.

总算在上海有了家, 今年是在新家过的第一个春节, 老妈也不远千里从辽宁过来团聚. 我相信只要努力, 我们的未来会更好, 也祝愿辽宁家人和山西家人身体健康, 万事如意.

Sunday, February 3, 2008

the powerful DebugView

Keywords: capture debug output, Win32, .Net


DebugView is made by the famous Sysinternals company owned by Microsoft. 我们在程序中通常会有意用debug类(c#)输出一些调试信息, 或者我们要捕捉一些其他人开发的程序是否有异常, 都可以使用这个工具. 只要启动一个DebugView实例, 就可以监控所有程序的debug输出.


它不仅仅可以监视Windows和Console程序的debug, 而且可以监视Web程序的debug输出(需要在Web服务器上运行debugview).

How to test performance in C#

Keywords: Performace test, Win32, .Net Framework


In Win32,


Low resolution: GetTickCount() Api


High resolution: QueryPerformanceCounter() and QueryPerformanceFrequency()


In .Net


Low resolution: Enviroment.TickCount, the best resolution it will give you is 10 milliseconds.


High resolution: System.Diagnostics.Stopwatch class.


Stopwatch class usage:




private void btnPerformaceTest_Click(object sender, EventArgs e)
{
System.Diagnostics.Stopwatch sw = new Stopwatch();
sw.Start();
//Process1();
sw.Stop();
System.Console.WriteLine(sw.ElapsedMilliseconds);

sw.Reset();
sw.Start();
//Process2();
sw.Stop();
System.Console.WriteLine(sw.ElapsedMilliseconds);

sw.Reset();
sw.Start();
//Process3();
sw.Stop();
System.Console.WriteLine(sw.ElapsedMilliseconds);
}