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 | |
//Requires LightBox to work. | |
//Example at https://valdestechtravel.net/gallery/?root_dir=gallery_main&work_dir=Washington&columns=3 | |
echo ' | |
<html> | |
<head> | |
<link rel="stylesheet" href="css/lightbox.min.css"> | |
<style> |
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_once('store_data.php'); | |
class CANDIDATE_DATA_GRAPH | |
{ | |
private function scan_news_data($first_name, $last_name) | |
{ |
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 | |
//This is a simple library to create bar and line graphs from data array. | |
//Usage: | |
//$graph_instance = new GRAPH_CREATE() | |
//$graph_instance _> gather_data(<'bar_graph' or 'line_graph'>, <height in pixels>, <width in pixels>, <data array (requres | |
//a sub array with 'label' key and data points to be in sub array with 'value' key)>, <min data point>, | |
//<max data point>,<text file name to save data in>, <array with RGB color values for graph>,<1 for automatically scaling graph | |
//to data>, <percentage from min/max value to space graph from top/bottom edge>); |
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 | |
//Change directory based on input from URL. | |
function change_directory() | |
{ | |
//If a directory variable is present in URL, change directory to match. | |
if (isset($_GET['dir_change'])) | |
{ | |
$directory_to_change = $_GET['dir_change']; | |
chdir($directory_to_change); |
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 | |
//This script is my crude attempt of trying to quantify the media's tone pertaining to articles about candidates. | |
//The script scans the 5 most heavily trafficked news sites that have a search function. | |
//It searches and counts key negative and positive adjectives. | |
//I excluded Fox News as that would skew my results. | |
//Working demo here: http://michvaldes001.ddns.net/index.php?section_id=Apps&app_loaded=yes&app_id=election_2016 | |
//Display header. | |
echo '<h2>Words Used to Describe Candidates (data from Google, Yahoo, CNN, NBC, and NYT news).</h2>'; |
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 | |
#This script requires a "thumbnail" and "description" folder to be present in the directory where images are stored. | |
#Photos must be uploaded manually and caption files must be edited manually. | |
#Demo can be found here: http://michvaldes001.ddns.net/index.php?section_id=Gallery | |
#Main photo displaying/image processing function. | |
function photo_display($photo_directory) { | |
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 | |
#Demo here: http://michvaldes001.ddns.net/index.php?section_id=Web_Apps&app_id=text_to_dna&name=Testing | |
#Generate user input box. | |
echo "<h3>Please Enter Your First Name</h3> | |
<form id='name_form' action = '<LOCATION OF TEXT_TO_DNA_ENCODE_REDIRECT.PHP>'> | |
<input name='name_submit' type='text' id='name_s'> | |
<button type='submit'>Submit</button> | |
</form>"; |
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
#must have OpenCV installed | |
import cv2 | |
#gets video feed from both cameras (this is for Linux) | |
cam = cv2.VideoCapture(0) | |
cam2 = cv2.VideoCapture(1) | |
#main loop | |
while True: | |
#process video feeds |
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
import cv2 | |
import numpy as np | |
AT_image = cv2.imread("AT.jpg") | |
TA_image = cv2.imread("TA.jpg") | |
CG_image = cv2.imread("CG.jpg") | |
GC_image = cv2.imread("GC.jpg") | |
dna_render_list = [] | |
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
#!/usr/bin/env python | |
import cv2, serial, time | |
#motion detect | |
def diffImg(t0, t1, t2): | |
d1 = cv2.absdiff(t2, t1) | |
d2 = cv2.absdiff(t1, t0) | |
return cv2.bitwise_and(d1, d2) |
NewerOlder