Re: What Emacs framework do you prefer?

2021-08-10 Thread Jiacai Liu
https://github.com/flyingmachine/emacs-for-clojure I recommend flyingmachine's config, tailored for clojure development. Also his awesome book https://www.braveclojure.com/basic-emacs/ On Tue, Aug 10, 2021 at 10:50:04 AM +0800, Laws wrote: I've been away from Clojure for 3 years but I've deci

[ANN] blog-backup 0.2.0 (Backup blogposts to PDF)

2020-08-09 Thread Jiacai Liu
Hi Everyone, I'm glad to release 0.2.0 of blog-backup. New blogs can be supported in edn config file, no code required. https://github.com/jiacai2050/blog-backup Enjoy -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

[ANN] hystrix-dynamicvar -- Clojure dynamic var binding through hystrix command

2018-08-08 Thread Jiacai Liu
https://github.com/Netflix/Hystrix does its job quiet good. However, its thread-style isolation makes dynamic var not work any more. hystrix-dynamicvar to the rescue. More refer: - https://github.com/jiacai2050/hystrix-dynamicvar - https://github.com/Netflix/Hystrix/wiki/Plugins#concurrencystrategy

1.8 vs 1.9 performance

2017-12-24 Thread Jiacai Liu
Clojure 1.9 has been out for a while, are there any companies updating to Clojure 1.9 ? How is the performance compared to 1.8 ? Is the migration smooth? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@go

Re: Unexpected performace of transducers

2017-11-27 Thread Jiacai Liu
n; transducers can create it directly) > 5) you want a reusable transformation that can be used in multiple > contexts (reduction, sequence, core.async, etc) > > On Monday, November 27, 2017 at 8:33:50 PM UTC-6, Jiacai Liu wrote: >> >> > Also, most of the performance boo

Re: Unexpected performace of transducers

2017-11-27 Thread Jiacai Liu
> Also, most of the performance boost from transducers is due to less garbage being created, and some times the heap of the JVM is so large you'll never see much change from switching to transducers. Thanks for this tip. I seldom use transducers in my daily work, and I was convinced transducer

Re: [ANN] Ring Jetty servlet adapter

2017-11-19 Thread Jiacai Liu
etty much > exactly the same reason (the Hystrix metrics stream). Thanks for this, I'm > looking forward to trying it out. > > On Thu, Nov 16, 2017 at 5:23 AM Jiacai Liu wrote: > >> Fork of official jetty adapter >> <https://github.com/ring-clojure/ring/tree/master/ring

[ANN] Ring Jetty servlet adapter

2017-11-16 Thread Jiacai Liu
Fork of official jetty adapter enhanced with servlet-mapping support. Why another adapter Some Java libraries, such as hystrix-metrics-event-st

Re: Releasing scope-capture, a library for easing REPL-based debugging

2017-10-08 Thread Jiacai Liu
Wow, what a good idea. Thanks for sharing. On Mon, Oct 9, 2017 at 7:05 AM, Mike <145...@gmail.com> wrote: > Cool! Thanks, Val! > > воскресенье, 8 октября 2017 г., 10:09:19 UTC+3 пользователь Val Waeselynck > написал: > >> Hi, I'm happy to release a tiny Clojure/Script library called >> scope-capt

Re: The performance of plain map vs. defrecord

2017-10-08 Thread Jiacai Liu
> s t u w v x y z]) (def dummy-record (Alphabet. 0 1 2 3 4 5 6 7 8 9 10 11 12 > 13 14 15 16 17 18 19 20 21 22 23 24 25))) > > user=> (get dummy-record :a) > 0 > > After fixed, the benchmark result is as expected. > > > > 2017-10-08 16:40 GMT+08:00 Jiacai Liu : >

The performance of plain map vs. defrecord

2017-10-08 Thread Jiacai Liu
As I read JoyOfClojure, it says one of reasons that prefer record over plain map is speed, out of curiosity I test this using https://github.com/hugoduncan/criterium, but the result is just contrary to my expectation. record is slower than map. Is there any optimizations made to clojure 1.8.0

Re: [inheritable-var] A wrapper of InheritableThreadLocal to define thread-inheritable variable

2017-07-30 Thread Jiacai Liu
(when (= x (dec t)) > (print res))) > > > > > On Saturday, 29 July 2017 23:52:44 UTC-7, Jiacai Liu wrote: >> >> For your first example, we should decorate the executor future use, see >> TransmittableThreadLocal >> doc

Re: [inheritable-var] A wrapper of InheritableThreadLocal to define thread-inheritable variable

2017-07-29 Thread Jiacai Liu
a.lang.RuntimeException: Unable to resolve symbol: > foo in this context > > (def ^:dynamic bar "In main thread.") > (let [chan (async/chan)] > (binding [bar "In chan Thread."] >(async/go > (async/>! chan bar)) >(async/

Re: [inheritable-var] A wrapper of InheritableThreadLocal to define thread-inheritable variable

2017-07-29 Thread Jiacai Liu
Thanks for your tips. I have updated my code to wrap TransmittableThreadLocal , an enhanced version of InheritableThreadLocal, to solve threadpool problem. On Sunday, July 30, 2017 at 3:11:59 AM UTC+8, Didier wrote

[inheritable-var] A wrapper of InheritableThreadLocal to define thread-inheritable variable

2017-07-29 Thread Jiacai Liu
After digging into dynamic + binding doesn't work in multithread, I create a simple wrap to define thread-inheritable var. Any suggestions(bugs) are welcome. https://github.com/jiacai2050/inheritable-var -- You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: [ANN] Miraj: functional, idiomatic Clojure web programming, including web components

2017-06-18 Thread Jiacai Liu
Cool. One question: Is miraj compatible with https://github.com/weavejester/hiccup ? On Mon, Jun 19, 2017 at 2:29 AM, Gregg Reynolds wrote: > Hi folks, > > The goal of the Miraj project is to support web programming, including > definition and use of web components (specifically Polymer 1.9.x >

How to invoke StaticMethodExpr.eval?

2017-02-04 Thread Jiacai Liu
I am following this series to learn how clojure compiler works. I tried to invoke eval method of StaticMethodExpr using below codes (ns clojure.lang (:use clojure.core) (:import [clojure.lang Compiler Compiler$C]))

Re: Stack Overflow Question

2016-12-25 Thread Jiacai Liu
I have left a comment below your answer on StackOverflow, can you explain it a little more. thanks On Saturday, December 24, 2016 at 11:12:03 PM UTC+8, James Reeves wrote: > > On 24 December 2016 at 11:48, Jiacai Liu > > wrote: > >> how to make correct fn args when create f

Re: Stack Overflow Question

2016-12-24 Thread Jiacai Liu
27;~passed-param] > (let [param-keys# (vec (map (comp symbol name :key) > ~params)) >{:keys param-keys#} '~passed-param] >;; some check >~@body))) > > > > Sorry for brevity, I'm on my phone... > Dim

Re: Stack Overflow Question

2016-12-24 Thread Jiacai Liu
passed-param` in your arg-vector, and the same whenever > you use it inside the newly defined fn. > > > HTH, > > Dimitris > > On 24/12/16 11:48, Jiacai Liu wrote: > > how to make correct fn args when create fn using macro > http://stackoverflow.com/q/41312963/21634

Stack Overflow Question

2016-12-24 Thread Jiacai Liu
how to make correct fn args when create fn using macro http://stackoverflow.com/q/41312963/2163429?sem=2 -- 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

Re: ClojureScript Quick-Start node_repl java.lang.IllegalArgumentException: Value out of range for char: -1

2016-09-22 Thread Jiacai Liu
It turns out that jdk7 is to blame. When I change to jdk8, everything goes well. On Thu, Sep 22, 2016 at 2:08 PM, Jiacai Liu wrote: > http://stackoverflow.com/questions/39629743/clojurescript-quick-start- > node-repl-java-lang-illegalargumentexception-value-ou > > -- > You receiv

ClojureScript Quick-Start node_repl java.lang.IllegalArgumentException: Value out of range for char: -1

2016-09-21 Thread Jiacai Liu
http://stackoverflow.com/questions/39629743/clojurescript-quick-start-node-repl-java-lang-illegalargumentexception-value-ou -- 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 f

Re: why is it so annoying to run clojure code

2016-06-11 Thread Jiacai Liu
Thank all above suggestions, I have tried emacs + cider, which seems great for me <https://lh3.googleusercontent.com/-QH52eABuaY8/V1v__vICr_I/Aco/13kqdkItrlgdZL6ray3zBP_YrawCIiREgCLcB/s1600/Snip20160611_57.png> 在 2016年6月10日星期五 UTC+8上午12:08:39,Jiacai Liu写道: > > I star

why is it so annoying to run clojure code

2016-06-09 Thread Jiacai Liu
I started learning clojure recently, and I am annoyed at the way to run it (aka. lein run). why clojure script can't be run like python,ruby or scala, like python .py -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Clojure cons vs. conj

2014-04-24 Thread Jiacai Liu
riday, April 25, 2014 12:59:34 AM UTC+8, Guru Devanla wrote: > > Another option is to explore "concat" > > > On Thu, Apr 24, 2014 at 8:46 AM, Jiacai Liu > > wrote: > >> Well,I understand you. >> list only support front insert since it only takes O(1).

Re: Clojure cons vs. conj

2014-04-24 Thread Jiacai Liu
queue). >> >> You could work around it by reversing, consing, then reversing again, or >> just use vectors and conj if you're always working on the tail. >> >> >> On Thu, Apr 24, 2014 at 11:27 AM, Jiacai Liu >> > wrote: >> >>> Oh,Than

Re: Clojure cons vs. conj

2014-04-24 Thread Jiacai Liu
g to the > rest. Also, cons takes the sequence as the second argument. > > > On Thu, Apr 24, 2014 at 11:10 AM, Jiacai Liu > > wrote: > >> hi everyone: >> I use Clojure to solve SICP 2.22 >> <http://www.billthelizard.com/2011/01/sicp-221-223-mapping-over-list

Clojure cons vs. conj

2014-04-24 Thread Jiacai Liu
hi everyone: I use Clojure to solve SICP 2.22 . The problem is to rewrite a map fn in a iterative way,here it want to get the square of each element in a list Method 1: (defn square-list [items] (defn iter [things answe