Fork me on GitHub
#admin-announcements
<
2015-08-28
>
nblumoe11:08:07

@danielcompton @akiva @seancorfield yep, same experience here. also they were super pushy in making me write that book. since then I am highly skeptical about them. also they asked me to write about a topic which was already covered by one of their books....

hans11:08:46

I sent back the last two packt books i bought and will never buy one again. They are just crappy publishers.

ska12:08:12

I reviewed one of the early packt clojure books and the process was such a catastrophe that I turned it down and refused to have my name somewhere on it. (This is not a criticism of the author)

slotkenov12:08:24

Someone done a codility test once? Unfortunately Clojure is not an option. But there is a request for it on which can be voted (https://codility.com/programmers/)!

ecelis15:08:13

Good morning

piyushmandovra16:08:29

guys can you suggest api testing libs for clojure web api testing, i am using pedestal with friend as web framework and suggestion for unit-testing and datomic query testing

seancorfield17:08:05

We just use clj-http for testing an HTTP API — and write a little DSL for commands around the API — and clj-webdriver for testing at a UI level.

jakemcc17:08:22

@piyushmandovra: I’ve used peridot and ring-mock in the past (though, those applications were not using pedestal)

piyushmandovra17:08:16

@jakemcc yup i was looking for ring mock but not able to figure out how to use them with pedestal app, help me if you understand

piyushmandovra17:08:18

@seancorfield can you elaborate more about dsl commands and your clj-http testing architecture?

seancorfield17:08:41

Not sure what more you’re looking for? We call clj-https get / post functions with the API URLs and test we get back what we expect. The DSL is written in terms of actions within our application to call API endpoints as appropriate.

piyushmandovra17:08:13

@seanomlor: thanks. ya got it, mainly i was asking about DSL commands.

meow20:08:24

Funny, I was just doing a Google search on "clojure lookahead" and what should pop up but the Packt book on Google Books: https://books.google.com/books?id=dQtnCgAAQBAJ&amp;printsec=frontcover

meow20:08:46

There is enough of the book available there to get a feel for the contents.

meow20:08:07

Can't say that I'm impressed. The formatting of the code is practically unreadable.

meow20:08:27

@akiva: ^ What I've seen of the book on Google books isn't that good. Don't think I'd be happy if I spent $$ for it.

akiva20:08:59

Yeah, this isn’t inspiring confidence.

meow20:08:44

I need to change that description since the ergo library works with both Clojure and ClojureScript.

meow20:08:58

Okay, they're not too much fun now, but I had to lay the foundation. They will be fun when I'm done with them. simple_smile

akiva20:08:55

Hah! Bookmarked.

meow20:08:51

I'm not super happy with how I'm handling the need to do a "look ahead" when processing a collection.

meow20:08:20

I feel like its taken me even further away from being able to really leverage transducers.

akiva20:08:45

I’m going to have to read up on L-Systems. Honestly never heard of them until today.

meow20:08:25

I can explain it in 30 seconds because it is so easy to do them in a nice functional language like clojure.

akiva20:08:47

That’d probably be more interesting than reading the Wikipedia article.

meow20:08:08

The basic idea is that you have a rewriting system that takes an initial collection of values (or just one value), like [:A], you process each "letter" or item in the collection, using it to look up a value in some rules (a map) and if there is a match you substitute the new value for the old, or retain the original if there is no match.

meow20:08:38

Then you repeat that recursively. And your collection grows like crazy:

(count (nth foo-modules 11))
=> 354293
(count (nth foo-modules 12))
=> 1062881

akiva20:08:12

Interesting. See, this is a whole new geography of interesting stuff to explore for me.

meow20:08:57

an L-System is a specific rewriting system that flattens out the collection each time through, and it does all of its replacements at once (well, in sequence).

meow20:08:30

it is used to mimic the growth/branching of plants, or to produce fractals

akiva20:08:48

Yeah, I’m looking at the examples on Wikipedia (the page is surprisingly good) and comparing it to what you’re typing.

meow20:08:58

You can pretty much write a simple one in one line of clojure code.

meow20:08:21

Now, to make it more powerful you want to do parametric substitutions where some parameters go along for the ride. So I allow the "letters" to be vectors where the first item is expected to be a keyword and the rest can be whatever, but a map works well.

meow20:08:01

I have an example that keeps track of the age of each "command/item/letter" in the "module/word"

meow20:08:22

They make a big deal about deterministic vs. stochastic but I just allow the rules to be functions and if it is a function I call it. So the function can do anything, predictable or unpredictable.

meow20:08:00

And if it wants to be context sensitive I have support for that as well by passing the current, previous, and next command to the rule function.

meow20:08:19

So the sky is the limit.

meow20:08:05

The result is a way to easily generate a ton of data that has fractal/simulation-like characteristics.

akiva20:08:44

That’s really flexible, yeah.

meow20:08:17

Now, what do you do with that data? You feed it to consuming functions that turn it into sequences of commands to drive things like turtle graphics or overtone music or laser cutters or whatever.

meow20:08:32

I'm working on a non-cartesian graphics system next, which will have a simplified abstraction traditionally known as a turtle from LOGO.

meow20:08:57

But the key is keeping everything decomplected.

akiva20:08:45

One of the first things I thought about when I saw the Koch curve was LOGO.

meow20:08:47

I'm hoping that simulations will never be the same... simple_smile

meow20:08:38

I think I'm gaining an understanding of why LOGO failed and how to do it right in Clojure/Script.

meow20:08:21

Well, failed to gain significant traction and failed by putting a ceiling on what could be done with the language.

akiva20:08:00

I never imagined LOGO being anything more than a niche language anyway.

meow20:08:06

And what they got right with turtle graphics, but failed to capitalize on (and nobody seems to have noticed).

meow21:08:21

So imagine the appeal of turtle graphics brought to a language like clj combined with powerful libraries for doing things like L-Systems in all its variations.

meow21:08:46

Developed with tools like Figwheel and Devcards...

meow21:08:54

And React and Om.

akiva21:08:01

Sounds very, very interesting.

meow21:08:02

I'm having a blast.

akiva21:08:51

Certainly sounds like it!

akiva21:08:03

And it’s good-looking code, too.

meow21:08:09

I'm picky so I'm still not happy with it but I am really happy that I've been able to keep it to less than 50 lines of code, more or less.

meow21:08:37

And before I added support for context-sensitive processing it was even smaller and simpler.