changeset 2:c7df1ea6fd71

fixed javadoc to work with my setup
author Robert McIntyre <rlm@mit.edu>
date Tue, 27 Dec 2011 23:27:22 -0700
parents 78a630e650d2
children c8e35134bf8e
files readme.txt src/rlm/light_base.clj src/rlm/meditations.clj src/rlm/quick.clj src/rlm/rlm_commands.clj
diffstat 5 files changed, 20 insertions(+), 172 deletions(-) [+]
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/readme.txt	Tue Dec 27 23:27:22 2011 -0700
     1.3 @@ -0,0 +1,2 @@
     1.4 +these are various special commands in clojure
     1.5 +that are near and dear to my heart
     2.1 --- a/src/rlm/light_base.clj	Tue Oct 18 00:57:08 2011 -0700
     2.2 +++ b/src/rlm/light_base.clj	Tue Dec 27 23:27:22 2011 -0700
     2.3 @@ -162,9 +162,6 @@
     2.4      cos exp log pow rint sin tan]]
     2.5     [functor :only [fmap]]]
     2.6   
     2.7 - '[matchure :only [fn-match defn-match if-match when-match cond-match]]
     2.8 - 
     2.9 - 
    2.10  ;; '[letd :only [with-separator display-local-bindings letd]]
    2.11   
    2.12   '[clojure
     3.1 --- a/src/rlm/meditations.clj	Tue Oct 18 00:57:08 2011 -0700
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,155 +0,0 @@
     3.4 -(ns rlm.meditations)
     3.5 -
     3.6 -(defn ten-times
     3.7 -  "Why do people have to argue so much?  I feel so alone and
     3.8 -   angry. Clojure helps me to calm down.  Just today I went to pour
     3.9 -   house, and al through the walk, there was so much negativity.  Most
    3.10 -   of this comes from Mike, I think.  He himself feels insecure
    3.11 -   because Duncan and Acrefoot were talking about inodes and he didn't
    3.12 -  know what they were.  Duncan was talking about a ray tracer which
    3.13 -  would be able to cmompute new frames in real time.  I thought that
    3.14 -  sounded neat, but I don't think 20 cores would be enough to really
    3.15 -  get it right..  You probably need a whole separate computer
    3.16 -  archeticture to actualy do it, like the ray tracing FPGA setup that
    3.17 -  some peoplle in 6.375 made last semester. When we gmade it to Pour
    3.18 -  House, there seemed to be some event going on.  We went downstairs
    3.19 -  and found that it was Amnesty International, MIT division, holding a
    3.20 -  petition for the conditional release of some journalists from
    3.21 -  somewhere.  The girl wwho introduced us to the program was drunk.
    3.22 -  There were no tables,  bbut the bar was mostly empty.  I suggested
    3.23 -  to Mike that we might sit at the bar, but he said that that would
    3.24 -  kill the experience for him since then we would be unable to talk to
    3.25 -  everyone eexcept those next to us.  Then he told me that If I wanted
    3.26 -  t sit down that I could just do that.  He was saying that I didn't
    3.27 -  care about anything but food and that it woI wasn't really part of
    3.28 -  the group anyway, so it was really just up to me wherever I wanted
    3.29 -  to sit.  I found this to be very cruel and was sad.  He didn't even
    3.30 -  realize that he made me sad, which means he can't put himself in my
    3.31 -  shoes even a bit.  Then he got into an argument with acrefoot about
    3.32 -  whether there was a croud above us or not.  Acrefood had not
    3.33 -  nnoticed the croud when we walked in, so he thought we might go up
    3.34 -  thereand see if we could get a table.  Mike kept arguing about which
    3.35 -  way was the front or back of the store because he didn't remember
    3.36 -  the orientation of the upper level after we walked down the stairs.
    3.37 -  ThBoth men were missing something that the other knew, but the
    3.38 -  difference between acrefoot and Mike was that Mike in every word he
    3.39 -  said was trying to put acrefoot down and belittle his intelligence
    3.40 -  by arguing with him, while acrefoot tried to explain which way was
    3.41 -  the front many times whithout changing the subject.  Finally
    3.42 -  acrefoot found out about the croud, but by that time, he was
    3.43 -  upsetand wanted to go up to the upper level anyway just to get away
    3.44 -  from Mike.  I wanted to go too and said so.  Mike dismissively said
    3.45 -  that it was OK to go up if we wanted, and I started to follow
    3.46 -  acrefoot to the stairs.  But then acrefoot asked Chris if he wanted
    3.47 -  to go with him.  Am I invisible or something?  Acrefood did not mean
    3.48 -  this out of malice, he just literally din't see me  and so asked
    3.49 -  chris.  Still, this made me feel bad because I was already feeling
    3.50 -  bad. Acrefoot and I went upstairs and found that the croud which was
    3.51 -  there prevented us from getting a seat.  We went back down and there
    3.52 -  was Mike, sitting at a table that had just cleared.  People started
    3.53 -  to sit down at the table, and then Duncan sat next to Mike and
    3.54 -  l positioned his body in such a way that he took up the remainder of
    3.55 -  the three person booth seat.  Yen-yu told him to move but he acted
    3.56 -  like he couldn't hear her.  I was standing right next to him and
    3.57 -  obviously (to me and most people) wating for my seat, but he would
    3.58 -  not move.  This is Duncan being his normal mildly-autustic self.  I
    3.59 -  can't blame him for it, as he just gets so focoused sometimes that
    3.60 -  he doesn't know how to deal with people.  I have some of the same
    3.61 -  problems.  I like Duncan, but what he did made me feel sad even
    3.62 -  more, because I was already feeling upset at his point.  With three
    3.63 -  random acts of meanness and inconsiderateness behind me and nothing
    3.64 -  that good to look forward to, I just left.  I didn't feel like
    3.65 -  talking to anyone anymore, but wanted to be by myself. I hate how
    3.66 -  Mike dismisses me, how his personality is alined to casual meanness,
    3.67 -  and how  he doesn't even have enough self reflection to know when he
    3.68 -  is hurting others.  I hope that he matures more and becomes a very
    3.69 -  nice person, but I worry about him.  I think I think about him too
    3.70 -  much..  I'm becomming more widthdrawsn from interacting with these
    3.71 -  nerds with half-baked social programming.  It's hard living with
    3.72 -  people who can casually just ithrow insults at you  that would
    3.73 -  demand a fight anywhere else.  Where people can ignore you if they
    3.74 -  think you're less intelligent than they are.  I don't like it on
    3.75 -  tetazoo.  I don't like myself, and I don't like the people here, so
    3.76 -  what am I supposed to do? I have to learn to deal or remove myself
    3.77 -  from this situation. I think I'd be sad if I was all alone, though.
    3.78 -  I left the resturant.  I just didn't want to talk t o anyone
    3.79 -  anymore.  I wanted to be alone.  I whish Dylan was here, or even
    3.80 -  anothere copy of myself to talk to.  I'm so lonely..  They've gotten
    3.81 -  into my head.  When I type that last sentence, I hear \"oh, the poor
    3.82 -  buy is sad, no one loves him.  you're not good enough to be loved.\"
    3.83 -  That part of me is not helpful.  It's echos of people being mean to
    3.84 -  me in the past.  If I was here to talk to, what would I say?  I
    3.85 -  would say, 'what's stopping you from just finding a new life, or
    3.86 -  just being they type of person that people like and who gets along
    3.87 -  wwith everyone?
    3.88 -  I'd like to do this but it's so hard to just do a 180 on my
    3.89 -  emotions..  As I was walking down the street, I overheard arguing
    3.90 -  people and happy people in equal measure.  At the time all I
    3.91 -  processed were the angry , arguing people, but the goodness was
    3.92 -  there too.  So, it's just a matter of who you hang out with? Maybe
    3.93 -  the clojure community can be ,y community? At least I have one good
    3.94 -  friend in Pablo.  Dylan is good but he's far away and has a mountain
    3.95 -  of his owwn problems he has to work through before he can do
    3.96 -  anything with me..I feel lame, because I've been around critical
    3.97 -  people for too long. I want to change, become more affable, but I
    3.98 -  don't know how. What should I do now? I think I'll go swimming.
    3.99 -  But, I don't think they'll let me actually go.  I loaned my ID card
   3.100 -  to pablo.
   3.101 -   This is an experiment in nested closures that makes a function that
   3.102 -   must be called ten times to yield its value. It reminds me of
   3.103 -   taylor aproximations to a sin wave, which are only accurate for a
   3.104 -   finite stretch of the reals, but that stretch can be made as long
   3.105 -   as you want by adding more terms."
   3.106 -  []
   3.107 -  (let [count 10
   3.108 -	return (fn return [n]
   3.109 -		 (if (= n 0) "the end"
   3.110 -		     (fn [] (return (dec n)))))]
   3.111 -    (return (dec count))))
   3.112 -
   3.113 -(defn onion [f n] (if (zero? n) f (recur (fn[]f) (dec n))))
   3.114 -
   3.115 -(defn onion++[f n] (if (zero? n) f (recur (fn[& _]f) (dec n))))
   3.116 -
   3.117 -(defn onion+ [f n] (reduce (fn [f _] (fn [] f)) f (range n)))
   3.118 -
   3.119 -(defn onion-n [n f] (onion f n))
   3.120 -
   3.121 -
   3.122 -(defn ttt [f & knocks]
   3.123 -  (
   3.124 -  (cond (empty? knocks) f
   3.125 -	(
   3.126 -
   3.127 -
   3.128 -(defn onion++ [f & knocks]
   3.129 -  (let[forever-onion (fn g[& _]g)]
   3.130 -    (reduce (fn [g knock]
   3.131 -	      (fn[& args] (if (=(first args) knock) g forever-onion)))
   3.132 -	    f knocks)))
   3.133 -
   3.134 -
   3.135 -
   3.136 -(defn treasure
   3.137 -  ([X n]
   3.138 -     (fn[& args]
   3.139 -       (let [k (count args)]
   3.140 -       (cond
   3.141 -	(< k n) (println "It's to your right!")
   3.142 -	(> k n) (println "It's to your left!")
   3.143 -	(= k n) (do (println "Apply force here to dig!") (delay X))))))
   3.144 -  ([X n & ns]
   3.145 -     (apply treasure (treasure X n) ns)))
   3.146 -
   3.147 -
   3.148 -(def X (treasure "I'm treasure!" 5 3 2 6))
   3.149 -(defn soln []
   3.150 -  (force ((force ((force ((force (X 1 1 1 1 1 1 ))1 1  )) 1 1 1)) 1 1 1 1 1 ) ))
   3.151 -
   3.152 -
   3.153 -(defn onion* [f n]
   3.154 -  (if (zero? n)
   3.155 -    f
   3.156 -    (fn [] (onion* f (dec n)))))
   3.157 -
   3.158 -
     4.1 --- a/src/rlm/quick.clj	Tue Oct 18 00:57:08 2011 -0700
     4.2 +++ b/src/rlm/quick.clj	Tue Dec 27 23:27:22 2011 -0700
     4.3 @@ -30,7 +30,6 @@
     4.4       [map-utils :only [map-keys map-vals filter-keys filter-vals]]
     4.5       [decorators :only [preserve-meta]]]
     4.6  
     4.7 -   '[matchure :only [fn-match defn-match if-match when-match cond-match]]
     4.8    
     4.9     '[clojure.contrib
    4.10       [combinatorics :only [cartesian-product subsets selections
     5.1 --- a/src/rlm/rlm_commands.clj	Tue Oct 18 00:57:08 2011 -0700
     5.2 +++ b/src/rlm/rlm_commands.clj	Tue Dec 27 23:27:22 2011 -0700
     5.3 @@ -2,7 +2,7 @@
     5.4    (:require  [rlm ns-rlm shell-write]
     5.5  	     [clojure.contrib [duck-streams :as ds]])
     5.6    (:use [clojure.contrib java-utils])
     5.7 -  (:use clojure.java.javadoc))
     5.8 +  (:require clojure.java.javadoc))
     5.9  
    5.10  
    5.11  (defn current-directory [] (ds/file-str "/home/r/mobius"))
    5.12 @@ -75,8 +75,6 @@
    5.13  (defn keymap-clojure []
    5.14    (rlm.shell-write/sw "xmodmap" "/home/r/.xmodmap.clojure"))
    5.15  
    5.16 -
    5.17 -
    5.18  (defn keymap-normal []
    5.19    (rlm.shell-write/sw "xmodmap" "/home/r/.xmodmap.normal"))
    5.20  
    5.21 @@ -85,6 +83,12 @@
    5.22    (clojure.core/require 'rlm.light-base)
    5.23    (rlm.ns-rlm/ns-clone rlm.light-base))
    5.24  
    5.25 +(defn javadoc [target]
    5.26 +  (binding
    5.27 +      [clojure.java.browse/*open-url-script*
    5.28 +       "/home/r/proj/repl/get-webpage.pl"]
    5.29 +    (clojure.java.javadoc/javadoc target)))
    5.30 +     
    5.31  
    5.32  (defn help
    5.33    "load a bunch of really useful help functions"
    5.34 @@ -92,7 +96,8 @@
    5.35    (use
    5.36     '[rlm
    5.37       [function-utils :only [mix defmix runonce]]
    5.38 -     [rlm-commands :only [undef ns-reset ns-nuke reload keymap-clojure keymap-normal rlm]]
    5.39 +     [rlm-commands :only [undef ns-reset ns-nuke reload keymap-clojure
    5.40 +                          keymap-normal rlm javadoc]]
    5.41       [ns-rlm :only [ns-clear ns-clone ls]]
    5.42       [play-all :only [play-all-music]]
    5.43       [shell-inspect :only [command-line?]]
    5.44 @@ -110,15 +115,15 @@
    5.45       [str-utils :only [re-split re-gsub str-join]]
    5.46       [repl-utils :only [show expression-info]]]
    5.47      '[clojure
    5.48 -      [repl :only [source]]]
    5.49 -     '[clojure.java
    5.50 -       [javadoc :only [javadoc add-local-javadoc]]])
    5.51 -  (clojure.java.javadoc/add-local-javadoc "/home/r/cortex/jme3/dist/javadoc")
    5.52 -  (clojure.java.javadoc/add-local-javadoc "/home/r/roBin/jdk6-docs/docs/api")
    5.53 -  (clojure.java.javadoc/add-local-javadoc 
    5.54 -   "/home/r/roBin/lpsolve-doc/lpsolve.sourceforge.net/5.5/Java/docs/api")
    5.55 -  (clojure.java.javadoc/add-local-javadoc 
    5.56 -   "/home/r/roBin/lpsolve-doc/lpsolve.sourceforge.net/5.5/Java/docs/api")
    5.57 +      [repl :only [source]]])
    5.58 +  (clojure.java.javadoc/add-local-javadoc
    5.59 +   "/home/r/proj/jMonkeyEngine3/dist/javadoc")
    5.60 +  (clojure.java.javadoc/add-local-javadoc
    5.61 +   "/home/r/java/jdk6u30-docs/api")
    5.62 +  (clojure.java.javadoc/add-local-javadoc
    5.63 +   "/home/r/java/jdk6u30-docs/jdk/api")
    5.64 +  (clojure.java.javadoc/add-local-javadoc
    5.65 +   "/home/r/java/jdk6u30-docs/jre/api")
    5.66    
    5.67    nil)
    5.68