Re: naming your project clojure with lein new clojure gives problems
It used to be that lein new would not allow you to create projects with jure in the name. I guess that restriction has disappeared, which is unfortunate since it would have prevented the problem you ran into... On Thu, Apr 26, 2012 at 10:57 PM, Sean Neilan sneil...@gmail.com wrote: Hello Lisperati, Naming your project clojure is a bad idea because doing seans-macaroni-book:BigNumberNames seanneilan$ lein new clojure Created new project in: /Users/seanneilan/BucketsOfNantucket/BigNumberNames/clojure Look over project.clj and start coding in clojure/core.clj seans-macaroni-book:BigNumberNames seanneilan$ cd clojure will give you problems... seans-macaroni-book:clojure seanneilan$ lein repl Copying 1 file to /Users/seanneilan/BucketsOfNantucket/BigNumberNames/clojure/lib Exception in thread main java.lang.ExceptionInInitializerError at clojure.main.clinit(main.java:20) Caused by: java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.core/refer at clojure.lang.Var$Unbound.throwArity(Var.java:43) at clojure.lang.AFn.invoke(AFn.java:39) at clojure.lang.Var.invoke(Var.java:401) at clojure.lang.RT.doInit(RT.java:447) at clojure.lang.RT.clinit(RT.java:316) ... 1 more -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: lein-cljsbuild on Windows?
On Thu, Apr 26, 2012 at 10:09 PM, Guofeng Zhang guof...@radvision.com wrote: I need to copy or install lein-cljsbuild-0.1.8.jar to LEIN's plugins directory. Then each steps works well. This command should do that for you: lein plugin install lein-cljsbuild 0.1.8 -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ANN clojure.java.jdbc 0.2.0
On Tue, Apr 24, 2012 at 8:30 PM, Michael michael-a...@db.com wrote: Would it be possible to make resultset-seq a dynamic var No, that certainly is not going to happen. Dynamic vars are not the right way to build an API in Clojure. bind in custom result set mapping without having to make two passes through the results? For instance, I would want to map sql date/timestamp to joda DateTime and T/F to true/false directly. I'm not sure what this would look like generically but it sounds like you want to be able to pass a function somewhere to perform a custom transformation of the Java result set? Perhaps if you can re-cast this in terms of the current API, showing where a function could be passed and used, I might be more inclined to consider this... -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ANN clojure.java.jdbc 0.2.0
It looks like there are two issues here... On Tue, Apr 24, 2012 at 8:04 PM, Michael michael-a...@db.com wrote: (defn- oracle-insert-sql [table pk-col-name pk-seq-name ks] (let [cols (apply str (interpose \, (map jdbc/as-identifier ks))) n (count ks) qmarks (apply str (interpose \, (repeat n \?)))] (str insert into (jdbc/as-identifier table) \( (jdbc/as-identifier pk-col-name) \, cols ) values ( (jdbc/as-identifier pk-seq-name) .nextval, qmarks \ You can't use insert-values because you don't want all the ? parameters - you want one of them to be a specific expression (seq.nextval in this case). (defn oracle-insert-record [table pk-col-name pk-seq-name record] (let [sql (oracle-insert-sql table pk-col-name pk-seq-name (keys record))] (with-open [^PreparedStatement pstmt (.prepareStatement (jdbc/connection) sql, (into-array [(jdbc/as-identifier pk-col-name)]))] (set-parameters pstmt (vals record)) (jdbc/transaction (.executeUpdate pstmt) (vec (ijdbc/resultset-seq* (.getGeneratedKeys pstmt))) You need a way to pass that array of column names in (the value-groups already allow for set-parameters as you need them). Am I correct in my analysis of your needs? The latter could be provided as an additional optional named parameter to insert-values. The former I'm not sure of the best approach yet. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure alternatives to Esper
Aphyr looks interesting, hadn't seen it before. Mentioning lamina and reactive extensions reminded me of the clojure asynchronous events page, http://dev.clojure.org/display/design/Asynchronous+Events which I probably should read once more ;) On Mon, Apr 23, 2012 at 6:29 PM, Toby DiPasquale t...@cbcg.net wrote: On Monday, April 23, 2012 9:51:39 AM UTC-4, Rogier wrote: My question is: is there an alternative for this in the clojure ecosystem (since clojure seems like a good fit for this), and if not, what kind of clojure components/libraries would be a good starting point to implement someting similar I know of no complete alternatives, but there are some projects doing similar things for similar reasons. There is one that I saw recently that looks interesting: https://github.com/aphyr/riemann Stream processing for monitoring. Not quite sure why he didn't use ESPer for this, but there it is. There is also Lamina: https://github.com/ztellman/lamina which is more of a concurrency library but you could build a stream processing engine with it pretty simply. -- Toby -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- Rogier Peters rogier@twitter, flickr, delicious -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure-Specific Emacs Environment
Fantastic work Tim. I think this can be a really important part of the future for Clojure hacking with Emacs. Let us know how you get on. Sam -- http://sam.aaron.name On Thursday, 26 April 2012 at 15:27, Tim King wrote: I have been working on a fork of Phil's nrepl.el for the past few nights. So far I have gotten the basic bencode/bdecode transport working and am able to send and receive to an nREPL server. Beyond that, it isn't really in anything close to a usable state yet, but I plan to continue plugging away at it. http://www.github.com/kingtim/nrepl.el Cheers, Tim not an emacs lisp hacker King On Mon, Apr 23, 2012 at 4:08 PM, Phil Hagelberg p...@hagelb.org (mailto:p...@hagelb.org) wrote: On Thu, Mar 29, 2012 at 9:52 AM, Phil Hagelberg p...@hagelb.org (mailto:p...@hagelb.org) wrote: Anyway, I'd be happy if someone went ahead with nrepl.el even so; don't let me discourage you. For what it's worth I sketched out a bare skeleton of what this could look like. Nothing works yet, but if someone were to want to hack on it, this might be a good place to start: https://github.com/technomancy/nrepl.el I don't have plans to finish it myself. -Phil -- 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 (mailto:clojure@googlegroups.com) Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com (mailto:clojure%2bunsubscr...@googlegroups.com) For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 (mailto:clojure@googlegroups.com) Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com (mailto:clojure+unsubscr...@googlegroups.com) For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clauth - OAuth2 provider for Ring
On 27 April 2012 06:43, Shantanu Kumar kumar.shant...@gmail.com wrote: That sounds quite interesting! Do you have a Github URL of the project to share? Looks like here: https://github.com/pelle/clauth Shantanu On Apr 25, 12:29 am, Pelle Braendgaard pel...@gmail.com wrote: This is a simple OAuth 2 provider that is designed to be used as a primary authentication provider for a Clojure Ring app. -- Michael Wood esiot...@gmail.com -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
ClojureScript: can't (:use) protocol in another namespace
Hello, I'm not sure if what I'm doing is supported or whether I'm doing it incorrectly. I have two ClojureScript namespaces: (ns foo) (defprotocol SomeProtocol (some-function [this])) (ns bar (:use [foo :only (SomeProtocol)])) (defrecord SomeRecord SomeProtocol (some-function [_] :quux)) The protocol function is compiled as though SomeProtocol was defined in the bar namespace, e.g.: bar.SomeType.prototype.bar$SomeProtocol$ = true; bar.SomeType.prototype.bar$SomeProtocol$some_function = function(this$) { var this__14211 = this; return\ufdd0'quux }; This causes an error at runtime. Should I be able to do this, or should I stick with (:require foo) and foo/SomeProtocol? Cheers, Stuart -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: a goal succeeding when given another goal succeeds for all elements in a list
Ok, so the function (let's name it for-all) is: (defn for-all A goal that succeeds if all goals succeeds. [goal first-param list] (fresh [head rest] (conso head rest list) (goal first-param head) (for-all goal first-param rest))) it takes 3 parameters. 1. a goal, 2. first parameter to the goal 3. list of parameters which will be applied as a second one to the goal. The 'for-all' goal succeeds when goal 'goal' succeeds for all pairs: first-param a, first-param b, first-param c , where a, b, c, are elements of 'list' list. Conso is a goal which takes 3 parameters. 1. an element, 2. list of elements, 3 list of elements. And succeeds when 3rd list is equal to 2nd list with prepended element ( L = H | R ) In goal 'for-all' conso is used for destructuring a 'list' list and store its head and rest in fresh variables. For such obtained head we try to apply 'goal' goal AND continue recursively in the same fashion with the rest of the list. Kind Regards, Daniel Kwiecinski lambder.com On 26 April 2012 23:57, nchurch nchubr...@gmail.com wrote: For the benefit of bystanders, could anyone explain why and how Daniel's for-all function works? (I've gotten to chapter 4 of TRS.) On Apr 26, 2:04 pm, David Nolen dnolen.li...@gmail.com wrote: core.logic can remember previous results via tabling. As far as n-queens - that's a problem best left for constraint logic programming (CLP). core.logic doesn't have constraint programming facilities yet, but I've mentioned the desire to implement cKanren many times on this list. Haven't really considered how CLP and tabling could be combined in core.logic - but it's been done elsewhere. David On Thu, Apr 26, 2012 at 4:55 PM, Daniel Kwiecinski daniel.kwiecin...@gmail.com wrote: So how would you tackle, lets say n-queen problem on m square board (for realy huge m) knowing that additional small set of chess pieces can be added to the problem (let's say K K N N B) the new pieces attack fraction of the board potentially not taken by any queens so far. Some of prev solutions would be no longer valid of course but for sure adding new pieces will not add new queen placements. It only limits it. Would be it possible to extend Clojure.logic to reuse prev results, or I should forget about it and restart search from scratch? Daniel On Apr 26, 2012 7:55 PM, David Nolen dnolen.li...@gmail.com wrote: On Thu, Apr 26, 2012 at 1:38 PM, Daniel Kwiecinski daniel.kwiecin...@gmail.com wrote: Does it make sense at all to you. Makes sense, but sounds outside the scope of what core.logic currently does. David -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
How to aggregate in clojure.logic ?
Lets say we have child - father and child - mother relationship and derive from it child - parent relationship (via goal) . In clojure logic I can create goals which can answer questions like: children-of, grandchildren-of, all-descendants-of, all-ancestors-of very easily. But how one create goals that let answer questions such as: grandchildren-count-of, length-of-ancestors-line, grandparents-count Kind Regards, Daniel Kwiecinski lambder.com -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Socket Library in Clojure
Hi, I was looking for socket libraries in clojure. The requirement is to connect via telnet to a mainframe based system and run commands on it. Thanks, Murtaza -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Socket Library in Clojure
I was looking for socket libraries in clojure. The requirement is to connect via telnet to a mainframe based system and run commands on it. Can't you use JVM interop directly? There is an example here - http://nakkaya.com/2010/02/10/a-simple-clojure-irc-client/ Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Socket Library in Clojure
Yes go with Java interop...sockets are pretty straight forward. Jim On 27/04/12 11:15, Baishampayan Ghose wrote: I was looking for socket libraries in clojure. The requirement is to connect via telnet to a mainframe based system and run commands on it. Can't you use JVM interop directly? There is an example here - http://nakkaya.com/2010/02/10/a-simple-clojure-irc-client/ Regards, BG -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Socket Library in Clojure
Take a look at aleph: https://github.com/ztellman/aleph Aleph is a high-level library for event-driven network programming. On 04/27/2012 06:12 PM, Murtaza Husain wrote: Hi, I was looking for socket libraries in clojure. The requirement is to connect via telnet to a mainframe based system and run commands on it. Thanks, Murtaza -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- Sun Ning Software developer Nanjing, China (N32°3'42'' E118°46'40'') http://about.me/sunng/bio -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: [ANN] Eastwood - A Clojure lint tool
This is great, and working for me, thanks :) On Thursday, 19 April 2012 14:04:07 UTC+1, Jonas wrote: Eastwood[1] is a Clojure lint tool which uses the analyze[2] library to inspect namespaces and report possible problems. Currently it should work with projects running Clojure 1.3.0 and newer. Currently eastwood warns when it finds - deprecated java instance methods, static fields, static methods and constructors - deprecated clojure vars - unused function arguments - unused private vars - reflection - naked (:use ...) - misplaced docstrings - keyword typos I appreciate bug reports and feature requests and I also hope you find it useful! Jonas [1] https://github.com/jonase/eastwood [2] https://github.com/frenchy64/analyze -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Using dynamic variables in libraries [Re: ANN clojure.java.jdbc 0.2.0]
On Thu, Apr 26, 2012 at 23:35 -0700, Sean Corfield wrote: On Tue, Apr 24, 2012 at 8:30 PM, Michael michael-a...@db.com wrote: Would it be possible to make resultset-seq a dynamic var No, that certainly is not going to happen. Dynamic vars are not the right way to build an API in Clojure. Could you elaborate on that please? I see that dynamic variables are used quite often to give the user the ability to configure/change the behaviour of a library. That approach is often coupled with a macro that changes the bindings of dynamic variables. An example of this can be, for example, found in criterium [0] --- snip --- ;;; Progress reporting (def ^{:dynamic true} *report-progress* nil) (defn #^{:skip-wiki true} progress Conditionally report progress to *out*. [ message] (when *report-progress* (apply println message))) (defmacro with-progress-reporting Macro to enable progress reporting during the benchmark. [expr] `(binding [*report-progress* true] ~expr)) --- snip --- I guess that my confusion stems from your very general statement and my inexperience so I would be happy if you could give more details. I find using a dynamic variable in a library in the way exemplified above to be OK and maybe (??) even idiomatic. It is just hard to get Clojure idioms right if a voice keeps nagging in the back of your head saying Dynamic vars are not ... Thanks! -- Wolodja babi...@gmail.com 4096R/CAF14EFC 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC signature.asc Description: Digital signature
Re: Clauth - OAuth2 provider for Ring
I guess it is https://github.com/pelle/clauth ./vijay On Friday, April 27, 2012 6:43:29 AM UTC+2, Shantanu Kumar wrote: That sounds quite interesting! Do you have a Github URL of the project to share? Shantanu On Apr 25, 12:29 am, Pelle Braendgaard pel...@gmail.com wrote: This is a simple OAuth 2 provider that is designed to be used as a primary authentication provider for a Clojure Ring app. I am a relative Clojure novice, but have am very experienced in OAuth. Please help give feedback on use of idiomatic clojure. It currently handles OAuth2 bearer authentication and interactive authentication. By interactive authentication I mean, it can be used for primary end user authentication by sticking a token in a session. This means that you could eventually provide google/facebook like session overviews and log off remote sessions. The following bearer tokens are implemented: * Authorization headerhttp:// tools.ietf.org/html/draft-ietf-oauth-v2-bearer-08#section-2.1 * Form encoded body parameterhttp:// tools.ietf.org/html/draft-ietf-oauth-v2-bearer-08#section-2.2 * URI query fieldhttp:// tools.ietf.org/html/draft-ietf-oauth-v2-bearer-08#section-2.3 * Non standard http cookie ('access_token') for use in interactive applications * Non standard session ('access_token') for use in interactive applications Authorization response types: * Authorization Code Granthttp:// tools.ietf.org/html/draft-ietf-oauth-v2-25#section-4.1 * Implicit Granthttp:// tools.ietf.org/html/draft-ietf-oauth-v2-25#section-4.2 Currently the following Grant types are supported: * Authorization Code Granthttp:// tools.ietf.org/html/draft-ietf-oauth-v2-25#section-4.1 * Client Credential Granthttp:// tools.ietf.org/html/draft-ietf-oauth-v2-25#section-4.4 * Resource Owner Password Credential Granthttp:// tools.ietf.org/html/draft-ietf-oauth-v2-25#section-4.3 Currently it supports Redis and in memory for tokens, apps and users. There is a very easy protocol to implement to add further stores. I will probably add a separate one for korma and for datomic. These will be released as separate projects. For an interactive demo of it: lein run -m clauth.demo I am working on a demo app that I will deploy on heroku. P --http://agree2.com- Reach Agreement!http://stakeventures.com- My blog about startups and agile banking -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Socket Library in Clojure
On Fri, Apr 27, 2012 at 11:12 AM, Murtaza Husain murtaza.hus...@sevenolives.com wrote: Hi, I was looking for socket libraries in clojure. The requirement is to connect via telnet to a mainframe based system and run commands on it. Thanks, Murtaza Note that there is more to telnet protocol than just a bare socket. Telnet is a protocol, and servers might send various protocol negotiation options etc. You might want to look at Apache Commons.Net, which has a TelnetClient class: http://commons.apache.org/net/api-3.1/org/apache/commons/net/telnet/TelnetClient.html -- Dave -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure-Specific Emacs Environment
Thank you Sam and Phil for the encouragement. And thanks Phil for getting it rolling with the initial version. I'll update the group as soon as I feel I have something ready to test. Cheers, Tim On Fri, Apr 27, 2012 at 12:40 AM, Sam Aaron samaa...@gmail.com wrote: Fantastic work Tim. I think this can be a really important part of the future for Clojure hacking with Emacs. Let us know how you get on. Sam -- http://sam.aaron.name On Thursday, 26 April 2012 at 15:27, Tim King wrote: I have been working on a fork of Phil's nrepl.el for the past few nights. So far I have gotten the basic bencode/bdecode transport working and am able to send and receive to an nREPL server. Beyond that, it isn't really in anything close to a usable state yet, but I plan to continue plugging away at it. http://www.github.com/kingtim/nrepl.el Cheers, Tim not an emacs lisp hacker King On Mon, Apr 23, 2012 at 4:08 PM, Phil Hagelberg p...@hagelb.org(mailto: p...@hagelb.org) wrote: On Thu, Mar 29, 2012 at 9:52 AM, Phil Hagelberg p...@hagelb.org(mailto: p...@hagelb.org) wrote: Anyway, I'd be happy if someone went ahead with nrepl.el even so; don't let me discourage you. For what it's worth I sketched out a bare skeleton of what this could look like. Nothing works yet, but if someone were to want to hack on it, this might be a good place to start: https://github.com/technomancy/nrepl.el I don't have plans to finish it myself. -Phil -- 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 (mailto: clojure@googlegroups.com) Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com (mailto: clojure%2bunsubscr...@googlegroups.com) For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 (mailto: clojure@googlegroups.com) Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com (mailto: clojure+unsubscr...@googlegroups.com) For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Socket Library in Clojure
Depending on what you are trying to do, you will probably also want to have a look at pallet [1], clj-ssh [2], and clojure-control [3]. [1] http://palletops.com/ [2] https://github.com/hugoduncan/clj-ssh [3] https://github.com/killme2008/clojure-control On Fri, Apr 27, 2012 at 6:15 AM, Baishampayan Ghose b.gh...@gmail.com wrote: I was looking for socket libraries in clojure. The requirement is to connect via telnet to a mainframe based system and run commands on it. Can't you use JVM interop directly? There is an example here - http://nakkaya.com/2010/02/10/a-simple-clojure-irc-client/ Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Bug recognizing tail position as default value in maps?
Is suspect this being a bug: When a recursive function call is used as a default value in a map, its tail position is not recognized. The problem can be easily demonstrated using the fixpoint function. The fixpoint function is usually defined as (defn fix [f x] (let [v (f x)] (if (= v x) x (recur f v To avoid the 'if' special form, we can use a map. The compiler rejects compilation and does not recognize (recur f v) to be correctly in tail position. (defn fix2 [f x] (let [v (f x)] ({x x} v (recur f v CompilerException java.lang.UnsupportedOperationException: Can only recur from t ail position, compiling:(NO_SOURCE_PATH:41) Avoiding tail recursion lets fix2 compile but not execute properly: (defn fix2 [f x] (let [v (f x)] ({x x} v (fix2 f v #'user/fix2 (fix identity 1) 1 (fix2 identity 1) StackOverflowError user/fix2 (NO_SOURCE_FILE:44) Strange, isn't it!? Dominikus -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Bug recognizing tail position as default value in maps?
Hi, (defn fix2 [f x] (let [v (f x)] ({x x} v (recur f v recur is not in the tail position. The call to the map is the tail call. So the result is as expected. Kind regards, Meikel -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
New release of Domina (now with reworked eventing)
Some of you may already be aware of of Domina, a jQuery-inspired DOM manipulation library I've been working on. It's been out there for a while, but I just finished up a round of changes that I think bring it to a certain degree of completion for basic use (although there's definitely a lot of cool stuff that still remains to be added). Most notable is a new set of eventing functions; I hope they'll provide an easy-to-use, low-level foundation for building more complex data- and event-driven web applications. Please check it out: https://github.com/levand/domina/ Feedback, pull request, etc. are welcome. Thanks! -Luke -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Bug recognizing tail position as default value in maps?
Sure? The semantics of the default value corresponds to a 'if', doesn't it? From this viewpoint, the default value is in tail position. And why does the non-tailrecursive version not run as expected? Dominikus Am Freitag, 27. April 2012 16:45:44 UTC+2 schrieb Meikel Brandmeyer (kotarak): Hi, (defn fix2 [f x] (let [v (f x)] ({x x} v (recur f v recur is not in the tail position. The call to the map is the tail call. So the result is as expected. Kind regards, Meikel -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Bug recognizing tail position as default value in maps?
Using a map instead of if means that it is evaluated as a function call. Unlike the if form, function calls eval their arguments. So the (recur) form is getting eval'd prior to being passed to the map/function, which isn't a tail position. That's why if is a special form/macro, not a regular function (like maps are). On Friday, April 27, 2012 10:52:10 AM UTC-4, Dominikus wrote: Sure? The semantics of the default value corresponds to a 'if', doesn't it? From this viewpoint, the default value is in tail position. And why does the non-tailrecursive version not run as expected? Dominikus Am Freitag, 27. April 2012 16:45:44 UTC+2 schrieb Meikel Brandmeyer (kotarak): Hi, (defn fix2 [f x] (let [v (f x)] ({x x} v (recur f v recur is not in the tail position. The call to the map is the tail call. So the result is as expected. Kind regards, Meikel -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Help with clojurescript code for google charts
Hi, I am trying to use google charts from clojurescript, however cant get it working. I have included both the js code from google's site and my clojurescript conversion. Any help in figuring out the problem will be appreciated. Thanks, Murtaza JS Code - script type=text/javascript src=https://www.google.com/jsapi;/script script type=text/javascript // Load the Visualization API and the piechart package. google.load('visualization', '1.0', {'packages':['corechart']}); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawChart); // Callback that creates and populates a data table, // instantiates the pie chart, passes in the data and // draws it. function drawChart() { // Create the data table. var data = new google.visualization.DataTable(); data.addColumn('string', 'Topping'); data.addColumn('number', 'Slices'); data.addRows([ ['Mushrooms', 3], ['Onions', 1], ['Olives', 1], ['Zucchini', 1], ['Pepperoni', 2] ]); // Set chart options var options = {'title':'How Much Pizza I Ate Last Night', 'width':400, 'height':300}; // Instantiate and draw our chart, passing in some options. var chart = new google.visualization.PieChart(document.getElementById('chart_div')); chart.draw(data, options); } /script CLJS code - ;;clj-js and $ are functions from jayq (defn add-rows [] (let [data (js/google.visualization.DataTable.)] (.addColumn data string Topping) (.addColumn data number slices) (.addRows data [[Mushrooms 3] [Onions 1] [Olives 1]]) data)) (defn chart-options [] (clj-js {:title How much Pizza i ate last night :width 400 :height 300})) (defn get-chart [] (js/google.visualization.PieChart. ($ div.container div#content))) (defn draw-chart [] (fn [] (let [data (add-rows) options (chart-options) chart (get-chart)] (.draw chart data options (.load js/google visualization 1.0 {packages [corechart]}) (.setOnLoadCallback js/google draw-chart) -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: How to aggregate in clojure.logic ?
Might I suggest a good book on Prolog? http://www.amazon.com/Prolog-Programming-Artificial-Intelligence-Bratko/dp/0201403757 http://www.amazon.com/The-Art-Prolog-Second-Edition/dp/0262193388 I also recommend close readings of The Reasoned Schemer and Byrd's dissertation - both are linked to in core.logic README. David On Friday, April 27, 2012, Daniel Kwiecinski wrote: Lets say we have child - father and child - mother relationship and derive from it child - parent relationship (via goal) . In clojure logic I can create goals which can answer questions like: children-of, grandchildren-of, all-descendants-of, all-ancestors-of very easily. But how one create goals that let answer questions such as: grandchildren-count-of, length-of-ancestors-line, grandparents-count Kind Regards, Daniel Kwiecinski lambder.com -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ClojureScript: can't (:use) protocol in another namespace
Does this work in Clojure? If so file a ticket in JIRA. David On Fri, Apr 27, 2012 at 5:09 AM, Stuart Campbell stu...@harto.org wrote: Hello, I'm not sure if what I'm doing is supported or whether I'm doing it incorrectly. I have two ClojureScript namespaces: (ns foo) (defprotocol SomeProtocol (some-function [this])) (ns bar (:use [foo :only (SomeProtocol)])) (defrecord SomeRecord SomeProtocol (some-function [_] :quux)) The protocol function is compiled as though SomeProtocol was defined in the bar namespace, e.g.: bar.SomeType.prototype.bar$SomeProtocol$ = true; bar.SomeType.prototype.bar$SomeProtocol$some_function = function(this$) { var this__14211 = this; return\ufdd0'quux }; This causes an error at runtime. Should I be able to do this, or should I stick with (:require foo) and foo/SomeProtocol? Cheers, Stuart -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: a goal succeeding when given another goal succeeds for all elements in a list
That makes a lot more sense with the variable names, thanks! I think I hadn't realized until this point that a goal is also a function. Much to learn On Apr 27, 2:53 am, Daniel Kwiecinski daniel.kwiecin...@gmail.com wrote: Ok, so the function (let's name it for-all) is: (defn for-all A goal that succeeds if all goals succeeds. [goal first-param list] (fresh [head rest] (conso head rest list) (goal first-param head) (for-all goal first-param rest))) it takes 3 parameters. 1. a goal, 2. first parameter to the goal 3. list of parameters which will be applied as a second one to the goal. The 'for-all' goal succeeds when goal 'goal' succeeds for all pairs: first-param a, first-param b, first-param c , where a, b, c, are elements of 'list' list. Conso is a goal which takes 3 parameters. 1. an element, 2. list of elements, 3 list of elements. And succeeds when 3rd list is equal to 2nd list with prepended element ( L = H | R ) In goal 'for-all' conso is used for destructuring a 'list' list and store its head and rest in fresh variables. For such obtained head we try to apply 'goal' goal AND continue recursively in the same fashion with the rest of the list. Kind Regards, Daniel Kwiecinski lambder.com On 26 April 2012 23:57, nchurch nchubr...@gmail.com wrote: For the benefit of bystanders, could anyone explain why and how Daniel's for-all function works? (I've gotten to chapter 4 of TRS.) On Apr 26, 2:04 pm, David Nolen dnolen.li...@gmail.com wrote: core.logic can remember previous results via tabling. As far as n-queens - that's a problem best left for constraint logic programming (CLP). core.logic doesn't have constraint programming facilities yet, but I've mentioned the desire to implement cKanren many times on this list. Haven't really considered how CLP and tabling could be combined in core.logic - but it's been done elsewhere. David On Thu, Apr 26, 2012 at 4:55 PM, Daniel Kwiecinski daniel.kwiecin...@gmail.com wrote: So how would you tackle, lets say n-queen problem on m square board (for realy huge m) knowing that additional small set of chess pieces can be added to the problem (let's say K K N N B) the new pieces attack fraction of the board potentially not taken by any queens so far. Some of prev solutions would be no longer valid of course but for sure adding new pieces will not add new queen placements. It only limits it. Would be it possible to extend Clojure.logic to reuse prev results, or I should forget about it and restart search from scratch? Daniel On Apr 26, 2012 7:55 PM, David Nolen dnolen.li...@gmail.com wrote: On Thu, Apr 26, 2012 at 1:38 PM, Daniel Kwiecinski daniel.kwiecin...@gmail.com wrote: Does it make sense at all to you. Makes sense, but sounds outside the scope of what core.logic currently does. David -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: New release of Domina (now with reworked eventing)
Looking forward to trying it out. Has anyone used both Enfocus and Domina? Any comparisons on the usage and features of the two? Also, has anyone put either of these together with JQuery UI code? On Apr 27, 7:47 am, Luke VanderHart luke.vanderh...@gmail.com wrote: Some of you may already be aware of of Domina, a jQuery-inspired DOM manipulation library I've been working on. It's been out there for a while, but I just finished up a round of changes that I think bring it to a certain degree of completion for basic use (although there's definitely a lot of cool stuff that still remains to be added). Most notable is a new set of eventing functions; I hope they'll provide an easy-to-use, low-level foundation for building more complex data- and event-driven web applications. Please check it out:https://github.com/levand/domina/ Feedback, pull request, etc. are welcome. Thanks! -Luke -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: New release of Domina (now with reworked eventing)
lein-cljsbuild is now becoming the tool of choice for many CLJS devs. One thing I've noticed about domina is that it's not particularly careful about declaration order. This results in a spew of compiler warnings when building your project with domina. It would be nice to sprinkle the code with the necessary declares to eliminate these warnings. David On Fri, Apr 27, 2012 at 10:47 AM, Luke VanderHart luke.vanderh...@gmail.com wrote: Some of you may already be aware of of Domina, a jQuery-inspired DOM manipulation library I've been working on. It's been out there for a while, but I just finished up a round of changes that I think bring it to a certain degree of completion for basic use (although there's definitely a lot of cool stuff that still remains to be added). Most notable is a new set of eventing functions; I hope they'll provide an easy-to-use, low-level foundation for building more complex data- and event-driven web applications. Please check it out: https://github.com/levand/domina/ Feedback, pull request, etc. are welcome. Thanks! -Luke -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: New release of Domina (now with reworked eventing)
I received the following error when performing a `lein deps` for this version [domina 1.0.0-beta4] Could not find artifact org.clojure:clojurescript:pom:0.0-1069 in central (http://repo1.maven.org/maven2) Could not find artifact org.clojure:clojurescript:pom:0.0-1069 in clojars (http://clojars.org/repo/) Could not find artifact org.clojure:clojurescript:jar:0.0-1069 in central (http://repo1.maven.org/maven2) Could not find artifact org.clojure:clojurescript:jar:0.0-1069 in clojars (http://clojars.org/repo/) java.lang.RuntimeException: org.sonatype.aether.resolution.DependencyResolutionException: Could not find artifact org.clojure:clojurescript:jar:0.0-1069 in central (http://repo1.maven.org/maven2) at clojure.lang.Util.runtimeException(Util.java:165) at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:35) at cemerick.pomegranate.aether$resolve_dependencies.doInvoke(aether.clj:406) at clojure.lang.RestFn.invoke(RestFn.java:1096) at leiningen.core.classpath$get_dependencies.doInvoke(classpath.clj:107) at clojure.lang.RestFn.invoke(RestFn.java:425) at clojure.lang.AFn.applyToHelper(AFn.java:163) at clojure.lang.RestFn.applyTo(RestFn.java:132) at clojure.core$apply.invoke(core.clj:604) at leiningen.core.classpath$resolve_dependencies.doInvoke(classpath.clj:123) at clojure.lang.RestFn.invoke(RestFn.java:425) at leiningen.deps$deps.invoke(deps.clj:24) at leiningen.deps$deps.invoke(deps.clj:20) at clojure.lang.Var.invoke(Var.java:401) at clojure.lang.AFn.applyToHelper(AFn.java:161) at clojure.lang.Var.applyTo(Var.java:518) at clojure.core$apply.invoke(core.clj:602) at leiningen.core.main$resolve_task$fn__699.doInvoke(main.clj:66) at clojure.lang.RestFn.invoke(RestFn.java:410) at clojure.lang.AFn.applyToHelper(AFn.java:161) at clojure.lang.RestFn.applyTo(RestFn.java:132) at clojure.lang.AFunction$1.doInvoke(AFunction.java:29) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:602) at leiningen.core.main$apply_task.invoke(main.clj:88) at leiningen.core.main$_main$fn__731.invoke(main.clj:140) at leiningen.core.main$_main.doInvoke(main.clj:140) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.lang.Var.invoke(Var.java:401) at clojure.lang.AFn.applyToHelper(AFn.java:161) at clojure.lang.Var.applyTo(Var.java:518) at clojure.core$apply.invoke(core.clj:600) at clojure.main$main_opt.invoke(main.clj:323) at clojure.main$main.doInvoke(main.clj:426) at clojure.lang.RestFn.invoke(RestFn.java:436) at clojure.lang.Var.invoke(Var.java:409) at clojure.lang.AFn.applyToHelper(AFn.java:167) at clojure.lang.Var.applyTo(Var.java:518) at clojure.main.main(main.java:37) Caused by: org.sonatype.aether.resolution.DependencyResolutionException: Could not find artifact org.clojure:clojurescript:jar:0.0-1069 in central (http://repo1.maven.org/maven2) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:375) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:92) at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:30) ... 37 more Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact org.clojure:clojurescript:jar:0.0-1069 in central (http://repo1.maven.org/maven2) at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538) at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358) ... 43 more Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact org.clojure:clojurescript:jar:0.0-1069 in central (http://repo1.maven.org/maven2) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:946) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:940) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669) at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60) at
Re: How to aggregate in clojure.logic ?
Big thanks for the links. Re. my question, is it doable to aggregate? Does it make sense to agregate in LP at all? Daniel On Apr 27, 2012 4:30 PM, David Nolen dnolen.li...@gmail.com wrote: Might I suggest a good book on Prolog? http://www.amazon.com/Prolog-Programming-Artificial-Intelligence-Bratko/dp/0201403757 http://www.amazon.com/The-Art-Prolog-Second-Edition/dp/0262193388 I also recommend close readings of The Reasoned Schemer and Byrd's dissertation - both are linked to in core.logic README. David On Friday, April 27, 2012, Daniel Kwiecinski wrote: Lets say we have child - father and child - mother relationship and derive from it child - parent relationship (via goal) . In clojure logic I can create goals which can answer questions like: children-of, grandchildren-of, all-descendants-of, all-ancestors-of very easily. But how one create goals that let answer questions such as: grandchildren-count-of, length-of-ancestors-line, grandparents-count Kind Regards, Daniel Kwiecinski lambder.com -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: How to aggregate in clojure.logic ?
It can be done with project. David On Fri, Apr 27, 2012 at 4:25 PM, Daniel Kwiecinski daniel.kwiecin...@gmail.com wrote: Big thanks for the links. Re. my question, is it doable to aggregate? Does it make sense to agregate in LP at all? Daniel On Apr 27, 2012 4:30 PM, David Nolen dnolen.li...@gmail.com wrote: Might I suggest a good book on Prolog? http://www.amazon.com/Prolog-Programming-Artificial-Intelligence-Bratko/dp/0201403757 http://www.amazon.com/The-Art-Prolog-Second-Edition/dp/0262193388 I also recommend close readings of The Reasoned Schemer and Byrd's dissertation - both are linked to in core.logic README. David On Friday, April 27, 2012, Daniel Kwiecinski wrote: Lets say we have child - father and child - mother relationship and derive from it child - parent relationship (via goal) . In clojure logic I can create goals which can answer questions like: children-of, grandchildren-of, all-descendants-of, all-ancestors-of very easily. But how one create goals that let answer questions such as: grandchildren-count-of, length-of-ancestors-line, grandparents-count Kind Regards, Daniel Kwiecinski lambder.com -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: How to aggregate in clojure.logic ?
Thanks David. -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Bug recognizing tail position as default value in maps?
I got it, guys! Thanks a lot! This non-tailrecursive version works as intended: (defn fix2 [f x] (let [y (f x)] (eval ({x x} y (list 'fix2 f y) Dominikus Am Freitag, 27. April 2012 17:00:52 UTC+2 schrieb Luke VanderHart: Using a map instead of if means that it is evaluated as a function call. Unlike the if form, function calls eval their arguments. So the (recur) form is getting eval'd prior to being passed to the map/function, which isn't a tail position. That's why if is a special form/macro, not a regular function (like maps are). On Friday, April 27, 2012 10:52:10 AM UTC-4, Dominikus wrote: Sure? The semantics of the default value corresponds to a 'if', doesn't it? From this viewpoint, the default value is in tail position. And why does the non-tailrecursive version not run as expected? Dominikus Am Freitag, 27. April 2012 16:45:44 UTC+2 schrieb Meikel Brandmeyer (kotarak): Hi, (defn fix2 [f x] (let [v (f x)] ({x x} v (recur f v recur is not in the tail position. The call to the map is the tail call. So the result is as expected. Kind regards, Meikel -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Help with clojurescript code for google charts
Try this: (defn add-rows [] (let [data (js/google.visualization.DataTable.)] (.addColumn data string Topping) (.addColumn data number slices) (.addRows data (clj-js [[Mushrooms 3] [Onions 1] [Olives 1]])) data)) (defn chart-options [] (clj-js {:title How much Pizza i ate last night :width 400 :height 300})) (defn get-chart [] (js/google.visualization.PieChart. (.get ($ div.container div#content) 0))) (defn draw-chart [] (let [data (add-rows) options (chart-options) chart (get-chart)] (.draw chart data options))) (.load js/google visualization 1.0 (clj-js {:packages [corechart]})) (.setOnLoadCallback js/google draw-chart) On Fri, Apr 27, 2012 at 11:15 AM, Murtaza Husain murtaza.hus...@sevenolives.com wrote: Hi, I am trying to use google charts from clojurescript, however cant get it working. I have included both the js code from google's site and my clojurescript conversion. Any help in figuring out the problem will be appreciated. Thanks, Murtaza JS Code - script type=text/javascript src=https://www.google.com/jsapi;/script script type=text/javascript // Load the Visualization API and the piechart package. google.load('visualization', '1.0', {'packages':['corechart']}); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawChart); // Callback that creates and populates a data table, // instantiates the pie chart, passes in the data and // draws it. function drawChart() { // Create the data table. var data = new google.visualization.DataTable(); data.addColumn('string', 'Topping'); data.addColumn('number', 'Slices'); data.addRows([ ['Mushrooms', 3], ['Onions', 1], ['Olives', 1], ['Zucchini', 1], ['Pepperoni', 2] ]); // Set chart options var options = {'title':'How Much Pizza I Ate Last Night', 'width':400, 'height':300}; // Instantiate and draw our chart, passing in some options. var chart = new google.visualization.PieChart(document.getElementById('chart_div')); chart.draw(data, options); } /script CLJS code - ;;clj-js and $ are functions from jayq (defn add-rows [] (let [data (js/google.visualization.DataTable.)] (.addColumn data string Topping) (.addColumn data number slices) (.addRows data [[Mushrooms 3] [Onions 1] [Olives 1]]) data)) (defn chart-options [] (clj-js {:title How much Pizza i ate last night :width 400 :height 300})) (defn get-chart [] (js/google.visualization.PieChart. ($ div.container div#content))) (defn draw-chart [] (fn [] (let [data (add-rows) options (chart-options) chart (get-chart)] (.draw chart data options (.load js/google visualization 1.0 {packages [corechart]}) (.setOnLoadCallback js/google draw-chart) -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Tagged literals: undefined tags blow up reader
Thanks everyone involved for the 1.4 release. One issue: In 1.4, tagged literals need to be defined, otherwise the reader blows up: user= [:a #foo/bar :b] RuntimeException No reader function for tag foo/bar clojure.lang.LispReader$CtorReader.readTagged (LispReader.java:1164) RuntimeException Unmatched delimiter: ] clojure.lang.Util.runtimeException (Util.java:170) This is a show-stopper for using tagged literals as a data interchange format. Its impossible to pass data through your system without every step knowing about what it is. I don't know what the best solution is, so I'm bringing this up here. But however it looks, it would be great if undefined literals were read into some kind of wrapper, and then the reader could go on with its job. -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Is there a log function that works in clojure 1.3 and above?
Hi All, There exists a log function by Konrad Hinsen http://richhickey.github.com/clojure-contrib/generic.math-functions-api.html But, does it work in Clojure 1.3 and above? If so, how would I start using it without leiningen? Incanter has a log function but whenever I do (use '(incanter core)) to get the log function, a swing window gets itself ready to display charts. This is definitely fixable though. Thank you for your time. -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Is there a log function that works in clojure 1.3 and above?
I'm good! Incanter has a log function adding :jvm-opts [-Djava.awt.headless=true] to project.clj gets rid of the window. On Fri, Apr 27, 2012 at 7:41 PM, Sean Neilan sneil...@gmail.com wrote: Hi All, There exists a log function by Konrad Hinsen http://richhickey.github.com/clojure-contrib/generic.math-functions-api.html But, does it work in Clojure 1.3 and above? If so, how would I start using it without leiningen? Incanter has a log function but whenever I do (use '(incanter core)) to get the log function, a swing window gets itself ready to display charts. This is definitely fixable though. Thank you for your time. -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Help with clojurescript code for google charts
Hey Mark, It worked ! Thank for your help. Murtaza On Saturday, April 28, 2012 5:06:49 AM UTC+5:30, Mark Rathwell wrote: Try this: (defn add-rows [] (let [data (js/google.visualization.DataTable.)] (.addColumn data string Topping) (.addColumn data number slices) (.addRows data (clj-js [[Mushrooms 3] [Onions 1] [Olives 1]])) data)) (defn chart-options [] (clj-js {:title How much Pizza i ate last night :width 400 :height 300})) (defn get-chart [] (js/google.visualization.PieChart. (.get ($ div.container div#content) 0))) (defn draw-chart [] (let [data (add-rows) options (chart-options) chart (get-chart)] (.draw chart data options))) (.load js/google visualization 1.0 (clj-js {:packages [corechart]})) (.setOnLoadCallback js/google draw-chart) On Fri, Apr 27, 2012 at 11:15 AM, Murtaza Husain murtaza.hus...@sevenolives.com wrote: Hi, I am trying to use google charts from clojurescript, however cant get it working. I have included both the js code from google's site and my clojurescript conversion. Any help in figuring out the problem will be appreciated. Thanks, Murtaza JS Code - script type=text/javascript src=https://www.google.com/jsapi;/script script type=text/javascript // Load the Visualization API and the piechart package. google.load('visualization', '1.0', {'packages':['corechart']}); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawChart); // Callback that creates and populates a data table, // instantiates the pie chart, passes in the data and // draws it. function drawChart() { // Create the data table. var data = new google.visualization.DataTable(); data.addColumn('string', 'Topping'); data.addColumn('number', 'Slices'); data.addRows([ ['Mushrooms', 3], ['Onions', 1], ['Olives', 1], ['Zucchini', 1], ['Pepperoni', 2] ]); // Set chart options var options = {'title':'How Much Pizza I Ate Last Night', 'width':400, 'height':300}; // Instantiate and draw our chart, passing in some options. var chart = new google.visualization.PieChart(document.getElementById('chart_div')); chart.draw(data, options); } /script CLJS code - ;;clj-js and $ are functions from jayq (defn add-rows [] (let [data (js/google.visualization.DataTable.)] (.addColumn data string Topping) (.addColumn data number slices) (.addRows data [[Mushrooms 3] [Onions 1] [Olives 1]]) data)) (defn chart-options [] (clj-js {:title How much Pizza i ate last night :width 400 :height 300})) (defn get-chart [] (js/google.visualization.PieChart. ($ div.container div#content))) (defn draw-chart [] (fn [] (let [data (add-rows) options (chart-options) chart (get-chart)] (.draw chart data options (.load js/google visualization 1.0 {packages [corechart]}) (.setOnLoadCallback js/google draw-chart) -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clauth - OAuth2 provider for Ring
I'm sorry I forgot to include it. I'm happy to answer any questions about it. P On Fri, Apr 27, 2012 at 5:25 AM, Vijay Kiran m...@vijaykiran.com wrote: I guess it is https://github.com/pelle/clauth ./vijay On Friday, April 27, 2012 6:43:29 AM UTC+2, Shantanu Kumar wrote: That sounds quite interesting! Do you have a Github URL of the project to share? Shantanu On Apr 25, 12:29 am, Pelle Braendgaard pel...@gmail.com wrote: This is a simple OAuth 2 provider that is designed to be used as a primary authentication provider for a Clojure Ring app. I am a relative Clojure novice, but have am very experienced in OAuth. Please help give feedback on use of idiomatic clojure. It currently handles OAuth2 bearer authentication and interactive authentication. By interactive authentication I mean, it can be used for primary end user authentication by sticking a token in a session. This means that you could eventually provide google/facebook like session overviews and log off remote sessions. The following bearer tokens are implemented: * Authorization headerhttp://tools.ietf.org/**html/draft-ietf-oauth-v2- **bearer-08#section-2.1http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-08#section-2.1 * Form encoded body parameterhttp://tools.ietf.** org/html/draft-ietf-oauth-v2-**bearer-08#section-2.2http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-08#section-2.2 * URI query fieldhttp://tools.ietf.org/**html/draft-ietf-oauth-v2-** bearer-08#section-2.3http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-08#section-2.3 * Non standard http cookie ('access_token') for use in interactive applications * Non standard session ('access_token') for use in interactive applications Authorization response types: * Authorization Code Granthttp://tools.ietf.org/** html/draft-ietf-oauth-v2-25#**section-4.1http://tools.ietf.org/html/draft-ietf-oauth-v2-25#section-4.1 * Implicit Granthttp://tools.ietf.org/**html/draft-ietf-oauth-v2-25#** section-4.2http://tools.ietf.org/html/draft-ietf-oauth-v2-25#section-4.2 Currently the following Grant types are supported: * Authorization Code Granthttp://tools.ietf.org/** html/draft-ietf-oauth-v2-25#**section-4.1http://tools.ietf.org/html/draft-ietf-oauth-v2-25#section-4.1 * Client Credential Granthttp://tools.ietf.org/** html/draft-ietf-oauth-v2-25#**section-4.4http://tools.ietf.org/html/draft-ietf-oauth-v2-25#section-4.4 * Resource Owner Password Credential Granthttp://tools.ietf.org/** html/draft-ietf-oauth-v2-25#**section-4.3http://tools.ietf.org/html/draft-ietf-oauth-v2-25#section-4.3 Currently it supports Redis and in memory for tokens, apps and users. There is a very easy protocol to implement to add further stores. I will probably add a separate one for korma and for datomic. These will be released as separate projects. For an interactive demo of it: lein run -m clauth.demo I am working on a demo app that I will deploy on heroku. P --http://agree2.com- Reach Agreement!http://**stakeventures.com-http://stakeventures.com-My blog about startups and agile banking -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- http://picomoney.com - Like money, just smaller http://stakeventures.com - My blog about startups and agile banking -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Is there a log function that works in clojure 1.3 and above?
Actually I just realized that you can use the java math api. Whoops. http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html (math/sqrt 2) 2.0 (math/log 4) 1.3862943611198906 Hooray! On Fri, Apr 27, 2012 at 7:44 PM, Sean Neilan s...@seanneilan.com wrote: I'm good! Incanter has a log function adding :jvm-opts [-Djava.awt.headless=true] to project.clj gets rid of the window. On Fri, Apr 27, 2012 at 7:41 PM, Sean Neilan sneil...@gmail.com wrote: Hi All, There exists a log function by Konrad Hinsen http://richhickey.github.com/clojure-contrib/generic.math-functions-api.html But, does it work in Clojure 1.3 and above? If so, how would I start using it without leiningen? Incanter has a log function but whenever I do (use '(incanter core)) to get the log function, a swing window gets itself ready to display charts. This is definitely fixable though. Thank you for your time. -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Using dynamic variables in libraries [Re: ANN clojure.java.jdbc 0.2.0]
On Fri, Apr 27, 2012 at 4:14 AM, Wolodja Wentland babi...@gmail.com wrote: Could you elaborate on that please? I see that dynamic variables are used quite often to give the user the ability to configure/change the behaviour of a library. That approach is often coupled with a macro that changes the bindings of dynamic variables. A better approach is to provide an API where the changes can be passed in as function arguments. Dynamic variables smack of imperative programming to me... When I asked Clojure/core to review c.j.jdbc in the context of a potential future 1.0.0 release, the use of dynamic variables was one of the issues that came up. The current variables will probably remain for backward compatibility but a new API or an extension to the current API will be added that provides a more functional style without requiring dynamic variables - and the existing code rewritten in terms of that new API. Hope that clarifies? -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en