Skip to main content

Posts

Showing posts from December, 2014

Simple tip for OOP MySQLi in PHP

The purpose of this tutorial is to show you how I use PHP's OOP MySQLi in larger projects.

For larger projects, I like to separate out the connection to the MySQLi in another file. We'll call the class db_connect.php since that's what most books seem to reference it as.

db_connect.php--
















I'll take it another step further and create a class that's going to make it simple for me to call other classes. I'll call
it ClassInitialization. This class will only contain one method className()and it's purpose will be to initialize other classes.

class_initialization.php
--
















As is evident from the above code, the className() method requires 2 parameters: the name of the class that you want initialized and an optional file location parameter. It'll then require_once() the file and return the new ClassName object.

To put the 2 classes that we've created together, you'll need to create a third class that will do something specific for your website. In this case I'…

Text Message Reminders

Sientists from Queen Mary University of London have found text messaging prevents one in six patients from forgetting to take, or stopping, their prescribed medicines.

Perfect example of how technology continues to shape and extend our lives. I don't think it'll work particularly well in patients over a certain age group, but the younger generation could definitely benefit. 

A simple calendar application on your phone has the ability to remind you about anything at any time at any frequency.

First Step to Mars

After an anticlimactic day on December the 4th, 2014, NASA regrouped, fixed the issue on the Orion and it launched successfully today. The unmanned spacecraft was NASA's attempt at testing some key components for the manned deep space exploration program that will occur in 2030 if everything goes according to plan.

The shuttle was in orbit 3600 miles above Earth for four and a half hours after which it successfully splashed into the Pacific Ocean off of the coast of Baja, California.

Deep Space exploration and hopefully colonization is key to our survival as a species. It's exciting to know that we're going to be alive to witness the beginning of such efforts. Everyone has a plan B, and we as a species need to have one too.

Artificial Intelligence is a risk to humanity

Artificial intelligence is a risk to humanity says astrophysicist Stephen Hawking.

The guy is undeniably brilliant. I'm not sure why he believes that speaking about AI currently is of importance but I still value his opinion. It could be simply that he himself doesn't know how much longer he has left and is prepping the future generations from making a mistake that they won't be able to correct.

I think we're still a good ways from having to worry whether our creations will turn against us, but I do believe it's coming. Just like anything else, there will come a point in time where our ability to share information will completely surpas our ability to dignose and comprehend the vast knowledge effectively. We'll naturally strive to create machines that will evaluate that information in a time-frame that would be impossible or impractical for the human race to compute it in. I know that currently we have vast machines that do this already, however there will come …

Future Scientists

According to George Mason University, parents and family make all the difference in creating the next generation of scientists, engineers and mathematicians. The research team surveyed 149 participants in the Aspiring Scientists Summer Internship Program from classes from 2007 to 2013. This competitive internship attracts top high school and undergraduate students who work on real-world research.

It's almost humorous that research had to be conducted for such a common sense topic; but I guess if scientists want to receive a federal grant they need to show some sort of research regardless of how nonsensical it may seem.

This is not to downplay the situation where parents without a doubt need to take a serious approach in guiding their children towards an academic lifestyle. Parents need to expose their children to a cornucopia of topics and monitor which of those the child tends to favor. More effort should then be placed to expose that child to said topic as frequently as possible. …

Obama vows action

President Barack Obama made a forceful pledge on Monday to use his last two years in office to address the "simmering distrust" between police and minority communities as he requested $263 million for the federal response to the civil rights upheaval triggered in Ferguson, Missouri.

Obama in my opinion is not doing a good job with addressing these situations. After the verdict was released, Obama instantly failed. First he appeared on television moments after the decision was announced : there have been other more pressing issues in which he chose to wait before deliberating. If he wanted to say anything it should have been in passing. Second, he unknowingly told the people to get up and let themselves be heard. "Protest peacefully," He knew exactly what was about to happen.

If he wanted to appear on television he should have said, "people, go home. This is a nation built on laws. You may or may not agree with those laws but they're in place. If you have an …