#clojure log - Mar 21 2014

The Joy of Clojure
Main Clojure site
IRC
List of all logged dates

0:09 blake: Hey all: I want to generate a sequence from one of a series of functions for guessing numbers. The functions are of the form "fn[lo hi]" and return a number between lo and hi. I want to create a sequence of the numbers returned, where the sequence ends when the value returned matches the number to be guessed.

0:10 I know this is a noob question but...I'm a noob =P

0:10 Should I just use loop?

0:11 blake: Ahhh...thanks beamso.

0:13 beamso: not a problem

0:16 lazybot: ⇒ "([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"

0:17 amalloy: you probably want to iterate over a pair of [hi lo], with a function that narrows it according to a guess

0:19 blake: amalloy: Yeah, it's putting all the pieces together that's getting me.

0:20 take-while I get. But the examples don't have changing parameters to the function calls.

0:22 amalloy: blake: well, you can't with take-while. that's what iterate is for. the general structure is going to look like (take-while (complement successful-guess?) (iterate improve-guess [0 100]))

0:23 where improve-guess takes a [hi lo] pair and returns a new [hi lo] pair by guessing something according to the strategy and seeing whether it was higher or lower

0:23 beamso: i didn't realise that the guessed values were being passed back into the function

0:24 blake: Right. That's how it knows to narrow it's guessing range. Also, one of the functions has a random element, so I have to make sure I'm not--getting into trouble there.

0:25 amalloy: heh. well, purity is nice, but a function that's impure because of randomness is going to be a lot easier than anything else here

0:25 it's good to feel a little uncomfortable about it, though

0:25 blake: But how do I get the return from improve-guess to test for a successful guess?

0:26 amalloy: blake: you include that as part of improve-guess

0:26 blake: Yeah, I'm trying to get used to the whole super-high-level/super-low-level thing.

0:28 seangrove: I think I'm confused about core.async tap

0:28 technomancy: turing vertigo?

0:28 blake: Heh. Maybe.

0:29 seangrove: I have a channel, I pass it to (mult ...) (not sure what this does), then I can take the result of that and the channel and pass it as (tap (mult ...) my-ch) and I get back ... hrm, I'm not sure

0:30 Ok, I think I need to create a local channel and then tap the mult result onto that

0:31 Yup, that did it

0:34 sm0ke: how do i create a java class which behaves like a record in clojure?

0:34 amalloy: blake: if you want an example solution to look at, there's https://www.refheap.com/62676

0:35 sm0ke: so class MyClass { private a; } , should behave like (:a (MyClass. 1)) => 1

0:35 what class i need to extend/implement?

0:36 amalloy: to behave like a record? you have to do a lot of work. why don't you just do it in clojure, sm0ke?

0:37 sm0ke: amalloy: yea clojure record have some porblem with serialization

0:37 amalloy: is it really that hard?

0:38 ivan: I am going to email hotspot-compiler-dev@ about https://github.com/technomancy/leiningen/issues/1025 - does anyone want to be cc:'ed (especially people who know how the Clojure compiler works?)

0:38 amalloy: &(require 'clojure.reflect)

0:38 lazybot: ⇒ nil

0:38 amalloy: &(require 'clojure.reflect.java)

0:38 lazybot: ⇒ nil

0:38 amalloy: &(ancestors clojure.reflect.java.Constructor)

0:38 lazybot: java.lang.ClassNotFoundException: clojure.reflect.java.Constructor

0:38 amalloy: &(ancestors clojure.reflect.Constructor)

0:38 lazybot: ⇒ #{clojure.lang.IMeta clojure.lang.Seqable clojure.lang.Associative clojure.lang.IKeywordLookup clojure.lang.ILookup clojure.lang.IRecord clojure.lang.Counted java.lang.Object clojure.lang.IPersistentMap java.io.Serializable java.util.Map clojure.lang.IObj clojure.lan... https://www.refheap.com/62678

0:39 amalloy: sm0ke: that's the list of interfaces you have to implement to really act like a record

0:39 sm0ke: :/

0:39 hmmm IKeywordlookup is interesting

0:39 amalloy: but records are serializable, so i think that whatever problem you've found with actual records is imaginary

0:40 sm0ke: amalloy: https://github.com/nathanmarz/cascalog/issues/239

0:41 blake: amallow: Thanks. I'm heartened that it looks a lot like the code I've written, the parts that I got working, anywya.

0:41 amalloy: blake: most IRC clients let you tab-complete other users' names. i can tell you don't know this because you spelled my nick wrong :)

0:42 sm0ke: oh man. trying to do it in java makes that problem much much worse, not better

0:42 blake: amalloy: Aha. Another good tip!

0:43 amalloy: just do what the ticket suggests, and define your own serializers, or use a map instead of a record (good advice in general anyway)

0:49 sm0ke: Registering my own serializer implies writing another class in java

0:49 or using a gen class

0:49 which is equally gros

0:51 amalloy: well, it's gross that kryo makes you extend a class instead of implementing an interface, but you can use proxy instaed of gen-class

0:52 sm0ke: amalloy: i dont know how ancient is that library you showed me, but i guess 100 years old?

0:53 amalloy: bro, you're the one trying to use it

0:53 because cascalog uses it

0:53 sm0ke: amalloy: :) kryo has moved to esoteric also now there are just write and read methods

0:54 amalloy: also for registering you dont need to send instance just the serializing class

0:55 cascalog uses com.twitter/carbonite i guess

0:56 oh thats the confusion, when i search for carbnite i get this only which you send me

1:01 JavaIsAwful: 'night all

1:02 sm0ke: the dawn of Java

1:02 dusk?

1:08 TheMoonMaster: I've run into a bit of a snag, I have a socket connection that I'd like to be available everywhere since that's probably a lot cleaner than passing it around everywhere. How can I do that without getting "Unable to resolve symbol" when requiring other files?

1:11 sm0ke: TheMoonMaster: Why is passing around not cleaner?

1:11 TheMoonMaster: sm0ke: Because it's an isolated app and it just ends up being A LOT of calls of things like, (write out "message")

1:12 Where passing out seems extremely redundant because it will never ever change.

1:12 It's always going to be that single socket connection.

1:12 Well, {in: reader, :out writer}

1:13 sm0ke: TheMoonMaster: and you cant `use` the namespace containing it where you require it?

1:14 TheMoonMaster: It's defined in app.core so it might make a circular dependency.

1:14 sm0ke: then define it in a namesapce which everyone else will `use`

1:15 a namespace dedicated for socket operation maybe

1:16 where you can define (write..) (read..) and you dont need to work with that socket instance anywhere else

1:18 blake: amalloy: Having some trouble making that code work. It seems to always replace the high value, never the low...

1:18 TheMoonMaster: Gotcha, I think I just need to rethink the architecture a bit more. Thanks

1:20 amalloy: blake: when i paste that into my repl, i get stuff like: (guess-stream 50 bad-guesser 1 100) ;=> ([1 100] [37 100] [37 87] [37 77] [37 71] [50 71] [50 59] [50 58] [50 51] [50 50])

1:21 blake: malloy: Huh. I get things like [1 100] [1 49] [1 24] [1 11]... Lemme try a clean namespace.

1:21 amalloy: did you pick 1 as your number? :P

1:22 blake: Heheh.Wait...Lord, I hope not.

1:24 amalloy: OK, it's obviously getting late. I was passing in 1. Duh.

1:27 sm0ke: hurm wtf is print-dup? i defined a literal tag which creates a Java instance but when i do something like {:key #my/tag[1]}

1:28 I get CompilerException java.lang.RuntimeException: Can't embed object in code, maybe print-dup not defined

1:28 ,(doc print-dup)

1:28 clojurebot: "; "

1:50 vimuser2: hmm

1:51 (:test ni) is nil, is this supposed to be true?

1:51 erm , is this the way it's supposed to be?

1:52 (nil :test) fails to copmile...

2:06 Frozenlock: Is there some kind of timestamp function in cljs, or is it just js/Date?

2:07 ivan: Frozenlock: (goog.now) if you prefer that

2:09 Frozenlock: ivan: isn't it the same thing?

2:10 ivan: yep

2:10 Frozenlock: ah ok :-p

3:52 john2x: vimuser2: yes, that's intentional

3:55 arrdem: ,(println "http://i.imgur.com/ATY0kCE.jpg") ;; testing erc images

3:55 clojurebot: http://i.imgur.com/ATY0kCE.jpgn

3:55 arrdem: test passed... this is either going to be awesome or terrible

5:33 danielszmulewicz: I just encountered this in a leiningen project.clj: ":repositories {"snapshots" {:url "s3p://lein-snapshots/snapshots"}}" Has anybody seen that before? And what is s3p?

5:35 mpenet: s3 wagon private url scheme

6:14 danielszmulewicz: mpenet: Oh, thanks!

6:14 (inc mpenet)

6:14 lazybot: ⇒ 2

6:55 wagjo: good morning (ugt)

7:12 clgv: good lunch (GMT+1) :P

7:20 neilm: Hi, I'm starting with midje autotest (doing the clojure mooc). When I save it says no facts checked. What am I doing wrong?

7:21 clgv: neilm: oh hmm, that stupid crystal ball is defect, so no idea. ;)

7:22 neilm: better on email perhaps

7:23 clgv: neilm: huh? why?

7:25 neilm: clgv: because not sure about pasting into irc anyway just cloned the trainingday repo

7:25 clgv: project reads (defproject training-day "1.0.0-SNAPSHOT"

7:25 :dependencies [[org.clojure/clojure "1.5.1"]

7:25 [iloveponies.tests/training-day "0.1.0-SNAPSHOT"]]

7:25 :profiles {:dev {:plugins [[lein-midje "3.1.1"]]}})

7:25 clgv: tests run once only

7:26 clgv: neilm: there are sites for posting gists refheap.com or gist.github.com

7:26 neilm: did you run "lein midje :autotest" in you project folder?

7:26 Kneiva: neilm: that autotest is broken in those excercises

7:26 neilm: clgv: I did

7:27 Kneiva: thanks

7:27 Kneiva: neilm: or it doesn't work because the tests are in separate projects

7:27 neilm: Kneiva: It gets better later?

7:28 Kneiva: neilm: I don't think it has been fixed yet

7:28 clgv: neilm: I have [midje "1.6.2"] in my project's dev dependencies and [lein-midje "3.1.3"] in my ~/.lein/profiles.clj in the :user profile dependencies

7:29 neilm: and the tests are in the same project as the code

7:29 neilm: clgv: yep

8:03 mikerod: Is there a significant perf overhead to setting up dynamically bound vars in a fn via `binding`? Example; I have a fn that is called 500K-1mil times (from different locations) and it rebinds a dynamic var each time when the fn body is entered.

8:09 Pate_: Hey peeps. I'm doing an Introduction to Clojure talk in my local dev community, and I'm looking for good resources on the best way to introduce developers to Lisp/Clojure. I particularly like Rich's approach of starting with data structures and working from there. Do you know of any good resources I can borrow from, or have advice for approaching a large group, e.g. using whiteboard vs powerpoint vs Light Table?

8:15 wagjo: Pate_: For slides, I would recommend Stu's at https://github.com/stuarthalloway/clojure-presentations , they are CC licensed

8:15 Pate_: thanks, wagjo

8:18 wagjo: mikerod: Yes

8:18 mikerod: wagjo: any particular reason for that?

8:18 I've tried to experiment some with a profiler

8:18 wagjo: mikerod: I've tested var-get/var-set and it is very slow, compared to the atom or hand-crafted mutable reference

8:19 mikerod: hmm interesting

8:20 I did a really basic example like : `(time (dorun (repeat 100000000 (binding [*ns* (the-ns 'my.tester)] (resolve 'a)))))`

8:20 to attach a profiler and just see what sort of hot-spot I hit

8:20 wagjo: well just reading a dyunamic var checks if it is a root binding or a thread local one, if it is the latter, it gets a frame for given thread and from this frame it gets the thread local value

8:21 mikerod: I got about "Elapsed time: 22953.87 msecs", not so bad. The example is pretty trivial though.

8:21 wagjo: so you are saying commenting on the overhead of reading a dynamic var in general?

8:21 so you are commenting*

8:22 wagjo: set has to go through same checks too

8:24 mikerod: interesting

8:25 I suppose this should be avoiding in a heavily hit fn then...

8:26 wagjo: but it may be OK for you, depends on the situation

8:27 Atom is faster so if you do not need the additional features of Var, I would go with atom

8:27 mikerod: wagjo: in my usage specifically, I needed to change the *ns*.

8:28 which is a strange use-case probably

8:29 I appreciate the feedback on it.

8:29 wagjo: mikerod: well that is a strange case indeed :)

8:30 hacking the compiler?

8:32 mikerod: OK I've dug up my benchmarks, swap! is 2-3 times faster than var-set using with-local-vars

8:33 mikerod: wagjo: interesting, I guess that makes sense though

8:33 wagjo: um, hacking the compiler; I suppose

8:33 I'm in a DSL scenario. I have to create fn's but they are coming from different *ns* environments

8:33 So I want to let the fn body be eval'ed against the *ns* it was defined in.

8:36 I think there are smarter ways to accomplish what I'm going for. So exploring those. I was generally interested the perf of using `binding` though.

10:09 clgv: mikerod: yeah binding kinda slows down compared to just passing functions as parameters

10:09 or values

10:09 mikerod: do you have a lot if these bindings?

10:59 uzo: c/ear

12:17 seangrove: Generated art with Om/clojurescript http://dl.dropbox.com/u/412963/Screenshots/dj.png

12:17 locks: seangrove: looks almost like Piet

12:18 seangrove: Heh, just kidding - getting a dragging with snap-to-grid / snap-to-arbitrary-guidelines components going

12:18 locks: Oh, interesting, you're right, heh

12:18 malyn: seangrove: Boo! I was excited about the generated art angle. :)

12:19 seangrove: malyn: Maybe we'll get there :)

12:20 dnolen_: seangrove: nice

12:22 ddellacosta: dnolen_: this caused me a lot of pain: http://dev.clojure.org/jira/browse/CLJS-523

12:22 dnolen_: seems like there should be some way for dates to return a hash value so that it doesn't break, for example, sets

12:23 seangrove: Ah, the understated elegance of real-world Javascript "toString.call(aDate) == '[object Date]'"

12:24 * ddellacosta looks at seangrove's code and sobs after everything he's just been through

12:27 dnolen_: ddellacosta: sure patch welcome

12:28 ddellacosta: dnolen_: is it reasonable to add something further to extend js/Date though? Seems like that jira thread suggests that would not be the direction folks want to move in. The fix is simple--using the string representation of Dates to generate a hash works.

12:28 dnolen_: ddellacosta: CLJS-525 is the only thing I'm interested in

12:30 ddellacosta: dnolen_: okay, understood

12:32 dnolen_: ddellacosta: a separate ticket for proper hashing of dates not based on strings would be considered, Joda Time looks like it some good ideas

12:33 cemerick: contrary to the docs, e.g. >! and co. never return anything but nil. I presume this is a bug?

12:33 ddellacosta: dnolen_: okay, thanks. I'll go head down that rabbit hole now...

12:34 JavaIsAwful: I'm doing some command line parsing, and I want `server` or `client <url>` to be valid arguments. What's the convention to use for the usage string?

12:35 dnolen_: there are lots of useful ClojureScript libraries now, feel free to extend this list http://github.com/clojure/clojurescript/wiki#useful-libraries

12:35 JavaIsAwful: the best I could think of was "[server/client url]", but that's obviously not proper

12:38 ohh, I think the convention is [server|client url]

12:39 except server and client are literal strings, while url is a variable name

12:39 I suppose I should instead use [--server|--client url]

12:40 jjttjj: maybe a dumb question but is importing 20 million small entities going to be feasible/easy on a normal pc

12:40 in datomic

12:41 dnolen_: jjttjj: more likely to get a good answer in the #datomic channel

12:42 jjttjj: dnolen_: k thanks

12:42 swks: exit

12:55 mr-foobar: dnolen_: In om can I print a component to string ?

12:55 dnolen_: mr-foobar: dom/render-to-str

13:01 mr-foobar: dnolen_: thx !

13:10 JavaIsAwful: in tools.cli, is there a way to have a command line option change the :parse-fn for another option?

13:12 specifically, I have a --IPv6 flag, and if it's on, I want the --hostname=HOST option to be parsed by Inet6Address instead of Inet4Address

13:35 arrdem: JavaIsAwful: I don't think there is. For something like that you'll proabably have to implement it yourself as a tack-on transform over the options map.

13:36 JavaIsAwful: arrdem: I've decided to just leave the host un-parsed, and let the client function handle it

13:36 it's simple enough that way

13:36 arrdem: or that I guess...

13:37 I'd argue that if you have some standard IR for an address that's more detailed than a string you should convert to it early rather than late but that's just me.

13:38 JavaIsAwful: well, it's not like this is production code

13:38 so I'm not too worried about it

13:46 arrdem: totally quoting you on that...

13:49 amalloy: JavaIsAwful: that shouldn't be possible in tools.cli, because it processes the args one at a time and there's no guarantee of what order the user passes them

13:53 JavaIsAwful: amalloy: that makes sense

14:01 so, say I have two functions, f and g, a boolean b, and some argument

14:01 based on b, I want to either do (f argument) or (g argument)

14:02 is there a better way to do it than this: ((if b f g) argument) ?

14:02 it's kind of hard to read

14:02 imo

14:03 pyrtsa: If you really find the above hard to read, of course you can write (if b (f argument) (g argument)).

14:03 Averell: or maybe a multimethod?

14:03 dacc: (cond a (f arg) b (g arg)) ?

14:04 JavaIsAwful: I don't really want to call (f arg) and (g arg) separately though

14:04 I guess this really is the simplest way

14:04 pyrtsa: JavaIsAwful: Just get used to thinking (if b f g) can return a function.

14:04 dacc: yeah, reads fine to me

14:05 JavaIsAwful: pyrtsa: I'm used to things returning functions, just something seems bad about it to me

14:05 but I guess it beats the alternatives

14:05 dacc: higher order functions are your friend =)

14:05 pyrtsa: JavaIsAwful: You can of course use a let expression to highlight the fact that the function gets called either way. (let [h (if b f g)] (h arg))

14:05 JavaIsAwful: pyrtsa: that's a good point, I think I'll do that

14:06 didn't think of that

14:06 pyrtsa: :)

14:12 JavaIsAwful: I think I should start using my github username, so people actually remember me

14:12 Rosnec: I've probably used about 5 different nicks in here before :P

14:21 amalloy: Rosnec: back when i had trouble reading ((if b f g) arg), i decided to use it whenever reasonable, so that i would get used to it and improve my command of the language

14:22 Rosnec: amalloy: I don't really have trouble reading it, just something about it seems wrong to me

14:22 not a big deal

14:23 I use it whenever I can, though

14:23 or better yet, do the thing with let that pyrtsa suggested

14:27 justin_smith: before I go and implement this myself - is there a clojure or java package that would let me check if a string is an SQL reserved word?

14:27 seems like a simple set of strings would suffice, but no need to store the information twice if it is out there somewhere

14:30 hiredman: justin_smith: that is highly implementation dependent

14:31 for example, fun fact, ssl is a reservered word in some versions of mysql

14:31 justin_smith: weird

14:31 OK, I'll just put a bunch of strings in a set for the db backends I care about

14:31 thanks

14:41 puredanger: if you're using JDBC, there is a call in DatabaseMetaData that can give you the set of reserved words for your database

14:42 justin_smith: now THAT would be nice

14:42 justin_smith: sweet, exactly what I was looking for actually

14:42 puredanger: although it looks like that is a list in addition to SQL:2003 keywords

14:43 justin_smith: well I can compromise and hardcode those

14:44 but better that than have to hand collate (and keep updated) the reserved words of all the backends we support

14:44 (inc puredanger)

14:44 lazybot: ⇒ 1

14:45 puredanger: hazards of having written a JDBC driver :)

14:54 seangrove: dnolen_: What's the use-case for :shared? If I have some data modifyable elsewhere that all of my subcomponents need to be able to access the latest version of, is that an appropriate place to put it vs app state?

14:54 dnolen_: In fact, feel free to disregard the second question, and just share your answer to the first

14:54 Rosnec: ah crap

14:55 a catch clause can't be in the tail position, right?

14:55 I'm trying to make a loop which retries a few times on a socket timeout

14:58 dnolen_: seangrove: :shared + :tx-listen is pretty useful

14:59 seangrove: anyone can subscribe to transacts! as they occur

14:59 seangrove: dnolen_: So for tapping state/events, or for inter-component/intra-app communication?

14:59 dnolen_: seangrove: yep

14:59 seangrove: Ok, thanks, will chew that over

15:00 Rosnec: ooh

15:01 thanks amalloy

15:01 heh, the code in the question is almost identical to mine

15:19 AmnesiousFunes: bbloom: Can I pester you about the cljs port of fipp? Any news?

15:19 bbloom: AmnesiousFunes: nothing new besides what is in those github tickets

15:20 AmnesiousFunes: however, i simply dislike cljx and don't feel like maintaining a copy/paste directory of code

15:21 it's unlikely that I'll maintain a simultaneous clj/cljs version of anything until the cross platform code story gets better

15:22 AmnesiousFunes: bbloom: Does that mean that jonase's cljs fork would be the "official" port, if it reaches working status?

15:22 bbloom: AmnesiousFunes: i haven't run it, but my udnerstanding is that it worked from the first try

15:22 AmnesiousFunes: it's like a 3 line change to swap finger trees out for rrb vectors

15:22 AmnesiousFunes: Nice to know. Thanks.

15:23 bbloom: AmnesiousFunes: and then after that there's a macro that you don't need and can simply delete

15:24 AmnesiousFunes: if you want to make your life easier for tracking changes, you'll need to either prove that the clj version is faster/the-same with rrb vectors, or you need to port finger trees to cljs :-)

15:24 AmnesiousFunes: Wasn't there a finger tree cljs impl hovering around?

15:24 bbloom: *shrug*

15:28 wagjo: AmnesiousFunes: https://github.com/wagjo/data-cljs

15:29 but ftrees are very slow compare to rrbt vectors

15:29 AmnesiousFunes: wagjo: Thanks, I had just found the link to your lib in the fipp issue tracker.

15:29 I see

15:29 bbloom: wagjo: that was my understanding as well, but some benchmarking in fipp was wildly inconclusive

15:31 wagjo: the 32 chunk array is more appropriate in most situations than digits and node objects, for both nth and conj

15:31 Rosnec: I don't understand why gloss frames always get placed in a sequence

15:31 why doesn't it just return a single ByteBuffer?

15:33 bbloom: wagjo: rust heavily leans on left and right consing, concatenation, and left popping, which are all the heuristic operations of rrb vectors

15:33 wagjo: bbloom: IIRC ftrees produce a lot garbage objects and while v8 handles it well, it was not perfect. Haven't compared it in CLJ though

15:34 wagjo: I've tried to limit garbage in ftrees and provide special fns for e.g. reduce and nth, but still

15:35 bbloom: wagjo: by rust, i meant fipp

15:35 Rosnec: ohh, I think I get why it returns a seq. It splits byte buffers at any delimiters you give

15:35 bbloom: wagjo: i happened to be reading a thing about rust at this moment and brain slipped :-P

15:39 tbaldridge: AKA, he'd rather be programming Rust than Clojure :-P

15:39 bbloom: tbaldridge: more like i rather NOT be writing C++ :-P

15:39 arrdem: ++rust

15:40 wagjo: heh

15:43 borkdude: could it be that the ordering of map entries (on which I should not depend, I know) differ per JVM version?

15:43 or Java version

15:43 wagjo: borkdude: or per Clojure version ;)

15:46 borkdude: if you use hashmap, than the order depends on the hash, and the algorithm for hash changes between Oracle JVM versions

15:46 borkdude: wagjo, I see ok!

15:47 wagjo: borkdude: and Clojure changes hashing algo for 1.6 drastically too, so there

15:48 borkdude: wagjo yeah, I saw that

15:57 dnolen_: bbloom: the Clojure RRBTrees still need quite a bit of optimization work last I looked.

15:58 bbloom: dnolen_: that was my understanding as well

16:06 Frozenlock: When I try to `lein jar' a cljx project, it warns me that there's some duplicate files. (namely, core.clj and core.cljs)

16:07 Wasn't lein skipping cljs files?

16:08 If not, does it mean that I can remove lein-cljsbuild entirely from my project?

16:14 gtrak: you don't need cljsbuild to distribute cljs in jars

16:15 I guess you might need it to run tests and such

16:22 Frozenlock: gtrak: Ah! Perfect then.

16:23 (I alreadly run the tests on the clj part)

16:24 cYmen: The reasonable IDE choices are Vim, Emacs, Lighttable and Eclipse, correct?

16:25 gtrak: Cursive?

16:26 nightcode?

16:26 cYmen: That's intellij, right?

16:26 gtrak: cursive is, yea

16:26 cYmen: Nightcode looks interesting, too.

16:26 Are there any comparisons available?

16:27 ooohh nightcode comes with presets for doing android dev in clojure

16:28 gtrak: do you already know emacs? if not, probably worth it to use something else :-)

16:28 cYmen: That could be fun.

16:28 I'm currently using emacs. :p

16:28 Rosnec: okay, I have a bit of an issue

16:28 cYmen: I wouldn't go as far as saying that I "know" emacs. ;)

16:28 Rosnec: I'm trying to send some DatagramPackets

16:28 gtrak: it's hard for me to use light table b/c I'm used to emacs, but I know a vim guy that likes it.

16:29 Rosnec: and I'm getting the bytes from gloss frames

16:29 but gloss sometimes splits the frame into multiple ByteBuffers

16:29 is there a way to force it to put everything in a single buffer?

16:30 or if not, a way to make DatagramPacket see the seq of ByteBuffers as a single ByteBuffer?

16:30 gtrak: i think it has to know sizes ahead of time, yea?

16:30 malyn: Rosnec: I think that you want to call (contiguous ...) on the seq of buffers that you are getting back -- https://github.com/ztellman/gloss/wiki/Introduction

16:31 Rosnec: malyn: ooh

16:31 now I feel dumb for not noticing that

16:33 malyn: There is a lot of content there, it's easy to miss single lines like that.

16:33 Rosnec: I'm pretty sure I read that paragraph a few times already

16:33 but that was before I realized I actually needed it

16:34 malyn: Yeah, that's frequently me and all of Clojure. Oooh, that looks neat. I hope I remember that someday when I actually understand what it means. :)

16:36 cYmen: gtrak: How hard/annoying/tedious is it to edit files on a machine to which I have ssh access with emacs?

16:36 If you happen to know how to do that. :)

16:36 gtrak: emacs is good at that, that's tramp mode, or I prefer sshfs.

16:36 which is not emacs-specific.

16:36 cYmen: yeah, I know sshfs

16:36 hlship: What is the expected behavior in core.async when code inside a go block throws an exception?

16:37 gtrak: there was a recent commit to enable cider-jack-in on tramp mode buffers.

16:37 hlship: It looks like the channel that receives the body result is closed

16:37 DomKM: noprompt: I'd like to use Bourbon and Neat in a project I'm working on. Thorn looks cool, how's it coming along?

16:37 cYmen: gtrak: Genera question, what's the meaning of the current buffer when I start an nrepl?

16:38 gtrak: so, if you have a single buffer open, and it's on a clj source file, cider-jack-in will start a repl for that current project.

16:38 hlship: I'm curious if there's anyway I could get go blocks into a "zombie" state?

16:38 noprompt: DomKM: i've been a tad on the busy side so i haven't had time to work on it this week. it'll mostly convert css->clj but full scss support isn't ready yet.

16:38 gtrak: 'current buffer' just means the selected or active one.

16:38 noprompt: i could always use help on it though.

16:38 amalloy: cYmen: i use tramp to edit files over ssh. it's pretty convenient: C-x C-f /ssh:me@host:/home/me/whatever.txt

16:39 hlship: It feels like any go blocks parked waiting for the failed go block will see the nil and, at worst, NPE

16:39 noprompt: DomKM: basically it's a matter of implementing remaining the remaining methods.

16:39 amalloy: the only thing i have trouble with is editing remote root-only files using sudo. i can't figure out how to get that to work

16:40 DomKM: noprompt: Ah, okay cool. Looking forward to using it. :)

16:40 noprompt: DomKM: if you'd like to help and have time i could give you the quick 'n dirty on it.

16:42 DomKM: essentially the remaining methods would need to handle SCSS vars, mixins, etc. it's just a PITA.

16:43 cYmen: gtrak: So, repls are somehow project specific and information from the project definition is being used for something?

16:43 noprompt: one thing that would be awesome would be to figure out how to keep track of where top-level vars are defined and how to properly expand them when emitting code.

16:45 cYmen: amalloy: I think I don't have that installed because I think I just created a weird folder and now emacs is trying to start aspell :p

16:50 gtrak: cYmen: yes, that's the case, the project.clj tells leiningen how to set up the java classpath correctly, among other things.

16:51 joelt: where to find Clojure job?

16:51 SegFaultAX: joelt: Where are you based?

16:51 joelt: Austin

16:51 nothing i see in Indeed.

16:52 arohner: joelt: do you have any remote experience? CircleCI is always hiring

16:52 joelt: planning on going to local Clojure group.

16:52 arohner: (remote, out of SF)

16:53 joelt: oddly not a big fan of working remote, but possible i guess.

16:53 arohner: no problem. just throwing it out there

16:54 SegFaultAX: arohner: Where is your office? SOMA?

16:54 joelt: thx though. didn't know if there was a clojure specific jobboard.

16:54 SegFaultAX: You told me once before but I forgot.

16:54 arohner: SegFaultAX: we were at Heavybit at the time

16:54 SegFaultAX: Did you guys move into your own office?

16:54 arohner: now we're in a temporary loft while looking for 'real' offices

16:54 some genius built a 6000 sq ft, 3 story, one bedroom apt

16:54 SegFaultAX: Well that's a step in the right direction! Congrats!

16:55 arohner: so we're there for a few months. The ground floor is offices, the second floor is a 'normal' apt living room & kitchen, and we turned the bedroom into a conference room

16:55 SegFaultAX: Thanks!

16:56 SegFaultAX: arohner: We're also in a loft for the moment (near 4th & King). But we're moving in a couple weeks.

16:56 tmciver: joelt: functionaljobs.com

16:57 joelt: tmciver: nice.

16:57 arohner: SegFaultAX: congrats! do you know where yet?

16:57 SegFaultAX: arohner: Yup. 5th and... mission I think? Maybe folsom.

16:57 arohner: cool. We're looking at a place on 2nd or 3rd & market

16:58 SegFaultAX: arohner: Oh man i really love that area. Rally was at 2nd & Mission. Such a sweet spot.

16:58 They're still there (for the moment), but I left Rally at the start of this year.

16:58 arohner: SegFaultAX: cool. where are you now?

16:59 SegFaultAX: arohner: StyleSeat.

17:02 arohner: SegFaultAX: cool. Another clojure startup!

17:03 SegFaultAX: We loved Circle at Rally. The only thing was our tests were really shitty so the builds took fricken forever.

17:03 The most cost effective solution for us at the time was to setup jenkins+2 slaves on beefy hand built boxes.

17:06 dacc: SegFaultAX: Rally as in rallydev.com?

17:07 SegFaultAX: dacc: rally.org

17:07 dacc: Crowdfunding for causes and non-profits.

17:08 dacc: SegFaultAX: ah cool

17:08 SegFaultAX: arohner: StyleSeat is mostly Python for the moment (3+ year old Django codebase), but Clojure is starting to infect.

17:08 Soon it will consume everything in its path. :D

17:08 At least that's my plan.

17:08 arohner: :-)

17:08 * dacc 's working at a Django shop.

17:09 dacc: most of the infection has been ideas here so far =)

17:09 SegFaultAX: dacc: Yea but you're probably on good Django. We

17:09 *we're on 1.4.2 :O

17:09 dacc: we just clawed our way into 1.6 i believe

17:09 DomKM: noprompt: I'm a CSS newb but I'd be happy to help if I can. I'm busy at the moment but maybe we can go over it later.

17:10 dacc: SegFaultAX: i actually find the ORM pretty nice. QuerySets have some decent composition properties

17:10 SegFaultAX: dacc: And 1.7 is about to go final.

17:10 dacc: SegFaultAX: the forms and templates can be horrid, though =\

17:10 SegFaultAX: dacc: I prefer it to ActiveRecord, but in general I despise ORM.

17:11 dacc: yeah

17:11 SegFaultAX: "ORMs make easy things easy and hard things impossible" - Abraham Lincoln

17:11 dacc: hah, exactly

17:13 i recently convinced everyone we should look at switching to SERIALIZABLE transaction isolation. manual locking + greedy orm touching everything in sight is a recipe for deadlock.

17:13 SegFaultAX: dacc: Manual commit like a boss.

17:14 pmonks: "transaction per table" pattern ftw

17:14 * pmonks saw that in a production app he inherited… ;-(

17:15 SegFaultAX: pmonks: How does that even work?

17:15 pmonks: Exactly! ;-)

17:15 It took me a week to even believe what I was seeing.

17:15 SegFaultAX: Seriously though, how do you even write to the database for anything even slightly non-trivial?

17:15 pmonks: I thought I was seeing something super-advanced and not understanding it.

17:16 dacc: that'll solve your contention, and your, uh, atomicity =)

17:16 SegFaultAX: And your consistency, too!

17:16 pmonks: Actually wait, I know how they did it.

17:17 The entire site was a single thousand column table.

17:17 pmonks: :-D

17:17 SegFaultAX: #webscale

17:17 pmonks: Simpler than that: they'd (accidentally) made the system no-concurrency (only one request at a time).

17:18 I inherited it with a "fix performance" mandate.

17:18 dacc: SegFaultAX: how are you phasing in clojure at your shop?

17:18 SegFaultAX: dacc: Brute force and fear tactics.

17:18 Also, water-boarding.

17:18 dacc: haha

17:19 turbofail: "Power is in tearing human minds to pieces and putting them together again in new shapes of your own choosing."

17:20 paren-shaped pieces

17:20 dacc: i'm fighting the idea war as i mentioned. largely writing clojure in python, which is actually pretty idiomatic as python is a little schizo.

17:21 SegFaultAX: turbofail: Factually correct.

17:22 llasram: dacc: It seems pretty sane. A bunch of functions directly defined in a module, with the occasional deftype, er, class when you need to do something OOy

17:26 technomancy: llasram: got my forth working last night, kinda excited

17:26 "working"

17:26 noprompt: DomKM: just ping me if you have questions. i'm no stranger to google hangouts, etc. if you wanna chat that way too.

17:27 technomancy: you can't define your own words, but it executes primitives and stuff

17:27 noprompt: i think it might be cool to see if we could pull together a group of interested people each month to talk about garden, thorn, and how to make it better.

17:28 llasram: technomancy: Awesome!

17:28 noprompt: is it possible to transform comment nodes w/ enlive?

17:28 i'm not sure how to target them

17:29 malyn: technomancy: Which platform/environment are you targeting?

17:29 technomancy: malyn: AVR on a Teensy ucontroller

17:30 llasram: I ended up going with C just because the docs for doing avr asm are beyond horrible

17:31 malyn: Neat! I looked at building one of those once and then got discouraged on something. Maybe the fact that it would be a pain to constantly have to flash newly-defined words due to the limited RAM and Harvard architecture? I can't remember now.

17:32 technomancy: malyn: haven't gotten it running quite yet on the board. it's got 2.5k of ram; we'll see.

17:33 the split memory is unfortunate for sure

17:33 malyn: Yeah, it made me sad. :( I went back to ARM after that brief foray into AVR.

17:37 muhoo: ~orm makes easy things easy and hard things impossible

17:37 clojurebot: Excuse me?

17:38 muhoo: ~orm is orms make easy things easy and hard things impossible

17:38 clojurebot: Ik begrijp

17:38 justin_smith: ~omg

17:38 clojurebot: Huh?

17:38 justin_smith: ~orm

17:38 clojurebot: orm is orms make easy things easy and hard things impossible

17:38 justin_smith: ~erm

17:38 clojurebot: Huh?

17:38 tmciver: technomancy: what's this? You're trying to get a forth interpreter running on an AVR?

17:39 technomancy: tmciver: yeah, that's the plan

17:40 pmonks: ~pmonks is mullet aficionado

17:40 clojurebot: Roger.

17:40 pmonks: ~pmonks

17:40 clojurebot: pmonks is mullet aficionado

17:40 seangrove: dnolen_: You might like https://github.com/sgrove/om-draggable

17:40 technomancy: malyn: I came really close to using an arm in this project, but the pins on the board I had were to big to let it fit in the enclosure

17:41 seangrove: Generic draggable component behavior with free-drag, grid-snap-drag, and guideline-snap-drag

17:41 dnolen_: seangrove: nice!, in the example there's a typo I think, `app` is not an argument

17:42 tmciver: technomancy: cool. I've had an idea to write a clojure compiler for a PIC or AVR or something. We'll see if I ever get to it.

17:42 technomancy: tmciver: I was pretty surprised to find there was only one forth for avr I could find, and it takes over the bootloader

17:42 seangrove: dnolen_: fixed, thanks

17:43 malyn: technomancy: Yeah, one nice thing about AVRs is the variety of sizes that you can get. I understand that half the fun of using Forth is writing your own, but in case you want to just quickly build your app then you might check out SwiftX. Works great on the AVR micros (and ARM).

17:43 seangrove: dnolen_: It'll need a bit of work, but overall pretty happy with it for an early-morning piece

17:43 dnolen_: seangrove: looks cool will take a closer look later

17:44 technomancy: malyn: too late! I've got mine working. =)

17:44 "working"

17:45 tmciver: technomancy: why forth? I've heard of it but don't think I've ever seen any code. Is it functional?

17:45 malyn: technomancy: So close! Almost prevented http://xkcd.com/927/ yet again. ;)

17:47 justin_smith: tmciver: it is stack based / concatenative

17:47 tmciver: justin_smith: Ah yes, that sounds familiar.

17:49 justin_smith: actually no, forth is not strictly concatenative, but concatenative languages are often related to forth

17:50 paulswilliamsesq: Hi, can anyone advise how I use (seq x) when x is a clojure.lang.LazySeq ?

17:50 what are you trying to do with it?

17:53 I don't think there is anything you can do to a seq that you cannot do to a clojure.lang.LazySeq, but seq is useful if you get an arg that may be a vector, lazyseq, array, string, hash-map, whatever, and you want to be able to treat it as a generic sequence

17:54 paulswilliamsesq: my code is..

17:54 ([ids-to-process metrics]

17:54 (if (seq ids-to-process)

17:54 (let [current-activity (activity-details (first ids-to-process))]

17:54 (recur (rest ids-to-process) metrics)))))

17:55 technomancy: justin_smith: is it parsing words that make it not strictly concatenative?

17:55 paulswilliamsesq: Oh, that didn't work well ;)

17:55 arrdem: paulswilliamsesq: https://refheap.com

17:55 justin_smith: technomancy: not sure... forth also has heap manipulation words

17:55 ,(map seq [(range 3) [:a :b :c] "hello" {:a 0 :b 1 :c 2 :d 3}])

17:55 clojurebot: ((0 1 2) (:a :b :c) (\h \e \l \l \o) ([:a 0] [:c 2] [:b 1] [:d 3]))

17:56 technomancy: justin_smith: ah, of course

17:56 arrdem: hey technomancy, what chip are you using on that board?

17:56 * arrdem ponders a toothpick backend...

17:56 justin_smith: http://concatenative.org/wiki/view/Forth technomancy looks like we were both right

17:56 technomancy: arrdem: it's an atmega32u4 inside a teensy 2

17:57 * arrdem looks for a bit encoding spec

17:58 arrdem: paulswilliamsesq: you need to paste the link

17:58 technomancy: almost ended up using a teensy 3, which uses an arm cortex m4 and a boatload more ram

17:58 paulswilliamsesq: https://www.refheap.com/62990

17:58 arrdem: technomancy: want a Clojure assembler? I found a bytecode spec :D

17:58 paulswilliamsesq: ids-to-process is a lazy-seq

17:58 technomancy: arrdem: this board is way too small for scheme

17:58 justin_smith: paulswilliamsesq: ahh, in that example seq forces empty inputs to be treated as false

17:59 arrdem: technomancy: you say that...

17:59 paulswilliamsesq: justin_smith: yes, nil punning?

17:59 justin_smith: paulswilliamsesq: it turns empty things into nils which are false

17:59 arrdem: technomancy: really what I mean is extending http://github.com/arrdem/toothpick

17:59 technomancy: not a full port of some runtime

18:00 paulswilliamsesq: justin_smith: yep, which I believed was idiomatic?

18:00 justin_smith: ,(if "" true false) ; paulswilliamsesq

18:00 clojurebot: true

18:00 justin_smith: ,(if (seq "") true false) ; paulswilliamsesq

18:00 clojurebot: false

18:00 justin_smith: yes, it is

18:01 ,(if (lazy-seq) true false) ; more apropos

18:01 clojurebot: true

18:02 paulswilliamsesq: justin_smith: given ids-to-process is lazy, do I need to 'doall'?

18:02 justin_smith: not at all

18:02 paulswilliamsesq: justin_smith: don't like the idea of that, just struggling to understand why I can't iterate over the lazy seq

18:03 justin_smith: ,(if (seq (range)) true false)

18:03 clojurebot: true

18:03 justin_smith: wait, why can't you?

18:03 and why would you want to doall?

18:03 paulswilliamsesq: the pasted code blows up with a ...IllegalArgumentException Don't know how to create ISeq

18:04 justin_smith: then ids-to-process is not a lazyseq

18:04 it is some other kind of thing

18:05 something that cannot be made a seq, it should be saying "Don't know how to create ISeq from..." and that will tell you the type coming in

18:05 ,(seq 0)

18:05 clojurebot: #<ExceptionInfo clojure.lang.ExceptionInfo: Don't know how to create ISeq from: java.lang.Long {:instance 0}>

18:05 paulswilliamsesq: justin_smith: the full code listing is https://www.refheap.com/62994

18:06 justin_smith: paulswilliamsesq: activity-ids is not a lazy seq

18:06 paulswilliamsesq: justin_smith: as you can see, ids-to-process comes from activity-ids a function which when seperately returns a LazySeq

18:06 justin_smith: it is a functino which if called would return one

18:06 so you need to call it

18:06 paulswilliamsesq: justin_smith: ridetothesun2014-strava-facade.ws=> (type (activity-ids))

18:06 clojure.lang.LazySeq

18:07 justin_smith: right

18:07 but then you use it in strava-metrics

18:07 edbond: how to make lein repl use clojure 1.6?

18:07 justin_smith: in strava-metrics you provide activity-ids as the first default arg if unprovided

18:07 it's not a lazy seq, it's a function that returns one, thus your error

18:08 change line 33 to (strava-metrics (activity-ids)

18:08 paulswilliamsesq: justin_smith: oh yeah, think I'm following that.. I just changed it and it's taking a while... hopefuly going to work - thank you :-)

18:17 technomancy: edbond: outside a project `lein repl` uses the version of clojure that ships with leiningen

18:17 (inside a project it's too dark to see)

18:18 amalloy: *groan*

18:18 technomancy: admit it, you loled

18:19 hyPiRion: And then you got eaten by a grue :(

18:19 arrdem: grues: 2, hackers: 0

18:20 zspencer: sounds like a gruesome fate

18:25 paulswilliamsesq: justin_smith: cheers - that worked a treat.

18:31 michaniskin1: hahaha, blowing on the 5.25" floppy

18:31 classic

18:31 arrdem: so sad that I didn't manage to see front at sxsw this year :c

18:32 michaniskin1: 5.25" floppy: it likes to be clean

18:34 technomancy: are those two Lisas in the background?

18:39 arrdem: maybe, I have no idea what all front got his hands on for that

18:39 I wouldn't be too surprised given the character of his fanbase :P

19:11 brehaut: hi joshnz

19:16 joshnz: howdy brehaut

19:16 brehaut: hows saturday?

19:16 joshnz: dunno, just waking up :)

19:17 brehaut: hah nice :)

19:18 joshnz: Otherwise need to clean up the grounds from that cyclone last week. Hundreds of cabbage tree leaves everywhere. Then I'll probably play some more of The Swapper. Quite an interesting game I started last night.

19:18 brehaut: i have not heard of this game

19:19 joshnz: Neither. I got it as part of one of the recent Humblebundle deals. Essentially a puzzle game at heart.

19:19 brehaut: oh huh

19:19 how recent is this bundle?

19:20 joshnz: I think it was in the last 'original' one. Bundle 11 perhaps? They've had android and book bundles since then.

19:21 yup, it was 11. What does Saturday bring for you?

19:22 brehaut: hmm is this the same bundle as has fez?

19:22 bbiab; lunch

19:23 joshnz: it did have fez yes. Giana sisters, guacamelee and dust, along with others. Lunch for me too.

19:24 perplexa: hmpf

19:25 i want fez so badly ;x

19:26 brehaut: fez is available for all three major computer platforms? (although the linux version might be tricky?)

19:26 seangrove: bbloom: Not sure if you've noticed yet, but the browser's layout system is completely bonkers

19:26 technomancy: brehaut: the linux compatibility consists of "here's a branch of the engine on github that's supposed to work, good luck"

19:27 bbloom: seangrove: haha, no, never noticed. i love CSS and believe it is THE WAY GOD INTENDED APPLICATIONS TO BE BUILT

19:27 brehaut: technomancy: pants

19:27 technomancy: wait pants is bad?

19:27 brehaut: yes

19:27 * technomancy updates his log book of commonwealth idioms

19:29 hiredman: ye old compendium of idioms from common wealth nations

19:30 seangrove: Nattering on like a registered nonce

19:30 brehaut: hiredman: olde

19:31 hiredman: þou art correct

19:32 divyy: perplexa: fez is really nice. One of the best games in recent times i'd say

19:32 Although I've only tried it on windows

19:34 brehaut: logic programming: you get to see all your errors at once

20:46 arohner: in lein, what is the default dir for :resources?

20:47 and more generally, is there a way to find the default, w/o reading source?

20:51 hiredman: arohner: the sample project.clj is the best place to look for stuff

20:51 arohner: hiredman: AFAICT, that doesn't tell you what the default value is though

20:51 clojurebot: Ik begrijp

20:51 hiredman: Oh, huh

20:52 arohner: the default is resources

20:52 arohner: thanks

20:54 technomancy: `lein pprint` will show you the values

20:55 arohner: technomancy: cool!

20:55 technomancy: (it's a plugin, not built in)

20:56 arohner: yeah, found it

20:57 another stupid resources question. Is there a way to get a resource before you've built a jar?

20:57 hrm, nvm, that's working now

20:57 amalloy: arohner: anything on the classpath is available as a resource

21:00 arohner: I'm confused then, what's the point of the resources directory? is that to guarantee that dir ends up in the jar?

21:05 amalloy: yes

21:06 it also lets you put things onto your classpath which otherwise wouldn't be, eg an html/ top-level dir

21:07 (or, indeed, resources/, which is only there because it's lein's default)

21:07 arohner: aha

21:07 thanks

22:03 seangrove: bbloom: Should borders be considered styling or layout? They certainly affect layout in the browser, so I'm leaning towards that right now

22:04 bbloom: seangrove: layout, but layout needs to (eventually) be controllable from styling

22:05 seangrove: interestingly... a border can be a ... component!

22:05 seangrove: bbloom: How so? Seems like they're orthogonal?

22:05 Hrm, checking it now

22:05 bbloom: seangrove: they are orthogonal, except when they aren't

22:05 * seangrove mutters about how many windows controls pages he's read through in the past few weeks

22:06 bbloom: haha sorry

22:06 this is probably a better thing to read: http://msdn.microsoft.com/en-us/library/ms751709(v=vs.110).aspx

22:06 there are several example images that help there

22:07 i'll bb in a bit

22:07 seangrove: The point about borders being components in their own right makes sense though. I've been enjoying teasing out components (like dragging, resizing, etc.)

22:09 m00nlight: Hi all, in the let bindings how can I force it to evaluate the LazySeq ? I use (let [a (doall exp)]), but it seems that a is still a LazySeq

22:12 seangrove: bbloom: Just to help me wrap my head around all of this, the second link is suggestions a very different layout system (alignment, padding, margin) compared to the auto-layout/constrain system in osx/ios (leading space, size, trailing space re: siblings or parent)

22:18 arrdem: m00nlight: doall is the tool of choice and you are using it...

22:19 m00nlight: arrdem: Yes, I use do all, but in the body I print the type of the binding, it is still clojure.lang.LazySeq

22:24 amalloy: forcing it doesn't change its type

22:24 seangrove: Surprising how many things from the game world seem relevant in the browser when trying to get layout right. Thinking about having to translating local<->world space for elements and sub-elements

22:45 xeqi: cemerick: do you know if the tab completion for cljs-repls is working for latest cider/austin?

22:45 cemerick: xeqi: works for me, at least for the rev of cider I'm using?

22:45 xeqi: hurray!, I haven't updated in a bit

22:46 will do so then

22:49 cemerick: xeqi: well, keep in mind, I got on head to produce a patch some months ago, and haven't moved

22:50 ironically, a tool luddite to the end, per usual

22:50 xeqi: yet you maintain so many of the pieces

22:53 bbloom: seangrove: coordinate systems aren't unique to games by any means ;-)

22:54 seangrove: so the padding/margin/alignment stuff can work with either a content negotiation or constraints based model equally fine

22:54 ddellacosta: seangrove: https://github.com/sgrove/om-draggable it's like you know what I need and you are making it for me

22:55 bbloom: seangrove: 1) padding is a derived concept, it's simply margin on an extra wrapper

22:55 seangrove: 2) margin and alignment are applied within a "layout slot"

22:56 seangrove: so even if you use constraints, you don't need to render things exactly where the constraints tell you, you can simply use that as the coordinate system for a subcomponent

22:57 seangrove: the idea of margin is that it simply contracts the coordinate space on all 4 sides and the idea of alignment is what to do if some sub component is smaller than the slot it has been allotted

22:58 wpf offers left/right/center/stretch and top/center/bottom/stretch, with horz/vert=stretch/stretch being the default

23:00 there's probably a more general way to think about it than an enum though: probably a pair of scalars where like left to right is 0 to 1 or -1 to 1, and then some scalar where like 0 is expected size and 1.0 == stretch

23:00 seangrove: does that make sense?

23:09 akhudek: Regarding this: https://www.refheap.com/63120

23:10 is this because the 300 positions is considered too small for fold to use multiple threads?

23:12 bbloom: (doc clojure.core.reducers/fold)

23:12 clojurebot: I don't understand.

23:12 bbloom: (require 'clojure.core.reducers)

23:12 (doc clojure.core.reducers/fold)

23:12 clojurebot: Cool story bro.

23:12 bbloom: ,(require 'clojure.core.reducers)

23:12 clojurebot: #<FileNotFoundException java.io.FileNotFoundException: Could not locate clojure/core/reducers__init.class or clojure/core/reducers.clj on classpath: >

23:12 seangrove: bbloom: Juuuuust barely

23:12 bbloom: (doc clojure.core.reducers/fold)

23:12 clojurebot: excusez-moi

23:12 bbloom: ,(doc clojure.core.reducers/fold)

23:12 clojurebot: Gabh mo leithscéal?

23:12 akhudek: haha, yes, I just went and checked

23:12 bbloom: akhudek: blah, screw clojurebot, but yeah default is 5122

23:12 512*

23:12 you can override

23:13 akhudek: yep, found it :-)

23:13 seangrove: ddellacosta: Let me know if it works for you, it's been pretty nice here. There's still more work to be done on it though

23:13 bbloom: seangrove: what needs clarification?

23:14 ddellacosta: seangrove: definitely. I was going to just wrap google closure's drag and drop but now I'm going to try this. Good thing I took care of other stuff first...

23:15 seangrove: and yeah, I may be able to help with shoring it up as need be

23:16 seangrove: bbloom: Trying to visualize contracting spaces, which I think I just about got, but the scalar stuff doesn't quite make sense. Is expected size the intrinsic size?

23:17 ddellacosta: I changed the free-drag locally to be constrained inside of its parent element already, haven't generalized it yet though

23:18 bbloom: seangrove: so again, in the "content negotation" model, the idea is that components ask for space, potentially infinite in either or both direction. then the parent grants space and the component makes due with what it was given

23:18 seangrove: the space given to the component is the "layout slot"

23:18 it's a rect

23:19 so let's say you need 50px width, but you're given 100px for whatever reason

23:19 where do you render?

23:19 do you render the left 50px? the right 50px? 25px in? or do you stretch your content to 100px wide and offer extra space to your children?

23:20 that's what alignment is about

23:20 vimuser2: mmm is there no built in function to append a vector and return a vector?

23:20 seangrove: ,(conj [123] 456)

23:20 clojurebot: [123 456]

23:21 vimuser2: ah, i meant something like concat

23:21 seangrove: ,(apply conj [123] [456])

23:21 clojurebot: [123 456]

23:21 vimuser2: ...

23:21 oh apply, yeah

23:21 amalloy: into

23:22 metellus: ,(into [123] 456)

23:22 clojurebot: #<ExceptionInfo clojure.lang.ExceptionInfo: Don't know how to create ISeq from: java.lang.Long {:instance 456}>

23:22 seangrove: bbloom: I think that's probably good for today, I'm not going to be able to absorb much more about all of that. Going to work on some simpler stuff for now

23:22 bbloom: Thanks for your patience and explanation, as always

23:22 ddellacosta: ,(into [123] [456])

23:23 clojurebot: [123 456]

23:23 vimuser2: meh perfect, thanks into is exactly what i want

23:23 *yeah, perfect

23:23 clojurebot: Gabh mo leithscéal?

23:23 vimuser2: thanks for the help =)

23:27 o, interesting,

23:27 .(into nil [1])

23:27 ,(into nil [1])

23:27 clojurebot: (1)

23:30 vimuser2: i could do something like (into (or var []) [1 2 3]) , just interesting it returns a list, or mabey it's a lazy seq

23:31 ,(type (into nil [1]))

23:31 clojurebot: clojure.lang.PersistentList

23:58 chare: ok suppose I want to make a news aggregator website with clojure, first off how do you get a list of the news sites?

23:59 michaniskin: m00nlight_: (let [a (into [] exp)] …)

23:59 m00nlight_: or reduce over it

23:59 things like that

Logging service provided by n01se.net