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
/etc/mdm/Xsession: Beginning session setup... | |
/etc/mdm/Xsession: 26: /home/wchargin/.profile: [[: not found | |
localuser:wchargin being added to access control list | |
Script for none started at run_im. | |
Script for auto started at run_im. | |
Script for default started at run_im. | |
Script for none started at run_im. | |
Script for auto started at run_im. | |
Script for default started at run_im. | |
GNOME_KEYRING_CONTROL=/run/user/1000/keyring-bapv8r |
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 LAFOptimizer | |
{ | |
/** | |
* Optimizes the look and feel to integrate with the operating system as | |
* much as possible. | |
* <p> | |
* To do this, this method at the installed look and feels and finds the | |
* system look and feel. If this is the same as the Metal look and feel, the | |
* method disables bold fonts to limit eyesores. If the element is the |
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
// ... | |
final ActionListener listener = event -> { | |
if (working) { | |
return; | |
} | |
working = true; | |
solveButton.setEnabled(false); | |
solutionArea.setText("Computing solutions\u2026"); | |
progress.setIndeterminate(true); | |
new SwingWorker<List<Map<Character, Integer>>, Void>() { |
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
// ... | |
final ActionListener listener = event -> { | |
if (working) { | |
return; | |
} | |
working = true; | |
solveButton.setEnabled(false); | |
solutionArea.setText("Computing solutions\u2026"); | |
progress.setIndeterminate(true); | |
new SwingWorker<List<Map<Character, Integer>>, Void>() { |
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 java.util.List; | |
class HistoryEvent { | |
private final HistoryEventItem item; | |
private static class HistoryEventItem { | |
} | |
private static final class WordPlayedItem extends HistoryEventItem { | |
private final int player; | |
private final List<String> wordsFormed; | |
public WordPlayedItem(int player, List<String> wordsFormed) { |
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
data HistoryEvent = Play | |
{ tilesPlaced :: [Positioned LetterTile] | |
, wordsFormed :: [[Letter]] | |
, rawPoints :: Int | |
, pointsAfterSpecialTile :: Int | |
} | |
| Challenge { invalidWords :: [[Letter]] } | |
| Exchange { old :: [LetterTile], new :: [LetterTile] } | |
| Pass |
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 java.awt.Color; | |
import java.awt.Dimension; | |
import java.awt.FlowLayout; | |
import java.awt.Font; | |
import java.awt.Graphics; | |
import java.awt.Graphics2D; | |
import java.awt.RenderingHints; | |
import java.awt.font.GlyphVector; | |
import java.awt.geom.Rectangle2D; | |
import java.util.Arrays; |
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
"""Shuffling algorithms and tools for evaluating them.""" | |
import collections | |
import math | |
import random | |
def fisher_yates(xs): | |
"""Generate a uniformly random permutation of the input list.""" | |
n = len(xs) | |
for i in xrange(n): | |
idx = random.randint(i, n - 1) |
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
functor MagicEq (eqtype t) : EQUAL where type t = t = | |
struct | |
type t = t | |
val equal : t * t -> bool = op = | |
end | |
functor MagicPairOfEq (structure E1 : EQUAL | |
structure E2 : EQUAL) : PAIR_OF_EQUAL = | |
struct | |
structure E1 = E1 |
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 System.Environment (getArgs) | |
import Control.Parallel.Strategies (parMap, rpar) | |
import Control.Monad (mplus, guard) | |
type Square = (Int, Int) | |
-- |threat p q|: is |p| queen-threatened by |q|? | |
threat :: Square -> Square -> Bool | |
threat (x, y) (x', y') = | |
x == x' || y == y' || x + y == x' + y' || x - y == x' - y' |