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
#!/bin/bash | |
rm *.jpg | |
rm *.png | |
rm *.gif | |
rm *.mp4 | |
find ../ -mindepth 1 -maxdepth 1 -mtime -7 -name "*.jpg" -exec cp -t . {} + | |
export MAGICK_THREAD_LIMIT=4 |
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
#!/bin/bash | |
# Set to number of cores your computer has or you want to use | |
export MAGICK_THREAD_LIMIT=8 | |
# Deleted old files | |
rm *.jpg | |
rm *.png | |
rm *.gif | |
rm *.mp4 |
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
float catalan_nums_rec(int numTerms){ | |
return catalan_nums_aux(numTerms, 1, 1.0); | |
} | |
float catalan_nums_aux(int numTerms, int n, float lastC){ | |
if( n < numTerms ) | |
return catalan_nums_aux(numTerms, n+1, 2*(2*n+1)*lastC/(n+2))); | |
else | |
return 2*(2*n+1)*lastC/(n+2); | |
} |
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 chart = new Highcharts.Chart({ | |
'chart': { | |
'renderTo': 'yw0' | |
}, | |
'exporting': { | |
'enabled': true | |
}, | |
'title': { | |
'text': 'Past Hour' | |
}, |
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
(defn run [nvecs nitems nthreads niters] | |
(let [vec-refs (vec (map (comp ref vec) | |
(partition nitems (range (* nvecs nitems))))) | |
swap #(let [v1 (rand-int nvecs) | |
v2 (rand-int nvecs) | |
i1 (rand-int nitems) | |
i2 (rand-int nitems)] | |
(dosync | |
(let [temp (nth @(vec-refs v1) i1)] | |
(alter (vec-refs v1) assoc i1 (nth @(vec-refs v2) i2)) |
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] | |
;;;;;;;;;;;;;;;;;;; | |
; About php.ini ; | |
;;;;;;;;;;;;;;;;;;; | |
; PHP's initialization file, generally called php.ini, is responsible for | |
; configuring many of the aspects of PHP's behavior. | |
; PHP attempts to find and load this configuration from a number of locations. | |
; The following is a summary of its search order: |
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
#include <vector> | |
#include <fstream> | |
#include <iostream> | |
#include <ctype.h> | |
#include "fann.h" | |
#include "fann_cpp.h" | |
using namespace std; | |
void error(const char* p, const char* p2 = ""){ |
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
Scraper/Content Extraction Training | |
Goal: Fetch relevant information sources, extract only appropriate content, save as documents as training data and usable by Watson | |
Method: | |
Fetch a few pages from various data sources using Phantom.js, then parse and save the website’s HTML as JSON | |
Iterate the text elements and extract features such as size, position, text, CSS properties, etc | |
Run the DBSCAN clustering algorithm over the document’s extracted feature data. Similar elements such as titles, headers, and article content should be grouped into the same clusters | |
Manually tag a portion of the documents to use as training data | |
A support vector machine (SVM) with linear kernel using a 4-fold cross validation should be capable of detecting the main content of a scraped page |
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
#/bin/bash | |
# Usage: ./find_running_process.sh <process_name> | |
# DEBUG=1 ./find_running_process.sh <process_name> | |
# Function to help with debug messages | |
debug_message () { | |
if [ $DEBUG -eq 1 ] | |
then | |
echo $1 | |
fi |
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
#!/bin/bash | |
# Usage: ./process_pids.sh | |
for proc in /proc/* | |
do | |
FILENAME=${proc##*/} | |
if [[ $FILENAME =~ ^-?[0-9]+ ]] | |
then | |
echo $FILENAME | |
fi |