Skip to content

Instantly share code, notes, and snippets.

View garyshort's full-sized avatar

Gary Short garyshort

View GitHub Profile
using System;
using System.Linq;
namespace _4Phil
{
class Program
{
static void Main(string[] args)
{
// Tests
using System;
using System.Linq;
namespace _4Phil
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Testing algorithm...");
@garyshort
garyshort / NationWord.py
Last active July 12, 2020 14:19
Demo of NationWord Test
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']
@garyshort
garyshort / Prereqs.txt
Last active June 29, 2017 03:57
The prereqs required for the "Leveraging Business Insights" tutorial @ OReilly's AI Summit NYC June 27 2017
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
@garyshort
garyshort / client.js
Created December 22, 2011 23:48
NodeCode
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'},
@garyshort
garyshort / BrokenKnockout.html
Created December 21, 2011 18:01
Broken Knockout
<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 = {