(fn[rq rs](let[log(java.util.logging.Logger/getLogger"mind.RootHandler") apps{ :dresdenlabs{:name"AlphaLabs"} :floatingboat2013{:name"FloatingBoat2013"} :knot-net{:name"KnotNet"} :new-egypt{:name"NewEgypt"}} appId(.get com.google.appengine.api.utils.SystemProperty/applicationId) app(get apps(keyword appId)) bh"abbccddfc5849d6decce074ca1b48a1cea262bc919d5d8627958d9c97bb6666f" pageEdit(fn[h t s][:sup[:a{:href(str"/ef/"h):title t} [:img{:width s :height s :alt t :src"/pen"}]]]) userService(com.google.appengine.api.users.UserServiceFactory/getUserService) datastoreService (com.google.appengine.api.datastore.DatastoreServiceFactory/getDatastoreService) sortDirAsc(com.google.appengine.api.datastore.Query$SortDirection/valueOf"ASCENDING") sortDirDesc(com.google.appengine.api.datastore.Query$SortDirection/valueOf"DESCENDING") filterEq(com.google.appengine.api.datastore.Query$FilterOperator/valueOf"EQUAL") queryLimit(fn[n] (com.google.appengine.api.datastore.FetchOptions$Builder/withLimit n)) mc(com.google.appengine.api.memcache.MemcacheServiceFactory/getMemcacheService) p(java.util.regex.Pattern/compile"[A-Z]+[a-z]+[A-Z]+[a-zA-Z0-9]*") urlP(java.util.regex.Pattern/compile"http[s]?://(^[ \n\r]*)");ToDo linkify(fn[ws] (let[m(.matcher urlP ws)] (if(.find m) (let[s(subs ws(.start m)(.end m))] [:a{:href(str"http://"s)}s]) ws))) wikify(fn[ws] (let[urlM(.matcher urlP ws)] ((fn recurW[ws m lastPos] (if(.find m) (let[ matchS(subs ws(.start m)(.end m)) pageExists (.getResourceAsStream(RT/baseLoader) (str "mind/" matchS ".txt"))] (list (subs ws lastPos(.start m)) [:a{:href(str"/wiki/"(linkify matchS)) :class(if pageExists"blue""red")} (linkify matchS)] (recurW ws m(.end m)))) (subs(str ws" ")lastPos))) ws (.matcher p ws)0))) btnBase"/" imgBase"/" knownUsers{ ; key: the userId as returned by userService.getCurrentUser().getUserId() "105367551153881701299"{ :profilePic "https://graph.facebook.com/509034915/picture" :wikiName"RaWa"} "ekcuop"{ :profilePic "https://lh3.googleusercontent.com/-1mLgZCinFfY/AAAAAAAAAAI/AAAAAAAAABE/R6k8EnyaYTg/s120-c/photo.jpg" :wikiName "HiPo"}} statsKey(com.google.appengine.api.datastore.KeyFactory/createKey "__Stat_Kind__" "BootStrap") countPages(fn[](.getProperty(.get datastoreService statsKey)"count")) uri(str" "(.getRequestURI rq)) uriP(if(<=(.length uri)2)"/"(.trim uri)) pathElements(.split uriP"/") resource(if(>(alength pathElements)0)(second pathElements)"") service (com.google.appengine.api.datastore.DatastoreServiceFactory/getDatastoreService) printException(fn[e] (hiccup.core/html ""[:html[:head [:title"Exception α"] [:link{:rel"stylesheet":type"text/css":href"/css"}]] [:body [:h1[:a{:href"/"}"α"]" Exception"] [:p"Pieschen we have a ProBlem:"[:br]e]]])) evalCode(fn[c](try (.setCharacterEncoding rs"UTF-8") ((eval(read-string c))rq rs) (catch Exception e(do (.severe log(str"ErrorMessage:"e)) (printException e))))) evalId(fn[id] (let[l(Long. id) key(com.google.appengine.api.datastore.KeyFactory/createKey"BootStrap"l)] (evalCode(.getValue(.getProperty(.get service key)"content"))))) evalResource(fn[r] (let[ limit(com.google.appengine.api.datastore.FetchOptions$Builder/withLimit 1) query(doto (com.google.appengine.api.datastore.Query."BootStrap") (.addSort"published"sortDirDesc) (.addFilter"resource"filterEq(str"/"r))) codeE(first(.asIterable(.prepare service query)limit))] (evalCode (if codeE(.getValue(.getProperty codeE"content")) (slurp(str"https://raw.githubusercontent.com/wasserfuhr/" "AllHashes/master/r/"r".clj")))))) search[:span [:input{:style"margin-left:64px":name"q"}] [:input{:type"submit":value"Search"}]] auth(fn[](let[ si(.getId(.getSession rq)) sk(com.google.appengine.api.datastore.KeyFactory/createKey "SignIn" si) se(try(.get service sk) (catch com.google.appengine.api.datastore.EntityNotFoundException e nil)) json(if se(clojure.contrib.json/read-json (.getValue(.getProperty se"content"))))] [:form{:action"/search"}(if json;(.isUserLoggedIn userService) [:nav[:p#auth"WelCome "[:a{:href(:identifier(:profile json))} (:displayName(:profile json))" " [:img{:width 25 :height 25 :src(:photo(:profile json))}]] " | "[:a{:href"/signout"}"SignOut"]] [:p[:a{:href"/edit"}"edit"]search]])])) footer[:footer(wikify"a RaWa EtAl production.")" BestHash: " [:a{:href(str"https://app.originstamp.org/s/"bh)}"#"(subs bh 0 8)"..."]] notifyTo(fn[to subject msgBody](let[ props(java.util.Properties.) session(javax.mail.Session/getDefaultInstance props nil) fromAddr (javax.mail.internet.InternetAddress. "rainerwasserfuhr@googlemail.com""RaWa") to"wasserfuhr@yahoo.com" toAddr(javax.mail.internet.InternetAddress. to"RaWa") msg(doto(javax.mail.internet.MimeMessage. session) (.setFrom fromAddr) (.addRecipient javax.mail.Message$RecipientType/TO toAddr) (.setSubject subject) (.setText msgBody))] (javax.mail.Transport/send msg))) notify(fn[subj msg](notifyTo"wasserfuhr@yahoo.com"subj msg)) id(if resource(get pathElements 2))](do (.setAttribute rq"requestURI" (str resource(.trim (subs(str(.getRequestURI rq)" ") (.length(str"/eval/"id)))))) (.setAttribute rq"c"{ :can[:link{:rel"canonical":href(str"https://sl4.eu"(.getRequestURI rq))}] :css[:link{:rel"stylesheet":type"text/css":href"/css"}] :ds datastoreService :fo footer :h(fn[x](slurp(str"http://s.sl4.eu/c/h/"x))) :ht(fn[h b](hiccup.core/html""[:html{:lang""}h b])) :pe pageEdit :re(fn[x](.sendRedirect rs x)) :rh(fn[x](slurp(str "https://"(.getServerName rq)"/rh/"x))) :sh(fn[h](slurp(str"http://s.sl4.eu/c/sh/"h))) :vp[:meta{:name"viewport":content"width=device-width,initial-scale=1.0"}] :wf wikify}) (.setAttribute rq"vars"{ :analytics"" :auth auth :rpxJs"" :log log :sortDirAsc sortDirAsc :sortDirDesc sortDirDesc :filterEq filterEq :queryLimit queryLimit :appId appId :evalResource evalResource :pageEdit pageEdit :appName(:name app) :notify notify :notifyTo notifyTo :apps apps :countPages countPages :datastoreService datastoreService :footer footer :knownUsers knownUsers :memCache mc :userService userService :wikify wikify}) (if(="eval"resource)(evalId id)(evalResource resource)))))