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
/* | |
* Description: | |
* Returns a count of new listings, ratings, students, landlords, or roommate requests | |
* that were made within 30 days. | |
* | |
* Input: | |
* $type = 'listings', 'ratings', 'students', 'landlords', or 'roommate'. | |
* | |
*/ |
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 free_list(node** head){ | |
while(*head){ | |
node* next = (*head)->next; | |
(*head)->next = NULL; | |
free(*head); | |
*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
var globalErrors = new angular | |
.module('globalErrors', []) | |
.config(function($provide, $httpProvider, $compileProvider) { | |
var elementsList = $(); | |
var showMessage = function(content, cl, time) { | |
$('<div/>') | |
.addClass('globalAlertMessage') | |
.addClass(cl) | |
.fadeIn('fast') |
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
$scope.arraySearch = function (array, key) { | |
for (var i = array.length - 1; i >= 0; i--) { | |
console.log(array[i].meta_key); | |
if (array[i].meta_key === key){ | |
console.log("Found " + key + " at " + i); | |
return i; | |
} | |
}; | |
console.log("Could not find " + key); | |
var newJson = { |
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 | |
$connect = new PDO('mysql:host=localhost;dbname=db',"user","pass"); | |
$file = fopen("myCSVFile.cvs", 'r'); | |
do { | |
if ($data[0]) { | |
$connect->exec("INSERT INTO myTable (col1, col2, col3, col4, col5) VALUES | |
( |
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
/** | |
* Return true if keys in this subtree are never null and are correctly sorted | |
* and are all in the range between the lower and upper (both exclusive). | |
* If either bound is null, then that means that there is no limit at this side. | |
* @param node root of subtree to examine | |
* @param lower value that all nodes must be greater than. If null, then | |
* there is no lower bound. | |
* @param upper value that all nodes must be less than. If null, | |
* then there is no upper bound. | |
* @return true if the subtree is fine. If false is returned, a problem |