[ANN] Reitit 0.1.0 - a fast data-driven routing library for Clojure(Script)

2018-02-19 Thread Didier
Looks good, congrats!

-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@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 emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] Reitit 0.1.0 - a fast data-driven routing library for Clojure(Script)

2018-02-19 Thread Tommi Reiman
We are happy to announce first release of Reitit 
, a new data-driven routing library for 
Clojure(Script)!

It builds on top of clojure.spec, supports first class route data, full 
route conflict resolution, pluggable coercion (schema & spec) and much more.

Intro blogs:

* Reitit, Data-Driven Routing with Clojure(Script) 

* Data-Driven Ring with Reitit 

Github: https://github.com/metosin/reitit
Docs: https://metosin.github.io/reitit/

-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@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 emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: `lein run` VS `lein uberjar` behaviour

2018-02-19 Thread dimitris
Darn it, i made a typo copying and it may throw some people off. There 
is a double-deref `@@` in the  handler i pasted. Apologies for the 
slopiness... :(


Regards,

Dimitris


On 19/02/18 16:52, dimitris wrote:


Ok, so here is the ns declaration:

(ns msnake.gui
   (:require ...the core game namespaces)
   (:import ...a bunch of JavaFX classes)
   (:gen-class:extends javafx.application.Application))

And here is the `-start` method and the animation-timer in case anyone 
is wondering what that is:


(defn- animation-timer
   ^AnimationTimer [proceed-game!]
   (let [last-update (SimpleLongProperty. 0)]
 (proxy [AnimationTimer] []
   (handle [now]
 (let [last-update* (.get last-update)
   nanos-elapsed (- now last-update*)]
   (when (>= nanos-elapsed @ctrl/turn-nanos)
 (proceed-game!)
 (.set last-update now)))

(defn -start [app ^Stage stage]
   (let [player-no (new-game-dialog!)
 entities (ctrl/game-entities player-no)
 canvas (doto (Canvas. 750 500)
  (.setFocusTraversable true)
  (.setOnKeyPressed (fxut/event-handler [e]
  (apply react! e entities
 root (StackPane. (into-array [canvas]))
 context (.getGraphicsContext2D canvas)
 scene (Scene. root750 500)
 timer (animation-timer (partial paint/paint-all context entities))
 audio (doto (MediaPlayer. (-> "PimPoy.wav" io/resource .toString 
(Media.)))
 (.setVolume start-volume)
 (.setAutoPlay true)
 (.setCycleCount MediaPlayer/INDEFINITE))]
 (deliver start-gui-loop #(.start timer))
 (deliver audio-engine audio)
 (doto stage
   (.setResizable false)
   (.setTitle "MX SNAKE")
   (.setOnCloseRequest (fxut/event-handler [_] (System/exit 0)))
   (.setScene scene)
   (.show))

 (fxut/run-later* @start-gui-loop)))

As you can see the MediaPlayer object is created once. It is accessed 
through various controllers (volume+/- etc) but never created anew. 
For example here is the handler for :


KeyCode/M (fn [& _]
 (if (= MediaPlayer$Status/PLAYING (.getStatus @audio-engine))
   (.stop @audio-engine)
   (.play @@audio-engine)))

Here is main.clj:

(ns msnake.main
   (:import (javafx.application Application)
(msnake gui))
   (:gen-class :main true))

(defn -main [& args]
   (Application/launch gui (into-array String args)))


and finally project.clj

(defproject msnake"0.1.0-SNAPSHOT" :description "FIXME: write description" :url 
"http://example.com/FIXME"; :license {:name "Eclipse Public License" :url 
"http://www.eclipse.org/legal/epl-v10.html"}

   :dependencies [[org.clojure/clojure"1.9.0"]]
   :aot [msnake.gui msnake.paint msnake.main]
   :main msnake.main
   :jvm-opts ["-Dclojure.compiler.direct-linking=true"]
   )

I should point out that direct-linking is not the culprit here. 
Exactly the same thing happens with or without direct-linking :(.


As you can see I'm playing by the book - i.e. subclassing Application, 
and launching through the overridden `-start` method.


Kind regards,

Dimitris


On 19/02/18 03:10, Sean Corfield wrote:


Show us some of your code.

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


*From:* clojure@googlegroups.com  on behalf 
of dimitris 

*Sent:* Sunday, February 18, 2018 5:13:06 AM
*To:* Clojure
*Subject:* `lein run` VS `lein uberjar` behaviour
Hi all,

I'm experiencing something very strange with my JavaFX clojure
application. What the application actually is about is not super
important. What is important is the fact that I'm having a different
experience when I run it via `lein run` (or in fact `lein trampoline
run`), than when I run the created uberjar (via `lein uberjar`).

The difference is the following:

In my `-start` method I'm creating a MediaPlayer object (with a .wav
resource), and setting its cycleCount to INDEFINITE, which is to say
that is will keep repeating the audio file forever. That's all fine and
dandy and it does work as expected when run through lein. However, the
exact same code in the uberjar plays the file once and then it stops!
The game carries on as usual with no exceptions or anything like
that...It's only the music that stops!

Now, before someone says that the MediaPlayer object has been GC'ed (as
indicated by [1], [2] & [3]), I should point out that I am able to
restart the music (by pressing 'M)' after it has stopped and while the
program is running normally. The only thing that the KeyCode handler for
M is doing calling `.play` or `.stop` on the original MediaPlayer object
i created at the very start. In other words, I'm not creating any new
MediaPlayer objects 

Re: `lein run` VS `lein uberjar` behaviour

2018-02-19 Thread dimitris

Ok, so here is the ns declaration:

(ns msnake.gui
  (:require ...the core game namespaces)
  (:import ...a bunch of JavaFX classes)
  (:gen-class:extends javafx.application.Application))

And here is the `-start` method and the animation-timer in case anyone 
is wondering what that is:


(defn- animation-timer
  ^AnimationTimer [proceed-game!]
  (let [last-update (SimpleLongProperty. 0)]
(proxy [AnimationTimer] []
  (handle [now]
(let [last-update* (.get last-update)
  nanos-elapsed (- now last-update*)]
  (when ( >= nanos-elapsed @ctrl/turn-nanos)
(proceed-game!)
(.set last-update now)))

(defn -start [app ^Stage stage]
  (let [player-no (new-game-dialog!)
entities (ctrl/game-entities player-no)
canvas (doto (Canvas. 750 500)
 (.setFocusTraversable true)
 (.setOnKeyPressed (fxut/event-handler [e]
 (apply react! e entities
root (StackPane. (into-array [canvas]))
context (.getGraphicsContext2D canvas)
scene (Scene. root750 500)
timer (animation-timer (partial paint/paint-all context entities))
audio (doto (MediaPlayer. (-> "PimPoy.wav" io/resource .toString 
(Media.)))
(.setVolume start-volume)
(.setAutoPlay true)
(.setCycleCount MediaPlayer/INDEFINITE))]
(deliver start-gui-loop #(.start timer))
(deliver audio-engine audio)
(doto stage
  (.setResizable false)
  (.setTitle "MX SNAKE")
  (.setOnCloseRequest (fxut/event-handler [_] (System/exit 0)))
  (.setScene scene)
  (.show))

(fxut/run-later* @start-gui-loop)))

As you can see the MediaPlayer object is created once. It is accessed 
through various controllers (volume+/- etc) but never created anew. For 
example here is the handler for :


KeyCode/M (fn [& _]
(if (= MediaPlayer$Status/PLAYING (.getStatus @audio-engine))
  (.stop @audio-engine)
  (.play @@audio-engine)))

Here is main.clj:

(ns msnake.main
  (:import (javafx.application Application)
   (msnake gui))
  (:gen-class :main true))

(defn -main [& args]
  (Application/launch gui (into-array String args)))


and finally project.clj

(defproject msnake"0.1.0-SNAPSHOT" :description "FIXME: write description" :url 
"http://example.com/FIXME"; :license {:name "Eclipse Public License" :url 
"http://www.eclipse.org/legal/epl-v10.html"}

  :dependencies [[org.clojure/clojure"1.9.0"]]
  :aot [msnake.gui msnake.paint msnake.main]
  :main msnake.main
  :jvm-opts ["-Dclojure.compiler.direct-linking=true"]
  )

I should point out that direct-linking is not the culprit here. Exactly 
the same thing happens with or without direct-linking :(.


As you can see I'm playing by the book - i.e. subclassing Application, 
and launching through the overridden `-start` method.


Kind regards,

Dimitris


On 19/02/18 03:10, Sean Corfield wrote:


Show us some of your code.

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


*From:* clojure@googlegroups.com  on behalf 
of dimitris 

*Sent:* Sunday, February 18, 2018 5:13:06 AM
*To:* Clojure
*Subject:* `lein run` VS `lein uberjar` behaviour
Hi all,

I'm experiencing something very strange with my JavaFX clojure
application. What the application actually is about is not super
important. What is important is the fact that I'm having a different
experience when I run it via `lein run` (or in fact `lein trampoline
run`), than when I run the created uberjar (via `lein uberjar`).

The difference is the following:

In my `-start` method I'm creating a MediaPlayer object (with a .wav
resource), and setting its cycleCount to INDEFINITE, which is to say
that is will keep repeating the audio file forever. That's all fine and
dandy and it does work as expected when run through lein. However, the
exact same code in the uberjar plays the file once and then it stops!
The game carries on as usual with no exceptions or anything like
that...It's only the music that stops!

Now, before someone says that the MediaPlayer object has been GC'ed (as
indicated by [1], [2] & [3]), I should point out that I am able to
restart the music (by pressing 'M)' after it has stopped and while the
program is running normally. The only thing that the KeyCode handler for
M is doing calling `.play` or `.stop` on the original MediaPlayer object
i created at the very start. In other words, I'm not creating any new
MediaPlayer objects anywhere else other than the `-start` method. Unless
I'm missing something, i shouldn't be able to restart the music if the
MediaPlayer object had been GC'ed, right?

I'm not sure if it plays any role but the MediaPlayer object lives
inside a promise, which aga

Re: [HEADS-UP] CFP for Dutch Clojure Day 2018 closes in 9 days

2018-02-19 Thread Niels van Klaveren
Eventbrite says "Sale ended". Did tickets go that fast or is it some hickup 
?

On Monday, February 19, 2018 at 9:47:00 AM UTC+1, Vijay Kiran wrote:
>
> Hello All,
>
> Just wanted to give you a heads-up for Dutch Clojure Day - a free one day 
> Clojure conference in Amsterdam. This is a conference run by community 
> volunteers, with sponsorship from amazing Clojure companies across Europe. 
> Our CFP will be open until Feb 28th and we welcome all levels of talks 
> about Clojure/ClojureScript ecosystem. If you have a talk in mind feel free 
> to submit at  https://www.papercall.io/dcd18 or spread the word :)
>
> Check out our website for http://clojuredays.org to register for the 
> event! 
>
> We look forward to seeing some of you here in Amsterdam on 21st April 2018
>
> Cheers,
> Vijay
> DCD Organiser Team
>

-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@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 emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[HEADS-UP] CFP for Dutch Clojure Day 2018 closes in 9 days

2018-02-19 Thread Vijay Kiran
Hello All,

Just wanted to give you a heads-up for Dutch Clojure Day - a free one day 
Clojure conference in Amsterdam. This is a conference run by community 
volunteers, with sponsorship from amazing Clojure companies across Europe. 
Our CFP will be open until Feb 28th and we welcome all levels of talks 
about Clojure/ClojureScript ecosystem. If you have a talk in mind feel free 
to submit at  https://www.papercall.io/dcd18 or spread the word :)

Check out our website for http://clojuredays.org to register for the event! 

We look forward to seeing some of you here in Amsterdam on 21st April 2018

Cheers,
Vijay
DCD Organiser Team

-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@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 emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.