Re: ClojureScript vs. Elm for Multiplayer Web Game

2015-09-21 Thread Gijs S.
I have no experience with Elm, but I have made a card game with ClojureScript: http://thegeez.net/2012/03/20/racket_gin_clojurescript.html As well as a version with a Datomic back-end: http://thegeez.net/2014/06/12/gin_datomic.html -- You received this message because you are subscribed to the

Re: Playing around with transducers, what about the zero-arity of the reducing function

2014-09-16 Thread Gijs S.
No init value given with transduce uses the zero arity value of f rather than the zero arity of the reducing function through xform: With Clojure 1.7.0-alpha2: user=> (doc transduce) - clojure.core/transduce ([xform f coll] [xform f init coll]) reduce with a transformati

Playing around with transducers, what about the zero-arity of the reducing function

2014-09-16 Thread Gijs S.
Hi, At a recent Amsterdam Clojure Meetup, we were looking into transducers. We could not find any situation where the "zero arity" println would get called when using this futile transducer: (defn println-transducing-fn [reducing-fn] (fn new-reducing-fn ([] (println "zero arity")

Re: Gin card game with Datomic

2014-06-14 Thread Gijs S.
3 AM UTC+2, Dry Jin wrote: > > Great, but I couldn't play this game. > > Do I need something else to play this? > > I am using IE8. > > 2014년 6월 13일 금요일 오후 4시 49분 19초 UTC+9, Gijs S. 님의 말: > >> Hi all, >> >> I wrote a web app where you can

Gin card game with Datomic

2014-06-13 Thread Gijs S.
Hi all, I wrote a web app where you can play a card game with Clojure, ClojureScript and Datomic. Background on the design is here: http://thegeez.net/2014/06/12/gin_datomic.html The game is playable here: http://gin.thegeez.net/ The code is on github: https://github.com/thegeez/gin -Gijs -

Re: Datascript and React.js for a Clojure web app

2014-05-02 Thread Gijs S.
> deploy it to heroku? > > On Wednesday, April 30, 2014 8:32:24 AM UTC-5, Gijs S. wrote: >> >> Hi all, >> >> I've released a Clojure web application. It includes a front-end using >> DataScript and React.js in ClojureScript. >> >> More d

Datascript and React.js for a Clojure web app

2014-04-30 Thread Gijs S.
Hi all, I've released a Clojure web application. It includes a front-end using DataScript and React.js in ClojureScript. More details here: http://thegeez.net/2014/04/30/datascript_clojure_web_app.html The code is on github: https://github.com/thegeez/clj-crud Demo on heroku: http://clj-crud.

Re: clj-http client translated from php/curl implementation fails, why?

2014-02-13 Thread Gijs S.
Untested of course, but I think you need to use either :body or :form-params rather than :query-params to put the query-params data into the body of the post request. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send ema

Re: mapv-in or map-in?

2012-10-05 Thread Gijs S.
Look at clojure.walk for mapping functions over nested structures: (defn mapv-in [f coll] (clojure.walk/prewalk #(if (coll? %) % (f %)) coll)) Clojure walk api: http://clojure.github.com/clojure/clojure.walk-api.html On Friday, October 5, 2012 7:58:30 AM UTC+2, nchurch wrote: > > I ended u

Re: Browser as an Evaluation Environment error

2012-09-10 Thread Gijs S.
I once ran into this error message when I entered the address "http://localhost:9000/repl"; into the address bar of the browser by mistake. This address should only be used in ClojureScript code. You should open a page in the browser that contains compiled ClojureScript that connects to this

Re: require goog.editor.ContentEditableField not working

2012-08-30 Thread Gijs S.
Hi, Re: ContentEditableField ContentEditableFIeld has only recently been added to the Google Closure Library (http://code.google.com/p/closure-library/source/list?path=/trunk/closure/goog/editor/contenteditablefield.js&start=2035). Are you sure that the version of the Google Closure Library t

Re: Clojurescript long polling questions

2012-05-01 Thread Gijs S.
The order of arguments you pass to long-poll-newest doesn't look right. You defined long-poll-newest to optionally take a fourth parameter for the existing xhr connection. However, when calling long-poll-newest you pass the existing xhr connection as the first argument. Replace (long-poll-newest

Re: ANN: clj-browserchannel-demo, cljs <-> clj communication

2012-04-02 Thread Gijs S.
See this blog post for more background on BrowserChannel and why it is useful for ClojureScript web applications: http://thegeez.net/2012/04/03/why_browserchannel.html -Gijs -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: ANN: clj-browserchannel-demo, cljs <-> clj communication

2012-03-28 Thread Gijs S.
Here is the chat app on Heroku: http://cold-stream-6156.herokuapp.com/index.html -Gijs On Mar 28, 1:39 pm, "Gijs S." wrote: > Hi, > > clj-browserchannel-demo demonstrates cross-browser compatible, real- > time, bi-directional communication between ClojureScript and

ANN: clj-browserchannel-demo, cljs <-> clj communication

2012-03-28 Thread Gijs S.
Hi, clj-browserchannel-demo demonstrates cross-browser compatible, real- time, bi-directional communication between ClojureScript and Clojure using Google Closure BrowserChannel. >From the Google Closure API: "A BrowserChannel simulates a bidirectional socket over HTTP. It is the basis of the Gma

Re: clojurescript why: (def ... is failing whereas (let ... succeeds

2012-02-11 Thread Gijs S.
Hi, The solution is to explicitly require goog.fx.DragDrop in the :require in the ns declaration: [goog.fx.DragDrop :as dd-import] This adds this line in the generated js output: goog.require('goog.fx.DragDrop'); This line is required because DragDrop lives in its own file within the Google Clo

= in ClojureScript differs from Clojure API for arities other than 2

2012-01-19 Thread Gijs S.
Subject: = in ClojureScript differs from Clojure API for arities other than 2 Using ClojureScript f4c0de502c92ce710da923888d672f22213b902c (checked out on Thu Jan 19 2012) => (= 1) false ;; incorrect => (= 1 1) true => (= 1 1 2) true ;; incorrect => (= 1 1 1) true ;; correct, but by accident

Re: clojurescript: how do i copy one input text field to another?

2011-12-19 Thread Gijs S.
The problem is the setTextContent function from Google closure. Text content is the text within a div, span, p, label etc but not the value of an input element. Likewise getTextContent on field1 returns "", rather than the value "Hello World!". The following clojurescript can set the value of a te

Re: Clojurescript Beginner's Question

2011-08-30 Thread Gijs S.
Out :as fx-dom-FadeOut])) > > (defn ^:export main [] >   (let [kurdt (dom/getElement "kurdt") >         anim (fx-dom/FadeOut. kurdt 1234)] >     (.play anim) >     (dom/appendChild (.body (dom/getDocument)) (dom/createDom "h1" 0 > (str (.duration anim)) >

Re: Clojurescript Beginner's Question

2011-08-30 Thread Gijs S.
Hi, I have run into a similar problem. The problem is something with the "require" and namespaces in JavaScript. The following worked for me: (ns example.example (:require [goog.fx.Dragger :as unused-alias])) And then to call the Dragger constructor: (goog.fx.Dragger. ) In the twitterbuzz exam

Re: Anyone using the sdb library?

2011-02-27 Thread Gijs S.
Yes, my suggestion without type indicators in SDB would look something like this: (def config {:sdb-client (AmazonSimpleDBClient. ...) :mapping {"Link" {"url" {:encode encode-string :decode decode-string} "points" sdb/integer-encoding

Re: Anyone using the sdb library?

2011-02-27 Thread Gijs S.
Hi, I have dabbled a bit with both AWS SimpleDB and the sdb library as well as with the similar Google App Engine Datastore and related Clojure libraries. These two parts are indeed no-brainers: - Support for consistent reads - Support for literal string queries Re: numeric formatting I

Re: Exporting FatJar from Eclipse CCW does not work

2010-11-28 Thread Gijs S.
Hi Alex, Glad to be of help. I had never heard of FatJar before and it turned out to work great for a clojure project I needed to distribute. Also, as a fellow Dutch clojurian I can recommend the Amsterdam Clojurians group at http://ams-clj.github.com. Cheers, Gijs -- You received this message

Re: Exporting FatJar from Eclipse CCW does not work

2010-11-27 Thread Gijs S.
Hi, Perhaps it is a typo but you should have (defn -main [] ...) rather than (defn- main [] ...) Note the place of the dash "-". defn- yields a non public var (a private declaration) (http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/ defn-) -main uses the dash, which is the

Re: Python is way faster than Clojure on this task

2010-11-08 Thread Gijs S.
I also get consistent better times with (freq-layer layer) vs. (nth freq-layer layer). Gist updated: https://gist.github.com/666228 -Gijs -- 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 N

Re: Python is way faster than Clojure on this task

2010-11-08 Thread Gijs S.
Indeed I was not using the transients correctly. Transients are not designed to be bashed in-place. (http://clojure.org/transients) The gist is updated with a version that first worked without the transients and then had the transient operations added. (https:// gist.github.com/666228) The times

Re: Python is way faster than Clojure on this task

2010-11-07 Thread Gijs S.
The problem is not the freqs function. The implementation in Python and in Clojure are different algorithms. Both produce a graph with the number of blocks per layer per type, for 6 particular types. These six types are the Clay, Coal ore, Diamond ore, Gold ore, Iron ore, Obsidian, and Redstone or

Re: partition-starting-every : yet another partition function

2010-09-17 Thread Gijs S.
Finished is a predicate which designates when the seed is exhausted. Because seed is not necessary a sequence, finished is not always empty?. For instance: => (unfold (fn [x] [(* x x) (inc x)]) #(> % 10) 0) (0 1 4 9 16 25 36 49 64 81 100) Or the zipmap (zip2) example from the wikipedia pa

Re: partition-starting-every : yet another partition function

2010-09-16 Thread Gijs S.
This answers neither question 1 nor 2, but there is a function from the map, filter and reduce family of higher order functions that is applicable to this problem. The function is called unfold and is the opposite of reduce (see http://en.wikipedia.org/wiki/Anamorphism). "An unfold builds a (poten