Skip to content

Instantly share code, notes, and snippets.

View nhuntwalker's full-sized avatar

Nicholas Hunt-Walker nhuntwalker

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>A Visualization Makeover</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body></body>
<footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.16/d3.min.js"></script>
@nhuntwalker
nhuntwalker / index.html
Last active March 14, 2016 18:23
Project 6: USA vs the World
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Project 6: Visualizing PISA 2012 Data</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.16/d3.min.js"></script>
</head>
<body>
Write a function that takes two arguments that are strings
and returns whether or not one is a rotation of the other
word1 = tugboat
word2 =
ttugboa
attugbo
oattugb
boattug
returns True
The Shell Game
Three (or more) cups. One has a ball underneath, and the rest are empty.
The person running the game will switch the cup positions over and over until they stop.
You, as the gambler, are trying to find which cup still has the ball.
Given the shell that the ball starts under, and a list of swaps, return the location of
the ball at the end.
For example, if my function name is find_the_ball,
and the starting position is 0
Write a function that takes as arguments:
- a list of integers that represents a whole number
--> ex: [1, 2, 3 ,4] = 1234
--> ex: [8, 2] = 82
- a single-digit integer (-9 -> 9)
Return the sum of the whole-number version of the
list of numbers, and that single-digit integer, as a list
add_us([1, 2, 3, 4], -9) --> [1, 2, 2, 5]
Write a function that takes two arguments:
- a list of numbers (not necessarily sorted)
- a number
Return the lowest index that the given number can take within the input list,
if that list was sorted.
e.g. the_list = [1, 2, 3, 4, 5], the_number = 2.5
the lowest index it can take is 2
@nhuntwalker
nhuntwalker / thing.txt
Created May 24, 2017 18:36
looped list
[1] -> [2] -> [3] -
^ |
| v
-----------
write a function that takes a linked list as an argument and returns a boolean telling
whether or not that list has a loop in it.
email to: nicholas@codefellows.com
def func(arg):
Write a function that will take a query string as an argument and return the key-value pairs as a dictionary.
query = ?one=1&two=2
parameters(query) => {'one': '1', 'two': '2'}
query = ?foods=butter&foods=cake&foods=chicken
parameters(query) => {'foods': ['butter', 'cake', 'chicken']}
query = ?username=codefellows&password=learnmorefaster&courses=code201&courses=code301&courses=code401-python&courses=code401-javascript&courses=code401-dotnet
parameters(query) =>
'part' and 'rapt' are anagrams
'apple' and 'papel' are anagrams
"rail safety" and "fairy tales" are anagrams
'foo' and 'bar' are not anagrams
'too' and 'to' are not anagrams
'AAA' and 'aaa' are not anagrams
Write a function that will check if two strings are anagrams of each other. Assume the strings have at least one character. Return a boolean. Be case sensitive
email the link to your public gist: nicholas@codefellows.com
Write a function that takes in two linked lists and will return a boolean that tells me whether or not those linked lists merge or don't
These two merge:
[ 1 ] - [ 2 ] - [ 3 ] - [ 4 ]
|
[ A ] - [ B ] ----
These two also merge:
[ 1 ] -> [ 2 ] -> [ 3 ] -> [ 4 ]
^