# HG changeset patch # User Robert McIntyre # Date 1325053642 25200 # Node ID c7df1ea6fd7187c328e23990a5d21f2ba58c570d # Parent 78a630e650d229e4c6f1cd968d9a1e4b56e8a7d7 fixed javadoc to work with my setup diff -r 78a630e650d2 -r c7df1ea6fd71 readme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/readme.txt Tue Dec 27 23:27:22 2011 -0700 @@ -0,0 +1,2 @@ +these are various special commands in clojure +that are near and dear to my heart diff -r 78a630e650d2 -r c7df1ea6fd71 src/rlm/light_base.clj --- a/src/rlm/light_base.clj Tue Oct 18 00:57:08 2011 -0700 +++ b/src/rlm/light_base.clj Tue Dec 27 23:27:22 2011 -0700 @@ -162,9 +162,6 @@ cos exp log pow rint sin tan]] [functor :only [fmap]]] - '[matchure :only [fn-match defn-match if-match when-match cond-match]] - - ;; '[letd :only [with-separator display-local-bindings letd]] '[clojure diff -r 78a630e650d2 -r c7df1ea6fd71 src/rlm/meditations.clj --- a/src/rlm/meditations.clj Tue Oct 18 00:57:08 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -(ns rlm.meditations) - -(defn ten-times - "Why do people have to argue so much? I feel so alone and - angry. Clojure helps me to calm down. Just today I went to pour - house, and al through the walk, there was so much negativity. Most - of this comes from Mike, I think. He himself feels insecure - because Duncan and Acrefoot were talking about inodes and he didn't - know what they were. Duncan was talking about a ray tracer which - would be able to cmompute new frames in real time. I thought that - sounded neat, but I don't think 20 cores would be enough to really - get it right.. You probably need a whole separate computer - archeticture to actualy do it, like the ray tracing FPGA setup that - some peoplle in 6.375 made last semester. When we gmade it to Pour - House, there seemed to be some event going on. We went downstairs - and found that it was Amnesty International, MIT division, holding a - petition for the conditional release of some journalists from - somewhere. The girl wwho introduced us to the program was drunk. - There were no tables, bbut the bar was mostly empty. I suggested - to Mike that we might sit at the bar, but he said that that would - kill the experience for him since then we would be unable to talk to - everyone eexcept those next to us. Then he told me that If I wanted - t sit down that I could just do that. He was saying that I didn't - care about anything but food and that it woI wasn't really part of - the group anyway, so it was really just up to me wherever I wanted - to sit. I found this to be very cruel and was sad. He didn't even - realize that he made me sad, which means he can't put himself in my - shoes even a bit. Then he got into an argument with acrefoot about - whether there was a croud above us or not. Acrefood had not - nnoticed the croud when we walked in, so he thought we might go up - thereand see if we could get a table. Mike kept arguing about which - way was the front or back of the store because he didn't remember - the orientation of the upper level after we walked down the stairs. - ThBoth men were missing something that the other knew, but the - difference between acrefoot and Mike was that Mike in every word he - said was trying to put acrefoot down and belittle his intelligence - by arguing with him, while acrefoot tried to explain which way was - the front many times whithout changing the subject. Finally - acrefoot found out about the croud, but by that time, he was - upsetand wanted to go up to the upper level anyway just to get away - from Mike. I wanted to go too and said so. Mike dismissively said - that it was OK to go up if we wanted, and I started to follow - acrefoot to the stairs. But then acrefoot asked Chris if he wanted - to go with him. Am I invisible or something? Acrefood did not mean - this out of malice, he just literally din't see me and so asked - chris. Still, this made me feel bad because I was already feeling - bad. Acrefoot and I went upstairs and found that the croud which was - there prevented us from getting a seat. We went back down and there - was Mike, sitting at a table that had just cleared. People started - to sit down at the table, and then Duncan sat next to Mike and - l positioned his body in such a way that he took up the remainder of - the three person booth seat. Yen-yu told him to move but he acted - like he couldn't hear her. I was standing right next to him and - obviously (to me and most people) wating for my seat, but he would - not move. This is Duncan being his normal mildly-autustic self. I - can't blame him for it, as he just gets so focoused sometimes that - he doesn't know how to deal with people. I have some of the same - problems. I like Duncan, but what he did made me feel sad even - more, because I was already feeling upset at his point. With three - random acts of meanness and inconsiderateness behind me and nothing - that good to look forward to, I just left. I didn't feel like - talking to anyone anymore, but wanted to be by myself. I hate how - Mike dismisses me, how his personality is alined to casual meanness, - and how he doesn't even have enough self reflection to know when he - is hurting others. I hope that he matures more and becomes a very - nice person, but I worry about him. I think I think about him too - much.. I'm becomming more widthdrawsn from interacting with these - nerds with half-baked social programming. It's hard living with - people who can casually just ithrow insults at you that would - demand a fight anywhere else. Where people can ignore you if they - think you're less intelligent than they are. I don't like it on - tetazoo. I don't like myself, and I don't like the people here, so - what am I supposed to do? I have to learn to deal or remove myself - from this situation. I think I'd be sad if I was all alone, though. - I left the resturant. I just didn't want to talk t o anyone - anymore. I wanted to be alone. I whish Dylan was here, or even - anothere copy of myself to talk to. I'm so lonely.. They've gotten - into my head. When I type that last sentence, I hear \"oh, the poor - buy is sad, no one loves him. you're not good enough to be loved.\" - That part of me is not helpful. It's echos of people being mean to - me in the past. If I was here to talk to, what would I say? I - would say, 'what's stopping you from just finding a new life, or - just being they type of person that people like and who gets along - wwith everyone? - I'd like to do this but it's so hard to just do a 180 on my - emotions.. As I was walking down the street, I overheard arguing - people and happy people in equal measure. At the time all I - processed were the angry , arguing people, but the goodness was - there too. So, it's just a matter of who you hang out with? Maybe - the clojure community can be ,y community? At least I have one good - friend in Pablo. Dylan is good but he's far away and has a mountain - of his owwn problems he has to work through before he can do - anything with me..I feel lame, because I've been around critical - people for too long. I want to change, become more affable, but I - don't know how. What should I do now? I think I'll go swimming. - But, I don't think they'll let me actually go. I loaned my ID card - to pablo. - This is an experiment in nested closures that makes a function that - must be called ten times to yield its value. It reminds me of - taylor aproximations to a sin wave, which are only accurate for a - finite stretch of the reals, but that stretch can be made as long - as you want by adding more terms." - [] - (let [count 10 - return (fn return [n] - (if (= n 0) "the end" - (fn [] (return (dec n)))))] - (return (dec count)))) - -(defn onion [f n] (if (zero? n) f (recur (fn[]f) (dec n)))) - -(defn onion++[f n] (if (zero? n) f (recur (fn[& _]f) (dec n)))) - -(defn onion+ [f n] (reduce (fn [f _] (fn [] f)) f (range n))) - -(defn onion-n [n f] (onion f n)) - - -(defn ttt [f & knocks] - ( - (cond (empty? knocks) f - ( - - -(defn onion++ [f & knocks] - (let[forever-onion (fn g[& _]g)] - (reduce (fn [g knock] - (fn[& args] (if (=(first args) knock) g forever-onion))) - f knocks))) - - - -(defn treasure - ([X n] - (fn[& args] - (let [k (count args)] - (cond - (< k n) (println "It's to your right!") - (> k n) (println "It's to your left!") - (= k n) (do (println "Apply force here to dig!") (delay X)))))) - ([X n & ns] - (apply treasure (treasure X n) ns))) - - -(def X (treasure "I'm treasure!" 5 3 2 6)) -(defn soln [] - (force ((force ((force ((force (X 1 1 1 1 1 1 ))1 1 )) 1 1 1)) 1 1 1 1 1 ) )) - - -(defn onion* [f n] - (if (zero? n) - f - (fn [] (onion* f (dec n))))) - - diff -r 78a630e650d2 -r c7df1ea6fd71 src/rlm/quick.clj --- a/src/rlm/quick.clj Tue Oct 18 00:57:08 2011 -0700 +++ b/src/rlm/quick.clj Tue Dec 27 23:27:22 2011 -0700 @@ -30,7 +30,6 @@ [map-utils :only [map-keys map-vals filter-keys filter-vals]] [decorators :only [preserve-meta]]] - '[matchure :only [fn-match defn-match if-match when-match cond-match]] '[clojure.contrib [combinatorics :only [cartesian-product subsets selections diff -r 78a630e650d2 -r c7df1ea6fd71 src/rlm/rlm_commands.clj --- a/src/rlm/rlm_commands.clj Tue Oct 18 00:57:08 2011 -0700 +++ b/src/rlm/rlm_commands.clj Tue Dec 27 23:27:22 2011 -0700 @@ -2,7 +2,7 @@ (:require [rlm ns-rlm shell-write] [clojure.contrib [duck-streams :as ds]]) (:use [clojure.contrib java-utils]) - (:use clojure.java.javadoc)) + (:require clojure.java.javadoc)) (defn current-directory [] (ds/file-str "/home/r/mobius")) @@ -75,8 +75,6 @@ (defn keymap-clojure [] (rlm.shell-write/sw "xmodmap" "/home/r/.xmodmap.clojure")) - - (defn keymap-normal [] (rlm.shell-write/sw "xmodmap" "/home/r/.xmodmap.normal")) @@ -85,6 +83,12 @@ (clojure.core/require 'rlm.light-base) (rlm.ns-rlm/ns-clone rlm.light-base)) +(defn javadoc [target] + (binding + [clojure.java.browse/*open-url-script* + "/home/r/proj/repl/get-webpage.pl"] + (clojure.java.javadoc/javadoc target))) + (defn help "load a bunch of really useful help functions" @@ -92,7 +96,8 @@ (use '[rlm [function-utils :only [mix defmix runonce]] - [rlm-commands :only [undef ns-reset ns-nuke reload keymap-clojure keymap-normal rlm]] + [rlm-commands :only [undef ns-reset ns-nuke reload keymap-clojure + keymap-normal rlm javadoc]] [ns-rlm :only [ns-clear ns-clone ls]] [play-all :only [play-all-music]] [shell-inspect :only [command-line?]] @@ -110,15 +115,15 @@ [str-utils :only [re-split re-gsub str-join]] [repl-utils :only [show expression-info]]] '[clojure - [repl :only [source]]] - '[clojure.java - [javadoc :only [javadoc add-local-javadoc]]]) - (clojure.java.javadoc/add-local-javadoc "/home/r/cortex/jme3/dist/javadoc") - (clojure.java.javadoc/add-local-javadoc "/home/r/roBin/jdk6-docs/docs/api") - (clojure.java.javadoc/add-local-javadoc - "/home/r/roBin/lpsolve-doc/lpsolve.sourceforge.net/5.5/Java/docs/api") - (clojure.java.javadoc/add-local-javadoc - "/home/r/roBin/lpsolve-doc/lpsolve.sourceforge.net/5.5/Java/docs/api") + [repl :only [source]]]) + (clojure.java.javadoc/add-local-javadoc + "/home/r/proj/jMonkeyEngine3/dist/javadoc") + (clojure.java.javadoc/add-local-javadoc + "/home/r/java/jdk6u30-docs/api") + (clojure.java.javadoc/add-local-javadoc + "/home/r/java/jdk6u30-docs/jdk/api") + (clojure.java.javadoc/add-local-javadoc + "/home/r/java/jdk6u30-docs/jre/api") nil)