Hi,
On 4 Nov., 04:58, ka wrote:
> (defprotocol OnlyHalfCooless x y z)
>
> Instead of
> (defn is-this-cool? [o] (satisfies? Coolness o))
>
> I need to now write:
> (defn is-this-cool? [o] (or (instance? Cool1 o) (instance? Cool2 o))
> or, (even worse)
> (defn is-this-cool? [o] (and (satisfies? On
On Wed, Nov 3, 2010 at 8:51 PM, Mike Meyer
wrote:
>> Solution: don't have monolingual programmers on your team :)
> What, we shouldn't hire Americans? :-)
Normally that joke is aimed at Brits like me :)
> That only helps if everyone actually knows all the languages involved
Well, smart people p
On Wed, Nov 3, 2010 at 7:47 PM, Nick Brown wrote:
> We could set up a web app that uses data mining algorithms to analyze
> people's interests, experience with Clojure, industries they work in,
> Myers-Briggs type, and other information to put together compatible
> small groups of people.
Or you
If you're looking to generate all the numbers with exactly two prime
factors (counting multiplicity), I have clojure code that generates
the ones up to 10^8 in under two minutes:
com.example.sbox=> (time (count (semiprimes-to 1)))
"Elapsed time: 106157.33292 msecs"
41803068
It's single-th
I get the expected result in my REPL via SLIME:
user> *clojure-version*
{:major 1, :minor 2, :incremental 0, :qualifier ""}
user> (set! *warn-on-reflection* true)
true
user> (defn foo [s] (.charAt s 1))
Reflection warning, NO_SOURCE_FILE:1 - call to charAt can't be resolved.
#'user/foo
Regards,
S
One more suggestion: Try simply creating one giant map that maps
complete postal code strings directly to the associated data values,
without any tree data structure explicitly created in your code. The
code will be a lot simpler, and the underlying data structure is
likely to be competit
The website has this example:
(set! *warn-on-reflection* true)
-> true
(defn foo [s] (.charAt s 1))
-> Reflection warning, line: 2 - call to charAt can't be resolved.
-> #user/foo
When I try this in a Clojure 1.2 REPL generated by Enclojure 1.4.0/NB
6.9.1 I don't see the reflection warning in any
> AFAIK, it is not possible. You must implement all the different protocols.
> It might look desapointing, but on the other hand it is not necessary.
> (As there is no static typing in Clojure)
> What is your use-case?
Current use case is that I want an abstraction which comprises of a
set of oper
On Wed, 3 Nov 2010 16:26:13 -0700
Sean Corfield wrote:
> On Wed, Nov 3, 2010 at 3:31 PM, Mike Meyer
> wrote:
> > We're facing that now, and with a mono-lingual system, you know
> > everyone can contribute to any part of the project. If different parts
> > are in different languages, then people
>> I would guess the problem is referring to T inside the deftype.
This also works:
(deftype T [] Object (equals [this o] (if (= T (class o)) true
false)))
But as Meikel said hope that this is not the end of the story.
--
You received this message because you are subscribed to the Google
Group
Check out assoc-in, get-in, and update-in. They make working with
nested maps a breeze. Here's a rewrite of your code:
(ns user
(:require [clojure.string :as str]
[clojure.java.io :as io]))
(def postcode-trie
(with-open [r (io/reader "/path/to/data.csv")]
(reduce
(fn [tri
On Nov 3, 2010, at 8:31 PM, Andy Fingerhut wrote:
> I'd recommend changing your code to use Java chars instead of single-char
> Java strings. That plus the change Paul suggests below should reduce memory
> consumption significantly.
Another option is to .intern() the strings. You'll still crea
On Nov 3, 2010, at 9:24 PM, Seth wrote:
> Is it possible to reload modified classes? I would likely to quickly
> test my java classes with clojure.
http://www.zeroturnaround.com/jrebel/
Used to have a free, um, Scala license too...
-- Alexy
--
You received this message because you are subscri
In addition to this, note that every java.lang.String, i.e. every "A"
in your example data structures below, requires storage for one
java.lang.Object (8 bytes on 32-bit JVMs, 16 bytes on 64-bit JVMs)
plus an array of java char's, where I think that is equal to the size
of a java.lang.Objec
Is it possible to reload modified classes? I would likely to quickly
test my java classes with clojure.
--
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
btw.: me too has great respect for ruby/rails
one of the nice aspects of clojure is, that multiple
currents and flavours of modern programming
accumulate/reconvene in there.
like evolution. diversity is good. it produces its own
power and controversy.
my fazit: clojure has great potential for we
Hi Vivek,
thanks for the info on the Cornell projects. (- jiff f)
[2]
Fabric: a federated, distributed system for securely and reliably
storing, sharing, and computing information.
http://www.cs.cornell.edu/projects/fabric/
The Fabric programming language is based on Jif.
[1]
Jif: Java + inform
We could set up a web app that uses data mining algorithms to analyze
people's interests, experience with Clojure, industries they work in,
Myers-Briggs type, and other information to put together compatible
small groups of people.
I just had a "How big of a nerd can I be?" moment. But that doesn
Try ants demo - https://github.com/krukow/ants-demo. It's an updated
version of the original Rich Hickey demo.
On Sun, Oct 31, 2010 at 9:13 PM, Alex Baranosky <
alexander.barano...@gmail.com> wrote:
> Thanks for these applications to look at. These look nice, but don't have
> much use for STM.
I really like this idea.
On Wed, Nov 3, 2010 at 1:16 PM, Laurent PETIT wrote:
> Speed dating at the clojure conj, yay ! (not totally non-sense, really)
>
> 2010/11/3 Alexy Khrabrov :
> > Badges could have much bigger font/be more readable, but they are not the
> only, and not the main thing; a mi
If you want to do this, you can do it simpler, without the loop and temp var:
(defn twice-composite? [n]
(->> (take-while #(< % n) prime-seq)
(every #(or (divides? (* 2 %) n)
(not (divides? % n
but this is not what you want. See the hints I sent you off the list.
On We
Why not just sort the text file and then build the merged trees
directly, without the numerous intermediate trees?
On Wed, Nov 3, 2010 at 12:22 PM, Paul Ingles wrote:
> Hi,
>
> I've been playing around with breaking apart a list of postal codes to
> be stored in a tree with leaf nodes containing
I could be missing something, but since you say you're running into
problems as your data gets large, I think you're possibly running into
2 things:
1. You're reading all the data into memory, and keeping it there, in
the form of the lines from the file.
2. The way you're defining postcodes-from-f
For writing DSLs, consider the excellent speak of cgrand at the conj :
(not= DSL macros)
Here are the slides: http://speakerrate.com/talks/4895-not-dsl-macros
Yes, I saw the slides. I disagree with the speaker, at least, from
what I could see from the slides.
If you could argument more, this
On Wed, Nov 3, 2010 at 3:31 PM, Mike Meyer
wrote:
> We're facing that now, and with a mono-lingual system, you know
> everyone can contribute to any part of the project. If different parts
> are in different languages, then people working in one area won't
> necessarily be able to help with other
All the time spent factoring is wasted. You can *construct* and/or
count the semiprimes far more efficiently than your method of
factoring each number one a time in order to filter the semiprimes
from the entire range of numbers up to 10^8. Your approach is
fundamentally slow; this has nothing to
Sean Corfield wrote ..
> Why are folks so insistent on monolingual systems?
We're facing that now, and with a mono-lingual system, you know
everyone can contribute to any part of the project. If different parts
are in different languages, then people working in one area won't
necessarily be able
I figured it out; if anyone has trouble with this in the future and
Googles this, it's done by (spit f content :append true)
On Nov 3, 1:57 pm, Daniel Bell wrote:
> Clojuredocs mentioned that opts could be passed to clojure.java.io/
> Writer, but (little Java background), I'm having a hard time f
Another possibility is to have something online, based on
registration, that let's people write a little bit about themselves
and offers tags or some such so attendees can find interesting /
similar (or different!) people to meet. I've used such networking apps
at a couple of conferences but I don'
On Wed, Nov 3, 2010 at 12:22 PM, Paul Ingles wrote:
> (defn merge-tree
> [tree other]
> (if (not (map? other))
>tree
>(merge-with (fn [x y] (merge-tree x y))
>tree other)))
>
You can get rid of the anonymous function here and just do (merge-with
merge-tree tree other).
On Wed, Nov 3, 2010 at 10:59 AM, wrote:
> This was/is one of the original selling points and philosophies of Rails - a
> monolingual system should mean less context switching, less glue code for
> things to talk to each other, fewer bugs and mistakes stemming from
> uniformity of language, and
Clojuredocs mentioned that opts could be passed to clojure.java.io/
Writer, but (little Java background), I'm having a hard time figuring
out what the analog to "options" is in the Java API. Any help?
Thanks,
--
You received this message because you are subscribed to the Google
Groups "Clojure"
I agree about the "speed dating" concept or something to have each of us talk
at least once with everyone else (as long as the group size is feasible). We
mostly all groan at these ice breaker type activities but they do tend to work
ok at getting people in larger groups to interact at least on
> Why are folks so insistent on monolingual systems?
This was/is one of the original selling points and philosophies of Rails - a
monolingual system should mean less context switching, less glue code for
things to talk to each other, fewer bugs and mistakes stemming from uniformity
of language,
Hi,
I've been playing around with breaking apart a list of postal codes to
be stored in a tree with leaf nodes containing information about that
area. I have some code that works with medium-ish size inputs but
fails with a GC Overhead error with larger input sets (1.5m rows) and
would really appr
On Fri, Oct 29, 2010 at 21:32, Michael Gardner wrote:
> Agreed. What is the point of Javascript on the server side? Familiarity?
> Consistency with client-side code?
>
I guess what Java was meant to be, to some degree? "Write once run
anywhere". I for one am still hankering for a great way to w
Hi,
When I stumbled upon the question "Clojure coalesce function" at
StackOverflow today, I saw a place for "reverted" maybe-m and
sequence-m monads. It seemed to have been easy, but turned out not. I
can't figure out how to use monads for the task at hand. Could someone
point me into a right dire
One idea that I had was to inline the factoring logic into twice-
composite. Who cares about the factors? We just want to know if there
are two or not:
(defn twice-composite? [n]
(loop [ps prime-seq
tmp n
p-count 0]
(if (< 2 p-count)
false
(if (= 1 tmp)
I have no problem at all with polyglot systems.
That said, Clojure, as a general-purpose programming language, is in
my subjective opinion superior to Ruby. Furthermore, there is nothing
special about Ruby that makes it particularly suited to webapps (MVC
webapps, perhaps, but MVC is not the only
Your Clojure implementation of your particular approach is reasonable,
but you need a cleverer approach. I'll send you a hint offline.
--
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
Sorry for the delayed response.
OK... here's an example; my solution to problem 187:
(defn divides? [n d]
(zero? (rem n d))
)
(declare prime? prime-seq)
(defn prime? [n]
(if (< n 2)
false
(every? #(not (divides? n %)) (take-while #(<= (* % %) n) prime-
seq)))
)
(def prime? (memoize
Does anybody know if this fix made it to the released jar?
On Oct 17, 12:18 am, Mike Hinchey wrote:
> I think it is caused by those 2 clojure bugs (which seem to be the same
> thing). You may be able to work around that problem by patching
> appengine-clj to hint the method call to be on the pub
Are there any plans on having an edition of the Conj somewhere in
europe? If not, I'd like to suggest we have one over here :)
U
--
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 p
2010/11/3 nicolas.o...@gmail.com :
> Very fast 3 minutes talk could be fun too.
interspaced between 2 talks, hmm, interesting ! (but it could have
worked for the first conj where we were just 200, but maybe will not
work for the next, if we're > 1000 :-) )
>
> Name, nicknames, and what you are us
most companys i know - i have come around a lot last
years - clearly prefer spring to grails because:
1. the integration-aspect is much more important for them than partial
productivity win or promise.
2. java is established in their tech portfolio groovy is not
clojure is completely out of scop
Sean Corfield wrote ..
> On Wed, Nov 3, 2010 at 8:51 AM, Luke VanderHart
> wrote:
> > I have nothing but respect for Rails, and I look forward to the day
> > when Clojure has a comparable system.
>
> I sort of have to ask "why?" - what's wrong with using Rails on JRuby
> for the front end and Cl
On Wed, Nov 3, 2010 at 8:51 AM, Luke VanderHart
wrote:
> I have nothing but respect for Rails, and I look forward to the day
> when Clojure has a comparable system.
I sort of have to ask "why?" - what's wrong with using Rails on JRuby
for the front end and Clojure for the model?
Why are folks so
On Wed, Nov 3, 2010 at 5:37 AM, Stuart Sierra
wrote:
> Protocols provide just one thing: polymorphic functions. They are not
> intended to provide "type" or hierarchy like Java classes /
> interfaces.
Well, they also provide a second thing -- a way to bundle multiple
functions as something that i
Very fast 3 minutes talk could be fun too.
Name, nicknames, and what you are using Clojure for.
No slides of course.
Best,
Nicolas.
--
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 t
Speed dating at the clojure conj, yay ! (not totally non-sense, really)
2010/11/3 Alexy Khrabrov :
> Badges could have much bigger font/be more readable, but they are not the
> only, and not the main thing; a mixer format is, and it should be something
> deliberate as even random motion over 2 d
Badges could have much bigger font/be more readable, but they are not the only,
and not the main thing; a mixer format is, and it should be something
deliberate as even random motion over 2 days is not enough to bring all
particles next to each other!
-- Alexy
On Nov 3, 2010, at 12:52 PM, Chri
I was thinking that it would be handy if the "badges" next year had
space for that. I'd be happy to whip up something to collect the data
and print the badges.
Chris
On Wed, Nov 3, 2010 at 12:35 PM, Alexy Khrabrov
wrote:
> I'd really like to meet everybody from IRC and github, but apparently mi
On Wed, Nov 3, 2010 at 12:38 PM, David Nolen wrote:
> On Wed, Nov 3, 2010 at 11:53 AM, Sunil S Nandihalli <
> sunil.nandiha...@gmail.com> wrote:
>
>> thanks Jim for your email. I will try to get my hands on Reasoned
>> Schemer.. :)
>> Sunil.
>>
>
William Byrd's dissertation, http://gradworks.umi.
On Wed, Nov 3, 2010 at 11:53 AM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:
> thanks Jim for your email. I will try to get my hands on Reasoned Schemer..
> :)
> Sunil.
>
I've been working through it and it's an eye-opening book, particularly for
me as I'm not that familiar with Prolo
I'd really like to meet everybody from IRC and github, but apparently missed
some. So perhaps we can have a meet-and-greet session, where folks will stand
up and announce their IRC and github nicks! We also need some color coding, as
@hiredman could be easily confused with @liebke!
@alexyk
-
thanks Jim for your email. I will try to get my hands on Reasoned Schemer..
:)
Sunil.
On Wed, Nov 3, 2010 at 7:44 PM, jim wrote:
> Sunil,
>
> I've been away from that code for a while, so I forget the details
> about its cut operator. However, I would really encourage you to read
> The Reasoned
Ok... Fair enough. Most of my comment related to Spring, not to
Grails.
Grails has other issues which I won't get into here.
I have nothing but respect for Rails, and I look forward to the day
when Clojure has a comparable system.
On Nov 2, 2:32 pm, Wilson MacGyver wrote:
> On Tue, Nov 2, 2010
Hi,
On 3 Nov., 15:37, Mark Hamstra wrote:
> It would seem that a solution to this problem would be to treat such
> automatic boxing/upcasting similar to reflection -- i.e., have an
> option that causes Clojure to spit out a warning when such boxing/
> upcasting occurs, alerting the performance c
It would seem that a solution to this problem would be to treat such
automatic boxing/upcasting similar to reflection -- i.e., have an
option that causes Clojure to spit out a warning when such boxing/
upcasting occurs, alerting the performance conscious of the need to
change the code that is gener
Sunil,
I've been away from that code for a while, so I forget the details
about its cut operator. However, I would really encourage you to read
The Reasoned Schemer, which is where that code came from.
I'm also intending to change it to use Fogus' unifier when I get home.
Jim
On Nov 3, 8:14 am,
Hi,
On 3 Nov., 14:58, Adrian Cuthbertson
wrote:
> I would guess the problem is referring to T inside the deftype. This works;
>
> (deftype T [] Object (equals [this o] (if (instance? (class this) o)
> true false)))
> (let [t (T.)] (.equals t t))
> ==> true
I hope that this is not the end of the
I would guess the problem is referring to T inside the deftype. This works;
(deftype T [] Object (equals [this o] (if (instance? (class this) o)
true false)))
(let [t (T.)] (.equals t t))
==> true
On Wed, Nov 3, 2010 at 12:39 PM, ka wrote:
> Clojure 1.2.0
> 1:1 user=>
> 1:2 user=>
> 1:3 user=>
Michael: thanks for those tips. I can't do anything about those but I
will raise it...
ka: you can find that kind of stuff now on the Clojure confluence
pages:
http://dev.clojure.org/display/design/Home
On Nov 2, 10:43 pm, ka wrote:
> Hi Alex, Can we have a section: Clojure - What's next? Dish
Hi Konrad,
It is really nice .. But I was wondering if it had a cut operator or
predicate .. similar to '!' in prolog..
Thanks,
Sunil.
On Wed, Nov 3, 2010 at 1:20 PM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:
> Thanks Konrad. I will look at it.
> Sunil
>
>
> On Wed, Nov 3, 2010 at
Before going down this road, I'd strongly recommend reading Ross
Anderson's paper "Programming Satan's Computer":
http://www.cl.cam.ac.uk/~rja14/Papers/satan.pdf
In addition, Ross has generously put the first edition of his book
"Security Engineering" online:
http://www.cl.cam.ac.uk/~rja14/book.
On Nov 3, 6:32 am, ka wrote:
> 1. How to combine protocols?
Just define types that extend all the protocols.
> On a related note if I have a protocol P how can I create a protocol
> with is a union of P and java.lang.Comparable ?
You can't. But you can define a type that extends both P and
Com
2010/11/3 Tim Daly :
>
>
> On 11/2/2010 12:38 PM, Laurent PETIT wrote:
>>
>> 2010/10/30 Tim Daly:
>>>
>>> Macros in lisp get used for three general purposes, at least
>>> in my experience.
>>>
>>> The first purpose is efficiency. In common lisp you will find
>>> that you can generate very machine-
On Wed, Nov 3, 2010 at 1:04 AM, Vivek Khurana wrote:
>
>
> On Nov 2, 8:56 pm, Ken Wesson wrote:
>
> > That seems impossible assuming you don't trust the software running on
> the
> > other node.
> >
>
> It is not impossible. There are projects by Cornell .University,
> jiff[1] and fabric[2] whic
On 11/2/2010 12:38 PM, Laurent PETIT wrote:
2010/10/30 Tim Daly:
Macros in lisp get used for three general purposes, at least
in my experience.
The first purpose is efficiency. In common lisp you will find
that you can generate very machine-efficient (aka optimized
fortran level) binary ins
On Wed, Nov 3, 2010 at 10:32 AM, ka wrote:
> 1. How to combine protocols?
>
AFAIK, it is not possible. You must implement all the different protocols.
It might look desapointing, but on the other hand it is not necessary.
(As there is no static typing in Clojure)
What is your use-case?
> 2. Do
Clojure 1.2.0
1:1 user=>
1:2 user=>
1:3 user=> (deftype T [] Object (equals [this o] (if (instance? T o)
true false)))
user.T
1:4 user=> (def t (T.))
#'user/t
1:5 user=> (.equals t t)
false
1:6 user=> (deftype T [] Object (equals [this o] (if (= T (class o))
true false)))
user.T
1:7 user=> (def t (
1. How to combine protocols?
For example I have protocols walks, talks, sleeps, now how might I
come up with an abstraction which walks-talks-and-sleeps ? In Java
one might create an interface which extends multiple interfaces.
Although getting an instance which walks-talks-and-sleeps is made ea
Some things are certainly possible. It depends whether you consider
all computers to be friendly of
some of them to be evil.
If all of them are friendly, you can annotate your data by permissions.
Else, you need either to check what you send to other computers, or
crypt with different keys.
--
On Wed, Nov 3, 2010 at 2:35 AM, Meikel Brandmeyer wrote:
> Hi,
>
> On 3 Nov., 00:40, Rasmus Svensson wrote:
>
>> I think the problem is that this reduction will build an expression like
>> this:
>>
>> (map + ... (map + ... (map + ... (map + ... > levels>
>>
>> When clojure tries to reali
Thanks Konrad. I will look at it.
Sunil
On Wed, Nov 3, 2010 at 1:08 PM, Konrad Hinsen wrote:
> On 3 Nov 2010, at 06:04, Sunil S Nandihalli wrote:
>
> Hello everybody,
>> I was wondering if one can code in a way semantically similar to prolog
>> using the backtracking monads.. Has anybody tried
On 3 Nov 2010, at 06:04, Sunil S Nandihalli wrote:
Hello everybody,
I was wondering if one can code in a way semantically similar to
prolog using the backtracking monads.. Has anybody tried it .. ? I
did see the tutorial which demonstrates backtracking monads ..
http://brehaut.net/blog/201
76 matches
Mail list logo