Hi Paul,
On 27 May 2010 23:24, Paul Moore wrote:
> Can someone recommend a good Mersenne Twister implementation I could
> use? A web search finds a number of implementations in Java -
> presumably I can use these via Java interop - is that a sensible thing
> to do?
It is very sensible to use an
On 11 May 2010 11:59, Lauri Pesonen wrote:
>
> At least in my setup ~/.clojure/user.clj does not get loaded unless
> ~/.clojure is in the JVM classpath.
(replying to myself)
So I've made this work with swank-clojure-project by adding this to my
emacs config:
(add-hook 'sw
On 11 May 2010 10:55, Tassilo Horn wrote:
> I think ~/.clojure/user.clj is evaluated on each clojure startup, so you
> could add that code there.
At least in my setup ~/.clojure/user.clj does not get loaded unless
~/.clojure is in the JVM classpath.
> Tassilo
--
! Lauri
--
You received thi
Hi all,
How do people autoload code in their repl at startup? I'd like to
specify code that would be loaded into each repl that I start with
slime. E.g. (use 'clojure.contrib.repl-utils) and (set!
*warn-on-reflection* true). Not being able to do this easily means
that I don't use e.g. the repl-uti
On 20 April 2010 15:41, Craig Andera wrote:
> Yep: that's good advice, although I can't say I find much in emacs to
> be "basic", even after using it casually for 20 years :). The one I
> tended to use in the tutorial (in case someone saw it flash by in the
> minibuffer) is C-x C-e, which I have b
Hi Albert,
2009/12/14 Albert Cardona :
> On Mon, Dec 14, 2009 at 10:08 AM, Lauri Pesonen wrote:
>> IIRC Java AWT-based libraries require a windowing system on the
>> machine. On Windows this is not a big deal since you're always running
>> a windowing system, even on a
2009/12/14 jan :
> Shawn Hoover writes:
>> I see usages of the time macro that wrap the expression of interest in a call
>> to dotimes. Is there any interest in an overload of time that takes an
>> additional parameter for a number of iterations, evaluates the expression
>> that
>> many times, an
Hi Fred,
2009/12/14 Frédéric Morain-Nicolier :
>> As far as I can tell, ImageJ isn't really suited for "headless" tasks,
>> which is what I want to do; I want to run some image processing in the
>> backend of a web app. I guess I'm going to try JAI first.
>
> Not sure to understand. By "headless"
Thanks everyone for the recommendations.
2009/12/4 Steve Purcell :
>
> Here's what I do (in Cocoa Emacs 23) to make 'option' work the same in Emacs
> as in other OS X apps:
>
> (setq mac-command-modifier 'meta)
> (setq mac-option-modifier 'none)
> (setq default-input-method "MacOSX")
Hmm, I'v
2009/12/2 Matthew Williams :
> Using the Cocoa build of Emacs 23 (http://www.emacsformacosx.com) I
> was able to get up and running extremely quickly with Technomancy's
> swank-clojure install.
This is very much off-topic, but...
How do you type ''#' in the Cocoa build of Emacs 23 (I'm on a UK
ke
2009/11/28 Joseph Smith :
> Definitely- Even when I'm programming Clojure in NetBeans I always have a
> REPL open. In general I like having an interpreter/dynamic environment
> running when I'm developing in any language that offers such an environment,
> e.g. Python, Groovy (I use groovysh while w
Hi Nipra,
2009/11/27 nipra :
> Hi,
> (rest *v1) is equal to *v2 in the below mentioned example. Then why
> `conj' operation on them is returning different things.
>
> user> (def *v1 [1 2 3 4 5])
> #'user/*v1
> user> (def *v2 [2 3 4 5])
> #'user/*v2
> user> (= (rest *v1) *v2)
> true
> user> (def
2009/11/23 Phil Hagelberg :
>
> I noticed an odd bug when working on the help command for leiningen. It
> uses docstrings on metadata for help output, but when AOTing the
> project, the docstrings (as well as all other metadata) would be
> lost. Note that this doesn't happen when metadata is added
2009/11/18 Jacek Laskowski :
>
> user=> (macroexpand '(-> v (assoc i (v j)) (assoc j (v i
> (assoc (clojure.core/-> v (assoc i (v j))) j (v i))
>
> How to expand the macro in the subform above?
You can use clojure.walk/macroexpand-all:
(clojure.walk/macroexpand-all '(cond (even? 2) :foo (odd?
Hi Mark,
2009/11/13 Mark Tomko :
>
> I notice you used the '->' macro. Perhaps I'm a little dense, but I
> haven't found the documentation for it to be terribly helpful. Do you
> have simple, succinct explanation for what it does?
The -> macro calls the given forms with the return value of prev
Hi John,
2009/10/25 jsrodrigues :
>
> When I try the following:
> user=> (into {} (map #([% (* % %)]) [1 2 3 4]))
The #(...) form assumes that the is a function call and thus it is
implicitly wrapped in parens. That is, #(+ % %) becomes (fn [x] (+ x
x)). So in your code the anonymous function bo
2009/10/21 John Harrop :
> Like this?
> (def hexchar? #{\0 \1 \2 \3 \4 \5 \6 \7 \8 \9 \A \a \B \b \C \c \D \d \E \e
> \F \f})
Yep, that's what I had in mind as well, but I got tired of typing ;-)
--
! Lauri
--~--~-~--~~~---~--~~
You received this message beca
Hi Mark,
2009/10/21 Mark Nutter :
>
> (defn blank? [s] (every? #(Character/isWhitespace %) s))
> user=> (defn hexchar? [c] (re-find #"[0-9A-Fa-f]" c))
> user=> (defn hex? [s] (every? #(hexchar? %) s))
> #'user/hex?
> nil
> user=> (hex? "a")
> # cannot be cast to java.lang.CharSequence (NO_S
2009/10/9 tommy c :
>
> I'm trying to translate a java lucene indexer to clojure.
> This java line is bothersome:
> writer = new IndexWriter(dir, new SimpleAnalyzer(), true,
> IndexWriter.MaxFieldLength.UNLIMITED);
MaxFieldLength is an inner class in IndexWriter and UNLIMITED is a
static field
2009/10/8 John Harrop :
>> java.lang.ClassFormatError: Unknown constant tag 52 in class file
>> queries__init (Trial.clj:0)
>
> Almost certainly, it occurs in some part of the code that works on a class's
> bytecodes either directly on disk or in the form of an unstructured Java
> byte array; hope
Hi,
2009/10/2 Miron Brezuleanu :
>
> Hello,
>
> I assume this is about the cheatsheet at http://clojure.org/cheatsheet
>
> The odd/even typos are in the PDF version.
>
> Some suggestions: add update-in, assoc-in, get-in in the 'Maps'
> section; Add the ignore-next-form #_ reader macro in the rea
2009/9/11 Richard Newman :
>
>>> Where I'm stuck
>>> is how to get access to the particle names, as I would in the above
>>> line of Java code.
>
> The final bit, once you have an iterator over particles, would be:
>
> (fn [p] (.getName p))
>
> To avoid the use of reflection, you might want explic
2009/9/11 carey :
> (. dataLoader getEnvironmentParticleSet)
>
> But what I want is to go through the list that this method returns and
> get the name of each particle in the list.
>
> I now that in Java this would be (inside some form of loop)
>
> dataLoader.getEnvironmentParticleSet().get(i).ge
2009/9/11 Rich Hickey :
>
> We should fix the doc. Patch welcome for this.
Ticket #189 - I've provided a patch following Stephen's suggested doc string.
> Rich
--
! Lauri
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Hi Karl,
2009/8/31 Krukow :
> 2) I can do:
> user> (into {} '([:k :v]))
> {:k :v}
>
> This works for two-element vectors. However, I cannot do the same for
> two-element arrays:
>
> user> (def str_array (.split "k=v" "="))
> #'user/str_array
> user> (into {} (list str_array))
> ; Evaluation abor
2009/8/30 mlm :
> (setq swank-clojure-extra-
> classpaths
> (list
> "/opt/clojure/clojure-contrib/clojure-contrib.jar:/opt/clojure/swan\
> k-clojure/swank/swank.clj"))
Try changing the swank-clojure bit to point to the directory rather
than the .clj file, i.e. either /opt/clojure/swank-clo
Hi,
2009/8/25 icemaze :
> (.open sdl format (* 48000 2 2))
Add a type hint to the sdl operand:
(.open #^SourceDataLine sdl fmt (* 48000 2 2))
--
! Lauri
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure"
Hi Rich,
2009/8/19 Rich Hickey :
>
> On Fri, Aug 14, 2009 at 6:28 AM, David Powell wrote:
>>
>>
>>> user=> (.getClass (+ 1 Integer/MAX_VALUE))
>>> java.lang.Long
>>
>> Also,
>>
>> user=> (def i (Integer/MAX_VALUE))
>>
>> user=> (class (+ 1 i))
>> java.lang.Long
>>
>> user=> (class (inc i))
>> jav
2009/8/12 Chas Emerick :
>
> On Aug 12, 2009, at 3:19 PM, Mark Volkmann wrote:
>
>> I didn't release it was valid to define names with colons in them.
>> Maybe that shouldn't be allowed. I'd like to be able to specify type
>> hints using UML-like syntax like the second example from Chas which
>> w
2009/8/8 Luc Prefontaine :
> I totally agree no comments is not good at all but JavaDoc style comments in
> Clojure ? I pray you all, please stay away of it :
I was quite taken by this scheme style guide recently:
http://mumble.net/~campbell/scheme/style.txt
While I don't agree with all th
2009/8/6 James Reeves :
>
> On Aug 6, 8:31 pm, Howard Lewis Ship wrote:
>> I'm cringing at the sight of XML here.
>
> XML is frequently overused, but it is a good format for representing
> dense, structured data. For example:
>
>
>
>
>
> Compared to:
>
> {:type :repository
> :name "third-par
Hi Stuart,
2009/8/6 Stuart Halloway :
>
> On the plus side, it appears to be faster (as collections grow large),
> and it doesn't "cheat" by introducing an atom. On the minus side it
> isn't as pretty as the one in contrib.
While maybe not as pretty as the one in contrib, it's not a monster
eith
Hi Meikel,
2009/8/5 Meikel Brandmeyer :
>
> Well, this is independent of whether you have a C or Java
> library. You can install each C library in its own directory
> and tell the linker to look there. Then you have basically
> a .jar like setup: If you don't tell the linker the right directory
>
Seth,
2009/8/6 Seth :
>
> I hope that learning a Lisp first is a good idea for novice
> programmers, because I intend to inflict Clojure on my poor children.
> (They didn't take to http://scratch.mit.edu/ and Google's rehash of
> BASIC is a non-starter).
There was a post recently on LtU about a
2009/8/4 Meikel Brandmeyer :
>
> I think, "clojure context" is underestimating things. The high
> integration
> of external Java libraries makes it necessary that such dependencies
> can be handled in the same way.
Agreed. I was actually going to write that whatever approach is chosen
it must be
2009/8/4 James Reeves :
>
> On Aug 4, 12:51 pm, Krešimir Šojat wrote:
>> In your project you would create standard ivy.xml and ivysettings.xml
>> files as described on Ivy site. Download Ivy (and Ant jars if you will
>> create or use Packagers). After that you can retrieve your
>> dependencies fr
Hi swaroop,
2009/7/29 swaroop belur :
>
> fibonacci sequence using lazy-cat :
> (def fibs (lazy-cat [0 1] (map + fibs (rest fibs
>
> I am trying to understand how this works ..not sure i fully comprehend
> it.
>
> Can anyone please explain how clojure evaluates this.
I'll do my best, but I
2009/3/24 Mark Volkmann :
>
> Thanks! It looks like I don't need the let now. Does a macro have to
> evaluate to one form? For example, this works, but it seems I can't
> drop the do.
>
> (defmacro dump [expr]
> `(do
> (print (quote ~expr))
> (println " =" ~expr)))
How about:
(defmacro
2009/2/3 Konrad Hinsen :
>
> Is there any reason to prefer lists over vectors or vice versa for
> implementing queues? It seems that for both lists and vectors, adding
> and removing at one end (front for lists, end for vectors) is cheap,
> whereas it is expensive at the other end. For queues you
2008/12/2 Stuart Halloway <[EMAIL PROTECTED]>:
>
> Cool, that's much better. Can we establish that all (or all important)
> Java 5+ VMs use AtomicLong in next?
While compare-and-swap is a lot better than a mutex, it's still not
free. IIRC a CAS is one (or maybe two) order(s) of magnitude more
exp
40 matches
Mail list logo