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
#All parts not labeled BJG were written by Chris Kief <http://bit.ly/1sUHJ8f> | |
# install and select | |
sudo port install postgresql93-server | |
sudo port select --set postgresql postgresql93 | |
# load at startup | |
sudo port load postgresql93-server |
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
#All parts not labeled BJG were written by Chris Kief <http://bit.ly/1sUHJ8f> | |
# install and select | |
sudo port install postgresql93-server | |
sudo port select --set postgresql postgresql93 | |
# load at startup | |
sudo port load postgresql93-server | |
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
# needs to be executed with the expanded REGEX synatax -E flag | |
# sed -Ef script.sed parenthesesFile.txt | |
s/ *\(/ \(/g; | |
s/\) */\) /g; | |
s/\(\)/\( \)/g; | |
s/\(\(/\( \(/g; | |
s/\)\)/\) \)/g; | |
s/\(([a-zA-Z0-9])/( \1/g; | |
s/([a-zA-Z0-9])\(/\1 (/g; |
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 | |
/** | |
* Created by PhpStorm. | |
* User: Blake Gideon | |
* Date: 3/14/15 | |
* Time: 7:34 PM | |
*/ | |
$incoming_post = file_get_contents("php://input"); | |
$incoming_post = json_decode($incoming_post, true); |
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 | |
# The skeleton of a script which checks to see if brew's openssl was uninstalled. If it was uninstalled, | |
# remove the cron job which sends the buggy email every hour. Additionally remove the cronjob which will be | |
# running this script itself. | |
if [ -f /usr/local/Cellar/openssl-osx-ca/1.0.3/bin/openssl-osx-ca] | |
then | |
exit 0 | |
else | |
(crontab -l | grep -v openssl-osx-ca) | crontab - | |
#(crontab -l | grep -v remove-openssl-cronjob | crontab - |
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
ConnectivityManager connMgr = (ConnectivityManager) | |
getSystemService(Context.CONNECTIVITY_SERVICE); | |
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); | |
if (networkInfo != null && networkInfo.isConnected()) { | |
Log.d("MyActivity","Internet Connection Available"); | |
} else { | |
Log.e("MyActivity","No internet connection"); | |
} | |
//Source: http://developer.android.com/training/basics/network-ops/connecting.html |
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
Active Internet connections (only servers) | |
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name | |
tcp 0 0 127.0.0.1:15455 0.0.0.0:* LISTEN - | |
tcp6 0 0 :::22 :::* LISTEN 7/micro-inetd |
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/awk -f | |
BEGIN { TOTAL=0 } | |
{ TOTAL = TOTAL + $1 } | |
END { print TOTAL/NR } |
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
{ | |
"_id" : ObjectId("5c75b350fc0c4b23785abcce"), | |
"name" : "Tom Hanks", | |
"url" : "https://en.wikipedia.org/wiki/Tom_Hanks", | |
"wiki_doc" : "American actor and producer This article is about the American actor. For the seismologist, see Thomas C. Hanks. \n Tom HanksHanks in September 2016BornThomas Jeffrey Hanks (1956-07-09) July 9, 1956 (age 62)Concord, California, U.S.ResidenceLos Angeles, California, U.S.Alma materChabot CollegeCalifornia State University, Sacramento (BFA)OccupationActor, filmmakerYears active1977–presentWorksPerformancesNet worth$390 million (May 2014)[1]Political partyDemocraticSpouse(s)Samantha Lewes(m. 1978; div. 1987)Rita Wilson (m. 1988)Children4, including Colin HanksRelativesJim Hanks (brother)Larry Hanks (brother)AwardsFull list Thomas Jeffrey Hanks (born July 9, 1956) is an American actor and filmmaker. Hanks is known for his comedic and dramatic roles in such films as Splash (1984), Big (1988), Turner & Hooch (1989), A League of Their Own (1992), Sleepless in Seattle ( |
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
from collections import namedtuple | |
CastMatch = namedtuple('CastMatch', 'role playedby cosine_dist') | |
def best_match(got_roles_list, clust_dict, vectorizer, topic_model, cluster_model): | |
matches = [] | |
for person in got_roles_list: |
OlderNewer