Skip to content

Instantly share code, notes, and snippets.

View Wilfred's full-sized avatar

Wilfred Hughes Wilfred

View GitHub Profile
; code for project euler problem 1
(defn returnIfFactor
[x]
(if (or (= (mod x 5) 0) (= (mod x 3) 0))
x
0))
(defn problem1
[x]
(if (= x 0)
' apostrophes denote comments
REM keyword also does this
' VB6 is case insensitive
Option Explicit
' this ensures that you only use variables you have declared
' (avoiding typos creating new variables)
public class Hello {
public static void main(String[] args) {
System.out.printf("Hello World!%n");
}
}
;;; moo.el --- comint-based emacs interface for MOOs.
;;; Copyright (C) 1993 Noah S. Friedman
;;; Author: Noah Friedman <[email protected]>
;;; Maintainer: Noah Friedman <[email protected]>
;;; Keywords: games, extensions
;;; $Id: moo.el,v 1.0 1993/11/15 05:26:49 friedman Exp $
#!/usr/bin/python
import os
import lxml.etree
def tld_to_word(node, hyphenated=False):
# convert text of the form 'ret<tld>ejo'
assert node != None
# beginning
# these words are from http://reta-vortaro.de/tgz/index.html
# ĉi tiuj vortoj estas el http://reta-vortaro.de/tgz/index.html
-a
-ac
-aĉ
-ad
-aĵ
-ebl
-ec
-ed
#!/usr/bin/python
import os
import lxml.etree
def get_words_from_kap(node):
flat_string = flatten_kap(node)
# now this is either one word 'foo' or multiple 'foo, bar'
words = flat_string.split(', ')
#!/usr/bin/python
# -*- coding: utf-8 -*-
def compare_esperanto_strings(x_mixed_case, y_mixed_case):
# case insensitive alphabetical sort
# permitting whole latin alphabet
if type(x_mixed_case) == str:
x = x_mixed_case.decode('utf8').lower().strip()
else:
x = x_mixed_case.lower().strip()
# every word in REVO which has more than one definition
# ĉiu vorto en REVO kiu havas pli ol unu difino
alburno
aro
asekura agento
babilaĉi
babilejo
babilema
babili
babilulo
@Wilfred
Wilfred / potato.cow
Created October 16, 2010 22:03
A .cow file for Potato London
##
## An ASCII potato
##
$the_cow = <<EOC;
$thoughts ~??+,
$thoughts ,?????????
$thoughts =???????????~
$thoughts ==????????????=
=+?????????????:
:=+??????????????