Re: [ANN] data.avl 0.0.12 -- sorted collections with slice, nth, transient support

2014-04-24 Thread Michał Marczyk
Cheers Alex! See below for the results of yesterday's run of my benchmark suite for the basic operations. (I'll post some benchmark results for the new functions in a separate message sometime soon.) In general, it's fair to expect (persistent) assoc/dissoc to be slower with data.avl maps, since

Re: JSON authentication with cemerick/friend?

2014-04-24 Thread Erik Bakstad
Here is an example from our ajax-login form. After reading Sam's excellent writeup it should be understandable. https://gist.github.com/ebaxt/11244031 kl. 00:28:45 UTC+2 torsdag 24. april 2014 skrev Ivan Schuetz følgende: Hi, I'm trying to get a simple use case running - send a login

Re: Style - Keyword access or accessors?

2014-04-24 Thread Jason Wolfe
FWIW, internally we use a combination of schema and religious use of letk or safe-get and safe-get-in (from prismatic/plumbing) to pull things out of object-like maps, which together with reasonable test coverage seem to catch almost all of the keyword typos before they become bugs. The other

Re: Bug in clojure.algo.monads prevents you from using :require :as ns declaration

2014-04-24 Thread Rick Moynihan
Thanks! R. On 23 April 2014 15:05, Andrey Antukh n...@niwi.be wrote: Hi Rick As far as I know, m-lift and similar functions should be used in monad context (using with-monad macro). Greetings. Andrey 2014-04-23 14:41 GMT+02:00 Rick Moynihan rick.moyni...@gmail.com: Hi all, I

Datomic Pro Starter: limit per user or per app?

2014-04-24 Thread Robin Heggelund Hansen
Simple question, sorry if this is jotted down somewhere and I didn't read it :/ Regarding Datomic Pro Starter, is the limitation of 1 transactor+two peers per registered user, or per app? I would love to use datomic in my projects, but when free is recommended for dev and not prod, and I can

Re: Datomic Pro Starter: limit per user or per app?

2014-04-24 Thread Jeroen van Dijk
Coincidentally, I was wondering the same today and I asked the same question in different wording on the Datomic mailinglist https://groups.google.com/forum/#!topic/datomic/gvP0ecJghd8 On Thu, Apr 24, 2014 at 1:42 PM, Robin Heggelund Hansen skinney...@gmail.com wrote: Simple question,

Re: Datomic Pro Starter: limit per user or per app?

2014-04-24 Thread Robin Heggelund Hansen
Ahh, I didn't know there was a Datomic mailing list :P Will be watching your question then :) kl. 13:59:38 UTC+2 torsdag 24. april 2014 skrev Jeroen van Dijk følgende: Coincidentally, I was wondering the same today and I asked the same question in different wording on the Datomic

Using core.typed to guide runtime behavior?

2014-04-24 Thread James MacAulay
I'm interested in exploring the use of the types provided by core.typed to guide function behavior at runtime. Specifically, I'd like to wrap existing functions such that the resulting functions behave in different ways depending on the type signatures of each original function. I'm imagining

Re: citing Clojure and EDN?

2014-04-24 Thread Phillip Lord
Ben Wolfson wolf...@gmail.com writes: The idea that you can't cite websites is a conceit that ensures that academics continue to spend a 1000s of pounds a paper on puplication costs, when you can achieve much the same with a blog, some metadata and archive.org. Ah, that was good, I feel

Re: Hosting Providers

2014-04-24 Thread Richard Watson
Hi Adrian, You don't have far to look ... Engine Yard now supports Java, and by extension, Clojure. If you can package up your Clojure app into a WAR file (using Leiningen's 'lein ring uberwar', for example) you can deploy it onto a Jetty or Tomcat server in an Engine Yard Java environment.

Clojure cons vs. conj

2014-04-24 Thread Jiacai Liu
hi everyone: I use Clojure to solve SICP 2.22 http://www.billthelizard.com/2011/01/sicp-221-223-mapping-over-lists.html . The problem is to rewrite a map fn in a iterative way,here it want to get the square of each element in a list Method 1: (defn square-list [items] (defn iter [things

Re: Clojure cons vs. conj

2014-04-24 Thread Gary Trakhman
Conj is polymorphic on its first argument. If you pass it a vector, it'll add to the back, if a list, the front. The collection is responsible for deciding the most efficient way to add an element. Cons always adds to the front, creating a linked-list node pointing to the rest. Also, cons takes

Re: Clojure cons vs. conj

2014-04-24 Thread Jiacai Liu
Oh,Thank you for answer. But if I just want to insert a element to list,and meantime want to insert in the back.How should I do? Another question: why clojure need both cons and conj? In mit-lisp cons just do all things. On Thursday, April 24, 2014 11:12:49 PM UTC+8, Gary Trakhman wrote: Conj

Re: Clojure cons vs. conj

2014-04-24 Thread Gary Trakhman
MIT-lisp is more for teaching than industrial use.. We also have hash-maps, vectors, sets, queues, conj works with all of them, leaving the details up to the collection. Cons always adds to the front. Conj only adds to the back for certain collections (vector, queue). You could work around it

Re: Clojure cons vs. conj

2014-04-24 Thread Gary Trakhman
Well, maybe I shouldn't bash MIT-scheme unintentionally :-). I bet some people use it for serious stuff, and I have no bad experiences with it. On Thu, Apr 24, 2014 at 11:33 AM, Gary Trakhman gary.trakh...@gmail.comwrote: MIT-lisp is more for teaching than industrial use.. We also have

Re: Clojure cons vs. conj

2014-04-24 Thread Jiacai Liu
Well,I understand you. list only support front insert since it only takes O(1). If insert in the back,it would require O(n) time. Maybe clojure has its own reasons for having both cons and conj. Thank again for telling me their differences. On Thursday, April 24, 2014 11:36:13 PM UTC+8, Gary

clojure.core.memoize dependency problem

2014-04-24 Thread Daniel Slutsky
Dear Clojure group, I am running into an interesting issue with clojure.core.memoize. I created a simple project depending on clojure.core.memoize. (defproject test-memoize 0.1.0-SNAPSHOT :description FIXME: write description :url http://example.com/FIXME; :license {:name Eclipse Public

Re: clojure.lang.PersistentVector cannot be cast to java.lang.String

2014-04-24 Thread sindhu hosamane
I have the same error above clojure.lang.PersistentVector cannot be cast to java.lang.String . but when i use ByteArrayInputStream i have clojure.lang.PersistentList cannot be cast to java.lang.String . don't know how to fix it .I want to retrieve data between 2 timestamp values . i have some

Re: Clojure cons vs. conj

2014-04-24 Thread Guru Devanla
Another option is to explore concat On Thu, Apr 24, 2014 at 8:46 AM, Jiacai Liu jiacai2...@gmail.com wrote: Well,I understand you. list only support front insert since it only takes O(1). If insert in the back,it would require O(n) time. Maybe clojure has its own reasons for having both

ANN: Om 0.6.1, moving towards independently addressable components

2014-04-24 Thread David Nolen
Om 0.6.1 significantly changes how component local state works - we now rely on React's forceUpdate to update components that use local state. This is a significant change so I would like people test this out on their existing code bases as soon as possible. The immediate benefit is that

Re: ANN: Om 0.6.1, moving towards independently addressable components

2014-04-24 Thread Rafal Lewczuk
Lack of (easy) access to local state (=addressability) is the single biggest problem I'm having with om as it brings quite a lot of unnecessary complexity. This was the reason of (strange) questions I was posting earlier. Thank you for tackling this problem. On 24.04.2014 19:03, David Nolen

Best way to create a namespace at runtime from a web app

2014-04-24 Thread Sarkis Karayan
Hi everyone, I am working on a web app that allows code and namespace creation at runtime, but I get an error when trying to create a namespace from a web process: java.lang.IllegalStateException: Can't change/establish root binding of: *ns* with set This works when doing in a repl or single

Re: Best way to create a namespace at runtime from a web app

2014-04-24 Thread A. Webb
Have you tried the aptly named create-nshttp://clojuredocs.org/clojure_core/clojure.core/create-ns ? -- 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

Elementary question about displaying images in an app

2014-04-24 Thread Christopher Howard
This is, I think, as much of a Java question as a Clojure question (I'm learning both at the same time). I'm writing a small desktop application, and I need to paint a few images in one part of the window (contained in PNGs). I'm looking through AWT/Swing/Graphics2D documentation, but I am a

Re: ANN: Om 0.6.1, moving towards independently addressable components

2014-04-24 Thread Kris Jenkins
All looks good here - a drop-in replacement. :-) Independently addressable components will be a very nice enhancement for us. I look forward to it. Cheers, Kris On Thursday, 24 April 2014 18:03:37 UTC+1, David Nolen wrote: Om 0.6.1 significantly changes how component local state works - we

Re: browser lisp editor

2014-04-24 Thread Alan Moore
Nice... I like it. But, as you say, probably not for beginners. Alan On Wednesday, April 23, 2014 5:34:51 AM UTC-7, Evan Rowley wrote: I have one more suggestion that a friend of mine made to me. I was able to run it but not actually use it due to a firewall issue. There is also a

Re: Using core.typed to guide runtime behavior?

2014-04-24 Thread Ambrose Bonnaire-Sergeant
I haven't tried anything like this. The most obvious pitfall is core.typed currently loads lazily and collects type annotations only after check-ns. There's a bunch of tools for manipulating types in the checker. Thanks, Ambrose On Thu, Apr 24, 2014 at 11:18 PM, James MacAulay

Re: Elementary question about displaying images in an app

2014-04-24 Thread Niels van Klaveren
The best way to use Swing from Clojure is the seesaw library.https://github.com/daveray/seesawIt managed to clojurize Swing remarkably well, and is trying it's hardest to get all glaring inconsistencies out of swing use. Simple example to set a background for a frame: (frame :title Hello

Re: ANN: Om 0.6.1, moving towards independently addressable components

2014-04-24 Thread Alan Moore
To what extent are the issues you are addressing with Om and state/cursors related to ORM-like problems? In a previous post: https://groups.google.com/forum/#!topic/clojurescript/88u7kcomnUA Here you mentioned that in Om you have a database-like system + time model. That made me think about

Re: Style - Keyword access or accessors?

2014-04-24 Thread Mars0i
I do think there's a legitimate role for routine use of accessors in some contexts, btw. I seem to have been traumatized by my experience with them, however. :-) On Thursday, April 24, 2014 12:48:04 AM UTC-5, Mars0i wrote: One of the things I hated about Java when I did Java programming for

Re: Best way to create a namespace at runtime from a web app

2014-04-24 Thread Shane Kilkelly
I can't offer any advice on how to do this, but I am genuinely curious as to why one would need to create a new namespace as part of a web server. Care to provide an example? :) On Thursday, 24 April 2014 18:44:02 UTC+1, Sarkis Karayan wrote: Hi everyone, I am working on a web app that

Re: Using core.typed to guide runtime behavior?

2014-04-24 Thread James MacAulay
Thanks for the pointers, Ambrose, and thanks for core.typed! James On Thursday, 24 April 2014 17:24:21 UTC-4, Ambrose Bonnaire-Sergeant wrote: I haven't tried anything like this. The most obvious pitfall is core.typed currently loads lazily and collects type annotations only after check-ns.

Re: Best way to create a namespace at runtime from a web app

2014-04-24 Thread Sarkis Karayan
Thank you, I was doing everything but the obvious. :-) On Thursday, April 24, 2014 11:26:39 AM UTC-7, A. Webb wrote: Have you tried the aptly named create-nshttp://clojuredocs.org/clojure_core/clojure.core/create-ns ? -- You received this message because you are subscribed to the Google

Re: Best way to create a namespace at runtime from a web app

2014-04-24 Thread Sarkis Karayan
My product integrates the code editor into the browser and allows live updates to the runtime. :-D On Thursday, April 24, 2014 11:27:30 AM UTC-7, Shane Kilkelly wrote: I can't offer any advice on how to do this, but I am genuinely curious as to why one would need to create a new namespace as

Re: Clojure cons vs. conj

2014-04-24 Thread Jiacai Liu
thank Guru,the solution of my problem may not difficult,I first didn't understand the usage of cons and conj,now I can grasp them deeper than before. Clojure is so flexible that it both have cons and conj for different situation,which accounts for its advantages over mit-lisp. On Friday,

Clojure Office Hours - Experience Report and Future Plans

2014-04-24 Thread Leif
This message is aimed at people that want to *hold* office hours primarily, but of course others can chime in with opinions, suggestions, cheerleading, etc. I recently held office hours where I chatted / pair programmed with less experienced clojure programmers (some were in fact more

Re: Clojure Office Hours

2014-04-24 Thread Leif
Hi, all. This test run of office hours was fun, and I hope to do it again soon. Unfortunately, as I said above, for the next several weeks at least I will be in transit, but I hope to have more office hours in the future. I've started a new thread on the list, trying to drum up community