Tuesday, December 23, 2008

Compare mobile phone Cap Plans

found this tool very useful
http://www.mobchoice.com.au/compare-cap-plans-spreadsheet

Wednesday, December 10, 2008

string.format new line partially works (C#, ASP.NET)

see below my code. every "\n" works fine except the ones after "Event: {0}" and "Start Date: {1:D}", basically the Event, Start Date and End Date are printed on same line. can anyone help please? thanks in advance.

string.Format(



"Schedule Details: \n" +

"Event: {0}\n"+


"Start Date: {1:D} \n" +

"End Date: {2:D} \n" +

"Location: {3} \n"


,schedule.event,
schedule.startDate,
schedule.endDate,
schedule.location);

I tried ""Event: {0}"+ Environment.NewLine" and "Event: {0}\r" and "Event: {0}/r/n" got the same result
==============

Schedule Details:

Event: Basketball Match Start Date: Friday, 1 May 2009 End Date: Tuesday, 30 June 2009

Location: Como
================

Then I tried "Event: {0}\n"+ Environment.NewLine" and "Event: {0}\r"+ Environment.NewLine" and "Event: {0}/n/r" got this result (an additional line)
==============


Schedule Details:

Event: Basketball Match

Start Date: Friday, 1 May 2009 End Date: Tuesday, 30 June 2009

Location: Como
================

It seems that it works either for no newline or 2 new lines, but not for 1 newline. I tried to take out "Event" everything else worked just fine, so the problem must be with "Event"?

The Event has datatype of "string", startDate and endDate are datetime, location is string. A sample of Event value is "Attend Class Certificate III in Basketball".

Eventually the problem is solved, not sure why though.....:

I put single quotes around the Event value, not sure how exactly but it worked.
"Event: '{0}'\n"+

Tuesday, August 05, 2008

select checkboxlist based on to database data

foreach(datarow in the query result)
{

ListItem currentCheckBox = CheckBoxListABC.Items.FindByValue(datarow ["TheFieldName"].ToString());
if (currentCheckBox != null)
{
currentCheckBox.Selected = true;
}
}

Monday, August 04, 2008

ASP.NET C# capitalize the first letter of a string

using System.Globalization;
..
..
..
..
..
string ManipulatedString= CultureInfo.CurrentCulture.TextInfo.ToTitleCase("OriginalString");

Saturday, August 02, 2008

"postback" event not related to REVIOUS and NEXT button on Internet Explorer?

in my case PageA has a buttonA that opens PageB. The code is "response.redirect("PageB.aspx");"

on PageB I have some methodM to call under condition "if (!IsPostBack)"

After I clicked on ButtoA to open PageB, methodM is trigerred.

but when I use the PREVIOUS button on Internet Explore to go back to PageA and click on NEXT button to go back to PageB the methodM didn't fire.

How can I catch the Previous and Next button click event?

the answer is adding the code below into Page_Load in the target page, this line of code will force the target page to load from server instead of cache

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Wednesday, July 30, 2008

a helpful tutorial for Creating a Data Access Layer in VS2005 Express

http://www.asp.net/learn/data-access/tutorial-01-cs.aspx

How to retrieve visitor's IP in C# ASP.NET 2.0

string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
return clientIPAddress;

Friday, July 25, 2008

MSSQL LIKE operator work with parameter values

without parameter: LIKE '%abc%'
with parameter: LIKE '%'+@searchString+'%'

Tuesday, June 17, 2008

useful stuff to solve visual studio 2008 slowness

found these links quite useful:
http://blogs.msdn.com/webdevtools/archive/2008/02/09/downloadable-hotfix-performance-and-editor-fixes-for-microsoft-visual-studio-2008-and-visual-web-developer-express-2008.aspx

https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826

Tomorrow's CIO: Are You Ready Today?

found this tool on InformationWeek very interesting:
http://www.informationweek.com/news/management/interviews/showArticle.jhtml?articleID=208403497#sg_wrapper

Monday, June 09, 2008

Cannot open .zip file in WSS 3.0

found solution for this problem on Microsoft
http://support.microsoft.com/kb/841120

Thursday, June 05, 2008

WSS 3.0 Search Service on SBS

You need to install and start Windows Indexing service, start SharePoint Search Service, and Change the Identity of the SP website in IIS-->Application Pools-->Properties from Network User to Local System User

Monday, May 26, 2008

project management - agile

project management - agile
In order to be agile everyone in the team must be proficient.

Thursday, May 22, 2008

ASP.NET DataBinding Eval V.S. Bind

Eval is used for one way data presentation whereas Bind is used to push data back to the database. Some detailed explanation:

http://www.15seconds.com/issue/040630.htm

Wednesday, May 14, 2008

Agile Project Management with Scrum

found this about Scrum, very helpful

http://agilescrum.tar.hu/agile_scrum_0035.html

Monday, May 12, 2008

"check-in pending" problem opening enterprise project within MS Project 2007

work around:
1. delete cache OR
2. when close the project, don't just click on "x", instead go File - Close

Friday, May 09, 2008

Available fields in Microsoft Office Project 2007

Available fields in Microsoft Office Project 2007
http://office.microsoft.com/en-us/project/HA102369301033.aspx?pid=CH100788901033

Thursday, May 08, 2008

what is Queue in MSPS 2007

Microsoft Office Project Server 2007 Queuing System

http://technet.microsoft.com/en-us/library/cc197395.aspx

Wednesday, May 07, 2008

what is resource units in Microsoft Office Project 2007

Sometimes it takes one resource to complete a task, but other times you need more. Sometimes a resource can only work part time. To account for these differences, Microsoft Office Project 2007 uses units (units: The quantity of a resource assigned to a task. The maximum units is the maximum number of units available for the resource. For example, if you have three plumbers, the maximum units is 300 percent or three plumbers working full-time.) to calculate the exact amount of time resources can work on a task............
Details: http://office.microsoft.com/en-us/project/HA102548291033.aspx

Configuring Linked Servers SQL Server 7 and 2000

found this post very helpful
http://www.informit.com/articles/article.aspx?p=21644

Tuesday, May 06, 2008

Endnote x1 with WORD 2007 slows down Windows Vista x64

found a workaround for this issue
http://www.endnote.com/envista.asp

Tuesday, April 22, 2008

Walkthrough: Validating User Input in a Web Forms Page

found this article on MSDN very helpful
http://msdn2.microsoft.com/en-us/library/a0z2h4sw(VS.80).aspx
Visual Studio 2005, c#, web form, validator control

Wednesday, April 16, 2008

translate 'In' operator in SQL to LINQ

Just found out there is no 'In' in LINQ, instead there is an ANY in LINQ:
e.g.
var abc=
from d in mydb.department
where mydb.employee.Any(e => e.ProductID == d.ManagerId)
select d;

Tuesday, April 15, 2008

OUTKAST - PROTOTYPE



[Intro]
I hope that you're the one
If not, you are the prototype
We'll tiptoe to the sun
And do thangs I know you like

[Hook]
I think I'm in love again [repeat]

[Verse 1]
Today must be my lucky day
Baby, you are the prototype
Do sumn' outta the ordinary
Like catch a manitee
Baby you are the prototype
I think I'm..

[Hook]

[Verse 2]
If we happen to part
Lord knows I don't want that
But hey, we can't be mad at God
We met today for a reason
I think I'm on the right track now

[Hook]

The Scene
Come here

[Hook]

[Outro (ad libs)]
Girl, right now I wanna say, I wanna say
I wanna say stank you very much
For picking me up
And bringing me back to this world
I can't, I'm not
I can't afford to not record
I thank I wanna say
I thank I wanna say stank you, stank you
Smelly much!
For picking me up and bringing me back to this world
Hey, hey John! Are we recording our ad libs?
Really?? Were we recording just then?
Let me hear that, that first one
When I first started

Tuesday, April 01, 2008

不归路


歌曲:不归路

歌手:迪克牛仔

专辑:忘记我还是忘记他

词∶许常德 曲∶林进璋


我没有退路

尽管你也千辛万苦

不愿认输

是良心让爱坚固

剩下由老天做主

爱你是一条不归路

一度我非常孤独

但是我更怕漂浮

不知道身在何处

有时候绝路也是人生一条路

爱让人全意付出忘记有结束

一心只想你幸福

疏忽了自己痛苦

我没有退路

尽管你也千辛万苦

不愿认输

是良心让爱坚固

剩下由老天做主

有時候错误也是人生一条路

谁不是跌到谷底才有点觉悟

只要你不想退出

我不怕命运残酷

我没有退路

尽管你也千辛万苦

不愿认输

是良心让爱坚固

剩下由老天做主

我没有退路

尽管我也千辛万苦也不愿认输

是良心让爱坚固

老天做主

Monday, March 17, 2008

美丽的神话-成龙,金喜善

解开我 最神秘的等待 星星坠落 风在吹动
终于再将你拥入怀中 两颗心颤抖
相信我 不变的真心 千年等待 有我承诺
无论经过多少的寒冬 我绝不放手

이젠 나의 손을 잡고 눈을 감아요 yi jie na ye so nul qia go,nu nul ka ma yo.
(现在紧抓住我的手闭上眼睛)
우리 사랑했던 날들 생각해봐요 u li sa la hei dang nal dul,sei ga ke ba yo.
(请你回想起过去我们恋爱的日子)
우리 너무 사랑해서 아팠었네요 u li no mu sa la hei so,ha pa so ne yo.
(我们是因为太爱所以更使得我们痛苦)
서로 사랑한단 말도 못했었네요 so lo sa la ha dan mal do,mo tei so ne yo.
(我们连"爱你"这句话都无法讲)

每一夜 被心痛穿越 思念永没有终点
早习惯了孤独相随 我微笑面对
相信我 已选择等待 再多苦痛也不闪躲
只有你的温柔能解救 无边的冷漠

이젠 나의 손을 잡고 눈을 감아요 yi jie na ye so nul qia go,nu nul ka ma yo.
(现在紧抓住我的手闭上眼睛)
우리 사랑했던 날들 생각해봐요 u li sa la hei dang nal dul,sei ga ke ba yo.
(请你回想起过去我们恋爱的日子)
우리 너무 사랑해서 아팠었네요 u li no mu sa la hei so,ha pa so ne yo.
(我们是因为太爱所以更使得我们痛苦)
서로 사랑한단 말도 못했었네요 so lo sa la ha dan mal do,mo tei so ne yo.
(我们连"爱你"这句话都无法讲)

让爱成为你我心中 那永远盛开的花
穿越时空绝不低头 永不放弃的梦
우리 너무 사랑해서 아팠었네요 u li no mu sa la hei so,ha pa so ne yo.
(我们是因为太爱所以更使得我们痛苦)
서로 사랑한단 말도 못했었네요 so lo sa la ha dan mal do,mo tei so ne yo.
(我们连"爱你"这句话都无法讲)

让爱成为你我心中 那永远盛开的花
우리 소중했던 약속 잊지는 말아요 u li so ju hei dang ya kso,yi ji ni ma la yo.
(我们千万不要忘记我们的约定)
唯有真爱追随你我 穿越无尽时空
서로 사랑한단 말도 못했었네요 so lo sa la ha dan mal do,mo tei so ne yo.
(我们连"爱你"这句话都无法讲)
爱是心中唯一不变美丽的神话

美丽的神话-孙楠,韩虹

梦中的人熟悉的脸孔
你是我守候的温柔
就算泪水淹没天地
我不会放手,每一刻孤独的承受
只因我曾许下承诺
你我之间熟悉的感动
爱就要苏醒
万世沧桑唯有爱是永远的神话
潮起潮落始终不悔真爱的相约
几番若痛的纠缠多少黑夜掐扎
紧握双手让我和你再也不离分
枕上雪冰封的爱恋
真心相摇篮才能融解
风中摇曳炉上的火
不灭亦不休
等待花开春去春又来
无情岁月笑我痴狂
心如钢铁任世界荒芜
思念永相随
悲欢负月唯有爱是永远的神话
谁都没有遗忘古老,古老的誓言
你的泪水化为漫天飞舞的彩蝶
爱是翼下之风两心相随自在飞
你就是我心中唯一美丽的神话

爱情诺曼底

六月六日六时六分刚过六十秒
脆弱的堡垒远眺如风化的沙雕
轻抚着断裂的皱纹沧桑一条条
谁的心早已死掉
曾和你相爱如天命难违的凑巧
为何与你对决变成轮回的纷扰
爱如那常消的海潮退去时飘渺
我的心不再计较
情爱它似毒药 你我早就应该知道
为何却不停的要
为何却一再的要
我怎么才能登上你的爱情诺曼底
别让天与海的距离 衡量爱与恨的对立
怎么才能让我登上你的爱情诺曼底
狂奔在破晓的大地 拼了命也要找到你
占领这爱情诺曼底 Yeah

Thursday, March 13, 2008

挑衅

我的梦早已归零 我的爱结成冰

退色的刺青 残留的姓名 那是我的曾经

别为我动了真情 别怪我那么ㄍㄧㄥ

孤独的背影 落寞的神情 经不起你的挑衅

不要闯进我冰冷的爱情 我怕沉睡的梦被你惊醒

无论束手就擒 或是抵挡你的入侵 都会让我 摇摆不定 触景伤情

你的梦如此清醒 你的爱太冷静

催泪的叮咛 温柔的神情 却又让我动心

别让我掉入陷阱 别恨我不敢听

固执的个性 坚定的表情 经不起你的挑衅

不要闯进我冰冷的爱情 我怕沉睡的梦被你惊醒

无论束手就擒 或是抵挡你的入侵 对我来说 都是挑衅

不要挑衅我冰冷的爱情 我怕醒来会爱你爱不停

请你别再靠近 不要让我恨不下心

现在的我 经不起你 一再挑衅

Friday, February 29, 2008

check all or none items in checkedlistbox

if (clientList.CheckedItems.Count == 0)
for (int i = 0; i < clientList.Items.Count; i++)
{
clientList.SetItemChecked(i, true);
}
else
for (int i = 0; i < clientList.Items.Count; i++)
{
clientList.SetItemChecked(i, false);
}

Visual Studio 2008 checkedlistbox

figured this way to databind checkedlistbox, not sure why DataSourse, ValueMember, and DisplayMember do not appear in intellisense

this.clientsTableAdapter.Fill(this.dataSet1.Clients);
practice2.DataSet1.ClientsDataTable t = clientsTableAdapter.GetData();
checkedListBox1.DataSource = t;
checkedListBox1.ValueMember = t.IdColumn.ColumnName;
checkedListBox1.DisplayMember = t.NameColumn.ColumnName;

Monday, February 25, 2008

detect if ActiveX is disabled

found this two links quite useful

tect the browser using ASP.NET and C#
http://www.codeproject.com/KB/aspnet/detectbrowser.aspx

How Can I Tell if ActiveX is Enabled in Internet Explorer?
http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov05/hey1114.mspx

Thursday, February 14, 2008

Wednesday, February 06, 2008

HAPPY CHINESE NEW YEAR TO YOU ALL!!!!!!




























五谷丰登 六畜兴旺 吉庆有余
惠风和畅 发家致富 日度小康
鼠年大吉 万事遂心 利国利民
一往无前 四海皆春 普天同庆

人逢盛世情无限;鼠拱华门岁有余

吉日生财鼠拱户;新春纳福鹊登梅

名题雁塔登金榜;鼠拱华门报吉祥

戌年引导小康路;亥岁迎来锦绣春

孟春之月方营室;宝盖进豕恰是家

国泰民安戌岁乐;粮丰财茂亥春兴

金榜题名光耀第;喜鼠拱户院生财

猪守家门旧主喜;鼠增财富新春欢

猪岁已赢十段锦;鼠年更上一层楼

猪年已展千重锦;鼠岁再登百步楼

猪问平安随腊去;鼠生财富报春来