Notice

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

Thursday, June 30, 2011

Quote's of Engr. Md.Asfak-Ur-Rahman

"Now-a-days all the people of the world has their own story, understanding, logic and facts .One can say 2+2=4 and other can say 2+2=5. Now it's up to you, which one will you believe or not? It's totally up to you. If you have education, then you will believe in 2+2=4. If you have no education, then you will beleive in what other says or what you want to believe in." ~ Engr. Md.Asfak-Ur-Rahman [Nov 05,2011 2:30pm]

"You are the best judge to judge yourself" ~ Engr. Md.Asfak-Ur-Rahman [Oct 06,2011 12:25am]

"Your life will be very beautiful and peaceful if your offer SALAH regularly" ~ Engr. Md.Asfak-Ur-Rahman [Oct 01,2011 05:03pm]

"This life has made my life so mysterious that now I love make my life more mysterious than it can be..." ~ Engr. Md.Asfak-Ur-Rahman [June 30,2011 09:41pm]

"My mask has become my face now that I wore it for you once." ~ Engr. Md.Asfak-Ur-Rahman [June 30,2011 09:35pm]

"Sleeping is important to make yourself ready for next working day as well as losing sometimes important to become winner next time. What you need to learn from past, go for your goal, try your best and rest Allah knows." ~ Engr. Md.Asfak-Ur-Rahman [June 27,2011 09:58pm]

"Love has many similar definition. Feeling to your mom, dad and husband is called love. But love differ depend on the relation with the person.Both Love and hate is necessary for our life. Because human use to be loved and human cant live without hating someone also.We, human are use to get love from after first day of life. So love is as important for us as we need breath to live" ~ Engr. Md.Asfak-Ur-Rahman [June 19,2011 11:53pm]

"Losing myself is important for discover myself in a new way....This is my point of view. You may differ.But I like to take everything positively" ~ Engr. Md.Asfak-Ur-Rahman [June 17,2011 09:57pm]

"Situation makes human brave and afraid. So don't focus on it always. But learn and analyze for next time.." ~ Engr. Md.Asfak-Ur-Rahman [June 11 10:42pm]

Monday, June 27, 2011

Decorator Design Pattern example using PHP

Decorator Design Pattern is a structural Pattern and also known as wrapper. The Decorator Pattern is used for adding additional functionality to a particular object during run-time. It is easy to add functionality to an entire class of objects by sub-classing an object during design time, but it adds extra codes as overhead.

With the Decorator Pattern, you can add functionality to a single object and leave others like it unmodified. Building all your functionality into an inheritance structure can result in an explosion of classes in a system. Even worse, as you try to apply similar modifications to different branches of your inheritance tree, you are likely to see duplication emerge.

Decorator answers “How can you structure your code to easily add conditional or rarely used features without putting the extra code directly in your class?”

Example using Decorator Design Pattern:
<?php

    abstract class Tile {
        abstract function getWealthFactor();
    }
   
    class Plains extends Tile {
        private $wealthfactor = 2;
        function getWealthFactor() {
            return $this->wealthfactor;
        }
    }
   
    // Decorator implementing the following
    abstract class TileDecorator extends Tile {
        protected $tile;
        function __construct( Tile $tile ) {
            $this->tile = $tile;   
        }
    }
   
    class DiamondDecorator extends TileDecorator {
        function getWealthFactor() {
            return $this->tile->getWealthFactor()+2;
        }
    }
   
    class PollutionDecorator extends TileDecorator {
        function getWealthFactor() {
            return $this->tile->getWealthFactor()-4;
        }
    }
   
    $tile = new Plains();
    print $tile->getWealthFactor(); // 2
    // Plains is a component. It simply returns 2
   
    $tile = new DiamondDecorator( new Plains() );
    print $tile->getWealthFactor(); // 4
    // DiamondDecorator has a reference to a Plains object. It invokes
    // getWealthFactor() before adding its own weighting of 2
   
    $tile = new PollutionDecorator( new DiamondDecorator( new Plains() ));
    print $tile->getWealthFactor(); // 0
    // PollutionDecorator has a reference to a DiamondDecorator object which
    // has its own Tile reference.

?>

Example without Decorator Design Pattern:
<?php

    abstract class Tile {
        abstract function getWealthFactor();
    }
   
    class Plains extends Tile {
        private $wealthfactor = 2;
        function getWealthFactor() {
            return $this->wealthfactor;
        }
    }
   
    class DiamondPlains extends Plains {
        function getWealthFactor() {
            return parent::getWealthFactor() + 2;
        }
    }
   
    class PollutedPlains extends Plains {
        function getWealthFactor() {
            return parent::getWealthFactor() - 4;
        }
    }
   
    $tile = new PollutedPlains();
    print $tile->getWealthFactor();
?>

Source:  From lecture notes of Design and Development Open Multi-tier Application 

Friday, June 24, 2011

Sketch of a Statue - One of my pencil sketch in year 1998


This is one of my pencil sketch during studying at BAFA (Bulbul Academy of Fine Art).

Important Note:
This was a sketch of 1998 and recently I have taken photograph of this statue from my sketch book. My sketch book is 12 years old. So my sketch book has damaged lot. So photograph quality is bad also.

Probably I was not so good artist.But I don't want to any negative comment regarding my sketch. Because we, artist spend many days or months for our sketches. My sketch can be bad . But this sketch is a result of my hard work on my student life. So no negative comment is allowed.  

Monday, June 20, 2011

"We will not get another Asfak Sir again." ~ A quote of my student

"We will not get another Asfak Sir again." - This was a lovely quote from one of my student of HND Business 2011 Intake 1. I receive many inspiring and lovely quotes from my students. But this quote was very touching.....


Friday, June 17, 2011

Conversation Decorum and Mechanism


We, human being are use to live by following the rules of Allah(God) or Natures. Rules are everywhere. To live, we follow the rules of Allah. We follow many rules in our educational and professional life as well as every family has their own set of rules.

There are some rules during conversation also. I have seen my few students who don't know the conversation decorum correctly.They are students, so this is acceptable. But how can I ignore those professional people who has more than 5 years of experience, but they don't know about conversation decorum.  

Conversation decorum or mechanism are,
  • When you talk to someone, let other to talk also. (There are some people who like to talk much rather then listening to others which is very bad practice)
  • Don't stop or interrupt when someone is talking to you. Give opposite speaker equal chance to explain his/her point of view.
  • Maintain eye-contact when someone is talking to you so that he/she feels that you are giving importance to him/her. 
  • Try to understand others point of view. If you have separate point of view, then explain it properly to others during your time slot.
  • Don't follow same conversation mechanism for all type of people. (Obviously conversion mechanism with my employees will be different from the conversation mechanism with my students. If I maintain same conversation mechanism for my employees and Students, then it will not work properly. Because my employees has crossed their student life before and they have professional experience also. So conversation decorum or mechanism will be different)
  • Show proper respect to your senior and junior colleague during conversation so that you can receive same respect in return.

Tuesday, June 7, 2011

Sketch of Grapes - One of my pencil sketch in year 1998

This is one of my favorite pencil sketch during studying at BAFA (Bulbul Academy of Fine Art). Drawing picture was my hobby.

Important Note:
Probably I was not so good artist.But I don't want to any negative comment regarding my sketch. Because we, artist spend many days or months for our sketches. My sketch can be bad . But this sketch is a result of my hard work on my student life. So no negative comment is allowed.

Sketch of grapes

Monday, June 6, 2011

Liger and Tigon - An exceptional case of wildlife

The liger is a cat born from the breeding of a male lion and female tiger.The tigon is a hybrid cross a male tiger and a female lion.
Figure -1: Real Picture of a Liger
Figure -2: Real Picture of a Liger
These two are the real picture of a Liger who is the accidental result of a male lion and a female tiger (tigress) who was living close together at the Institute of Greatly Endangered and Rare Species, Florida. Interesting things are,
  • The size and weight of this liger is double compare to his parents as you can see in the picture that it's a big cat then all other cats.
  • Naturally tiger love to swim and lion like to live in a social network (Don't thing about Facebooking. :-). But liger has both characteristics.
  • This liger has not gone for hunt yet. Because he has born in a research institute. So we don't know whatever this liger will hunt in a group like Lion or will hunt alone like tiger.
Figure -3: Understanding of Liger & Tigon
Liger has born naturally. I don't know about any Tigon which has born naturally. But this is not impossible as you have understood already.

Saturday, June 4, 2011

BAC Automated Routine and Course Scheduling Software

Recently I have developed a Automated Routine and Course Scheduling Software for BAC (A concern of British-American Education Group).

Previously BAC management was used to generate routine manually and Microsoft Excel was the tool for data storage.Management has faced following problem during making routine manually,
  1. Generating routine was time consuming.
  2. It was hard to avoid batch, faculty and room wise clashes.
  3. Finding faculty engagement details was too hard.
  4. Finding information of free class slots and rooms were not so easy.
  5. Generated routine was day wise which was easy for faculties and administration peoples. But student need batch and course wise routine.
  6. Generated routine has one type of view only. It was day wise. But management needs different views of routine different time.   
  7. Overall it was painful for coordinator to generate routine considering all the points noted above. It is hard for human to track and consider all the issues together.
  8. Updating routine was hard because of chances of batch, faculty and room wise clashes.  
  9. Two coordinators was responsible for generating the routine of law and business school.So it was costly.
Recently I have developed the software. The main features of the software are,
  1. Software need 10-20 minutes to generate the routine. (Time required only for entering relevant data.)
  2. Depend of necessary input, software automatically allocates day, time and room such a way so that batch, faculty and room will never clash together.
  3. You can add your plan in the software also.
  4. Software can generate day, time, batch, course and faculty wise routine. 
  5. Besides this software has solutions of all the problems which BAC management has faced during making manual routine.    
Finally I appreciate BAC management that they have understood the importance of a software like this. But there are some people who don't even understand - how a software can solve their problem? 

References:
Thesis of my bachelor degree was "Test driven software engineering for automated course scheduler". My analysis of that time has helped me lot during developing this software.But the structure of BRAC University and BAC is different.So database design, algorithm and programming is new, organized and more professional this time.

Screen shot from software:
Screen shot from software: Routine for students
Screen shot from software: Day Vs. Time View for Management

Friday, June 3, 2011

Clear cache of your PC using ASP.NET(C#)

You can use following function to clear cache of your PC using ASP.NET(C#).

public static void CacheClear()
{
    foreach (System.Collections.DictionaryEntry DE in HttpContext.Current.Cache)
    {
        string Key = DE.Key.ToString();
        HttpContext.Current.Cache.Remove(Key);
    }
}

String splitter function using C#

You can use following function to Split String using C#.

public static Queue StringSplitter(string MainString, string SplitBy)
{
    Queue Q = new Queue();
    foreach (string S in Regex.Split(MainString, SplitBy))
        if (S.Length > 0)
            Q.Enqueue(S);
    return Q;
}