Nov 19

I am attending the Nampa First Nazarene church and every Christmas they do an event called Project Shoebox. Project Shoebox gives to school kids that would otherwise not receive anything for Christmas. We provide some basic winter clothing items, toothbrushes(I was surprised at the number of students without toothbrushes!), school supplies, and a few toys. This year we reached 2000 students! When I showed up to the wrapping tonight there were only a few people there, and after wrapping my box and 3 others, I looked up from being absorbed in my work and found the entire gym full of people! It was such an outpouring of love and grace. One that is rare to find.

I took some pics of the wrapping party, click on the image below to see them.

Nov 19

I normally like to keep original content on here, but occasionally I run across really cool article or website and I just have to tell you about it. Any of you ubergeeks out there will love this new datacenter. A ISP in Sweden recently bought a nuclear bunker and turned it into a high tech datacenter. You have to check this out. Click on the picture to see more.

Nov 17

There is a screensaver called electric sheep that I have been using for a while now. It creates cool graphical 'sheep' when your computer is idle and shares them out on the internet.  If you have a high speed connection I encourage you to check it out. The sheep are always changing, and they are usually really fun to watch.

As an example, here is the rendering of one of the sheep that was recently on my machine that I really like

Nov 8

A friend of my sister ran across this picture and sent it to me today. This was from a play called 'All Wee Like Sheep' I think. I was so cute and carefree back then. If only I could recapture those carefree, careless days....

Oct 26

I remembered these crazy pics were on my computer today. Figured y'all would like it if I shared them :D. Click on the picture below to be taken to the rest f the gallery.

Click to see the rest of the gallery

Oct 24

I am currently working on a site where the client has a rich text box to enter content for his articles. This is not unusual in itself, however he wants the ability to do some wikiish syntax in the text box and have the system magically produce the output for him. For instance, \[\[ThisIsSomePage\]\] could create an internal link to some other page on the site. I had not done this before, however I immediately thought of using a regular expression(regex, regexp). A little bit of research confirmed that this would be a good approach, but how was I to get the data between the characters that I chose as delimiters so that I could manipulate it? Turns out that this is a fairly simple and straight forward process.

 
/**
 * Converts all internal links into html links through the use
 * of a wikiish syntax
 *
 * Syntax for internal links:
 * 		\[\[LinkToSomewhere\]\]
 *
 * Converted to:
 * 		<a href="LinkToSomewhere.html">LinkToSomewhere</a>
 *
 * @param String $text - Text to parse
 * @return String - Parsed text
 */
function convert_internal_links($text)
{
    $text = preg_replace_callback(
                "/\[\[([^\]]+)\]\]/",
                create_function(
                    '$matches',
                    'return "<a href="http://ben.lobaugh.net/blog/wp-admin/%5C%22%22.urlencode%28$matches%5B1%5D%29.%22.html%5C%22">$matches[1]</a>";'
                ),
                $text
            );
 
    return $text;
}

It works great, and it seems to be pretty quick too.

Oct 22

There are many times when I have come across situations where I need to remove a parameter from the query string of a URI. Usually these are involved in sorting data from a database, and I want to put a sort_by or some such in the URI as a GET. When the page loads I check for sort_by and if it exists I attempt to sort by it. The problem comes in when I have the link clicked on again. Usually this creates something like &sort_by=col1&sort_by=col2. Now obviously it will sort by the second, which is the one the user wants to sort by, but it looks tacky when they user sees multiple sort_bys in the query string. So I wanted to remove them. I did not know of, or find, a simple way to do this, so I created my own function using regular expressions(regex or regexp).

/**
 
* Will remove the passed in string from the url query string
* NOTE: This changes a global! If you do not desire this
*  sort of functionality change the last line to a return rather
*  than an assignment.
*
* @param string $needle - String to look for and remove
*/
function remove_from_query_string($content, $needle) {
    $query_string = $_SERVER['QUERY_STRING']; // Work on a seperate copy and preserve the original for now
   $query_string = preg_replace("/\&$needle=[a-zA-Z0-9].*?(\&|$)/", '&',   $query_string);
   $query_string = preg_replace("/(&)+/","&",$query_string); // Supposed to pull out all repeating &amp;s, however it allows 2 in a row(&&). Good enough for now
   $_SERVER['QUERY_STRING'] $query_string;
}

For an example of usage let's assume we want to order our ascending or descending list with a get variable called 'direction'

 
$direction = 'asc';
if($_GET['direction'] == 'asc') {
    $direction = 'desc'; // Do the opposite
}
remvove_from_query_string('direction'); // Remove any existing &amp;direction=...
echo '<a href="?order_by=title&' . $_SERVER [QUERY_STRING] . '">Order by title</a>';
Oct 18



Over a month ago I ordered a Dean Edge 10a bass guitar from Musician's Friend. It was back ordered until the end of that week, then it was back ordered till the next month. When that date came around I received ANOTHER back order notice! So I was appropriately irritated at the thought of having purchased a bass that would take months to get to me. Apparently it is a fairly popular bass to buy.

My friend, Andy, was heading up to Guitar Center to get some work done on his acoustic guitar so I figured I would tag along and see if they have my bass and cancel the order with Musician's Friend if they did. Well they did not have any Dean basses at all. But they did have plenty of Ibanez basses. I like the Ibanez basses. I found the GSR200. It is a good quality bass with a wide range of sounds available to it. It also has an active pickup system, which is something I wanted. So I picked it up and now am canceling my, back ordered 3 times, Musician's Friend bass.

I took a few pictures of it that you can find on my photo gallery

Oct 16

An amazing new website was launched today. It details the life and times of Mr. Mitch. Be sure to checkout his new content!

Mitch's Personal Life

Oct 14

Northwest Nazarene University Bookstore used to have a web site. Actually more of a single page with a few items on it. This week the brand new website(yes a full site this time) has been launched!

The new website allows the bookstore employees to easily manage their online inventory. It magically integrates into their desktop and POS systems to keep track of inventory changes as well as price, description, etc.

Take a look Northwest Nazarene University Bookstore

« Previous Entries