Tuesday

About Programming: Bash Scripts, Referential Integrity, PHP Rounding

If you can't see this email, click here

About


From Scott Orgera, your About Programming Editor
This week we learn how to make a pregnancy calculator in PHP for those folks either expecting a new arrival or just wanting to learn how to create a really cool counter program. We also delve into the database concept of referential integrity, explain how to create functions and subroutines in Linux Bash scripts, discuss the Require method in Ruby, and much more...

Functions and Subroutines in Bash Scripts
Even though Bash is a Linux shell, it has many of the capabilities needed to be a general purpose programming language, such as loops and conditional expressions. While-loops and For-loops are ways to execute a sequence of instructions multiple times. Functions are another method you can use to prevent code duplication.
Search Related Topics:  scripts  functions  subroutines

PHP Pregnancy Calculator
In this PHP program we make a pregnancy calculator to tell parents to be exactly how pregnant they are in days and weeks, how long they have to wait until their due date, and what percentage of the pregnancy has passed.
Search Related Topics:  pregnancy calculator  due date  gestation calculator

Understanding Referential Integrity
Referential integrity is a database concept that ensures that relationships between tables remain consistent. When one table has a foreign key to another table, the concept of referential integrity states that you may not add a record to the table that contains the foreign key unless there is a corresponding record in the linked table. It also includes the techniques known as cascading update and cascading delete, which ensure that changes made to the linked table are reflected in the primary table.
Search Related Topics:  foreign keys  referential integrity 

PHP: Rounding and Formatting Numbers
Sometimes when you are rounding numbers you always want to round down. For example, if you are calculating how many people will fit in a boat safely, you can't carry .47 of a person, and you can't exceed the capacity. Therefore in this circumstance you would always round down. In PHP this is done with the floor () function.
Search Related Topics:  rounding numbers  php basic functions  php math


Related Searches
Featured Articles
Color Tips for the Web
Is the 'Require' Method Overlooked in Ruby?
Open Source Tools for Game Creation
Java: How to Generate Random Numbers
The Making of the 2013 Mac Pro
Poll: Do You Use HTML5 Email and URL Fields?

 

More from About.com

Run Your First 5K
Even couch potatoes can be ready for a 5K with just a couple months of training. Read more...>



Help! I'm Too Busy
Time and stress management tips to help you feel as though you have more time. Read more...>




 
Sign up for more free newsletters on your favorite topics
You are receiving this newsletter because you subscribed to the About.com Programming newsletter. If you wish to change your email address or unsubscribe, please click here.

About.com respects your privacy: Our Privacy Policy

Contact Information:
1500 Broadway, 6th Floor
New York, NY, 10036

© 2013 About.com
 

Advertisement