inheritance when extending goog library

2012-10-01 Thread Wei Hsu
I want to add a callback for goog.ui.Popup to call when it's closed. The latest version of the closure library supports adding callbacks (http://closure-library.googlecode.com/svn/docs/ closure_goog_disposable_disposable.js.source.html#line209), but the version that Clojurescript uses doesn't.

fileseq modifiers - :min-depth, :max-depth ?

2012-10-01 Thread coltnz
Hi, not sure if this is considered too frivolous somehow but I've thought many times how nice it would be to modify a fileseq call by using a min-depth or max-depth modifier rather constructing a filter. Depth would refer to the levels of the underlying treeseq returned. So

Re: Core.logic performance of looping over a list with tabling

2012-10-01 Thread Reinout Stevens
On Saturday, September 29, 2012 11:10:38 PM UTC+2, David Nolen wrote: On Wed, Sep 26, 2012 at 9:20 AM, Reinout Stevens rest...@vub.ac.bejavascript: wrote: Hi, I'm the author of a DSL that allows reasoning over paths throughout graphs using core.logic (

Re: Core.logic performance of looping over a list with tabling

2012-10-01 Thread David Nolen
Looking into it. On Monday, October 1, 2012, Reinout Stevens wrote: On Saturday, September 29, 2012 11:10:38 PM UTC+2, David Nolen wrote: On Wed, Sep 26, 2012 at 9:20 AM, Reinout Stevens rest...@vub.ac.bewrote: Hi, I'm the author of a DSL that allows reasoning over paths throughout

Re: Is Slick feasible in Clojure?

2012-10-01 Thread Timothy Baldridge
I've thought about this as well. Coming from the .NET world I'm quite familiar with the Linq.Expression namespace. I too have wondered about this. For those who are not familiar with how IQueryableT works in Linq, it's something like the following (in clojure): (def query (q (db :people)

Re: Is Slick feasible in Clojure?

2012-10-01 Thread Yann Schwartz
On Mon, Oct 1, 2012 at 4:45 PM, Timothy Baldridge tbaldri...@gmail.comwrote: I've thought about this as well. Coming from the .NET world I'm quite familiar with the Linq.Expression namespace. I too have wondered about this. For those who are not familiar with how IQueryableT works in Linq,

Re: Is Slick feasible in Clojure?

2012-10-01 Thread Timothy Baldridge
Not to nitpick, but Linq to XML is based on Linq to objects entirely (no IQueryable, juste vanilla IEnumerables). You're correct. To my - naive - knowledge of clojure macros, writing an provider in clojure would be a lot easier than it is in C# (or even with F# quotations). I would

Re: Is Slick feasible in Clojure?

2012-10-01 Thread Alessio Stalla
Il giorno lunedì 1 ottobre 2012 16:45:44 UTC+2, tbc++ ha scritto: I've thought about this as well. Coming from the .NET world I'm quite familiar with the Linq.Expression namespace. I too have wondered about this. For those who are not familiar with how IQueryableT works in Linq, it's

Re: Playing with clojure-encog, Machine-Learning wrapper

2012-10-01 Thread Timothy Washington
Hey, thanks for responding. See responses inlined. On Mon, Oct 1, 2012 at 4:24 AM, Jim - FooBar(); jimpil1...@gmail.comwrote: I've always found this page very good : http://www.doc.ic.ac.uk/~nd/surprise_96/journal/vol4/cs11/report.html generally, the weight of a connection is adjusted by

Re: Playing with clojure-encog, Machine-Learning wrapper

2012-10-01 Thread Jim - FooBar();
Hmmm...I am not sure I follow... the error is simply (- target actual). Then you take the square of that difference (2 reasons for that) and there you have the error per neuron at the output layer. Then you simply add them up to get the entire network's error. so far so good... the tricky

Regarding Starting Clojure

2012-10-01 Thread aboy021
I decided to quickly compare the website experience of starting Clojure and starting Scala. I do a Google search for Clojure I decide to try the first link, Clojure.org There's some basic information. I follow the somewhat obscure link halfway down the side, Getting Started Ok, that looks

Re: Playing with clojure-encog, Machine-Learning wrapper

2012-10-01 Thread Timothy Washington
Hey, thanks for these. I'll take the evening to read through them. It's the gradient descent calculation that I find to be convoluted. I understand the concept. But I haven't seen a clear example of how that's done. That's what I was trying to nail down with that output neuron example. And reading

Re: Transforming an ugly nested loop into clojure code

2012-10-01 Thread arekanderu
I wrote a much better example in order to show what am I trying to do. Of course, the following is a simplified version of the actual code in order to make things easier for everybody. (def my-data [{:area Somewhere :warehouses [{:warehouse W54321 :containers

Re: Transforming an ugly nested loop into clojure code

2012-10-01 Thread gaz jones
You appear to be running over the map purely for side-effects, therefore off the top of my head something like: (defn my-func [data] (doseq [area data warehouse (:warehouses area) container (:containers warehouse) box (:boxes container)] (if-not (empty?

Re: Regarding Starting Clojure

2012-10-01 Thread Grant Rettke
On Mon, Oct 1, 2012 at 4:13 PM, aboy021 arthur.bo...@gmail.com wrote: The getting started issue is an ongoing problem for Clojure. It's an issue that keeps coming up in the surveys and on the mailing list. Other languages are doing it really well, Scala is just a convenient example. What does

Re: Transforming an ugly nested loop into clojure code

2012-10-01 Thread arekanderu
Thank you Gaz for your reply. You are correct about the side effects. I will go through your example more carefully and give it a go. It definitely looks more promising than what I got :) On Tuesday, October 2, 2012 1:22:44 AM UTC+3, Gaz wrote: You appear to be running over the map purely for

Re: Regarding Starting Clojure

2012-10-01 Thread Andreas Liljeqvist
Probably they wouldn't, but that's not the point. The clojure community is doing something wrong for providing a coherent beginner experience. Maybe we aren't good at encouraging people to contribute documentation. Or the composability of Clojure leads to small library islands without much

Which power function is right for Clojure?

2012-10-01 Thread Grant Rettke
(ns power.examples) (defn non-acc-pow [base exp] (if (zero? exp) 1 (* base (non-acc-pow base (dec exp) (defn acc-pow [base exp] (letfn [(loop [base exp acc] (if (zero? exp) acc (recur base (dec exp) (* base acc] (loop base exp 1)))

Re: Which power function is right for Clojure?

2012-10-01 Thread Andy Fingerhut
It depends. Are you trying to optimize for speed? Teaching a particular style of programming? Code size? Range of input values handled correctly? Time to write it? Something else? Andy On Oct 1, 2012, at 4:45 PM, Grant Rettke wrote: (ns power.examples) (defn non-acc-pow [base exp]

Re: Which power function is right for Clojure?

2012-10-01 Thread Jean Niklas L'orange
Numeric tower has implemented pow (named expt in the library), so you could have a look at their implementation: https://github.com/clojure/math.numeric-tower/blob/master/src/main/clojure/clojure/math/numeric_tower.clj#L64 (It utilizes exponentiation by squaring to get the running time from O(n)

Re: Which power function is right for Clojure?

2012-10-01 Thread Mark Engelberg
On Mon, Oct 1, 2012 at 4:45 PM, Grant Rettke gret...@acm.org wrote: (ns power.examples) (defn non-acc-pow [base exp] (if (zero? exp) 1 (* base (non-acc-pow base (dec exp) This is not ideal for Clojure. The exponent will be limited by the stack size in Java. (defn

Re: Which power function is right for Clojure?

2012-10-01 Thread Mark Engelberg
On Mon, Oct 1, 2012 at 6:29 PM, Mark Engelberg mark.engelb...@gmail.comwrote: (defn efficient-pow [base pow] (loop [n pow, y 1, z base] (let [t (even? n), n (quot n 2)] (cond t (recur n y (*' z z)) (zero? n) (*' z y) :else (recur n (*' z y) (*' z z))

Re: Regarding Starting Clojure

2012-10-01 Thread Brent Millare
Sounds like the main beef is with the official website's styling and layout. I agree its not necessarily the prettiest but all the information is there. On the other hand, there are plenty of great resources that provide a great getting started experience in my opinion. Just typing clojure in

Parallella - The new era of computing?

2012-10-01 Thread René Groß
Hi, Anyone heard of the project Parallellahttp://www.kickstarter.com/projects/adapteva/parallella-a-supercomputer-for-everyone yet? What do you think about it? Will it be of any interest for the clojure plattform? Kind regards, René -- You received this message because you are subscribed

Problems loading Clojure core in Nutch plugin

2012-10-01 Thread Michael Lim
Hi there, I am trying to implement a Nutch plugin in Clojure 1.3. It works correctly in Nutch standalone mode, but not in Nutch distributed (Hadoop) mode. I have made the plugin inherit from Nutch's HtmlParser class, as follows. --- (ns test_plugin.core) (gen-class :name

Re: Clojure web framework

2012-10-01 Thread James MacAulay
Frameworks have benefits which can't easily be achieved with documentation. The most obvious to me is that a framework lets you fire up a complete system of carefully curated components in no time. They also let you defer choices until you actually need to care about them. Because Clojure's

Re: Clojure web framework

2012-10-01 Thread Leonardo Borges
On Sun, Sep 30, 2012 at 12:27 PM, James MacAulay jmacau...@gmail.comwrote: Frameworks have benefits which can't easily be achieved with documentation. The most obvious to me is that a framework lets you fire up a complete system of carefully curated components in no time. They also let you