Thursday, April 29, 2010

South Beach Miami on a typical winter day

I wish I were in Miami...

Monday, April 26, 2010

C# Improve Responsiveness in Real Time Searching

When you have real-time searching (searching as you type) you will inevitably get a performance hit because each letter you type will trigger a search which usually retrieves data from the database or at best a cache.

One solution is to add a delay and not search until the user has stopped searching for say 500ms.

//declare the timer
private Timer _searchQueueTimer;


//Initialize the timer in the constructor
_searchQueueTimer = new Timer();
_searchQueueTimer.Interval = 10;
_searchQueueTimer.Enabled = true;
_searchQueueTimer.Tick += new EventHandler(_searchQueueTimer_Tick);


/// Add the search string to a Queue
private string _currentSearchItem;
private string _queuedSearchItem;
private DateTime _queuedSearchTime;
public void Search(string search)
    if (search.Trim().Length > 0)
        _queuedSearchTime = DateTime.Now;
        _currentSearchItem = search.Trim();
        _queuedSearchItem = _currentSearchItem;

/// Delay the search while user is still typing 
/// before performing the actual search
private void _searchQueueTimer_Tick(object sender, EventArgs e)
    // Time in milliseconds to wait before initiating the search
    const int queueTime = 500;
    if (_queuedSearchItem != null 
     && DateTime.Now.Subtract(_queuedSearchTime).TotalMilliseconds >= queueTime)
            Cursor = Cursors.WaitCursor;//Provide feedback to users
            Cursor = Cursors.Default;

/// Some psudo code for the method which actually does the search
/// Removes the queued search text from the queue
private Results DoSearch()
      if (string.IsNullOrEmpty(_queuedSearchItem))
          return list;

      _queuedSearchItem = null;

      return results;

Saturday, April 24, 2010

Taiwan's Susan Boyle

Monday, April 19, 2010

NBA Playoffs 2010: The first round

Lakers vs Thunder

The Oklahoma Thunder are in the playoffs for the first time since their move from Seattle (Supersonics), and with Kevin Durant leading the way, they are hoping to gain some experience before becoming an elite team in the years to come.  But its still Laker time.  Ron Artest is playing Dennis Rodman like defense, keeping KD shooting under 30%.  Bryant is also a great defender, plus they have two 7 footers.  I don't see anyone out west beating them beside Dallas.

Magic vs Bobcats

Howard's first game into the playoffs and he was frustrated by the Bobcat's front line.  He's not going to have a bad game every game, but it was great to see Jameer Nelson step up, scoring 36 pts 4 rebs 6 assists.  Lewi, Pietrus and Reddick had solid games and it was enough for a win even with VC playing badly.  I think the Magic will bounce back from this bad performance and play better as the playoffs go along, which is scary considering how deep they are.  Its no secret I'm vouching for a Magic Lakers finals rematch with the Magic finally winning that championship.

This still has Orlando fans angry...

Celtics vs Heat

I don't really care who wins this series, winner goes on to play Cleveland who will eventually make it through to the conference finals anyway.  I really like Paul Pierce, and I really like Dwayne Wade, so I'm just sitting back and enjoying an intense defensive series.

And just for fun... NBA's Record for most 3 pts by a team, staring the Orlando Magic...

WPF Problem Loading Designer

If your designer view is having problem loading, its probably because you have some code-behind in the constructor of your xaml form or user control. Add the following;

if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))
     // Code which causes the designer to fail
     // Stick this using segment inside the contructor 
     // code-behind and encapsulate all extra code
     // You may also need to add it to any initialize
     // or form load method if you have added extra code

Sunday, April 18, 2010

Selling some work out equipment

In order to make room for my new bench press - which has a lateral pull down, I'm going to sell my previous bench press and some dumbbell weights. If anyone is interested, come visit my trade me listings.

If these don't get sold I'll consider lowering the price. If anyone is interested - and if there aren't any existing bids, I'll do mates rates for these.

Hyper Extension Bench Press with Leg Extension

20KG Dumbbells

Saturday, April 17, 2010

What's your first thought of Cyclists while driving?

My Favourite (Active) NBA Players

1. Dwight Howard.  Best player on my favourite team.  He's also the best centre in the league, has a great attitude towards the game, is a Christian, and also likes Superman!

2. Dwayne Wade. In the years that Orlando didn't make the playoffs while Dwight was still young and up n coming, I followed Wade and Miami and their championship run.  His skill and talent is great but his determination won him the ring.

3. Paul Pierce.  I just love his playing style, since I also play Small Forward, The Truth is the player I want to play like.  A complete player that can shoot, penetrate, pass and defend.

4. Tim Duncan.  He almost became a Magic back when T-Mac and Grant Hill joined Orlando and what a team that would be.  He played with David Robinson and clearly gets a lot of values from him.  An unselfish player that dominates the game with fundamentals, and the only all world superstar that accepts lower pay so that his team can sign more and better players.

5. Vince Carter.  This spot just goes to VC because he joined the Magic this year.  He no longer commands the highlight reels with his dunks, but still a top swing man.

Honorable Mentions: Kevin Garnett, Ron Artest, Chris Paul, Brandon Roy

Friday, April 16, 2010

Beware of the Flying Fox - If you are male...

NZ Herald Article about a man who got his private part stuck in a flying fox...

Read full article here...

Thursday, April 15, 2010

Separating the Sheep from the Goats: Matthew 25:31-46

Recently, I got together with my friends from Jesus for the Homeless, and we discussed our goals and vision for the group, as well as a strategy going forward.

We drew on the passage from Matt 25:31-46.

For those interested, here is a transcript of our study:

Separating the Sheep from the Goats: Matthew 25:31-46

Our group is called Jesus for the Homeless.  What I like about this name is that it has Jesus in it.  You see, the whole reason this group got together was because of Jesus.  A bunch of guys were reading the bible one day, and saw how Jesus loved the poor and the downtrodden, the widows and the fatherless.  They realized they could not claim to love and follow Jesus without helping the poor.

Our Homeless nights have been running for some 6 months now, and I feel it is important to come back to scripture and think about our goals and vision for the group.  Why are we doing this? and what is the goal we are trying to reach?

I would like to open to a verse in Matthew, which I hope to be our group's defining passage.

Matt 25:40 - "The King will answer and say to them, 'Truly I say to you, to the extent that you did it to one of these brothers of mine, even the least of them, you did it to me.'"

This verse comes from a segment in the book of Matthew, where Jesus is speaking of the Judgement.  The separating of the sheep from the goats.  

Let us firstly read the entire passage.  [Reading of Mathew 25:31-46]

Firstly, who is the Judge?  The King, the son of man, Jesus Christ himself.

Next, who will be judged?  The passage says Jesus, will gather all the nations.  Everyone, Christians, non-Christians alike will be gathered together and judged.  And He is going to separate them like a shepherd separates sheep from goats. 

So who gets to inherit the kingdom?  The sheep.

And why do the sheep inherit the kingdom?  Lets read v 35 to 40 again.

Mat 25:35  For I was hungry, and you gave Me something to eat; I was thristy and you gave Me something to drink; I was a stranger and you invited Me in;
Mat 25:36  Naked, and you clothed me; I was sick, and you visited me; I was in prison, and you came to Me.
Mat 25:37  Then the righteous will answer him, 'Lord, when did we see you hungry, and feed you? or thirsty, and give you something to drink?
Mat 25:38  And when did we see you a stranger, and invite you in? or naked, and clothed you?
Mat 25:39  Or when saw we thee sick, or in prison, and came unto thee?
Mat 25:40  And the King shall answer and say to them, 'Truly I say to you, to the extent that you did it to one of these brothers of mine, even the least of them, you did it to me'.

Who are these brothers Jesus talks about?  There are scholars who says Jesus is refering to the Jews, or to fellow Christians.  But this question is similar to "who is my neighbour" which a lawyer asked Him in Luke 10:29.  The point is not who you should help, but how.  Serving others without expecting a reward.  These acts of compasion are not things we need gifts or skills in order to perform.  They are simple acts of kindness which anyone can do.

Sheep and Goat look similar and often grazed together.  Jesus is using this picture of sheep and goats to describe His people among the rest of the people; unbelievers and pretenders.

Jesus says the sheep who inherit the kingdom will be those who show compassion to the needy.  

Now, don't get me wrong here, it is not by our actions and goodness that gets us to heaven, these actions are just the fruit of following Jesus.    If we love and follow Jesus, we will feed the hungry and visit the sick.  What separates us from unbelievers and pretenders, is not just our actions, but our intentions and our reasons.  And when we show kindness and compassion to our brothers, without thinking of the reward, even to the least of them, we do it to the Lord himself.

So back to our group; Jesus for the Homeless. 

Why do we do it?  Because we love and follow Jesus. 
How should we do it?  We treat everyone with love and respect as if they were the Lord Himself.
What do we need? Anyone who is interested in helping the poor.  There are lots of ways you can help, but whats important is that desire to help.

Saturday, April 10, 2010

Tuesday, April 6, 2010

Saturday, April 3, 2010

The Sabbath: A shadow of Christ

I would like to share of a recent study I did of the sabbath and how it gave me a completely new perspective on rest, and ultimately how it pointed toward Jesus.

What is the Sabbath?  Christians often think of it as the day of rest, in particularly abstain from work usually done on Sunday.  The Jewish Sabbath was on the seventh day - Saturday, and in fact the 4th commandment from God given by Moses was to remember the Sabbath and to keep it Holy.  There are some people such as the Seventh Day Adventists who claim that we are not really Christians unless we also observe the Sabbath on the Saturday, reasoning that the Pope or Constantine shifted the Sabbath from Saturday to Sunday and as such we worship false gods or idols.

So to understand the origin of the Sabbath, we must look at its first occurance in the Bible - Genesis 2:1-3.  This was the seventh day of creation, God had finished the work He had done in creation and He rested.  So the main thing we can learn about the Sabbath was that it is about rest.  The word rest occurs twice here, and the hebrew word is שׁבת (shâbath).  What does rest mean?  Clearly in this context, rest is not the kind of thing you do when you are tired, God does not get tired.  Rather the word means to "desist from exertion" or "cease from effort".  God rested because He finished a particular effort, his work in creation.

The next thing we notice is that the seventh day is different to all the other days.  In each of the other six days, the day ended with "there was evening and there was morning...".  I believe this eludes to the idea that the Sabbath is not tied to a particular day.  We are never told that God ever stopped resting from His creation work.  His last and final work in creation was creating Man, and He is still to this day, resting, from His "creation" work.  But God is active and working today.  In John 5:17, Jesus' answer to the Pharisees charge of working on the Sabbath, was that He was doing the will of the Father, and that God never ceases from the work of mercy and compassion.  This Sabbath which God has entered, is still continuing today, and is not limited to any particular day, but is concerned with rest from effort.

Now we compare this true Sabbath, this rest, to the Jewish Sabbath which was given to the people of Israel by Moses.  I would like to quickly make a point here that my view is that the entire old testament, is filled with Shadows or Types or Symbols which pointed towards Jesus Christ, the Passover Lamb, burnt offerings, the Tabernacle, the High Priest, the Ark, all of these look forward to the one who would fulfill these.  Let us turn to Colossians 2:16-17.
Col 2:16  Let no man therefore judge you in meat, or in drink, or in respect of an holyday, or of the new moon, or of the sabbath.

Col 2:17  Which are a shadow of things to come; but the body is of Christ.  
Paul is telling us here that many of the Jewish laws, traditions, ceremonies were a shadow of things to come, pointing towards Jesus who ultimately fulfilled all these things.  We no longer need sacrifice animals because Jesus offered Himself as the passover lamb to God once and for all.  We are also told that Jesus fulfilled the Sabbath, and so claims that we are not Christians unless we observe the Sabbath on Saturday are as absurd as needing to sacrifice animals at the alter.  The Jewish weekly Sabbath occurred on Saturday.  We go to Church on Sunday because that is the Lord's Day, the day of resurrection.  This day has nothing to do with the Jewish Sabbath, its not a day of rest, its not the Sabbath.

When Jesus died and rose again, Christians stopped observing the Sabbath on Saturday, and began observing the Lord's day on Sunday.  So the weekly Sabbath was fulfilled when Jesus died and rose again.  We no longer need to observe such a day as a day of rest.  We can now experience the true Sabbath through Jesus.  Turn to Hebrews 4:8-10.
8 For if Joshua had given them rest, then He would not afterward have spoken of another day. 9 There remains therefore a rest for the people of God. 10 For he who has entered His rest has himself also ceased from his works as God did from His.
The book of Hebrews is all about how the old testament prophesies are fulfilled in Jesus Christ, and I think this passage is telling us how to experience that true Sabbath, the rest for the people of God.  We can enter God's rest by ceasing from our works as God also ceased from His.

Matthew 11:28-30
28"Come to Me, all who are weary and heavy-laden, and I will give you rest.
 29"Take My yoke upon you and learn from Me, for I am gentle and humble in heart, and you will find rest for your souls.
 30"For My yoke is easy and My burden is light."
A yoke would have been something Jesus built as a carpenter.  A yoke is a piece of wood which was put onto oxen in order to pull a load.  But a yoke would almost always fit two oxen, as the two would work together.  When Jesus refers to putting on His yoke, He is saying He will work with us, by His strength.  Not by our efforts but His.  We are to rest from our work, doing things our own way, and do things under His strength.  That is what Paul meant when He said "It is no longer I who lives but Christ lives in me".  The oxen under yoke is no longer able to do his own will, but only the will of his master.  The same is true when we put on Jesus' yoke, we are no longer able to do own thing, but only the will of the Lord.

Jesus said "Come to me, and I will give you rest".  So many of us Christians or not alike are unsatisfied with life.  We don't find happiness in our relationships, our jobs, our material wealth.  We don't have peace in our souls.  The true Sabbath is to rest from our own efforts, and allow God to work in us.  We are to put on Jesus' yoke and He will give us rest.

Further Reading:
In Hebrews 4, it mentions the Israelites led by Moses, and how they were not able to enter the Promised Land.  It was ultimately Joshua who brought them in.  Read the book of Joshua and notice where it says the Israelites will find rest in the land.  The book of Joshua is about conquering the land of Cannan, crossing the Jordan.  How does this parallel with the book of Ephesians, a book about life after becoming a Christian?

Friday, April 2, 2010

Happy Easter!

Edypository 2.5 is here - thanks to a comment by Jacqui saying my blog had the .Net MVC blue, I changed the skin again.