Re: bit-wise operators for bigint in Clojure

2020-06-02 Thread Niels van Klaveren
Clojure often leaves implementations to the backing platforms, and Clojurescript probably has no difference in the methods of the different numerical types. Java does, so you'd have to fall back on that. Something like: (defn big-or [f & r] (reduce (fn [acc v] (.or acc (biginteger v))) (bigi

Re: bit-wise operators for bigint in Clojure

2020-06-02 Thread Niels van Klaveren
Clojure 1.10: (and 4N 8N (bigint Integer/MAX_VALUE)) => 2147483647N (or 4N 8N (bigint Integer/MAX_VALUE)) => 4N On Tuesday, May 26, 2020 at 6:39:51 PM UTC+2, Harmon Nine wrote: > > Hello. > > I noticed a post about this from 2013, so doing a bump. > > The bit-wise operators appear to be support

Re: [ANN] metasoarous/oz 1.5.1 - clojure dataviz updates (jupyter notebooks, markdown extensions, and static export, oh my!)

2019-01-23 Thread Niels van Klaveren
Thanks for this, Christopher. Oz has very rapidly become my go-to visualization library due to it's simplicity and exchange capabilities. On Wednesday, January 23, 2019 at 9:26:00 AM UTC+1, Christopher Small wrote: > > > Greetings > > > I'm excited to announce the release of oz 1.5.1. > > https

Re: [HEADS-UP] CFP for Dutch Clojure Day 2018 closes in 9 days

2018-02-19 Thread Niels van Klaveren
Eventbrite says "Sale ended". Did tickets go that fast or is it some hickup ? On Monday, February 19, 2018 at 9:47:00 AM UTC+1, Vijay Kiran wrote: > > Hello All, > > Just wanted to give you a heads-up for Dutch Clojure Day - a free one day > Clojure conference in Amsterdam. This is a conference

Re: what does future do after fn finish ?

2018-02-02 Thread Niels van Klaveren
+1 for Claypoole, it removed the needs of using agents or futures in 95% of the cases in my code. On Thursday, February 1, 2018 at 9:54:36 PM UTC+1, Alan Thompson wrote: > > You may find that using the Claypoole library is the easiest way to handle > threadpools: https://github.com/TheClimateC

Re: Get Lein to run 32-bit JVM on Windows

2016-07-06 Thread Niels van Klaveren
If system/getProperty "os.arch" says it's 64 bits, it means the processor is a 64 bits compatible processor, not that the Java process is 64 or 32 bits. If you want to see what the JVM data model is you need to use (System/getPropery "sun.arch.data.model") and see what it returns (either "32"

which GC optimizations work better with Clojure?

2016-04-30 Thread Niels van Klaveren
GC parameters used by a lot of projects are handed down like traditions for years, even spreading to others. They're almost never re-evaluated, which means they might actually lose out on new performance improvements, or worse, might even cause performance regressions. Most parameters in the Ov

Re: Porting Clojure to Native Platforms

2016-04-26 Thread Niels van Klaveren
The only conclusion I can draw from these benchmarks over the years is that the speed of Clojure is inversely proportional to it's idiomaticity On Tuesday, April 26, 2016 at 7:23:48 AM UTC+2, Mars0i wrote: > > On Tuesday, April 26, 2016 at 12:19:23 AM UTC-5, Mars0i wrote: >> >> I was going to say

Re: Advice getting started with concurrency and parallelism in Clojure

2016-04-07 Thread Niels van Klaveren
The biggest problem with pmap I have is ordering, ie. it will process in batches of (+ 2 (.. Runtime getRuntime availableProcessors)), and only take a new batch when the slowest of the old batch has been evaluated. With functions dependent on IO, parallel gains are only a fraction of what they

Re: Protocols in another namespace, retract-type possible ?

2016-04-04 Thread Niels van Klaveren
no-op gets optimized away by the JVM. On Thursday, March 24, 2016 at 10:14:11 AM UTC+1, Niels van Klaveren wrote: > > In a project using clojure.java.jmx, I was extending it's Destract protocol > object->data function to transform more of the JMX data structures > returned

Re: Reworking :pre condition to add an error message

2016-03-30 Thread Niels van Klaveren
Truss also has good support for :pre and :post conditions On Monday, July 11, 2011 at 7:40:48 PM UTC+2, frye wrote: > > Note: This message was originally posted by ' Shantanu' on the

Re: flowchart for choosing the right Clojure parallel primitives?

2016-03-30 Thread Niels van Klaveren
Thanks, that's a really nice overview for the possible parallel processing options in clojure. On Tuesday, March 29, 2016 at 9:53:32 PM UTC+2, David Della Costa wrote: > > Hi Sergey, I don't have a direct answer for you but this talk at > Clojure/West 2015 by Leon Barrett went over the various o

Protocols in another namespace, retract-type possible ?

2016-03-24 Thread Niels van Klaveren
In a project using clojure.java.jmx, I was extending it's Destract protocol object->data function to transform more of the JMX data structures returned from calls or metadata queries into plain clojure data structures. When I was done with the individual data structures, it should have been po

Re: Poor parallelization performance across 18 cores (but not 4)

2015-11-17 Thread Niels van Klaveren
Could you also show how you are running these functions in parallel and time them ? The way you start the functions can have as much impact as the functions themselves. Regards, Niels On Tuesday, November 17, 2015 at 6:38:39 AM UTC+1, David Iba wrote: > > I have functions f1 and f2 below, and l

Re: clojure.java.jdbc prepared select statement

2015-11-09 Thread Niels van Klaveren
would be almost just as effective, but 60% is no small difference. I'll definitely keep this in mind whenever I do need to repeat queries and transactions. Monday, November 9, 2015 at 7:11:48 PM UTC+1, Sean Corfield wrote: > > Niels van Klaveren wrote on Monday, November 9, 2015 at 7:2

Re: clojure.java.jdbc prepared select statement

2015-11-09 Thread Niels van Klaveren
Performance wise the conclusion is batch queries done this way are around 60% faster than doing separate queries for even very simple queries. On Monday, November 9, 2015 at 11:45:48 AM UTC+1, Niels van Klaveren wrote: > > While answering this question > <http://stackoverflow.c

Re: clojure.java.jdbc prepared select statement

2015-11-09 Thread Niels van Klaveren
ot;c" "d" "e" "f"] On Monday, November 9, 2015 at 11:45:48 AM UTC+1, Niels van Klaveren wrote: > > While answering this question > <http://stackoverflow.com/questions/33600132/checking-if-uuid-exists-in-postgresql-table-using-clojure-java-jdbc-db

clojure.java.jdbc prepared select statement

2015-11-09 Thread Niels van Klaveren
While answering this question on stackoverflow about do-prepared I wanted to show the way to do multiple queries with the same prepared statement (bat

Re: Cursive and gen-class

2015-08-25 Thread Niels van Klaveren
If you had read more attentively, he uninstalled Cursive because he suspected a reinstall might fix an error. However, the error was caused because in Cursive, an extra step is necessary configuring the project to make gen-class work in certain situations, so the unistall was unnecessary. When

Re: awful performance on Windows 7 compared to anything else

2015-07-08 Thread Niels van Klaveren
Fluid Dynamics wrote: > > On Wednesday, July 8, 2015 at 5:41:47 AM UTC-4, Niels van Klaveren wrote: >> >> Colin, be aware that running through service wrappers can introduce a lot >> of overhead / blocking on logging due to stdout redirects. >> Our application had to switc

Re: awful performance on Windows 7 compared to anything else

2015-07-08 Thread Niels van Klaveren
Colin, be aware that running through service wrappers can introduce a lot of overhead / blocking on logging due to stdout redirects. Our application had to switch to SLF4J / Logback, since logging with JUL, Log4J or to console / stdout and incorrectly configuring the wrapper could lead to 100 ms

Re: Why aren't libraries like clojure/(data.csv, ...) on clojars.org?

2015-05-11 Thread Niels van Klaveren
Code that does consume artifacts would never be complete with just adding maven central or having libraries duplicated on clojars. It should use the repo info from lein or maven to include local, snapshot and other external repositories, like lein ancient does. -- You received this message bec

Re: Extend java class to participate in sequence operations

2015-03-17 Thread Niels van Klaveren
If a java class implements Iterable, it automatically supports seq. On Tuesday, March 17, 2015 at 11:34:17 AM UTC+1, juvenn wrote: > > Dear all, > > Given a node type from singly linked list: > > class Node { > int val; > Node next; > } > > How do I extend it so `(seq node)` will return a sequenc

Re: Current best-of-breed JDBC libraries?

2015-02-24 Thread Niels van Klaveren
Perhaps I'm missing something, but I don't really see the advantages of yesql over standard parametrized clojure.java.jdbc queries ? -- 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 th

Re: Current best-of-breed JDBC libraries?

2015-02-24 Thread Niels van Klaveren
I've done a fair bit of complex SQL with honeysql, and must say it rocks. It could use a bit more documentation where extending it with new clauses is concerned, though. For my latest project being able to manipulate the datastructures that are rendered to SQL was crucial, and honeysql was the

Re: Hi I am a new user of clojure ,I am not being able to use lein

2015-01-27 Thread Niels van Klaveren
There are some problems with the lein MSI and Chocolaty installs, because of wget/curl certificate handling on Windows. If you use lein.bat without wget or curl (you can remove wget or curl exes from the lein.bat directory), lein will default to Powershell for downloading which works as intende

Re: Open html file in Clojure

2014-12-08 Thread Niels van Klaveren
Perhaps it could be as simple as browse-url .. On Monday, December 8, 2014 5:44:10 PM UTC+1, daveray wrote: > > Nope. It barely renders HTML3. JavaFX, I think, has a real embedded > browser component. And, of course, it's always easy to jus

Re: Nightcode problem

2014-12-07 Thread Niels van Klaveren
Nightcode is starting a 32 bits version of the JVM which only supports a max of 2 Gb continuos memory. Install a 64 bits JVM or lower the Xmx to 1500m. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googl

Re: Getting sick and tired of "[trace missing]"

2014-12-04 Thread Niels van Klaveren
On Wednesday, December 3, 2014 11:53:02 PM UTC+1, Laurent PETIT wrote: > > > Hello Niels, > > that's interesting. Would it deserve that CCW adds this option > automatically when asked to start a REPL ? I could probably easily do this > in both cases : when the REPL start is delegated to Leinin

Re: Getting sick and tired of "[trace missing]"

2014-12-03 Thread Niels van Klaveren
I'm sure first thing in the morning there'll be someone at Larry Ellison's door clamoring for removal of hotspot optimization from the JVM.. On Wednesday, December 3, 2014 10:41:34 PM UTC+1, Sam Ritchie wrote: > > The first result of googling > > jvm "[trace missing]" > > is really helpful here.

Re: Getting sick and tired of "[trace missing]"

2014-12-03 Thread Niels van Klaveren
This isn't a CCW exclusive issue, but the Oracle JVM 'optimizing away' stacktraces. It can be remedied by adding the '-XX:-OmitStackTraceInFastThrow' flag to the JVM startup parameters of the process you're starting. If Leiningen is used to start the JVM, add the following setting to your lein

Re: is any work done to draw sequence diagrams with drcode/vijual ?

2014-12-02 Thread Niels van Klaveren
AFAIK there's several libraries for interfacing with graphviz, all coming from a slightly different angle - drcode/vijual - Emphasis on ascii graphics, alternately output to graphviz - daveray/dorothy

Re: Core.async unordered pipeline-blocking ?

2014-11-28 Thread Niels van Klaveren
in these functions is in handling > exceptions and orchestrating shutdown. > > I put my version up in a gist with some other async utility functions I > wrote: https://gist.github.com/favila/8e7ad6ea5b01bd7466ff > You are looking for fast-pipeline-blocking. > > On Thursday, Novem

Core.async unordered pipeline-blocking ?

2014-11-27 Thread Niels van Klaveren
Recently in creating load testing I've been in need of throttling certain mixed IO/CPU bound processes and have been using claypoole.core/upmap for those situations (require '[com.climate.claypoole :as cp]) (defn wait-and-return [w] (Thread/sleep (* 1000 w)) w) (def to-sort [38 20 22 2

Why doe floor and ceil accept clojure.lang.Ratio but round not

2014-11-24 Thread Niels van Klaveren
If you want math operations that are guaranteed to work with all clojure numeric types, be sure to use clojure.math.numeric-tower -- 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

Re: [ANN] freactive - high performance, pure Clojurescript, declarative DOM library

2014-11-20 Thread Niels van Klaveren
This looks pretty impressive, both in already implemented features and performance. I can't help but wonder though if the example chosen to compare performance with React/ Reagent isn't stacked a bit because effectively all nodes are rerendered all the time ? Wouldn't this effectively nullify p

Re: assert inside an if-let

2014-11-19 Thread Niels van Klaveren
>From the docs "If test is true, evaluates then with binding-form bound to the value of test, if not, yields else". So a is NEVER bound within the else block, and can't compile. On Wednesday, November 19, 2014 3:34:13 PM UTC+1, Las wrote: > > Hi, > > the following form doesn't compile and I see

Re: OJ - A friendly way to talk to your database using Clojure.

2014-11-04 Thread Niels van Klaveren
Looks cool, any design decisions that made you create this instead of using honeysql ? On Tuesday, November 4, 2014 3:45:35 AM UTC+1, Taylor Lapeyre wrote: > > > > GitHub project link: > https://github.com/taylorlapeyre/oj > > The idea is to lay a solid foundatio

Re: Clojure terminology

2014-09-12 Thread Niels van Klaveren
http://aphyr.com/posts/301-clojure-from-the-ground-up-welcome. Kyle Kingsbury's Clojure from the ground up has an excellent introduction about symbols, vars and quoting where he introduces them in the beginning of the course which makes things pretty clear and which makes the steo up to macro's

Re: Transducers are Coming

2014-08-31 Thread Niels van Klaveren
non-issue anyway ? On Thursday, August 7, 2014 2:05:33 PM UTC+2, Rich Hickey wrote: > > The integration with reducers is still todo. > > On Aug 7, 2014, at 7:03 AM, Niels van Klaveren > wrote: > > > Will the new transducer abstraction also (partly) replace / incorporate

Re: Prismatic Schema: Unclear exception in subsequence validation

2014-08-13 Thread Niels van Klaveren
Thanks much Francois, since the validation works, I'll leave it at that and will follow the plumbing mailing list to see what happens. Regards, Niels On Wednesday, August 13, 2014 3:20:02 PM UTC+2, François Rey wrote: > > The resulting message is generated by the walk method of the s/Either >

Prismatic Schema: Unclear exception in subsequence validation

2014-08-13 Thread Niels van Klaveren
(def field-order [(s/one s/Keyword "field") (s/one (s/enum :asc :desc) "order")]) (s/validate field-order [:name :dexc]) ExceptionInfo Value does not match schema: [nil (named (not (#{:desc :asc} :dexc)) "order")] schema.core/validate (core.clj:165) This is a pretty clear er

Re: Transducers are Coming

2014-08-07 Thread Niels van Klaveren
Will the new transducer abstraction also (partly) replace / incorporate the reducer library ? So we could do something like (def xform (comp (fold +) (map inc) (filter even?))) to leverage parallelism ? On Wednesday, August 6, 2014 8:01:24 PM UTC+2, Rich Hickey wrote: > > I pushed today the ini

Re: Best tools for profiling Clojure programs?

2014-07-03 Thread Niels van Klaveren
No, also for Oracle JVM on Linux, and 64 bit Mac OS X -- 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 first pos

Re: Best tools for profiling Clojure programs?

2014-07-02 Thread Niels van Klaveren
Oops, forgot to state Java Mission Control flight recording is for Oracle JVM only. On Tuesday, July 1, 2014 1:10:42 PM UTC+2, Niels van Klaveren wrote: > > A new option for test purposes is included in JDK 1.7.0_40 and up and is > called Java Mission Control. It is located in the JD

Re: Best tools for profiling Clojure programs?

2014-07-01 Thread Niels van Klaveren
A new option for test purposes is included in JDK 1.7.0_40 and up and is called Java Mission Control. It is located in the JDK as /bin/jmc.exe. With it you can connect to a local java process, or remotely through RMI, and record all kinds of performance characteristics in a Flight Recording. Su

Re: Elementary question about displaying images in an app

2014-04-24 Thread Niels van Klaveren
The best way to use Swing from Clojure is the seesaw library.It managed to clojurize Swing remarkably well, and is trying it's hardest to get all glaring inconsistencies out of swing use. Simple example to set a background for a frame: (frame :title "Hello

Re: is there a way I can learn clojure with a lot of exercises

2014-04-16 Thread Niels van Klaveren
I suggest read up on Clojure for the Brave and Trueand Clojure from the Ground Up, then start on 4clojure's exercises . I'd recommend it over sites with euler problems, since t

Re: How to work with variables that need to change

2014-04-12 Thread Niels van Klaveren
For storing timing results of expressions, I make use of an agent to store them in, and a modified time macro. (def timings (agent [])) (defmacro send-timing "Evaluates expr and prints the time it took. Returns the value of expr." {:added "1.0"} [agnt expr] `(let [start# (System/curren

Error when starting REPL

2014-03-28 Thread Niels van Klaveren
Its a problem with writing to a temp folder. Run Ccw as admin, or take a look at the counterclockwise group for a solution that doesn't need that. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegrou

Re: Source code reloading with leiningen checkouts

2014-02-26 Thread Niels van Klaveren
Windows (7) has different versions of linking. For checkouts to work on Windows 7 you need to have a *junction* to the directory, not a symbolic link. I make mine with Link Shell Extension for Windows Explorer, and have no probl

Re: 'Reduced' and logic functions

2014-02-20 Thread Niels van Klaveren
> > > The result wouldn't return faster if the input is an infinite list. > > Ah, I see the gotcha now. If you don't implement *or *as a macro, all arguments will be evaluated before *or *is invoked. Macro-expansion won't evaluate later arguments if a former one short-circuits, of course. I'd on

Re: 'Reduced' and logic functions

2014-02-20 Thread Niels van Klaveren
> > > The definitions of alt-or and alt-and are swapped: > > (alt-or false true) and (alt-or true false) both return false, (but (and) > is true, and both (alt-and) and (alt-or) are false). > > (alt-and true false) and (alt-and false true) both return true. > That's some serious C&P errors there

'Reduced' and logic functions

2014-02-19 Thread Niels van Klaveren
Currently, *and* and *or *are implemented as macro's, and cannot be used in *apply *or as function parameters. Related functions like *every?* and *some* are implemented either on the basis of *or* or recursion over lazy sequences. These choices were made because they all need to be able to sho

Re: how to use the G1 garbage collector

2014-02-07 Thread Niels van Klaveren
Both G1 and ConcurrentMarkSweep GC are meant to lower pauses (increase responsiveness), but generally increase total running time. So I don't know if it's ideal for the scenario you describe. On Friday, February 7, 2014 5:38:09 PM UTC+1, Lee wrote: > > > On Feb 7, 2014, at 11:35 AM, Gary Trakhma

Re: need help reading blob column from oracle

2014-01-30 Thread Niels van Klaveren
(jdbc/query db ["select blob_contents from ce_blob where event_id in (?,?,?) " [10024279,10024280,10024281]] :row-fn (fn [r] (some-> r :blob_contents .getBinaryStream io/inpu

Re: need help reading blob column from oracle

2014-01-27 Thread Niels van Klaveren
Oops, above example is for a clob, change .getCharacterStream to .getBinaryStream for a true blob. On Monday, January 27, 2014 9:08:30 AM UTC+1, Niels van Klaveren wrote: > > For reading a single blob you need to get the field's characterstream, > make it a reader and then proc

Re: need help reading blob column from oracle

2014-01-27 Thread Niels van Klaveren
For reading a single blob you need to get the field's characterstream, make it a reader and then process it further. (jdbc/query c ["select field from table" parameters] :row-fn (fn [r] (some-> r :fieldidentifier

Re: Finding available methods or docs for a value type

2013-12-27 Thread Niels van Klaveren
Anthony Grimes made a find-fn that finds functions based on input parameters and output functions. So something like (find-fn clojure.core [1 2] {:a 1 :b 2}) would return vals and (find-fn clojure.core [:a :b] {:a 1 :b 2}) would return keys. It would be great

Re: Caribou admin page: No template by the name login.html

2013-12-14 Thread Niels van Klaveren
th a potential fix > upcoming<https://github.com/caribou/caribou-core/pull/20> > . > > On Saturday, December 14, 2013 8:45:01 AM UTC-8, Niels van Klaveren wrote: >> >> Could it have something to do with the caribou lein template ending up in >> \.m2\repository\caribou\

Re: Caribou admin page: No template by the name login.html

2013-12-14 Thread Niels van Klaveren
y not respecting either of those settings. On Saturday, December 14, 2013 5:36:54 PM UTC+1, Niels van Klaveren wrote: > > Following the steps in the > tutorial<http://caribou.github.io/caribou/docs/tutorial.html>, clicking on > the admin login link on the homepage of the running

Caribou admin page: No template by the name login.html

2013-12-14 Thread Niels van Klaveren
Following the steps in the tutorial, clicking on the admin login link on the homepage of the running caribou app results in the following message: No template by the name login.html What could be the problem ? Windows 7 x64, Leiningen 2.3.4

[ANN] clojure.java.jdbc 0.3.0 RC1 released

2013-12-13 Thread Niels van Klaveren
Thanks very much Sean. After hesitating a long time about the jump to 0.3.0, today I migrated all my projects without a hitch ! -- -- 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 th

Re: clojure.java.jdbc 3.0 reusing connections

2013-12-10 Thread Niels van Klaveren
Oops, should be 'connection' instead of 'collection', of course. On Tuesday, December 10, 2013 5:24:23 PM UTC+1, Niels van Klaveren wrote: > > Do I understand correctly that to prevent creating a collection per query > I have to wrap multiple consecutive que

clojure.java.jdbc 3.0 reusing connections

2013-12-10 Thread Niels van Klaveren
Do I understand correctly that to prevent creating a collection per query I have to wrap multiple consecutive queries inside a `db-transaction` binding instead of the old `with-connection` bindings ? -- -- You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: clojure java.jdbc db-do-prepared and dynamic parameters

2013-12-09 Thread Niels van Klaveren
I think the OP just meant to ask how to do a PreparedStatement batch update in clojure.jdbc. The simplest answer is, just give in multiple parameter vectors to db-do-prepared (sql/db-do-prepared db "INSERT INTO fruit2 ( name, appearance, cost, grade ) VALUES ( ?, ?, ?, ?

Re: Autocomplete for new dependency - counterclockwise

2013-11-12 Thread Niels van Klaveren
, November 12, 2013 3:25:35 PM UTC+1, Josh Kamau wrote: > > Thanks. I had tried that. I guess i was doing something wrong. > Let me try again. > > Josh > > > On Tue, Nov 12, 2013 at 4:53 PM, Niels van Klaveren > > > wrote: > >> You only need to restart the

Re: Autocomplete for new dependency - counterclockwise

2013-11-12 Thread Niels van Klaveren
You only need to restart the REPL since the new library needs to be on the classpath. On Tuesday, November 12, 2013 2:48:21 PM UTC+1, Josh Kamau wrote: > > Hi there ; > > I have a counterclockwise project on eclipse. I have just added a new > library dependency to project.clj. What do i need t

Re: Cursive IntelliJ working on multiple Leiningen projects & require - refer :as not working

2013-11-06 Thread Niels van Klaveren
REPL then. > > > > On 6 November 2013 10:50, Colin Fleming > > wrote: > >> Hmm, there may be some problem with the classpath there - I'll take a >> look. >> >> >> On 5 November 2013 23:53, Niels van Klaveren >> >> > wrote:

Re: Cursive IntelliJ working on multiple Leiningen projects & require - refer :as not working

2013-11-05 Thread Niels van Klaveren
t; also transparently supported for interop with other tools. > > Let me know if it works for you, and I'd be interested to know more about > your namespace resolution problems too. Feel free to drop me a mail at > cur...@cursiveclojure.com if you'd rather send it off-list.

Re: Cursive IntelliJ working on multiple Leiningen projects & require - refer :as not working

2013-11-01 Thread Niels van Klaveren
I don't think it's the way to do it, because the checkouts /src directory gets unmarked when the project is loaded anew after an IntelliJ restart. On Friday, November 1, 2013 4:44:49 PM UTC+1, Niels van Klaveren wrote: > > The release notes mention that working on multiple Leinin

Cursive IntelliJ working on multiple Leiningen projects & require - refer :as not working

2013-11-01 Thread Niels van Klaveren
The release notes mention that working on multiple Leiningen projects has been improved, but how to get it working ? I wondered if there's a preferred way to work on multiple Leiningen projects, so changes in one are reflected in the other. - Leiningen has the option to work with the checkouts d

Re: Compulsive over-optimization

2013-10-22 Thread Niels van Klaveren
I can imagine this behavior. Unlike premature performance optimization, readability / terseness are well worth optimizing for when learning Clojure, as long as you value readability over terseness to keep well away from code golf territory. With Clojure, I always have the idea that things coul

Re: [ANN] Counterclockwise - Clojure plugin for Eclipse

2013-10-17 Thread Niels van Klaveren
Window > Preferences > General > Editors > Text Editor >Displayed Tab Width > change 4 to 2 On Saturday, October 12, 2013 7:21:39 PM UTC+2, Gary Zhao wrote: > > Great. But I have one thing confusing. > Auto indent uses two spaces, but tab uses four spaces. How can I make them > consistent? Eithe

Re: Who uses HtmlUnit?

2013-10-07 Thread Niels van Klaveren
Didn't see this was posted in the general Clojure group, and thought this had been posted in another group. So if you want to do any automated web testing be sure to check out clj-webdriver , the clojure library for Selenium Webdriver and it's Google G

Re: Who uses HtmlUnit?

2013-10-06 Thread Niels van Klaveren
I've used HTMLunit, but the Javascript implementation used is rather slow compared to regular JS in browsers. Since the webframework I need to test is rather JS heavy, this is a pretty big problem. I had hopes that they would switch from Rhino to Nashorn, but there currently aren't plans for tha

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Niels van Klaveren
Live-editing OpenGL under Quill (Processing) worked very well in CCW last time I toyed with it. On Thursday, July 25, 2013 7:27:37 PM UTC+2, Chris Gill wrote: > > I find this interesting. I've been using light table mostly, but recently > I tried my hand at socket programming and light table flo

Re: is it possible to join on lazy seqs?

2013-07-17 Thread Niels van Klaveren
Perhaps you could post a minimal example of the two datasets you're trying to join ? To do multiple types of joins (left, right, inner, natural & cross) on collections of maps/records, I use Sean Devlin's table-utils library. There's no jar, but there's instructions on how to make a version wit

Re: Is this idiomatic for a recurring function?

2013-07-09 Thread Niels van Klaveren
> > > So I should use loop together with recur? > > Does the recur at that point recursively call the function, or does it > refer to the loop? > Yes, it refers to the loop. The loop form is usually used to 'hide away' additional parameters that are needed in the loop itself, but not in the fu

Re: Is this idiomatic for a recurring function?

2013-07-09 Thread Niels van Klaveren
For comparison's sake, here's a version made with higher order functions. HOF based functions are usually considered more idiomatic Clojurethan (loop-)recur ones. However, I've found that performance wise loop-recur ones often win. (d

Re: multiline strings and multiline comments ?

2013-07-05 Thread Niels van Klaveren
> Right, but what should be done, then? The command is a "toggle", but > there are both commented and uncommented lines: should it comment all > lines, or uncomment all lines? > I understand why the function works like it does, and there's no 'right' solution to this problem. I just posted t

Re: multiline strings and multiline comments ?

2013-07-05 Thread Niels van Klaveren
> Right, but what should be done, then? The command is a "toggle", but > there are both commented and uncommented lines: should it comment all > lines, or uncomment all lines? > I fully understand there's no right solution for this, just wanted to assure the OP that the function should work

Re: multiline strings and multiline comments ?

2013-06-29 Thread Niels van Klaveren
In my version of CCW CTRL-/ multiline (un)commenting just works (under Windows). Perhaps it's a keyboard shortcut problem ? Only problem there is when multiple lines are selected, and some are uncommented, uncommenting the whole block doesn't work. On Wednesday, August 18, 2010 10:40:39 AM UTC+

Re: Graph API

2013-06-18 Thread Niels van Klaveren
As a user of the old version of Loom (thanks for the link to aysylu's fork !) it'd be great if there was a well maintained pure Clojure graph library. The ideas and improvements on Loom you put forward are pretty sensible, and I hope you and Aysylu can find a way to collaborate ! On Tuesday, Ju

Re: feeding leiningen a local JAR file

2013-06-07 Thread Niels van Klaveren
Leiningen uses the pomegranate libraryto manage dependencies and classpath. You can use this library from your project (or even the REPL) to load jars or put extra directories on the classpath, if you don't want to put them in your local repo. Something

Re: creating maps out of sql

2013-05-24 Thread Niels van Klaveren
If you need to do join like operations on database tables from different sources that you can't join through SQL, there's a nice library called table-utilsthat you can use. Since it's not released on clojars there's some steps y

Re: Real-world Clojure application

2013-05-23 Thread Niels van Klaveren
One of the applications that might be comparable are web apps / frameworks. They can be configured relatively easily to give deterministic results (html /json) on arguably comparable input (http request). There's already an existing benchmark site

Re: link for clojure programs

2013-05-06 Thread Niels van Klaveren
+1 to Clinton's advice. If anything, SICP et al teach the wrong habits fo working with Clojure. Christophe Grand, one of the authors of the aforementioned "Clojure Programming" book, held a great presentation called "You aren't gonna need it

Re: Something goofy you can do in Clojure.

2013-04-09 Thread Niels van Klaveren
In Clojure 1.5.1: => (+ .3 1.7) CompilerException java.lang.RuntimeException: Unable to resolve symbol: .3 in this context, compiling:(NO_SOURCE_PATH:1:1) So the only way you can do this is if you def'd .3 before => (def .3 0.4) => (+ .3 1.7) 2.1 On Tuesday, April 9, 2013 10:53:06 AM UTC+2, C

Re: Working with a huge graph - how can I make Clojure performant?

2013-03-28 Thread Niels van Klaveren
That's quoting far out of context Alan. All Christophe says in his blog is he dislikes the statefulness of most implementations of Tarjan, and shows how this isn't needed, and can be done in a functional way. You could have stated the arguments why you think your version is superior, and it mig

Re: Working with a huge graph - how can I make Clojure performant?

2013-03-28 Thread Niels van Klaveren
Perhaps for inspiration have a look at Christophe Grand's implementation of Tarjan's algorithm(which is a more efficient version of Kosaraju's). On Thursday, March 28, 2013 12:06:45 PM UTC+1, Balint Erdi wrote

Re: Coding while running the program

2013-03-23 Thread Niels van Klaveren
Doing stuff like you describe was one of Cris Granger's inspirations for making Light Table. See http://www.chris-granger.com/2012/02/26/connecting-to-your-creation/ However, most of this is doable with a REPL, as Mikera already noted. For Clojure/Clojurescript, redefining functions in running c

Re: what are some stack sizes that people use?

2013-03-19 Thread Niels van Klaveren
t;>> some symptoms for >>> > a bit. Increasing the stacksize is something that only rarely needs to >>> be done, usually >>> > when relying on an external library that has problems with stacksize. >>> Always try >>> > to troubleshoot code

Re: what are some stack sizes that people use?

2013-03-18 Thread Niels van Klaveren
Another Caveat is that stack size is allocated per thread. If you use a highly threaded application (f.i. webservers) a small stacksize increase can add up quite a bit. On Monday, March 18, 2013 4:15:00 PM UTC+1, larry google groups wrote: > > > I am a noob when it comes to the JVM, and actually

Re: what are some stack sizes that people use?

2013-03-18 Thread Niels van Klaveren
Default stack size is 512kB for 32bit JVMs on Solaris, 320kB for 32bit JVMs on Linux (and Windows), and 1024kB for 64bit JVMs. However, stack overflows are usually a good indication of problematic / faulty recursive algorithms. Increasing the stacksize usually only alleviates some symptoms for

Re: is intellij idea a good ide for clojure development?

2013-01-31 Thread Niels van Klaveren
Another vote for Eclipse/CCW over Netbeans and IntelliJ. I used all three, and CCW's development has proven to be consistently better than plugins for the other IDE's. Both CCW's excellent Leiningen and REPL support, as the option to link projects when working on multiple sources at the same tim

Re: Clojure Full Syntactical Reference

2012-12-18 Thread Niels van Klaveren
I wonder if this couldn't have been better implemented as nrepl middleware. On Tuesday, December 18, 2012 10:34:01 AM UTC+1, Niels van Klaveren wrote: > > It's a feature of the REPLy NREPL client. See > https://github.com/trptcolin/reply/blob/master/src/clj/reply/initiali

Re: Clojure Full Syntactical Reference

2012-12-18 Thread Niels van Klaveren
It's a feature of the REPLy NREPL client. See https://github.com/trptcolin/reply/blob/master/src/clj/reply/initialization.clj how it works so you can emulate it. On Tuesday, December 18, 2012 5:10:00 AM UTC+1, Karim A. Nassar wrote: > > When using nrepl in emacs (cdoc ) emits: > > CompilerExcep

Re: (def some? (comp not nil? some))

2012-12-03 Thread Niels van Klaveren
That's why Jim mentions if-let and when-let in combination with some, they both detect if results are nil. On Sunday, December 2, 2012 10:11:24 PM UTC+1, Ben wrote: > > On Sun, Dec 2, 2012 at 12:48 PM, Jim - FooBar(); > > > wrote: > > Its perfectly fine to use some as a predicate as far as I k

Re: Clojure turns 5

2012-10-17 Thread Niels van Klaveren
(take 5 (range)) Many happy return values, Rich ! On Wednesday, October 17, 2012 3:53:55 AM UTC+2, Rich Hickey wrote: > > I released Clojure 5 years ago today. It's been a terrific ride so far. > > Thanks to everyone who contributes to making Clojure, and its community, > great. > > Rich --

  1   2   >