One man's voice Thoughts, rants and commentary of a simple man

21Oct/090

ZendCon 2009: Day 2

Yesterday was an amazing day at ZendCon. Lots of talks, lots of information, lots of networking, lots of geekdom. The day was long but very informative and at the end of it I couldn't wait to get back for today.

Today started off a bit different than yesterday because today I was scheduled to take the Zend Framework Certification exam and my coworker was scheduled to take the Zend Certification Exam. So we got to the conference and camped out for the morning to get some last minute studying in.

As we studied we were joined by Aaron Wormus. I'm not sure why, but when presenters and other people who are widely known in PHP are close by I always feel like I am in the presence of a celebrity. Last year I was like a little kid at a football game, meeting everyone, shaking hands, being excited, enjoying the conference. This year? Well, kinda the same, except I haven't seen to have as much time this year to find people to meet.

Still, it was nice to be able to spend a couple of hours trying to familiarize myself with the Zend Framework. The exam preparation study guide is 214 pages long, and as of 12:15, when it was lunch time, I had gotten through about 110 page of it. So much for being totally prepared for the exam.

After lunch was over my coworker and I headed to the exam room where we took our test. And wouldn't you know it... I passed. So now I am not only a Zend Certified PHP Engineer, I am also Zend Framework certified as well. Sweet!

After the certifications were over we were able to get back into the swing of the sessions...

MySQL Server Performance Tuning 101
Cal Evans, filling in for Legaya Turmelle, did an excellent job of describing how to optimize your MySQL server and sent queries to enhance the performance of your applications. Filled with an incredible amount of technical data, this presentation was still a vibrant session that involved the attendees throughout the entire session. And I managed to sneak away two things that will be a help to me as soon as I get back to work:

/* Show all of your global variables */
mysql > SHOW GLOBAL VARIABLES;
 
/* Show your statuses */
mysql > SHOW GLOBAL STATUS;

Both of these can filter your queries by adding a "LIKE '%{filter}%'" to the query. Very handy pieces of information.

Architecting Your Models
Matthew Weier O'Phinney gave an awesome talk about architecting models (the M in MVC) and using your models to handle business logic. The logic that was employed was very similar to the Introduction to Zend Framework talk he gave on Monday (kudos for consistency) and covered data access, table/row gateways and service layers.

This is one of those presentations that I would recommend you get the slides for because just the programming practices employed in his presentation make it an absolutely stellar session and one that can only help you as a programmer. [Note: as soon as the links to the slides are posted I will put that link here. Sorry.]

Building Desktop RIAs with JavaScript and PHP
Ed Finkler gave a sweet presentation on taking PHP and Javascript from the web to the desktop in his talk on building Rich Internet Applications. His talk was dynamic, funny, had a couple of well handled snafus and totally captivated the audience.

Using Adobe AIR, Appcelerator's Titanium and PHP, he built a couple of cool little desktop apps that are driven by server hosted PHP applications. Though the apps were just for example, what you can do with AIR or Titanium, jQuery and PHP is freaking amazing and I can't wait to try some of this stuff when I get back to work.

Links to his presentation and associated code samples:

Day 2 wrap-up
Sitting here, at the end of the last session, I am overwhelmed with the amount of information I learned in the last couple of days. I am so looking forward to how ZendCon will be wrapping up tomorrow and cannot wait to meet some of the people of I haven't yet had a chance to meet.

20Oct/09Off

ZendCon 2009: Day 1

The second day of ZendCon is always a busy day. That is the day the sessions start; when you try as hard as you can to be in three places at once; where you spend half of each session reading Twitter for all #zendcon hash tags or hang out on the #zendcon IRC channel; when all you can think of outside of PHP is free swag and free beer.

Today was like that for me. Well, minus the mad rush to sit in on the morning keynote. I spent the early morning reading up on the Zend Framework so I can stand a chance at passing the ZF Certification Exam tomorrow. There is a lot to learn in that stupid manual (214 pages long - gripes!) so there was naturally lots of reading to do. After that we started the day.

Session 0: PHP 5.3 = Awesome
Ilia Alshanetsky gave this talk on PHP 5.3 and some of the new and exciting features in it. Outside the fact that Ilia never stops talking... I mean never... this talk was filled with some pretty cool stuff that a lot of programmers have been waiting for in PHP.

He opened with talking about namespaces and how they can be used. There are so many ways to utilize the namespace feature that to repeat that here would take a lot of screen real estate. I would recommend getting your hands on the slides of the presentation and reading through the first few slides. There is lots of useful information on namespaces in the slides.

The next thing he talked about was the new usage for the ternary operator. While there are, I'm sure, different ways to implement this feature, the manner in which it is implemented right now is pretty neat. Essentially you can now say "If the first condition evaluates to true, use it, otherwise use the second" without saying it exactly that way:

<?php
// We used to do this with ternary
$var = $a ? $a : $b;
 
// Now we can do this
$var = $a ?: $b;
?>

That is pretty slick in my opinion.

There was also mention of the use, internally, of the MySQLInd client library for MySQL Database Server interaction and how much overhead is being saved on select queries when not manipulating SELECT query result set data. Essentially you can cut your memory consumption in half because of this change. Sweet.

After this the talk moved into some new stuff you can do with INI files and data you can set in them. This change will make configuration pretty freaking sweet in my opinion, just because of what you can set and how you can set it. There is also some pretty nifty stuff that is happening with the DataTime built in objects in PHP. And lastly, there is a new PHP constant being introduced. That constant is E_DEPRECATED and it will be used to tell you, when you have error_reporting set to E_ALL, if what you are using in PHP 5.3 is slated for deprecation in PHP 6.

Overall this was an awesome talk. Ilia is a great speaker, knows his stuff very well and packs in about three hours worth of presentation into about an hour.

Session 1: Xdebug — PHP developer's swiss-army knife
Presented by Derick Rethans, the author of xDebug, this presentation covered an enormous set of the features included in xDebug. Derick also talked about kcachegrind and utilizing xDebug with PHPUnit to cover many aspects of unit testing and debugging

Slides for Derick's talk are available for download at his website.

Session 2: Mastering OpenXML Documents with PHP
Aaron Wormus gave an excellent talk about the PHPExcel library and how it utilizes the OpenXML standard to write complex and feature rich spreadsheets for Microsoft Excel, Open Office and other text based formats. This was very well presented session and covered several different, clearly coded examples.

Session 3: Premature Optimization Mistakes
Another awesome presentation by Ilia Alshanetsky, this session talked about some of the wrong directions programmers can go into when trying to optimize their applications. Many myths were debunked in this session, like the idea that smaller code is better code, removing comments in PHP makes your applications faster and changing your code makes it better. I even installed APC on the PHP Developer's Network forums during this presentation to buy some performance gain without having to do any really heaving lifting.

Again, Ilia put about three hours worth of information into an hour long session and knocked it out of the park.

Session 4: Taming the Deployment Beast
Chris Cornutt, the man behind PHPDeveloper.org and joind.in, gave a hugely informative presentation about deployment and managing your applications from the start of development to the implementation of production over both teams of developers and for individual programmers.

Covering an array of various tools, practices and principles, Chris's presentation was filled with application lifecycle management concepts, deployment practices and low level programming practices.

Slides can be downloaded here

Day 1 wrap-up
Much like last year, the first day of ZendCon was packed with information, networking, free swag (thank God for vendor fairs) and great food. Seriously%2

19Oct/090

ZendCon 2009: Day 0

Woo to the frickin' hoo! ZendCon 2009 is back in town!

I am fortunate enough to work for a company that believes that you should continue your education within your professional field. They back up that commitment by putting their money where their mouth is and actually spending money to send their employees to various training seminars and conferences throughout the year. And this year, like last year, ZendCon is that conference for me.

Like last year, this year opened up with the conference tutorials day. This year I chose to focus on Zend Framework and learning what I could of it. It is a fast growing framework and is quickly becoming a popular tool in the arsenal of many a PHP developer. I am seeing more and more recruiter emails that are asking for ZF experience. And it is a beast of a code base, well written and extremely well organized, developed by a team of people that are some of the biggest and brightest names in PHP development around the world.

Session 0
My day started out with an Introduction to Zend Framework by Matthew Weier O'Phinney. Matthew gave a stellar presentation on using the Zend Framework to develop a pastebin application. Covering some of the ins and outs of the MVC architecture employed by the Zend Framework, he also taught some programming practices as he started out first by developing his models, then his forms, then his controllers then his views. He taught techniques like setting view variables as their lowest PHP variable type so they are not to tightly coupled to a particular implementation should controllers or models change (like passing a result array to the view as opposed to a DB result object).

He also went into a decent amount of detail on Zend_Tool, Zend_Config, plugins and routing. In the end I felt like I could actually do something cool with the Zend Framework. Maybe not as cool as what he did, but cool nonetheless.

Now if I could just figure out those sweet vim plugins he was using...

Session 1
Seeing as the Zend Framework certification exam is being offered to conference attendees for free I figured since I am here that I would try to add to my ZCE certification. To do that I figured I'd sit in on the Zend Framework Certification Refresher course being presented by Rob Allen.

I am pretty sure I was in over my head from the start of this class. One of the first things that Rob said was that this class was not a tutorial on Zend Framework but a refresher for those that are using it regularly. For almost every component that was covered he asked the question "Who has used this?" and sadly I could not raise my hand for hardly any of them. Still, on the practice questions I did alright because much of the Zend Framework is common enough that you can expect certain behavior from it. That seemed to get me some pretty good mileage.

Of course there were lots of things that I had never seen, either. Parts of Zend_Log (and the writers, the formatters and the filters), parts of Zend_Db (the table data gateway and the row data gateway), Zend_Auth (the returns from Zend_Auth::authenticate()) and a host of other items from the framework are fodder for me reading up on.

Still, I think I can pass the exam if I don't overthink the questions being asked. Of course, that means lots and lots of reading tonight, tomorrow, tomorrow evening and Wednesday morning.

Other happenings (and mishappenings)
When my coworker and I got to the conference and registered that we were there we noticed something missing from our registration packet. All early registrants who attended a previous ZendCon were supposed to receive a netbook for the conference. Ours was not there. Throughout the day we checked back in with the front desk, per their instruction, and found out at the end of the day that we would be getting ours tomorrow. That was a small bummer, though it had a happy ending so I am pretty stoked about that.

Something else I noticed this year was the lack of power in the rooms. Last year there was no shortage of power plugs to plug my laptop into. This year, in the first session, only the people that sat next to the walls close to an outlet could plug in. The second session was a little better in that my room had two power strips. Still, both of those were on one side of the room so if you sat on the other side of the room for the three hour session there was a decent chance that you were going to be running out of power before the end of the session.

Wireless internet this year was way better than last year for me (albeit a lot slower). Connecting to it was a snap and once I was able to power up my laptop I was able to stay connected to the internet pretty much the entire rest of the day.

Lunch was really good this year. For a boxed lunch the food was really, really good. As were the dining accommodations. My coworker and I were able to meet some new folks (a fellow from Seattle, John from Vermont and another fellow from Slovenia) as we talked about the ZCE, differences between PHP and Java and this year's conference versus last year's.

Ending the day this year was a little sad for me. Not because the day was over and I had to wait an entire half a day to mingle with my peers again. No, it was because of the $18 I spent on parking at the Convention Center. What. The. Hell? There was no validation either. And to top it off, the stupid ticket reader didn't work so we had to drive around the entire garage until we found a guy that could help us.

Still, given the day as it went, I am very happy with ZendCon this year. I cannot wait until it gets into full swing tomorrow. And I really can't wait for some of the uncons that were just posted late tonight.

18Oct/094

Why I disabled my Facebook account

Thinking of disabling my Facebook account. It is entirely too easy to not talk to my wife in lieu of reading her wall. #stupidfacebook
6:10 PM Oct 3rd from web

-- @RobertGonzalez

A couple of weeks ago I disabled my Facebook account. I also audited some of my accounts on other social networking sites and either disabled those or deleted them altogether. I have also started to cull my following list on Twitter.

So what prompted these actions, you might ask? The honest answer is... my marriage.

It became clearly evident, shortly after my wife joined Facebook, that my use of social networking was becoming a huge problem for us. What made this so evident was how easy it became to converse with my wife over wall posts and post comments as opposed to real conversations. We stupidly sat in the living room together, commenting on each other's wall posts and replying to each other's comments. And when we weren't communicating with each other on Facebook we were ignoring each other altogether as I sat and Twittered or posted to my Facebook friends' walls and my wife did the same thing with her Facebook friends.

The saddest aspect of all this was that I had never seen that I was doing this until I saw my wife doing this with me. She joined Facebook in June, and while she has only been on it for a couple of months I have been Facebooking for years. I have been Twittering for over a year. I have been keeping up with people through their blogs for years. I have been involved in forums for almost six years. If you look at it, I have traded relationship with my wife for interaction with strangers for upward of six years.

I chose to make myself available to people I would never meet, in whose lives I would really never have any meaning and whose lives really had no significant meaning to me while at the same time choosing not to put any time, effort, energy or expressed interest into the one relationship that should have taken the highest priority in my life. I have made many connections with other women, some married, some unmarried, and have put myself in a position of "caring friend" to them. And while I am sure that these women needed a caring friend I should not have been that friend. My wife needed that caring friend just as bad as the next lonely woman, she needed me more than any other person could have needed me, yet I never took the time or had the inclination to offer myself to her.

Facebook, Twitter and all the other social networking sites... even email, allowed me to spend time I should have spent with my wife, with someone or something else. I spent time getting to know other people. I spent time building relationships with complete strangers. I spent time spending time apart from my wife, even when I was within physical proximity to her.

The truth is, anything that allows a married couple to not spend time with one another while harboring an air of developing relationships with others is just plain bad for your marriage. Facebook definitely fits into this category. So does Twitter and every other social networking site.

By their nature, social internet networks are designed to bring people together with or for a common cause or idea or ideal. While this is not a bad thing, in my opinion, it is terrible if you are substituting a real relationship for virtual ones. Yes, I was doing that. No, that can never be good for your marriage. And no, it wasn't good for mine.

Your spouse should be the most important person in your life. And if your intimacy and relationship with your spouse is suffering then you need to do whatever you can to feed it. In my case, I needed to starve my Facebook relationships and Twitter relationships in order to feed my marriage. And I'd do it again if the need ever arose.

So you may notice that every couple of days my "following" count on Twitter goes down. If I currently follow you and then one day I am not following you anymore, understand that my marriage has to come first. It is nothing personal. I just need to protect my marriage.

And will I ever make it back to Facebook? I don't know. For now I am sticking to the idea that I am only gone for the time being. How long that time is depends entirely on how long it takes me to feed my marriage, which has starved for far too long. I may never make it back on there. And if I don't, I'm fine with that. To me, what is most important is that my marriage is nurtured and that my wife knows, without a doubt, that she is so much more important to me than some website.

Until then, if you really have to keep up with what is going on with me, my family or things that I notice around me, you'll just have to come here to find out if I have mentioned anything. But you can be certain of one thing: I am pouring myself into my marriage now like I used to pour myself into Facebook, Twitter and every other thing I let take the place of my marriage.

For the men: If you notice your marriage starting to take a downward turn take a look at what you might be spending your time on other than you marriage. Your marriage is your most important relationship you could foster. Make sure to treat it that way. Your wife needs your gentleness, intimacy, strength, your concern and your heart. Give it to her, gladly, and sacrifice whatever else you need to in order to allow your marriage to flourish.

For the women: Though I feel horribly unqualified to tell you anything as a man, I can tell you that when it comes to your marriage, your husband needs to know that he is the most important person to you just as much as you need that from him. Pay attention to what you are putting your heart into and where your time is being spent. Your husband needs your intimacy (not sexual intimacy but emotional intimacy) like you need his. Be cognizant of this, and be ready to offer to him whatever you can to show him he is just as important to you as you know you are to him.

17Oct/094

The sweet taste of progress

Three months ago , at the request of my doctor, I took a blood test to measure my overall health and the results of that test were alarming to say the least. Since then I have been working very hard to curb my sugar and sodium intake and, after I received the results of the blood test I took today, I have to tell you I am pretty excited this time around.

The main item I was concerned with was my blood sugar, which last time around was a staggering 142. This time it was down to 105 which is an enormous gain in my opinion. Yes, it is still over 100, but not by much, and it is significantly lower than it was just a few months ago. So I am confident that three months from now my blood sugar will be well under control.

The lab test items that I thought were significant improvements on this lab over the last lab where:

Prior lab results vs. today's results
Test Standard Last time This time
Glucose, Fasting 60 - 99 mg/dL 142 105
Triglycerides <199 mg/dL 151 73
Cholesterol <239 mg/dL 188 154
HDL >40 mg/dL 42 43
LDL <129 mg/dL 116 96

All in all, in the core category areas of concern, I have made significant improvement. No, I am not at all close to being "done" improving - I still have a family to stick around for ;) - but I am very happy with what has transpired over the last three months.

I am also excited about the physical transformation I am undergoing. I have lost just over 30 pounds in this time, have dropped six inches in my waist and about six inches in my chest. I am feeling better about me, about my health and about how much longevity I may be adding to my life. Not to mention that I have an indescribable desire to exercise.

I am looking at different exercise plans that I can do at home right now because I would love to take advantage of this momentum I have developed. I know that coupling exercise with my current sugar-free, low sodium, lower calorie diet will have extraordinary results to say the least. But really excites me is that I can attack my health issues from two different angles: diet and exercise.

I think doing it this way will position me for a longer life, which means more time with my wife and kids overall. And lower life insurance premiums. Which means more savings. Which means I might just be able to afford that motorcycle I have been wanting so very badly.

And seriously, have you ever seen a really fat guy jamming down the highway on a sport bike? Me neither.

For the men: If you are fat (be honest with yourself on this), start working to lose some weight right now. Don't wait. You owe it to your wife, your kids and yourself. And I can say with 100% certainty that your wife will undoubtedly love being able to be closer to you. ;)

16Oct/091

Handling multiple MySQL results in PHP

Back in the day (June of 2007 to be a little more exact) I posted a little snippet about using PHP to hand multiple MySQL query results with the MySQLi extension. At the time it was something I was using just to see what was coming back from the database when I called a stored procedure that happened to have multiple results in it. Skip to how this really works...

Since then I have improved my little handler, added some library code to actually handle queries and results (and timers and requests and... dude, so much). The new code, which is much fatter (not necessarily better, just fatter in that it has a lot more features in it), now encapsulates much of what the original, simple script was doing. Unfortunately, the script is no longer as simple as I wanted it to be. However, it does now come in several files which might be of use to you in some of your own code.

Because of the change that I made to the way this code works, I have decided to package it into a little zip file for your downloading pleasure. The zip file includes:

  • index.php (the actual procedure/result tester)
  • A lib directory, which contains:
    • memorystats.php (A memory use and reporting object)
    • mysql.php (The database connection and query object)
    • mysqlresult.php (The database result object)
    • request.php (The HTTP request object)
    • timer.php (The process timer object)

It should be ready to use right out of the box, with the exception of making sure to add your own username, password and database name to the $db->connect() call (at about line 85 in index.php). I'm sure you could expand it to be more of what you want in a tester (like adding a database chooser to it - right now I have a database server chooser, but not a database chooser within a server) but overall it is a very nice little script that does pretty much what it was built to do: run a query/procedure and return all of the results in it.

Please note: This is seriously not something that you should think to use in a production environment. The farthest this has ever made in any of my architectures is the dev machine. Not that the code is not good. It is just that putting something that has free form access to your database onto a production machine is, in my opinion, a remarkable stupid thing to do and I would hate to have my name associated with code that was used to exploit your business because you chose to put a huge gaping hole into your network through a simple little test script. Just sayin'.

Under the hood
Before diving into that mash of code I included in the zip file, it might be a good idea to see just the relevant code so you can, if you want to, just tap into the multiple result set handling of MySQL results in PHP. Without further ado...

<?php
// Set a query
$sql = "SHOW TABLES FROM `mysql`; SELECT VERSION() AS `version`; SELECT NOW() AS `date`;";
 
// Change the params to you own here...
$mysql = new mysqli('HOSTNAME', 'USERNAME', 'PASSWORD', 'DATABASE');
 
if (mysqli_connect_errno()) {
	die(printf('MySQL Server connection failed: %s', mysqli_connect_error()));
}
 
// Initialize our result set array
$results = array();
 
/** 
 * Check our query results
 * 
 * This is where the magic happens, and it must be this way anytime you use a
 * stored procedure. The reason for that is the MySQL server always sends a 
 * status return with any query, even a select query. That means that even a
 * single result set select query will return two results. Those results will
 * not necessarily make it to your application (I think the client handles 
 * that) but in my experience I have always had to use multi_query to get this
 * to work.
 */
if ($mysql->multi_query($sql)) {
	do {
		// Create the records array
		$records = array();
 
		// Lets work with the first result set
		if ($result = $mysql->use_result()) {
			// Loop the first result set, reading the records into an array
			while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
				$records[] = $row;
			}
 
			// Close the record set
			$result->close();
		}
 
		// Add this record set into the results array
		$results[] = $records;
	} while ($mysql->next_result());
}
 
// Close the connection
$mysql->close();
 
// Set our output type
header('Content-Type: text/plain');
 
// What do we have
print_r($results);

And there you have it. Nice, simple, clean and easy to use all by itself.

13Oct/092

Scope? Nope. Dope!

Today I made a classic blunder in PHP programming. It is one that many make and certainly one I have made before. But the frustrating thing about this issue is it probably would have been caught by a simple unit test or, in lieu of that, something as simple as trying to capture output of my script from the go.

I was working on the command line (something I have been spending a lot more time doing) building a background processing application that will be triggered by the web. The process is expected to take between 45 minutes and an hour each time it is ran and will be ran one time a month at the discretion of an administrator (hence the reason it is not set as a cron job).

One of the very first lines of the CLI script looks like this:

<?php
// Define our path for all includes and file writes
define('APPPATH', realpath('.'));
?>

It would seem simple enough, right? Basically that little line of code defines a constant called APPPATH that would essentially describe the path to the location of the file that is setting the constant. At least that is what I thought. And every test I ran led me to believe that I had indeed made the right choice to set the path the way I did.

I ran the script, and even other scripts that derived code from the script, from the command line on my local Ubuntu machine, from the command line on our Fedora dev machine and from the command line on our Ubuntu production server. I have similar snippets that are working on all of our machines, and these snippets work interactively, through cron and through the web.

But today something happened that I did not intend. As I attempted to run my last process test of this long running script through the web I found myself in a place where my script would not run. It was being triggered properly. It was just not actually doing anything.

After an hour of trying to figure out what I was doing wrong I solicited the wisdom and advice of two of my colleagues who are seasoned Unix professionals and after a couple of minutes I was able to begin to see what was wrong. Can you guess what it was?

That's right... PHP, on the web, was applying its scope to the CLI script that it was calling. The reason it had worked in all cases prior to triggering it by the web was that I was logged in as me and calling the script as a CLI script interactively, through the prompt. That means that the setting of the APPPATH constant was happening as expected and to what I expected.

However, from the web, when PHP runs as an apache module, it calls the CLI script from the scope of the web server. That means that the use of realpath() on the location '.' (current working directory) was assuming the working directory was the web server root, not the location of where the script actually resided.

That's right folks, I lost track of the scope in which I was working. Like a dope.

The simple solution to this problem was to change where the script looks to set its own directory. Can you think of what I could have used, instead of '.' as the location to pass to realpath() so that it knows, without a doubt, what its own path is?

<?php
// Get the real path to the current directory location OF THIS FILE
define('APPPATH', realpath(dirname(__FILE__)));/
?>

I hate it when something this simple causes such deep pain and suffering, needlessly.

1Oct/090

Bite your tongue

Sometimes you just need to not say whatever it is you are planning (or even not planning) to say. For most folks this goes without saying. For many, however, the words that come flying out of your mouth are words that should not have even been thought, let alone released.

I say this as a man that has yet to learn his lesson with controlling his tongue. Too often I will allow myself into a place where my perspective, my own opinion clouds the moment I am in. I allow myself to stop listening intently to the other person and begin to develop my response before the other person is even done talking. What's more, the words that I formulate in my head are often not appropriate for the conversation or for the edification of the person with whom I am speaking. Have you ever experienced that?

I don't have any concrete examples that I am willing to share, but there have been occasions recently in which I was talking with someone and as I spoke it became clear to me that what I was saying was really not at all empathetic to the other person. Really what I was doing was trying to make myself heard over the conversation without listening to what was being spoken to me. How awful that must feel for those that I communicate with. Imagine speaking from your heart and laying it all out there just to have the person with whom you are speaking respond with something completely out of context because he/she felt it was necessary to pour their own feelings, their own opinions into the conversation without a need, really, to do so.

There is a lesson in this for married men. If you are ever talking with your wife and you feel the need to reply in haste or if you have already begun to develop a response to something she has said before she is finished talking, it is a sure sign that what you are about to say would be better off left in your brain. Specifically, as it relates to marriage, it would seem to me that as men, we should want to be able to communicate with our wives on their level of communication. What that means, essentially, is actually listening to her words, and her heart, as she speaks and really trying to empathize with her as she pours herself out to you.

I think sometimes that we as men are so quick to defend ourselves or provide our own spin on things that we lose sight of what is really important at that moment: understanding the person that you are conversing with. Truly, how can we ever really understand someone if we cannot unplug our own opinions and ideas for just a brief moment to really try to see it their way?

Just throwing this out there, for those that are not scared off by a challenge: the next time you have already prepared your response to someone that you are talking with before they are done talking, or before you respond out of your own perspective or opinion, bite your tongue, stop and think for just a second about what they just said, then try to feel it for yourself as they have described it. You might be amazed at what you can learn from someone when doing that.