On Sat, May 29, 2010 at 08:52:59PM -0700, ataggart wrote:
Yup, you need to use the transient functions, e.g., assoc!, just as
you would the persistent functions. This is nice since you can write
your code in the persistent style, then if you need to make some
performance tweaks, simply add
On May 29, 9:44 am, James Reeves jree...@weavejester.com wrote:
On 29 May 2010 14:19, WoodHacker ramsa...@comcast.net wrote:
I'm working on a simple imaging problem. I want to copy an array of
pixels to an image buffer. That means that I have to deal both with
an array and a matrix
Thank you!
Greetings, a.
On 28 Mai, 17:51, Paul Moore p.f.mo...@gmail.com wrote:
On 28 May 2010 16:17, alux alu...@googlemail.com wrote:
Hello Paul,
thats much better, many thanks!
I've added it to the Wikibooks
Small addition, you missed to add the : before eof
replace goto eof by goto :eof
Thank you, and regards, alux
On 28 Mai, 16:09, Paul Moore p.f.mo...@gmail.com wrote:
On 28 May 2010 09:48, alux alu...@googlemail.com wrote:
Hello!
Short: It works, but is not perfect.
(this may need an
On 30 May 2010 12:39, WoodHacker ramsa...@comcast.net wrote:
On May 29, 9:44 am, James Reeves jree...@weavejester.com wrote:
On 29 May 2010 14:19, WoodHacker ramsa...@comcast.net wrote:
I'm working on a simple imaging problem. I want to copy an array of
pixels to an image buffer.
This is precisely what 'for' is for in clojure.
For example:
(for [x (range 10) y (range 10)] [x y])
... produces a sequence of the coordinates in a 10x10 grid. You can
then consume the sequence for whatever purpose. The position of each
matrix coord in the seq produced would match up with the
Hi Andrzej,
I have a question about primary keys. As far as I can see you're
currently using the first field of the relation as a primary key.
While that's what other databases do (and it is working well), I think
it would be better to make _records_ themselves primary keys. Since
records
You could be really odd and write a wrapper for Edje.
http://trac.enlightenment.org/e/wiki/Edje
Not a serious recommendation, really. I just don't have any strong
positive opinions regarding any of the others except for QT, and as
you say
On May 27, 10:18 am, Luke VanderHart
Hi all,
I'm running into a problem where I need to define several functions
and/or vars inside another function, but the function has multiple
definitions and they all need to have access to the inner things.
This could be solved by making private functions and using partial,
but this sounds like
JavaFx has one other major issue. The scene graph isn't accessible outside
of JavaFx script.
On Friday, May 28, 2010, Luke VanderHart luke.vanderh...@gmail.com wrote:
My understanding may be wrong, but I think JavaFX is intended more as
a competitor to Flash or Silverlight than a GUI toolkit.
I'm getting verify errors again with the latest 1.2 shapshots of
clojure..contrib within Netbeans.
I know the source=1.5 and target=1.5 should work when you are
compiling with the 1.6 jdk but so far that has not been my
experience.
I'll stop caring about this when Netbeans 6.9 is out (which I hope
user (loop [thm (transient {}),
i 0]
(if (= 10 i)
(persistent! thm)
(recur (assoc! thm i i)
(inc i
{0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8, 9 9}
By the way, FYI:
(reduce #(assoc %1 %2 %2) {} (range 10))
or
On 30 May 2010 12:42, Michael Wood esiot...@gmail.com wrote:
Well, what's wrong with this:
for (k = 0; k 256; ++k)
writeBuffer(k % 16, k / 16, value[k]);
:)
I was about to say the same thing. Clojure can be more concise than
most other languages, but in this case, all one needs is a
It's also worth to mention that the produced seq is lazy, so you can
work on big images without memory issues.
On Saturday, May 29, 2010, John Cromartie jcromar...@gmail.com wrote:
This is precisely what 'for' is for in clojure.
For example:
(for [x (range 10) y (range 10)] [x y])
...
Adrian Cuthbertson adrian.cuthbert...@gmail.com said:
That said, I'd rather make sure that my low-level data structures are being
operated on by only one implementation.
You could use closures to encapsulate the refs/atoms ...
(let [car-mem (ref nil)]
(defn set-car-mem [new-car-mem]
Hi,
Am 30.05.2010 um 16:39 schrieb Sina K. Heshmati:
[2]
http://github.com/sindoc/algorithms/blob/master/src/test/clojure/whiteboard/y2010/hide-adt-state-using-closure.clj
I'm almost sure, that this code does not what you expect. Nested def's, and in
particular defn's, are almost surely
I'm running Clojure code on an early Mac Pro with OS X 10.5 and Java
1.6. It has two dual-core Xeon 5150s and 5GB of memory.
I'm not getting the performance I expected despite top reporting 390%
steady-state CPU use, so I wrote some trivial tests to see if I was
actually getting the benefit of
On May 30, 2010, at 18:31 , Zak Wilson wrote:
I'm running Clojure code on an early Mac Pro with OS X 10.5 and Java
1.6. It has two dual-core Xeon 5150s and 5GB of memory.
Just a idea, two dual cores != 4 cores. Parallelism on more then one CPU is
always slower then on one cpu with multiple
Zak,
This may not be your main issue and I haven't done enough testing with my own
code to know if it's even my main issue, but I've found that things appear to
go better for me on multicore machines if I invoke java with the
-XX:+UseParallelGC option.
-Lee
On May 30, 2010, at 12:31 PM,
Hi Clojurians,
I have some conceptual questions on the sequence abstraction. I
understand that (seq coll) will give me a sequence.
coll maybe be a list, vector, map, set, LazySeq or nil.
1. In case coll is a LazySeq why does (seq coll) realize its first
element? I thought seq just did a type
Hi!
For example, it's possible to do things like:
(def do println)
((var do) example)
And it works correct. But I don't understand how to get the same
behavior in let bindings.
I mean
(let [do println]
..)
what can I write to get the same results?
--
You received this message
Heinz - playing with the size of the number doesn't have much effect,
except that when it becomes very small, parallelization overhead
eventually exceeds compute time.
Lee - Parallel GC slowed it down by 3 seconds on the four core
benchmark.
--
You received this message because you are
Swing, mainly for deployment reasons.
It's not hard to set the look and feel to the platform's look and
feel. That's not perfect, but it's usually not bad either, though the
GTK1-style file chooser is horrid.
--
You received this message because you are subscribed to the Google
Groups Clojure
1. In case coll is a LazySeq why does (seq coll) realize its first
element? I thought seq just did a type conversion and all of list,
vector .. etc implemented Seqable or something.
Because seq is defined as returning nil for an empty sequence. The
only way to find that out for a lazy
On May 30, 8:11 pm, Richard Newman holyg...@gmail.com wrote:
2. Why is there no other way to determine an empty coll except (not
(seq coll)).
user= (empty? [])
true
And in fact, the docs for (empty?) say:
Please use the idiom (seq x) rather than (not (empty? x))
Perhaps the seq docs
+1 SWT -- but if it's good, Swing works also.
--
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 post.
To
On May 29, 10:29 pm, Daniel doubleagen...@gmail.com wrote:
You could be really odd and write a wrapper for Edje.
http://trac.enlightenment.org/e/wiki/Edje
Not a serious recommendation, really. I just don't have any strong
positive opinions regarding any of the others except for QT, and as
I am not knocking all of these +1 Swing posts. But I would love to
see one good public application built in Swing (besides Netbeans)
On May 28, 9:10 am, laseray lase...@gmail.com wrote:
+1 Swing
If I had my druthers I would go with QtJambi, but since Nokia dropped
development for that it has
On 30 May 2010 12:31, alux alu...@googlemail.com wrote:
Small addition, you missed to add the : before eof
replace goto eof by goto :eof
Thanks, good catch. (goto eof without the colon works on TCC, which
I normally use as my command shell).
Paul.
--
You received this message because you
I'm new to Clojure and have a long background in Java. After writing
Clojure code for a month or so now, I find myself struggling with
function size. If I have expressions that can be grouped by
association, then I can re-factor these expression(s) into a
function. However, the newly
Hi jbs,
Not sure why the title of this post is about size instead of protection,
but why don't you just use private functions in Clojure?
(defn- my-little-helper [] visible only in my namespace ...)
Note the - on the end of defn, which is idiomatic for introducing a private
var. You can also
Hi,
Not really mechanisms, but two Idioms will help you with your problem:
Either wrap the defn in a let:
(let [U (gen-matrix [1 2 2 -2 -1 -2 2 2 3] 3 3)
A (gen-matrix [1 2 2 2 1 2 2 2 3] 3 3)
D (gen-matrix [-1 -2 -2 2 1 2 2 2 3] 3 3)
S (gen-vector [3 4 5])]
(letfn
You can bind functions inside a let, which can help if you're just
trying to make code less nested. The thread-first and thread-last
macros help here too. But if you're looking for the equivalent of the
private keyword (sort of) check out defn-. Note the dash at the
end.
On Sunday, May 30, 2010,
On May 30, 12:18 pm, Stuart Halloway stuart.hallo...@gmail.com
wrote:
Hi jbs,
Not sure why the title of this post is about size instead of protection,
but why don't you just use private functions in Clojure?
(defn- my-little-helper [] visible only in my namespace ...)
Note the - on the
I am not knocking all of these +1 Swing posts. But I would love to
see one good public application built in Swing (besides Netbeans)
Here's a couple just off the top of my head...
jEdit http://www.jedit.org/
GanttProject http://www.ganttproject.biz/
Intellij IDEA, RubyMine, PhpStorm,
I am not knocking all of these +1 Swing posts. But I would love to
see one good public application built in Swing (besides Netbeans)
Here's a couple just off the top of my head...
Also, Aqua Data Studio (my favorite db tool) http://www.aquafold.com/
--
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Hi A.,
I dont completely understand what you refer to with works correct.
You define a local variable, named do, and use it. That works of
course. Btw you may use it without the call to var
(def do println)
(do example)
In let you may do
(let [do println] (do :plop))
Is this what you want?
I have been working on a branch [1] and haven't updated the ticket yet [2].
Given the number of diverse (and sometimes opposite!) opinions already
expressed on this topic, I thought a little extra community review would be in
order. David and I organized the work into several fairly small
The first solution looks good. I had no idea that wrapping a defn
inside of let's would leave the function exposed. Interesting. Is it
considered idiomatic though?
On May 30, 2:16 pm, Erik Söhnel eriksoeh...@googlemail.com wrote:
Hi,
Not really mechanisms, but two Idioms will help you with
Michael Gardner wrote:
As a style issue I'd suggest using inc, dec, neg?, pos?, and zero? instead of the
various (+ x 1), ( x 0), etc. in your code. This actually seems to improve
performance a bit on my laptop, but it's nothing amazing. To get good performance
you're likely going to need to
I'd vote for swing and against anything that abstracts away the
toolkit so that you can switch the backend.
Implementing a clojure wrapper for the apache pivot toolkit gave me
a little insight on at least two GUI toolkits, namely swing and
pivot. Despite their goal of displaying widgets on a 2
Hello,
I careless used rationals in a function, and, well, it took some
minutes to understand why it was slowing down. (I did this formatting
by (println (* 1.0 x)) when it started being unreadable - and forgot
that).
I still see rationals as very nice, but try to use them carefully now.
What I
Why do some of the functions use StringBuilder (no internal
synchronization) and some use StringBuffer (provides internal
synchronization). Using the latter is probably a mistake.
The first function -- reverse -- uses StringBuilder#reverse() to reverse
the character sequence in place, and then
not being a programmer perhaps I should be quite, but I never do that.
+10 for swing, here is why:
1: it is there
2: it is good enough
3: doing the bare minimum you are signing up for a large amount of
work, don't sign up for more.
4: people who build new gui libs usually have their own ideas
On 31/05/2010, at 9:44 AM, Marc Spitzer wrote:
2: it is good enough
IMO This is the entire point. Swing is not good enough if you want to build
something with native integration and correct look and feel. Everything else
comes down to whether developers are prepared to pay the price for
On Sun, May 30, 2010 at 8:23 PM, Antony Blakey antony.bla...@gmail.com wrote:
On 31/05/2010, at 9:44 AM, Marc Spitzer wrote:
2: it is good enough
IMO This is the entire point. Swing is not good enough if you want to build
something with native integration and correct look and feel.
On 31/05/2010, at 10:44 AM, Marc Spitzer wrote:
I do agree with you for 'a' native wrapper. What is your opinion for
all native wrappers? The thing is that each platform that requires
native code is a source of tech support requests. Now let me go with
the things I have at work:
1:
This is a great idea, and is something that Clojure really needs in my
opinion (for starters it would be nice to be able to write GUI apps in
Clojure without worrying about the Java level, with its completely different
and completely annoying semantics). My vote is for Swing, simply because the
On Sun, May 30, 2010 at 9:23 PM, Antony Blakey antony.bla...@gmail.com wrote:
On 31/05/2010, at 10:44 AM, Marc Spitzer wrote:
I do agree with you for 'a' native wrapper. What is your opinion for
all native wrappers? The thing is that each platform that requires
native code is a source of
On 31/05/2010, at 11:13 AM, Marc Spitzer wrote:
I actually primarily do not care about mac or windows, personally or
professionally. Also keep in mind that one of the selling points of
clojure is that it runs where *Java* runs not mac and windows, I would
think that in my mind anyway, be a
Type-hinting args as a CharSequence is a GoodThing; type-hinting that
you're returning a CharSequence when you're actually returning a
String is not.
I disagree with Steven that some functions should return the
StringBuilder instance due to being type-hinted as CharSequence.
CharSequence is
Ratio doesn't emit the numerator and denominator:
http://github.com/richhickey/clojure/blob/master/src/jvm/clojure/lang/Ratio.java
I'm not sure that would help solve your problem, even if it were
available. You either need to turn the ratio into a non-ratio (using
float or double) or use
On May 30, 12:45 pm, alux alu...@googlemail.com wrote:
Hi A.,
I dont completely understand what you refer to with works correct.
You define a local variable, named do, and use it. That works of
course. Btw you may use it without the call to var
(def do println)
(do example)
It only
I've written a small simulation program, in order to help me learn
Clojure. I've reproduced it below. It's quite likely not very
idiomatic - any suggestions on how to improve it would be nice.
However, my main concern is that it doesn't seem to scale as I would
expect when multi-threading.
The
Also, according to Merriam-Webster, uppercase and lowercase don't have
hyphens in them.
RJ
On May 30, 3:49 pm, Stuart Halloway stuart.hallo...@gmail.com wrote:
I have been working on a branch [1] and haven't updated the ticket yet [2].
Given the number of diverse (and sometimes opposite!)
Thanks! Trying to pass through non-strings was overreaching. Ease of use first:
the API should return immutable strings. If you really need to optimize more
than this, roll your own.
Stu
Type-hinting args as a CharSequence is a GoodThing; type-hinting that
you're returning a CharSequence
Antony Blakey antony.bla...@gmail.com wrote ..
On 31/05/2010, at 11:13 AM, Marc Spitzer wrote:
I actually primarily do not care about mac or windows, personally or
professionally. Also keep in mind that one of the selling points of
clojure is that it runs where *Java* runs not mac and
On Mon, 31 May 2010 10:53:45 +0930
Antony Blakey antony.bla...@gmail.com wrote:
On 31/05/2010, at 10:44 AM, Marc Spitzer wrote:
also lets not forget about LD_LIBRARY_PATH issues,
No Mac or Windows user would encounter these.
You forget that the Mac is a Unix box. It supports
Steven, thanks for the detailed feedback! Responses inline:
Why do some of the functions use StringBuilder (no internal
synchronization) and some use StringBuffer (provides internal
synchronization). Using the latter is probably a mistake.
Stuck with this thanks to the Java API:
Mike Meyer mwm-keyword-googlegroups.620...@mired.org wrote ..
On Mon, 31 May 2010 10:53:45 +0930
Antony Blakey antony.bla...@gmail.com wrote:
On 31/05/2010, at 10:44 AM, Marc Spitzer wrote:
also lets not forget about LD_LIBRARY_PATH issues,
No Mac or Windows user would encounter
But they can be separate words, and Java treats them so (.toUpperCase,
.toLowerCase).
Stu
Also, according to Merriam-Webster, uppercase and lowercase don't have
hyphens in them.
RJ
On May 30, 3:49 pm, Stuart Halloway stuart.hallo...@gmail.com wrote:
I have been working on a branch [1]
On 31/05/2010, at 12:31 PM, Mike Meyer wrote:
On Mon, 31 May 2010 10:53:45 +0930
Antony Blakey antony.bla...@gmail.com wrote:
On 31/05/2010, at 10:44 AM, Marc Spitzer wrote:
also lets not forget about LD_LIBRARY_PATH issues,
No Mac or Windows user would encounter these.
You forget
I doubt this subthread is of any use to the OP at this point.
On 31/05/2010, at 12:31 PM, lprefonta...@softaddicts.ca wrote:
Any suggestion is welcomed but I doubt we can find a core group of
developers that will win this survey.
It's a survey group of 1 i.e. what are *his* responses to those
On 31 May 2010 04:51, Paul Moore p.f.mo...@gmail.com wrote:
On 30 May 2010 12:31, alux alu...@googlemail.com wrote:
Small addition, you missed to add the : before eof
replace goto eof by goto :eof
Thanks, good catch. (goto eof without the colon works on TCC, which
I normally use as my
Antony Blakey antony.bla...@gmail.com wrote ..
I doubt this subthread is of any use to the OP at this point.
I run a software business, I generally look at product decisions in terms
of cost/benefits from end to end over time not just looking solely at a
specific item and specific time frame.
On 31/05/2010, at 2:04 PM, lprefonta...@softaddicts.ca wrote:
Two alternatives seem to gather some support, Swing and SWT. Now what are
the
cost/benefits of choosing SWT ?
See below.
What value brings SWT ?
a) Performance ? Maybe a few years ago but presently
Swing and SWT are
On May 30, 9:23 pm, Antony Blakey antony.bla...@gmail.com wrote:
I care about Mac and Windows primarily, and building software that will sell
(not dev tools) requires good native look and feel.
Do you have a single example of an SWT app that has a decent feel on
OS X? I've spent a fair
The trouble with pmap is that it only works well with a slow function
and a short sequence. In trivial tests, it seems to be best if the
sequence has as many elements as you do cores.
I've been experimenting with things that are like pmap, but work
better in situations that I care about. I'm
Hi Meikel,
Meikel Brandmeyer wrote:
Am 30.05.2010 um 16:39 schrieb Sina K. Heshmati:
[2]
http://github.com/sindoc/algorithms/blob/master/src/test/clojure/whiteboard/y2010/hide-adt-state-using-closure.clj
I'm almost sure, that this code does not what you expect. Nested def's, and
in
On 31/05/2010, at 2:27 PM, James Cunningham wrote:
On May 30, 9:23 pm, Antony Blakey antony.bla...@gmail.com wrote:
I care about Mac and Windows primarily, and building software that will sell
(not dev tools) requires good native look and feel.
Do you have a single example of an SWT
70 matches
Mail list logo