Wednesday, November 28, 2012

Into the box

J Allen Peterson makes a profound statement "Most people get married believing a myth - that marriage is a beautiful box full of all the things that they have longed for - companionship, sexual fulfillment, intimacy, friendship. The truth is that marriage, at the start is an empty box. You must put something in before you can take anything out. There is no love in marriage, love is in people. There is no romance in marriage, people have to infuse it in their marriages. A couple must learn the art and form the habit of giving, loving, serving, praising - keeping the box full. If you take out more than you put in, the box will be empty."

That's amazing advice for couples but it pertains to our relationship with God as well. Many people bring their box to God and say "Fill it up, Lord." It's good to have Him fill it but did you know God wants you to put your heart and emotions in it as well? He's looking for more than obedient servants, He's looking for relationship. He created you for more than servanthood, He created you for fellowship. You have stuff to put in the box and He wants it, He's interested in your ideas, thoughts and friendship.

In the Old and New Testaments God called Abraham His friend; friends talk, friends exchange ideas and challenge each other. Abraham's friendship was expressed in Gen. 18 when he interceded on behalf of Sodom. Contrary to God's plan he pleaded for the people of Sodom and God listened. The relationship wasn't about Abraham's goodness, he lied about his wife over and over and by his poor decisions fathered both the Arab and Jewish people. Through that mix alone he is personally responsible for messing up half the planet, yet he's still considered a friend of God. I doubt you've messed up half the planet so there's hope for you!

Over and over God enjoys the input of His people. God was amazed when David wanted to build a house for Him, without Him asking. We are able to bless the Lord by our response to Him. You have a box that needs to be filled but you are part of the filling. If you're still in doubt Jesus told His disciples, "I no longer call you servants...but I have called you friends." John 15:15 Be a friend of God, pour your input into your box with God and watch what happens.

Thursday, November 22, 2012

The Real Parallel Universe

Science fiction loves to tell stories of parallel universes, invisible worlds as close as our breath but unknown to men where every now and then a soul slips in and a wonderful adventure begins. This delightful topic of fiction is in fact reality; we live in a parallel universe where our natural world is mixed with an invisible one. The Bible tells us that we live in both a natural and a spiritual world and we can interact with both.

I believe that everyone is created to interact with this invisible realm but many have never had their eyes opened or don't take the time to become familiar with it. So the common condition is to be directed by the dictates of this natural world. God does not call us to such a one sided existence; not only does He call us into His unseen realm, He Himself gives us abilities to interact with it, beginning with the simplicity of a bended knee in prayer.

The Bible tells us about the spiritual gifts God has for us. God gives them to us as we ask but He also gives them as He wills and we might experience them without asking or fully understanding their nature or purpose. I wonder if you know what it is to see someone across a room and immediately feel their pain in your body or a burden of their heart press upon yours; to discern someone who has an hidden motive in a business transaction or to know what God is about to do in someone's life. These are expressions of those gifts. What about praying for an physical injury and seeing it immediately disappear, knowing a stranger's thoughts, seeing angels and demons or having faith to believe for impossible situations? These are some of the amazing spiritual gifts God gives us.

For many years I experienced and loved these gifts but didn't really understand the details. I was both keenly aware of Heaven's activity yet ignorant of how to interact with it. In some respect it's like being an X-Man having supernatural abilities that make me different in a good way. I talk to people about these things but it seems to be a language not everyone understands.

Now I've come to Bethel in Redding, CA, where I'm surrounded by 2,000 students who totally understand this realm. They live, eat and breathe this invisible reality. It's like coming to a school for the gifted, where once you thought you were unusual but now you realize you're normal. Even after months here the reality of this can be overwhelming. Yesterday was such a day, that day I saw the Holy Spirit guiding and leading me with more clarity and precision than I've ever known. In the last session I'm sitting at a table with students I've just met and hear one say "I'm such a feeler" and I know EXACTLY what she means. She's an X-Woman, a student with supernatural abilities, able to feel people's pain, joy, grief and longings; she knows where God stations His angels in a room and how He's feeling about someone or something. As she speaks it seems like decades of hidden understanding overwhelm me as she articulates her invisible gift.

This is Bethel, the most exciting environment for discovering God. I've heard teaching about the gifts and their operation, now I have an entire leadership team demonstrating, cultivating and awakening those gifts. Imagine what it's like to suddenly realize God has made you a seer and He speaks to you in images, or that you're a feeler and you feel things, a gift that can be so strong that some here thought they were bi-polar because of the emotional swing caused by encountering different people. As Kris Vallotton said in class, "Many of you were the most spiritual people in your church and your leaders weren't sure what to do with you. Welcome to the land of the giants!" Oh how I love this new world! If this resonates in your heart, run for the things of God. Ask Him, ask Him, ask Him questions. Seek and you will find.

Wednesday, September 1, 2010

DP_DefaultValueTypeDoesNotMatchPropertyType Error

If you create a Silverlight (and probably WPF) usercontrol and get a DP_DefaultValueTypeDoesNotMatchPropertyType error when rendering the control, make sure you are setting the right kind of default value in the .Register method.

The following code generated that error.

public static readonly DependencyProperty HourFillProperty = DependencyProperty.Register(
"HourFill", typeof(int), typeof(ucScheduleHour),
new PropertyMetadata(null,
new PropertyChangedCallback(ChangeValue)));


My value was an int so I needed to change null to a 0,


public static readonly DependencyProperty HourFillProperty = DependencyProperty.Register(
"HourFill", typeof(int), typeof(ucScheduleHour),
new PropertyMetadata(0,
new PropertyChangedCallback(ChangeValue)));

Wednesday, March 31, 2010

SQL WHERE and JOIN clauses

A brief discussion of the difference in SQL between criteria in the WHERE and JOIN clauses.

Suppose we have a very simple system of two tables A & B. A is a list of Deptartments and B is a list of charges to a departmental account.

Table A
Dept
10
20
30

Table B
Dept Acct Amt
10    15    2
10    11    4
20    11    1

Management request a report that shows all Depts in table A, regardless of the entries shown in B, and the sum of Amount by Acct for dept 15.

You might be tempted to write the SQL as:

SELECT A.DEPT, B.ACCT, SUM(Amount) as TOTAL
FROM A LEFT OUTER JOIN B
ON A.DEPT=B.DEPT
WHERE ACCT = 15 OR ACCT IS NULL
GROUP BY A.DEPT, B.ACCT

However this will give you these results.

Dept Acct Amount
10    15    2
30    NULL  NULL

Dept 20 does not appear in the list. As you can guess from the sample data Dept 20 is eliminated by the where clause, although the
DEPT IS NULL allows Dept 30 to appear.

There is a simple fix to show all departments, move the criteria to the JOIN.

SELECT A.DEPT, B.ACCT, SUM(Amount) as TOTAL
FROM A LEFT OUTER JOIN B
ON A.DEPT=B.DEPT AND ACCT = 15
GROUP BY A.DEPT, B.ACCT

This yeilds

Dept Acct Amount
10    15    6
20    NULL  NULL
30    NULL  NULL

Exactly what was requested.

Here is a little SQL which demonstrates the results.

SELECT A.DEPT, B.ACCT, SUM(AMT) AS AMOUNT
FROM
(SELECT 10 AS DEPT
UNION
SELECT 20
UNION
SELECT 30 ) A
LEFT OUTER JOIN
(
SELECT 10 AS DEPT, 15 AS ACCT, 2 AS AMT
UNION
SELECT 10, 11 , 4
UNION
SELECT 20, 11 , 1
) B
ON A.DEPT=B.DEPT AND B.ACCT=15
--WHERE B.ACCT=15 OR B.ACCT IS NULL
GROUP BY A.DEPT, B.ACCT

Friday, October 30, 2009

Reconnect SQL user after restore

Have you ever restored a SQL database with a SQL login to a new server and not been able to use the SQL login. So you log into Management Console to create the login, which you can but when you try to give it rights to the database, it says "User, group, or role already exists in the current database."

There is a simple way to fix this. Create user in SQL, connect as sa or admin, select the database you just restored and execute

exec sp_change_users_login 'Auto_Fix', 'yourUserName'

You should see a message like.

The row for user 'yourUserAcct' will be fixed by updating its login link to a login already in existence.
The number of orphaned users fixed by updating users was 1.
The number of orphaned users fixed by adding new logins and then updating users was 0.

Tuesday, October 6, 2009

Correct way to Load a window in WPF

Here is the correct way to load a window in WPF. Notice the hooking the Loaded event in the constructor.

public MainWindow()
{
InitializeComponent();
Loaded += new RoutedEventHandler(Window_Loaded);
//MyBigRoutine(); -- Don't do this.
}

private void Window_Loaded(object sender, RoutedEventArgs e)
{
MyBigRoutine();
}

Call to MessageBox.Show in App() prevents StartupURI

Not sure what is going on here but a MessageBox.Show in the ctor of WPF's app.xaml.cs prevents the call to the startupURI object. Removed the call to Show and all is well.