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/python | |
# subanagram.py | |
# This program receives as input an English word, and then | |
# delivers as output those English words which can be spelled with the | |
# letters in the input word. | |
# This script is Copyleft 2002, 2012 by Mitchell Szczepanczyk under the | |
# terms of the General Public License. Anyone is free to copy, modify, |
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 Browser | |
import Html exposing (Html, Attribute, div, input, text, button, p, h1) | |
import Html.Attributes exposing (placeholder, style, value) | |
import Html.Events exposing (onInput, onClick) | |
-- MODEL | |
type alias Model = | |
{ field : String | |
, color : 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
-- Show the current time in your time zone. | |
-- | |
-- Read how it works: | |
-- https://guide.elm-lang.org/effects/time.html | |
-- | |
-- For an analog clock, check out this SVG example: | |
-- https://elm-lang.org/examples/clock | |
-- | |
import Browser |
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
heroku redis:cli -a [APP] | |
dbsize | |
keys * | |
get [KEY] |
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/env escript | |
% This is an Erlang version of the subanagram generator. | |
% It works far faster and the code is far shorter. | |
% It takes a word at the command line as an argument. | |
% e.g.: `./subanagram_prototype.erl representative` | |
% It delivers as output the words that are eligible subanagrams, ordered in length from shortest to longest, | |
% along with the number of points from each word, assuming no double or triple letter or word squares. |
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/env escript | |
% This is an Erlang version of the subanagram generator. | |
% It works far faster and the code is far shorter. | |
% It takes a word at the command line as an argument. | |
% e.g.: `./subanagram_prototype.erl representative` | |
% Note: You need a file of words, one word per line, in the same directory as | |
% the script. |
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
from itertools import product | |
final_answer = set() | |
for a in open('mrc2.dct'): | |
cols = a.split(' ', 1) | |
b = list(cols[0]) | |
c = int(b[28] + b[29] + b[30]) # concreteness rating | |
i = int(b[31] + b[32] + b[33]) # imagery rating | |
f = int(b[25] + b[26] + b[27]) # familiarity rating |
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
; https://gist.github.com/Youenn-Bouglouan/02cd3ac6fd0130cc48b207eec6049af6 | |
; | |
; http://www.ybouglouan.pl/2017/03/are-you-polish-fharp-will-tell-us-probably/ | |
(defn are-you-polish? [surname] | |
(letfn [(score-polish-characters | |
[surname] | |
(->> (re-seq #"[ąćęłńóśżź]" surname) | |
count)) |
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
'{:dependencies [[org.clojure/clojure "1.8.0"] | |
[cheshire "5.8.0"]]} | |
(require '[cheshire.core :as json]) | |
(def j (cheshire.core/parse-string (slurp "j.json") true)) | |
(def file-names (->> j | |
:definitions | |
(map (comp last #(clojure.string/split #"\.") :file)) |
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
; #wqc #clojure | |
; For the World Quizzing Championships | |
; http://www.worldquizzingchampionships.com/ | |
(def sample-scores | |
[["joshua Kreitzer" 1 2 3 4 5 6 7 8] | |
["Sreeradh RP" 9 10 11 12 13 14 15] | |
["david striasny" 3 8 8 7 20 4 14 11]]) | |
(defn get-wqc-scores [s] |
NewerOlder