Re: Arithmetic simplifier

2018-08-29 Thread bernardH
As an example of how to use intaparse to parse arithmetic expressions (among other things), you might be interested in this notebook https://mybinder.org/v2/gh/bhugueney/binder-test/master?filepath=Clojure.ipynb On Saturday, August 18, 2018 at 2:02:25 PM UTC+2, ckry...@gmail.com wrote: > > Hi,

Re: Reflection needed ? More precise types returned from higher-order function (i.e. comp and partial) ?

2016-07-30 Thread bernardH
thi.ng/geom: > > (require '[thi.ng.geom.vector :as v]) > > (defn tween-points > [src dest t] (map (fn [a b] (m/mix a b t)) src dest)) > > (tween-points [(v/vec2 0 0) (v/vec2 100 50)] [(v/vec2 100 200) (v/vec2 > 200 100)] 0.5) > ;; ([50.0 100.0] [150.0 75.0]) >

Reflection needed ? More precise types returned from higher-order function (i.e. comp and partial) ?

2016-06-28 Thread bernardH
Hi, Inspired by Karsten Schmidt's amazing work[0], I'm thinking about porting some generative code from python to Clojure[script]. However, I would like to use the (expected) performance boost (from python turtle module) to add some animation effects. I believe my current code is quite clean

Re: Puzzle solving in Clojure

2016-04-14 Thread bernardH
Hi ! On Friday, April 8, 2016 at 3:28:55 PM UTC+2, Olivier Scalbert wrote: > > Hello everybody ! > > I just start learning Clojure and I am a complete newbie ! > > I have tried to solve this classical small puzzle with Clojure. > Assign one digit from {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} to each letter

Re: [ANN] dali SVG library 0.7.0

2016-02-14 Thread bernardH
On Thursday, February 11, 2016 at 1:49:54 AM UTC+1, Stathis Sideris wrote: > > Hello all, > > dali is a Clojure library for representing the SVG graphics format. It > allows the creation and manipulation of SVG files. The syntax >

Re: [ANN] pex, a powerful PEG parsing library

2015-11-19 Thread bernardH
This is interesting ! It reminds me of Parsnip from C.Grand [0], have you considered it when desining pex ? As your parser is focusing of characters, I am wondering : could the operations triggered by the execution of your pex code be simple enough to warrant actual compiling to JVM bytecode

Re: My first implementation of Sieve of Eratosthenes. cons please

2014-11-26 Thread bernardH
Hi, As has been said, this is not SoE. But my take would be something along : (reduce (fn [primes number] (if (some zero? (map (partial mod number) (take-while #(= % (Math/sqrt number)) primes))) primes (conj primes number))) [2] (take n (iterate inc 3))) But I'm a

Re: Adding up numbers, quickly

2014-10-17 Thread bernardH
On Friday, October 17, 2014 1:21:55 PM UTC+2, Jony Hudson wrote: Thanks all again for the advice. For the record, I ended up writing the loop in Java - being constrained on the type of the data (it ultimately comes from Java code), and not wanting to pay the (newly reduced!) price of

Re: Optimizing code : Fun but now paining me

2014-10-17 Thread bernardH
On Friday, October 17, 2014 12:51:01 PM UTC+2, Ashish Negi wrote: Ok so i am back with this and rechanged the code and used another algorithm : created by great Dijkstra Shunting Yard algo which creates the infix to postfix conversion. My implementation here :

Re: Optimizing code : Fun but now paining me

2014-10-14 Thread bernardH
Sorry but I don't feel that I'm understanding your code enough to rewrite it (for instance, why substract 2 at https://gist.github.com/ashishnegi/a9ae3fb3c270c7d3742e#file-calculator-clj-L102 to add 2 at https://gist.github.com/ashishnegi/a9ae3fb3c270c7d3742e#file-calculator-clj-L16 ?). But

Re: Teaching Clojure to students (how ?)

2013-10-09 Thread bernardH
Thanks for all the feedback. I had already made sure that LightTable is already installed, and the plug-in for eclipse (that they already use). But I don't expect too much trouble on this front as they are already somewhat proficient (with even some converts to the church of Emacs ☺). Cheers,

Teaching Clojure to students (how ?)

2013-10-05 Thread bernardH
Hi all, I intend to (ab)use my authority as a teacher to enlighten unsuspecting students about Clojure. On the plus side, I may give them insights that they did not even know they needed. On the minus side, I cannot expect (all of) them to be curious about Clojure. Hence, I want to make a

Re: [ANN] REST in Peace 0.1.0

2013-07-20 Thread bernardH
On Saturday, July 20, 2013 3:21:47 AM UTC+2, Steven Degutis wrote: https://github.com/sebastiansen/rip Thanks ! I'll be implementing RESTful ws this summer and intended to use http://clojure-liberator.github.io/liberator/ . How does your library compares to it ? Any advice on how to make

async.core : how to process (match) sequences of events ?

2013-07-20 Thread bernardH
Dear Clojurians, I'm currently wrapping my head around core.async and it seems really great to process events from various souces. However, I don't currently see how I could use it for my use case. I want to make a kind of multiplayer action game with combos moves for sequences of input events

Re: direction of an arrow in core.async

2013-07-14 Thread bernardH
On Monday, July 15, 2013 1:39:00 AM UTC+2, Brandon Bloom wrote: When I read code like (- 1 2), I tranform it into (1 - 2) in my head […] In the absence of a mental infix transform, (! c) reads like redirecting from a file in your shell. Thx for the mnemonic ! It didn't make sense

core.async ring middleware vs pedestal interceptors

2013-07-07 Thread bernardH
Dear clojurians, Like many others here, I'm thrilled by the new core.async and wondering about all the goodies that we will be able to reap from it. Thinking about how it decouples the abstracts threads of execution with the concrete implementation thread(s) especially in the context of

No bit shift for clojure.lang.BigInt ?

2013-06-06 Thread bernardH
Hi, I wanted to shave a few cycles of a (quot n 2) by using (bit-shift-right n 1) instead, with n being a bigint. However, this fails with an IllegalArgumentException bit operation not supported for: class clojure.lang.BigInt clojure.lang.Numbers.bitOpsCast (Numbers.java:1008). Since the

Re: ANN: Iota 1.0.2 release (Reducers for text files)

2013-03-08 Thread bernardH
Hi Alan, On Friday, March 8, 2013 4:02:18 PM UTC+1, Alan Busby wrote: Hi Bernard, I'd certainly like to add support for binary files, but as I haven't had a need for it myself I haven't had a good place to start. As Java NIO's mmap() doesn't support ranges over 2GB, I've had to paste

Re: ANN: Iota 1.0.2 release (Reducers for text files)

2013-03-07 Thread bernardH
Hi, On Wednesday, March 6, 2013 2:53:26 PM UTC+1, Alan Busby wrote: With the release of Clojure 1.5 and it's new reducers, I figured this would be a good time to release a library to help with file IO for reducers. As reducers can only operate in parallel over specific collections, like

Re: Clojure Performance For Expensive Algorithms

2013-02-25 Thread bernardH
Hi, Nice solution, but don't we need to distinguish between the array types ? (cf. inline comment below ) Cheers, B. On Monday, February 25, 2013 12:08:39 AM UTC+1, Aria Haghighi wrote: […] Here, I think it's a macro you'll probably use all over the place, arr-max, which will find the

Re: Clojure Performance For Expensive Algorithms

2013-02-24 Thread bernardH
On Thursday, February 21, 2013 10:27:11 PM UTC+1, Geo wrote: Man, this is exactly how I feel after all this tinkering! It was great for learning Clojure a bit more in depth, but in the end I am going to stick with the Java solution. Especially since it's so easy to mix Java and Clojure

Re: Building a REST API / efficient RPC interface in Clojure

2013-02-12 Thread bernardH
On Monday, February 11, 2013 2:48:30 AM UTC+1, Mikera wrote: Thanks bernardH - these are great links, probably pretty close to what I was looking for. Will try some experiments with these over the next few days. Hi, I, for one, would be interested by the results of those experiments

Re: Building a REST API / efficient RPC interface in Clojure

2013-02-09 Thread bernardH
Hi, On Saturday, February 9, 2013 4:47:26 AM UTC+1, Feng Shen wrote: Hi, I did something similar during work (we are using Clojure) 1. Use HTTP as the transport: browser ajax call, mobile API call, intertal use 2. JSON as encoding. Javascript support it natively, mobile can

Re: revisiting community funding?

2012-03-20 Thread bernardH
On 20 mar, 21:09, nchurch nchubr...@gmail.com wrote: But there are other people who work on Clojure and Clojurescript; great things could happen from the focus that comes from being able to work on them full time.  I know I'd be willing to give a couple hundred to fund such an effort, and

Clojure Propaganda, reaching out of the LISP niche market

2012-02-27 Thread bernardH
Hi, I've been watching the Neal Ford video from Clojure/conj about World Domination and thought about the propaganda part. Clojure was sold to me as a practical Lisp on the JVM. This was good because I had already decided to cure my parenthesophobia and the contenders were Racket, Guile and

Re: Literate Programming example

2011-11-18 Thread bernardH
On Nov 18, 1:17 pm, daly d...@axiom-developer.org wrote: Many of you asked me to show an example of a literate program and demonstrate the use of the tangle function. Thanks to your perseverance, I am looking into practicing literate programming. However, I decided to settle for emacs

Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-12 Thread bernardH
hi, I just stumbled upon a paper on en enhanced immutable data structure [0] that could be useful for Clojure implementation. Could it enable batter parallel programming semantics as discussed by Guy Steel in this presentation [1] ? I'd have to look deeper into it, but I'd be very interested in

Re: Literate programming

2011-10-27 Thread bernardH
Thank you for your persistence on this subject : I'm sure that I'm not the only lurker on this list that you manage to get interested in LP. I wanted to share two thought that I had when looking at your LP take on Clojure code : 1°) The infrsastructure should really lower the barrier to

Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-24 Thread bernardH
Thank you very much for the help ! On Jul 24, 2:30 pm, Chas Emerick cemer...@snowtide.com wrote: A couple of thoughts: You should be using 1.3.0-beta1 of Clojure 1.3 -- anything with -master-SNAPSHOT is woefully out of date at this point. Damned, I thought -master-SNAPSHOT was as snapshot

Re: [incanter]State, how to do it right ? (rng state for parallel computing)

2011-07-24 Thread bernardH
(@cej38: thanks for bringing that up to my radar ! However, I'd have to check the fine prints because I like the Open in OpenCL and dispise vendor lock-ins, no matter how shiny the shackles :) ) On Jul 24, 1:11 pm, Lee Spector lspec...@hampshire.edu wrote: On Jul 22, 2011, at 11:20 AM, bernardH

[parallel][incanter]State, how to do it right ? (rng state for parallel computing)

2011-07-23 Thread bernardH
Context : I'm currently comparing (ease of implementation *and* performance) C++ and Clojure (no flame war intented : I *love* them both) trying to find when / how one can code in Clojure rather than in C++. Problem : Rewriting some financial computing code, I was very pleased with my first

Needing type hinting help for number crunching

2011-07-23 Thread bernardH
Hi, I have rewritten some number crunching code from C++ to Clojure. I was pleasantly surprised to find that the Clojure code is within 10x of the C++ excecution time (both multicore implementations), but always eager for more speed, I (reluctantly) moved away from incanter (only used a couple of