Clocker was built using the Ruby on Rails (RoR) framework. The Ruby design-paradigm puts a strong emphasis on writing clean and understandable code that doesn’t try and be too clever. During development this philosophy was taken to heart; strong separation of concerns and the single responsability principle were kept in mind for all aspects of the application. The RoR framework tends to allow presentation logic to leak into the presentation markup. However in the spirit of proper design, the Mustache templating framework was used to provide a clean separation of presentation logic from markup. Database design was also thoroughly thought-out to ensure proper referential integrity of entities.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var last_details = $(); | |
$('body').on('click','.info', function (e) { | |
// Don't let the page reload | |
e.preventDefault(); | |
last_details.remove(); | |
last_details = $('<div>').html(content_from_ajax) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void LinkedList<T>::reverseList() | |
{ | |
ListNode<T> *previous; | |
previous = NULL; | |
ListNode<T> *temp; | |
while(head != NULL) | |
{ | |
temp = head->next; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL | E_STRICT); | |
Class lotto{ | |
private $_connection; | |
function __construct() | |
{ | |
$auth = include("login.php"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ($games as $game) | |
{ | |
// The default values array.. all empty | |
$default = array_combine($games, array_fill(0, length($games), '-')); | |
try | |
{ | |
$sth = $dbh->prepare("SELECT * FROM $game ORDER BY date $sort"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('File.Class.php'); | |
Class lotto{ | |
public function init(){ | |
$dbName = "lotto"; | |
try { | |
$dbh = new PDO('mysql:localhost:3306', 'root', ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo ' <link href="common/style.css" rel="stylesheet" type="text/css" />'; | |
echo "<body onLoad='document.getElementById('song').select();'>"; | |
//create a PDO object to interface with the database | |
try { | |
$dbh = new PDO('mysql:localhost:3306', 'root', ''); | |
} | |
catch (PDOException $e) { | |
echo 'Connection failed: ' . $e->getMessage(); |