Skip to content

Instantly share code, notes, and snippets.

@tomwhoiscontrary
tomwhoiscontrary / print_call_and_return.rb
Created March 4, 2013 15:12
What do you think gets printed as Exhibit F?
#! /usr/bin/ruby
def print_call_and_return(string, &block)
puts string
block.call unless !block
"return"
end
puts "=== exhibit A ==="
create table Dashboard (
id integer not null,
name varchar(255),
primary key (id)
);
create table User (
id integer not null,
name varchar(255),
primary key (id)
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
public class Sorter {
public static void main(String[] args) {
@SuppressWarnings("unchecked")
public class CircularQueue<T> {
private T[] queue = newArray(5);
private int front = 0;
private int rear = 0;
public void enqueue(T element) {
if (front == (rear + 1) % queue.length) {
expandCapacity();
}
@tomwhoiscontrary
tomwhoiscontrary / .hgignore
Created March 9, 2012 15:23
A bloated but bland .hgignore
.hgignore
syntax:glob
.byecycle
.classpath
.checkstyle
.nbattrs
.nbintdb
.settings
antlib
antlog.bat
package com.stackoverflow.jaizen;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
@Entity
public class A {
package uk.co.initech.sandbox;
import javax.persistence.Embeddable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.MapsId;
@Entity
public class OrderLine {
package uk.co.initech.sandbox;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;