Re: ring - setting no-cache for everything?

2015-06-19 Thread Colin Yates
/making-sure-a-web-page-is-not-cached-across-all-browsers), or if this is just for development, then Chrome at least has a checkbox in the developer tools for disabling caching. - James On 19 June 2015 at 10:00, Colin Yates colin.ya...@gmail.com mailto:colin.ya...@gmail.com wrote: Hi all

ring - setting no-cache for everything?

2015-06-19 Thread Colin Yates
Hi all, is there a quick way to disable caching for everything or alternatively hash based on the contents of the resource. I am talking specifically about CSS and javascript issues served from the JAR's class path? -- You received this message because you are subscribed to the Google Groups

Re: 1.7.0b2, lein, cljc and tests

2015-06-19 Thread Colin Yates
/leiningen/blob/master/src/leiningen/test.clj#L137 https://github.com/technomancy/leiningen/blob/master/src/leiningen/test.clj#L137 On Friday, June 19, 2015 at 8:41:49 AM UTC-5, Colin Yates wrote: First - cljc is (for me) a huge upgrade over cljx, which was a great solution. Not having to run

Re: 1.7.0b2, lein, cljc and tests

2015-06-19 Thread Colin Yates
/leiningen/test.clj#L137 On Friday, June 19, 2015 at 8:41:49 AM UTC-5, Colin Yates wrote: First - cljc is (for me) a huge upgrade over cljx, which was a great solution. Not having to run lein clix auto every time I do a clean is far more useful than I realised. The problem I am having

Re: protocol names - community standards

2015-06-16 Thread Colin Yates
I name all of my protocols as active very in the first tense/descriptions of what they do. Rather than ‘Find’ I would have ‘IFindThings’. It takes a bit of getting used to and it was a suggestion in something I read a while ago (one of Steve Yeggies’ posts maybe?) but it really makes you think,

Re: Question regarding java array

2015-06-11 Thread Colin Yates
Lesson learned here for me is that only use java array when absolutely necessary. I always thought since it's primitive array, it should be the fastest. Apparently not! This bears repeating. I often find it hit-and-miss to know when idiomatic Clojure will be faster than turning to Java. Are

Re: Question regarding java array

2015-06-10 Thread Colin Yates
Will guess in the dark but would boxing come into play here? On 10 Jun 2015, at 21:03, Ritchie Cai ritchie...@gmail.com wrote: I'm working on a java array of double with 128 elements. I need the max and min values of the array. So I initially tried areduce and loop, both gives runs

Re: Advice when running java -jar rather than a managed server like tomcat?

2015-06-01 Thread Colin Yates
I recall seeing that from a while ago - weren’t they planning on rewriting emacs effectively? On 1 Jun 2015, at 15:55, Mikhail Malchevskiy malch...@gmail.com wrote: https://github.com/syl20bnr/spacemacs =) понедельник, 1 июня 2015 г., 17:05:35 UTC+3 пользователь Colin Yates написал: Hi

Re: Advice when running java -jar rather than a managed server like tomcat?

2015-06-01 Thread Colin Yates
ride using nginx as reverse proxy and running the uberjar inside tmux. No other special sauce needed, plus you get the benefit of using nginx to serve your static assets (if there're not on a CDN already)... On 1 June 2015 at 14:40, Colin Yates colin.ya...@gmail.com wrote: Thanks Daniel, I

Re: Advice when running java -jar rather than a managed server like tomcat?

2015-06-01 Thread Colin Yates
is a Unix classic (as in an outstanding example of a particular style), and Boot is quickly becoming a Clojure classic. More examples here: https://github.com/danielsz/system/blob/master/examples/boot/build.boot On Tuesday, May 26, 2015 at 2:38:30 PM UTC+3, Colin Yates wrote: Hi, I am

Re: Project structure when using reader conditionals

2015-05-29 Thread Colin Yates
. https://github.com/Skinney/oslo-programmene/blob/development/project.clj fredag 29. mai 2015 11.17.25 UTC+2 skrev Colin Yates følgende: In the vein of there are no stupid questions :), how does one structure a combined clj and cljs project that uses reader conditionals? At the moment I am

Project structure when using reader conditionals

2015-05-29 Thread Colin Yates
In the vein of there are no stupid questions :), how does one structure a combined clj and cljs project that uses reader conditionals? At the moment I am using cljx and have: - src/clj for clojure files - src/cljs for clojurescript files - src/cljx for cljx - target/cljx/clj for clojure

Re: Advice when running java -jar rather than a managed server like tomcat?

2015-05-27 Thread Colin Yates
Thanks Stuart. On 27 May 2015, at 08:53, Stuart Sierra the.stuart.sie...@gmail.com wrote: JSVC (Apache Commons daemon for Unix) is excellent for this sort of thing. There's a Windows Services version too. –S On Tuesday, May 26, 2015 at 12:38:30 PM UTC+1, Colin Yates wrote: Hi, I am

Advice when running java -jar rather than a managed server like tomcat?

2015-05-26 Thread Colin Yates
Hi, I am venturing into new territory using http-kit, as I usually use a 'managed' web server container like tomcat and have a few questions about packing and running a JAR file: - are there are convenient service wrappers for windows and/or Linux - any best practice around managing class

lein uberjar with prep tasks of cljx once, garden once and cljsbuild once loops forever

2015-05-26 Thread Colin Yates
This looks similar to https://github.com/lynaghk/cljx/issues/60 but I am running 0.6.0. I have tried lein do clean, cljx once, garden once, cljsbuild once, uberjar but uberjar seems to clear the target directory thus making the previous tasks pointless. Any suggestions or pointers which are

Re: Advice when running java -jar rather than a managed server like tomcat?

2015-05-26 Thread Colin Yates
with little fuss. I use InnoSetup to create a windows installer. For the runtime class path, I just use something like, java -cp conf;myuberjar.jar mypackage.main On Tue, May 26, 2015 at 12:38 PM, Colin Yates colin.ya...@gmail.com wrote: Hi, I am venturing into new territory using http-kit, as I

Re: clarity on binding and thread local

2015-05-26 Thread Colin Yates
experience, I am relatively new to Clojure, but I read a lot of Clojure code at this point. On Saturday, May 23, 2015 at 6:16:15 AM UTC-4, Colin Yates wrote: Hi, My use-case is that I need to have a bunch of state which differs for each (web) request but is accessible via a var. Specifically

Re: Advice when running java -jar rather than a managed server like tomcat?

2015-05-26 Thread Colin Yates
/configuration.html http://logback.qos.ch/manual/configuration.html. BR -- Henrik On Tue, May 26, 2015 at 1:38 PM, Colin Yates colin.ya...@gmail.com mailto:colin.ya...@gmail.com wrote: Hi, I am venturing into new territory using http-kit, as I usually use a 'managed' web server

clarity on binding and thread local

2015-05-23 Thread Colin Yates
Hi, My use-case is that I need to have a bunch of state which differs for each (web) request but is accessible via a var. Specifically I need to allow code to access the current transaction and register one or callbacks that are executed if/after that transaction is committed. In Java I would

Re: Using @ alone

2015-05-21 Thread Colin Yates
Yes, exactly. In my previous email I incorrectly said '() was a set. On 21 May 2015 01:07, Pierre Thibault pierre.thibau...@gmail.com wrote: No: (type '()) clojure.lang.PersistentList$EmptyList It a list just like it should be. Le mercredi 20 mai 2015 20:02:22 UTC-4, Colin Yates a écrit

Re: Using @ alone

2015-05-20 Thread Colin Yates
@my-atom is the same as (deref my-atom), is that what you mean? On 20 May 2015 23:35, Pierre Thibault pierre.thibau...@gmail.com wrote: Is possible to use the operator '@' alone? In the Joy Of Clojure book it is presented as '~@'. I would like an example. -- You received this message because

Re: Using @ alone

2015-05-20 Thread Colin Yates
construct. On 20 May 2015 23:43, Pierre Thibault pierre.thibau...@gmail.com wrote: For example: (def foo '(1 2 3)) (+ @foo) Does not work. I am expecting 6. Le mercredi 20 mai 2015 18:37:05 UTC-4, Colin Yates a écrit : @my-atom is the same as (deref my-atom), is that what you mean? On 20 May

Re: Using @ alone

2015-05-20 Thread Colin Yates
a temperal construct. On 20 May 2015 23:43, Pierre Thibault pierre.t...@gmail.com wrote: For example: (def foo '(1 2 3)) (+ @foo) Does not work. I am expecting 6. Le mercredi 20 mai 2015 18:37:05 UTC-4, Colin Yates a écrit : @my-atom is the same as (deref my-atom), is that what you mean

Re: Using :refer 'sparingly'

2015-05-17 Thread Colin Yates
As stated in the article, I find the extra context of using :as aids maintenance more than you might expect. The only time I use refer is if the referred vars are conceptually owned, or the context is implicit by the name space using them. For me it is about responsibility and ignorance. :as

Re: separation of concerns w/o encapsulation

2015-05-14 Thread Colin Yates
I guess a related concern is abstraction. I notice I often have functions which work at different levels of abstraction in the same ns which makes me uncomfortable. In OO land they would be package level or even instance classes. I haven't yet found a way to solve this in clojure land. To be

Re: Why does the following Clojure code take 10x the time the C# version does? How to improve the Clojure version?

2015-05-14 Thread Colin Yates
Probably not helpful, but I tend to rely on the jvm optimisations and just -server. I figured this is an area where a little knowledge is a dangerous thing. At the very least I would have a realistic benchmark suite to prove to myself that these gains were worth it. In my experience the

Re: Why does the following Clojure code take 10x the time the C# version does? How to improve the Clojure version?

2015-05-14 Thread Colin Yates
it was a non-issue at this point. Is that incorrect? On Thu, May 14, 2015 at 1:54 PM, Colin Yates colin.ya...@gmail.com wrote: Probably not helpful, but I tend to rely on the jvm optimisations and just -server. I figured this is an area where a little knowledge is a dangerous thing

Re: separation of concerns w/o encapsulation

2015-05-14 Thread Colin Yates
That assumes the intermediate functions are reusable. I guess with all these things asthetics come into play, and there is of course the option of letfn as well. On 14 May 2015 18:40, Sean Corfield s...@corfield.org wrote: On May 14, 2015, at 10:28 AM, Colin Yates colin.ya...@gmail.com wrote

Managing database schema

2015-05-14 Thread Colin Yates
Is there a lib that will allow me to have my sql defined in a file which I can reference from Clojure? I cannot use one of the existing migration libraries as I need to do more than just manipulate SQL on a version upgrade. I am aware of yesql which would be great but it didn't work out for

Re: Managing database schema

2015-05-14 Thread Colin Yates
, Colin Yates colin.ya...@gmail.com wrote: Is there a lib that will allow me to have my sql defined in a file which I can reference from Clojure? I cannot use one of the existing migration libraries as I need to do more than just manipulate SQL on a version upgrade. I am aware of yesql which

Re: Why (defn- ...) but (def ^:private? ...)

2015-05-07 Thread Colin Yates
Have you tried with-meta? On 7 May 2015 15:13, Stig Brautaset sbrauta...@gmail.com wrote: Is it because the def form can also be ^:dynamic? At any rate, I did an attempt at my first macro to create a (def- ...) form, but it doesn't seem to work. Can you not attach metadata in a macro?

Re: Clojure needs a web framework with more momentum

2015-05-03 Thread Colin Yates
Clojure + developer's skill + existing libraries + custom code is the framework. On 3 May 2015 15:27, Fluid Dynamics a2093...@trbvm.com wrote: On Sunday, May 3, 2015 at 2:12:02 AM UTC-4, Sven Richter wrote: Hi, Reading through all the discussion I don't get which features you are actually

Re: Any chance of a module system being added to the language?

2015-04-13 Thread Colin Yates
Ok, thanks Mark. On 13 Apr 2015 06:37, Mark Derricutt m...@talios.com wrote: On 3 Apr 2015, at 3:14, Colin Yates wrote: Do you have any references to OSGi and Clojure? My fork of clojure.osgi is updated for 1.6 and in Maven Central: https://github.com/talios/clojure.osgi and a simple

Re: How to to watch changed files and run tests again automatic

2015-04-09 Thread Colin Yates
Lein-test-refresh works well On 9 Apr 2015 14:55, Denis L sad.ho...@gmail.com wrote: I use Rspec/Guard to watch changed files and automatic run test for for Ruby/Rails application. How can I repeat similar scenario for Clojure-app? -- You received this message because you are subscribed to

Re: [ANN] Clojure Applied: From Practice to Practitioner

2015-04-08 Thread Colin Yates
Well done- just purchased and looking forward to read this tonight. Sent from my iPhone On 8 Apr 2015, at 14:27, Alex Miller a...@puredanger.com wrote: Hey all, I'm very happy to announce that Clojure Applied is now available in beta: https://pragprog.com/book/vmclojeco/clojure-applied

lein checkout dependencies with cljx project

2015-04-04 Thread Colin Yates
Hi, I have a common library which I want to use in both Clojure and ClojureScript. The project uses cljx and works a treat and the generated clj and cljs are available to use alongside the hard coded clj and cljs. However, when I add that project (after doing the initial lein install) to the

Re: Any chance of a module system being added to the language?

2015-04-02 Thread Colin Yates
Do you have any references to OSGi and Clojure? On 2 April 2015 at 15:11, Alex Miller a...@puredanger.com wrote: It's possible we could make use of Java's module system if it ever actually gets released in Java 9. While I followed it pretty extensively when they first started discussing it (7

Re: clojure, not the go to for data science

2015-03-31 Thread Colin Yates
Ha! Genius. On 30 March 2015 at 19:47, danle...@gmail.com danle...@gmail.com wrote: http://www.scribd.com/doc/30605092/Saturn-v-Flight-Manual I have tracked down the flight manual of the Saturn-V rocket so we can objectively decide whether emacs is more, or less, difficult. -- You

Re: clojure, not the go to for data science

2015-03-31 Thread Colin Yates
me own emacs-based-editor - sure :). I had better stop thinking about emacs as it is feeding my ever-present 'grass is greener' gene On 31 March 2015 at 10:54, Phillip Lord phillip.l...@newcastle.ac.uk wrote: Alexis flexibe...@gmail.com writes: Colin Yates colin.ya...@gmail.com writes: I

Re: clojure, not the go to for data science

2015-03-31 Thread Colin Yates
This. I am amazed it isn't more widely shouted about. On Sunday, 29 March 2015 12:34:23 UTC+1, Jony Hudson wrote: First, let me shamelessly plug Gorilla REPL http://gorilla-repl.org . It's a notebook type REPL, which I think works well as an environment for the sort exploratory programming

Re: clojure, not the go to for data science

2015-03-30 Thread Colin Yates
For me personally, I absolutely admire emacs - I really do. I used it a few years back when I first started in Clojure before Cursive was around and when it was configured correctly it was absolutely great. From an engineering POV, yeah, it rocks. I am sure that for anything I can do in IDE-X I

Re: clojure, not the go to for data science

2015-03-29 Thread Colin Yates
I assumed his reference to emacs covered CIDER - don't be so sensitive :). On 29 March 2015 at 15:14, Bozhidar Batsov bozhi...@batsov.com wrote: And CIDER isn't, right? I find this pretty insulting... On 29 March 2015 at 13:47, Colin Yates colin.ya...@gmail.com wrote: Cursive Clojure

Re: clojure, not the go to for data science

2015-03-29 Thread Colin Yates
Cursive Clojure, LightTable and CounterClockwise are all good Clojure IDEs. On 29 March 2015 at 09:54, Sayth Renshaw flebber.c...@gmail.com wrote: Hi I last learned clojure in 1.2. Just curious why Clojure hasn't developed as a go to for data science? It never seems to get a mention

Re: [ANN][book] Clojure Reactive Programming

2015-03-26 Thread Colin Yates
Luc, you are missing the point: this isn't the forum for that discussion regardless of how valid the points in that discussion are. This is a _Clojure_ forum, not a 'what's wrong with the (technology) world' forum, I would suggest this isn't even a 'how can Clojure fix the world' forum. Luc,

Re: [ANN][book] Clojure Reactive Programming

2015-03-26 Thread Colin Yates
Hi Leonardo, I haven't read it yet but I am very much looking forward to it based on other people's responses :). On 26 March 2015 at 15:52, Leonardo Borges leonardoborges...@gmail.com wrote: Thanks everyone for the kind words! It makes it all worth it :) Cheers, Leonardo On Thursday,

Re: [ANN][book] Clojure Reactive Programming

2015-03-25 Thread Colin Yates
No - he is right, we just don't say it! Obviously I am kidding :). On 25 March 2015 at 11:51, Hildeberto Mendonça m...@hildeberto.com wrote: On Wed, Mar 25, 2015 at 12:14 PM, Colin Yates colin.ya...@gmail.com wrote: Hi Shahrdad, just a point of etiquette, inferring that an architect

Re: [ANN][book] Clojure Reactive Programming

2015-03-25 Thread Colin Yates
to be that hard. Clojure is the first real try in opposite direction (touch of genius) Thanks a lot Best regards Shahrdad On Wed, Mar 25, 2015 at 8:06 AM, Colin Yates colin.ya...@gmail.com wrote: No - he is right, we just don't say it! Obviously I am kidding :). On 25 March 2015 at 11:51

Re: [ANN][book] Clojure Reactive Programming

2015-03-25 Thread Colin Yates
Hi Shahrdad, just a point of etiquette, inferring that an architect is ignorant because they chose Java8, Akka and play is full of assumptions. Calling those technologies pathetic is very bad poor. As I like to quote Any intelligent fool can make things bigger and more complex... It takes rude

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread Colin Yates
If there are enough optional args that they need to be named then I choose a map, every time. That said, I do must multi-arity fns quite a bunch as well (with the options map going on the end if applicable). I also depend quite heavily on prismatic's schema, and to a lesser extent core.typed and

Re: about binding and dynamic vars

2015-03-21 Thread Colin Yates
http://stuartsierra.com/2013/03/29/perils-of-dynamic-scope is a good read around this subject. On 21 March 2015 at 21:47, coco clasesparticulares...@gmail.com wrote: Hi guys, I'm curious about how work some codes with binding and dynamics vars, for instance, in sqlkorma you define your db

Re: Macro Help with Symbols and Evaluation

2015-03-19 Thread Colin Yates
I don't have the answer (as I too am in the still-going-blind phase) but the following might help: - deref symbols to get their value - http://learnxinyminutes.com/docs/clojure-macros/ (short and very helpful) - http://www.braveclojure.com/writing-macros/ (long and very helpful) -

Re: Composing Stuart Sierra's components

2015-03-17 Thread Colin Yates
Hi James, Do you have a code fragment/gist for the glue? On 17 March 2015 at 17:47, James Gatannah james.gatan...@gmail.com wrote: On Thursday, March 12, 2015 at 10:16:10 AM UTC-5, Stuart Sierra wrote: On Wednesday, March 11, 2015, Colin Yates wrote: Nested systems don't really work

Re: How do I access components of a system map

2015-03-16 Thread Colin Yates
help, Torsten. Am Sonntag, 15. März 2015 19:15:04 UTC+1 schrieb Colin Yates: If you haven't already then you might want to watch: https://www.youtube.com/watch?v=13cmHf_kt-Q If it helps: (defn a-real-worker [db] ...) (defrecord ARealWorkerComponent [db registry] components

Re: How do I access components of a system map

2015-03-15 Thread Colin Yates
Hi Torsten, It works best when it is all-or-nothing, so the caller of get-user would itself be a component that is dependant upon the db component. The way I visualise it is that the components are a very thin layer at the outer edge of the system that delegate to actual worker functions. Those

Re: Easier Idempotent Component Lifecycles?

2015-03-15 Thread Colin Yates
In OO we tend to solve the 'copy and paste' problem with abstract classes. In Clojure we also have macros, easily overused, sure, but worth knowing about. They turn the problem on its head and allow truly composable functionality. I am not stating they _are_ appropriate here, only that you might

Re: Easier Idempotent Component Lifecycles?

2015-03-15 Thread Colin Yates
itself. The big weakness is that it would require using a custom start-system stop-system function rather than the standard one. Andrew Oberstar On Sun, Mar 15, 2015 at 11:32 AM Colin Yates colin.ya...@gmail.com wrote: In OO we tend to solve the 'copy and paste' problem with abstract classes

Re: How do I access components of a system map

2015-03-15 Thread Colin Yates
If you haven't already then you might want to watch: https://www.youtube.com/watch?v=13cmHf_kt-Q If it helps: (defn a-real-worker [db] ...) (defrecord ARealWorkerComponent [db registry] components/Lifecycle (start [this] (registry-api/register registry (partial a-real-worker-fn db))

Re: Easier Idempotent Component Lifecycles?

2015-03-15 Thread Colin Yates
. I'll give that a go along with a few other ideas, and see what works out best. Thanks for the help! Andrew Oberstar On Sun, Mar 15, 2015 at 1:22 PM Colin Yates colin.ya...@gmail.com wrote: I don't have one at hand (as I literally wrote my first macro last week ;)) but the way it could

defmacro help

2015-03-13 Thread Colin Yates
Hi, I am wiring up a bunch of CRUD command handlers for different aggregates using prismatic schema to validate and it is screaming out for a macro, but my ignorance is screaming even louder :). The form I want to emit is something like (for a 'Location' for example): (s/defn

Re: defmacro help

2015-03-13 Thread Colin Yates
? On Friday, 13 March 2015 12:27:02 UTC, Colin Yates wrote: Hi, I am wiring up a bunch of CRUD command handlers for different aggregates using prismatic schema to validate and it is screaming out for a macro, but my ignorance is screaming even louder :). The form I want to emit is something like

Re: defmacro help

2015-03-13 Thread Colin Yates
OK, so ~(symbol create) was what I needed to do but that now loses the ^:always-validate meta :).. On Friday, 13 March 2015 12:42:36 UTC, Colin Yates wrote: Nope, never mind - it was a dirty REPL. It works fine-ish. My next problem is that it works fine, but only if I call

Re: defmacro help

2015-03-13 Thread Colin Yates
Thanks Tobias. The complete macro body is now: (let [{:keys [hierarchy-key cascade-keys define-command-schema defined-event-schema define-command-key defined-event-key]} (default-options aggregate)] `(do

Re: Composing Stuart Sierra's components

2015-03-12 Thread Colin Yates
at 3:01 PM, Colin Yates colin...@gmail.com javascript: wrote: merge won't help as there will be name space clashes. I wonder if a more elegant approach would be to construct the 'inner' system and then assoc onto it the external dependencies it needs before calling start. On 11 March 2015

Re: Composing Stuart Sierra's components

2015-03-12 Thread Colin Yates
misunderstood your question; I didn't realize it was system (as opposed to any general component) specific. I think systems can be merged together (via 'merge'). Would that help? On Wednesday, March 11, 2015 at 2:40:14 PM UTC-4, Colin Yates wrote: Hi Adrian - I don't follow how that helps integrate two

Re: Composing Stuart Sierra's components

2015-03-12 Thread Colin Yates
...@gmail.com wrote: On Wednesday, March 11, 2015, Colin Yates wrote: I can't merge the two systems because the reusable component is chocka full of very fine grained command handlers and both the internal and external systems will have their own 'bus' for example. I could namespace the keys

Re: Composing Stuart Sierra's components

2015-03-11 Thread Colin Yates
as a value. On Wednesday, March 11, 2015 at 2:17:12 PM UTC-4, Colin Yates wrote: I have a non-trivial component which requires a bunch of internal and external collaborators to work. This component is itself re-usable. What I really want to do is have ReusableComponent be a component

Composing Stuart Sierra's components

2015-03-11 Thread Colin Yates
I have a non-trivial component which requires a bunch of internal and external collaborators to work. This component is itself re-usable. What I really want to do is have ReusableComponent be a component in a system so it can pull its external collaborators. However, ReusableComponent

Re: Om design query

2015-03-06 Thread Colin Yates
I know this is a different direction than a lot of people but I store everything in the app-state and so far it has worked well. There are a hundred reasons why this (storing everything in app-state) is a terrible idea, but I haven't run into any of them. The main driver for this was for bug

Re: Disk based caching for Clojure app

2015-03-06 Thread Colin Yates
You could build something on top memory mapped files. I did this to solve similar requirements with good effect. On 6 Mar 2015 18:55, JPatrick Davenport virmu...@gmail.com wrote: Hello, I'm been thinking about an idea for a cache layer. It's driven by two trends. Most caches are in memory.

Re: Idiomatic way to co-ordinate 'disconnected' services into a single transaction (ala Spring's @Transactional functionality)?

2015-03-05 Thread Colin Yates
the problems you raised that points in the direction of modeling and then executing the data flow, rather than relying solely on the call stack. On Thu, Mar 5, 2015 at 9:39 AM, Colin Yates colin.ya...@gmail.com wrote: Sounds interesting - are there are instances that I can look at? On 5 March

Re: Idiomatic way to co-ordinate 'disconnected' services into a single transaction (ala Spring's @Transactional functionality)?

2015-03-05 Thread Colin Yates
, rather to share another thought process around the problems you raised that points in the direction of modeling and then executing the data flow, rather than relying solely on the call stack. On Thu, Mar 5, 2015 at 9:39 AM, Colin Yates colin.ya...@gmail.com wrote: Sounds interesting

Re: clojure map to java instance of pojo class

2015-03-05 Thread Colin Yates
Isn't this exactly what defrecord does? On 5 March 2015 at 07:42, Xiangtao Zhou tao...@gmail.com wrote: hi all, is there some library or simple way to do it like the function map-to-pojo in the following code ? java code class A{ public int a; public String b; } clojure code (def

Re: Idiomatic way to co-ordinate 'disconnected' services into a single transaction (ala Spring's @Transactional functionality)?

2015-03-05 Thread Colin Yates
, Colin Yates colin.ya...@gmail.com wrote: Hi, I am looking for the Clojure equivalent of: class Whatever { @Transactional void doSomething(IDoSomething one, IDoSomethingElse two) { one.doSomething() two.doSomething() } } where both one and two are dependency

Re: Idiomatic way to co-ordinate 'disconnected' services into a single transaction (ala Spring's @Transactional functionality)?

2015-03-05 Thread Colin Yates
, while functions that deal with edge resources take those resources along with other parameters more explicitly, so the data flow can run in an insulated fashion. On Thu, Mar 5, 2015 at 8:55 AM, Colin Yates colin.ya...@gmail.com wrote: Hi Jonah, This sounds very much like the model layer

Idiomatic way to co-ordinate 'disconnected' services into a single transaction (ala Spring's @Transactional functionality)?

2015-03-04 Thread Colin Yates
Hi, I am looking for the Clojure equivalent of: class Whatever { @Transactional void doSomething(IDoSomething one, IDoSomethingElse two) { one.doSomething() two.doSomething() } } where both one and two are dependency injected with a proxy which resolves to a thread

Re: Idiomatic way to co-ordinate 'disconnected' services into a single transaction (ala Spring's @Transactional functionality)?

2015-03-04 Thread Colin Yates
March 2015 17:58:58 UTC, Colin Yates wrote: Hi, I am looking for the Clojure equivalent of: class Whatever { @Transactional void doSomething(IDoSomething one, IDoSomethingElse two) { one.doSomething() two.doSomething() } } where both one and two are dependency

Re: Any Lispers in South Devon, UK?

2015-03-04 Thread Colin Yates
Only if you promise to move up to Leicester :). On 4 March 2015 at 13:14, John Kane j...@kanej.me wrote: Hello Stephen, There is a small group of us based around Exeter and we are trying to get a group off the ground, is that close enough to be of interest? John On Tuesday, 3 March 2015

Re: Idiomatic way to co-ordinate 'disconnected' services into a single transaction (ala Spring's @Transactional functionality)?

2015-03-04 Thread Colin Yates
, possibly composed with other functions, and invoked elsewhere), I usually have a convention where I pass a map of options as an argument to the handler, and make the database a value in that map. On Wednesday, March 4, 2015 at 12:58:58 PM UTC-5, Colin Yates wrote: Hi, I am looking

Re: Idiomatic way to co-ordinate 'disconnected' services into a single transaction (ala Spring's @Transactional functionality)?

2015-03-04 Thread Colin Yates
of your transaction. On Wednesday, March 4, 2015 at 1:15:02 PM UTC-5, Colin Yates wrote: Hi Adrian, and thanks for replying. I understand your point, but the subtlety is that a transactional connection is per function invocation where as the database component is per Component lifecycle

Re: clj-uuid: time-based uuid now 350% faster than java.util.UUID/randomUUID

2015-03-03 Thread Colin Yates
Are v1 as unique as randomUUID()? On 3 Mar 2015 20:08, danle...@gmail.com danle...@gmail.com wrote: PS. We are now TEN TIMES faster, so it is a lot easier to compute that percentage: #'uuid/v1:201 nanoseconds #'java.util.UUID/randomUUID: 2012 nanoseconds Best, Dan

Re: clj-uuid: time-based uuid now 350% faster than java.util.UUID/randomUUID

2015-03-03 Thread Colin Yates
, 2015 at 3:11:23 PM UTC-5, Colin Yates wrote: Are v1 as unique as randomUUID()? On 3 Mar 2015 20:08, danl...@gmail.com danl...@gmail.com wrote: PS. We are now TEN TIMES faster, so it is a lot easier to compute that percentage: #'uuid/v1:201 nanoseconds #'java.util.UUID

Re: clj-uuid: time-based uuid now 350% faster than java.util.UUID/randomUUID

2015-03-03 Thread Colin Yates
Ha - the irony of you and I posting a message about uniqueness at pretty much the same time :). On 3 Mar 2015 20:11, Lucas Bradstreet lucasbradstr...@gmail.com wrote: Hi, Nice work! I wanted to clarify something: it seems to me that the v1 uuids clj-uuid generate are not exactly equivalent

Re: [ANN] lein-html5-docs-3.0.0

2015-03-02 Thread Colin Yates
And an example of its output would be nice :). The project is https://github.com/tsdh/lein-html5-docs I think. On 2 March 2015 at 20:49, Jeremy Heiler jeremyhei...@gmail.com wrote: Do you have a link to the project? :-) On Mon, Mar 2, 2015 at 3:26 PM, Tassilo Horn t...@gnu.org wrote: Hi all,

Re: idiomatic use of Stuart Sierra's component

2015-03-02 Thread Colin Yates
AM UTC-5, Colin Yates wrote: If I have a stateful thing with a lifecycle then is the system component the instance of the thing or a wrapper that contains the thing. For example, let's say I have a registry of clients that want to be polled then I might have the following: (defrecord Registry

Re: clj-uuid: time-based uuid now 350% faster than java.util.UUID/randomUUID

2015-03-02 Thread Colin Yates
Note - at least in chrome on OS X the link is broken as it terminates at the hype (http://danlentz.github.io/clj-). Great work despite the chrome breaking project name ;). On Monday, 2 March 2015 00:35:16 UTC, danl...@gmail.com wrote: Ok, for anyone following my adventures optimizing

Re: Breaking out of a sequence

2015-03-01 Thread Colin Yates
I would replace it with loop/recur or a while, with both checking a termination flag (probably an atom) which is set by the user. An alternative approach would be core.async with a stop channel and then use alt! to check them both simultaneously. On 1 Mar 2015 10:30, Cecil Westerhof

Re: Breaking out of a sequence

2015-03-01 Thread Colin Yates
to be a mess of unnecessary code. As Dr Eli Goldratt/TOC states: never say I know :). For example, I meant 'for/while' not 'while' :). On 1 March 2015 at 10:52, Cecil Westerhof cldwester...@gmail.com wrote: 2015-03-01 11:33 GMT+01:00 Colin Yates colin.ya...@gmail.com: I would replace it with loop/recur

Re: Breaking out of a sequence

2015-03-01 Thread Colin Yates
are invaluable. On Sunday, 1 March 2015 10:53:05 UTC, Cecil Westerhof wrote: 2015-03-01 11:33 GMT+01:00 Colin Yates colin...@gmail.com javascript:: I would replace it with loop/recur or a while, with both checking a termination flag (probably an atom) which is set by the user. ​I was just going

idiomatic use of Stuart Sierra's component

2015-03-01 Thread Colin Yates
If I have a stateful thing with a lifecycle then is the system component the instance of the thing or a wrapper that contains the thing. For example, let's say I have a registry of clients that want to be polled then I might have the following: (defrecord Registry [state]) (defn register-with

Re: should edn recognise defrecord?

2015-02-27 Thread Colin Yates
http://www.compoundtheory.com/clojure-edn-walkthrough/ is a nice read around this as well. On Tuesday, 24 February 2015 21:40:14 UTC, Colin Yates wrote: I am sending instances of defrecords from clojurescript via transmit/edn and getting: 2015-Feb-24 19:23:52 + dev-os-mbp.local DEBUG

Re:

2015-02-26 Thread Colin Yates
Hi Cecil - have you looked at hiccup? On 26 February 2015 at 19:39, Cecil Westerhof cldwester...@gmail.com wrote: At the moment I have the following code: (str html table border='1' cellpadding='10' style='font-family:Arial; font-size:16px; margin: 10px;width:100%'

Re:

2015-02-26 Thread Colin Yates
16px :margin 10px :width 100%}} [:tr (for [header headers] [:th {:bgcolor black :color white} header])]])) HTH. On Thursday, 26 February 2015 20:23:59 UTC, Cecil Westerhof wrote: 2015-02-26 20:46 GMT+01:00 Colin Yates colin...@gmail.com javascript:: Hi Cecil - have you

Idiomatic access to collaborators/services

2015-02-25 Thread Colin Yates
Hi, I ran into a bit of a brick wall when thinking about how to register to and dispatch to multiple micro-services and it made me realise the underlying tension came from not having peace about a fundamental design decision; how do you access your collaborators. Note: I am specifically

Re: defmethod inside of a (stuart sierra) component?

2015-02-25 Thread Colin Yates
). I'm using component a lot and I never had the need for this. Maybe you can elaborate on why you think you need a multimethod inside the component? Maybe a full example? Cheers, Jeroen On Wed, Feb 25, 2015 at 12:08 PM, Colin Yates colin.ya...@gmail.com wrote: Hi, I have a number

Re: defmethod inside of a (stuart sierra) component?

2015-02-25 Thread Colin Yates
). So: (defmulti handle-command(fn [component command] (first command))) (defmethod handle-command :add-customer [{:keys [db eventstore} [[_ customer]]] ... ) Isn't something like this enough? Jeroen On Wed, Feb 25, 2015 at 1:34 PM, Colin Yates colin.ya...@gmail.com wrote: Hi Jeroen

Re: defmethod inside of a (stuart sierra) component?

2015-02-25 Thread Colin Yates
, Jeroen On Wed, Feb 25, 2015 at 2:01 PM, Colin Yates colin.ya...@gmail.com wrote: Yes, I did consider that but didn't like the idea of passing the system around. Also handle-command would need access to the system as well. I am wondering whether simply having a 'registry' component which

Re: defmethod inside of a (stuart sierra) component?

2015-02-25 Thread Colin Yates
export-query [db pdf-generator] ...) ; Convenience function that pulls system from an atom (defn export-query [] (export-query (@system :db) (@system :pdf-generator))) (defmethod handle-command :export-query [[_]] (export-query)) marc On Wed, Feb 25, 2015 at 8:23 AM, Colin Yates

Re: Idiomatic access to collaborators/services

2015-02-25 Thread Colin Yates
the lifecycle idea from Stuart Sierra's component (maybe define IStoppable) for things that need shutdown, such as custom thread-pools. Shantanu On Wednesday, 25 February 2015 18:52:28 UTC+5:30, Colin Yates wrote: Hi, I ran into a bit of a brick wall when thinking about how to register

Re: Idiomatic access to collaborators/services

2015-02-25 Thread Colin Yates
; you can just change the queue/push function into a method on a protocol. Any code that uses queue/push will act the same, but now we have different behaviour depending on the configuration. - James On 25 February 2015 at 13:22, Colin Yates colin.ya...@gmail.com wrote: Hi, I ran

Re: should edn recognise defrecord?

2015-02-25 Thread Colin Yates
as a tagged literal (for edn compatibility). It’s only for the Clojure side at the moment, but I imagine it wouldn’t be hard to port to CLJS. However, I suggest that you use transit. https://github.com/miner/tagged On Feb 24, 2015, at 4:40 PM, Colin Yates colin...@gmail.com javascript: wrote

<    1   2   3   4   5   6   >