Re: Comments on first function

2013-11-18 Thread Leonardo Borges
Hi, Good inital effort. Only a couple of things to comment on: - You're not closing the stream after you're done with it This is a very common bug and for that reason clojure provides a macro - with-open - that takes care of closing the resource for you. - As you're using a string as the accumu

Re: Releasing Caribou today: Open Source Clojure Web Ecosystem

2013-11-18 Thread David Simmons
Hi Ryan If I create a model "Customer" - will Caribou create a specific table Customer. I ask because using H2 Console I can't find any of the tables I'd have expected to find having created my model. (This may be user error as I'm not used to using H2). cheers Dave -- -- You received thi

Re: Releasing Caribou today: Open Source Clojure Web Ecosystem

2013-11-18 Thread Ryan Spangler
Mark, Yes, you can do nested loops. Say you have a structure like this: {:title "Hello" :slides [{:caption "World" :images [{:path "/img/world.png"} {:path "/img/space.png"}]} {:caption "Jupiter" :images [{:path "/img/callisto.png"}

Re: Releasing Caribou today: Open Source Clojure Web Ecosystem

2013-11-18 Thread Ryan Spangler
David, Yes, if you created a Customer model there will be a "customer" table inside the h2 db (lowercase). Can you create customer instances? If so it is all working as it should, and you might just be missing the tables somewhere. On Mon, Nov 18, 2013 at 12:04 AM, David Simmons wrote: > Hi R

Re: Releasing Caribou today: Open Source Clojure Web Ecosystem

2013-11-18 Thread Mark Engelberg
The docs say something about being ready by default to deploy to Heroku. But the default H2 database won't work on Heroku, will it? I was under the impression that on Heroku, you can't use a database that just saves to the local filesystem, but need to "provision" a postgresql database. Is that c

Re: Releasing Caribou today: Open Source Clojure Web Ecosystem

2013-11-18 Thread David Simmons
Hi Ryan I'm probably doing something daft but I'm using H2 Console and connecting to taiga_development.h2.db (user: sa). running select * from wibble (the name of my model) returns "table wibble not found". I can create instances of wibble via the Admin UI. Like I've said I'm pretty sure this

instaparse questions

2013-11-18 Thread eliassonaand
Hi, I'm trying to use instaparse to differentiate between identifiers and keywords. The following code is from the tutorial. (def unambiguous-tokenizer (insta/parser "sentence = token ( token)* = keyword | !keyword identifier whitespace = #'\\s+' identifier = #'[a-zA-Z

Re: Reactive Programming in Clojure

2013-11-18 Thread Sam Ritchie
Nice! Here are my Scala assignments, if you want to follow along: https://github.com/sritchie/rx-scala-class Doing the second one tomorrow. Marco Manzi wrote: Hi all, I'm a young clojure developer. I work as Java developer, but I've falled in love with this fantastic language and I would like

Re: Reactive Programming in Clojure

2013-11-18 Thread Alexandru Nedelcu
Hi Sam, You are not supposed to publish your solutions to the Reactive Programming Coursera course. It says so in the honour code you agreed to when you joined the class. I would advise you to take that code off GitHub, as I distinctly remember the staff complaining and warning people about po

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Kris Jenkins
Hi Gary, Yeah, you're not the only one to say it, and I think you're all right. Thanks for the link to sql-phrasebook. I'm going to take it to the hammock and consider v0.3.0. :-) Cheers, Kris On Friday, 15 November 2013 23:55:46 UTC, Gary Johnson wrote: > > Hi Kris, > > I really like your a

Re: instaparse questions

2013-11-18 Thread Mark Engelberg
Simplest way is to make the keywords regular expressions that look for a "word boundary" after the keyword: (def unambiguous-tokenizer-improved (insta/parser "sentence = token ( token)* = keyword | !keyword identifier whitespace = #'\\s+' identifier = #'[a-zA-Z]+' keywor

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Kris Jenkins
On Monday, 18 November 2013 03:21:12 UTC, Jeremy Heiler wrote: > > On Mon, Nov 11, 2013 at 6:10 AM, Kris Jenkins > > > wrote: > >> https://github.com/krisajenkins/yesql >> >> Yesql is a simple library for blending SQL & Clojure together, cleanly. >> Here's how it works

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Josh Kamau
Can i put more than one sql statement in a file? Josh On Mon, Nov 18, 2013 at 2:01 PM, Kris Jenkins wrote: > > > On Monday, 18 November 2013 03:21:12 UTC, Jeremy Heiler wrote: > >> On Mon, Nov 11, 2013 at 6:10 AM, Kris Jenkins wrote: >> >>> https://github.com/krisajenkins/yesql >>> >>> Yesql is

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Kris Jenkins
Not yet. That's in the works for the next version. :-) On Monday, 18 November 2013 11:02:07 UTC, Josh Kamau wrote: > > Can i put more than one sql statement in a file? > > Josh > > > On Mon, Nov 18, 2013 at 2:01 PM, Kris Jenkins > > > wrote: > >> >> >> On Monday, 18 November 2013 03:21:12 UTC,

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Ray Miller
Hi Gary et al, On 15 November 2013 23:55, Gary Johnson wrote: > I really like your approach, but I've also been feeling the burn a bit > with having to store each SQL query in its own file (especially since my > data exploration frequently leaves me cataloging hundreds of them). Take a > look at

Re: Using xlisp assoc-lists in clojure

2013-11-18 Thread Justin Smith
Typically in clojure we use hash-maps (represented literally as {}) where other lisps would use an alist. Regarding reading assoc list literals, I wouldn't be surprised if someone had written this function already, but I doubt it is in the core language. I also don't think it would be hard to i

Re: Releasing Caribou today: Open Source Clojure Web Ecosystem

2013-11-18 Thread Justin Smith
Check out resources/config/*.clj. production.clj includes a postgres config that you can customize (I notice now that we should include an example mysql config in there too actually). Once you have a config set up and pointing to an empty db in the appropriate environment, you can use the "lein

Re: Releasing Caribou today: Open Source Clojure Web Ecosystem

2013-11-18 Thread Justin Smith
We only include the h2 db to lower friction for creating a project and trying it out - I have never used h2 in an actual production app. On Monday, November 18, 2013 5:23:16 AM UTC-8, Justin Smith wrote: > > Check out resources/config/*.clj. production.clj includes a postgres > config that you c

instaparse: composing smaller rules into a bigger one

2013-11-18 Thread Jim - FooBar();
Hi all, I'm having a small problem composing smaller matches in instaparse. Here is what I'm trying...just observe the bold bits: (def parsePK (insta/parser "S = TOKEN (SPACE TOKEN PUNCT?)* END TOKEN = (NUM | DRUG | PK | DRUGPK | MECH | SIGN | EFF | ENCLOSED) / WORD = #'\\w+' |

Re: Releasing Caribou today: Open Source Clojure Web Ecosystem

2013-11-18 Thread David Simmons
Hi Ryan please ignore my previous email - it was definitely a user error - looking at the wrong database (doh!). Look forward to getting to grips with the framework over the next few days. cheers Dave -- -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: instaparse: composing smaller rules into a bigger one

2013-11-18 Thread gianluca torta
I am not familiar with instaparse, but the parser may be reasoning as follows: - "Exposure" matches a "PK" TOKEN that is preferred over "WORD" TOKEN, so it is parsed as "PK" TOKEN - "to" matches a "WORD" TOKEN that is not preferred, but there's no other choice, so it is parsed as a "WORD" TOKEN

Re: Releasing Caribou today: Open Source Clojure Web Ecosystem

2013-11-18 Thread Oskar Boethius Lissheim
Seriously impressive stuff. Great to have two super interesting takes on clojure web frameworks (pedestal and now caribou). -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that po

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Jeremy Heiler
On Mon, Nov 18, 2013 at 6:01 AM, Kris Jenkins wrote: > On Monday, 18 November 2013 03:21:12 UTC, Jeremy Heiler wrote: > >> Very cool. Do you have any thoughts on a caching strategy? >> > > Yes, for the next version. At the moment it's only changing when the > defquery is re-eval'd. That's right fo

Re: Using xlisp assoc-lists in clojure

2013-11-18 Thread Tassilo Horn
Justin Smith writes: Hi Justin & Hans-Peter, > Typically in clojure we use hash-maps (represented literally as {}) > where other lisps would use an alist. One difference between alists and maps is that in alists a "key" can occur multiple times, and then the first entry with that key shadows al

Re: Do web apps need Clojure?

2013-11-18 Thread Marcus Blankenship
Brian, I certainly will. I’ll type up something later this week as we progress. The current pain point is Korma, and generally learning clojure. On Nov 16, 2013, at 10:25 AM, Brian Craft wrote: > Marcus -- I hope you will post updates to the list with your experiences. It > would be very

Take the FLOSS 2013 Survey

2013-11-18 Thread Tom Marble
All: If you participate in Open Source please take the survey to make sure YOU are represented. In particular the 2002 survey numbers show very low participation of women in Open Source. Has that changed? http://floss2013.libresoft.es/index.en.html Please forward! --Tom -- -- You received

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Gary Johnson
Hi Ray, Although the sql-phrasebook does capture much of the same philosophy behind Yesql (and has the excellent feature that we can store multiple SQL queries in the same file), its syntax is somewhat more unpleasant to my eyes than Yesql's macro api. yesql - (defquery user

Creating a CMS with Clojure(Script)

2013-11-18 Thread Eduardo Lávaque
With the announcement of Caribou I realized that it is possible to do CMSs in Clojure, so I thought I would give it a try even if it's just as an exercise. I considered between using a Leiningen template like Caribou and using a .jar file that will detect the files that relate to it and do it's

Re: Do web apps need Clojure?

2013-11-18 Thread Brian Craft
Re: korma, and sql dsls, I've been moving between korma, honeysql, and raw sql, without being satisfied with any of them. Desirable traits of the db layer in my problem domain are 1) eliminating boilerplate (e.g. setting up default keys, and indexes, and performing standard joins across relation

Re: Do web apps need Clojure?

2013-11-18 Thread Marcus Blankenship
Brian, Yeah, and I realize I’m going to take darts for this, but coming from Django’s ORM / Rails ActiveRecord makes Korma and these other tools feel like stone-age tools. I’d rather do it all in SQL than fight something to get out of my way, or reveal it’s magic. I know I’m probably not thin

Re: Do web apps need Clojure?

2013-11-18 Thread Marcus Blankenship
Do you have a link to the UncleBob talk, Jarrod? On Nov 16, 2013, at 4:34 PM, Jarrod Swart wrote: > I think the more interesting question is: do web developers need Clojure? If > performance were the sole concern then everyone would still code web apps in > C or assembler. There is great po

Re: [ANN] clojure-sec

2013-11-18 Thread wm . mark . lee
This list seems somewhat inactive, which I find a bit surprising, but I am very interested in one particular aspect of security when I build Clojure apps. Right now my interest is in building REST web services and web applications backed by a relational database with something like Angular or B

2013 State of Clojure & ClojureScript survey results

2013-11-18 Thread Chas Emerick
Results of this year's survey are available here: http://cemerick.com/2013/11/18/results-of-the-2013-state-of-clojure-clojurescript-survey/ Thank you to all that participated! Best, - Chas -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: 2013 State of Clojure & ClojureScript survey results

2013-11-18 Thread kovas boguta
Great job Chas. Some notes on methodology and then some general comments - That the survey was not featured on HN this time without a doubt alone accounts for the slight dip in responses - The 'missing' people are more likely fall into the 'hobbyist' camp, which might explain the increased % of p

ANN: thalia version 0.1.0 -- more detailed doc strings for (a small fraction of) Clojure

2013-11-18 Thread Andy Fingerhut
If you want complete, detailed doc strings for all of Clojure and its libraries, I am sorry to say I do not have that for you. I do have detailed doc strings for a small fraction of the Clojure symbols (20 out of 591), and am planning to write more as I have time. If you want to use them from a R

Re: How could you solve this problem

2013-11-18 Thread Ray Miller
Just for contrast, here's a fairly succinct solution I put together: https://gist.github.com/ray1729/7534528#file-ring_of_primes-clj It uses a basic depth-first search. Ray. -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: Do web apps need Clojure?

2013-11-18 Thread Ryan Spangler
I just ran this in the Caribou repl: (caribou.model/gather :field {:where {:created-at {:<= (java.util.Date.)} :model-id 1}}) And got a bunch of results. No string coercion necessary! (also, dashes not underscores!) We looked at Korma and found it lacking (similar problem as Compojure: mac

Re: Do web apps need Clojure?

2013-11-18 Thread Marcus Blankenship
Ryan, Awesome! We’re playing with Caribou now, and are loving it. At first we thought “Oh, this is going to be like Drupal, with all it’s pseudo-tables and crap. But it’s not, and we’re having fun with it! I’ll try the query engine now. Thanks! On Nov 18, 2013, at 12:31 PM, Ryan Spangler

Re: Question on Sequences

2013-11-18 Thread Alexandru Nedelcu
Thanks Leif, thanks folks, these are good tips. On Mon, Nov 18, 2013 at 4:12 AM, Leif wrote: > > Hi, Alexandru. > > If you just need more performance on vectors only, there are the core > functions mapv, filterv, and subvec (O(1), which can be used to implement > takev and dropv). Also, lookin

Re: 2013 State of Clojure & ClojureScript survey results

2013-11-18 Thread Brian Craft
Wow, this result is shocking to me: In short, Clojure libraries are easy to find, their maintainers are > receptive to feedback and patches, they are technically of high quality, > but they’re not always very well-documented. None of that is surprising or > particularly different from last yea

Re: Do web apps need Clojure?

2013-11-18 Thread Ryan Spangler
Marcus, Good to hear! I am have never used Drupal, what do you mean by pseudo-table? Also, looking into this I think the one caveat to using Caribou for your query engine is that it requires that you have a table for both "model" and "field" that contain the descriptions of the model you are que

Re: Reactive Programming in Clojure

2013-11-18 Thread Marco Manzi
Hi, Txs for support, I haven't readed the forum because I thougth no one was reading it (I didn't receive any email). Actually I have released the first assignment and you can try it in clojure if you like. I'm trying to do the assignment 2 but actually It is full of mutable states... Martin did

Re: [ANN] cljs-start with batteries included

2013-11-18 Thread Mimmo Cosenza
Hi, I just updated the cljs-start lein-template to create a cljs lib with batteries included: - directories layout of a cljs lib project - cljsbuild configurations - clojurescript.test configuration and setup - brepl connection The most significant update regards the substitution of the piggieb

Design question - dependencies and function discovery

2013-11-18 Thread dm3
Hello, Looking for opinions :) I'm currently building an event-driven service which consumes events using handlers. Now, the idea is to define a set of handlers (functions of type Event->Unit) in different parts of the service, which are then invoked when an event comes into the system. The d

Re: Do web apps need Clojure?

2013-11-18 Thread Marcus Blankenship
Ryan, FYI - The date comparison syntax appears to work fine under h2, but throws a exception on PSQL. Here’s my function (defn calendar [request] (controller/render (assoc request :currentdate (java.util.Date.) :videos (model/gather :video {:where {:unlock-date {:<= (java

Re: Do web apps need Clojure?

2013-11-18 Thread Ben Wolfson
try (java.sql.Timestamp (.getDate (java.util.Date.))) On Mon, Nov 18, 2013 at 3:42 PM, Marcus Blankenship wrote: > Ryan, > > FYI - The date comparison syntax appears to work fine under h2, but throws > a exception on PSQL. > > *Here’s my function* > > (defn calendar > [request] > (controller

Re: Using xlisp assoc-lists in clojure

2013-11-18 Thread Cedric Greevey
It would probably be better to convert to/from normal Clojure maps at the edges of the Clojure code. If the input is '((k1 v1) (k2 v2) (k3 v3) (k1 v4)) and we want the earliest occurrence of k1 to "win", then that suggests (into {} (reverse alist)). If the input's flattened that would be (into {} (

Re: Design question - dependencies and function discovery

2013-11-18 Thread John D. Hume
Rather than having hidden mutable state for wiring events to handlers, would it be clearer if the main namespace just passed an :event->[handlers] map to the event processor? If that would create a huge, frequently changing data structure, each namespace with handlers could expose an :event->[hand

Re: instaparse questions

2013-11-18 Thread Mark Engelberg
Also, the version in the tutorial called "preferential-tokenizer" behaves the way you would like. This is actually a really good illustration of the difference between the two approaches of negative lookahead versus ordered choice. The unambiguous-tokenizer, by saying " = keyword | !keyword ident

Re: 2013 State of Clojure & ClojureScript survey results

2013-11-18 Thread kovas boguta
I used to find libraries using github's now-modified-to-the-point-of-uselessness explore feature. Its probably still possible to set up a decent search though. There are a large number of high quality libraries like instaparse, cascalog, storm, overtone, friend, etc. I find it pretty easy to tell

Re: core.logic merge substitutions map?

2013-11-18 Thread Kevin Downey
https://github.com/sonian/Greenmail/blob/master/src/clj/greenmail/db.clj#L98-L126 has an example, using clojure.core.logic/all to make a goal which is a conjunction of the clojure.core.logic/== goals On 11/16/13, 5:04 PM, Mark wrote: > d'oh! Answering my own question: Just compose the unify func

Re: instaparse: composing smaller rules into a bigger one

2013-11-18 Thread Mark Engelberg
Seems like there are (at least) two issues here. 1. You have a preference in mind that is not expressed by the grammar. The parse that was outputted is a valid parse that fits all the rules of the grammar. If you want the parser to prefer DRUGPK and EFF interpretations over other interpretations

Re: gemacl: Scientific computing application written in Clojure

2013-11-18 Thread Jose M. Perez Sanchez
Hi Andy, cej38, kovas: Thanks for the replies. I plan to release the whole code soon (waiting for institutional authorization). I do use lazyness both within the move function to select the allowed random displacements and when iterating the move function to generate the trajectory. Lazy struc

Generating functions from data

2013-11-18 Thread Jeremy Heiler
I am interested in what you think about generating functions at compile time (with a macro) from data. The specific use case I am thinking about pertains to libraries for large web services with a lot of endpoints. A cost-benefit analysis could probably be done for what size is appropriate, but let

Re: [ANN] clojure-sec

2013-11-18 Thread ronen
First note that Im not a security expert so take my advice with a grain of salt, There are couple of middlewares that are worth checking out (in addition to friend): * https://github.com/weavejester/ring-anti-forgery * https://github.com/myfreeweb/ring-ratelimit Regarding SQL injection quotin

Re: 2013 State of Clojure & ClojureScript survey results

2013-11-18 Thread Jeremy Heiler
On Mon, Nov 18, 2013 at 4:01 PM, Brian Craft wrote: > Also, I find it difficult to find libraries. When I do find libraries > they're often deprecated, or moribund. What's the easy way to find clojure > libraries? > There's http://www.clojure-toolbox.com, but your mileage may vary. Viewing the

Re: [Job spam] Write Clojure in your pajamas, for decent money in a pleasant company, remote pairing all the time

2013-11-18 Thread Tony Tam
Hi, I'm always curious about remarks like this: A link to your Github profile counts for much more than a stellar resume. > Doesn't have to be in Clojure. > If I sent you a like to a github profile that looked like yours ( https://github.com/alexeyv?tab=repositories), would I ever get an answer

Re: Do web apps need Clojure?

2013-11-18 Thread Jarrod Swart
The talk is linked in my initial post, and again here: http://skillsmatter.com/podcast/agile-testing/bobs-last-language its very interesting! On Monday, November 18, 2013 2:00:06 PM UTC-5, Marcus Blankenship wrote: > > Do you have a link to the UncleBob talk, Jarrod? > > > On Nov 16, 2013, at 4:

Re: Do web apps need Clojure?

2013-11-18 Thread Marcus Blankenship
Thanks! On Nov 18, 2013, at 6:03 PM, Jarrod Swart wrote: > The talk is linked in my initial post, and again here: > http://skillsmatter.com/podcast/agile-testing/bobs-last-language its very > interesting! > > On Monday, November 18, 2013 2:00:06 PM UTC-5, Marcus Blankenship wrote: > Do you ha

Re: gemacl: Scientific computing application written in Clojure

2013-11-18 Thread kovas boguta
Hi Jose, I think you should try making the core iteration purely functional, meaning no agents, atoms, or side effecting functions like the random generator. I assume the number of steps you evolve the particle is encoded in step-extract-fn? What you probably want is something like (loop [i 0

Re: Generating functions from data

2013-11-18 Thread Michael-Keith Bernard (SegFaultAX)
Hi Jeremy, There are a number of existing implementations of what you're describing, the most well known of which is the Web Services Description Language (WSDL)commonly used with SOAP . A WSDL f

Re: Generating functions from data

2013-11-18 Thread Jeremy Heiler
On Mon, Nov 18, 2013 at 9:35 PM, Michael-Keith Bernard (SegFaultAX) < mkbernard@gmail.com> wrote: > There are a number of existing implementations of what you're describing, > the most well known of which is the Web Services Description Language > (WSDL) >

Re: Generating functions from data

2013-11-18 Thread Jeremy Heiler
On Mon, Nov 18, 2013 at 7:48 PM, Jeremy Heiler wrote: > I am interested in what you think about generating functions at compile > time (with a macro) from data. The specific use case I am thinking about > pertains to libraries for large web services with a lot of endpoints. A > cost-benefit analys

Re: 2013 State of Clojure & ClojureScript survey results

2013-11-18 Thread Jarrod Swart
I will second http://clojure-toolbox.com and I also recently found: http://www.clojuresphere.com/ On Monday, November 18, 2013 4:01:27 PM UTC-5, Brian Craft wrote: > > Wow, this result is shocking to me: > > In short, Clojure libraries are easy to find, their maintainers are >> receptive to fee

Re: core.logic merge substitutions map?

2013-11-18 Thread Norman Richards
On Mon, Nov 18, 2013 at 6:26 PM, Kevin Downey wrote: > > https://github.com/sonian/Greenmail/blob/master/src/clj/greenmail/db.clj#L98-L126 > has an example, using clojure.core.logic/all to make a goal which is a > conjunction of the clojure.core.logic/== goals Based on my experience writing pld

Re: [Job spam] Write Clojure in your pajamas, for decent money in a pleasant company, remote pairing all the time

2013-11-18 Thread gaz jones
If you're account had a picture like his, YES. On Mon, Nov 18, 2013 at 5:45 PM, Tony Tam wrote: > Hi, > > I'm always curious about remarks like this: > > > A link to your Github profile counts for much more than a stellar resume. >> Doesn't have to be in Clojure. >> > > If I sent you a like to

Re: [Job spam] Write Clojure in your pajamas, for decent money in a pleasant company, remote pairing all the time

2013-11-18 Thread gaz jones
*your :) On Mon, Nov 18, 2013 at 9:46 PM, gaz jones wrote: > If you're account had a picture like his, YES. > > > On Mon, Nov 18, 2013 at 5:45 PM, Tony Tam wrote: > >> Hi, >> >> I'm always curious about remarks like this: >> >> >> A link to your Github profile counts for much more than a stell

Re: Does Pedestal have a future in the long run

2013-11-18 Thread Murtaza Husain
I also personally like pedestal. However couple of reasons are holding me back - 1) An easier integration with UI. All current frameworks such as Angular etc focus on easing the DOM manipulation. You define your model, and then define the relationship of your model with the DOM. The framework