Output of printf is buffered

2014-04-10 Thread Cecil Westerhof
I have the following simple program: (def time-format (new java.text.SimpleDateFormat "hh:mm:ss")) (defn now [] (new java.util.GregorianCalendar)) (defn give-message [message] (printf "%s: %s\n" (. time-format format (. (now) getTime)) message)) (give-message "Start")

Re: Output of printf is buffered

2014-04-10 Thread Kevin Ilchmann Jørgensen
I believe this is how the terminal behave. You can force an (clojure.core/flush) /Kevin On Thu, Apr 10, 2014 at 12:34 PM, Cecil Westerhof wrote: > I have the following simple program: > (def time-format (new java.text.SimpleDateFormat "hh:mm:ss")) > > (defn now [] > (new java.util

Re: Output of printf is buffered

2014-04-10 Thread Cecil Westerhof
2014-04-10 12:52 GMT+02:00 Kevin Ilchmann Jørgensen : > I believe this is how the terminal behave. You can force an > (clojure.core/flush) > But why does println not behave this way? I think I stick to println for the moment. On Thu, Apr 10, 2014 at 12:34 PM, Cecil Westerhof wrote: > >> I have

Re: Output of printf is buffered

2014-04-10 Thread Di Xu
there're three buffer mode in unix, line buffered, full buffered and no buffered, if the output is terminal then it's default to line buffered. That means it buffer the output until '\n' occurs, you can force output via flush. Thanks, Di Xu 2014-04-10 19:30 GMT+08:00 Cecil Westerhof : > 2014-04

Re: Output of printf is buffered

2014-04-10 Thread Cecil Westerhof
2014-04-10 13:40 GMT+02:00 Di Xu : > there're three buffer mode in unix, line buffered, full buffered and no > buffered, if the output is terminal then it's default to line buffered. > That means it buffer the output until '\n' occurs, you can force output via > flush. > The printf format string

Re: Output of printf is buffered

2014-04-10 Thread Kevin Ilchmann Jørgensen
nREPL server started on port 53667 on host 127.0.0.1 REPL-y 0.3.0 Clojure 1.5.1 Docs: (doc function-name-here) (find-doc "part-of-name-here") Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) Results: Stored in

Re: Output of printf is buffered

2014-04-10 Thread Di Xu
Well, I'm not very familiar with buffer in java. But I think it's always safe to call flush if you want to see the output immediately. 2014-04-10 19:50 GMT+08:00 Cecil Westerhof : > 2014-04-10 13:40 GMT+02:00 Di Xu : > > there're three buffer mode in unix, line buffered, full buffered and no >>

Re: Output of printf is buffered

2014-04-10 Thread Cecil Westerhof
2014-04-10 14:13 GMT+02:00 Di Xu : > Well, I'm not very familiar with buffer in java. But I think it's always > safe to call flush if you want to see the output immediately. > The problem (in my opinion) is that you do not expect println and printf to behave differently. I would expect that both

Clojure Office Hours

2014-04-10 Thread Leif
Hi, everybody. Inspired by the SF Bay Area clojure group, ClojureBridge, and the great talks on community education from Clojure/West on youtube, I've decided to try holding my own personal Clojure office hours (online). I am personally of the opinion that face-to-face interaction is superior,

Re: Om and core.async: Necessary together?

2014-04-10 Thread Mike Haney
Thanks for the clarification, that helps a lot. And I agree you wouldn't expose channels in the public API for a component, that's definitely an implementation detail. I have more ideas/questions on the topic, but I don't want to hijack this thread, and I probably need to spend some more hammo

Re: Real World Example

2014-04-10 Thread Mike Haney
I'm in the early stages of developing a real-world app for a customer that will use a full clojure stack. It's maybe not as sexy as all the social networking examples you see, but I think it's more representative of the types of apps most people write to satisfy real business needs. The app is

Re: What's the difference between -?> and some-> ?

2014-04-10 Thread Timothy Washington
Good question. I've been rooting around arrow land for the past few days. *some->* , now a part of clojure.core, was originally in core.incubator as *-?>*. From the documentation, it's the *same as clojure.core/-> but returns nil as soon as the threaded value is nil itself (thus short-circuiting a

Re: Clojure Office Hours

2014-04-10 Thread Marcus Blankenship
Thanks, Leif, I greatly enjoyed our first session and look forward to the next! On Apr 10, 2014, at 5:53 AM, Leif wrote: > Hi, everybody. Inspired by the SF Bay Area clojure group, ClojureBridge, and > the great talks on community education from Clojure/West on youtube, I've > decided to try

Re: Clojure Office Hours

2014-04-10 Thread Colin Fleming
Hi Leif, This sounds like a very interesting project, please report back and let us know how it went! I'd be very interested to know. Cheers, Colin On 11 April 2014 00:53, Leif wrote: > Hi, everybody. Inspired by the SF Bay Area clojure group, ClojureBridge, > and the great talks on communit

Re: Real World Example

2014-04-10 Thread Anthony Ortiz
Oh that would be very nice! On Thursday, April 10, 2014 9:22:35 AM UTC-4, Mike Haney wrote: > > I'm in the early stages of developing a real-world app for a customer that > will use a full clojure stack. It's maybe not as sexy as all the social > networking examples you see, but I think it's mo

Re: Real World Example

2014-04-10 Thread Marcus Blankenship
Hey Mike, are you doing this as a one-man-show? On Apr 10, 2014, at 6:22 AM, Mike Haney wrote: > I'm in the early stages of developing a real-world app for a customer that > will use a full clojure stack. It's maybe not as sexy as all the social > networking examples you see, but I think it's

Re: Clojure Office Hours

2014-04-10 Thread Timothy Washington
Sounds great. I just sent a request. Tim Washington Interruptsoftware.com On Thu, Apr 10, 2014 at 9:43 AM, Colin Fleming wrote: > Hi Leif, > > This sounds like a very interesting project, please report back and let us > know how it went! I'd be very interested to

Advice for building backend REST services from scratch using clojure

2014-04-10 Thread Kashyap CK
Hi, I have the opportunity to build a set of services from scratch. I plan to use clojure for this. I'd like to experiment with options available out there - options such as - what webserver, what database etc. I'd like it very much if you could share some of your experiences in this and possibl

Re: Real World Example

2014-04-10 Thread Timothy Washington
I've also had a lot of success with Prismatic's Schemalibrary. I've found it to be a good middle ground between type hints, Protocols, etc, and a full blown type system, such as core.typed . Hth Tim Washington Interrupt

Re: Clojure + BDD + TDD + Pairing...

2014-04-10 Thread Timothy Washington
I'm also keen. I'm on EST (GMT - 5). Saturdays and Sundays are good for me. But weekday evenings would also work. Tim Washington Interruptsoftware.com On Wed, Mar 26, 2014 at 4:51 PM, Brian Muhia wrote: > Hi Josh, > I'm interested in pairing as well. I'm also bas

Using parallellisation

2014-04-10 Thread Cecil Westerhof
I have the following in my code: (let [val (Math/sqrt i) diff (Math/abs (- (Math/pow val 2) (* val val)))] I expect that calculating the difference is the most expensive part of my code. I understood that Clojure is very good in parallellisation. How would I let (Math/pow val 2)

Re: Using parallellisation

2014-04-10 Thread Andy Fingerhut
Forcing small bits of computation to be done in parallel using the tools Clojure and the JVM have at hand, e.g. pmap, future, etc., which rely on creating JVM Thread objects, tends to slow things down rather than speed things up, because the extra overhead of creating threads and waiting for them t

Re: Using parallellisation

2014-04-10 Thread Timothy Baldridge
Some would also argue that any parallelism system is going to slow down code as trivial as this. Never underestimate the power of properly optimized single threaded code :-). But yes, futures are the way to go if you want to execute a given expression on a different thread. On Thu, Apr 10, 2014

[ANN] Zengarden. A Clojure library for generating CSS

2014-04-10 Thread Timothy Washington
Zengarden is a riff on Joel Holdbrooks' excellent gardenlibrary. Zengarden is a simple tool for generating CSS in Clojure. The goal is to cover most of CSS3. The spirit of the library is to have declarative s

Re: Real World Example

2014-04-10 Thread Mike Haney
Yes, it's just me. Crazy, right? Like I said, I wouldn't even have attempted it without the productivity gains I've seen since I've started using clojure. Fortunately, the customer isn't in "we need this yesterday" mode (a refreshing, but rare, circumstance). -- You received this message bec

Re: STM and persistent data structures performance on mutli-core archs

2014-04-10 Thread Justin Smith
One could quantify this with Category Theory. In order to map from one domain to another reversibly, the target domain must have at least as many elements as the source domain, if not more. An abstraction which simplifies by reducing the number of elements in play is guaranteed to be "leaky". O

Re: What's the difference between -?> and some-> ?

2014-04-10 Thread Plínio Balduino
Thank you very much Plínio On Thu, Apr 10, 2014 at 10:37 AM, Timothy Washington wrote: > Good question. I've been rooting around arrow land for the past few days. > > *some->* , now a part of clojure.core, was originally in core.incubator > as *-?>*. From the documentation, it's the *same as cl

Re: "true" lightweight threads on clojurescript?

2014-04-10 Thread Marc Boschma
Maybe I am missing a point but wouldn't it be better to restructure to use web workers and have a UI layer that all apps (different workers) could utilise for interactions with the user ? Marc > On 10 Apr 2014, at 12:12 am, t x wrote: > > Regarding yield: > > Understood, thanks for clarifyi

Re: Real World Example

2014-04-10 Thread Karsten Schmidt
Hi Anthony, unfortunately I can't point you to actual code examples (since this was work for a client), but I've got some screenshots & screenrecordings of a few OpenGL/CL desktop apps written in Clojure. Both of them don't use Swing for UI, but a custom widget system sitting straight on OpenGL2+ (

[ANN] iroh 0.1.9 - class reflection and exploration

2014-04-10 Thread zcaudate
A library for hacking and exploring the jvm: Whats New 0.1.9 - .> macro now supports both .accessors and :accessor calls - delegate added for better object support 0.1.6 Changed syntax: - .$ to .> (threading

Re: Clojure + BDD + TDD + Pairing...

2014-04-10 Thread Marcus Blankenship
Hi Tim, awesome news!. I've had other folks today asking about it as well. Any idea how we could use a shared calendar to let people put down their availability, and then others can "claim" a spot to work with them? Or, maybe that's a Clojure project we should work on! ;-) But really, idea

ANN Elastisch 2.0.0-beta4 is released

2014-04-10 Thread Michael Klishin
Elastisch [1] is a small, feature complete Clojure client for ElasticSearch. Release notes: http://blog.clojurewerkz.org/blog/2014/04/11/elastisch-2-dot-0-0-beta4-is-released/ 1. http://clojureelasticsearch.info -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- You r

Re: Using parallellisation

2014-04-10 Thread Cecil Westerhof
2014-04-10 16:45 GMT+02:00 Andy Fingerhut : > Forcing small bits of computation to be done in parallel using the tools > Clojure and the JVM have at hand, e.g. pmap, future, etc., which rely on > creating JVM Thread objects, tends to slow things down rather than speed > things up, because the extr

Re: Advice for building backend REST services from scratch using clojure

2014-04-10 Thread Arun Augustine
Look into: https://github.com/pedestal/pedestal http://www.datomic.com/ On Thursday, 10 April 2014 07:13:19 UTC-7, Kashyap CK wrote: > > Hi, > I have the opportunity to build a set of services from scratch. I plan to > use clojure for this. > I'd like to experiment with options available out ther

Re: [ANN] Zengarden. A Clojure library for generating CSS

2014-04-10 Thread Dave Sann
what is different from what Joel already did? I think Joel was asking for input to help develop garden further it would be great to see efforts go into one thing - unless you have really divergent ideas Dave On Friday, 11 April 2014 01:07:47 UTC+10, frye wrote: > > Zengarden is a riff on

Re: Using parallellisation

2014-04-10 Thread Andy Fingerhut
Your check-concurrent2 is a much better way to use parallelism in your program -- create a few threads, each of which does a lot of work. I haven't analyzed the values you are computing in detail, but note that your program still has lots of inter-thread 'communication' because of the use of a com

Re: Advice for building backend REST services from scratch using clojure

2014-04-10 Thread Leif
I think you are not getting a lot of replies because a question about generic "services" leaves the design space way too large. The choice of webserver and especially the database are going to depend strongly on the required throughput, latency, access patterns, lots of other things I'm not th

Re: Real World Example

2014-04-10 Thread Anthony Ortiz
Wow, this is awesome! Thanks for posting this, I'm going through it as soon as I'm done with dinner! On Thursday, April 10, 2014 5:00:07 PM UTC-4, Karsten Schmidt wrote: > > Hi Anthony, unfortunately I can't point you to actual code examples > (since this was work for a client), but I've got som

Re: Advice for building backend REST services from scratch using clojure

2014-04-10 Thread Kashyap CK
Thanks Leif and Arun ... I will try out your suggestions. I'll have something up and play a bit and come back with more specifics. Regards, Kashyap On Friday, April 11, 2014 6:53:04 AM UTC+5:30, Leif wrote: > > I think you are not getting a lot of replies because a question about > generic "se

Re: Clojure Office Hours

2014-04-10 Thread Leif
Hmm... less interest than I'd expected, given recent posts. Maybe I should rename the thread to "Free Clojure Consulting / Tutoring." Tht's not spammy. FYI, all bookings are automatically confirmed, so don't fret if I don't instantly respond. @Tim: Sounds good! Of course, now I'll have

Re: [ANN] Zengarden. A Clojure library for generating CSS

2014-04-10 Thread Timothy Washington
I actually did take Joel up on his offer. But my feature requests are on the back burner for the moment. I happen to be building a product, that needs what Zengarden provides. Mainly authoring gnarly things like @import, @media queries, pseudo classes, etc, *declaratively, from edn*. That was the

[ANN] lein-generate 0.1.0

2014-04-10 Thread James Reeves
lein-generate is a Leiningen plugin that complements the built-in "lein new" task with a "lein generate" task. While "lein new" creates new projects from templates, "lein generate" creates new files in existing projects. New generators can be added li

Re: [ANN] iroh 0.1.9 - class reflection and exploration

2014-04-10 Thread zcaudate
Please use 0.1.10 update. clojure 1.6 does not load clojure.walk and clojure.set automatically anymore. -- 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: Using parallellisation

2014-04-10 Thread Cecil Westerhof
2014-04-11 3:10 GMT+02:00 Andy Fingerhut : > Your check-concurrent2 is a much better way to use parallelism in your > program -- create a few threads, each of which does a lot of work. > > I haven't analyzed the values you are computing in detail, but note that > your program still has lots of int