Re: using core.async results in page getting replaced with empty iframe

2015-08-20 Thread Malcolm Sparks
don't know how this could happen. On Wed, Aug 19, 2015 at 3:00 PM, Malcolm Sparks malc...@juxt.pro wrote: Would you mind pasting the rest of your dependencies? This is the most curious of puzzles and I'd love to know the answer - but I'm really stumped so please provide the next clue

Re: when the body of the request is HttpInputOverHTTP, how do I get the string representation?

2015-08-19 Thread Malcolm Sparks
If I were you, I would reach into my toolbox for https://github.com/ztellman/byte-streams - worth a try On Wednesday, 19 August 2015 20:57:57 UTC+1, Lawrence Krubner wrote: I know this has been asked before, but Google is interpreting HttpInputOverHTTP as Http Input Over HTTP which renders

Re: using core.async results in page getting replaced with empty iframe

2015-08-19 Thread Malcolm Sparks
Would you mind pasting the rest of your dependencies? This is the most curious of puzzles and I'd love to know the answer - but I'm really stumped so please provide the next clue! On Wednesday, 19 August 2015 19:32:22 UTC+1, Daniel Higginbotham wrote: I've found that using core.async in one

[ANN] iota - Infix operators for test assertions

2015-07-17 Thread Malcolm Sparks
I've been writing quite a lot of tests recently, with clojure.test I wrote a little macro to help. It means you could replace this : (require '[clojure.test :refer :all] '[schema.core :as s]) (deftest my-test (let [response ...] (is (= (:status response) 200)) (is (= (count

Re: [ANN] bidi 1.20.0 - with Schema suppport

2015-06-30 Thread Malcolm Sparks
at 11:47:00 AM UTC-4, Malcolm Sparks wrote: bidi is a routing library that lets you define the URI routes for your website as data. Until now, there has been no way to validate whether that data conforms to the expected structure. Not doing so can often lead to problems. I've just released

Re: Writing REST api the right way

2015-06-29 Thread Malcolm Sparks
yada exploits aleph's async model of returning futures and leverages manifold's ability to chain together futures and promises. This means you can effectively use a Java synchronous API by wrapping it in a future, or exploit an asynchronous Java API by returning a promise which is delivered

[ANN] bidi 1.20.0 - with Schema suppport

2015-06-29 Thread Malcolm Sparks
bidi is a routing library that lets you define the URI routes for your website as data. Until now, there has been no way to validate whether that data conforms to the expected structure. Not doing so can often lead to problems. I've just released a new version that defines a Prismatic Schema

[ANN] yada 0.4.0 - async REST web library

2015-05-12 Thread Malcolm Sparks
yada is a library for creating RESTful Ring handlers, similar(ish) to Liberator. The main difference is that yada fully supports async operation (provided by Zach Tellman's manifold library). It is a kind of reactive Clojure-based response to Java's ratpack.io or Scala's spray.io. yada is

Re: Clojure needs a web framework with more momentum

2015-05-12 Thread Malcolm Sparks
How do we effectively leverage some of the more advanced Clojure-oriented webservers such as Aleph and Immutant? I've just posted about yada on another thread, a library for 'proper' handling of Ring requests, fully supporting async. Although yada is a separate library, it fully complements

Re: Minimum Viable Database Component

2015-04-30 Thread Malcolm Sparks
I think it can be a dangerous road trying to create abstractions over data sources. It can be a lot of work maintaining a stub/mock implementation to work alongside a database, and sometimes it's not that much more work (or less work) to install Postgres, SQLite, or whatever you're using,

Re: [ClojureScript] Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2015-04-11 Thread Malcolm Sparks
Author of bidi here. In his blog article, REST Litmus Test for Web Frameworks - https://www.innoq.com/blog/st/2010/07/rest-litmus-test-for-web-frameworks/ - Stefan Tilkov asks of REST libraries: Is there an easy way to produce links that point back resources identified by whatever means

Re: core.async: Deprecated - this function will be removed. Use transducer instead

2015-02-19 Thread Malcolm Sparks
-decoder payload-json-decoder) (pipe source destination) just copies elements from source to destination. How is that any different than just using source here directly?: (- source payload-decoder payload-json-decoder) What have I missed? // Ben On Thu, Feb 19, 2015 at 3:06 AM, Malcolm Sparks

Re: core.async: Deprecated - this function will be removed. Use transducer instead

2015-02-18 Thread Malcolm Sparks
I have recently written a blog article which explains how to use transducers with core.async. You can find it here: http://malcolmsparks.com/posts/transducers.html On Wednesday, 18 February 2015 21:48:05 UTC, bsmith.occs wrote: I'm probably just especially dense today, but perhaps someone

[ANN] clean-blog @ modularity.org

2015-02-18 Thread Malcolm Sparks
I've added a blog-site template called 'clean-blog' to the collection at http://modularity.org - documented here: http://modularity.org/templates/clean-blog.html clean-blog is intended as a live site, rather than a static site generator like Cryogen: https://github.com/cryogen-project/cryogen

Re: [ANN] dformat 0.1.0

2015-01-12 Thread Malcolm Sparks
Very nice! On Monday, 12 January 2015 21:43:08 UTC, zirkonit wrote: A tiny library, my first open-source Clojure release. Removes some head-scratching when formatting dates (is it or ? or YYY?) by building date format strings automatically based on a sample. For example: (dformat

Re: equivalent of Compojure resources in juxt/bidi

2015-01-12 Thread Malcolm Sparks
Hi Clifford, First, br/resource-maybe can only appear as the second item of a route pair, because it only satisfies the bidi.bidi/Matched protocol. The first item of a route pair is for patterns only, i.e. types that satisfy bidi.bidi/Pattern protocol. What you are trying to do is easy (when

Re: [ANN] modularity.org

2015-01-12 Thread Malcolm Sparks
with Modular and having a Compojure router component (together with the endpoint-component function/pattern) would be very valuable. Regards, Malcolm On Friday, 9 January 2015 16:34:05 UTC, James Reeves wrote: On 8 January 2015 at 15:10, Malcolm Sparks mal...@juxt.pro javascript: wrote

Re: [ANN] modularity.org

2015-01-08 Thread Malcolm Sparks
January 2015 at 14:42, Malcolm Sparks malc...@juxt.pro wrote: I've created a new website to help new Clojure developers get started with Clojure and specifically with Stuart Sierra's component/reloaded-workflow pattern. On http://modularity.org you can find documentation about modular

[ANN] modularity.org

2015-01-08 Thread Malcolm Sparks
I've created a new website to help new Clojure developers get started with Clojure and specifically with Stuart Sierra's component/reloaded-workflow pattern. On http://modularity.org you can find documentation about modular. Modular comprises :- - a set of pre-written components - a template

Re: TDD and lein

2015-01-08 Thread Malcolm Sparks
LISP systems work better when they are continually up-and-running. Take Emacs for example. Clojure systems aren't much different. I prefer to think of lein more as a launch tool than a build tool. I don't think anyone has mentioned it on this thread yet, but lots of people are using Stuart

Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-12-29 Thread Malcolm Sparks
Thanks for the nice words about Bidi (https://github.com/juxt/bidi). For the record, Bidi now supports ClojureScript too. btw. The reason for matching on the path (rather than allowing matches on the query-string) is intentional, since I think that encourages a more RESTful architecture.

Re: how do you name your protocols?

2014-12-29 Thread Malcolm Sparks
I agree with you and Meikel's points about wrapping protocols with API functions, it makes sense, especially if you want to combine these calls with (Prismatic) schema checks. However, I'm not sure about your point that Stuart made an 'unfortunate' design to 'expose' protocol methods directly,

Re: problem redefining protocols and records in emacs+nrepl

2014-12-29 Thread Malcolm Sparks
I once worked with a Clojure dev who had a note stuck to his monitor with the words 'Have you tried lein clean?'. :) On Thursday, 16 May 2013 11:56:58 UTC+1, Joachim De Beule wrote: Just a small follow up in case somebody else hits the same problems: they disappear after a lein clean...

Re: Server Sent Events under Http-Kit

2014-12-17 Thread Malcolm Sparks
Here is a solution for SSE over http-kit channels (defn server-event-source [ch] ;; Adding a mult here is dangerous because it bleeds the underlying ;; channel dry. We should provide the mult via modular.async (let [m (async/mult ch)] (fn [req] (let [ch (async/chan 16)] (async/tap m ch)

Re: Server Sent Events under Http-Kit

2014-12-17 Thread Malcolm Sparks
. If not, how does backpressure work? On Wed, Dec 17, 2014 at 8:07 AM, Malcolm Sparks malc...@juxt.pro wrote: Here is a solution for SSE over http-kit channels (defn server-event-source [ch] ;; Adding a mult here is dangerous because it bleeds the underlying ;; channel dry. We should provide

Re: Starting a project the right way - tips?

2014-11-20 Thread Malcolm Sparks
Adding a vote for Potemkin's import-vars. Also, I've been using Stuart's component approach for almost a year in a half-dozen projects and it's real value is having a consistent architecture - I find projects that don't use it are likely to invent their own ad-hoc, informally-specified

Re: As framework creator, how would you get user defined specific functions/macros?

2014-11-20 Thread Malcolm Sparks
I think you should consider using Clojure's protocols feature rather that code-loading. Frameworks take control away from a developer, seeing the developer's code as somewhat subservient to the framework. The more common approach in Clojure applications is to provide libraries, and expect

[ANN] modular 0.5.1 with cylon 0.4.0

2014-08-05 Thread Malcolm Sparks
Hi, As a follow-up to my talk at EuroClojure 2014, I have deployed the latest modular and cylon releases to clojars. Both of these projects contain pre-built components to get up-and-running quickly with a component-based application as described by Stuart Sierra :- [1]

Re: [ANN] modular 0.5.1 with cylon 0.4.0

2014-08-05 Thread Malcolm Sparks
Hi Michael. No, it wasn't intentional. I think I've fixed it now, let me know if you still can't see the content. Regards, Malcolm On Tuesday, August 5, 2014 1:01:11 PM UTC+1, Michael Klishin wrote: On 5 August 2014 at 15:54:58, Malcolm Sparks (mal...@juxt.pro javascript:) wrote: As I

Re: [ANN] System

2014-08-05 Thread Malcolm Sparks
Michael is right, but I'll expand a bit. Jig is based on Stuart's tools.namespace and workflow-reloaded pattern, and I released it before I was really aware of Stuart's component library. Neale Swinnerton introduced me to 'component' and persuaded me of the strengths of Stuart's approach, in

Re: [ANN] Jig

2014-03-18 Thread Malcolm Sparks
It's a nice idea to load your schema and data on every reset, if you can. But if you need to, place you data anywhere under the :safe key in the system map and it will survive a reset. On 18 Mar 2014 15:57, Joachim De Beule joachim.de.be...@gmail.com wrote: Got it! :-) One more thing. While

Re: Om-powered HTML slide-decks

2014-03-14 Thread Malcolm Sparks
Yes, I believe it will be posted there soon. On 13 March 2014 17:35, Laurens Van Houtven _...@lvh.cc wrote: Hi Malcolm, Love the code, excited about the talk as well. Will it eventually end up on infoq.com/Clojure? thanks in advance lvh -- You received this message because you are

Re: [ANN] Jig

2014-03-12 Thread Malcolm Sparks
Hi Joachim, What you're describing is a dynamic system map, whereas the current pattern as described by Stuart in his classic blog post http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloadeddescribes a static system map which is established at the beginning of a reset cycle and

Re: [ANN] 1st public release of thi.ng geometry toolkit (CLJ CLJS)

2014-03-10 Thread Malcolm Sparks
Karsten, This is amazing. Watching you work with your geom library in this fantastic video has really inspired me :- http://www.youtube.com/watch?v=tKIVJ2TaS2kfeature=youtu.bet=20m9s I've been looking for some geom library to build animated data visualizations, so I'm looking forward to

Om-powered HTML slide-decks

2014-03-09 Thread Malcolm Sparks
There are some HTML-based tools out there (reveal.js, slidy, impress.js, deck.js ...) for building slide-based presentations for conference talks. But you usually have to write your slides in raw HTML. This feels cumbersome when you're used to writing LISP s-expressions with paredit. And if

Re: Om-powered HTML slide-decks

2014-03-09 Thread Malcolm Sparks
Sure. For SVG examples please view the presentation here: http://qcon.juxt.pro - I'm sorry it isn't (yet) responsive or touch-sensitive (getting it working on my laptop before the talk became the overriding priority) so you'll need a keyboard to control it. Use the left/right arrow keys to

Re: [ANN] Jig

2014-02-06 Thread Malcolm Sparks
Hi Joachim, I suggest you create a component, C, that assocs a channel in the system map. Now create a component, A that depends on C. A should start and stop a thread in the usual start/stop Lifecycle. The component should get the channel from the system map. The thread should check the

Re: [ANN] Jig

2014-01-23 Thread Malcolm Sparks
Hi Joachim The component lifecycle protocol is used to group together the init, start and stop functions tied to ephemeral services common to many Java server-side applications. I'm not sure it makes sense for components to satisfy other protocols that are functional in nature, as this invite

Re: How to handle configuration in Clojure?

2014-01-17 Thread Malcolm Sparks
There's also Jig : https://github.com/juxt/jig Jig's recommendation is for configuration to be held in EDN files. I much prefer EDN over environment variables. Environment variables feel awkward when there you have lots of configuration, usually in the form of a tree. Usually it makes sense

ANN: bidi, a URI dispatch and formation library for Clojure

2014-01-01 Thread Malcolm Sparks
I'd like to announce a new URI routing library called bidi. If you're planning to write HTTP/web applications in Clojure in 2014, chances are you'll be including hyperlinks (URIs) in your pages/views/templates. After all, this is what the web is all about. But the code that includes/generates

Re: Is Clojure right for me?

2013-12-27 Thread Malcolm Sparks
I modularize my Clojure systems using Jig: https://github.com/juxt/jig - it's one of many possible approaches. On 27 December 2013 15:23, Massimiliano Tomassoli kiuhn...@gmail.comwrote: On Friday, December 27, 2013 7:29:22 AM UTC+1, Sean Corfield wrote: On Thu, Dec 26, 2013 at 8:32 AM,

Re: How do I serve clojure pages with nginx

2013-12-26 Thread Malcolm Sparks
Here's an article I wrote that takes you through the full process of running nginx and and a Clojure web app. https://juxt.pro/articles/manual-clojure-deployment.html On Tuesday, December 17, 2013 12:44:34 PM UTC, Zeynel wrote: I've set up a home server with ubuntu and nginx and I can serve

Re: Is Clojure right for me?

2013-12-26 Thread Malcolm Sparks
Hi Massimiliano. The absence of a well-established framework for web development in Clojure is not a sign of its immaturity (rather the opposite). Web frameworks can give you some increased productivity to begin with, but as soon as you need to do something that isn't naturally supported by

Re: [ANN] Jig

2013-11-07 Thread Malcolm Sparks
side effect at one place but will not spread out to our other core functions. Thanks On Saturday, October 12, 2013 12:23:41 AM UTC+8, Malcolm Sparks wrote: A few months ago, Stuart Sierra blogged about the workflow he follows for building Clojure applications. One of the great pleasures

Re: [ANN] Jig

2013-11-06 Thread Malcolm Sparks
to the tool. Anyways... :) Tim Washington Interruptsoftware.ca http://interruptsoftware.ca/ / Bkeeping.comhttp://bkeeping.com/ On Tue, Nov 5, 2013 at 4:33 AM, Malcolm Sparks mal...@juxt.projavascript: wrote: Hi Tim, The tests in JUXT accounting are using clojure.core.test. I'm

Re: [ANN] Jig

2013-11-05 Thread Malcolm Sparks
27, 2013 at 4:39 AM, Chris Zheng z...@caudate.mejavascript: wrote: Thanks Malcom, Even something really simple like showing your current project setup would be really good for me to get going. On 21/10/2013, at 15:57, Malcolm Sparks mal...@juxt.pro javascript: wrote: Hi Chris, yes I

Re: [ANN] Jig

2013-11-05 Thread Malcolm Sparks
Hi Tim, The tests in JUXT accounting are using clojure.core.test. I'm fairly sure Midje's :autotest feature does something dynamic to determine the tests to run and that may not work with Jig's classloading approach. For example, if something uses (System/getProperty java.class.path) it will

Re: [ANN] Jig

2013-10-24 Thread Malcolm Sparks
file to your hard drive *java.io.FileNotFoundException: /home/malcolm/Dropbox.private/JUXT/accounts.edn* Tim Washington Interruptsoftware.ca / Bkeeping.com On Mon, Oct 21, 2013 at 3:57 AM, Malcolm Sparks mal...@juxt.projavascript: wrote: Hi Tim, Good to hear you're finding Jig

Re: [ANN] Jig

2013-10-21 Thread Malcolm Sparks
Hi Tim, Good to hear you're finding Jig useful. There isn't any explicit support for Ring in Jig yet, it's just Pedestal services right now. The separation of jig.web.server and jig.web.app into 2 components is to allow multiple 'virtual hosts' to share the same Jetty server, if necessary.

Re: [ANN] Jig

2013-10-21 Thread Malcolm Sparks
Hi Chris, yes I will try to do something like that very soon. On Friday, October 18, 2013 12:30:20 AM UTC+1, zcaudate wrote: Would it be possible to put up a video of a typical workflow example with pedestal. It's quite difficult for me to piece everything together just by reading the

Re: [ANN] Jig

2013-10-15 Thread Malcolm Sparks
) (start [_ system] system) (stop [_ system] system)) *fig.3 - recordo/src/recordo/core.clj; ... recordo's project.clj has no mention of **jig*** Cheers - great work. Tim Washington Interruptsoftware.ca / Bkeeping.com On Fri, Oct 11, 2013 at 12:23 PM, Malcolm Sparks mal

Re: [ANN] Jig

2013-10-15 Thread Malcolm Sparks
On Sunday, 13 October 2013 01:21:40 UTC+1, Manuel Paccagnella wrote: Looks very interesting, thanks for sharing! BTW, documentation is impressive and quite comprehensive. On a related note: I've spotted a couple of typos in your README.md so far. Do you accept pull requests for small

[ANN] Jig

2013-10-11 Thread Malcolm Sparks
A few months ago, Stuart Sierra blogged about the workflow he follows for building Clojure applications. One of the great pleasures of working with a dynamic language is being able to build a system while simultaneously interacting with it. --

Re: [GSoC] Clojure refactoring library and integration in Counterclockwise

2013-04-18 Thread Malcolm Sparks
Michael, There are some pre-existing libraries that could give you a headstart in this work :- tools.reader - can help you parse Clojure source - https://github.com/clojure/tools.reader tools.namespace can help you parse and manage graphs of namespaces -

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

2013-01-12 Thread Malcolm Sparks
The Clojure tradition of mixing-and-matching small libraries rather than relying on large frameworks like Spring did not emerge by accident. The Java language itself causes library authors to create their own types thereby creating an impedance mismatch with other libraries. Spring (and

Re: Parsing Clojure code in Clojure?

2012-12-31 Thread Malcolm Sparks
are different from Java ones, but there all the same. Regards, Malcolm On Thursday, December 27, 2012 10:45:26 PM UTC, Jozef Wagner wrote: This may also help https://github.com/cgrand/sjacket On Thursday, December 27, 2012 9:32:10 PM UTC+1, Malcolm Sparks wrote: Thanks David, that was just

Parsing Clojure code in Clojure?

2012-12-27 Thread Malcolm Sparks
Hi, I need to parse Clojure code for purposes of code-insights, web presentation with hyperlinks between symbols, potential re-factoring, dead namespace illumination, visualization and inspection of increasingly large Clojure code-bases, code-style and compliance violation monitoring, that

Re: Parsing Clojure code in Clojure?

2012-12-27 Thread Malcolm Sparks
Thanks David, that was just the library I was looking for :) On 27 Dec 2012 20:22, David Nolen dnolen.li...@gmail.com wrote: https://github.com/Bronsa/blind This library is on its way to becoming a part of contrib as tools.reader David On Thu, Dec 27, 2012 at 3:17 PM, Malcolm Sparks malc

Re: Attractive examples of function-generating functions

2012-08-12 Thread Malcolm Sparks
On Wednesday, August 8, 2012 7:48:23 PM UTC+3, Brian Marick wrote: I'm looking for medium-scale examples of using function-generating functions. Brian, when I saw this I was reminded of ring middleware - eg. http://jgre.org/2010/10/04/ring-middleware/ -- You received this message