Skip to content

Instantly share code, notes, and snippets.

View Scramble Solver Output.txt
FoundWord(word='a', locations=[Location(row=2, col=0)])
FoundWord(word='al', locations=[Location(row=2, col=0), Location(row=1, col=1)])
FoundWord(word='alice', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=2, col=3), Location(row=3, col=2)])
FoundWord(word='alien', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=3, col=2), Location(row=3, col=3)])
FoundWord(word='alin', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=3, col=3)])
FoundWord(word='aline', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=3, col=3), Location(row=3, col=2)])
FoundWord(word='alit', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=2, col=1)])
FoundWord(word='alite', locations=[Location(row=2, col=0), Location(row=1, col=1), Location(row=2, col=2), Location(row=2, col=1), Location(row=3, col=2)])
F
@I82Much
I82Much / jetty.xml
Created Jun 6, 2011
Mule 3 Jetty Configuration
View jetty.xml
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="FileServer" class="org.mortbay.jetty.Server">
<Set name="handler">
<New class="org.mortbay.jetty.handler.HandlerList">
<Set name="handlers">
<Array type="org.mortbay.jetty.Handler">
<Item>
<New class="org.mortbay.jetty.handler.ResourceHandler">
View python_checkmark
import sys
from collections import defaultdict
import csv
# see http://stackoverflow.com/questions/6180609/group-and-check-mark-using-python
def main():
# files = ["group.txt"]
files = sys.argv[1:]
if len(files) < 1:
print "usage: ./python_checkmark.py file1 [file2 ... filen]"
@I82Much
I82Much / MovieCountries1.java
Created May 17, 2011
itextpdf 5.1.0 header
View MovieCountries1.java
/*
* This class is part of the book "iText in Action - 2nd Edition"
* written by Bruno Lowagie (ISBN: 9781935182610)
* For more info, go to: http://itextpdf.com/examples/
* This example only works with the AGPL version of iText.
*
* Modified by Nick Dunn (http://developmentality.wordpress.com) to
* focus on just the PDF header aspect.
*/
@I82Much
I82Much / unzipkmz.sh
Created May 6, 2011
This script unzips a kmz file by renaming it to .rar and then calling unzip on it.
View unzipkmz.sh
#!/bin/sh
# Author: Nick Dunn
#
# This script takes as input the path to a .kmz file and outputs a directory
# full of the contents of that .kmz file, named the same as the .kmz file without
# the kmz suffix. Thus
# ./openkmz.sh /path/to/mykmz.kmz
# would result in a new directory being created at /path/to/mykmz filled with the contents
# of mykmz.kmz.
@I82Much
I82Much / Test.txt
Created May 3, 2011
Find missing tag
View Test.txt
<users>
<user>
</user>
<user>
<user>
</users>
@I82Much
I82Much / MySQL NHibernate Mono Configuration.xml
Created May 3, 2011
MySQL NHibernate Mono Configuration
View MySQL NHibernate Mono Configuration.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<!-- an ISessionFactory instance -->
<session-factory>
<!-- properties -->
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="connection.driver_class">
NHibernate.Driver.MySqlDataDriver
View StringTemplate class skeleton
group ClassDefinition;
class(name, number, description, classAttributes, classComments, package)::=<<
$packageDeclaration(package)$
$imports(...)$
$header()$
View Output
$ python reverse.py I like dogs
dogs like I
View star rater
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.add(new StarRater());
frame.getContentPane().add(panel);
frame.pack();
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}