Thursday, March 22, 2012

Dodge Stratus Battery replacement

Recently I had the fun of replacing the Battery in a 2005 Dodge Stratus.  At first I could not find the battery but after following some cables back to the battery, I located it.
To replace the battery you must first remove the Left Front tire.  Then you have to remove the plastic around the front of the wheel well.  Next you need to disconnect the ground, then the positive, then remove the brace that goes in front of the battery.  All told it takes about 45 minutes to do.

Tuesday, March 20, 2012

I have been featured on EE Web!

I have been featured by Wired Magazine, Hacked Gadgets and now by EE Web.  Check it out:
http://www.eeweb.com/spotlight/interview-with-bob-davis

Thursday, March 15, 2012

Samsung Syncmaster 214T repair

Samsung Syncmaster 214T repair for the symptom of a faint and flashing picture.

The solution is to replace 5 capacitors in the power supply.  They are 3 x 330 uf at 25 volts and 2 x 820 uf at 25 volts.  It is safe to use 470 uf and 1000 uf capacitors to replace them if you do not have the correct values in stock.

Dis-assembly can be a little tricky.  Start by removing the base by removing the 4 screws on the back of the monitor.  Then there are catches all around to remove the front.  Start at the bottom, and watch out for the short cable to the front controls.  Once the front bezel is removed, the guts come right out.  Then remove the metal cover and there is the power supply.

There are 5 capacitors that are bulging as can be seen in the picture below, replace them.

Monday, March 12, 2012

How to get more gas milage or better MPG

When I purchased my van it only got about 16 miles per gallon. So I set out to improve on that. First replace the spark plugs. Use platinum as a minimum, there is also split-fire and ring-of-fire plugs that will help give better MPG's.

Second add some magnets to the fuel line. Here are two sets of hard drive magnets on the fuel line of my 2001 Ford Windstar.

Next add a spacer to your oxygen sensor. The problem is that the car is running so well that the computer thinks it needs to pollute some more. Adding the Oxygen spacer tells the computer that the exhaust is more polluted so it will stop dumping so much fuel.
So far I am getting about 25 Miles Per Gallon, I will keep working on it with a goal of getting up to 30 MPG.....

Wordpress - How to replace TimThumb Improved

Back in 2009 I replaced TimThumb in the Mimbo WordPress Template with a change in the function that was used to get the thumbnail images. This function is found under "Theme Functions" and it is called "Get_post_image". The problem was that TimThumb was slow, and there already is a thumbnail image created whenever you upload an image to your Wordpress blog. That created thumbnail image usually ends in "-150x150.jpg".

The version of this function that I wrote back in 2009 was too slow because it used the "if file exists" test to see if the image name that it created was correct and if it did not exist then it went with the full sized image and just scaled it down by specifying a width and height of 150 and 150.

So the simplest way to select the already available thumbnail image is to remove the last 12 digits and replace them with "-150x150.jpg", Right? Unfortunately reality varies greatly from theory. The first problem is that you might have a ".gif" or some other image extension. So you have to remove the extension, then remove the next few digits, then replace them and then put the extension back.

Well that works about 75% of the time. The next issue that you have to deal with is if the image is smaller than around 600 pixels wide, there might not be any extension added onto the image that needs to be removed, so you just need to add the "-150x150" to the image. How can you tell what format the image is in? That is done by breaking down the image and then looking for first a "-", then a 3 digit number, then an "x" then, optionally, a second three digit number. So here is the code to do all of that:




/* For Getting the Image FASTER */
//GET-POST-IMAGE1 by Bob Davis - improved version of script by Tim McDaniels

function get_post_image1 ($post_id=0, $width=0, $height=0, $img_script='') {
  global $wpdb;
  if($post_id > 0) {
    $sql = 'SELECT post_content FROM ' . $wpdb->posts . ' WHERE id = ' . $wpdb->escape($post_id);
    $row = $wpdb->get_row($sql);
    $the_content = $row->post_content;
    if(strlen($the_content)) {
      preg_match("/<img src\=('|\")(.*)('|\") .*( |)\/>/", $the_content, $matches);
      if(!$matches) {
    preg_match("/<img class\=\".*\" title\=\".*\" src\=('|\")(.*)('|\") .*( |)\/>/U", $the_content, $matches); }
    $the_image_ext = substr($matches[2],-4);
    if ($the_image_ext == ".JPG") {  $the_image_ext = ".jpg"; }
    $the_image_dash = substr($matches[2],-12,-11);
    $the_image_num = substr($matches[2],-11,-8);
    $the_image_x = substr($matches[2],-8,-7);
// replace -???x??? with -150x150 and then add .jpg back on
    $the_image_src = substr($matches[2],0,-4);
    $the_image_repl = $the_image_src . '-150x150' . $the_image_ext;
// just add -150x150 and then add .jpg back on
    $the_image_src = substr($matches[2],0,-12);
    $the_image_add = $the_image_src . '-150x150' . $the_image_ext;
// Check to see it the name ends in -???x???
        if(($the_image_dash=='-') && (is_numeric($the_image_num)) && ($the_image_x=='x')) {
       $the_image = '<img alt="" src="' . $the_image_add .'" width="' . $width . '" height="' . $height . '" />';
           } else {
           $the_image = '<img alt="" src="' . $the_image_repl . '" width="' . $width . '" height="' . $height . '" />';  
                 }
        return $the_image;
      }
    }

  }