Brandon Smith
18May/120

BenchMax Bench Press Calculator for iPod/iPhone/iPad


NEW

I've just released an update for the new BenchMax bench press max calculator on the Apple App Store.  It can be found at www.benchmaxapp.com .  Enjoy!

Click here for a direct link to the iTunes/App Store

BenchMax App for iOS

BenchMax App for iOS

 

Description:

Calculate your bench press maximum quickly! Get a list of percentage-based-weight to use immediately in your workout! Light, lean, & effective: BenchMax is a simple utility for the weightlifting enthusiast to whom the details matter. BenchMax is an application that allows users to calculate an estimated weightlifting one-rep maximum quickly and effectively. It also provides users with a table of commonly-used percentages and their associated values when compared to the calculated maximum, that are commonly used in designing workout programs.

What's New in Version 1.0.1:

-Added support for iPad/iPad Retina Display.
-Added ability to calculate units in kilograms(kg).
-Added ability to freely convert input weight, percentage tables, and max between pounds and kilograms.
BenchMax Screen 1    BenchMax Screen 2    


Filed under: Uncategorized No Comments
29Apr/120

Casting strings as integers for sorting

If you're coming on an existing web application project and find yourself building sortable tables, chances are you've come across situations in which you need to sort these tables numerically but they're stored as type VARCHAR (aka strings).  If so, don't fret!  you don't have to rebuild your table.  Simply cast the fields as strings in your SQL query (whether this be in Drupal, C#/ASP.NET, general PHP, etc..) do your own hunting on where to do so.  The actual query, however, is:

SELECT * FROM <tablename> ORDER BY CAST(<columnname> AS SIGNED) ASC

to cast the field as an integer and correctly sort the numerical order.  Variations of this query will have different effects - chop it up at your convenience!

Filed under: Uncategorized No Comments
22Jan/120

Evaluating Regular Expressions in PHP

It goes without saying that there are obvious benefits to using server-side validation of forms.  From e-mail validation to username formatting, it's important to use regular expressions to make sure any data being passed is both secure and compatible with your SQL database.  It's also important to use server-side validation over client-side(ex. JavaScript) to prevent SQL injection or any other malicious behavior.

Below is a basic example of how to evaluate a regular expression using PHP.  IF you're somewhat familiar with the language, the code should be easy enough to follow.  Please feel free to use at your own discretion; remember once a field/string has been evaluated the options are endless when handling the results!

A live example of the following code can be found here.

NOTE: Please forgive the formatting in the following snippet.  This is a current limitation of the blog and the majority of the whitespace is formatted incorrectly.

--------------------------

<?php
#pull POST variable from form submission
$str = $_POST['str'];

#define the function run the regular expression for the string value submitted
function parseString($x){

  #define the regular expression and set as variable: will return 1 if true(validated) or null if
    #the requirements are not met

    $evaluated = eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $x);

    #echo the input string for the sake of seeing results
  echo $x;

    #evaulate the regular expression and return a message if true or false
if ($evaluated){
echo " You've entered a valid e-mail address.";
} else {
echo " Please enter a valid e-mail address.";
}
}
?>
<!DOCTYPE HTML>
<body>
    <?php
    #execute the parseString function and pass the form-submitted variable
    parseString($str);
?>
<br />
    <!-- html for the form submitting the field/string under question -->
<form method="POST" action="regex.php">
<input type="text" id="str" name="str" /><br />
<input type="submit" value="submit" id="submit" />
</form>
</body>
</html>

Filed under: Uncategorized No Comments
21Jan/120

New Job @ Astonish Designs

I've recently begun my new job at Astonish Designs - feeling really lucky to work with such a great team on some incredible projects! Check out the website - www.astonishdesigns.com

Filed under: Uncategorized No Comments
21Jan/120

Welcome!

If you're reading this you've haphazardly stumbled upon my blog. I'm in the process of building the rest of the site, so feel free to occasionally check back from time to time as I get around to posting content. You can also use the links above and on the side to download my resume or navigate to my various social media outlets. Thanks for stopping by!

Brandon

Filed under: Uncategorized No Comments
28Sep/110

Hello, World!

Check 1, 2, 3 Check

Filed under: Random No Comments