瀏覽人數

            カウンター

2013年1月30日 星期三

對事不對人


對事:對事件的選擇(正確與否)和處理方式(解決問題的適合方法)
對人:對(人格、個性等層面)等的攻擊方式(包括:攻擊人格性語言、強勢的語調甚至憤怒表情等)

所以說:對事不對人,就是目的放在雙方​​促進事情有效進展過程,同時注意自己的情緒,
而不把對方的否定意見引申到人格人性等層面的方式。

2013年1月28日 星期一

腦內啡=快樂


什麼樣的情形下,你會感到快樂?是當獲得別人的讚美時、被情人擁抱時還是中了樂透的時候?
不論是何種情形,當我們感受到快樂時,大腦會分泌一些和情緒相關的化學物質來傳遞「快樂的訊息」,這些化學物質叫做神經傳導物質(
neurotransmitters
),神經傳導物質像情報員一樣會把一些簡單的訊息傳至腦中及身體各部位,身體一接收到指令,就會依令行事。

目前科學家已經確認有
100種以上的神經傳導物質,其中和情緒相關並且較常為人所討論的則是腦內啡(endorphine)及血清素(serotonin
)。
腦內啡是會使人產生幸福及愉悅感的「快樂嗎啡」,而血清素是腦部主要的「滿意」化學物質,如果含量不足,人們就會不斷抱怨,情緒低落。著名的抗憂鬱藥物「百憂解」,就是利用增加血清素的含量,來幫助憂鬱症患者提升快樂感。
當一個人感到快樂時,腦內啡的分泌不僅能夠減少疼痛,免疫功能也會適時的得到調節,對身理或心理都有良好的影響。快樂和腦內啡之間的關連,跟雞生蛋還是蛋生雞的道理一樣。

因為寫稿的關係,查了一些有關腦內啡的資料。
於是那一整天,我就陷入腦內啡的漩渦中……

場景:五點過後的辦公室
狀態:下班後、加班中……為了放鬆心情而在閒聊的三個人
話題進行著……

seven:「你們知道嗎?運動會分泌腦內啡,然後就會產生愉悅耶~」立即做起體操。
看到同事在吃餅乾,我又緊接著說:「吃東西也會產生腦內啡耶!尤其是吃巧克力這種甜食……」
「對了!聽音樂也會分泌腦內啡唷~」我內心不由自主的哼起歌來!

我沒什麼注意話題進行到哪?一昧的幻想腦子正在分泌腦內啡的快感……
「還有還有…冥想、按摩、體操、跳舞、喝綠茶、吃大豆製品都會分泌腦內啡喔~」我的心裡正陶醉的一一細數。

回家後,心情非常的愉悅,我相信我的腦內啡分泌得很順暢,感覺我的皮膚都要水噹噹了!
「勳!你知道腦內啡嗎?」
「知道啊!」
「腦內啡會讓人快樂,就像打了嗎啡一樣喔!而且腦內啡還會增加免疫功能,讓身體好呢!」完全是把在公司說的那套再搬回家說一遍!
「我知道啊!」勳依舊神色自若,對我的大驚小怪習以為常。
「而且你知道嗎?談戀愛~」我聲音高揚,企圖吊勳的胃口。
「也會分泌腦內啡喔~呵呵!」我邊傻笑邊花痴的靠在勳的肩膀上,腦內啡已經快要爆表了!


2012年10月15日 星期一

2010 Outlook學習

(1) 第一步,點選檔案,點選帳戶設定










(2)第二步,Highlight預設使用帳戶傳送 ,點選變更








 (3)帳戶設定,點選其他設定





(4)外寄伺服器:確認是否外寄伺服器有勾選,也使用與內送一樣的設定

                                   
                               
                                   設定簽名檔: 按下新增郵件後,在選單中點選郵件,出現簽章




2012年8月29日 星期三

string .join


                    DateTime dt = Convert.ToDateTime(Model.xx);
                    string format = "yyyy/MM/dd";
                    string bb= "(" + dt.ToString(format) + ")";
                    string[] cc= {aa, bb};
                    string newJoin = string.Join("", cc);
                 

2012年8月28日 星期二

string convert to DateTime C# 兩種做法


string xx= Model.xx;
DateTime dt = Convert.ToDateTime(xx);
     
string format = "yyyy/MM/dd";
(<%=dt.ToString(format)%>)

FundSizeDate = string.Format("{0}/{1}/{2}", dt.Year, dt.Month, dt.Day);
(<%=String.Format("{0:yyyy/MM/dd}", xx)%>

2012年8月20日 星期一

亂數不重複加排序


 <%
     ArrayList myArray = new ArrayList();
     int number;
     System.Random num = new Random();
     for (int i = 0; i < 30; i++)
     {
         do
         {
             number = num.Next(1, 50);
         } while (myArray.IndexOf(number.ToString()) != -1);
         myArray.Add(number.ToString());
     }
     var sortedmyArray = myArray.Cast<string>().OrderBy(item => int.Parse(item));
     foreach (var a in  sortedmyArray)
     {
         Response.Write("<LI>" + a);
     }
%>

2012年8月16日 星期四

C# Server驗證~!!


public class ServerValidation
    {
        public struct RegularExp
        {
            public const string Chinese = @"^[^\u4E00-\u9FA5]$";
            public const string Chinese1 = @"^[\u4E00-\u9FA5\uF900-\uFA2D]+$";
            public const string Color = "^#[a-fA-F0-9]{6}";
            public const string Date = @"^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$";
            public const string DateTime = @"^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-)) (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$";
            public const string Email = @"^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$";
            public const string Float = @"^(-?\d+)(\.\d+)?$";
            public const string ImageFormat = @"\.(?i:jpg|bmp|gif|ico|pcx|jpeg|tif|png|raw|tga)$";
            public const string Integer = @"^-?\d+$";
            public const string IP = @"^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$";
            public const string Letter = "^[A-Za-z]+$";
            public const string LowerLetter = "^[a-z]+$";
            public const string MinusFloat = @"^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$";
            public const string MinusInteger = "^-[0-9]*[1-9][0-9]*$";
            public const string Mobile = "^0{0,1}13[0-9]{9}$";
            public const string NumbericOrLetterOrChinese = @"^[A-Za-z0-9\u4E00-\u9FA5\uF900-\uFA2D]+$";
            public const string Numeric = "^[0-9]+$";
            public const string NumericOrLetter = "^[A-Za-z0-9]+$";
            public const string NumericOrLetterOrUnderline = @"^\w+$";
            public const string PlusFloat = @"^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$";
            public const string PlusInteger = "^[0-9]*[1-9][0-9]*$";
            public const string Telephone = @"(\d+-)?(\d{4}-?\d{7}|\d{3}-?\d{8}|^\d{7,8})(-\d+)?";
            public const string UnMinusFloat = @"^\d+(\.\d+)?$";
            public const string UnMinusInteger = @"\d+$";
            public const string UnPlusFloat = @"^((-\d+(\.\d+)?)|(0+(\.0+)?))$";
            public const string UnPlusInteger = @"^((-\d+)|(0+))$";
            public const string UpperLetter = "^[A-Z]+$";
            public const string Url = @"^http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?$";
            public const string Guid = @"^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$";
        }
           
        private static Regex isGuid = new Regex(RegularExp.Guid, RegexOptions.Compiled);
        private static Regex isChinese = new Regex(RegularExp.Chinese, RegexOptions.Compiled);
        private static Regex isMobile = new Regex(RegularExp.Mobile, RegexOptions.Compiled);

        public bool IsGuidValid(string candidate, out Guid marketcontent)
            {
                marketcontent = Guid.Empty;    
                try
                {
                        if (isGuid.IsMatch(candidate))
                        {
                            marketcontent = new Guid(candidate);
                            return true;
                        }
                        return false;
                }
                catch(ArgumentException)
                {
                        return false;
                }
            }

        public bool IsChineseValid(string chinese)
        {      
            try
            {
                    if(isChinese.IsMatch(chinese))
                    return true;
       
                    return false;
            }
            catch(FormatException)
            {
                    return false;
            }
        }

        public bool IsMobileValid(string number)
        {
            try
            {
                if(isMobile.IsMatch(number))
                return true;

                return false;
            }
            catch (FormatException)
            {
                return false;
            }
        }

        public bool IsEmailValid(string emailaddress)
        {
            try
            {
                MailAddress m = new MailAddress(emailaddress);
                return true;
            }
            catch (FormatException)
            {
                return false;
            }
        }
    }