Website Design and Mobile Application Development in Austin, Texas

Blog

Simple PHP Function for Iterating over Microsoft Excel Column Names

I recently had a need to create a function that iterates over a list of strings and writes them out to a column in a Microsoft Excel spreadsheet that I was creating for a client. In Excel, the columns are labeled A-Z, AA-AZ, BA-BZ, etc… and it continues on.  I couldn’t find any existing functions in PHP that did this, so I wrote my own below:

function column_name($index) {
  if($index<27) {
    $letter = “A”;
    for($i=1; $i<$index; $i++) {
      $letter++;
    }
  } else {
    $div = intval($index / 27);
    $mod = $index % 27;
    $letter = column_name($div);
    $letter.= column_name($mod);
  }
  return $letter;
}

Read the rest
Posted on October 31st, by Peter in Tutorials.

Review of Adobe Creative Cloud – It’s the Worst

Recently I decided to signup for the adobe creative cloud monthly subscription plan available from Adobe at http://www.adobe.com/products/creativecloud.html.  I have older versions (CS3) of Photoshop and Dreamweaver and wanted to try getting the latest copies of each on my system.  Also thought it was a nice deal as it would allow me to have a full version of Acrobat and I could play with Illustrator in case I ever had clients send me AI files that I needed to work with.

So in theory, it was a pretty good deal…$50 monthly for three/four solid adobe products, two of which I use on a daily basis.  In practice, it turned out to be a pretty bad deal due to the … Read the rest

Posted on September 27th, by Peter in News, Recommendations.

Simple Function to Remove URLs Posted in WordPress Comments

As part of an effort to combat spam for a web design client using wordpress, I have been tasked with removing urls from comments that are posted to his wordpress blog. Most articles and tutorials on the web mention removing the comment input field from the comments form. This, however, won’t work since most spam bots are posting their generated comments directly to wordpress and are bypassing the comments form directly.

The only way to do this completely that I was able to come up with was to use this simple function.  Add the following code to your wordpress theme’s functions.php file.

function disable_comment_url($fields)
{
return ”;
}

add_filter(‘pre_comment_author_url’,’disable_comment_url’);

This code is a hook into the pre_comment_author_url filter in wordpress … Read the rest

Posted on March 19th, by Peter in Uncategorized.

GoDaddy Dedicated Server Disaster Recovery, Part 2

This is a follow up to this post from two years ago (http://www.halfslide.com//2010/03/14/review-godaddy-dedicated-server-disaster-recovery/). 

This past week, the same client who had her server crash at Godaddy in 2010 had it happen again.  The server went down and we only noticed it when all of the websites she was hosting went offline.  I was about to run to a meeting so I logged into godaddy and requested a hard reboot of the server through their server control panel.  About an hour later, we got an email that the server restart had been completed.  There was no mention that there was still an issue, but the server was still definitely dead.

My client called Godaddy directly to speak with someone in … Read the rest

Ranking Teams based on Win/Loss/Tie Record using PHP’s usort()

For a current project I’m working on, I’ve had to rank a list of teams based on their win-loss-tie record within their division acheter viagra en ligne. I searched the web but was unable to find anyone who had done this and posted an example so I figured I’d post my process. If you have corrections or improvements for this, please feel free to comment.

The code assumes that you have an array of team objects that each have a win/loss/tie property. As an example, I’ve got an array of five teams such that:

Array
(
  [0] => stdClass Object
  (
    [id] => 1
    [name] => Team 1
    [wins] => 5
    [losses] => 6
    [ties] => 3
  )

  [1]

Read the rest
Posted on April 6th, by Peter in Tutorials.

Halfslide Design Launches Mobile Site

Halfslide Design is happy to announce that we have completed our new mobile site at m.halfslide.com. If you are on a smart phone, you will now be automatically redirected to the mobile version of our site with scaled down pages including our list of services, contact information, portfolio of web design projects, and list of testimonials from happy clients.

Usability was the main motivation for creating the mobile site.  The site provides visitors with a better experience by serving them smaller images, less css and javascript, and formatting the navigation and text in such a way that they do not have to zoom or horizontally scroll.

The mobile site was designed to be compatible with all mobile browsers on smart … Read the rest

Posted on January 27th, by Peter in News, Projects.