Re: [ANN] Clojure 1.9.0-alpha15 is now available

2017-03-14 Thread Dmitri
esday, March 14, 2017 at 12:38:53 PM UTC-5, Dmitri wrote: >> >> looks like the latest core.async fails Spec validation with alpha15: >> >> Caused by: clojure.lang.ExceptionInfo: Call to clojure.core/refer-clojure >> did not conform to spec: >> In: [2] val: (

Re: [ANN] Clojure 1.9.0-alpha15 is now available

2017-03-14 Thread Dmitri
looks like the latest core.async fails Spec validation with alpha15: Caused by: clojure.lang.ExceptionInfo: Call to clojure.core/refer-clojure did not conform to spec: In: [2] val: (quote :as) fails at: [:args :exclude :op :spec] predicate: #{:exclude} In: [2 1] val: :as fails at: [:args :exclud

Re: Luminus in Techempower benchmarks

2016-02-29 Thread Dmitri
Sounds fantastic! On Monday, February 29, 2016 at 4:13:53 PM UTC-5, Jim Crossley wrote: > > Sounds good, Dmitri. I'll work up something on a fork in the next few > days and ping you. We can go from there. > > Jim > > > On Mon, Feb 29, 2016 at 2:33 PM,

Re: Luminus in Techempower benchmarks

2016-02-29 Thread Dmitri
Hi Jim, I'm the author of Luminus, and I'd love tow work with you to tune up the performance. Feel free to ping me via email or on GitHub. On Sunday, February 28, 2016 at 8:17:13 PM UTC-5, Jim Crossley wrote: > > I just tried a few experiments and realized the :dispatch? option is > broken in t

Re: Streamlining dev environment startup

2015-12-11 Thread Dmitri
The recommended way to manage components in Luminus is using the mount library (https://github.com/tolitius/mount), it's much less intrusive than Component in my opinion and provides most of the same benefits without requiring you to structure your application around it. The latest version of m

Re: [ANN] Let's make clojure.org better!

2015-11-10 Thread Dmitri
Just a note that the author of Cryogen is very responsive regarding discussions on improvements and pull requests for additional functionality. If there's a particular feature that's missing it might be worth creating an issue or opening a pr for it. On Tuesday, November 10, 2015 at 10:57:45 AM

Re: Using a dynamic var for my database connection for implicit connections+transactions

2015-08-05 Thread Dmitri
_name_here&password=db_user_password_here"}}} The tests run in the test profile and so get the test database connection from the environment. On Wednesday, August 5, 2015 at 2:34:31 PM UTC-4, James Reeves wrote: > > On 5 August 2015 at 18:04, Dmitri > > wrote: > >> I agree t

Re: Using a dynamic var for my database connection for implicit connections+transactions

2015-08-05 Thread Dmitri
at in practice it's better to use a separate test database instead of the dev instance. On Wednesday, August 5, 2015 at 11:11:19 AM UTC-4, James Reeves wrote: > > On 5 August 2015 at 14:03, Dmitri > > wrote: > >> What I'm talking about is whether it's a bette

Re: Using a dynamic var for my database connection for implicit connections+transactions

2015-08-05 Thread Dmitri
o encapsulating them centrally is a better pattern. I certainly don't see that as a feature. On Wednesday, August 5, 2015 at 8:19:38 AM UTC-4, James Gatannah wrote: > > > > On Monday, August 3, 2015 at 10:21:09 PM UTC-5, Dmitri wrote: >> >> My understanding is that the

Re: Using a dynamic var for my database connection for implicit connections+transactions

2015-08-03 Thread Dmitri
me at least - to be the same. > > > R. > > > On 3 Aug 2015, at 18:19, Dmitri > > wrote: > > While I generally agree that purity is something to strive for, I think > it's also important to consider the problem that's being solved in each > parti

Re: Using a dynamic var for my database connection for implicit connections+transactions

2015-08-03 Thread Dmitri
While I generally agree that purity is something to strive for, I think it's also important to consider the problem that's being solved in each particular scenario. While creating stateless database query functions and passing the connection round explicitly achieves purity, it's not entirely c

Re: ANN: ClojureScript 0.0-3255 - pretty printer & latest Closure Compiler / Library

2015-05-10 Thread Dmitri
Is there possibly anything else missing in the package, figwheel doesn't appear to find the repl ns. lein figwheel Retrieving org/clojure/clojurescript/0.0-3269/clojurescript-0.0-3269.pom from central Retrieving org/clojure/clojurescript/0.0-3269/clojurescript-0.0-3269.jar from central Exceptio

Re: Clojure needs a web framework with more momentum

2015-05-05 Thread Dmitri
Tuesday, May 5, 2015 at 1:27:21 AM UTC-4, Sven Richter wrote: > > Hi Dmitri, > > When I was building closp I was taking luminus as the base for it with > some minor adoptions. I just had a look at the website of luminus and saw > the massive amount of work you put into the docum

Re: Clojure needs a web framework with more momentum

2015-05-05 Thread Dmitri
Luminus uses a minimal amount of generated code. It completely embraces the composable library approach. The difference from rolling your own each time is that it provides some structure and it's a curated set of libraries that are known to work well together. On Tuesday, May 5, 2015 at 3:46:09

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread Dmitri
As others have pointed out the comparison isn't really valid. Luminus intentionally aims to leverage existing libraries that are maintained independently whenever possible. I've been doing web dev with Clojure for the past 4 years and overall I do prefer the approach of using composable librari

Re: [ANN} Aleph 0.4.0 released, plus Manifold, Dirigiste, and a whole host of other libraries

2015-04-17 Thread Dmitri
Ah, you're right there is ring.middleware.reload middleware available and wrapping the handler with it in dev works perfectly. On Friday, April 17, 2015 at 7:22:06 PM UTC-4, Zach Tellman wrote: > > Hey Dmitri, > > I haven't used any sort of dev-mode before (I just updat

Re: [ANN} Aleph 0.4.0 released, plus Manifold, Dirigiste, and a whole host of other libraries

2015-04-17 Thread Dmitri
I'd like to add Aleph to the Luminus template and I was wondering if there's an equivalent of dev mode available for other servers where it watches for changes in source and reloads them. I did a cursory look but didn't spot anything like a -dev option. On Friday, April 17, 2015 at 5:06:30 PM U

Re: [ANN] ring-access-rules library

2014-12-09 Thread Dmitri
It really looks fantastic, I'll do the integration in Luminus this weekend and let you know how that goes. :) On Tuesday, December 9, 2014 4:50:51 PM UTC-5, Andrey Antukh wrote: > > > > 2014-12-09 22:35 GMT+01:00 Dmitri >: > >> I'm definitely up for that, if

Re: [ANN] ring-access-rules library

2014-12-09 Thread Dmitri
y because I'm little frustrate with friend approach (is > good but not convinced me). > > Regards. > Andrey > > 2014-12-09 21:30 GMT+01:00 Dmitri >: > >> That does look rather similar actually, and it looks like buddy does a >> lot more as well. I guess t

Re: [ANN] ring-access-rules library

2014-12-09 Thread Dmitri
That does look rather similar actually, and it looks like buddy does a lot more as well. I guess that validates the approach, I'll have to see if it fits all my use cases. :) On Tuesday, December 9, 2014 2:43:42 PM UTC-5, Andrey Antukh wrote: > > Hi Dmitri! > > If I underst

[ANN] ring-access-rules library

2014-12-09 Thread Dmitri
https://github.com/yogthos/ring-access-rules Friend is a great library, but it's definitely not easy to get into and I found it can actually make the workflow logic difficult to follow in some cases. My experience has been that for apps I work on all I want is to apply a decision function to a

Re: Releasing Caribou today: Open Source Clojure Web Ecosystem

2013-11-13 Thread Dmitri
I notice you're using a fairly old version of markdown-clj [markdown-clj "0.9.19"] The current version is [markdown-clj "0.9.35"] so that should address a lot of formatting issues. :) On Wednesday, November 13, 2013 2:09:10 PM UTC-5, Ryan Spangler wrote: > > Brian, > > Thanks for the heads up!

Re: Full stack Clojure web/REST framework - is there any mileage in it?

2013-01-11 Thread Dmitri
I think a lot of the issues can be addressed via a good template which sets up all the boiler plate, demonstrates idiomatic usage, and defaults to some common libraries. I'm actively working on filling this gap with the Luminus, which aims to make it easy to get roll

CDS tutorials

2012-10-10 Thread Dmitri
extensive Noir tutorial here https://www.yogthos.net/blog/22-Noir+tutorial+-+part+1 if they look useful I'd be glad to add them. Cheers, Dmitri -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj

Re: clj-pdf for declarative PDF generation (status update)

2012-06-11 Thread Dmitri
And it's been updated as per suggestion, thanks for the tip. On 2012-06-11, at 01:45 , Baishampayan Ghose wrote: > > > On Sun, Jun 10, 2012 at 10:16 PM, Dmitri > wrote: > >> The reason I'm using strings for values is to make it easier to work > with > &

Re: clj-pdf for declarative PDF generation (status update)

2012-06-11 Thread Dmitri Sotnikov
That's a good point, it would make the API more idiomatic I suppose. On 2012-06-11, at 01:45 , Baishampayan Ghose wrote: > On Sun, Jun 10, 2012 at 10:16 PM, Dmitri wrote: >> The reason I'm using strings for values is to make it easier to work with >> deserialized

Re: clj-pdf for declarative PDF generation (status update)

2012-06-10 Thread Dmitri
better fit there. > > On Sun, Jun 10, 2012 at 5:59 PM, Dmitri > wrote: > > The goal of clj-pdf is to provide a straight forward way to generate > PDFs > > using markup similar to hiccup. It tries to do the right thing by > default, > > so all styling hints are

clj-pdf for declarative PDF generation (status update)

2012-06-10 Thread Dmitri
The goal of clj-pdf is to provide a straight forward way to generate PDFs using markup similar to hiccup. It tries to do the right thing by default, so all styling hints are optional. It's getting some production use at the moment, and there don't appear to be any issues so far. https://github

Re: a library I'm working on for generating PDFs from Clojure

2012-04-19 Thread Dmitri
It should be pretty easy to map some basic Hiccup tags to this, headings, paragraphs, lists, and tables, etc. I suspect it's probably easier to go the hiccup->pdf route, as you could simply ignore the html tags that aren't applicable. On Apr 19, 4:45 am, David Jagoe wrote: > Hi

a library I'm working on for generating PDFs from Clojure

2012-04-18 Thread Dmitri
I poked around and noticed that there aren't any libraries for creating PDFs, and as I needed to make one for work I decided to open source it. I tried to follow Hiccup syntax as I find it to be nice and flexible. https://github.com/yogthos/clj-pdf The library piggy backs on iText 2.1.7 (the last

Re: a convenience idea for test functions

2012-04-18 Thread Dmitri
That is an excellent point, and the macro is actually a very nice approach, thanks for the help. On Apr 18, 1:07 am, Sean Corfield wrote: > On Tue, Apr 17, 2012 at 9:16 PM, Dmitri wrote: > > (map? foo bar baz) would return bar if foo is a map and baz otherwise. > > To elab

a convenience idea for test functions

2012-04-17 Thread Dmitri
Often times I find myself writing code like the following (if (map? foo) bar baz) would it make sense to make test functions variadic, so if only passed a single argument it would return true/false, but could also act as an if when passed 3 arguments, eg: (map? foo bar baz) would return bar if f

Re: Servlet question

2010-10-11 Thread Dmitri
Thanks this does seem to solve the problem of the servlet being reinitialized on every run. On Oct 10, 11:10 pm, Adrian Cuthbertson wrote: > Hi Dmitri, > > The problem is probably related to calling init with args. It requires > that super() gets called - I can't remembe

Servlet question

2010-10-10 Thread Dmitri
I noticed an odd thing when making a servlet (ns jms.myservlet (import (javax.servlet.http HttpServlet HttpServletRequest HttpServletResponse)) (:gen-class :extends javax.servlet.http.HttpServlet)) (defn -init [& args] (println "+++ init ran with arg

Re: date serialization in clojure-contrib json

2010-09-04 Thread Dmitri
address": ["street","1 Bay","city","Toronto"]} decoded {:name John, :age #, :address [street 1 Bay city Toronto]} On Sep 3, 3:17 pm, Stuart Sierra wrote: > No. I'm talking about collisions when multiple deserialization > functions are added

Re: date serialization in clojure-contrib json

2010-09-03 Thread Dmitri
s are added from different sources.  It cannot be a global > setting. > > -S > > On Sep 3, 1:28 pm, Dmitri wrote: > > > > > The problem I was trying to avoid is having to do a second pass over > > the data after it comes out of the parser, it's more expen

Re: date serialization in clojure-contrib json

2010-09-03 Thread Dmitri
The problem I was trying to avoid is having to do a second pass over the data after it comes out of the parser, it's more expensive and it's also ugly for nested data structures. Would using defonce- and defmacro- from clojure-contrib address the problem with namespace collisions? On Sep 3, 12:01 

Re: date serialization in clojure-contrib json

2010-08-25 Thread Dmitri
I posted the complete file on github here http://gist.github.com/549771 -- 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 wi

Re: date serialization in clojure-contrib json

2010-08-25 Thread Dmitri
ception. "JSON error (end-of- file)")) eof-value) ;; Ignore whitespace (Character/isWhitespace c) (recur (.read stream) object- reader) these are the only changes that are needed and should preserve the default case, while allowing to extend object

Re: date serialization in clojure-contrib json

2010-08-24 Thread Dmitri
wrote: > On Aug 23, 9:03 pm, Dmitri wrote: > > > Would there be an issue with adding something like that to the > > contrib? > > I don't want to add anything that impacts performance in the plain > parsing case. > > -S -- You received this message because y

Re: date serialization in clojure-contrib json

2010-08-23 Thread Dmitri
that to the contrib? On Aug 21, 1:52 pm, Stuart Sierra wrote: > I suppose one could override the (private) read-json-object function > to transform maps after they are read, based on the presence of > certain keys.  But that would seriously complicate the reader.  It's > probably ea

Re: date serialization in clojure-contrib json

2010-08-20 Thread Dmitri
dard for how to represent dates in JSON, it is > unlikely to be built in.  But you can extend the writer with > application-specific date formats. > -S > > On Aug 20, 2:15 pm, Dmitri wrote: > > > > > I'm currently using Dan Larkin's clojure-json, and it provi

Re: date serialization in clojure-contrib json

2010-08-20 Thread Dmitri
Extending the writer is pretty trivial (defn write-date [date] (.format (new java.text.SimpleDateFormat "MMM dd, hh:mm:ss a") date)) (extend Date Write-JSON {:write-json write-date}) but it seems like deserializing a date wouldn't be quite so trivial. -- You received this message beca

date serialization in clojure-contrib json

2010-08-20 Thread Dmitri
I'm currently using Dan Larkin's clojure-json, and it provides a way to serialize and deserialize dates, it also provides the option to specify custom serializers, eg: (defn date-encoder [date writer pad current-indent start-token-indent indent- size] (.append writer (str start-tok

Re: sequence manipulation question

2009-10-19 Thread Dmitri
ah thanks for the clarification, makes perfect sense, didn't notice into. On Oct 20, 1:25 am, Alex Osborne wrote: > Dmitri wrote: > >  > I notice that certain sequence operations such as concat and cons will >  > not retain the original type of sequence, for example

sequence manipulation question

2009-10-19 Thread Dmitri
I notice that certain sequence operations such as concat and cons will not retain the original type of sequence, for example if you combine two vectors together a list will be returned: user=> (concat [1 2] [3 4]) (1 2 3 4) is this intentional behavior, and would it not be more consistent for co

Re: speed question

2009-04-02 Thread Dmitri
yeah I definitely agree that it would be nice if constants could be used without the parens. On Apr 2, 11:48 am, Paul Stadig wrote: > Yeah that works the same as defining a function, just more explicit. I was > looking for a way to define a constant and just use it as "my-const" without > having

Re: speed question

2009-04-02 Thread Dmitri
nifty :) On Apr 2, 5:10 pm, Raffael Cavallaro wrote: > If you change the color constructor you can get some nice color > effects: > > (. setColor (let [scaled (Math/round (* value color-scale))] >                      (Color.   255 (- 255 scaled) scaled))) > > will give you yellow and magenta fo

Re: speed question

2009-04-02 Thread Dmitri
Thanks a lot, that's really helpful. I never thought of using a macro to define constants like that, it's definitely a good trick and it does seem to result in the biggest performance gain. On Apr 2, 7:25 am, Paul Stadig wrote: > I got it down to about 3 seconds. I did what William said, but the

Re: speed question

2009-04-02 Thread Dmitri
like Paul said earlier changing the globals to macros makes seems to make a huge impact. and the check-bounds and draw-line get called for each line on the screen so it makes sense that optimizations there will make a big impact. On Apr 2, 8:05 am, MikeM wrote: > Starting with your version, I go

Re: speed question

2009-04-02 Thread Dmitri
thanks a lot, that's really helpful. On Apr 2, 7:25 am, Paul Stadig wrote: > I got it down to about 3 seconds. I did what William said, but the biggest > improvement was from changing the way *width*, *height*, and *max-steps* > were defined. I noticed that in the Java version they are constants

Re: speed question

2009-04-01 Thread Dmitri
mance over java that only so much can be done about. I'm mostly curious if I made any newbie mistakes that would cause it to perform a lot worse than it should. I do expect pure java to run faster in the end. On Apr 1, 10:49 pm, Stuart Sierra wrote: > On Apr 1, 9:40 pm, Dmitri wrote: > &g

Re: speed question

2009-04-01 Thread Dmitri
kes that would cause it to perform a lot worse than it should. I do expect pure java to run faster in the end. On Apr 1, 10:49 pm, Stuart Sierra wrote: > On Apr 1, 9:40 pm, Dmitri wrote: > > > I've been playing around with rendering a mandelbrot set, and using > > pure ja

Re: speed question

2009-04-01 Thread Dmitri
I actually tried forcing the type hints and didn't really see a noticeable improvement, just made the code hard to read for the most part. On Apr 1, 9:57 pm, CuppoJava wrote: > From a quick glance, I think the lack of type hints is what's slowing > down your Clojure code. > You can set the globa

speed question

2009-04-01 Thread Dmitri
I've been playing around with rendering a mandelbrot set, and using pure java it renders about 2 seconds on my machine, however it runs about 10 times as slow in clojure, I was curious if I'm doing anything obviously wrong, or if it's just life :) I do run it with the -server flag, which does impr

is there a replace-at function

2009-01-25 Thread Dmitri
I ran into a situation where I needed to replace an element in a collection at a specific position, I ended up writing the following: (defn replace-at [coll pos value] "replaces an element in collection at pos with the value" (let [parts (split-at pos coll)] (concat (first parts) (cons va

Re: sort behavior question

2009-01-08 Thread Dmitri
I think the main issue is that sort should behave consistently. Possibly sort could check if the elements implement Comparable before attempting to sort them? I also don't see a reason as to why the lists shouldn't implement Comparable. On Jan 8, 4:17 pm, "Mark Engelberg" wrote: > Lists are not

Re: sort behavior question

2009-01-08 Thread Dmitri
n Jan 8, 2:11 pm, "Stephen C. Gilardi" wrote: > On Jan 8, 2009, at 1:55 PM, Dmitri wrote: > > > There are two issues here that I'm seeing, first is that the list and > > vector have different behavior, my understanding is that they are both > > sequences and

Re: sort behavior question

2009-01-08 Thread Dmitri
There are two issues here that I'm seeing, first is that the list and vector have different behavior, my understanding is that they are both sequences and one should be able to perform the same operations on them. Second issue is that the behavior is inconsistent, if it is not possible to sort tu

sort behavior question

2009-01-07 Thread Dmitri
I noticed strange behavior in the sort function, I was sorting key value tuples and ran into the following: when sorting 2 item vectors such as [1 [1 2 3]] sort works fine: (println (sort (map (fn [x] [(int (* (Math/random) 10)) x]) (for [x (range 4)] [1 2 3] output: (

Re: performance question

2008-12-13 Thread Dmitri
thanks for pointing this out, and I absolutely appreciate the example. I'm still new to functional approach and I always like to see how things are done properly. On Dec 13, 1:15 pm, Chouser wrote: > On Sat, Dec 13, 2008 at 10:41 AM, Dmitri wrote: > > > I wrote a simple word

Re: performance question

2008-12-13 Thread Dmitri
Now, obviously I could just use the mutable java hash map, but I'm curious if there's a functional approach which would be efficient. On Dec 13, 12:38 pm, Jeremy Dunck wrote: > On Dec 13, 9:41 am, Dmitri wrote: > ... > > > The slowdown seems to occur in the inc-count > &

Re: performance question

2008-12-13 Thread Dmitri
I added the time call later on to find what was taking up the cycles, I also checked the reverse, it's impact is minimal, the print-words part of the program runs fast, but the read-words takes the majority of the time. On Dec 13, 12:38 pm, Jeremy Dunck wrote: > On Dec 13, 9:41 am

performance question

2008-12-13 Thread Dmitri
I wrote a simple word counter described here http://ptrace.fefe.de/wp/ it reads stdin and counts the occurrences of words, however I notice that it runs significantly slower than the java version in the link. I was wondering why there is such a dramatic difference. The approach I took was to crea

Re: infix operators

2008-11-30 Thread Dmitri
I agree that the consistency that the s-expressions provide is valuable, and hence it would be counter productive to allow different kinds of syntax. However, it makes sense to have an explicit way to do infix notation. As Johan points out above, Haskell has a very elegant way of infixing function

Re: infix operators

2008-11-30 Thread Dmitri
Thanks for the example, the macro is exactly the solution was looking for. On Nov 30, 1:11 am, Jeff Bester <[EMAIL PROTECTED]> wrote: > On Nov 28, 11:11 pm, Dmitri <[EMAIL PROTECTED]> wrote: > > > Thanks for the comments, the prefix notation may indeed be something >

Re: infix operators

2008-11-28 Thread Dmitri
Thanks for the comments, the prefix notation may indeed be something that one gets used to. I find it just fine for most cases, just not for mathematical expressions. The example function was not meant as a complete solution, but rather as an example of how trivial it is to switch between the two

infix operators

2008-11-28 Thread Dmitri
First of I'd like to say that I find Clojure to be an excellent language, however I find the lack of infix operators makes reading equations somewhat unnatural, eg: (+ (- (* x x) (* y y)) a) I ended up writing a simple function to handle infix notation (defn infix [arg1 func arg2 & args] (l

Re: Clojure, Emacs and Slime on Windows

2008-11-11 Thread Dmitri P
Does your clojure.bat start from command line without errors? On Nov 11, 10:21 am, "Kyle R. Burton" <[EMAIL PROTECTED]> wrote: > I've followed the straightforward instructions that BC put together: > > http://bc.tech.coop/blog/081023.html > > It worked flawlessly under Linux. I have lispbox in

Re: What Windows IDE are you using?

2008-10-15 Thread Dmitri P
I followed Hans's instructions and was able to use compojure's repl script as swank-clojure-binary. Also, I don't use jline on windows because cmd provides sufficient editing facilities. I found that swing JFrame displayed through setVisible hangs slime, it probably needs a thread wrapper. On Oc

"if" small syntax change proposal

2008-10-09 Thread Dmitri P
Allow cond-like specification of expression pairs and allow odd number of expressions. Let odd expressions in last position serve as default return value. There will be no impact on previous reading/writing of "if". Stolen from Paul Graham's Arc. (defmacro myif ([x] x) ([x y] (if

Re: Clojure Poll 09/2008

2008-09-12 Thread Dmitri P
Doing: learning, deciding whether clojure is appropriate for my company projects Would like: 1) up to date documentation. Online docs are so far behind SVN it's not funny. Yes yes, SVN is not release, but in the beginning stages of the project as it is things happen very fast and sticking with re

Re: Bug: self require -> stack overflow

2008-09-09 Thread Dmitri P
Whatever you do, don't kill Clojure while trying to save us from ourselves. --~--~-~--~~~---~--~~ 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 To unsubscrib