Skip to content

Instantly share code, notes, and snippets.

public class Palindrome {
// This method checks whether its input reads the same forwards
// as backwards. For example, isPalindrome("noon") should return
// true, but isPalindrome("night") should return false.
// Note that this implementation contains a deliberate bug.
public static boolean isPalindrome(String s) {
if (s.length() == 0) {
@omgm
omgm / vector-test.js
Last active August 29, 2015 14:05
vector.js' moveTo
//
// Adding this test fails
//
describe('One vector: ', function () {
it('is moved to another position', function () { // is converted into another?
var x = new v(1,0,0);
var y = new v(1,1,0);
var c = x.distanceFrom(y);
c.should.eql(1);
x.moveTo(y);