MyCollegeExchange is the project that eventually inspired me to develop UniversityLite, a rapid deployment e-commerce tool to market university products and information to university students over the web using PHP and other tools. UniversityLite has it’s own section dedicated on the homepage for more information.
Getting back to MyCollegeExchange. Sometimes you just want to build a website from scratch. No CMS, no templates. Not always the prettiest, but the result here became MyCollegeExchange and features a website that allows students to buy and sell used textbooks on College Campuses. The website was built using PHP, JavaScript, HTML, CSS and has a SQL backend.
Some of the noted areas I had to develop for the site were:
InnoDB SQL Database Using Referential Integrity
In order to allow books, members and transactions to be kept as separate entities, I constructed a database with certain constraints. The books table uses an auto incrementing Primary Key that is referenced by the selling table. Additionally the members table has a Primary Key also referenced by the selling table. This table is then later joined using JOIN to generate all the necessary components for who is selling what, when and where. The database has been normalized to the 3rd Normal Form.
The website has been developed to be easily deployed in a new setting by creating the necessary SQL database based on variables set in a settings file that is called during installation:
$data='";
file_put_contents("./data/settings.php",$data);
echo '';
$con=mysql_connect($_POST['hostname'],$_POST['dbuname'],$_POST['dbpwd']);
echo '';
if ($con)
{
if(mysql_select_db($_POST['dbname'], $con))
{
$sql = "CREATE TABLE IF NOT EXISTS `user_info` (
`Username` varchar(32) NOT NULL DEFAULT '',
`Password` varchar(32) DEFAULT NULL,
`email` varchar(40) NOT NULL,
PRIMARY KEY (`Username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
mysql_query($sql,$con);
The database is queried and updated using mysql_connect, mysql_select_db, mysql_query and mysqli_query PHP statements. For example, this snippet updates the selling table when posting a book using the Post form on the website:
$db = mysqli_connect("$LOGIN_DB_HOSTNAME", "$LOGIN_DB_UNAME", "$LOGIN_DB_PWD", "$LOGIN_DB_NAME");
$postSelling = "INSERT INTO selling (BookNumber, Username, Date, Price, ConditionOfBook, Description)
VALUES ('$booknumber','$user','$todaysdate','$price','$conditionofbook','$description')";
Search
Algorithm
In order to generate search results, I developed a simple search algorithm that uses SQL JOIN statements to link our three tables.
if(isset($_POST['submit'])){
if(isset($_GET['go'])) {
if(preg_match("/^[ a-zA-Z]+/", $_POST['name'])){
$name=$_POST['name'];
//connect to the database
$db=mysql_connect ("$LOGIN_DB_HOSTNAME", "$LOGIN_DB_UNAME", "$LOGIN_DB_PWD") or die ('I cannot connect to the database because: ' . mysql_error());
//-select the database to use
$mydb=mysql_select_db("$LOGIN_DB_NAME");
//-query the database table
$sql = "SELECT user_info.Username, books.BookTitle, books.ISBN, books.Author, selling.Date, selling.Price FROM selling
JOIN books
ON books.BookNumber = selling.BookNumber
JOIN user_info
ON user_info.Username = selling.Username
WHERE books.BookTitle LIKE '%" . $name . "%' OR books.Author LIKE '%" . $name ."%' OR books.ISBN LIKE '%" . $name ."%'";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result)){
$BookTitle =$row['BookTitle'];
$Author=$row['Author'];
$ISBN=$row['ISBN'];
$Price=$row['Price'];
echo "" . "$" . $Price . " " . $BookTitle . "
";
echo "Author: " . $Author . " ISBN: " . $ISBN . "";
echo nl2br("\n");
}
}}}
Automatic Page Generation For Results
Once we get our search results based on the JOIN operation, each result becomes a clickable link that takes the user to auto-generated PHP page with more detailed results:
if (isset($_GET['id'])) {
$ISBN = $_GET['id'];
$db=mysql_connect ("$LOGIN_DB_HOSTNAME", "$LOGIN_DB_UNAME", "$LOGIN_DB_PWD") or die ('Can't Connect: ' . mysql_error());
$mydb=mysql_select_db("$LOGIN_DB_NAME");
$sql = "SELECT user_info.Username, user_info.Email, books.*, selling.* FROM selling
JOIN books
ON books.BookNumber = selling.BookNumber
JOIN user_info
ON user_info.Username = selling.Username
WHERE books.ISBN LIKE '%" . $ISBN ."%'";
//-run the query against the mysql query function
$result=mysql_query($sql);
while($row=mysql_fetch_array($result)){
$BookTitle =$row['BookTitle'];
$Author=$row['Author'];
$ISBN=$row['ISBN'];
$Price=$row['Price'];
$Username=$row['Username'];
$Date=$row['Date'];
$Email=$row['Email'];
$ConditionOfBook=$row['ConditionOfBook'];
$Description=$row['Description'];
echo "
Live Form Validation
The forms used to register, post and manage posts have automatic line validation as the user progresses through the form. Each form calls a javascript function for validation. For example, here we have the javascript functions to validate the Post a Book form:
function validate_book()
{
if (flag6==1 && flag7==1 && flag8==1 && flag9==1 && flag10==1)
{
alert("Everything Checked Out. Your book is posted!");
return true;
}
else
{
alert("We found some errors in your book information.");
}
}
function validate_booktitle()
{
var booktitle = document.getElementById("booktitle").value;
var valbooktitle = booktitle.search(/^[a-zA-Z0-9_]+/);
if (booktitle = ""||valbooktitle != 0)
{
document.getElementById("booktitleInfo").className="error";
document.getElementById("booktitle").className="error";
document.getElementById("booktitleInfo").innerHTML="Title must be only letters or numbers";
}
else
{
document.getElementById("booktitleInfo").className="success";
document.getElementById("booktitle").className="success";
document.getElementById("booktitleInfo").innerHTML="Title looks good!";
flag6=1;
}
}
function validate_bookauthor()
{
var bookauthor = document.getElementById("bookauthor").value;
var valbookauthor = bookauthor.search(/[a-zA-Z]+/);
if (bookauthor = ""||valbookauthor != 0)
{
document.getElementById("bookauthorInfo").className="error";
document.getElementById("bookauthor").className="error";
document.getElementById("bookauthorInfo").innerHTML="Author must contain only letters";
}
else
{
document.getElementById("bookauthorInfo").className="success";
document.getElementById("bookauthor").className="success";
document.getElementById("bookauthorInfo").innerHTML="Author looks good!";
flag7=1;
}
}
function validate_bookisbn()
{
var bookisbn = document.getElementById("bookisbn").value;
var valbookisbn = bookisbn.search(/^\d{10,13}$/);
if (bookisbn = ""||valbookisbn != 0)
{
document.getElementById("bookisbnInfo").className="error";
document.getElementById("bookisbn").className="error";
document.getElementById("bookisbnInfo").innerHTML="ISBN must be at 10 or 13 numbers only";
}
else
{
document.getElementById("bookisbnInfo").className="success";
document.getElementById("bookisbn").className="success";
document.getElementById("bookisbnInfo").innerHTML="ISBN checks out!";
flag8=1;
}
}
function validate_bookprice()
{
var bookprice = document.getElementById("bookprice").value;
var valbookprice = bookprice.search(/^\d{1,}$/);
if (bookprice = ""||valbookprice != 0)
{
document.getElementById("bookpriceInfo").className="error";
document.getElementById("bookprice").className="error";
document.getElementById("bookpriceInfo").innerHTML="Please use whole dollars only such as 8. Pennies are for pansies";
}
else
{
document.getElementById("bookpriceInfo").className="success";
document.getElementById("bookprice").className="success";
document.getElementById("bookpriceInfo").innerHTML="What a great price!";
flag9=1;
}
}
function validate_bookdescription()
{
var bookdescription = document.getElementById("bookdescription").value;
var valbookdescription = bookdescription.search(/^[a-zA-Z0-9_]+/);
if (bookdescription = ""||valbookdescription != 0)
{
document.getElementById("bookdescriptionInfo").className="error";
document.getElementById("bookdescription").className="error";
document.getElementById("bookdescriptionInfo").innerHTML="Please use only letters or numbers";
}
else
{
document.getElementById("bookdescriptionInfo").className="success";
document.getElementById("bookdescription").className="success";
document.getElementById("bookdescriptionInfo").innerHTML="Cool!";
flag10=1;
}
}
Business Plan
The website concept was guided with a business and marketing plan that looked at competition, funding, etc.
As someone with a lifelong fascination for automotive technology, I have gained an extensive amount of knowledge and hands-on experience through various projects I’ve completed in my spare time. I take great pride in following the manufacturer’s factory service manuals to ensure that each project is executed properly and to the highest standard.
One of the most challenging projects I have undertaken is complete vehicle teardowns. This involves the careful disassembly of the entire vehicle, down to the last bolt, and reassembling it according to the manufacturer’s specifications. This has given me a comprehensive understanding of the vehicle’s design and function, from the engine and transmission to the suspension and brakes.
I have also tackled more specific projects, such as transmission and engine teardowns and swaps. This involves dismantling and rebuilding the components of the engine or transmission, replacing any worn or damaged parts, and then installing the reconditioned component back into the vehicle. This requires a high level of precision and attention to detail, as even the slightest mistake can result in major damage to the engine or transmission.
Another area of interest for me is wheel and transaxle upgrades. Upgrading the wheels can improve the vehicle’s overall performance, handling, and appearance. Meanwhile, upgrading the transaxle, which includes the differential, axles, and transmission, can significantly enhance the vehicle’s drivetrain and power delivery.
Finally, I have also delved into electronic performance upgrades or changes. This can involve reprogramming the vehicle’s engine control unit (ECU) to increase horsepower and torque, adjusting the timing or fuel delivery to optimize performance, or installing aftermarket components such as a cold air intake or performance exhaust system. These upgrades require a deep understanding of the vehicle’s electronic systems and an ability to troubleshoot any issues that may arise.
Overall, my automotive projects have given me a great deal of satisfaction and knowledge about the inner workings of cars. I am always eager to tackle new projects and continue to expand my understanding of automotive technology.
Documentation Thumbnails
I once embarked on a musical adventure that led me to experiment with different music technologies, resulting in a collection of two techno singles that I proudly named my “weird Sunday on the computer” project. I am grateful to Gerry the cat for providing the awesome photo that graced the album cover.
The first single, “404 England,” takes the listener on a thrilling ride through the underground techno scene in Britain, complete with pounding bass and electrifying beats that are sure to make any dance floor shake.
The second single, “You Know How You Love Mario,” is a playful tribute to one of the most iconic video game characters of all time.
Both singles were produced by Stony Studio, and I am proud to have added my own unique touch to the world of techno music with these creations.
Track 1 – Britain Presents – 404 England
Track 2 – You Know How You Love Mario
Produced by Stony Studio.
CD Art Thumbnails
David Maiolo’s album, “Piano,” is a unique exploration of melody, harmony, and rhythm that showcases a journey through different cultures and moods, each piece conveying its own story and emotions.
Track 1 – American Series – Crystal Ocean
Track 2 – African Series – A Song for Kenya
Track 3 – American Series – Morning Tide
Track 4 – Korean Series – Coercion
Track 5 – American Series – Late Night Moon
Produced by Stony Studio.
CD Art Thumbnails
This project involved designing and programming a Printed Circuit Board (PCB) for very low photon detection assisted transit photometry to detect extrasolar planets. I worked with a team of design and electrical engineers to develop the final project.
I utilized CadSoft EAGLE PCB Design software and programmed using C/C# to create the project. The project structure includes the Pictavore Server, an ASCOM driver for Pictavore cameras, camera driver, filter wheel driver, focuser driver, and various .bat files. The ASCOM Camera Driver was developed in C#, and it produces an in-process (assembly) based driver.
In addition to my contributions to the programming and design of the PCB, I also assisted with testing and debugging the final product. Overall, this project was an exciting opportunity to apply my skills in programming and electrical engineering to a real-world application in astronomy research.
Beta solution testing in low-light conditions:
The Infix Expression Evaluator is a powerful algorithm that takes an arithmetic expression in infix notation, converts it to postfix notation, and evaluates the expression using C-style evaluation. This is a GUI-based interface that allows users to evaluate C-style arithmetic expressions and display their values.
Unlike other programming languages, C does not have a separate Boolean data type, and thus, it has no Boolean expressions. The Infix Expression Evaluator algorithm accommodates this missing Boolean ability by handling Boolean values true and false as non-zero and zero numbers, respectively. The algorithm works with expressions containing numbers, arithmetic and comparison operators, and logical connectives, using only the following operators: comparison operators (<, <=, >, >=, ==, !=), binary logical operators (&&, ||), and binary arithmetic operators (+, -, *, /, %). Positive integer arguments are allowed, and the algorithm assumes C-style evaluation: false is equal to 0, and true is equal to 1 (anything non-zero).
The algorithm is made up of ten files, including ArrayListStack.java, ArrayStack.java, Expression.java, ExpressionEvaluator.java, ExpressionEvaluatorTester.java, ExpressionGUI.java, InfixToPostfixConverter.java, IStack.java, PostfixEvaluator.java, and Token.java.
The InfixToPostfixConverter class is responsible for converting the infix expression to postfix notation. It creates an empty postfix expression, an empty operator stack, and uses temporary local variables to keep track of the tokens. The main loop gets the next token from the infix expression, determines whether it is an operand or an operator, and appends it to the postfix expression or pushes it into the operator stack, respectively. If the next token is a closed parenthesis, the algorithm pulls operators out of the stack and appends them to postfix until it reaches an open parenthesis. If it is an operator, the algorithm compares the precedence of the next token and the top of the stack, and then pushes or pulls operators out of the stack as needed. Finally, it pulls all the operators out of the stack and appends them to postfix.
To demonstrate the Infix Expression Evaluator, we will use a tester to convert and evaluate the following infix expressions: 10 * 5 + 3, 10 * ( 7 + ( 12 – 9 ) ) / 10, and 100 % ( ( 3 + 2 ) + 3 ) / 4. The first expression evaluates to 53, the second to 10, and the third to 1.
The GUI allows users to enter an infix expression manually and compute its value. It is an intuitive way for users to see the algorithm at work and easily evaluate their expressions.