annotate src/rlm/meditations.clj @ 0:78a630e650d2

initial import
author Robert McIntyre <rlm@mit.edu>
date Tue, 18 Oct 2011 00:57:08 -0700
parents
children
rev   line source
rlm@0 1 (ns rlm.meditations)
rlm@0 2
rlm@0 3 (defn ten-times
rlm@0 4 "Why do people have to argue so much? I feel so alone and
rlm@0 5 angry. Clojure helps me to calm down. Just today I went to pour
rlm@0 6 house, and al through the walk, there was so much negativity. Most
rlm@0 7 of this comes from Mike, I think. He himself feels insecure
rlm@0 8 because Duncan and Acrefoot were talking about inodes and he didn't
rlm@0 9 know what they were. Duncan was talking about a ray tracer which
rlm@0 10 would be able to cmompute new frames in real time. I thought that
rlm@0 11 sounded neat, but I don't think 20 cores would be enough to really
rlm@0 12 get it right.. You probably need a whole separate computer
rlm@0 13 archeticture to actualy do it, like the ray tracing FPGA setup that
rlm@0 14 some peoplle in 6.375 made last semester. When we gmade it to Pour
rlm@0 15 House, there seemed to be some event going on. We went downstairs
rlm@0 16 and found that it was Amnesty International, MIT division, holding a
rlm@0 17 petition for the conditional release of some journalists from
rlm@0 18 somewhere. The girl wwho introduced us to the program was drunk.
rlm@0 19 There were no tables, bbut the bar was mostly empty. I suggested
rlm@0 20 to Mike that we might sit at the bar, but he said that that would
rlm@0 21 kill the experience for him since then we would be unable to talk to
rlm@0 22 everyone eexcept those next to us. Then he told me that If I wanted
rlm@0 23 t sit down that I could just do that. He was saying that I didn't
rlm@0 24 care about anything but food and that it woI wasn't really part of
rlm@0 25 the group anyway, so it was really just up to me wherever I wanted
rlm@0 26 to sit. I found this to be very cruel and was sad. He didn't even
rlm@0 27 realize that he made me sad, which means he can't put himself in my
rlm@0 28 shoes even a bit. Then he got into an argument with acrefoot about
rlm@0 29 whether there was a croud above us or not. Acrefood had not
rlm@0 30 nnoticed the croud when we walked in, so he thought we might go up
rlm@0 31 thereand see if we could get a table. Mike kept arguing about which
rlm@0 32 way was the front or back of the store because he didn't remember
rlm@0 33 the orientation of the upper level after we walked down the stairs.
rlm@0 34 ThBoth men were missing something that the other knew, but the
rlm@0 35 difference between acrefoot and Mike was that Mike in every word he
rlm@0 36 said was trying to put acrefoot down and belittle his intelligence
rlm@0 37 by arguing with him, while acrefoot tried to explain which way was
rlm@0 38 the front many times whithout changing the subject. Finally
rlm@0 39 acrefoot found out about the croud, but by that time, he was
rlm@0 40 upsetand wanted to go up to the upper level anyway just to get away
rlm@0 41 from Mike. I wanted to go too and said so. Mike dismissively said
rlm@0 42 that it was OK to go up if we wanted, and I started to follow
rlm@0 43 acrefoot to the stairs. But then acrefoot asked Chris if he wanted
rlm@0 44 to go with him. Am I invisible or something? Acrefood did not mean
rlm@0 45 this out of malice, he just literally din't see me and so asked
rlm@0 46 chris. Still, this made me feel bad because I was already feeling
rlm@0 47 bad. Acrefoot and I went upstairs and found that the croud which was
rlm@0 48 there prevented us from getting a seat. We went back down and there
rlm@0 49 was Mike, sitting at a table that had just cleared. People started
rlm@0 50 to sit down at the table, and then Duncan sat next to Mike and
rlm@0 51 l positioned his body in such a way that he took up the remainder of
rlm@0 52 the three person booth seat. Yen-yu told him to move but he acted
rlm@0 53 like he couldn't hear her. I was standing right next to him and
rlm@0 54 obviously (to me and most people) wating for my seat, but he would
rlm@0 55 not move. This is Duncan being his normal mildly-autustic self. I
rlm@0 56 can't blame him for it, as he just gets so focoused sometimes that
rlm@0 57 he doesn't know how to deal with people. I have some of the same
rlm@0 58 problems. I like Duncan, but what he did made me feel sad even
rlm@0 59 more, because I was already feeling upset at his point. With three
rlm@0 60 random acts of meanness and inconsiderateness behind me and nothing
rlm@0 61 that good to look forward to, I just left. I didn't feel like
rlm@0 62 talking to anyone anymore, but wanted to be by myself. I hate how
rlm@0 63 Mike dismisses me, how his personality is alined to casual meanness,
rlm@0 64 and how he doesn't even have enough self reflection to know when he
rlm@0 65 is hurting others. I hope that he matures more and becomes a very
rlm@0 66 nice person, but I worry about him. I think I think about him too
rlm@0 67 much.. I'm becomming more widthdrawsn from interacting with these
rlm@0 68 nerds with half-baked social programming. It's hard living with
rlm@0 69 people who can casually just ithrow insults at you that would
rlm@0 70 demand a fight anywhere else. Where people can ignore you if they
rlm@0 71 think you're less intelligent than they are. I don't like it on
rlm@0 72 tetazoo. I don't like myself, and I don't like the people here, so
rlm@0 73 what am I supposed to do? I have to learn to deal or remove myself
rlm@0 74 from this situation. I think I'd be sad if I was all alone, though.
rlm@0 75 I left the resturant. I just didn't want to talk t o anyone
rlm@0 76 anymore. I wanted to be alone. I whish Dylan was here, or even
rlm@0 77 anothere copy of myself to talk to. I'm so lonely.. They've gotten
rlm@0 78 into my head. When I type that last sentence, I hear \"oh, the poor
rlm@0 79 buy is sad, no one loves him. you're not good enough to be loved.\"
rlm@0 80 That part of me is not helpful. It's echos of people being mean to
rlm@0 81 me in the past. If I was here to talk to, what would I say? I
rlm@0 82 would say, 'what's stopping you from just finding a new life, or
rlm@0 83 just being they type of person that people like and who gets along
rlm@0 84 wwith everyone?
rlm@0 85 I'd like to do this but it's so hard to just do a 180 on my
rlm@0 86 emotions.. As I was walking down the street, I overheard arguing
rlm@0 87 people and happy people in equal measure. At the time all I
rlm@0 88 processed were the angry , arguing people, but the goodness was
rlm@0 89 there too. So, it's just a matter of who you hang out with? Maybe
rlm@0 90 the clojure community can be ,y community? At least I have one good
rlm@0 91 friend in Pablo. Dylan is good but he's far away and has a mountain
rlm@0 92 of his owwn problems he has to work through before he can do
rlm@0 93 anything with me..I feel lame, because I've been around critical
rlm@0 94 people for too long. I want to change, become more affable, but I
rlm@0 95 don't know how. What should I do now? I think I'll go swimming.
rlm@0 96 But, I don't think they'll let me actually go. I loaned my ID card
rlm@0 97 to pablo.
rlm@0 98 This is an experiment in nested closures that makes a function that
rlm@0 99 must be called ten times to yield its value. It reminds me of
rlm@0 100 taylor aproximations to a sin wave, which are only accurate for a
rlm@0 101 finite stretch of the reals, but that stretch can be made as long
rlm@0 102 as you want by adding more terms."
rlm@0 103 []
rlm@0 104 (let [count 10
rlm@0 105 return (fn return [n]
rlm@0 106 (if (= n 0) "the end"
rlm@0 107 (fn [] (return (dec n)))))]
rlm@0 108 (return (dec count))))
rlm@0 109
rlm@0 110 (defn onion [f n] (if (zero? n) f (recur (fn[]f) (dec n))))
rlm@0 111
rlm@0 112 (defn onion++[f n] (if (zero? n) f (recur (fn[& _]f) (dec n))))
rlm@0 113
rlm@0 114 (defn onion+ [f n] (reduce (fn [f _] (fn [] f)) f (range n)))
rlm@0 115
rlm@0 116 (defn onion-n [n f] (onion f n))
rlm@0 117
rlm@0 118
rlm@0 119 (defn ttt [f & knocks]
rlm@0 120 (
rlm@0 121 (cond (empty? knocks) f
rlm@0 122 (
rlm@0 123
rlm@0 124
rlm@0 125 (defn onion++ [f & knocks]
rlm@0 126 (let[forever-onion (fn g[& _]g)]
rlm@0 127 (reduce (fn [g knock]
rlm@0 128 (fn[& args] (if (=(first args) knock) g forever-onion)))
rlm@0 129 f knocks)))
rlm@0 130
rlm@0 131
rlm@0 132
rlm@0 133 (defn treasure
rlm@0 134 ([X n]
rlm@0 135 (fn[& args]
rlm@0 136 (let [k (count args)]
rlm@0 137 (cond
rlm@0 138 (< k n) (println "It's to your right!")
rlm@0 139 (> k n) (println "It's to your left!")
rlm@0 140 (= k n) (do (println "Apply force here to dig!") (delay X))))))
rlm@0 141 ([X n & ns]
rlm@0 142 (apply treasure (treasure X n) ns)))
rlm@0 143
rlm@0 144
rlm@0 145 (def X (treasure "I'm treasure!" 5 3 2 6))
rlm@0 146 (defn soln []
rlm@0 147 (force ((force ((force ((force (X 1 1 1 1 1 1 ))1 1 )) 1 1 1)) 1 1 1 1 1 ) ))
rlm@0 148
rlm@0 149
rlm@0 150 (defn onion* [f n]
rlm@0 151 (if (zero? n)
rlm@0 152 f
rlm@0 153 (fn [] (onion* f (dec n)))))
rlm@0 154
rlm@0 155