Notice

YouTube.com/BESTTravelers - Visit and SUBSCRIBE to our travel related YouTube Channel named "BEST Travelers"

Monday, April 18, 2011

URL validation function or method using C#

Use following function to validate URL using C#.....

public static bool IsUrl(string Url)
{
    string strRegex = "^(https?://)"
            + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" //user@
            + @"(([0-9]{1,3}\.){3}[0-9]{1,3}" // IP- 199.194.52.184
            + "|" // allows either IP or domain
            + @"([0-9a-z_!~*'()-]+\.)*" // tertiary domain(s)- www.
            + @"([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\." // second level domain
            + "[a-z]{2,6})" // first level domain- .com or .museum
            + "(:[0-9]{1,4})?" // port number- :80
            + "((/?)|" // a slash isn't required if there is no file name
            + "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$";
   
    Regex re = new Regex(strRegex);
    if (re.IsMatch(Url))
        return (true);
    else
        return (false);
}

Email address validation function or method using C#

Use following function to validate your email address in C#.....

public static bool IsEmail(string EmailAddress)
{
    string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
        @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +
        @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$";
    Regex re = new Regex(strRegex);
    if (re.IsMatch(EmailAddress))
        return (true);
    else
        return (false);
}

Sunday, April 17, 2011

Find out the sum or average of top or bottom N numbers in Excel

In my Excel Worksheet, I have random number from cell A1 to A10. My requirement is to find out result of following queries in cell A11.
  1. To find the average of top 5 numbers, Excel formula of cell A11 will be =AVERAGE(LARGE(A1:A10,{1,2,3,4,5}))
  2. To find average of bottom 5 numbers , Excel formula of cell A11 =AVERAGE(SMALL(A1:A10,{1,2,3,4,5}))
  3. Excel formula of cell A11 for the sum of bottom 3 numbers will be =SUM(SMALL(A1:A10,{1,2,3}))
    Important Note:
    • AVERAGE is the function for finding average within a range as we all know.
    • LARGE is the function for finding TOP numbers with a range.
    • SMALL is the function for finding BOTTOM numbers with a range.
    • {1,2.3} means to find TOP or BOTTOM 3 numbers depending on the function you chose.
    • {1,2.3,4,5} means to find TOP or BOTTOM 5 numbers depending on the function you chose.

    Friday, April 15, 2011

    Easy way to download YouTube Videos

    YouTube is very popular website for watching online videos. We always want to download important videos. But download option is not available in the YouTube website.There are many YouTube download software's available in the internet. Here are some easy ways to download YouTube Video.

    Way-1:
    If you use Mozilla Firefox, then complete following steps to get download option in YouTube website,
    1. Browse https://addons.mozilla.org/en-US/firefox/addon/easy-youtube-video-downl-10137/
    2. Click "Add to FireFox"
    3. A window will open. Click "Install"
    4. Restart your Mozilla Firefox to after completing installation.
    5. Finish
    Way-2: 
    Besides there are some online websites where you can download YouTube videos directly. I think this is the easiest way.Those websites are,
    Note: I know most of the internet user knows about it. I have written for those users who don't know about it.  

    Thursday, April 14, 2011

    Still we have to learn lot to become human

    The name of these two girls is Shumi and Piya. Public has beaten them because of stealing food. Is this acceptable to beat someone for food? It is clearly seen that they street children. We could ignore it for such a silly mistake or we could make them understand about their mistake and can provide then some food. I know none start stealing at the beginning. Probably they have requested for food from many people before stealing. But people refuse to give some money and food. Thus they have stolen the food after lots of refusing.

    Still general public don't enough common sense or knowledge to handle such a situation proper way. I was wondering that there were not one people who can stand and speak on behalf of them. It is totally unacceptable.

    It is the duty of our government to take care of providing food to them on time. But we know the limitation of our government. So rich people should take initiative to help them. But they are busy for incoming more and don't have to time for all these. They are behaving like selfish. Moreover every Muslim should give Jakat. But true Muslims are not available enough and those who are true Muslim, they has not money enough. Whatever the problem is - This children needs food to live. So you don't give them food, then what will they do rather then stealing?


    Monday, April 11, 2011

    Is this you call it "Education"?

    I read following article today and felt very very bad. Please read this article and think - "Is this call it Education? Are they (Those teacher and friends mention in the following article) really educated people? Are they really a responsible teacher or doctor?"

    We should take extra care for this kind of people like Madhusudan. I could understand that his friend was immature and they were student also. But how can I ignore those teachers? They should have to be more responsible and caring. But they are immature also.

    An educated person is one who has learned that information almost always turns out to be at best incomplete and very often false, misleading, fictitious, mendacious - just dead wrong. Are they really educated? I don't think so. I call them uneducated among the educated people.
     

    "অনেক দুঃখ নিয়ে আমি চলে যাচ্ছি"

    বগুড়ার শহীদ জিয়াউর রহমান মেডিকেল কলেজের শিক্ষার্থী মধুসূদন চক্রবর্তী ২০১০ সালের ১১ ডিসেম্বর বিষপানে আত্মহত্যা করে। মৃত্যুর আগে লিখে যাওয়া চিঠিতে প্রমাণ মেলে, শিক্ষক ও সহপাঠীদের দ্বারা ক্রমশ হাসাহাসি ও তাচ্ছিল্যের পাত্র হয়ে উঠেছিল ছেলেটি। কারণ, মধুসূদন ছিল স্বল্পমাত্রার বাকপ্রতিবন্ধী। মৃত্যুর আগে বাবাকে লেখা তার কয়েকটি চিঠি এবং বিষয়টি নিয়ে মানবাধিকার সংগঠন ব্লাস্টের তদন্ত প্রতিবেদন নিয়ে এই আয়োজন। লিখেছেন তানজিম আল ইসলাম

    ‘বাবু, আমাকে আপনি ক্ষমা করে দেবেন। আমি আপনাদের সবাইকে খুব ভালোবাসি, কিন্তু অনেক দুঃখ নিয়ে আমি চলে যাচ্ছি। এ পড়ালেখা আমার দ্বারা হবে না। আজ স্যার যে অপমান করেছে, তা আমি কোনো দিন ভুলব না। বিদায় এ পৃথিবী।’ মধুসূদন চক্রবর্তীর লেখা শেষ চিরকুট। এ চিরকুটটি যখন লিখছিল মধুসূদন, তখন নিশ্চয় তার এই নিষ্ঠুর পৃথিবীর প্রতি ঘৃণার বাঁধ উপচে উঠেছিল। কতটা অসহ্য হলে জীবনের শেষ চিরকুটে ছেলেটি তার বাবাকে লেখে, ‘অনেক দুঃখ নিয়ে আমি চলে যাচ্ছি...।’ এ চিরকুটটি লেখার পরপরই নিজেকে নিজেই সরিয়ে নেয় এ পৃথিবীর নিষ্ঠুর মানুষগুলো থেকে। আত্মহনন করে তার অপমানের নীরব প্রতিবাদ জানায়। কী এমন অপরাধ করেছে ছেলেটি, কীসের এত দুঃখ মধুর? স্বল্পমাত্রার তোতলামি (বাকপ্রতিবন্ধী), কথা বলতে গিয়ে। এটুকুই। এ জন্য তাকে সইতে হয়েছে বঞ্চনা ও অপমান। ক্লাসের শিক্ষক আর সহপাঠীদের বঞ্চনা সইতে পারল আর কই। মধু যে অভিমানী ভীষণ...। ডাক্তারি পড়তে গিয়েছিল বগুড়ায় শহীদ জিয়াউর রহমান মেডিকেল কলেজে। মধু তার বাবাকে বাবু বলে ডাকত। তিনি নিজের একমাত্র ছেলেকে কত আশা নিয়ে ভর্তি করিয়ে এসেছিলেন স্বপ্নক্ষেত্রে। কিন্তু এ কোন স্বপ্নের বারতা পেতে হলো বাবুকে...?


    বাবুকে লেখা মধুর শেষ চিরকুটের অপর পৃষ্ঠায় লেখা, ‘আজকে স্যার বলেছেন, আমি নাকি “পারব না” এই কথাটি বলার জন্যই ক্লাসে যাই। অথচ আমি অনেকক্ষণ পড়ালেখা করি, তার পরও স্যারের মন খুশি করতে পারি না। একটা পরীক্ষাও আমি আমার মতো করে দিতে পারি না বাবা। আমি কালিদাসের মতো পণ্ডিত হতে চাই।’ হায়! মধুসূদনের আর কালিদাস হওয়া হলো না।

    মধুসূদনের বাড়ি চট্টগ্রামের মীরসরাইয়ে। এসএসসি ও এইচএসসিতে ভালো ফল করে ২০০৯ শিক্ষাবর্ষে মেডিকেল কলেজে ভর্তি হয়। কিন্তু শুরুর দিন থেকে তার তোতলামি আর কথা বলার জড়তার কারণে শিক্ষক আর সহপাঠীদের কাছে হাসি- তাচ্ছিল্যের পাত্র হয়ে ওঠে ক্রমশ। প্রথম বর্ষ কোনোভাবে কেটে যায় তার। দ্বিতীয় বর্ষ সবে শুরু হয়। কিন্তু বোঝে না মধুর কদর কেউই। শিক্ষকেরা বলেন, তোতলামি করলে চিকিৎসক হওয়া যাবে না। এ ডাক্তারি পড়া তার জন্য নয়...। মধু শুধু নীরবে সয়ে যায়। বিধাতার দেওয়া এ অভিশাপ সে ঘোচাবে কী করে...?

    মধুসূদন তার বাবাকে চিঠি দিত সব সময়। একটি চিঠিতে সে তার কষ্টের কথা জানায় বাবাকে এভাবেই, ‘আজ আমি যখন প্রথম ক্লাসে যাই, তখন স্যার জোরে নাম ঠিকানা বলতে বলে, তখন তোতলামির কারণে আমার যখন বলতে অসুবিধা হয়েছে, তখন ক্লাসের সব ছাত্রছাত্রী আমার দিকে তাকিয়ে তাচ্ছিল্য সহকারে সজোরে হেসে ছিল। একজন স্যার বলেছিলেন, তোতলামি রোগ আছে—এমন কোনো ছাত্র মেডিকেলে পড়তে পারে না। কারণ, এখানে প্রতিদিন ভাইবা নেওয়া হয়।...তিনি আরও বলেছেন, একজন চিকিৎসককে সর্বদা ভালো বক্তা হতে হয়, তা না হলে রোগীকে ভালোভাবে বোঝাতে পারে না।’

    এই চিঠিতে মাধ্যমিক ও উচ্চমাধ্যমিক পড়ার সময়েও তার মানসিকভাবে ভেঙে পড়ার কথা জানায় তার বাবাকে। চিঠিটির আরেকটি অংশে লেখা, ‘জীবনের এই পর্যায়ে এসে পেশাজীবী লেখাপড়া করতে গিয়ে যখন সমবয়সী বাকপটু ছাত্রছাত্রীদের অপমান সহ্য করতে হয়, যখন জানতে পারি, একজন চিকিৎসক হওয়ার জন্য পুরোপুরি অযোগ্য, তখন আর নিজেকে স্থির রাখতে পারি না। ভাবলাম, আপনাকে জানাব। কিন্তু আপনি যদি ভুল বুঝে দূরে ঠেলে দেন। কিন্তু অনেক চিন্তা করার পর বুঝলাম, আপনি তো বুদ্ধিমান, আপনি তো সব বোঝেন। আপনি এও বোঝেন, এতে আমার কোনো দোষ নেই—সবই বিধির বিধান।’

    চিঠিটির শেষ অংশে লেখা, ‘জানি না ভগবান আমার ভাগ্যে কী লিখেছেন, তবে এটুকু জানি যে কোনো না কোনোভাবেই আমি বিখ্যাত হব—এতে কোনো ভুল নেই...।’

    মধুসূদনের ভগবান তার ভাগ্যে কী এমন মরণই লিখে রেখেছিলেন? বিখ্যাত হওয়ার স্বপ্নটা আর পূরণ হলো না তার। মধুসূদন ২০১০ সালের ১১ ডিসেম্বর রাতে বগুড়া শহরের একটি হোটেলের কক্ষে বিষপান করে পরদিন মৃত্যুর কোলে সঁপে দেয় নিজেকে। এরপর তার চিরকুট থেকেই প্রমাণ মেলে আত্মহত্যার কারণ। মানবাধিকার সংগঠনগুলো সোচ্চার হয়। স্মারকলিপি পেশ করে শিক্ষামন্ত্রী, স্বরাষ্ট্রমন্ত্রী, সমাজকল্যাণমন্ত্রী, মানবাধিকার কমিশনের চেয়ারম্যান ও বগুড়ার জেলা প্রশাসকের কাছে। তারা দাবি করে, একজন বাকপ্রতিবন্ধী হিসেবে মধুসূদনের সুস্থ-স্বাভাবিকভাবে বেঁচে থাকা এবং চিকিৎসক হওয়ার অধিকার ছিল। কিন্তু সাড়া মেলেনি কারও কাছ থেকেই...। অবশেষে এ ঘটনার তদন্ত শুরু করে বেসরকারি সংস্থা বাংলাদেশ লিগ্যাল অ্যাইড অ্যান্ড সার্ভিসেস ট্রাস্ট (ব্লাস্ট)। সাত দিন আগে তারা তদন্ত প্রতিবেদনও সম্পন্ন করেছে।

    ফোনে কথা হয় মধুসূদনের বাবা শংকর চক্রবর্তীর সঙ্গে। ফোনে পরিচয় দেওয়ার পরপরই কান্নায় ভেঙে পড়েন শংকর। বলেন, ‘বুকে পাথর বেঁধে আছি। ওর মা তো পাগলপ্রায়। আমার একমাত্র সোনার টুকরা ছেলেটাকে কেড়ে নিল ওরা। এর বিচার চাই। আমার ছেলে একটু তোতলামি করত, এটা কি তার অপরাধ ছিল? ওরে সবাই মিলে প্রতিবন্ধী বলে খ্যাপাত।’

    বললাম, আপনার ছেলে তো আপনাকে আগেই জানিয়েছিল সব কথা। তখন কি কোনো প্রতিকার চেয়েছিলেন কলেজে?

    ‘আমি একবার গিয়েছিলাম। অধ্যক্ষের সঙ্গে দেখাও করেছিলাম। কিন্তু কেউ এ বিষয়টি গুরুত্ব দেয়নি। আমার ছেলেটা কত লক্ষ্মী। কোন শিক্ষক তাকে অপমান করেছে, এটি সে বলেও যায়নি শিক্ষকের অপমান হবে বলে। তবুও মরে গিয়ে ওদের লজ্জা দিল। কী জানি লজ্জা হবে কি না! শিক্ষকের একটি নির্দয় আচরণ যে একটা ভবিষ্যৎকে ছিনিয়ে নিতে পারে, আমার মধুই তা দেখিয়ে গেল। আমার ছেলেকে নিয়ে অনেকেই কুৎসা ছড়াচ্ছে। ওর ছবিটা দেখে বলেন তো ওকে কি নিষ্পাপ মনে হয় না? আমার লক্ষ্মী ছেলেটা একটি গেঞ্জি কেনার জন্য হলেও আমাকে নিয়ে যেত। এ ছেলেকে বড় ডাক্তার বানাব বলে বসতভিটা বিক্রি করেছি। তবুও ছেলেটি আমার ডাক্তার হবে। কিন্তু...।’ এই বলে অঝোরে কাঁদতে লাগলেন মধুর বাবা। কান্নার শব্দে কথাগুলো অস্পষ্ট হয়ে যাচ্ছিল বারবার। আমি তাঁকে সান্ত্বনা দিয়ে বিদায় নিই। জানি, ছেলেহারা বাবার আর্তনাদ বেশিক্ষণ শোনার শক্তি হয়তো কারও নেই।

    ব্লাস্টের তদন্ত প্রতিবেদন সম্পর্কে জানতে কথা বলি সারা হোসেনের সঙ্গে। সারা হোসেন জানান, শিক্ষক বা সহপাঠীরা কেউই কোনো কথা বলছেন না কারও সঙ্গে। এ থেকে ফৌজদারি অভিযোগ কারও বিরুদ্ধে আনা অনেক কঠিন হয়ে যাবে। তাহলে এ বিষয়টির কি কোনো প্রতিকার হবে না? এ প্রশ্নের জবাবে সারা হোসেন বলেন, ‘আমরা উচ্চ আদালতে নির্দেশনার জন্য যাব। কারণ, মধুসূদনের মতো অসংখ্য শিক্ষার্থী রয়েছে, যারা নীরবে এমন অত্যাচার-অপমান সহ্য করে যাচ্ছে। আমাদের কাছে আরও কয়েকটি অভিযোগ এসেছে। আমরা এ ঘটনাটি উচ্চ আদালতের নজরে এনে রিট দায়েরের প্রস্তুতি নিচ্ছি। আমরা চাই, প্রতিবন্ধী শিক্ষার্থীদের সঙ্গে কীভাবে শিক্ষক ও সহপাঠীরা আচরণ করবে, এ জন্য একটি নির্দিষ্ট আচরণবিধি প্রণয়ন হোক। যৌন নির্যাতন দমন নীতিমালা কিংবা শিশু শিক্ষার্থীদের ওপর নির্যাতন বন্ধের নীতিমালা প্রণয়নের কথা হাইকোর্ট থেকে এসেছে। এমন একটি নীতিমালা প্রতিবন্ধী শিক্ষার্থীদের জন্যও হতে পারে। এতে করে আর কোনো মধুসূদনকে অপমান সইতে না পেরে আত্মহননের পথ বেছে নিতে হবে না।’

    কথা বলি শহীদ জিয়াউর রহমান মেডিকেল কলেজের অধ্যক্ষ মাহবুবুল করিমের সঙ্গে। তিনি বলেন, ‘ছেলেটির সম্পর্কে আসলে কেউ কিছু জানত না। এ বিষয়ে কে জড়িত, কারা জড়িত, এটা বলা মুশকিল। তবে আর কোনো শিক্ষক দ্বারা যেন কেউ অপমানিত না হয়, এ বিষয়ে সবাইকে সতর্ক করে দিয়েছি।’

    মধুসূদন একা থাকতে পারত না। সব সময় অস্থির হয়ে থাকত, কখন ছুটি হবে। কখন তার প্রিয় বাবু আর মায়ের কোলে ছুটে যাবে। বাবাকে লেখা আরেকটি চিঠিতে এর প্রমাণ মেলে, ‘এরপর যখন বাড়ি থেকে আসি, তখন জানতে পারলাম, সামনে অনেক দিন আর ছুটি পাব না। কী করে থাকব এখানে, কীভাবে পড়ালেখা করব, সেটাই শুধু মাথার ভেতর ঘুরতে লাগল।...যখন নিজের মনকে স্থির করলাম, ঠিক তখন বাস্তবতা বলছে, এটা আমার পক্ষে সম্ভব হবে না। আমি কখনোই ৮-১০ দিনের বেশি হয়তো থাকতে পারব না। তখন আমার মনে হলো, আমরা তো গরিব। বেশি বাড়ি গেলে তো টাকা খরচ হবে...।...তারপর ভগবানের ওপর প্রচণ্ড রাগ হতে লাগল। হে ভগবান, আমার বাবা তোমার কত সেবা করে, আমি কতবার তোমায় আকুলভাবে ডেকেছি। তুমি জান আমার মনের অবস্থা। তার পরও তুমি কেন আমাকে এখানে পাঠালে...।’

    মধুসূদনের মনের অবস্থা ভগবান হয়তো বুঝতে পেরেছিলেন, কিন্তু নিষ্ঠুর মানুষগুলো তো আর বুঝতে পারল না। আর কোনো মধুসূদনের মতো মানুষ যেন অন্য মানুষদের উপহাসের বস্তু না হয়ে ওঠে।

    Source: http://www.prothom-alo.com/detail/date/2011-04-10/news/145472

    Saturday, April 9, 2011

    IT people are those who has IT knowledge

    There are some people who think that IT people are those who have IT degree. But this is a wrong conception. IT people are those who have knowledge of IT (Information Technology). Anyone can be IT people if they have sufficient IT knowledge.

    I have completed my CSE (Computer Science & Engineering), but I have no business or marketing relevant degree. But I have learned business and marketing from real life during working in my previous companies. I have real life experiences in business and marketing. I know accounting also. Because I have developed accounting software. So it's important to continue learn from different area depend on our need. So non-IT degree holder can call himself or herself as IT person also if he/she has sufficient knowledge.But make sure that you have enough knowledge to express yourself. I have also seen some people who think themselves as Web Developer by knowing basic HTML only. But to develop a professional website, you have to know HTML, database, JavaScript, PHP/ASP.NET and many relevant tools. So check yourself properly before telling yourself as IT person.

    Please see the following person. He is an IT person. I am joking. Don't take this line seriously. 


    Friday, April 8, 2011

    "Sir, you are irreplaceable." ~ A quote of my student

    "Sir, you are irreplaceable." - This was a quote from one of my student. This quote was from bottom of his heart. Thus I have liked this quote and felt honored also.

    I have not completed one year as lecturer yet. But I am receiving many inspiring and lovely quotes from my students. On the other hand, top management is also happy about me because of getting positive feedback about my class from my students. So I am feeling good as new lecturer.

    Green Technology is the solution of our natural problems

    Green Technology is a technology where it discusses about the way of using natural resources and environment in a proper way.

    In Bangladesh, we have to work more on Green Technology. Because now we are facing serious problem because of air pollution, water pollution, soil contamination and noise pollution.

    The Buriganga River is the great example of water pollution. If we fail to save our buriganga river from pollution, then Dhaka WASA will be able to supply water in near future. Because now Dhaka WASA is supplying pure water from more deep level of the Buriganga River which level is last margin of getting pure water. We will face serious problem if we don't take any effective steps. Like this, we are facing similar problem because of other type of pollution as well.

    We should study Green Technology and have to find a proper solution to solve all natural problems. Institute of Appropriate Technology (IAT), Bangladesh University of Engineering and Technology (BUET) and Institute of Water Modeling (IWM) is working on this area. But we are not watching any improvement. There could be many valid reasons behind this non-improvement. But we have to overcome all the problems and have to decrease the rate of pollutions.

    =======================================================================
    Comment from my one of friend was - "all the people can save our nature not technology"

    My Answer was - "You are partially right. Yes, involvement of all people is required. Now you think - Dhaka WASA is supplying pure water from more deep level of the Buriganga River which level is last margin of getting pure water. So IWM have to come out with a good technique to avoid upcoming danger. Now please you say – what will general people do here? So people are always important. But we need some people who can think more deeply. That's why technology is required.

    Technology will always help you to make your life easy. So don’t hate technology. :-) "

    Tuesday, April 5, 2011

    "BEST." - Was a user of orkut.com

    The name of my first used social networking site was orkut.com where my name was BEST. I have used that account from 2005 to 2009.But orkut.com has lost it's popularity after Facebook. Everyone use Facebook now-a-days. So I don't have any friend there. But still I miss orkut.com.

    "I am the BEST or
    I want to be the BEST or
    I will be the BEST.
    Here the main point is the BEST.

    I am the star of the sky,
    You can see me,
    But impossible to touch........."

    This was my description in orkut.com and was my favorite quote also.