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
using System; | |
using System.Linq; | |
namespace _4Phil | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Tests |
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
using System; | |
using System.Linq; | |
namespace _4Phil | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Testing algorithm..."); |
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
def number_of_a_additions(aString): | |
# Fail fast | |
if 'aaa' in aString: | |
return -1 | |
if aString == 'aa': | |
return 0 | |
# For any string of n chars long, return | |
# (2(number of chars that aren't 'a') +2) - count('a') | |
not_as = [c for c in aString if c != 'a'] |
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
1. Python 2.7 | |
https://www.python.org/downloads/release/python-2712/ | |
2. Ensure you're running the latest version of Pip | |
run python -m pip install -U pip setuptools | |
3. BeautifulSoup Library for Python | |
pip install BS4 | |
4. Download Stanford Named Entity Recognizer version 3.8.0 |
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 twitter_config_model = { | |
track: ko.observable(''), | |
follow: ko.observable(''), | |
locations: ko.observable(''), | |
onSave: function(formElement){ | |
$.ajax({ | |
url: "http://localhost:8080/trinity/configure", | |
type: "PUT", | |
data: ko.toJSON(this), | |
headers: {'Origin':'http://localhost'}, |
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
<html> | |
<body> | |
<form data-bind="submit: onSubmit"> | |
<button type="submit">Submit</button> | |
</form> | |
<script language="text/javascript" src="knockout-2.0.0.js"></script> | |
<script type="text/javascript"> | |
var viewModel = { |