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> | |
<head> | |
<title>Email Address Munger</title> | |
</head> | |
<body> | |
<h3>Put your email in below</h3> | |
<form method='POST'> | |
<input type=text name='email'> | |
<input type=submit> | |
</form> |
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
[TestMethod] | |
public void MultiplicationNegativeBoth() | |
{ | |
this.UIMap.StartApplication(); | |
// Both negative decimal | |
this.UIMap.NegativePressed(); | |
this.UIMap.FivePressed(); | |
this.UIMap.MultiplicationPressed(); | |
this.UIMap.NegativePressed(); |
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
private boolean postIssue(String description, String title, String username, | |
String password, String stub, String ownerUsername){ | |
// Set up authentication | |
String authentication = username + ":" + password; | |
String encoding = Base64.encodeToString(authentication.getBytes(), | |
Base64.NO_WRAP); | |
URL url; | |
try { | |
// Setup URL with specified username (Owner) and repository stub |
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
public class Calculator{ | |
private int a, b; | |
public Calculator(int a, int b){ | |
this.a = a; | |
this.b = b; | |
} | |
public int addition(){ | |
return this.a + this.b; | |
} |
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
@Test | |
public void division(){ | |
// Positive | |
Calculator c = new Calculator(4, 2); | |
assertEquals("Basic division", c.division(), 2); | |
c = new Calculator(8, 3); | |
assertEquals("Division with decimals", c.division(), 2); | |
c = new Calculator(50000000, 10000000); |
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
private void setupDirectionSpinner(){ | |
busStop = inputTextEdit.getText().toString(); | |
boundSpinner = (Spinner) this.findViewById(R.id.boundSpinner); | |
// Set up bound list | |
boundList = new ArrayList<String>(); | |
boundList.add("Direction"); | |
boundList.addAll(dbhelper.getDirections(busStop)); | |
// Set up adapter |
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 unittest | |
def calculate_addition_string(expression): | |
numbers = expression.split('+') | |
total = 0 | |
for number in numbers: | |
total += int(number) | |
return total | |
class TestAdditionMethods(unittest.TestCase): |
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
# lib/tasks/db.rake | |
namespace :db do | |
desc 'Drop, create, migrate then seed the development database' | |
task reseed: [ 'db:drop', 'db:create', 'db:migrate', 'db:seed' ] do | |
puts 'Reseeding completed.' | |
end | |
end |
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
# compare_images.sh | |
# Requires imagemagick `brew update && brew install imagemagick` | |
for entry in "$1"/* | |
do | |
if [ -f "$entry" ];then | |
NAME=`basename "$entry"` | |
DIFF=`compare -metric AE "$1/$NAME" "$2/$NAME" null: 2>&1`; | |
if [ "${DIFF}" -eq "0" ]; then |
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/sh | |
# Arguments: | |
# First argument: input file | |
# -ss: start time [optional] | |
# -t: end time [optional] | |
# Example usage: | |
# ./video_to_gif.sh input_file.mov | |
# ./video_to_gif.sh input_file.mov -ss 1.00 |
OlderNewer