Re: Making cryptograms, my first Clojure function. Feedback welcome.

2013-06-13 Thread Dan Neumann
I actually like the original lower/upper/digit the best: lower (seq "abcdefghijklmnopqrstuvwxyz") upper (seq "ABCDEFGHIJKLMNOPQRSTUVWXYZ") digit (seq "0123456789") It's just immediately obvious, especially for instance if you wanted to remove ambiguous chars like 0, O, l, I. On Wednesday, June

Re: Clojure in production

2013-06-13 Thread Rogier Peters
Really inspiring thread and a welcome stick to beat the "functional == academic" nay-sayers with! On Wed, Jun 12, 2013 at 10:30 PM, Jose A. Ortega Ruiz wrote: > > Hi Plinio, > > On Mon, Jun 10 2013, Plínio Balduino wrote: > > > Hi there > > > > I'm writing a talk about Clojure in the real world

Re: Clojure in production

2013-06-13 Thread rod naph
I work at boxuk.com, we have some internal apps, and a few small production services in Clojure. On Monday, June 10, 2013 10:47:25 PM UTC+1, Plinio Balduino wrote: > > Hi there > > I'm writing a talk about Clojure in the real world and I would like to > know, if possible, which companies are us

Re: Clojure in production

2013-06-13 Thread jan
Hi Plínio, at gateprotect, we use clojure in our firewall product for model representation and doing all the hard/logic work. Some stats: ~ 370 namespaces ~ 25000 sloc A great part of that is written in our model DSL. Cheers, Jan http://www.gateprotect.com We are hiring! http://www.gat

End user applications

2013-06-13 Thread Wolodja Wentland
Hi all, I was recently trying to find some applications written in Clojure that are meant for end users. The aim was to find those that would be interesting to a user even though the user does not know anything about Clojure or that the application is written in it. Given that Clojure is not that

ring 如何实现热加载代码?

2013-06-13 Thread stream
今天看了一下ring代码,想看一下,如何实现热加载clj代码。 我尝试 run-jetty :join true 导致server被阻塞,然后emacs nrepl 无法热加载代码。 改成 join false,jetty 进程不加入主进程里,才可以正常加载。 我翻查源码,没发现是如何分离server与逻辑代码,从而实现只热加载handler的。 哪位大神能科普一下呢,谢谢 -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: Clojure in production

2013-06-13 Thread Stas Krichevsky
Hi Plínio, We use Clojure for many of our backend services at kontera.com /stask On Tuesday, June 11, 2013 12:47:25 AM UTC+3, Plinio Balduino wrote: > > Hi there > > I'm writing a talk about Clojure in the real world and I would like to > know, if possible, which companies are using Clojure fo

Re: End user applications

2013-06-13 Thread Philip Potter
PuppetDB is another: http://docs.puppetlabs.com/puppetdb/latest/index.html We use PuppetDB at GOV.UK for host management and reporting purposes. Nobody else on my team really knows clojure, but nobody has to care because PuppetDB is self-contained. On 13 June 2013 10:01, Wolodja Wentland wrote:

Re: 请教一个问题

2013-06-13 Thread James Reeves
Leiningen plugins don't run in the project's environment, so they don't have access to the project's code or dependencies. In some cases you want to evaluate code in the project's environment, and Leiningen provides the eval-in-project function, which evaluates a quoted expression in the context o

Re: ring 如何实现热加载代码?

2013-06-13 Thread Stathis Sideris
Instead of doing: (defonce server (run-jetty my-app {:port 8080 :join? false})) do: (defonce server (run-jetty #'my-app {:port 8080 :join? false})) This is make the code reload every time you redefine my-app. Also see: http://stackoverflow.com/questions/2706044/how-do-i-stop-jetty-server-in-c

Re: End user applications

2013-06-13 Thread Aaron Cohen
What about Overtone? http://overtone.github.io/ On Thu, Jun 13, 2013 at 5:01 AM, Wolodja Wentland wrote: > Hi all, > > I was recently trying to find some applications written in Clojure that are > meant for end users. The aim was to find those that would be interesting > to a > user even though

extending a protocol to primitive arrays strange problem

2013-06-13 Thread Jim - FooBar();
Hi everyone, here is an odd one for you...I've got this tiny protocol: (defprotocol Normalisable (normalise [this transform-fn] [this transform-fn limits])) now, I'd like to have it extended to clojure native data-structures; no problem: (extend-protocol Normalisable java.l

Re: Clojure in production

2013-06-13 Thread Jay Fields
On Monday, June 10, 2013 5:47:25 PM UTC-4, Plinio Balduino wrote: > Hi there > > I'm writing a talk about Clojure in the real world and I would like to > know, if possible, which companies are using Clojure for production or > to make internal tools. > I've previously written about adopting C

bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
Hi all, can anyone explain why these 2 are different given the same protocol (the only difference is the swapped ordering)? (defprotocol FOO (bar [this a] [this a b]) ) (extend-protocol FOO ;;THIS WORKS (Class/forName "[D") (bar ([_ a] a) ([_ a b] (+ a b))) String (bar ([_ a] (str

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-13 Thread Steven Degutis
We've figured out a way to do groups in a simple, flexible way, that allows for probably everyone's use-cases. It requires a change to the spec and to how runners work. Here's an implementation similar to speclj: https://www.refheap.com/15744 And this is how clojure.test would be translated: https

'amap' issue after extending a protocol to a primitive array type

2013-06-13 Thread Jim - FooBar();
more weirdness! try this at your REPL: -extend any protocol to some primitive array type - let's say 'doubles' -while in the same namespace, try to use amap passing it an array of floats and also type-hint it with ^floats * **IllegalArgumentException No matching method found: aset clojure.la

End user applications

2013-06-13 Thread Thom Lawrence
getprismatic.com, orderharmony.com, www.rocketli.st are consumer focused apps written in Clojure. FlightCaster is hard to miss. -- -- 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 tha

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Marshall Bockrath-Vandegrift
"Jim - FooBar();" writes: > CompilerException java.lang.UnsupportedOperationException: nth not > supported on this type: Character, compiling:(NO_SOURCE_PATH:1:1) If you examine the implementation of `extend-protocol` and for how it distinguishes between additional functions being defined for a

while loop

2013-06-13 Thread Josh Kamau
Hi there ; How do i implement the following in clojure while((entry = stream.getNextEntry())!=null) { System.out.println(entry.getName()); } NOTE: calling getNextEntry moves the curse to the next entry. CONTEXT: I am trying to list the contents of a .zip file using http://docs.

Re: while loop

2013-06-13 Thread Plínio Balduino
I would use loop/recur something like this: (loop [item (get-next-entry)] (when item (do (do-something) (recur (get-next-entry On Thu, Jun 13, 2013 at 2:20 PM, Josh Kamau wrote: > Hi there ; > > How do i implement the following in clojure > > while((entry

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Leon Barrett
It shouldn't be necessary to examine the source to know what's going on in a builtin, really, but I also encountered this one recently. The way the extend-protocol macro finds which entries are types and which are function definitions is by checking which are lists. Frankly, a better macro woul

Re: while loop

2013-06-13 Thread Leon Barrett
Yeah, Clojure's while construct isn't really good at stuff like that. A loop is the basic thing I reach for, and I'd probably write it as: (loop [] (when-let [entry (.getNextEntry stream)] (println entry) (recur))) On Thursday, June 13, 2013 10:20:22 AM UTC-7, Josh Kamau wrote: > > Hi

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
On 13/06/13 18:16, Marshall Bockrath-Vandegrift wrote: "Jim - FooBar();" writes: CompilerException java.lang.UnsupportedOperationException: nth not supported on this type: Character, compiling:(NO_SOURCE_PATH:1:1) If you examine the implementation of `extend-protocol` and for how it distingui

Re: 'amap' issue after extending a protocol to a primitive array type

2013-06-13 Thread Aaron Cohen
Are you sure? user=> (defprotocol A (foo [a b])) A user=> (extend-protocol A (Class/forName "[D") (foo [a b] [a b])) nil user=> (pprint (foo (double-array [1 2 3]) 1)) [[1.0, 2.0, 3.0] 1] user=> (pprint (amap (float-array [1 2 3]) i ret (float (* 2 (aget ret i) [2.0, 4.0, 6.0] My guess is you

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
On 13/06/13 18:28, Leon Barrett wrote: It shouldn't be necessary to examine the source to know what's going on in a builtin, really, but I also encountered this one recently. The way the extend-protocol macro finds which entries are types and which are function definitions is by checking which

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
On 13/06/13 18:47, Jim - FooBar(); wrote: On 13/06/13 18:28, Leon Barrett wrote: It shouldn't be necessary to examine the source to know what's going on in a builtin, really, but I also encountered this one recently. The way the extend-protocol macro finds which entries are types and which are

Re: while loop

2013-06-13 Thread Aaron Cohen
I like the StackOverflow answer for this: http://stackoverflow.com/questions/5419125/using-java-api-from-clojure-reading-zip-file (defn entries [zipfile] (enumeration-seq (.entries zipfile))) (defn walkzip [fileName] (with-open [z (java.util.zip.ZipFile. fileName)] (doseq [e (ent

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
On 13/06/13 18:52, Jim - FooBar(); wrote: On 13/06/13 18:47, Jim - FooBar(); wrote: On 13/06/13 18:28, Leon Barrett wrote: It shouldn't be necessary to examine the source to know what's going on in a builtin, really, but I also encountered this one recently. The way the extend-protocol macro f

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Aaron Cohen
On Thu, Jun 13, 2013 at 1:52 PM, Jim - FooBar(); wrote: > > or can you perhaps show an example of successfully extending any protocol > to at least 2 primitive array types? > You can call extend-protocol several times: user=> (defprotocol A (foo [a b])) A user=> (extend-protocol A (Class/forNam

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Leon Barrett
On Thu, Jun 13, 2013 at 10:52 AM, Jim - FooBar(); wrote: > On 13/06/13 18:47, Jim - FooBar(); wrote: > >> On 13/06/13 18:28, Leon Barrett wrote: >> >>> It shouldn't be necessary to examine the source to know what's going on >>> in a builtin, really, but I also encountered this one recently. The wa

Re: Clojure in production

2013-06-13 Thread dgrnbrg
We are using Clojure at Two Sigma to monitor, schedule, and optimize our cluster. On a related note, we're hiring: http://functionaljobs.com/jobs/149-distributed-systems-developer-at-two-sigma-investments On Monday, June 10, 2013 5:47:25 PM UTC-4, Plinio Balduino wrote: > > Hi there > > I'm wr

Re: Making cryptograms, my first Clojure function. Feedback welcome.

2013-06-13 Thread Alan Thompson
Looks nice, although I like Dan's explicit definition of char sequences. One thing that threw me at first was the double arg in the function #(encrypt % %). It took a while before I realized you were supplying each character as both the map key value and a default return value (thus, a non-alphan

Clojure generates unnecessary and slow type-checks

2013-06-13 Thread Leon Barrett
Hi. I've been working with people at Prismatic to optimize some simple math code in Clojure. However, it seems that Clojure generates an unnecessary type check that slows our (otherwise-optimized) code by 50%. Is there a good way to avoid this, is it a bug in Clojure 1.5.1, or something else? W

Re: while loop

2013-06-13 Thread Josh Kamau
Thanks guys i have now have a bunch of solutions to try out ;) Josh On Thu, Jun 13, 2013 at 8:57 PM, Aaron Cohen wrote: > I like the StackOverflow answer for this: > > > http://stackoverflow.com/questions/5419125/using-java-api-from-clojure-reading-zip-file > > (defn entries [zipfile] >

[ANN] edn-java 0.4.2 released

2013-06-13 Thread Ben Smith-Mannschott
edn-java [1] is a parser and printer for edn [2]. This release fixes issue #32 [3] "EDN List, Vector types indistinguishable due to common RandomAccess interface". It should be available on Maven Central within a day. // Ben [1] http://edn-java.bpsm.us [2] https://github.com/edn-format/edn [3]

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
I wish I could...if I do that I can't call amap on any other primitive array but the first extended - I get the exception I posted earlier and it has nothing to do with type hinting the array. I'm type-hinting it in both cases: IllegalArgumentException No matching method found: aset clojure.l

Re: Clojure in production

2013-06-13 Thread Leon Barrett
At The Climate Corporation (formerly Weatherbill), we do much, though not all, of our development in Clojure. On Thursday, June 13, 2013 11:45:42 AM UTC-7, dgrnbrg wrote: > > We are using Clojure at Two Sigma to monitor, schedule, and optimize our > cluster. > > On a re

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
an epiphany finally!!! while writing my response previously I realised that adding 2 numbers of different type usuallly returns either a double or a long. That was the source of confusion... I need to coerce whatever number my fn is returning to the type the array is expecting (duh!) I feel

Re: End user applications

2013-06-13 Thread Karsten Schmidt
Hey, just recently I've completed my first full Clojure client project, the new identity for Leeds College of Music. Some pretty pictures: http://flickr.com/toxi/sets/72157630719227308/ The project is a 3-tier system, consisting of: 1) OSX app with custom OpenGL GUI to create & preview new brand

Re: Clojure generates unnecessary and slow type-checks

2013-06-13 Thread Jason Wolfe
Taking a step back, the core problem we're trying to solve is just to sum an array's values as quickly as in Java. (We really want to write a fancier macro that allows arbitrary computations beyond summing that can't be achieved by just calling into Java, but this simpler task gets at the crux

Re: Clojure in production

2013-06-13 Thread Karsten Schmidt
Just for completeness' sake, my two pence: https://groups.google.com/d/msg/clojure/Z995K48BZGA/IDSAEm-PKFkJ >> On Monday, June 10, 2013 5:47:25 PM UTC-4, Plinio Balduino wrote: >>> >>> Hi there >>> >>> I'm writing a talk about Clojure in the real world and I would like to >>> know, if possible, wh

Re: End user applications

2013-06-13 Thread Daniel Pittman
On Thu, Jun 13, 2013 at 2:41 AM, Philip Potter wrote: > > PuppetDB is another: > http://docs.puppetlabs.com/puppetdb/latest/index.html > > We use PuppetDB at GOV.UK for host management and reporting purposes. > Nobody else on my team really knows clojure, but nobody has to care > because PuppetDB

Re: Clojure in production

2013-06-13 Thread Deepak Giridharagopal
On Monday, June 10, 2013 3:47:25 PM UTC-6, Plinio Balduino wrote: > Hi there > > I'm writing a talk about Clojure in the real world and I would like to > know, if possible, which companies are using Clojure for production or > to make internal tools. > Puppet Labs (http://puppetlabs.com) uses

Re: Clojure in production

2013-06-13 Thread Travis Vachon
We've used Clojure at Copious (http://copious.com) to build our activity feed (http://www.youtube.com/watch?v=0l7Va3-wXeI) and a number of backend services. We're definitely looking to use it even more in the future: it's the cat's pajamas. On Thu, Jun 13, 2013 at 2:07 PM, Deepak Giridharagopal

Re: Clojure in production

2013-06-13 Thread Zhemin Lin
We use Clojure in some backend services in Trend Micro. -- -- 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 fir

Re: End user applications

2013-06-13 Thread Ron Toland
At rewryte.com, we use Clojure for all our back- end data processing. -- -- 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

Re: Clojure in production

2013-06-13 Thread Korny Sietsma
We're building a few clojure projects at IOOF (a large Australian superannuation firm) - the biggest is a transformation and routing system for communicating with other superannuation companies, written in clojure for the back end, and angular.js for the UI. (It's technically in "production" but t

Re: Clojure in production

2013-06-13 Thread Stuart
We use Clojure across several APIs and for data analysis at SmartBIM in Atlanta, and we're hiring! Send me an email at stuart.hinson at the company's domain if you're local and interested On Thursday, June 13, 2013 5:07:07 PM UTC-4, Deepak Giridharagopal wrote: > > On Monday, June 10, 2013 3:47:

Re: End user applications

2013-06-13 Thread Wolodja Wentland
On 14 Jun 2013 05:37, "Ron Toland" wrote: > > At rewryte.com, we use Clojure for all our back- end data processing. Sure, but I was rather looking for actual applications that can be downloaded and installed locally. It wasn't really my intention to compile a list of companies that use Clojure so

Re: End user applications

2013-06-13 Thread Wolodja Wentland
On 13 Jun 2013 11:42, "Philip Potter" wrote: > > PuppetDB is another: > > http://docs.puppetlabs.com/puppetdb/latest/index.html > > We use PuppetDB at GOV.UK for host management and reporting purposes. > Nobody else on my team really knows clojure, but nobody has to care > because PuppetDB is self

Re: End user applications

2013-06-13 Thread Wolodja Wentland
On 13 Jun 2013 15:31, "Aaron Cohen" wrote: > > What about Overtone? http://overtone.github.io/ Overtone is certainly great, but I would rather classify it as a library as you still have to write programs to use it. There might be an independent UI these days that I am unfamiliar with though. > >

Re: while loop

2013-06-13 Thread Meikel Brandmeyer (kotarak)
Hi, another way if it's not an enumeration or the like: (doseq [entry (repeatedly #(.getNextEntry stream)) :while entry] (println (.getName entry))) Kind regards Meikel -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, se

Re: while loop

2013-06-13 Thread Josh Kamau
Thanks Meikel. That works exactly as i wanted. Now, how can i put all the "names" in a vector ? On Fri, Jun 14, 2013 at 9:19 AM, Meikel Brandmeyer (kotarak) wrote: > Hi, > > another way if it's not an enumeration or the like: > > (doseq [entry (repeatedly #(.getNextEntry stream)) :while entry]

Re: while loop

2013-06-13 Thread Josh Kamau
I figured it out... with a for loop. THanks Josh On Fri, Jun 14, 2013 at 9:40 AM, Josh Kamau wrote: > Thanks Meikel. That works exactly as i wanted. Now, how can i put all the > "names" in a vector ? > > > On Fri, Jun 14, 2013 at 9:19 AM, Meikel Brandmeyer (kotarak) > wrote: > >> Hi, >> >> an

Re: while loop

2013-06-13 Thread Meikel Brandmeyer (kotarak)
Am Freitag, 14. Juni 2013 08:40:51 UTC+2 schrieb Josh Kamau: > Thanks Meikel. That works exactly as i wanted. Now, how can i put all the > "names" in a vector ? > By switching from doseq to for: (vec (for [entry repeatedly #(.getNextEntry stream) :while entry] (.getName entry))) or (->> (rep