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
USING: kernel math math.functions sequences ; | |
IN: euler1 | |
: euler1 ( x -- y ) | |
iota [ dup [ 3 divisor? ] [ 5 divisor? ] bi or [ drop 0 ] unless ] map-sum ; |
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
IN: scratchpad 1 0 > | |
--- Data stack: | |
t | |
IN: scratchpad [ "true" ] [ "false" ] if | |
--- Data stack: | |
"true" | |
IN: scratchpad |
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
As found in "Thinking Forth": http://thinking-forth.sourceforge.net/ | |
"Simplicity is the primary measurement recommended for evaluating | |
alternative designs relative to reduced debugging and modification | |
time. Simplicity can be enhanced by dividing the system into sepa- | |
rate pieces in such a way that pieces can be considered, implemented, | |
fixed and changed with minimal consideration or effect on the other | |
pieces of the system." | |
W. P. Stevens, |
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
: fib ( a b -- x y ) [ + ] keep swap ; | |
! My goal was to implement this with produce. | |
1 1 | |
[ dup 4000000 < ] [ fib dup ] produce | |
2nip ! Remove the workspace | |
dup length 1 - swap remove-nth ! Remove the extra value | |
[ dup odd? [ drop 0 ] when ] | |
map-sum |
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
StackOverflowError | |
java.util.regex.Pattern$GroupHead.match (Pattern.java:4556) | |
java.util.regex.Pattern$Loop.match (Pattern.java:4683) | |
java.util.regex.Pattern$GroupTail.match (Pattern.java:4615) | |
java.util.regex.Pattern$GroupTail.match (Pattern.java:4615) | |
java.util.regex.Pattern$BranchConn.match (Pattern.java:4466) | |
java.util.regex.Pattern$CharProperty.match (Pattern.java:3694) | |
java.util.regex.Pattern$Branch.match (Pattern.java:4502) | |
java.util.regex.Pattern$GroupHead.match (Pattern.java:4556) | |
java.util.regex.Pattern$Neg.match (Pattern.java:4997) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <readline/readline.h> | |
#include <readline/history.h> | |
int main(int argc, char** argv) | |
{ | |
puts("JL 0.0.1"); | |
puts("Press C-c to exit\n"); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <readline/readline.h> | |
#include <readline/history.h> | |
int | |
main(int argc, char** argv) | |
{ | |
puts("JL 0.0.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
import clojure.java.api.Clojure; | |
import javax.servlet.ServletContextEvent; | |
import javax.servlet.ServletContextListener; | |
public class NreplContextListener implements ServletContextListener { | |
private Object server; | |
public NreplContextListener() { | |
Clojure.var("clojure.core", "require").invoke(Clojure.read("clojure.tools.nrepl.server")); |
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
mvn archetype:generate -DgroupId=io.github.jeremyheiler -DartifactId=irc -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false |
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
user> (def m {:a {:b 2 :c 3} :b {:d 4 :e 5} :c {:f 6}}) | |
#'user/m | |
user> (reduce (fn [m k] (update-in m [k] (comp vec keys))) m (keys m)) | |
{:c [:f], :b [:e :d], :a [:c :b]} |
OlderNewer