Re: Clojure and Python Flask

2021-01-09 Thread alexandr...@gmail.com
This shouldn't be a problem - you can send all Flask responses as JSON and it will work fine in CLJS. >From Flask, have a look at https://stackoverflow.com/questions/13081532/return-json-response-from-flask-view In Clojurescript, use for instance https://github.com/r0man/cljs-http to read the

Re: Update multiple values in vector at once

2015-03-30 Thread Alexandr
; On 30 March 2015 at 20:05, Alexandr > > wrote: > >> Hello everybody, >> >> How can I update values in the vector given vector of id-s and new values? >> >> For example >> >> (defn upd-vec [input-vector ids new-values] >> >> ) &g

Update multiple values in vector at once

2015-03-30 Thread Alexandr
Hello everybody, How can I update values in the vector given vector of id-s and new values? For example (defn upd-vec [input-vector ids new-values] ) (upd-vec [0 0 0 0 0] [1 3] [1.44 1.45]) Output: [0 1.44 0 1.45 0] (1st and 3rd elements are replaced) -- You received this message beca

Sequential processing of the data

2014-08-02 Thread Alexandr M.
Hello everyone, I have started learning Clojure recently. Could you please point me out what is the best way to replicate the next Python script in Clojure: https://gist.github.com/alexvmblog/a3e3bfffa732ca3d3738#file-seqprocess-py Quite frequently I have this kind of tasks when it's needed to

What's your testing flow with the current clj tools?

2014-01-24 Thread Alexandr Kurilin
re effective, or if I can make this a bit simpler and less manual. Tips would be greatly welcome. Cheers! -- Alexandr Kurilin 206.687.8740 | @alex_kurilin <https://twitter.com/alex_kurilin> | blog<http://www.kurilin.net> -- -- You received this message because you are subscribed

Re: clojure debugging repl

2014-01-24 Thread Alexandr Kurilin
(defn foo [] >>>> ... >>>> (throw (ex-data ...)) >>>> ...) >>>> >>>> I instead do: >>>> >>>> (defn foo [] >>>> ... >>>> (something-went-wrong-please-fire-up-a-repl) >>>>

Re: Adding query customization to Ring-based REST APIs

2014-01-21 Thread Alexandr Kurilin
gt; or datomic util > namespace<https://github.com/ITEdge/service-hub/blob/master/persistence-datomic/src/itedge/service_hub/persistence_datomic/util.clj> > . > There are also some examples of such CRUD based web-services in project > service-hub-examples <https://github.com/I

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

2014-01-20 Thread Alexandr Kurilin
roups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- Alexandr Kurilin 206.687.8740 | @alex_kurilin <https:/

Re: Managing role-based permissions in Ring apps

2014-01-13 Thread Alexandr Kurilin
scr...@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 unsubscribe from this group and stop receiving

Adding query customization to Ring-based REST APIs

2014-01-12 Thread Alexandr Kurilin
I'm investigating adding query options to my Ring app's GET requests for the more boring CRUD routes. I'd like to allow the caller to specify a set of SQL-level query customizations such as sorting, paging, counting, distinct ons, limits, some basic constraints etc. across all of my resources, ide

Managing role-based permissions in Ring apps

2014-01-12 Thread Alexandr Kurilin
My Ring app is undergoing growing pains: I think I need some kind of abstraction for managing user permissions when working with my RDBMS. Our system has few user roles and they all own or have rights to a bunch of data in a hierarchical fashion e.g. admin > manager > employee etc. So far I've got

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

2014-01-07 Thread Alexandr Kurilin
rom this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- Alexandr Kurilin 206.687.8740 | @alex_kurilin <https://twitter.com/alex_kurilin> | blog<http://www.kurilin.net&

Re: [ANN] quickie- autotest plugin for clojure.test

2013-09-13 Thread Alexandr Kurilin
uot; 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

Re: Functional purity and "globals" in Clojure

2013-09-11 Thread Alexandr Kurilin
e. Just create as many differently-configured > > >> instances as you like. > > >> > > >> The main downside, of course, is that you need to be thoughtful and > do a > > >> bit more work in designing the constructor function. But I think > that

Functional purity and "globals" in Clojure

2013-09-10 Thread Alexandr Kurilin
I'm trying to determine how to best deal with the concept of globals in Clojure. Say I have a map of configuration values for my Ring app, populate at app startup from disk or env, and I need to reference the contents of this map from all over the project. Assuming MVC, models and controllers a

Re: new ClojureDocs experiment

2013-09-08 Thread Alexandr Kurilin
I use clojuredocs daily and would definitely benefit from it being as up-to-date as possible. I wasn't even aware of those two macros you listed, which is a bummer and a good indication that a replacement might be warranted. I'd be happy to use your wiki as a day-to-day reference, or we can som

How do you configure your Ring apps?

2013-09-07 Thread Alexandr Kurilin
I'm curious to find out how you folks decided to organize configuration for your Ring applications, assuming you also use configuration management like Puppet/Ansiblet etc to deploy them. So far I've been using a combination of daemontools' envdir (through runit) + weavejester's environ

Re: Introducing a new SQL migration library for clojure / jdbc

2013-09-07 Thread Alexandr Kurilin
This is great, thanks for making it. There was nothing quite like that I could find back when I started on our web app, so I ended using standalone_migrations, which is essentially ActiveRecord's Migration module extracted for standalone use. Rig

Re: [ANN] Blackwater 0.0.5 released (SQL query logging)

2013-09-07 Thread Alexandr Kurilin
This is awesome, thanks for making it, will try to integrate it asap. I'm not a Korma user, so it'll be good to see how well it plays with clojure jdbc. Just to confirm, is the recommendation to use this only at development time? It's been a while since Rails and I don't recall if they turn off

Re: "Clojure in the Large" style JDBC library

2013-09-07 Thread Alexandr Kurilin
I've been using clojure.java.jdbc for a while and have been able to get away with the query and execute! functions for most of the work, frequently wrapping them with transactions. All three, from what I recall, give you the option of either using an open connection (very useful for transaction

Re: Model validation - exceptions as side-effects?

2013-08-17 Thread Alexandr Kurilin
tion would just need a little bit more > code to simulate the behaviour above. > > [1]: https://github.com/clojure/core.match > > Leonardo Borges > www.leonardoborges.com > > > On Sat, Aug 17, 2013 at 12:08 PM, Alexandr Kurilin > > > wrote: > >> Let'

Model validation - exceptions as side-effects?

2013-08-16 Thread Alexandr Kurilin
Let's hypothetically say I have a Ring application and I'm performing some validation on the input map I receive as part of a POST request. The validate function throws an exception if anything's wrong with the input. The exception is caught in the middleware and turned into a 400 code response

Re: ExceptionInInitializerError in clojure.main in every clojure lein project.

2013-06-01 Thread Alexandr Kurilin
Answering myself on this one, thanks to hiredman from #clojure. The 1.5.1 clojure jar was somehow broken, nuking the folder and letting leiningen re-fetch it fixed it. On Saturday, June 1, 2013 11:11:41 AM UTC-7, Alexandr Kurilin wrote: > > Hello folks, > > I'm wondering if

ExceptionInInitializerError in clojure.main in every clojure lein project.

2013-06-01 Thread Alexandr Kurilin
Hello folks, I'm wondering if someone out there might have encountered this problem before. I'm not sure when exactly it started, perhaps 2-3 days ago, but ever since I have not been able to run neither "lein repl" nor "lein ring server[-headless]" on this machine on any of my leiningen-created