Re: go-circuit for clojure

2014-05-13 Thread gamma235
I get the feeling that Cognitect has about four or five secret projects that they are going to unleash on the world, a ridonculously distributed asynchronous networking system being one of them. Datomic is kind of a step in that direction, is it not? -- You received this message because you

Re: go-circuit for clojure

2014-05-13 Thread François Rey
On 10/05/14 22:59, Michał T. Lorenc wrote: Since, core.async has goroutines maybe it would be possible to implement go-circuit for clojure to distrubute goroutines across computer nodes? In a previous topi

Re: [ANN] tools.analyzer(.jvm) 0.1.0-alpha1

2014-05-13 Thread Gregg Reynolds
On Friday, January 10, 2014 7:23:56 PM UTC-6, Nicola Mometto wrote: > > > Today I released the first version of the tools.analyzer[1] and > tools.analyzer.jvm[2] contrib libraries, here are the leiningen > coordinates: > > [org.clojure/tools.analyzer "0.1.0-alpha1"] > [org.clojure/tools.analy

Re: [ANN] Clojure RETE implementation - CLIPS-like expert system shell. New version 4.3

2014-05-13 Thread Alan Moore
It would be interesting to compare rete4frames with clara-rules and maybe some other clojure-based RETE implementation. Having spent some time with Clara and only looked over rete4frames it is clear that Clara has been heavily optimized for working with collections/accumulators. Especially int

Re: Expected inconsistency between set and map w/ ArrayList?

2014-05-13 Thread Mike Fikes
To facilitate inlining, the patch calls out to a separate larger method which handles a group of cases. +if(o.getClass().getName().startsWith("java.util.")) +return doalienhasheq(o); +return o.hashCode(); I was wondering whether an efficient improvement is possib

Best method for REST api authentication?

2014-05-13 Thread Ivan Schuetz
Hi, I'm new to Clojure and have little experience with api development. I'm looking for a way to implement REST api authentication. As far I understand, the best way to do this is using an authentication token. The goal is use this for mobile apps. I would prefer to avoid sending the login dat

Re: Expected inconsistency between set and map w/ ArrayList?

2014-05-13 Thread Michał Marczyk
It's not just to facilitate inlining, but also to limit the perf hit for hashing non-collections, some of which make completely reasonable map keys and set members. I've used the classes Alex Miller mentioned he was interested in for benchmarking: Class, Character, Var; these are all good examples,

Re: Expected inconsistency between set and map w/ ArrayList?

2014-05-13 Thread Michał Marczyk
Also, = defers to equals in all cases except two: (1) numeric arguments, (2) at least one IPersistentCollection among the arguments. Clojure collections are allowed to determine whether they are = to the other thing or not. So, we should calculate special hashCodes for the java.util collections Cl

Re: Expected inconsistency between set and map w/ ArrayList?

2014-05-13 Thread Michał Marczyk
Unfortunately the Guava example means that this approach doesn't really solve the problem at hand... Thanks for pointing it out. The earlier version with the three-way test in place of the "java.util." check should be semantically correct, at least. On 13 May 2014 14:40, Michał Marczyk wrote: >

ANN Langohr 2.10.1 is released

2014-05-13 Thread Michael Klishin
Langohr [1] is a small, feature complete Clojure client for RabbitMQ. Release notes: http://blog.clojurewerkz.org/blog/2014/05/13/langohr-2-dot-10-dot-1-is-released/ 1. http://clojurerabbitmq.info -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- You received this me

Re: Expected inconsistency between set and map w/ ArrayList?

2014-05-13 Thread Michał Marczyk
New patch reinstates the three-way check, but puts it in a separate static method. Performance seems to be just fine. I wonder if my previous round of benchmarking with the inline three-way check was somehow flawed... Either that or the JIT is happier with the new arrangement for some reason. In a

Re: [ANN] Clojure RETE implementation - CLIPS-like expert system shell. New version 4.3

2014-05-13 Thread ru
Alan. You absolutely right! Clojure must return thinking of programmers back to solving problems from vanity and narcissism of unnecessary complexity :) I certainly will look on Clara more attentively and may be switch to it in my applications. cheers, Ru понедельник, 12 мая 2014 г., 17:47:

clojurescript: modifying function definitions

2014-05-13 Thread t x
Suppose we had the following: (defn stupid-wrapper [f args] (. js/console log args) (let [ans (f args)] (. js/console log ans) ans)) It basically logs the arguments + return value on every function call. Now, suppose I wanted to do this to _functions that already existed_ . Is ther

To make sure - brief

2014-05-13 Thread Francisco
Hi, thanks in advance. This is for a college course. I'll be short. I need to capture with a cam (or maybe a few cams) the motion of a ball. Process the video and obtain a few calculus like speed of ball, trajectory, height reached from ground... And finally make a recreation which displays tho

Re: To make sure - brief

2014-05-13 Thread James Reeves
OpenCV is a common open source tool for computer vision processing, and there are libraries and various tutorials online for integrating this with Clojure (and Java). However, I've yet to play around with it in depth, so take what I say with a pinch of salt :) - James On 13

Re: To make sure - brief

2014-05-13 Thread Maik Schünemann
I think clojure will be a great language for this. You have access to all mature java libraries you can think of and clojure as great high level language to glue the components together and write clever algorithms. Would be great if you could do a blog post/experience report afterwards ;) On Tue,

Re: using atoms as logs for channels in core.async

2014-05-13 Thread Gary Verhaegen
What about the following? (as is bound to clojure.core.async ns) (defn decorate-channel [chan at] (as/map> (fn [x] (swap! at conj x) x) (as/map< (fn [x] (swap! at pop) x) chan))) As far as I can tell, it should do what you want, without introducing global vars. I

Loading native libs from Clojure

2014-05-13 Thread Gary Verhaegen
Hi everyone, I have recently been working on something [0] that required (consisted mainly of, really) loading native dlls. I have encountered a surprising (to me) behaviour: calling (System/load path) from Clojure correctly loaded the library, but did not link the JNI methods, whereas just switch

Re: [ANN] tools.analyzer(.jvm) 0.1.0-alpha1

2014-05-13 Thread Max Kreminski
On Tuesday, May 13, 2014 4:14:16 AM UTC-7, Gregg Reynolds wrote: > I've begun experimenting with this and I wonder if there is any further > documentation or more extensive examples.  So far I'm just trying to use > walk, prewalk, postwalk to crawl an AST, but I think I must be doing > something

Re: [ANN] Hermod a core.async message passing library

2014-05-13 Thread kovas boguta
This is extremely cool! Some questions: 1. What, besides full buffers, would cause the message to be dropped? 2. What is the practical limit on the size of messages? I'm trying to understand if manual ack'ing is necessary for say a map-reduce type distributed application. If manual ack'ing is t

Re: Loading native libs from Clojure

2014-05-13 Thread Aaron Cohen
System.loadLibrary in java has counter-intuitive behaviour. It examines the stack to figure out what class invoked it, then loads the native library into the Classloader of that class. At the REPL, this classloader is usually a transient instance of DynamicClassLoader, which isn't very helpful in t

Re: [ANN] tools.analyzer(.jvm) 0.1.0-alpha1

2014-05-13 Thread Max Kreminski
Hi Greg, I wrote a quickref to the AST node structures that also describes a generic method for traversing an arbitrary AST. It can be found here: http://mkremins.github.io/clojure-ast-ref Essentially, the :children vector is an ordered list of keys into the AST node. Each of these keys is gua

Re: [ANN] Hermod a core.async message passing library

2014-05-13 Thread Timothy Baldridge
Under-the-sheets Hermod uses TCP. Thus the idea is, if a connection is dropped mid-transmission the message is dropped. If a buffer is full, messages are dropped. Technically I've heard it's possible for TCP to hand you corrupted data (it's pretty rare, but it could happen). In that case it is ass

[ANN] Automat: better FSMs through combinators

2014-05-13 Thread Zach Tellman
https://github.com/ztellman/automat This has been languishing in my Github for a while, for lack of a few finishing touches on the code and documentation. I think this is one of cooler libraries I've written, and beyond the obvious use for parsers, the set theoretic operators could be a powerf

Re: [ANN] tools.analyzer(.jvm) 0.1.0-alpha1

2014-05-13 Thread Timothy Baldridge
My Clojure/West talk covers how to write such a pass, and the comments on this video include a link to the source code. https://www.youtube.com/watch?v=KhRQmT22SSg On Tue, May 13, 2014 at 1:16 PM, Max Kreminski wrote: > Hi Greg, > > I wrote a quickref to the AST node structures that also descri

Re: JSON authentication with cemerick/friend?

2014-05-13 Thread Ivan Schuetz
Okay. One question, what is the point to implement this as middleware? It's just a request to /login, which checks the credentials against a database and returns the status as JSON... in my case the HTTP status code will not change... (200 for success/failure). I thought it was maybe the case to

Re: [ANN] tools.analyzer(.jvm) 0.1.0-alpha1

2014-05-13 Thread Gregg Reynolds
On Tue, May 13, 2014 at 2:16 PM, Max Kreminski wrote: > Hi Greg, > > I wrote a quickref to the AST node structures that also describes a > generic method for traversing an arbitrary AST. It can be found here: > http://mkremins.github.io/clojure-ast-ref > > Max - perfect! That's just what I was lo

Re: [ANN] Automat: better FSMs through combinators

2014-05-13 Thread Colin Fleming
I'm also very excited about Automat, although I haven't had time to look at it closely yet. Ragel is one of my favourite pieces of software. Here's an article from Zed Shaw about using state charts for networked apps: http://www.zedshaw.com/essays/ragel_state_charts.html. I read an article (or an i

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-13 Thread bob
Any Result? Talk is cheap On Sunday, April 27, 2014 12:39:04 AM UTC+8, Val Waeselynck wrote: > > Hello to all, > > *Short version :* I think Clojure needs a documentation system in > Clojure, I would like to know if some efforts exist in that direction, and > I am willing to create it / contribu

Re: [ANN] tools.analyzer(.jvm) 0.1.0-alpha1

2014-05-13 Thread Gregg Reynolds
On Tue, May 13, 2014 at 2:17 PM, Timothy Baldridge wrote: > My Clojure/West talk covers how to write such a pass, and the comments on > this video include a link to the source code. > > https://www.youtube.com/watch?v=KhRQmT22SSg > Just watched, very helpful. Thanks. -- You received this messa

Re: "recursive" hierarchies and derive

2014-05-13 Thread Brandon Bloom
Leif is right, but isa?'s docstring doesn't mention this behavior. Here's the relevant code: https://github.com/clojure/clojure/blob/028af0e0b271aa558ea44780e5d951f4932c7842/src/clj/clojure/core.clj#L5120 On Tuesday, May 13, 2014 12:22:28 AM UTC-4, Leif wrote: > > Hi, Ranko. > > I *think* it's

Re: using atoms as logs for channels in core.async

2014-05-13 Thread gamma235
Hi Gary, Your function looks interesting and succinct, but I am still new to this subject so am not sure how it would be used. Could you give some examples? Jesse On Wednesday, May 14, 2014 3:34:17 AM UTC+9, Gary Verhaegen wrote: > > What about the following? (as is bound to clojure.core.async

Joy of Clojure question

2014-05-13 Thread gamma235
I am reading The Joy of Clojure now and am finishing chapter 5 on sequence abstractions. There is an example given that demonstrates how to locate the index of an element in a sequence by value, but I don't understand why the character lookup here is returning 13. Can somebody please explain thi

Re: clojurescript: modifying function definitions

2014-05-13 Thread Dave Sann
I have done this sort of this with with-redefs to look at the input and output of functions inside a library I was using. http://clojuredocs.org/clojure_core/clojure.core/with-redefs I may have a small macro to assist. I can post later if you wish. You need to be careful of binding boundaries t

Re: [ANN] Clojure RETE implementation - CLIPS-like expert system shell. New version 4.3

2014-05-13 Thread Dave Sann
this code (and the related create) is unusual: (defn reset [] "Reset: clear and initialize all memories" (def =AMEM= (object-array @ACNT)) (def =BMEM= (object-array =BCNT=)) (def =FMEM= (create-fmem =TEMPL=)) (def =FMMB= (create-fmem =TEMPL=)) (def =FIDS= (HashMap.)) (def CFSET (atom

Re: Joy of Clojure question

2014-05-13 Thread Bridget
\3 is a character literal, so you're looking up the character 3. You're looking it up in a collection which is a string. Count from the first position, 0, a colon, then 1, the letter a, and so on. 3 is at the 13th position. On Tuesday, May 13, 2014 9:44:38 PM UTC-4, gamma235 wrote: > > I am rea

Re: Joy of Clojure question

2014-05-13 Thread Guru Devanla
The call to (index) returns this vector ([0 \:] [1 \a] [2 \space] [3 \4] [4 \space] [5 \:] [6 \b] [7 \space] [8 \1] [9 \space] [10 \:] [11 \c] [12 \space] [13 \3] [14 \space] [15 \:] [16 \d] [17 \space] [18 \4]) And, 3 here is in the 13th position. Your (cond) in index function is picking up the

Re: [ANN] brute 0.2.0 - A lightweight Entity Component System library for writing games

2014-05-13 Thread Atamert Ölçgen
This is nice! I'm working on a component-entity-system myself. ( https://github.com/muhuk/clecs) I aim for pluggable backends, so you can choose between a persistent world or an in-memory world etc. The reference backend is based on an atom. So clecs is not as side-effect free as brute. But the p

Re: Joy of Clojure question

2014-05-13 Thread gamma235
Okay, both these answers make lots of sense. thank you for your help. J On Wednesday, May 14, 2014 11:47:51 AM UTC+9, Guru Devanla wrote: > > The call to (index) returns this vector > > ([0 \:] [1 \a] [2 \space] [3 \4] [4 \space] [5 \:] [6 \b] [7 \space] [8 > \1] [9 \space] [10 \:] [11 \c] [12

Re: [ANN] brute 0.2.0 - A lightweight Entity Component System library for writing games

2014-05-13 Thread Zach Oakes
Thanks Mark, this is impressive. Let me know if there is anything I can do on my end to make play-clj more agnostic regarding entity systems. The built-in entity system is quite simple and doesn't do much for you, so this looks like a great alternative. On Monday, May 12, 2014 7:22:07 PM UTC-4,

ANN Monger 2.0 RC1 is released

2014-05-13 Thread Michael Klishin
Monger [1] is a Clojure MongoDB client for a more civilized age. 2.0 is a major release that has *breaking public API changes*. Release notes: http://blog.clojurewerkz.org/blog/2014/05/14/monger-2-dot-0-0-rc1-is-released/ Please give this RC a try. This is the biggest revision of Monger in the e

Re: [ANN] Clojure RETE implementation - CLIPS-like expert system shell. New version 4.3

2014-05-13 Thread Ryan Brush
It's cool to see different approaches to Rete in Clojure. I think a solid implementation could really disrupt Drools. Why would I want to write in a limited rule language if I can get rule-like semantics and the expressiveness of Clojure at the same time? Of course I'm going to be biased toward

ANN: zip-visit and fast-zip-visit 1.0.2

2014-05-13 Thread Alexander Hudek
The zip-visit library implements zipper-based visitors that allow one to carry and modify state during a depth first traversal of a zipper. There is an extensive description here: https://github.com/akhudek/zip-visit A short example of a zipper-based version of some. Here n is the node and s is

[ANN] Clojure RETE implementation - CLIPS-like expert system

2014-05-13 Thread daly
Ryan, Does this system compile the left hand sides into a shared data structure? Tim Daly -- 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 -

[ANN] Clojure RETE implementation - CLIPS-like expert system

2014-05-13 Thread Ryan Brush
Hi Tim, Yes. Clara does Rete-style structural sharing of equivalent rule constraints, and then compiles those constraints into Clojure expressions. This actually happens when a rule session is created for a set of rules, but this is memoized by default so you only pay that cost the first time.