Skip to main content

Posts

Javascript - Rounding numbers to decimal

function roundNumber(number, decimal) { return Math .round(number * Math .pow( 10 , decimal)) / Math .pow( 10 , decimal); } How it works The first thing to understand is how the Math.round() function works in Javascript. The round function takes what ever number that it is given and strips off everything after the decimal point. So if you have a number like 343.12345678 it will return 343. For this example lets say you want to have 2 decimal points left for your output like 343.12. To get the decimal points that we want we need to move the decimal point over 2 spots so that they will not be removed from the round function. Each decimal place is a factor of 10. Tenths, Hundredths, Thousandths, etc. Lets now multiply 343.12345678 by 10^2. 10 is the decimal and the 2 is how many we need to move. You should get 34312.345678. Now if you use the round function you will get 34312 right? So now that we have all the correct numbers we need to get the number back to the right value...

Breakfast Tacos

Ingredients Taco Shells Cheese Bacon Eggs Prepare Cook bacon to desired crispyness. Cook and scramble eggs. Bake taco shells at 350 for 8 to 10 min Put eggs, cheese and bacon in Taco shells Eat your wonderful new breakfast tacos.

MICR Check Printing - Tips for Improving results

Chances are these days if your business has the technology of this century you may be printing your own checks rather than writing them out by hand. If so then you are probably also familiar with MICR printing. MICR stands for Magnetic Ink Character Recognition. This process uses a specialized toner that usually contains an iron oxide so that a check reader can properly read the symbols at the bottom of the check that make a routing and account number. In rolling out printers for the last year I have discover 3 major pieces that can really smooth your results out and have 100% passing rate for your checks. 1. Uniform Document The first thing in any type of document that gets printed is that no matter what content may change the format and placing of certain areas are uniform. For example on a check you may change who the check is to. You might even have a summary of what all the check includes on the check register section. These items must not move the routing number. 2. ...

Javascript SOAP Client

Sometimes it is nice to get data using a SOAP call. However with using Javascript there are some disadvantages and hurdles that you may need to over come. As with any fun little project you will need some materials before we get started. Favorite Text Editor Browser Endpoint for the SOAP call - should be a url SOAP request string If you have all these things ready to go, the next thing we need to make sure of is that the proper headers are set on the server side. If this is not your server that your are trying to hit then you will need to ask the administrator of the server if they can fix up the proper access. The Headers we need are Access-Control-Allow-Origin: * Access-Control-Allow-Methods: POST Access-Control-Allow-Headers: SOAPAction, Content-Type If you happen to have a PHP SOAP server you can add these lines to the top of your code. Please remember that the header functions will need to load before you start printing other text to the page. heade...

Ben and Rose Harrington

Love fills a moment  A moment fills a lifetime  A lifetime begins eternity  Our eternity begins here,  at the wedding of  Rose Mary Black  &  Benjamin Lee Harrington  Please complete our happiness  by celebrating our wedding  At two-o'clock in the afternoon  On August twenty second  Two Thousand Nine  Mt. Moriah Baptist Church  990 Cornersville Rd  Lewisburg, Tennessee  Reception to Follow

PHP LDAP

Simple function to check if a username and password is correct with Active Directory. function checkNTuser($username, $pasword){ $Domain = "SOMEDOMAIN" ; $Server = "ldap://someaddress.co" ; $auth = $username. "@" .$Domain; if (extension_loaded( 'ldap' )){ echo "LDAP Module Enabled" ; $connect = ldap_connect($Server); if ($bind = ldap_bind($connect, $auth, $password)){ ldap_close($connect); echo "Success" ; return ( true ); } else { ldap_close($connect); echo "Failed" ; return ( false ); } } }