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
# ~/Src/Perl/scrabble.pl | |
Usage: scrabble.pl <words-file> <letter> [<letter> ...] | |
Where: <words-file> is a file of words to search. | |
<letter> is a letter [a-z]. | |
Print to STDOUT a list of words from <words-file> | |
composed of only the <letter>s specified. | |
1# ~/Src/Perl/scrabble.pl words-file a b c | |
Error: Cannot open 'words-file' | |
Usage: scrabble.pl <words-file> <letter> [<letter> ...] | |
Where: <words-file> is a file of words to search. |
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
tbl.local # ls | |
stl.cc | |
tbl.local # cat stl.cc | |
// C++ has strong support for internationalization and localization, and | |
// it is better developed than the C equivalents. Here's a small sample | |
// program illustrating some techniques. This program is pure ANSI/ISO | |
// standard C++. It should compile and run on any conforming hosted C++ | |
// implementation on any OS. If you want it to run on a platform that | |
// uses wide characters for its native data representation, just change | |
// 'std::string' to 'std::wstring' in main(). It parses words and frobs |
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
|| See http://msdn2.microsoft.com/en-us/library/ms997538.aspx | |
|| A .ico file is an IconDir followed by 0 or more IconDirEntry | |
|| objects, one for each icon pixmap in the file. Each IconDirEntry | |
|| describes an IconImage object. All the IconImage objects are in a | |
|| last section following all the IconDirEntry objects. | |
|| Note: Encode every icon with 32-bit pixels because that's where the | |
|| world is headed anyway, and it is much simpler. |
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
#!/usr/bin/perl -w | |
use strict; | |
use sigtrap qw(die normal-signals error-signals); | |
use Carp; | |
use Config; | |
use Fcntl qw(:flock); | |
use File::Basename; | |
use File::Copy; | |
use File::Path; |
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
# Work around the usual object orientation problem with the | |
# "Get out of Python free!" card. | |
# | |
class Oops: | |
def __init__(self, **stuff): | |
self.__dict__.update(stuff) | |
def start_capture_subprocesses(logdir): | |
""" | |
Start a console capture subprocess for each node in configstore, |
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
~/C # cat reverse.c | |
// make CFLAGS+=-std=c99 reverse | |
// ./reverse a b c d e f g h i j k l | |
#include <stdio.h> | |
#include <stdlib.h> | |
// A linked list of strings. | |
// .next is the next Item. | |
// .s is the payload string. |
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
#! /opt/local/bin/perl -w | |
use strict; | |
use File::Basename; | |
# Return ssh with the standard command line options. | |
# | |
sub ssh { | |
my @result = qw(ssh -A -t); | |
push @result, qw(-o UserKnownHostsFile=/dev/null); |
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
(ns panpal.core | |
(:require [clojure.java.io :as io] | |
[clojure.math.combinatorics :as comb] | |
[clojure.pprint :as pp] | |
[clojure.string :as str]) | |
(:gen-class)) | |
(def ^{:private true :doc "The default word list file."} | |
words | |
"http://www.itasoftware.com/careers/work-at-ita/PuzzleFiles/WORD.LST") |
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
;; Everything from ';' to the end of a line is a Clojure comment. | |
;; A letter is one of "abcdefghijklmnopqrstuvwxyz". Examples: \q \j \z | |
;; A word is a Clojure (Java) string of letters. Example: "word" | |
;; A sentence is a sequence of words. Example: ["sequence" "of" "words"] | |
;; [...] denotes a Clojure vector, #{...} a set, {...} a map. | |
;; In Java you call a method like this: object.method(arg1, arg2, arg3); |
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
(ns panpal.core | |
(:import [java.io BufferedReader FileReader]) | |
(:require [clojure.pprint :as p] | |
[clojure.string :as s])) | |
;; A 'word' is a string of lower-case letters: "word" | |
;; A 'sentence' is a vector of words: ["a" "vector" "of" "words"] | |
;; A 'palindrome' is a 'sentence' whose letters are the same read | |
;; forward and backward. (def ted ...) defines 'ted' to be '...'. |
OlderNewer