#clojure log - Jan 01 2016

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:03 ben_vulpes: i mean it's way at the bottom.

0:03 in the doc string for let, huh?

0:03 justin_smith: ben_vulpes: I know it's weird but I go around reading docs for things even though I think I already know them

0:04 kind of like how some people read cereal boxes

0:04 ben_vulpes: interestingly, it's in there for clj, but not cljs

0:04 not that i'm going to blame that for my missing it.

0:04 justin_smith: oh, that's odd

0:05 ben_vulpes: i'm much more inclined to pull the docs up now that i have cider all wired together

0:09 justin_smith: ,0x1bad1dea

0:09 clojurebot: 464330218

0:09 kenrestivo: what's a bad idea about the docs?

0:09 docs are awesome

0:10 justin_smith: nothing, I just randomly wanted to see what number that was, totally unrelated

0:10 kenrestivo: (inc docs)

0:10 amalloy: ,0xcafebabe

0:10 clojurebot: 3405691582

0:10 kenrestivo: ,inc docs

0:10 clojurebot: #object[clojure.core$inc 0x2478afba "clojure.core$inc@2478afba"]

0:10 kenrestivo: ~inc docs

0:10 clojurebot: Huh?

0:10 kenrestivo: whatever, whichevver bot keeps the karma, and however it does it, that.

0:11 justin_smith: ,(- 0xdeadbeef 0x1bad1dea)

0:11 clojurebot: 3271598341

1:16 justin_smith: ,(.toString (BigInteger. "3824053620879447910461354") 36)

1:16 clojurebot: "happynewyear2016"

2:02 TEttinger: ,(.toString 3824053620879447910461354N 36)

2:02 clojurebot: #error {\n :cause "No matching method found: toString for class clojure.lang.BigInt"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "No matching method found: toString for class clojure.lang.BigInt"\n :at [clojure.lang.Reflector invokeMatchingMethod "Reflector.java" 53]}]\n :trace\n [[clojure.lang.Reflector invokeMatchingMethod "Reflector.java" 53]\n [clojure.lang.Reflector in...

2:02 TEttinger: damn!

2:02 int and integer

2:03 ikfb_: I stduy clojure on braveclojure.com. Here is a str (swap! fred increase-cuddle-hunger-level 10) but the author said swap! need two args . It passed three !

2:03 TEttinger: swap! needs at least two args, it passes the rest to the fn

2:03 tolstoy: Is that tutorial written by Aphyr?

2:03 TEttinger: ,(def adam (atom 0))

2:03 clojurebot: #'sandbox/adam

2:03 TEttinger: ,(swap! adam inc)

2:04 clojurebot: 1

2:04 TEttinger: ,(swap! adam + 1)

2:04 clojurebot: 2

2:04 TEttinger: ,(swap! adam + 3 3 3)

2:04 clojurebot: 11

2:04 ikfb_: I see

2:05 func is first class . pass like a var . but action like fun

2:09 tolstoy: swap takes an atom a function and any args. Kinda like (reset! atom (apply f @atom args)).

2:14 ikfb_: I have a question. swap mean exchange. the meaning show only update atom value . where is old value , it can't give to a func i think.

2:16 tolstoy: The function you have to swap takes the old value and returns a new value to be stored on the atom.

2:16 (swap! atom (fn [old-value] (+ old-value 10)))

2:18 s/have/give/

2:19 If you want the old value, you just deref the atom.

2:20 (let [old-val @atom] (swap! atom #(+ % 10)))

2:20 the swap! function itself returns the new value when the function is applied.

4:46 ikfb_: Hi I translate https://bpaste.net/show/d9540131efbf to in python https://bpaste.net/show/6662ba8eec39 about 1 minute. When I want implement by clojure. ( First I should directly translate Then I use clojure's idea method to replace it) But I meet simple problem. Which var should be use atom or rel ?

6:59 /msg NickServ identify nickjiamo

7:10 ishake-u: hi

7:10 which country is this channel

7:13 beaky: hello

7:30 ikfb_: Ok find a website compare python and clojure on some syntax, http://jkkramer.com/sudoku.html

8:32 engblom: ikfb_: Somehow I find that site biased towards making Python look more simple. They seem to pick a more complicated way for Clojure, like (def digits (set (range 1 10))) for clojure and digits = '123456789 for Python

8:37 ikfb_: New to clojure. While the generally language something like equal turling. Every one have its best idiom to describe somethings. I am familiar python (more or less) I wish I can have some resource to see a complicated problem by clojure and python. (May be there have different domain)

8:41 AimHere: Rosetta Stone is a good resource for that sort of thing

8:41 Rosetta Code

8:41 http://rosettacode.org/wiki/Rosetta_Code

8:42 It's a website with a series of programming tasks, and the code for it in *lots* of languages

8:44 Whether the code for any given tasks is idiomatic clojure (or idiomatic python), I'll leave as an exercise for you to guess

8:45 ikfb_: thanks. I find a guys in 4clojure for last or list like : (reduce #(-> %2) [1 2 3 4]) and python may be a[-1]

8:45 AimHere: Well clojure has 'last' built-in.

8:46 Some of the 4clojure exercises are to replicate clojure builtins without using them

8:46 ,(last [1 2 3 4 5])

8:46 clojurebot: 5

8:46 AimHere: So when they have those sorts of constraints, they'll clearly not be idiomatic

8:51 ikfb_: Hi Aimhere . http://rosettacode.org/ is really what I want to see now. Wish more clojure programmer give their beautiful code on it. This may attract new people.

8:51 People will see which language is their taste.

9:43 irctc: Hi

13:04 Frozenlock: clojars is down again :-(

13:47 ZimaBlue: YEAH!

13:48 clojars IS down!! Is this an ongoing problem?

13:48 I'm trying to set up a new laptop/workstation and thought I'd just done something wrong -_-

13:51 gfredericks: ZimaBlue: linode keeps getting DOS'd, which affects clojars since it's hosted there

13:55 justin_smith: sounds like it's time for redundancy

13:55 ZimaBlue: that sucks :( is there a workaround to get leiningen up and running?

13:56 justin_smith: ZimaBlue: if you need a specific package, you can check out from github and run lein install

13:56 gfredericks: if toby hasn't gotten alex to give him some control over dns at least then I'm not sure how to get that redundancy working

13:56 unless we wanna all switch to clojars2.org

13:56 justin_smith: but if you need to bootstrap a whole lein install... maybe you can copy your ~/.m2/ from another machine?

13:58 gfredericks: I'm Gary Fredericks And I Wish Clojars Was Up.™©☺®

14:01 amalloy: we should all just share one network-mounted .m2

14:02 put it someplace central

14:02 justin_smith: :)

14:02 amalloy: what would we call our central maven?

14:02 (happy 2016)

14:03 justin_smith: gfredericks: well, instead of switching to clojars2.org, we could just ensure that clojars2, clojars3, clojars4 all exist and stay synced with clojars, and then add them all to the default repos

14:04 and separate orgs could sponsor mirrors, especially if there was a turnkey "run this jar to run a clojars mirror" download

14:04 the failover checking already exists in the maven logic

14:07 gfredericks: this reminds me that my server log says I've been getting requests for nonexistent subdomains of googlegooglegooglegooglegoogle.com

14:07 and I'm curious how that happens

14:07 justin_smith: gfredericks: the server log on googlegooglegooglegooglegoogle.com which you own, or the logs on some other server?

14:08 gfredericks: the former

14:08 in particular I've logged 2 requests to each of ww{38,41}.googlegooglegooglegooglegoogle.com, and 12 requests to ww1.googlegooglegooglegooglegoogle.com

14:09 amalloy: the least sophisticated port-scanning of all time

14:10 justin_smith: hell, I get requests for domains that aren't even subdomains http://24x7-allrequestsallowed.com/?PHPSESSID=aab45f4f00143PRWJTUGYC%40_JESX HTTP/1.1" - they are trying to see if I am running a proxy, basically

14:10 gfredericks: I've gotten 2 requests for www.baidu.com

14:10 justin_smith: I get a lot of those

14:11 gfredericks: if it was wwwwwwwwwwwwwww.googlegooglegooglegooglegoogle.com that they sent a request to, I would congratulate them for their wit

14:11 gfredericks: I should put something special there

14:12 justin_smith: gfredericks: you could blatantly copy the behavior of "telnet skelnet.club"

14:13 gfredericks: ha

14:13 justin_smith: gfredericks: what amazes me is that they made a recognizable ascii version of that dude at that resolution

14:13 I mean I know *exactly* the gif they are quoting

14:13 gfredericks: I don't know who that dude is

14:14 I only had two gif classes in college

14:14 never even made it to the end of that big textbook

14:14 justin_smith: oh wait never mind, not that one

14:15 false memory syndrome strikes again

14:17 gfredericks: I was thinking of this guy, but the costume is wrong https://nicoladallasen.files.wordpress.com/2014/09/tumblr_ncqys2nrbb1qe8i7ko7_r1_250.gif

14:17 gfredericks: oh I'm familiar with that guy actually

14:18 a coworker once took it upon himself to play that on his auxiliary monitor for the entire month of October or something

14:19 http://status.linode.com/

14:20 I used to run my primary personal server in linode atlanta, which made these outages a lot more annoying

14:21 justin_smith: gfredericks: does linode allow serving one site from multiple regions?

14:21 gfredericks: "ugh, my server's down; fine I'll just develop this clojure code locally. ugh, clojars is down; fine, I'll just"

14:21 justin_smith: can you do that purely with DNS?

14:21 justin_smith: dunno

14:22 amalloy: i hope to someday learn that dns is turing complete

14:23 justin_smith: gfredericks: I mean there's the low tech way of having a backup server and propagating a new dns to point to that one when the other one goes down - but there are fancier things out there too (that linode might not support)

14:40 gfredericks: I meant having one domain name point to several IPs

14:40 e.g., `dig google.com` lists 11 or so

14:42 justin_smith: gfredericks: I only know so much about this stuff, seems like it should be doable

14:43 gfredericks: ~this |could be due| to a typo in :dependencies or network issues.

14:43 clojurebot: c'est bon!

14:43 gfredericks: ~this

14:43 clojurebot: this is not allegro

14:43 gfredericks: ~this

14:43 clojurebot: this is an outrage!

14:43 gfredericks: ~this

14:43 clojurebot: this has been another episode of gfredericks in wonderland

14:44 amalloy: truer than you know, clojurebot

14:44 gfredericks: ~that

14:44 ~what

14:44 amalloy: gfredericks banned from clojurebot for spamming

14:44 gfredericks: ~it

14:45 consarnit

14:45 that's never happened before

14:45 clojurebot: that is pretty cool

14:54 ZimaBlue: thanks for the .m2 advice btw it worked

15:03 rhg135: I don't like 'em script kiddies attacking servers. By now it's not serving a purpose.

15:38 lokien: How to use "and" on a vector? I have a vector of booleans

15:39 luma: (every? true? v)

15:40 lokien: what about "or"?

15:41 luma: (some true? v)

15:41 lokien: ohh, I tried to use some?, that's why it didn't work

15:41 thanks

15:41 luma: (some? x) is (not (nil? x))

15:42 lokien: not-empty? would be a better name, in my opinion

15:42 oh, it can be empty

15:43 never mind

15:43 ,(some? [])

15:43 clojurebot: true

16:04 danielglauser: Is clojars down for other folks? Can't pull up the web interface and I'm having trouble pulling down deps too.

16:06 featheredtoast: danielglauser: yeah, down for me currently too :(

16:08 danielglauser: I wonder if there's someone we should ping to be nice.

16:09 TEttinger: danielglauser: linode is still being DDoSed

16:09 at least that's what I gathered

16:09 featheredtoast: that'd do it then

16:09 danielglauser: TEttinger: Ah...that makes sense. Didn't know about that.

16:10 Curious, any idea why it's being DDoSed?

16:10 TEttinger: https://twitter.com/clojars

16:10 danielglauser: Sweet, didn't know about that. Thanks!

16:11 Luckily I'm able to build the deps I'm looking for from source.

16:16 TEttinger: https://twitter.com/jonknee/status/682974714935947266

16:21 I wonder how big clojars is

16:34 benjyz1: clojars.org is down?

16:34 http://downforeveryoneorjustme.com/clojars.org

16:35 MJB47: may i suggest updating the topic?

16:37 Trioxin: finally 1 clojure course makes it onto lynda

16:44 jonathanj: can i map with an xform?

16:44 archimedespi: lol, yeah, might want to just add "CLOJARS IS DOWN SINCE LINODE IS UNDER DDOS" to the beginning of the topic :)

16:44 jonathanj: like (let [xf (comp (map get-foo) (filter bar?)) objs (map xf things)])

16:47 i guess maybe that's just (sequence xf things)

17:03 kenrestivo: yikes, linode got piled on? yuck.

17:06 mr-: It might just be back (for now..)

17:10 archimedespi: it's been going up and down, linode is playing whack-a-mole with their various regions

17:20 kenrestivo: the couple client linodes i checked seem to be up

17:27 gfredericks: justin_smith: who is the photo of?

17:27 justin_smith: gfredericks: the man who famously rejected resolution in music

17:28 Arnold Shoenberg

17:28 (father of serialism, which rejects melodic movement, harmony, melody, etc.)

17:29 gfredericks: TIL

17:29 so he didn't want music to have any music in it

17:30 justin_smith: *schoenberg ftfm https://www.youtube.com/watch?v=A-fyWc6Mpd8

17:31 gfredericks: he claimed (right or wrong) music was possible without those things

17:31 above link is a good example

17:33 gfredericks: anyway pun on new years resolution etc. etc.

17:40 gfredericks: right right

17:41 * gfredericks the dennis rodman of classical music

17:41 justin_smith: gfredericks: music theory has some wild fringes - I knew a guy ages ago who developed scales based on sets of frequencies that were all relatively prime (ensuring that no audible harmonics would line up between any two notes in the scale)

17:44 gfredericks: I'd compare schoenberg in music to the expressionists in painting - still very traditional in many ways, derived quite logically (all to logically) from the preceding craft, but crucially rejecting the expectation that the result be beautiful (at least by preceding standards)

17:45 gfredericks: music is a series of developments that were each the dennis rodman of the previous development

17:45 justin_smith: heh

17:48 * gfredericks is a little too interested in declaring things to be the dennis rodman of things

17:48 justin_smith: gfredericks is the dennis rodman of declaring things are dennis rodmans of things

18:01 gfredericks: of course the main problem in this area is to figure out what michael jordan is the dennis rodman of

18:09 randomcharhere: good reference for beginning programing in clojure?

18:09 justin_smith: randomcharhere: if you literally mean a reference sheet, check out http://conj.io

18:10 randomcharhere: probaly bad choice of words not looking for a list of clojure cammonds more on basics of programming clojure

18:11 most book/website been more of a list of commands and not about how to program in clojure

18:12 daph: randomcharhere: Have you tried Clojure for the Brave and True? http://www.braveclojure.com/

18:12 justin_smith: randomcharhere: there are a few good intros online- clojure for the brave and true and clojure from the ground up are two good examples

18:14 randomcharhere: already got repl installed and have a really basic understanding of clojure

18:16 http://www.braveclojure.com/ have to check out. What I'm looking for is more programing by example starting simple and getting more complicated

18:17 most of what I've found is more along he lines of a list of commands and descriptions kinda like learning a languauge reading a dictioanry ...

19:53 justin_smith: ,\ಾ

19:53 clojurebot: \ಾ

19:53 rhg135: yay for unicode!

19:53 pontiki: what is happening? netsplit?

19:54 rhg135: doesn't seem so

19:55 usually it would say in the quit message

20:17 cal: anyone here familiar with joplin? every command i run i get a message says that the migrations table already exists.

20:54 tcrawley: gfredericks: justin_smith: I've been giving some thought today on what it would take to have a turnkey clojars mirror. I'm writing up my thoughts now, and will post to the clojars-maintainers list tonight

20:54 if'n y'all want to contribute to the discussion

20:55 gfredericks: tcrawley: cool

21:00 zerokarmaleft: danielglauser: https://twitter.com/clojars/status/683010552608722944

21:00 oops

21:01 tcrawley: I think you just earned some karma back!

21:27 justin_smith: tcrawley: awesome!

21:45 gfredericks: I wonder if linode achieved two 9's of uptime in 2015

21:50 daph: two nines gives them a yearly downtime of 3 days and 15 hours. Depending on how you define 'downtime', they could still good on two nines, since it seems like some of their DCs have remained un-attacked.

22:57 justin_smith: daph: but clojars specifically, hosted on linode, has had 10 hrs down just today

22:57 tcrawley: clojars is up at the moment. get your deps while they are hot

23:07 daph: justin_smith: true, I'm not debating that

23:51 kenrestivo: for i in `find . -type d`; do (cd $i; lein check); done

Logging service provided by n01se.net