View counts_per_title.txt
This file has been truncated, but you can view the full file.
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
"Mikysco, Bartholdus." "The spanish-Austrian league:" 1.0 1 | |
"Miller, John," "The evidence, (as taken down in court) in the trial wherein the Rt. Hon. John, Earl of Sandwich, was plaintiff, and J. Miller, defendant, before William, Lord Mansfield, And a Special Jury, in the Court of King's Bench, July 8, 1773." 1.0 1 | |
"Whiston, Thomas." "A sermon preached at Wisbech, Sunday, March 11. 1743." 1.0 1 | |
"Whiston, Thomas." "The important doctrines of original sin," 1.0 1 | |
"Highmore, Joseph," "Observations on a pamphlet, entitled, \"christianity not founded on argument.\" By a Christian freethinker, Who apprehends that Infidels cannot be effectually answered, on any Principles less general, than those which he has adopted. The only apology he can make for publishing (at this distance of time) animadversions on a pamphlet printed so long since, is, that he has just now (and never before) perused it with that design." 1.0 1 | |
"Member of the Hon. Artillery-Company." "The necessity of a well-regulated and able-bodied nightly- |
View twitter_sentiment_classification_in_R
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 a dictionary of words with positive valence and another dictionary | |
# of words with negative valence. Get access to Twitter. Search Twitter for | |
# tweets that discuss 4 topics. Grab the text from those tweets. Combine | |
# tweets into database. Look for words with positive and negative valence | |
# in those tweets. Subtract words with negative valence from words with | |
# positive valence to get net subjective response to topic of interest. | |
# Create graphs. Code by Gaston Sanchez, edited by Douglas Duhaime | |
library(twitteR) | |
library(plyr) |
View gist:5876255
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 os | |
from os import makedirs | |
from subprocess import call | |
# It seems this script must be run from inside C:\mallet-2.0.7 | |
# Set the path to your mallet package (make sure to change the mallet | |
# version number, if necessary) | |
# Create directory "inputdirectory" within this mallet directory. Load the | |
# files to be analyzed in "inputdirectory" |
View gist:8643692
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
### Locating UI elements ### | |
# By ID | |
<div id="coolestWidgetEvah">...</div> | |
element = driver.find_element_by_id("coolestWidgetEvah") | |
or | |
from selenium.webdriver.common.by import By | |
element = driver.find_element(by=By.ID, value="coolestWidgetEvah") | |
# By class name: |
View Gemfile
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
# | |
## Add the rubycas-client gem to your Gemfile and run bundle install | |
# | |
gem 'rubycas-client' | |
gem 'mechanize' | |
View DragTransform
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 selector = 'img' // Replace this with the selector for the element you want to make transformable | |
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() { | |
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() { | |
(function() { | |
var $, applyTransform, getTransform, makeTransformable; | |
$ = jQuery; |
View Matrix Transform Gist
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 numpy as np | |
""" | |
This script identifies a transform matrix X such that | |
one can determine how to perform a css matrix translation | |
to map one div's coordinates to those of another. | |
A fiddle demonstrating the input div, output div, | |
and a transformation that maps the input to the output | |
may be found here: https://jsfiddle.net/dduhaime/9444Lnjp/ |
View 2D Point Project via Transformation Matrix
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 numpy as np | |
""" | |
This script calculates a transform matrix X such that | |
one can project points in one 2d coordinate system | |
into another 2d coordinate system. Because the solution uses | |
a homogenous coordinate space to represent points, | |
the projection may involve rotation, translation, shearing, | |
and any number of other forces acting on the input matrix | |
space. |
View Build PhantomJS on Amazon Linux.txt
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
sudo yum install gcc-c++ git chrpath openssl-devel freetype-devel fontconfig-devel | |
git clone git://github.com/ariya/phantomjs.git && cd phantomjs | |
git checkout 1.5 | |
./build.sh --jobs 1 |
View Yale CAS Auth
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
To authenticate users with Yale's CAS server, one can first send a request to the following endpoint: | |
`https://secure.its.yale.edu/cas?service=http%3A%2F%2Fgoogle.com` | |
The `service` query param specifies the application that's requesting the authentication. | |
This request will redirect control back to the application with the following url: | |
`https://www.google.com/?ticket=ST-6606719-A9AjXY2yXrsKw0b7oC4e-vmssoprdapp01` |
OlderNewer