My Baby is Growing Up

Maura is officially 1 year old, as of December 2. It doesn’t seem possible; seems like just a few months ago when we were bringing her home from the hospital. Now she’s walking around, taking 7 or 8 steps. Man does time fly. Anyway, here’s a photo from her first birthday.

Little Princess

Little Princess

Tags: , ,

iPhone 3G Dropping Calls

Dear AT&T,

Enough is enough. You know there is a problem with the iPhone 3G dropping calls. Please fix it. I finally went through and did as the forums suggested, and disabled 3G. I shouldn’t have to do that though. I’ve been growing tired of your company and my family will probably be switching to Verizon once our contract is up.

Your loyal customer since 2001,

Eric

Tags: , ,

Piwik Analytics

Has anyone messed with Piwik Analytics? I just got it setup on thejudens.com yesterday, and so far it seems pretty slick. The one thing I like most about it is that the data is mine! I don’t have to share it with google! Right now we have both google analytics and piwik running on the server. I’m going to let them run and see how they compare with each other. I’m just kind of curious how close the results will be with the other. I’ll report back later and let everyone know.

In the meantime, you better go check out Piwik. It runs on php/mysql and you can most likely install it on your hosting account.

Tags: , , ,

Wordpress MU List Blogs

I recently had to make a list of all the active blogs for the university’s blog site running Wordpress MU. Here’s the code to do so:

<?php if(is_front_page()){?>
    <h1>Blog Directory</h1>
 
<?php
    global $wpdb;
    $query = "SELECT blog_id FROM " . $wpdb->base_prefix . "blogs WHERE spam != '1' AND archived != '1' AND deleted != '1' AND public = '1' AND blog_id != '1' ORDER BY path";
    
    $blogs = $wpdb->get_results($query);
    
    echo '<ul>';
    foreach($blogs as $blog){
        $blog_details = get_blog_details($blog->blog_id);
        echo '<li><a>siteurl .'">' . $blog_details->blogname .'</a></li>';
    }
    echo '</ul>';
}
?>

You’ll notice the query is set to filter out blogs that are marked as archived, spam, private. Also, it hides the main blog from the list.

Tags: , ,

Newsletter Converter 1.0.6 Released

Not sure if anyone has noticed, but the Newsletter Converter for Wordpress has been updated to version 1.0.6. Hopefully this release fixes a lot of the timeout issues people were experiencing. You also have the ability to use cURL instead of php’s file_get_contents() function, which is apparently not enabled on a lot of web hosts…go figure.

If you are happy with it, feel free to buy me a beer (in the sidebar).

Tags: , ,

jQuery Image Resize

Let me start off by saying, I LOVE jQuery! It’s the greatest thing since sliced bread! Now that I have that out of the way, I’ve been working on developing some Wordpress themes for work. We are going to be launching a blogs site (using Wordpress MU) fairly soon for faculty, staff, and eventually students. So, in the process we are building a blog that will be used as an online newsletter. On the blog page, they want the top story to take precedence, and for the image to be larger. So to accomplish this, I wanted to scale down the other images and keep the aspect ratio. Enter jQuery…

I was looking out there at some of the solutions already completed. I didn’t see anything that quite did what I was looking for. So I made my own function:

$(document).ready(function() {
    $('.story-small img').each(function() {
        var maxWidth = 100; // Max width for the image
        var maxHeight = 100;    // Max height for the image
        var ratio = 0;  // Used for aspect ratio
        var width = $(this).width();    // Current image width
        var height = $(this).height();  // Current image height
 
        // Check if the current width is larger than the max
        if(width > maxWidth){
            ratio = maxWidth / width;   // get ratio for scaling image
            $(this).css("width", maxWidth); // Set new width
            $(this).css("height", height * ratio);  // Scale height based on ratio
            height = height * ratio;    // Reset height to match scaled image
            width = width * ratio;    // Reset width to match scaled image
        }
 
        // Check if current height is larger than max
        if(height > maxHeight){
            ratio = maxHeight / height; // get ratio for scaling image
            $(this).css("height", maxHeight);   // Set new height
            $(this).css("width", width * ratio);    // Scale width based on ratio
            width = width * ratio;    // Reset width to match scaled image
        }
    });
});

The 2nd line of code says to grab every image with a class of ’story-small’. The block for the height is just a safety net. I have it there in case the height is still larger than the max. There are a hundred ways to skin a cat, so I’m sure there are plenty of other ways to do this.

Tags: , , , ,

HttpWebRequest and Multiple Files

I’m working on a project at work right now to pull inventory data from the bookstore’s point-of-sale system into the e-commerce site I’m setting up for them. One of the parts in the process is to check the web server for any new/updated images for the items on the website. I am doing a web request for each image on the server to see if I really does exist. After doing so many, I noticed that all of the files kept coming back saying they weren’t there, when I know darn well they are! So after a little research online, I noticed that you need to close your Response object when you are finished with it.

Here’s my code:

private static bool _FileExists(string filename) {
    try {
        HttpWebRequest req = (HttpWebRequest)WebRequest.Create(filename);
        req.Timeout = 5000;
        req.Method = "HEAD";
        HttpWebResponse response = (HttpWebResponse)req.GetResponse();
 
        if (response.StatusCode == HttpStatusCode.OK) {
            response.Close();    // IMPORTANT
            return true;
        } else {
            response.Close();    // IMPORTANT
            return false;
        }
    } catch(Exception ex) {
        return false;
    }
}

The big thing to note here is when I’m calling response.Close(), as that closes out the connection. So if you are experiencing issues where you keep getting time out errors, give this a try. Here’s the original article that helped me.

Tags: , , , , , , ,

Core Values

So I’ve been doing some reflecting recently. A blog that I frequently visit, The Art of Manliness, has started a 30 day challenge to becoming a better man. For the first day’s post, they talked about building a list of core values to keep yourself from drifting through life. So, I’ve decided to share my 5 core values with the world (in alphabetical order):

Confidence

This is definitely one of the values that I need to work on. I feel confident in my current work abilities, but there is always room for improvement and the web is always changing. I think I could have more confidence in my role as a father…sometimes I wonder if I’m doing the right things. I would like to have more confidence toward my understanding of church and religion. Also, I would like to have more confidence in my decision making. If I decide on something, stick with it; I obviously chose it for a reason.

Family

Family comes first, what else can I really say on this. I’m sure almost everyone feels the same way I do on this subject.

Honesty

If you are getting an answer from me or seeking my opinion, it will be the honest truth. This is one thing that really bothers me. If you are responsible for something and it is your fault that it fails, own up to it. Rest assured, I always will, no matter the consequences.

Humor

Life can’t always be serious, you’ve got to inject some fun and humor into it.

Trustworthy

I think this one kind of dove-tails into honesty. I am, and always will be a person you can trust.

So, did you think about it? What are your core values?

Tags: ,

Achieving Your Childhood Dreams

This is an excellent video that everyone should watch on achieving your childhood dreams. It is very inspirational and makes you think about how you are using your life. Grab some popcorn, because it’s about an hour and 15 minutes long.

YouTube Preview Image

Tags: , ,

Funny Monday: Picture of the Day

I’ve decided to start a weekly ritual on my blog for a funny picture of someone in my family. For the first one, I’ve chosen easy prey….Maura having a bad hair day. ENJOY!

DSCF1143

Tags: ,