Re: Clojure with Tensorflow, Torch etc (call for participation, brainstorming etc)

2016-10-06 Thread Sunil S Nandihalli
I think deeplearning4J is a contender for deeplearning in clojure. I have
not used it .. but I repeatedly see the sponsored link on clojure-reddit.
Since nobody mentioned it .. I thought of mentioning it

On Fri, Oct 7, 2016 at 7:40 AM, kovas boguta  wrote:

> On Thu, Oct 6, 2016 at 9:26 PM, Mikera 
> wrote:
>
>>
>> I'm hoping to work with Dragan to get core.matrix integration working
>> with Neanderthal, now that Windows support is finally arriving. This would
>> get you a few big advantages:
>>
>
> Yes, I can see how my problem relates to the core.matrix vision. The only
> missing piece is the actual operations I want (nn layers) :)
>
>
> --
> 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 unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to call the method when it clearly exists..

2016-05-12 Thread Sunil S Nandihalli
I was able to get over this problem by doing one of the following two ways
of calling "parquet" function.

(. inp-rdr (parquet (into-array java.lang.String [parq-path])))
(. inp-rdr (parquet (-> [parq-path] JavaConversions/asScalaBuffer .toList)))

On Fri, May 13, 2016 at 10:01 AM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:

> Just to add to the previous email,
> I have also tried
>
> (. inp-rdr-s (parquet (to-array '(parq-path))
>
> but got the same error.
> Thanks
> Sunil.
>
> On Fri, May 13, 2016 at 9:55 AM, Sunil S Nandihalli <
> sunil.nandiha...@gmail.com> wrote:
>
>> Hi everybody,
>>  I am trying to call function "parquet" on the var "inp-rdr-s". From the
>> following reflection output using clojure.reflect, it is clear that the
>> method parquet exists. However I am unable to call the function. Can
>> somebody help?
>> Thanks and regards,
>> Sunil
>>
>> bidland.core> (def parq-path
>> "/home/hdfs/sunil/dl4j/bidland/tmp/sunil-bidland-data/part-r-0.parquet")
>> #'bidland.core/parq-path
>> bidland.core> (pp/pprint (filter  #(= 'parquet (:name %)) (:members
>> (r/reflect (class inp-rdr-s)
>> ({:name parquet,
>>   :return-type org.apache.spark.sql.DataFrame,
>>   :declaring-class org.apache.spark.sql.DataFrameReader,
>>   :parameter-types [java.lang.String<>],
>>   :exception-types [],
>>   :flags #{:varargs :public}}
>>  {:name parquet,
>>   :return-type org.apache.spark.sql.DataFrame,
>>   :declaring-class org.apache.spark.sql.DataFrameReader,
>>   :parameter-types [scala.collection.Seq],
>>   :exception-types [],
>>   :flags #{:public}})
>> nil
>> bidland.core> (. inp-rdr-s (parquet parq-path))
>> IllegalArgumentException No matching method found: parquet for class
>> org.apache.spark.sql.DataFrameReader
>>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:80)
>> bidland.core>
>>
>
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to call the method when it clearly exists..

2016-05-12 Thread Sunil S Nandihalli
Just to add to the previous email,
I have also tried

(. inp-rdr-s (parquet (to-array '(parq-path))

but got the same error.
Thanks
Sunil.

On Fri, May 13, 2016 at 9:55 AM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:

> Hi everybody,
>  I am trying to call function "parquet" on the var "inp-rdr-s". From the
> following reflection output using clojure.reflect, it is clear that the
> method parquet exists. However I am unable to call the function. Can
> somebody help?
> Thanks and regards,
> Sunil
>
> bidland.core> (def parq-path
> "/home/hdfs/sunil/dl4j/bidland/tmp/sunil-bidland-data/part-r-0.parquet")
> #'bidland.core/parq-path
> bidland.core> (pp/pprint (filter  #(= 'parquet (:name %)) (:members
> (r/reflect (class inp-rdr-s)
> ({:name parquet,
>   :return-type org.apache.spark.sql.DataFrame,
>   :declaring-class org.apache.spark.sql.DataFrameReader,
>   :parameter-types [java.lang.String<>],
>   :exception-types [],
>   :flags #{:varargs :public}}
>  {:name parquet,
>   :return-type org.apache.spark.sql.DataFrame,
>   :declaring-class org.apache.spark.sql.DataFrameReader,
>   :parameter-types [scala.collection.Seq],
>   :exception-types [],
>   :flags #{:public}})
> nil
> bidland.core> (. inp-rdr-s (parquet parq-path))
> IllegalArgumentException No matching method found: parquet for class
> org.apache.spark.sql.DataFrameReader
>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:80)
> bidland.core>
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Unable to call the method when it clearly exists..

2016-05-12 Thread Sunil S Nandihalli
Hi everybody,
 I am trying to call function "parquet" on the var "inp-rdr-s". From the
following reflection output using clojure.reflect, it is clear that the
method parquet exists. However I am unable to call the function. Can
somebody help?
Thanks and regards,
Sunil

bidland.core> (def parq-path
"/home/hdfs/sunil/dl4j/bidland/tmp/sunil-bidland-data/part-r-0.parquet")
#'bidland.core/parq-path
bidland.core> (pp/pprint (filter  #(= 'parquet (:name %)) (:members
(r/reflect (class inp-rdr-s)
({:name parquet,
  :return-type org.apache.spark.sql.DataFrame,
  :declaring-class org.apache.spark.sql.DataFrameReader,
  :parameter-types [java.lang.String<>],
  :exception-types [],
  :flags #{:varargs :public}}
 {:name parquet,
  :return-type org.apache.spark.sql.DataFrame,
  :declaring-class org.apache.spark.sql.DataFrameReader,
  :parameter-types [scala.collection.Seq],
  :exception-types [],
  :flags #{:public}})
nil
bidland.core> (. inp-rdr-s (parquet parq-path))
IllegalArgumentException No matching method found: parquet for class
org.apache.spark.sql.DataFrameReader
 clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:80)
bidland.core>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: connecting to infobrite server from clojure

2016-05-03 Thread Sunil S Nandihalli
Hi Shantanu,
 Thanks for the inputs. I was able to resolve the problem by changing the
version of mysql-java-connector library to 5.1.29. I was previously using
6.0.2 (latest).
Regards,
Sunil

On Mon, May 2, 2016 at 7:04 PM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:

> Hi Shantanu,
>  I am attaching the error stack trace of the exception I got. I am still
> unable to figure out what is happening.
> Thanks,
> sunil.
>
> On Mon, May 2, 2016 at 1:22 PM, Sunil S Nandihalli <
> sunil.nandiha...@gmail.com> wrote:
>
>> Thanks Shantanu for the response. I installed dbvisualizer and it seems
>> to work perfectly fine with infobright.
>>
>>
>>
>> On Mon, May 2, 2016 at 1:04 PM, Shantanu Kumar <kumar.shant...@gmail.com>
>> wrote:
>>
>>> Could you try connecting to InfoBright using DbVisualizer? It is a Java
>>> based tool and any differences w.r.t. the MySQL JDBC driver would be
>>> evident if it fails to work with DbVisualizer.
>>>
>>> https://www.dbvis.com/
>>>
>>> Shantanu
>>>
>>>
>>> On Monday, 2 May 2016 12:48:16 UTC+5:30, Sunil Nandihalli wrote:
>>>>
>>>> Hi Everybody,
>>>>  I have tried to connect to infobrite server using clojure.java.jdbc .
>>>> Infobrite server is supposed to be identical to mysql in terms of the
>>>> protocol. I have successfully used mysqlworkbench to talk to it. When I try
>>>> to connect to the infobrite server using clojure.java.jdbc, I get the
>>>> following exception
>>>>
>>>> java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is
>>>> required
>>>>
>>>> however if I use the exact same code to query a mysql db it works
>>>> perfectly fine. Can somebody help please me with this?
>>>> Thanks and regards,
>>>> Sunil.
>>>>
>>>> The code i use is
>>>>
>>>> (ns cpi.core
>>>>   (:require [clojure.java.jdbc :as jdbc]
>>>> [clojure.string :as s]))
>>>>
>>>> (defn run-query [{:keys [url user password db] :as cnf} & qs]
>>>>   (println qs)
>>>>   (println cnf)
>>>>   (jdbc/with-db-connection [db-conn {:classname "com.mysql.jdbc.Driver"
>>>>  :subprotocol "mysql"
>>>>  :subname (str "//" url "/" db)
>>>>  :user user
>>>>  :password password}]
>>>> (jdbc/query db-conn qs)))
>>>>
>>> --
>>> 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 unsubscribe from this group, send email to
>>> clojure+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: connecting to infobrite server from clojure

2016-05-02 Thread Sunil S Nandihalli
Hi Shantanu,
 I am attaching the error stack trace of the exception I got. I am still
unable to figure out what is happening.
Thanks,
sunil.

On Mon, May 2, 2016 at 1:22 PM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:

> Thanks Shantanu for the response. I installed dbvisualizer and it seems to
> work perfectly fine with infobright.
>
>
>
> On Mon, May 2, 2016 at 1:04 PM, Shantanu Kumar <kumar.shant...@gmail.com>
> wrote:
>
>> Could you try connecting to InfoBright using DbVisualizer? It is a Java
>> based tool and any differences w.r.t. the MySQL JDBC driver would be
>> evident if it fails to work with DbVisualizer.
>>
>> https://www.dbvis.com/
>>
>> Shantanu
>>
>>
>> On Monday, 2 May 2016 12:48:16 UTC+5:30, Sunil Nandihalli wrote:
>>>
>>> Hi Everybody,
>>>  I have tried to connect to infobrite server using clojure.java.jdbc .
>>> Infobrite server is supposed to be identical to mysql in terms of the
>>> protocol. I have successfully used mysqlworkbench to talk to it. When I try
>>> to connect to the infobrite server using clojure.java.jdbc, I get the
>>> following exception
>>>
>>> java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is
>>> required
>>>
>>> however if I use the exact same code to query a mysql db it works
>>> perfectly fine. Can somebody help please me with this?
>>> Thanks and regards,
>>> Sunil.
>>>
>>> The code i use is
>>>
>>> (ns cpi.core
>>>   (:require [clojure.java.jdbc :as jdbc]
>>> [clojure.string :as s]))
>>>
>>> (defn run-query [{:keys [url user password db] :as cnf} & qs]
>>>   (println qs)
>>>   (println cnf)
>>>   (jdbc/with-db-connection [db-conn {:classname "com.mysql.jdbc.Driver"
>>>  :subprotocol "mysql"
>>>  :subname (str "//" url "/" db)
>>>  :user user
>>>  :password password}]
>>> (jdbc/query db-conn qs)))
>>>
>> --
>> 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 unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


error.stacktrace
Description: Binary data


Re: connecting to infobrite server from clojure

2016-05-02 Thread Sunil S Nandihalli
Thanks Shantanu for the response. I installed dbvisualizer and it seems to
work perfectly fine with infobright.



On Mon, May 2, 2016 at 1:04 PM, Shantanu Kumar 
wrote:

> Could you try connecting to InfoBright using DbVisualizer? It is a Java
> based tool and any differences w.r.t. the MySQL JDBC driver would be
> evident if it fails to work with DbVisualizer.
>
> https://www.dbvis.com/
>
> Shantanu
>
>
> On Monday, 2 May 2016 12:48:16 UTC+5:30, Sunil Nandihalli wrote:
>>
>> Hi Everybody,
>>  I have tried to connect to infobrite server using clojure.java.jdbc .
>> Infobrite server is supposed to be identical to mysql in terms of the
>> protocol. I have successfully used mysqlworkbench to talk to it. When I try
>> to connect to the infobrite server using clojure.java.jdbc, I get the
>> following exception
>>
>> java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is
>> required
>>
>> however if I use the exact same code to query a mysql db it works
>> perfectly fine. Can somebody help please me with this?
>> Thanks and regards,
>> Sunil.
>>
>> The code i use is
>>
>> (ns cpi.core
>>   (:require [clojure.java.jdbc :as jdbc]
>> [clojure.string :as s]))
>>
>> (defn run-query [{:keys [url user password db] :as cnf} & qs]
>>   (println qs)
>>   (println cnf)
>>   (jdbc/with-db-connection [db-conn {:classname "com.mysql.jdbc.Driver"
>>  :subprotocol "mysql"
>>  :subname (str "//" url "/" db)
>>  :user user
>>  :password password}]
>> (jdbc/query db-conn qs)))
>>
> --
> 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 unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


connecting to infobrite server from clojure

2016-05-02 Thread Sunil S Nandihalli
Hi Everybody,
 I have tried to connect to infobrite server using clojure.java.jdbc .
Infobrite server is supposed to be identical to mysql in terms of the
protocol. I have successfully used mysqlworkbench to talk to it. When I try
to connect to the infobrite server using clojure.java.jdbc, I get the
following exception

java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required

however if I use the exact same code to query a mysql db it works perfectly
fine. Can somebody help please me with this?
Thanks and regards,
Sunil.

The code i use is

(ns cpi.core
  (:require [clojure.java.jdbc :as jdbc]
[clojure.string :as s]))

(defn run-query [{:keys [url user password db] :as cnf} & qs]
  (println qs)
  (println cnf)
  (jdbc/with-db-connection [db-conn {:classname "com.mysql.jdbc.Driver"
 :subprotocol "mysql"
 :subname (str "//" url "/" db)
 :user user
 :password password}]
(jdbc/query db-conn qs)))

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Inlein 0.1.0

2016-03-13 Thread Sunil S Nandihalli
Thanks Jean for this. A quick comparison to lein-exec
 shows that your stuff is very
similar to lein-exec but probably much simpler to use with much faster
startup times.  I tried it.

Thanks again.

Sunil.

On Sun, Mar 13, 2016 at 7:39 PM, Jean Niklas L'orange  wrote:

> Hi all Clojurians,
>
> Alex Miller did some research
>  on
> slow boot times with Clojure/scripting in
> Clojure not too long ago.
>
> What I found weird was that there were no tool for doing Clojure
> scripting. It's
> possible to do this with both Leiningen and Boot, but neither were
> originally
> designed for scripts nor fast startup times. I have personally found this
> a bit
> annoying in the past, as I have had good reasons to use Clojure for
> scripting.
>
> Therefore, I have created a new tool called Inlein .
> You can think of it as a
> Leiningen for scripts, where the project.clj is inlined into the script
> itself.
> Inlein itself starts up very fast, so the startup time of a script is more
> or
> less only the time it takes to start Clojure and the dependencies you drag
> in.
>
> You could probably use this for a lot of things. The first thing that
> comes to
> mind is obviously long-running scripts and CLI programs, but it could also
> be
> used for customised REPLs, independent of Boot and Leiningen.
>
> There are probably many uses for Inlein that I haven't thought of yet, but
> if
> you want inspiration, you can have a look in the examples directory
> .
>
> Inlein is located over at https://github.com/hyPiRion/inlein and the 0.1.0
> version can be downloaded from
> https://github.com/hyPiRion/inlein/releases/0.1.0/
>
> To get started, you can take a look over at the Getting Started page
>  on the
> wiki.
>
> -- Jean Niklas
>
> --
> 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 unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cljs build goog/base.js is not getting generated properly..

2016-03-06 Thread Sunil S Nandihalli
Thanks Thomas,
I fixed the issue. It was not even recompiling. Like you said, lein clean
was not removing all the files. When I manually deleted the files, I
realized that the cljs files were not even getting compiled. I had
specifying the hook to leiningen.cljsbuild .Thanks again for helping me
through the debugging process.

Regards,
Sunil.

On Sun, Mar 6, 2016 at 8:22 PM, Thomas Heller <th.hel...@gmail.com> wrote:

> Did you lein clean?
>
> Although I'm not sure cljsbuild actually cleans anything.
> Delete resources/public/js/out manually if clean doesn't help.
>
> If that also doesn't help try this
>
> lein repl
> (clojure.java.io/resource "goog/base.js")
>
> That should give you the URL of a base.js inside the closure-library jar.
> If it is the third-party jar something weird is happening on your classpath.
>
>
>
> On Sunday, March 6, 2016 at 3:41:14 PM UTC+1, Sunil Nandihalli wrote:
>>
>> I added all the recommended exclusions and I still see the above issue I
>> mentioned.
>>
>>
>> On Sun, Mar 6, 2016 at 7:03 PM, Sunil S Nandihalli <sunil.na...@gmail.com
>> > wrote:
>>
>>> Thanks Thomas for the response
>>>
>>> when I did
>>>
>>> lein deps :tree | egrep google
>>>
>>> I got
>>>
>>>[com.google.javascript/closure-compiler "v20151216"]
>>>[org.clojure/google-closure-library "0.0-20151016-61277aea"]
>>>  [org.clojure/google-closure-library-third-party
>>> "0.0-20151016-61277aea"]
>>>
>>> the full output is here.
>>>
>>> https://gist.github.com/8801e6554f501acdc4c1
>>>
>>> looks like the google-closure library is recent enough..
>>>
>>> Regards,
>>> Sunil.
>>>
>>>
>>>
>>> On Sun, Mar 6, 2016 at 6:50 PM, Thomas Heller <th.h...@gmail.com> wrote:
>>>
>>>> That was an issue with old closure library releases but was fixed a
>>>> while ago.
>>>>
>>>> Try lein clean and make sure there are no conflicting versions being
>>>> used (via lein deps :tree).
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To post to this group, send email to clo...@googlegroups.com
>>>> Note that posts from new members are moderated - please be patient with
>>>> your first post.
>>>> To unsubscribe from this group, send email to
>>>> clojure+u...@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/clojure?hl=en
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to clojure+u...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>> --
> 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 unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cljs build goog/base.js is not getting generated properly..

2016-03-06 Thread Sunil S Nandihalli
I added all the recommended exclusions and I still see the above issue I
mentioned.


On Sun, Mar 6, 2016 at 7:03 PM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:

> Thanks Thomas for the response
>
> when I did
>
> lein deps :tree | egrep google
>
> I got
>
>[com.google.javascript/closure-compiler "v20151216"]
>[org.clojure/google-closure-library "0.0-20151016-61277aea"]
>  [org.clojure/google-closure-library-third-party
> "0.0-20151016-61277aea"]
>
> the full output is here.
>
> https://gist.github.com/8801e6554f501acdc4c1
>
> looks like the google-closure library is recent enough..
>
> Regards,
> Sunil.
>
>
>
> On Sun, Mar 6, 2016 at 6:50 PM, Thomas Heller <th.hel...@gmail.com> wrote:
>
>> That was an issue with old closure library releases but was fixed a while
>> ago.
>>
>> Try lein clean and make sure there are no conflicting versions being used
>> (via lein deps :tree).
>>
>> --
>> 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 unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cljs build goog/base.js is not getting generated properly..

2016-03-06 Thread Sunil S Nandihalli
Thanks Thomas for the response

when I did

lein deps :tree | egrep google

I got

   [com.google.javascript/closure-compiler "v20151216"]
   [org.clojure/google-closure-library "0.0-20151016-61277aea"]
 [org.clojure/google-closure-library-third-party
"0.0-20151016-61277aea"]

the full output is here.

https://gist.github.com/8801e6554f501acdc4c1

looks like the google-closure library is recent enough..

Regards,
Sunil.



On Sun, Mar 6, 2016 at 6:50 PM, Thomas Heller  wrote:

> That was an issue with old closure library releases but was fixed a while
> ago.
>
> Try lein clean and make sure there are no conflicting versions being used
> (via lein deps :tree).
>
> --
> 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 unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cljs build goog/base.js is not getting generated properly..

2016-03-06 Thread Sunil S Nandihalli
Please find my project.clj here
https://gist.github.com/f3bcb03fdbbee75b56df
Thanks,
Sunil

On Sun, Mar 6, 2016 at 6:18 PM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:

> Hi Everybody,
> when I compile my cljs project, I find that goog/base.js has the contents
>
> // This is a dummy file to trick genjsdeps into doing the right thing.
> // TODO(nicksantos): fix this
>
> because of this my compiled js file is having trouble finding the goog 
> namespace.
>
> What is causing this to happen? I don't see any code like I do when I compile 
> some of the sample cljs projects which are available online?
>
> Can somebody please help?
>
> Thanks,
>
> Sunil.
>
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


cljs build goog/base.js is not getting generated properly..

2016-03-06 Thread Sunil S Nandihalli
Hi Everybody,
when I compile my cljs project, I find that goog/base.js has the contents

// This is a dummy file to trick genjsdeps into doing the right thing.
// TODO(nicksantos): fix this

because of this my compiled js file is having trouble finding the goog
namespace.

What is causing this to happen? I don't see any code like I do when I
compile some of the sample cljs projects which are available online?

Can somebody please help?

Thanks,

Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: a project template containing clj, cljs cljc files

2016-03-06 Thread Sunil S Nandihalli
Thanks Colin, Torsten and Robert.
After looking around a little more I did realise that cljc files can just
be added without a place for the generated like in cljx. I did actually
endup checking out reagent template. I think I now have a reasonable idea
and I am making progress. Thanks everybody for the help.

Regards,
Sunil.

On Sun, Mar 6, 2016 at 3:03 PM, Colin Yates <colin.ya...@gmail.com> wrote:

> Not sure about now (as it has been a while since I used it but yes, I
> always find `lein ancient` a good first step :-).
>
> On 6 March 2016 at 09:32, Robert Levy <r.p.l...@gmail.com> wrote:
> > Reagent-template may have improved recently, but the last time I checked,
> > about 5-6 months ago, I found it to be seriously misleading and outdated
> in
> > a number of ways in its opinions on the state of the art for
> clojurescript
> > tooling.  The template I found to be the best was the figwheel template.
> >
> > On Sun, Mar 6, 2016 at 1:14 AM, Colin Yates <colin.ya...@gmail.com>
> wrote:
> >>
> >> Hi Sunil, I always use
> >> https://github.com/reagent-project/reagent-template. Not sure it
> >> creates cljc out of the box but all you need to do is create a new
> >> directory for your .cljc files and add that to the project
> >> source-path.
> >>
> >> On 6 March 2016 at 05:25, Sunil S Nandihalli <
> sunil.nandiha...@gmail.com>
> >> wrote:
> >> > Hi everybody,
> >> >  I am trying to port an old project which uses cljx plugin and reagent
> >> > to
> >> > use cljc and reader-conditionals. I was wondering if somebody can
> share
> >> > a
> >> > simple template which has clj, cljs and cljc files in it?
> >> >
> >> > Thanks and regards,
> >> > Sunil.
> >> >
> >> > --
> >> > 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 unsubscribe from this group, send email to
> >> > clojure+unsubscr...@googlegroups.com
> >> > For more options, visit this group at
> >> > http://groups.google.com/group/clojure?hl=en
> >> > ---
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "Clojure" group.
> >> > To unsubscribe from this group and stop receiving emails from it, send
> >> > an
> >> > email to clojure+unsubscr...@googlegroups.com.
> >> > For more options, visit https://groups.google.com/d/optout.
> >>
> >> --
> >> 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 unsubscribe from this group, send email to
> >> clojure+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/clojure?hl=en
> >> ---
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Clojure" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to clojure+unsubscr...@googlegroups.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > 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 unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "Clojure" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to clojure+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Cloju

a project template containing clj, cljs cljc files

2016-03-05 Thread Sunil S Nandihalli
Hi everybody,
 I am trying to port an old project which uses cljx plugin and reagent to
use cljc and reader-conditionals. I was wondering if somebody can share a
simple template which has clj, cljs and cljc files in it?

Thanks and regards,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: unable to understand the behaviour of core.matrix/emap ( Bug maybe? )

2016-02-22 Thread Sunil S Nandihalli
Thanks Mikera, Looking forward to the release.
Regards,
Sunil.

On Tue, Feb 23, 2016 at 12:31 PM, Mikera 
wrote:

> Yeah, confirmed this is a bug in vectorz-clj. Indexing error meant that
> the operator was getting applied to the first row twice, instead of once to
> each row.
>
> There is a fix and regression tests in the develop branch already, will be
> fixed in next release (hopefully today if I have time)
>
>
> On Friday, 19 February 2016 08:11:17 UTC+8, Sunil Nandihalli wrote:
>>
>> Hi Everybody
>>  There seems to be a problem with core.matrix/emap implementation for
>> vectorz implementation
>>
>> sunil@peacock:~/work/wnmf/clj/wnmf$ lein repl
>> Clojure 1.8.0
>> wnmf.core=> (def t (m/array [[10] [20]]))
>> #'wnmf.core/t
>> wnmf.core=> (m/pm t)
>> [[10.000]
>>  [20.000]]
>> nil
>> wnmf.core=> (m/pm (m/emap / t 10))
>> [[ 0.100]
>>  [20.000]]
>> nil
>> wnmf.core=>
>>
>> can somebody please clarify this?
>> Thanks,
>> Sunil.
>>
> --
> 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 unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


unable to understand the behaviour of core.matrix/emap ( Bug maybe? )

2016-02-18 Thread Sunil S Nandihalli
Hi Everybody
 There seems to be a problem with core.matrix/emap implementation for
vectorz implementation

sunil@peacock:~/work/wnmf/clj/wnmf$ lein repl
Clojure 1.8.0
wnmf.core=> (def t (m/array [[10] [20]]))
#'wnmf.core/t
wnmf.core=> (m/pm t)
[[10.000]
 [20.000]]
nil
wnmf.core=> (m/pm (m/emap / t 10))
[[ 0.100]
 [20.000]]
nil
wnmf.core=>

can somebody please clarify this?
Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: A doubt about core.matrix

2016-02-17 Thread Sunil S Nandihalli
Thanks Mikera, for the detailed response. I tested the element-wise product
on two sparse matrix.. it seems to run through the entire matrix ? Am I
missing something.

Regards,
Sunil

On Wed, Feb 17, 2016 at 7:47 AM, Mikera 
wrote:

> Hi Sunil,
>
> You are correct that the naive code will eagerly produce the full matrix
> UxV, which may be very large :-)
>
> I think your strategy of extracting rows and columns from U and V is the
> best one. Row and column extraction for dense matrices in vectorz-clj is
> very efficient since it just uses strided vectors, as is the dot product
> operation, so you probably won't see much of a performance overhead from
> doing it this way. I wouldn't worry about the verbosity - obviously you
> should encapsulate this logic in a function if you are doing it in many
> places.
>
> Top tip: also remember to use (non-zero-indices W) if you want to know
> which elements of the sparse matrix are non-zero without iterating over
> every element
>
>   Mike.
>
>
> On Tuesday, 16 February 2016 23:17:52 UTC+8, Sunil Nandihalli wrote:
>>
>> Hi Everybody,
>>  I am newbie to core.matrix .. I have the following expression
>>
>> W -> a large spare matrix of size MxN
>> U  -> a dense matrix of size MxK
>> V ->  a dense matrix of size KxN
>>
>> and K << (M,N)
>> (require [clojure.core.matrix :as m])
>>
>> I want to compute (m/mul W (m/* U V))
>>
>> m/mul computes element-wise product
>>
>> m/*  computes regular matrix multiplication
>>
>> I want to know if the above would compute full-matrix UV .. if it does
>> then I want to know if there is an elegant way to compute the
>> spare-resultant matrix without blowing up memory in the intermediate stage
>>
>> I am currently just extracting the corresponding rows and columns from U
>> and V for the elements which are non-zero in W .. but that seems
>> unnecessarily verbose...
>>
>> I am using the vectorz implementation of core.matrix
>>
>> Thanks in advance.
>>
>> Sunil.
>>
> --
> 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 unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


A doubt about core.matrix

2016-02-16 Thread Sunil S Nandihalli
Hi Everybody,
 I am newbie to core.matrix .. I have the following expression

W -> a large spare matrix of size MxN
U  -> a dense matrix of size MxK
V ->  a dense matrix of size KxN

and K << (M,N)
(require [clojure.core.matrix :as m])

I want to compute (m/mul W (m/* U V))

m/mul computes element-wise product

m/*  computes regular matrix multiplication

I want to know if the above would compute full-matrix UV .. if it does then
I want to know if there is an elegant way to compute the spare-resultant
matrix without blowing up memory in the intermediate stage

I am currently just extracting the corresponding rows and columns from U
and V for the elements which are non-zero in W .. but that seems
unnecessarily verbose...

I am using the vectorz implementation of core.matrix

Thanks in advance.

Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: stack overflow

2015-12-13 Thread Sunil S Nandihalli
Thanks Andy for the response. I was able to make it work by modifying the
code in the following way

(let [modulo 10007
  trunc #(mod % modulo)
  mult-m (comp trunc *)
  add-m (comp trunc +)
  h (fn [mf l]
  (if (<= l 1) 1
  (trunc (reduce add-m 0
 (map #(mult-m (mf mf (- l % 1)) (mf mf %))
  (range l))
  mf (memoize h)]
  (defn num-trees [n]
(doseq [i (range n)] (mf mf i))
(mf mf n)))

I was able to fix the problem by progressively building up the answer
bottom up.

Regards,
Sunil


On Sun, Dec 13, 2015 at 3:03 PM, Andy Fingerhut <andy.finger...@gmail.com>
wrote:

> You can increase the maximum stack size in your JVM with command line
> options when you start it.
>
> You can reduce the amount of stack memory required per recursive
> iteration.  I don't know if let-bound symbols like modulo, trunc, mult-m,
> and add-m require separate stack space per recursive call in your function
> or not, but if they do, in your function those could easily be made into
> separate functions defined outside of num-trees.
>
> The biggest way to avoid using stack space is to write the code in a way
> that doesn't make recursive calls, but this can often be fairly
> inconvenient for functions that are naturally written recursively.
> Increasing the maximum stack size would be a lot quicker.
>
> Andy
>
> On Sat, Dec 12, 2015 at 9:38 PM, Sunil S Nandihalli <
> sunil.nandiha...@gmail.com> wrote:
>
>> Hi Everybody,
>> I wrote the simple function for computing the number of
>> binary-search-trees that can be formed from a sequence of numbers from 1 to
>> N using memoization. I get a stack-overflow for values more than N of 196.
>> Can anybody help me in figuring out how to fix this?
>> Thanks,
>> Sunil.
>>
>> (defn num-trees [n]
>>   (let [modulo 10007
>> trunc #(mod % modulo)
>> mult-m (comp trunc *)
>> add-m (comp trunc +)
>> h (fn [mf l]
>> (if (<= l 1) 1
>> (trunc (reduce add-m 0
>>(map #(mult-m (mf mf (- l % 1)) (mf mf %))
>> (range l))
>> mf (memoize h)]
>> (mf mf n)))
>>
>> --
>> 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 unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: stack overflow

2015-12-13 Thread Sunil S Nandihalli
Thanks Mark. That is exactly what I ended up doing.

Regards,
Sunil.

On Sun, Dec 13, 2015 at 8:45 PM, Mark Engelberg <mark.engelb...@gmail.com>
wrote:

> Call your memoized function on values 1 .. n-1 first, before calling it on
> n.
> On Dec 12, 2015 9:45 PM, "Sunil S Nandihalli" <sunil.nandiha...@gmail.com>
> wrote:
>
>> a small correction. The function computes the modulo 10007 of the
>> answer and not the answer itself. I ran it in the repl.
>> Thanks,
>> Sunil.
>>
>> On Sun, Dec 13, 2015 at 11:08 AM, Sunil S Nandihalli <
>> sunil.nandiha...@gmail.com> wrote:
>>
>>> Hi Everybody,
>>> I wrote the simple function for computing the number of
>>> binary-search-trees that can be formed from a sequence of numbers from 1 to
>>> N using memoization. I get a stack-overflow for values more than N of 196.
>>> Can anybody help me in figuring out how to fix this?
>>> Thanks,
>>> Sunil.
>>>
>>> (defn num-trees [n]
>>>   (let [modulo 10007
>>> trunc #(mod % modulo)
>>> mult-m (comp trunc *)
>>> add-m (comp trunc +)
>>> h (fn [mf l]
>>> (if (<= l 1) 1
>>> (trunc (reduce add-m 0
>>>(map #(mult-m (mf mf (- l % 1)) (mf mf %))
>>> (range l))
>>> mf (memoize h)]
>>> (mf mf n)))
>>>
>>>
>> --
>> 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 unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


stack overflow

2015-12-12 Thread Sunil S Nandihalli
Hi Everybody,
I wrote the simple function for computing the number of binary-search-trees
that can be formed from a sequence of numbers from 1 to N using
memoization. I get a stack-overflow for values more than N of 196. Can
anybody help me in figuring out how to fix this?
Thanks,
Sunil.

(defn num-trees [n]
  (let [modulo 10007
trunc #(mod % modulo)
mult-m (comp trunc *)
add-m (comp trunc +)
h (fn [mf l]
(if (<= l 1) 1
(trunc (reduce add-m 0
   (map #(mult-m (mf mf (- l % 1)) (mf mf %))
(range l))
mf (memoize h)]
(mf mf n)))

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: stack overflow

2015-12-12 Thread Sunil S Nandihalli
a small correction. The function computes the modulo 10007 of the
answer and not the answer itself. I ran it in the repl.
Thanks,
Sunil.

On Sun, Dec 13, 2015 at 11:08 AM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:

> Hi Everybody,
> I wrote the simple function for computing the number of
> binary-search-trees that can be formed from a sequence of numbers from 1 to
> N using memoization. I get a stack-overflow for values more than N of 196.
> Can anybody help me in figuring out how to fix this?
> Thanks,
> Sunil.
>
> (defn num-trees [n]
>   (let [modulo 10007
> trunc #(mod % modulo)
> mult-m (comp trunc *)
> add-m (comp trunc +)
> h (fn [mf l]
> (if (<= l 1) 1
> (trunc (reduce add-m 0
>(map #(mult-m (mf mf (- l % 1)) (mf mf %))
> (range l))
> mf (memoize h)]
> (mf mf n)))
>
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to speedup lein uberjar?

2015-11-03 Thread Sunil S Nandihalli
I can embed an nrepl-server in a driver program and submit that jar and
then connect the nrepl-server to my emacs cider and work with it. I have
just never done it. May be it is time to understand how instead of just
doing

M-x cider-jack-in

Thanks Asim for pointing in the right direction.
Regards,
Sunil.


On Tue, Nov 3, 2015 at 12:05 PM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:

> Thanks Asim for this suggestion. I wanted to do it but did not have the
> bandwidth to explore how to do it.. I am new to spark..  I usually do
> repl-driven dev for local apps... Have you done repl-driven using spark and
> clojure? do you have pointers as to how to do it.. I can explore if you
> tell me that there really are no problems in doing that.
>
> Regards,
> Sunil.
>
> On Tue, Nov 3, 2015 at 12:48 AM, Asim Jalis <asimja...@gmail.com> wrote:
>
>> Hi Sunil,
>>
>> Here is something to think about. Can you use the REPL for your workflow
>> instead?
>>
>> If the changes are all in the Spark driver code you can run the driver
>> inside the REPL and then test out the changes in the REPL. Once you have
>> something that works you can save that and deploy an uberjar.
>>
>> Deploying an uberjar 4-5 times an hour feels like it goes against the
>> spirit of Clojure.
>>
>> Asim
>>
>> On Sun, Nov 1, 2015 at 10:10 PM, Sunil S Nandihalli <
>> sunil.nandiha...@gmail.com> wrote:
>>
>>> Hi Asim,
>>>  I needed to run lein uberjar to submit the jar to run a distributed job
>>> on a apache-spark cluster.  and my uberjar is currently taking anywhere
>>> from 2 to 4 minutes to finish. I have have had to run uberjar fairly
>>> frequently during my iterations ( 4 to 5 times in an hour) . I am new to
>>> spark. So I need to quickly iterate with changes in the code.
>>>
>>> Thanks for asking.
>>> Regards,
>>> Sunil.
>>>
>>> On Mon, Nov 2, 2015 at 6:09 AM, Asim Jalis <asimja...@gmail.com> wrote:
>>>
>>>> Hi Sunil,
>>>>
>>>> I am wondering why you want to speed up lein uberjar.
>>>>
>>>> How frequently do you need to run this?
>>>>
>>>> What is your use case and workflow around this?
>>>>
>>>> Thanks.
>>>>
>>>> Asim
>>>>
>>>> On Mon, Oct 26, 2015 at 2:04 AM, Sunil S Nandihalli <
>>>> sunil.nandiha...@gmail.com> wrote:
>>>>
>>>>> Hi Everybody,
>>>>>   My lein uberjar takes about 2 minutes to run. It also recompiles all
>>>>> the clj files everytime.  Is there a way to speedup lein-uberjar .. Or may
>>>>> be make it incremental?
>>>>> Thanks,
>>>>> Sunil.
>>>>>
>>>>> --
>>>>> 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 unsubscribe from this group, send email to
>>>>> clojure+unsubscr...@googlegroups.com
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/clojure?hl=en
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Clojure" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to clojure+unsubscr...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> --
>>>> 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 unsubscribe from this group, send email to
>>>> clojure+unsubscr...@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/clojure?hl=en
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to clojure

Re: how to speedup lein uberjar?

2015-11-03 Thread Sunil S Nandihalli
It was too simple to setup .. I just had not spent time .. and also with
respect to running the spark-app in yarn-client mode and connecting to it
was a good suggestion. Thank you! Sunil.

On Tue, Nov 3, 2015 at 7:46 PM, Asim Jalis <asimja...@gmail.com> wrote:

> Hi Sunil,
>
> Yes. This should work. I have used something much simpler in the past such
> as server-socket. This starts listening on a specific port and then you can
> telnet to that port from your client and start telnet with rlwrap to get
> history and editing.
>
> Asim
>
> On Tue, Nov 3, 2015 at 12:00 AM, Sunil S Nandihalli <
> sunil.nandiha...@gmail.com> wrote:
>
>> I can embed an nrepl-server in a driver program and submit that jar and
>> then connect the nrepl-server to my emacs cider and work with it. I have
>> just never done it. May be it is time to understand how instead of just
>> doing
>>
>> M-x cider-jack-in
>>
>> Thanks Asim for pointing in the right direction.
>> Regards,
>> Sunil.
>>
>>
>> On Tue, Nov 3, 2015 at 12:05 PM, Sunil S Nandihalli <
>> sunil.nandiha...@gmail.com> wrote:
>>
>>> Thanks Asim for this suggestion. I wanted to do it but did not have the
>>> bandwidth to explore how to do it.. I am new to spark..  I usually do
>>> repl-driven dev for local apps... Have you done repl-driven using spark and
>>> clojure? do you have pointers as to how to do it.. I can explore if you
>>> tell me that there really are no problems in doing that.
>>>
>>> Regards,
>>> Sunil.
>>>
>>> On Tue, Nov 3, 2015 at 12:48 AM, Asim Jalis <asimja...@gmail.com> wrote:
>>>
>>>> Hi Sunil,
>>>>
>>>> Here is something to think about. Can you use the REPL for your
>>>> workflow instead?
>>>>
>>>> If the changes are all in the Spark driver code you can run the driver
>>>> inside the REPL and then test out the changes in the REPL. Once you have
>>>> something that works you can save that and deploy an uberjar.
>>>>
>>>> Deploying an uberjar 4-5 times an hour feels like it goes against the
>>>> spirit of Clojure.
>>>>
>>>> Asim
>>>>
>>>> On Sun, Nov 1, 2015 at 10:10 PM, Sunil S Nandihalli <
>>>> sunil.nandiha...@gmail.com> wrote:
>>>>
>>>>> Hi Asim,
>>>>>  I needed to run lein uberjar to submit the jar to run a distributed
>>>>> job on a apache-spark cluster.  and my uberjar is currently taking 
>>>>> anywhere
>>>>> from 2 to 4 minutes to finish. I have have had to run uberjar fairly
>>>>> frequently during my iterations ( 4 to 5 times in an hour) . I am new to
>>>>> spark. So I need to quickly iterate with changes in the code.
>>>>>
>>>>> Thanks for asking.
>>>>> Regards,
>>>>> Sunil.
>>>>>
>>>>> On Mon, Nov 2, 2015 at 6:09 AM, Asim Jalis <asimja...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Sunil,
>>>>>>
>>>>>> I am wondering why you want to speed up lein uberjar.
>>>>>>
>>>>>> How frequently do you need to run this?
>>>>>>
>>>>>> What is your use case and workflow around this?
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> Asim
>>>>>>
>>>>>> On Mon, Oct 26, 2015 at 2:04 AM, Sunil S Nandihalli <
>>>>>> sunil.nandiha...@gmail.com> wrote:
>>>>>>
>>>>>>> Hi Everybody,
>>>>>>>   My lein uberjar takes about 2 minutes to run. It also recompiles
>>>>>>> all the clj files everytime.  Is there a way to speedup lein-uberjar .. 
>>>>>>> Or
>>>>>>> may be make it incremental?
>>>>>>> Thanks,
>>>>>>> Sunil.
>>>>>>>
>>>>>>> --
>>>>>>> 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 unsubscribe from this group, send email to
>>>>>>> clojure+unsubscr...@googleg

Re: how to speedup lein uberjar?

2015-11-02 Thread Sunil S Nandihalli
Thanks Asim for this suggestion. I wanted to do it but did not have the
bandwidth to explore how to do it.. I am new to spark..  I usually do
repl-driven dev for local apps... Have you done repl-driven using spark and
clojure? do you have pointers as to how to do it.. I can explore if you
tell me that there really are no problems in doing that.

Regards,
Sunil.

On Tue, Nov 3, 2015 at 12:48 AM, Asim Jalis <asimja...@gmail.com> wrote:

> Hi Sunil,
>
> Here is something to think about. Can you use the REPL for your workflow
> instead?
>
> If the changes are all in the Spark driver code you can run the driver
> inside the REPL and then test out the changes in the REPL. Once you have
> something that works you can save that and deploy an uberjar.
>
> Deploying an uberjar 4-5 times an hour feels like it goes against the
> spirit of Clojure.
>
> Asim
>
> On Sun, Nov 1, 2015 at 10:10 PM, Sunil S Nandihalli <
> sunil.nandiha...@gmail.com> wrote:
>
>> Hi Asim,
>>  I needed to run lein uberjar to submit the jar to run a distributed job
>> on a apache-spark cluster.  and my uberjar is currently taking anywhere
>> from 2 to 4 minutes to finish. I have have had to run uberjar fairly
>> frequently during my iterations ( 4 to 5 times in an hour) . I am new to
>> spark. So I need to quickly iterate with changes in the code.
>>
>> Thanks for asking.
>> Regards,
>> Sunil.
>>
>> On Mon, Nov 2, 2015 at 6:09 AM, Asim Jalis <asimja...@gmail.com> wrote:
>>
>>> Hi Sunil,
>>>
>>> I am wondering why you want to speed up lein uberjar.
>>>
>>> How frequently do you need to run this?
>>>
>>> What is your use case and workflow around this?
>>>
>>> Thanks.
>>>
>>> Asim
>>>
>>> On Mon, Oct 26, 2015 at 2:04 AM, Sunil S Nandihalli <
>>> sunil.nandiha...@gmail.com> wrote:
>>>
>>>> Hi Everybody,
>>>>   My lein uberjar takes about 2 minutes to run. It also recompiles all
>>>> the clj files everytime.  Is there a way to speedup lein-uberjar .. Or may
>>>> be make it incremental?
>>>> Thanks,
>>>> Sunil.
>>>>
>>>> --
>>>> 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 unsubscribe from this group, send email to
>>>> clojure+unsubscr...@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/clojure?hl=en
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to clojure+unsubscr...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>>> 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 unsubscribe from this group, send email to
>>> clojure+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> 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 unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from t

Re: how to speedup lein uberjar?

2015-11-01 Thread Sunil S Nandihalli
Hi Asim,
 I needed to run lein uberjar to submit the jar to run a distributed job on
a apache-spark cluster.  and my uberjar is currently taking anywhere from 2
to 4 minutes to finish. I have have had to run uberjar fairly frequently
during my iterations ( 4 to 5 times in an hour) . I am new to spark. So I
need to quickly iterate with changes in the code.

Thanks for asking.
Regards,
Sunil.

On Mon, Nov 2, 2015 at 6:09 AM, Asim Jalis <asimja...@gmail.com> wrote:

> Hi Sunil,
>
> I am wondering why you want to speed up lein uberjar.
>
> How frequently do you need to run this?
>
> What is your use case and workflow around this?
>
> Thanks.
>
> Asim
>
> On Mon, Oct 26, 2015 at 2:04 AM, Sunil S Nandihalli <
> sunil.nandiha...@gmail.com> wrote:
>
>> Hi Everybody,
>>   My lein uberjar takes about 2 minutes to run. It also recompiles all
>> the clj files everytime.  Is there a way to speedup lein-uberjar .. Or may
>> be make it incremental?
>> Thanks,
>> Sunil.
>>
>> --
>> 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 unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to speedup lein uberjar?

2015-10-26 Thread Sunil S Nandihalli
Hi Everybody,
  My lein uberjar takes about 2 minutes to run. It also recompiles all the
clj files everytime.  Is there a way to speedup lein-uberjar .. Or may be
make it incremental?
Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Probabilistic programming anyone?

2015-05-13 Thread Sunil S Nandihalli
Hi Frank,
 I am looking forward to giving it a shot. I am familiar with and used
Stan. While I understand that stan may not as flexible. A comparison with
of Anglician with Venture and Stan would be very much appreciated. Thanks
for probabilistic-language embedded in clojure.

Sunil.

On Wed, May 13, 2015 at 1:16 AM, hy...@juji-inc.com wrote:

 Another question: is there a particular reason why the code of Anglican is
 hosted on BitBucket with read only access for outsider, whereas the
 examples are on Github? Does that mean that you do not anticipate
 contributions to the language from the outside? I saw the license is GPL
 though.

 On Tuesday, May 12, 2015 at 3:05:50 AM UTC-7, Frank Wood wrote:

 I'm a professor at Oxford and my group has been working on a new embedded
 language called Anglican:

 http://www.robots.ox.ac.uk/~fwood/anglican/

 It can be used to do advanced machine learning in Clojure (Java, etc.)
 applications without having to know anything about inference or math.  For
 example see:

 http://www.robots.ox.ac.uk/~fwood/anglican/examples/index.html

 My group would be very interested to get feedback on the language design
 and its usefulness to the community.  Also, frankly, we could use your help
 in taking it forward, where help largely means writing queries and
 telling us what doesn't work.

  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cascalog and java 1.7

2015-02-27 Thread Sunil S Nandihalli
Thank you Sam for the response. I am up and running with cascalog on
java-1.7 cascalog 2.1.1
Regards,
Sunil.

On Fri, Feb 27, 2015 at 8:08 PM, Sam Ritchie sritchi...@gmail.com wrote:

 Hey Sunil,

 That's probably due for an update. Hadoop 1.x (and 0.21.x, etc) only ran
 on JDK6. As long as the Hadoop distro you've chosen runs on JDK6 or JDK8
 you're going to be fine.

 Cheers,
 Sam

   Sunil S Nandihalli sunil.nandiha...@gmail.com
  February 26, 2015 at 1:25 PM
 Hi Everybody,
  I have been meaning to try cascalog for a while now looking at its
 powerful query language. But today when I was trying to play with it I am
 getting some errors and when I go back cascalog readme page it says
 cascalog runs only with java 1.6 . Is it just that the readme is outdated
 or does it really mean that cascalog cannot run on java 1.7? I thought I
 need to confirm this before investigating cascalog any further.
 Thanks,
 Sunil.
 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


 --
 Sam Ritchie (@sritchie)
 Paddleguru Co-Founder
 703.863.8561
 www.paddleguru.com
 Twitter http://twitter.com/paddleguru // Facebook
 http://facebook.com/paddleguru

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


cascalog and java 1.7

2015-02-26 Thread Sunil S Nandihalli
Hi Everybody,
 I have been meaning to try cascalog for a while now looking at its
powerful query language. But today when I was trying to play with it I am
getting some errors and when I go back cascalog readme page it says
cascalog runs only with java 1.6 . Is it just that the readme is outdated
or does it really mean that cascalog cannot run on java 1.7? I thought I
need to confirm this before investigating cascalog any further.
Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Dependency conflict between parkour [0.6.2] and inflections [0.9.13]

2015-02-23 Thread Sunil S Nandihalli
Hi Everybody,
 I am having a dependency conflict when using parkour and inflections
library.

[inflection 0.9.13] also pulls [com.google.protobuf/protobuf-java 2.4.1]

I don't want it to pull [com.google.protobuf/protobuf-java 2.4.1]

 since the hadoop system (CDH-5.3.1) I am running already provides
[com.google.protobuf/protobuf-java 2.5.0]
I tried putting the above in :exclusions in the project.clj with no
success.

How can I make this work?

Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dependency conflict between parkour [0.6.2] and inflections [0.9.13]

2015-02-23 Thread Sunil S Nandihalli
I was wrong about :exclusions not working, the code was crashing due to
some other reason. :exclusions worked as expected. Thanks for making me
take another look at what was happening.

Regards,
Sunil.

On Mon, Feb 23, 2015 at 10:43 PM, Jeremy Heiler jeremyhei...@gmail.com
wrote:

 On Mon, Feb 23, 2015 at 11:22 AM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:

 I tried putting the above in :exclusions in the project.clj with no
 success.


 What do you mean by with no success? Can you show how you modified your
 project.clj?

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


A newbie question with using parkour

2015-02-22 Thread Sunil S Nandihalli
Hi Everybody,
 I am complete newbie to using parkour. I am having trouble just reading in
data. Can somebody help me figure out the problem.

The code I am using is here..

https://gist.github.com/52f4298e5b6ca6a46699

I agree that there is no other stage apart from the input. I had all other
stages but removed them to zero-in on the problem to create the smallest
possible code to reproduce the problem.
I am running the uber-jar with the following command

hadoop jar mr.jar

It is able to list the files which have been specified with a wild-card so
it seems like it is able to talk to the hdfs.
I am a complete noob to parkour .. so please excuse any stupid mistakes and
explain the same.

Thanks,
Sunil.

The error I get is here
#DSeq conf={mapreduce.job.inputformat.class
org.apache.hadoop.mapreduce.lib.input.TextInputFormat,
mapreduce.input.fileinputformat.inputdir hdfs://
hadoopcl2slave1.bidstalk.com:8020/user/hdfs/rawlogs/2015022006/2015022006-chi-event1-notify-acc.log,hdfs://hadoopcl2slave1.bidstalk.com:8020/user/hdfs/rawlogs/2015022006/2015022006-chi-event2-notify-acc.log,hdfs://hadoopcl2slave1.bidstalk.com:8020/user/hdfs/rawlogs/2015022006/2015022006-chi-event3-notify-acc.log,hdfs://hadoopcl2slave1.bidstalk.com:8020/user/hdfs/rawlogs/2015022006/2015022006-chi-event4-notify-acc.log,hdfs://hadoopcl2slave1.bidstalk.com:8020/user/hdfs/rawlogs/2015022006/2015022006-chi-event6-notify-acc.log,
parkour.source-as.default :vals}
15/02/22 12:22:26 ERROR parkour.tool: Uncaught exception:
java.lang.IllegalArgumentException: Don't know how to create ISeq from:
clojure.core.reducers$folder$reify__5580
java.lang.IllegalArgumentException: Don't know how to create ISeq from:
clojure.core.reducers$folder$reify__5580
at clojure.lang.RT.seqFrom(RT.java:506)
at clojure.lang.RT.seq(RT.java:487)
at clojure.core$seq__7216.invoke(core.clj:135)
at clojure.core.protocols$seq_reduce.invoke(protocols.clj:30)
at
clojure.core.protocols$eval10183$fn__10184.invoke(protocols.clj:42)
at
clojure.core.protocols$eval10104$fn__10105$G__10095__10118.invoke(protocols.clj:13)
at clojure.core$reduce.invoke(core.clj:6514)
at clojure.core$into.invoke(core.clj:6595)
at parkour.graph$execute.invoke(graph.clj:458)
at impressions.core$counter_tool.invoke(core.clj:14)
at impressions.core$tool.invoke(core.clj:21)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invoke(core.clj:628)
at parkour.tool.ParkourTool$fn__13080.invoke(tool.clj:33)
at parkour.tool$integral_STAR_.invoke(tool.clj:12)
at parkour.tool.ParkourTool.run(tool.clj:31)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at parkour.tool$run.invoke(tool.clj:50)
at parkour.tool$run.invoke(tool.clj:45)
at impressions.core$_main.doInvoke(core.clj:25)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at impressions.core.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: A newbie question with using parkour

2015-02-22 Thread Sunil S Nandihalli
Thanks Jeremy for the response. I was using clojure-1.7.0-alpha5 , parkour
6.2that looked was the original problem. After I changed the version to
clojure-1.6.0 I got past that problem and hit a new set of problems.
Marshall suggested that the issue could be because of mismatched
hadoop-versions. I am currently looking at those.
Thanks,
Sunil.

On Sun, Feb 22, 2015 at 11:50 PM, Jeremy Heiler jeremyhei...@gmail.com
wrote:

 What version of parkour are you using? That will help us match line
 numbers in the stracktrace with the code.

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- You received this message because you are subscribed to the Google
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


help with my inefficient instaparse grammar

2014-12-02 Thread Sunil S Nandihalli
Hi Everybody,
 https://gist.github.com/cced1cf377ed49005704  *instaparse_question.clj*
https://gist.github.com/anonymous/cced1cf377ed49005704#file-instaparse_question-clj
Raw
https://gist.github.com/anonymous/cced1cf377ed49005704/raw/220ff32218839db388261fd8e2489288a0093606/instaparse_question.clj
12345678910111213141516171819202122232425

(ns lua-map-parser.instaparse-question
  (:require [instaparse.core :as insta]))

(let [parser (insta/parser
 lua-file = {map-decl|return-statement}
  map-decl = 'local' identifier '='  '{' {
map-entry} '}' ;
  identifier =  #'[a-zA-Z\\_][0-9a-zA-Z\\-\\_]*' ;
  map-entry = '['  (string|number) ']' '='
(string|number) ;
  string =  '\\\' #'([^\]|.)*' '\\\' ;
  number = integer | decimal ;
  decimal = #'-?[0-9]+\\.[0-9]+' ;
  integer = #'-?[0-9]+' ;
  return-statement = 'return' identifier
   :auto-whitespace :comma)]
  (defn lua-map-parser [str]
(parser str)))

(lua-map-parser local CTRData = {
[1]=2 ,
 [\3\]=4 }
local MYData = { [\hello\] = \world\
[\sunil\] = 1 [\satish\] = \office\
[\dad\]=\home\ }
return CTRData
)

The above grammar simply parses a map in lua-syntax. It works for the above
case. However, when I try to use it on a file that is about 1 MB in size,
it fails(not sure didn't wait longer than 2 minutes).  I would love to hear
if there is something that is grossly inefficient in the way I have
represented my grammar. The lua interpreter loads the file in no time (well
0.06 sec) . I would love any feedback on improving the grammar. Thanks
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: help with my inefficient instaparse grammar

2014-12-02 Thread Sunil S Nandihalli
The file I tried it on is here
https://gist.github.com/8c0daef5b832b58c86fa

On Wed, Dec 3, 2014 at 10:28 AM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi Everybody,
  https://gist.github.com/cced1cf377ed49005704  *instaparse_question.clj*
 https://gist.github.com/anonymous/cced1cf377ed49005704#file-instaparse_question-clj
 Raw
 https://gist.github.com/anonymous/cced1cf377ed49005704/raw/220ff32218839db388261fd8e2489288a0093606/instaparse_question.clj
 12345678910111213141516171819202122232425

 (ns lua-map-parser.instaparse-question
   (:require [instaparse.core :as insta]))

 (let [parser (insta/parser
  lua-file = {map-decl|return-statement}
   map-decl = 'local' identifier '='  '{' { map-entry} 
 '}' ;
   identifier =  #'[a-zA-Z\\_][0-9a-zA-Z\\-\\_]*' ;
   map-entry = '['  (string|number) ']' '=' 
 (string|number) ;
   string =  '\\\' #'([^\]|.)*' '\\\' ;
   number = integer | decimal ;
   decimal = #'-?[0-9]+\\.[0-9]+' ;
   integer = #'-?[0-9]+' ;
   return-statement = 'return' identifier
:auto-whitespace :comma)]
   (defn lua-map-parser [str]
 (parser str)))

 (lua-map-parser local CTRData = {
 [1]=2 ,
  [\3\]=4 }
 local MYData = { [\hello\] = \world\
 [\sunil\] = 1 [\satish\] = \office\
 [\dad\]=\home\ }
 return CTRData
 )

 The above grammar simply parses a map in lua-syntax. It works for the
 above case. However, when I try to use it on a file that is about 1 MB in
 size, it fails(not sure didn't wait longer than 2 minutes).  I would love
 to hear if there is something that is grossly inefficient in the way I have
 represented my grammar. The lua interpreter loads the file in no time (well
 0.06 sec) . I would love any feedback on improving the grammar. Thanks
 Sunil.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Get the value of the persistentArrayMap from the exception which was thrown

2014-11-05 Thread Sunil S Nandihalli
Hi Everybody,

user= ({:a 1})

ArityException Wrong number of args (0) passed to: PersistentArrayMap
 clojure.lang.AFn.throwArity (AFn.java:429)
user= *e
#ArityException clojure.lang.ArityException: Wrong number of args (0)
passed to: PersistentArrayMap

From *e is it possible to infer that the object which threw it was {:a 1}?

Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


uniqueness of hash if computed on different jvms across different machines.

2014-10-13 Thread Sunil S Nandihalli
Hi,
Is the clojure hash function guaranteed to produce the same hash on
different jvms running on different jvms for the same data-structure
which would satisfy equality if checked on a single jvm. The data
structure is simply a hash-map.
Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


class file too large

2014-10-05 Thread Sunil S Nandihalli
Hi Everybody,
 I am getting class file too-large errors when I compile the clojure file.
Do you have pointers as to how one can identify the offending piece of
code?
Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: class file too large

2014-10-05 Thread Sunil S Nandihalli
Hi Michael,
 Thanks for the response. You are likely right about that. While none of
them actually look very large, The function is built-up using macros. I
will cross check if I can split it. I am using PigPen which makes heavy use
of macros and due to some of the semantics of how it is able to handle
closures, I am forced to use Macros to build my functions. I was clearly
able to identify the change I made which triggered the above error. The
change I made seems very benign(the change can't explain the byte-code
bloat).  I will try to split the functions as much as I can and see if it
makes the difference.

Thanks,
Sunil.


On Sun, Oct 5, 2014 at 5:18 PM, Michael Klishin michael.s.klis...@gmail.com
 wrote:



 On 5 October 2014 at 15:20:36, Sunil S Nandihalli (
 sunil.nandiha...@gmail.com) wrote:
  I am getting class file too-large errors when I compile the clojure
  file. Do you have pointers as to how one can identify the offending
  piece of code?

 You likely have a giant function somewhere. Split it into multiple small
 ones.
 --
 @michaelklishin, github.com/michaelklishin


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: `as-` does not work with `recur`.

2014-10-04 Thread Sunil S Nandihalli
This issue has been reported

May be you should upvote this..

http://dev.clojure.org/jira/browse/CLJ-1418



On Sun, Oct 5, 2014 at 4:56 AM, Leon Grapenthin grapenthinl...@gmail.com
wrote:

 Thought:

 (defmacro as-
 [expr name  forms]
 `(let [~name ~expr
~@(interleave (repeat name) (butlast forms))]
~(last forms)))




 On Sunday, October 5, 2014 1:02:50 AM UTC+2, Jan-Paul Bultmann wrote:

 Hey,
 I just noticed that while recur can be the last statement in most
 threading macros,
 it can’t be used within an `as-` macro.

   user= (macroexpand '(- x (recur)))
   (recur x)

   user= (macroexpand '(as- x % (recur %)))
   (let* [% x % (recur %)] %)

 This means that a recur within a `as-` will cause a CompilerException,
 because it is not at the tail position.

 Thoughts?

 Cheers,
 Jan-Paul

  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] rmap - define lazy, recursive maps

2014-10-04 Thread Sunil S Nandihalli
On Sun, Oct 5, 2014 at 1:17 AM, Mayank Jain firesof...@gmail.com wrote:

 This looks amazing!
 Could you write a blog post explaining in detail your thought process,
 what inspired you, and walking through what you have written?

+1 for usage patterns that motivated this...


 Thanks! This is beautiful! :D

 On Sat, Oct 4, 2014 at 8:57 PM, Arnout Roemers 
 goo...@company.romeinszoon.nl wrote:

 I would like to announce a very little utility library for defining
 recursive maps in Clojure, called rmap.

 For example:

 (def m
   (rmap X
 {:what awesome!
  :clj (str Clojure is  (:what X))})
 (:clj m)
 ;= Clojure is awesome!

 An object of type IFn + ILookup + Seqable is currently returned, which
 means it can be used with the core get function, as a function itself
 (taking one or two arguments), with keyword lookups, and all functions
 using seq, such as into. Please let me know (or send a pull request)
 when you need another protocol or interface implemented.

 On Clojars: [functionalbytes/rmap 0.1.2]
 On Github: https://github.com/aroemers/rmap

  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


behavior of as- macro

2014-09-29 Thread Sunil S Nandihalli
Hi everybody,
 I get the following when I try to use the as- macro


user= (def x (as- {:a 10 :b 20} {:keys [a b] :as w}  {:a (* 2 a) :b (* 2
b)}))
#'user/x
user= x
{:keys [20 40], :as {:a 20, :b 40}}
user=

I would have expected x to be {:a 20 :b 40}, not what I see above.

Can somebody explain?
Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: behavior of as- macro

2014-09-29 Thread Sunil S Nandihalli
I think the definition of as- should be changed to this. I feel this
behavior is more consistent with the rest of clojure.

(defmacro as- [expr name  forms] `(let [~name ~expr ~@(interleave (repeat
name) (take (dec (count forms)) forms))] ~(last forms))

Thanks,
Sunil

On Mon, Sep 29, 2014 at 2:11 PM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi everybody,
  I get the following when I try to use the as- macro


 user= (def x (as- {:a 10 :b 20} {:keys [a b] :as w}  {:a (* 2 a) :b (* 2
 b)}))
 #'user/x
 user= x
 {:keys [20 40], :as {:a 20, :b 40}}
 user=

 I would have expected x to be {:a 20 :b 40}, not what I see above.

 Can somebody explain?
 Thanks,
 Sunil.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: behavior of as- macro

2014-09-29 Thread Sunil S Nandihalli
upvoted your bug-report.

On Mon, Sep 29, 2014 at 4:56 PM, Nahuel Greco ngr...@gmail.com wrote:

 I reported this issue to the Clojure JIRA a while ago:
 http://dev.clojure.org/jira/browse/CLJ-1418 , please vote it up.
  El 29/09/2014 05:55, Sunil S Nandihalli sunil.nandiha...@gmail.com
 escribió:

 I think the definition of as- should be changed to this. I feel this
 behavior is more consistent with the rest of clojure.

 (defmacro as- [expr name  forms] `(let [~name ~expr ~@(interleave
 (repeat name) (take (dec (count forms)) forms))] ~(last forms))

 Thanks,
 Sunil

 On Mon, Sep 29, 2014 at 2:11 PM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:

 Hi everybody,
  I get the following when I try to use the as- macro


 user= (def x (as- {:a 10 :b 20} {:keys [a b] :as w}  {:a (* 2 a) :b (*
 2 b)}))
 #'user/x
 user= x
 {:keys [20 40], :as {:a 20, :b 40}}
 user=

 I would have expected x to be {:a 20 :b 40}, not what I see above.

 Can somebody explain?
 Thanks,
 Sunil.


  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pigpen newbie question

2014-09-15 Thread Sunil S Nandihalli
Thanks Matt for the response. Like you said, I don't really need to be
using 1.7.0 I am doing quiet ok with 1.6.0
Thanks,
Sunil.

On Tue, Sep 16, 2014 at 9:28 AM, 'Matt Bossenbroek' via Clojure 
clojure@googlegroups.com wrote:

 Sunil,

 I tried upgrading PigPen to Instaparse 1.3.4, but that pulled in Clojure
 1.6.0  now I'm running into some build/jar/versioning issues. I don't
 think I'll be able to get the update out as soon as promised, but it sounds
 like not using 1.7.0 will work for you in the meantime.

 -Matt

 On Thursday, September 11, 2014 at 7:52 PM, Sunil S Nandihalli wrote:

 Thanks Mark and Matt, changing the version back to clojure version 1.6.0
 fixed it.
 Sunil

 On Fri, Sep 12, 2014 at 7:05 AM, 'Matt Bossenbroek' via Clojure 
 clojure@googlegroups.com wrote:

  Just saw this response - disregard the questions I asked you on the
 pigpen support DL.

 I'll pull in the new instaparse  get a new PigPen build out soonish
 (within a day or two).

 -Matt

 On Thursday, September 11, 2014 at 6:28 PM, Mark Engelberg wrote:

 You're probably using Clojure 1.7.0 alpha 2, which introduced a new
 function called cat into the core namespace, which overlaps with a
 function in instaparse.

 A couple nights ago, I updated instaparse to version 1.3.4, with an update
 to deal with this change in alpha 2, but pigpen has not yet been updated to
 use that version of instaparse.

 You can either go back to a non-alpha release of Clojure, or wait for the
 pigpen folks to update, or perhaps there is some leiningen-fu you can do in
 the project.clj file to override the instaparse dependency loaded by pigpen
 with instaparse 1.3.4.

 On Thu, Sep 11, 2014 at 5:16 PM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:

 Hi ,
  I am trying to compile a simple clj file which does nothing apart from
 requiring the pigpen name-space and it fails to compile with the following
 error. Can anybody help?

 Attempting to call unbound fn: #'instaparse.combinators-source/cat

 the full stack trace is here.
 https://gist.github.com/sunilnandihalli/b400e21552ca97038e56

 Thanks,
 Sunil.

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google
 Groups

pigpen newbie question

2014-09-11 Thread Sunil S Nandihalli
Hi ,
 I am trying to compile a simple clj file which does nothing apart from
requiring the pigpen name-space and it fails to compile with the following
error. Can anybody help?

Attempting to call unbound fn: #'instaparse.combinators-source/cat

the full stack trace is here.
https://gist.github.com/sunilnandihalli/b400e21552ca97038e56

Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pigpen newbie question

2014-09-11 Thread Sunil S Nandihalli
Thanks Mark for the response. That was very quick. Let me see if moving to
clojure 1.6.0 fixes the issues.
Sunil.

On Fri, Sep 12, 2014 at 6:58 AM, Mark Engelberg mark.engelb...@gmail.com
wrote:

 You're probably using Clojure 1.7.0 alpha 2, which introduced a new
 function called cat into the core namespace, which overlaps with a
 function in instaparse.

 A couple nights ago, I updated instaparse to version 1.3.4, with an update
 to deal with this change in alpha 2, but pigpen has not yet been updated to
 use that version of instaparse.

 You can either go back to a non-alpha release of Clojure, or wait for the
 pigpen folks to update, or perhaps there is some leiningen-fu you can do in
 the project.clj file to override the instaparse dependency loaded by pigpen
 with instaparse 1.3.4.

 On Thu, Sep 11, 2014 at 5:16 PM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:

 Hi ,
  I am trying to compile a simple clj file which does nothing apart from
 requiring the pigpen name-space and it fails to compile with the following
 error. Can anybody help?

 Attempting to call unbound fn: #'instaparse.combinators-source/cat

 the full stack trace is here.
 https://gist.github.com/sunilnandihalli/b400e21552ca97038e56

 Thanks,
 Sunil.

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pigpen newbie question

2014-09-11 Thread Sunil S Nandihalli
Thanks Mark and Matt, changing the version back to clojure version 1.6.0
fixed it.
Sunil

On Fri, Sep 12, 2014 at 7:05 AM, 'Matt Bossenbroek' via Clojure 
clojure@googlegroups.com wrote:

  Just saw this response - disregard the questions I asked you on the
 pigpen support DL.

 I'll pull in the new instaparse  get a new PigPen build out soonish
 (within a day or two).

 -Matt

 On Thursday, September 11, 2014 at 6:28 PM, Mark Engelberg wrote:

 You're probably using Clojure 1.7.0 alpha 2, which introduced a new
 function called cat into the core namespace, which overlaps with a
 function in instaparse.

 A couple nights ago, I updated instaparse to version 1.3.4, with an update
 to deal with this change in alpha 2, but pigpen has not yet been updated to
 use that version of instaparse.

 You can either go back to a non-alpha release of Clojure, or wait for the
 pigpen folks to update, or perhaps there is some leiningen-fu you can do in
 the project.clj file to override the instaparse dependency loaded by pigpen
 with instaparse 1.3.4.

 On Thu, Sep 11, 2014 at 5:16 PM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:

 Hi ,
  I am trying to compile a simple clj file which does nothing apart from
 requiring the pigpen name-space and it fails to compile with the following
 error. Can anybody help?

 Attempting to call unbound fn: #'instaparse.combinators-source/cat

 the full stack trace is here.
 https://gist.github.com/sunilnandihalli/b400e21552ca97038e56

 Thanks,
 Sunil.

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[no subject]

2014-06-23 Thread Sunil S Nandihalli
Hi Everybody,
 I have the following lein setup.

sunil@ubuntu-14:~/rabbit/rabbit-clj$ lein version
Leiningen 2.4.2 on Java 1.7.0_55 OpenJDK Server VM

I get the following exception when i run lein repl can somebody tell me
as to what could be wrong?


Exception in thread main java.lang.IllegalArgumentException: Value out of
range for char: -1, compiling:(lein.clj:22:17)

I have attached the file containing the stacktrace also.

Any help is greatly appreciated.

I am running this inside a project which was created afresh with

lein new app project_name

Thanks,
sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


log
Description: Binary data


Re:

2014-06-23 Thread Sunil S Nandihalli
answering my own question. a closer look at the stack-trace revealed that
it was a problem with vinyasa plugin which was part of the profiles.clj.
Removing it fixed it. I haven't tried to get vinyasa working.
thanks,
Sunil.


On Mon, Jun 23, 2014 at 1:35 PM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi Everybody,
  I have the following lein setup.

 sunil@ubuntu-14:~/rabbit/rabbit-clj$ lein version
 Leiningen 2.4.2 on Java 1.7.0_55 OpenJDK Server VM

 I get the following exception when i run lein repl can somebody tell me
 as to what could be wrong?


 Exception in thread main java.lang.IllegalArgumentException: Value out
 of range for char: -1, compiling:(lein.clj:22:17)

 I have attached the file containing the stacktrace also.

 Any help is greatly appreciated.

 I am running this inside a project which was created afresh with

 lein new app project_name

 Thanks,
 sunil.



-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to convert current time to format i need?

2014-04-29 Thread Sunil S Nandihalli
Hi ,
 I didn't verify if that particular formatter comes prepackaged ( I am
assuming you are using clj-time since it is not mentioned..) Once you have
created your custom formater all you have to do is unparse

(clj-time.formatter/unparse date-time-object custom formatter ) .
This is there in the readme.. may be you missed it.
Sunil.


On Tue, Apr 29, 2014 at 3:33 PM, sindhu hosamane sindh...@gmail.com wrote:

   How to convert  the current date and time to the format i need ? for
 example i retrieve current time using (l/local-now) which outputs

 #DateTime 2014-04-29T11:16:02.420+02:00

 i want the above output to be converted to format dd:MM: HH:mm:ss

 Should i define my own formatter like below (def custom-formatter
 (f/formatter dd:MM: HH:mm:ss))

 But then how to convert it ? Any advice or help would be appreciated .!!


 --  Sindhu



  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: call clojure from java

2014-02-18 Thread Sunil S Nandihalli
You can't call a clojurescript function from java. However you can call
clojure-code from Java and clojurescript code from javascript.


On Tue, Feb 18, 2014 at 5:09 PM, sorin cristea srncris...@gmail.com wrote:

 Hi

 do you know how I can call a clojure script from a java method ?


 Thanks,
 Sorin.

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: call clojure from java

2014-02-18 Thread Sunil S Nandihalli
sorry I misread the email!


On Tue, Feb 18, 2014 at 6:17 PM, Michael Klishin 
michael.s.klis...@gmail.com wrote:


 2014-02-18 16:00 GMT+04:00 Sunil S Nandihalli sunil.nandiha...@gmail.com
 :

 You can't call a clojurescript function from java. However you can call
 clojure-code from Java and clojurescript code from javascript.


 I think the idea is to call a Clojure script (with a space) from Java.

 Use clojure.lang.RT#var and clojure.lang.IFn#invoke to call
 clojure.core/load-file
 and similar clojure.core functions:


 http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Invoking_Clojure_from_Java
 --
 MK

 http://github.com/michaelklishin
 http://twitter.com/michaelklishin

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: rseq for subvec in clojurescript

2014-02-17 Thread Sunil S Nandihalli
thanks Michal for the fix.


On Mon, Feb 17, 2014 at 12:58 AM, Michał Marczyk
michal.marc...@gmail.comwrote:

 It is now, thanks for the report!

 Ticket with patch:

 http://dev.clojure.org/jira/browse/CLJS-765


 On 16 February 2014 17:48, Sunil S Nandihalli
 sunil.nandiha...@gmail.com wrote:
  Hi Everybody,
 
  I get the following error when I do a rseq on a subvec in clojurescript
  Uncaught Error: No protocol method IReversible.-rseq defined for type
  cljs.core/Subvec: [(:red :clockwise) (:blue :clockwise) (:yellow
 :clockwise)
  (:yellow :clockwise) (:orange :clockwise)]
 
  Is this a known problem?
  Thanks, Sunil
 
  --
  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 unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
  ---
  You received this message because you are subscribed to the Google Groups
  Clojure group.
  To unsubscribe from this group and stop receiving emails from it, send an
  email to clojure+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


rseq for subvec in clojurescript

2014-02-16 Thread Sunil S Nandihalli
Hi Everybody,

I get the following error when I do a rseq on a subvec in clojurescript
Uncaught Error: No protocol method IReversible.-rseq defined for type
cljs.core/Subvec: [(:red :clockwise) (:blue :clockwise) (:yellow
:clockwise) (:yellow :clockwise) (:orange :clockwise)]

Is this a known problem?
Thanks, Sunil

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


webgl and reagent(cljs wrapper for reactjs)

2014-02-01 Thread Sunil S Nandihalli
Hi Everybody,
 I am new to web-programming but have done some stuff with clojurescript.
Now I was looking add an webgl based canvas to render a cube. I am using
reagent https://github.com/holmsand/reagent which is a cljs-wrapper
around reactjs. I am unable to decide, due to my inexperience in both webgl
and web-programming, if I should continue using reagent to add this new
webgl-enabled-canvas or are they fundamentally different in how they handle
things. Any input is very much appreciated.
Thanks
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


How to place unicode characters in span tag in reagent (formerly known as cloact)

2014-01-27 Thread Sunil S Nandihalli
Hi Everybody,
 Can somebody help me figure out as to how I can place a unicode character.
What I have
tried is [:span #8634;] with the correct header but it renders it as-is.

Thanks,
Sunil.

-- 
-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


a simple macro to tame the run-away loop-recurs

2013-12-28 Thread Sunil S Nandihalli
Hi Everybody,
 I just wrote a simple macro to tame the run-away loop-recur infinite
loops. Some of you may find use for it. It only handles loop-recur pairs
not fn-recur combination. It is trivial but useful .. so thought of sharing.

(defmacro limit [max-recurs loop-expr]
  (let [[_ bindings  body] loop-expr
counter (gensym)
transformer (fn transformer [form]
  (if-not (seq? form) form
  (let [[op  operands :as form] form]
(cond
 (= op 'loop) `(limit ~max-recurs ~form)
 (= op 'recur) `(recur ~@(conj (vec
operands) `(inc ~counter)))
 :default (clojure.walk/walk transformer
identity form)]
`(loop ~(into bindings [counter 0])
   (if ( ~counter ~max-recurs) (throw (Exception. loop limit
exceeded))
   (do ~@(clojure.walk/walk transformer identity body))

usage :

(limit 1000 (loop [a 10]
(if (= (mod (rand-int 100) 5) 0) (recur (inc a))
(if (= (mod (rand-int 100) 5) 0) (recur (dec a))
(if (= (mod (rand-int 100) 5) 0) (recur (inc a))
(loop [x a y (* a a)]
  (if ( x 100) (+ x y)
  (recur (dec x) (inc y)

the above sexp will macro-expand to a form where none of the loop-recur
combination can recurse for more than 1000 iterations.

Merry Christmas and Happy New Year!!
Sunil.

-- 
-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


methods of a protocol

2012-12-26 Thread Sunil S Nandihalli
Hi Everybody,
 It looks like the following way of definition is not allowed.. what is a
good alternative way of doing this

(defprotocol symbolicExpr


  (evalx [this args]))

(let [y #(+ 1 2)]


  (deftype x [a]


symbolicExpr


(evalx [this args]


  (y

I know I can do a (def y #(+ 1 2)) but that would unnecessarily make the
variable global to the namespace. and I don't want to put it inside the
method either, since it would have to re-evaluate the same var multiple
times when I know it will remain constant across *evalx* method calls. what
is a good way of achieving my goal without making *y *global to the
namespace?
Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

class name clashes on importing classes of same name from different Java packages into the same clojure namespace...

2012-10-18 Thread Sunil S Nandihalli
Hi Everybody,
class name  clashes on importing same named classes from different
java-packages into same clojure namespace. Is this expected. I think that
it should be possible to import them and can be used by completely
qualifying the class name with the appropriate java-package name.
Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: class name clashes on importing classes of same name from different Java packages into the same clojure namespace...

2012-10-18 Thread Sunil S Nandihalli
Am I doing it wrong ? is there a way to get around this?.. I guess I
pressed the send button before I completed the email..

Thanks,
Sunil.
On Thu, Oct 18, 2012 at 8:57 PM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi Everybody,
 class name  clashes on importing same named classes from different
 java-packages into same clojure namespace. Is this expected. I think that
 it should be possible to import them and can be used by completely
 qualifying the class name with the appropriate java-package name.
 Thanks,
 Sunil.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: class name clashes on importing classes of same name from different Java packages into the same clojure namespace...

2012-10-18 Thread Sunil S Nandihalli
thanks tassillo, that fixed it .. I didn't know that we can use the classes
with out importing them.
Sunil.

On Thu, Oct 18, 2012 at 9:07 PM, Tassilo Horn t...@gnu.org wrote:

 Sunil S Nandihalli sunil.nandiha...@gmail.com writes:

 Hi!

  class name clashes on importing same named classes from different
  java-packages into same clojure namespace. Is this expected.

 Yes, that's expected.  Import the one you are using more frequently and
 access the other one qualified.

  it should be possible to import them and can be used by completely
  qualifying the class name with the appropriate java-package name.

 Then why do you want to import them in the first place if you have to
 qualify them?

 Bye,
 Tassilo

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: class name clashes on importing classes of same name from different Java packages into the same clojure namespace...

2012-10-18 Thread Sunil S Nandihalli
Thanks Jim,
 That fixed the issue. I did not know that I can access the classes without
importing them..
Sunil.

On Thu, Oct 18, 2012 at 9:14 PM, Jim foo.bar jimpil1...@gmail.com wrote:

 On 18/10/12 16:27, Sunil S Nandihalli wrote:

 Hi Everybody,
 class name  clashes on importing same named classes from different
 java-packages into same clojure namespace. Is this expected. I think that
 it should be possible to import them and can be used by completely
 qualifying the class name with the appropriate java-package name.
 Thanks,
 Sunil.
 --
 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 unsubscribe from this group, send email to
 clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en


 simply don't import them...just use the fully-qualified name

 Jim


 --
 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 unsubscribe from this group, send email to
 clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

problem compiling a file from with in slime while it works fine when I do a lein jar

2012-06-09 Thread Sunil S Nandihalli
Hi Everybody,
 I am trying to write a code using the thrift in clojure. The files
generated by thrift are present and I am able to run lein jar and it
successfully creates a jar. but when I am inside emacs and I try to do C-c
C-k it fails to load(import) the class file corresponding to one of the
classes generated by thrift. Can somebody help me as to how I can fix this.
I am able to do run the code as-well using lein run . So, the only
problem is I am unable to work with it interactively in slime. Can somebody
help me fix this problem?
Thanks
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: problem compiling a file from with in slime while it works fine when I do a lein jar

2012-06-09 Thread Sunil S Nandihalli
while I couldn't get it to work from with-in slime .. I was able to get
around the problem by doing a
lein repl
where I could run the (s-expressions) for debugging purposes..
I just thought of updating the mailing list should somebody else come
across the same problem..
Sunil.

On Sat, Jun 9, 2012 at 3:43 PM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi Everybody,
  I am trying to write a code using the thrift in clojure. The files
 generated by thrift are present and I am able to run lein jar and it
 successfully creates a jar. but when I am inside emacs and I try to do C-c
 C-k it fails to load(import) the class file corresponding to one of the
 classes generated by thrift. Can somebody help me as to how I can fix this.
 I am able to do run the code as-well using lein run . So, the only
 problem is I am unable to work with it interactively in slime. Can somebody
 help me fix this problem?
 Thanks
 Sunil.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: clojure-hadoop

2012-05-09 Thread Sunil S Nandihalli
Hi,
A little digging led me to clojure-hadoop.filesystem which had most of the
context info I was interested in.
Sunil.

On Wed, May 9, 2012 at 2:02 PM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi Everybody,
  I have been using clojure-hadoop with out knowing all the nitty-gritties
 of hadoop .. which is a good and a bad thing. It abstracts everything
 except maps and reduces which directly deal with clojure-datastructures
 without worrying about serilization or deserialization.. So, very nice. I
 want to get access to the task-id .. would somebody have a clue as to how I
 can do this from within map or reduce functions? I need it so that I can
 use it to debug failed-tasks. Right now I just append the current time to
 stringified form of the key to obtain a unique file-name during my reduce
 job.. but would be useful to find out how to get the actual job-id from
 inside the map-task.
 Thanks,
 Sunil.

 P.S. Just to put things in context .. following is an extract from
 http://wiki.apache.org/hadoop/FAQ

 2.4. Can I write create/write-to hdfs files directly from map/reduce tasks?

 Yes. (Clearly, you want this since you need to create/write-to files other
 than the output-file written out by 
 OutputCollectorhttp://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/OutputCollector.html
 .)

 Caveats:

 ${mapred.output.dir} is the eventual output directory for the job (
 JobConf.setOutputPathhttp://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/JobConf.html#setOutputPath(org.apache.hadoop.fs.Path)
  / 
 JobConf.getOutputPathhttp://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/JobConf.html#getOutputPath()
 ).

 ${taskid} is the actual id of the individual task-attempt (e.g.
 task_200709221812_0001_m_00_0), a TIP is a bunch of ${taskid}s (e.g.
 task_200709221812_0001_m_00).

 With *speculative-execution* *on*, one could face issues with 2 instances
 of the same TIP (running simultaneously) trying to open/write-to the same
 file (path) on hdfs. Hence the app-writer will have to pick unique names
 (e.g. using the complete taskid i.e. task_200709221812_0001_m_00_0) per
 task-attempt, not just per TIP. (Clearly, this needs to be done even if the
 user doesn't create/write-to files directly via reduce tasks.)

 To get around this the framework helps the application-writer out by
 maintaining a special *${mapred.output.dir}/_${taskid}* sub-dir for each
 reduce task-attempt on hdfs where the output of the reduce task-attempt
 goes. On successful completion of the task-attempt the files in the
 ${mapred.output.dir}/_${taskid} (of the successful taskid only) are moved
 to ${mapred.output.dir}. Of course, the framework discards the
 sub-directory of unsuccessful task-attempts. This is completely transparent
 to the application.

 The application-writer can take advantage of this by creating any
 side-files required in ${mapred.output.dir} during execution of his
 reduce-task, and the framework will move them out similarly - thus you
 don't have to pick unique paths per task-attempt.

 Fine-print: the value of ${mapred.output.dir} during execution of a
 particular *reduce* task-attempt is actually
 ${mapred.output.dir}/_{$taskid}, not the value set by
 JobConf.setOutputPathhttp://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/JobConf.html#setOutputPath(org.apache.hadoop.fs.Path)
 . *So, just create any hdfs files you want in ${mapred.output.dir} from
 your reduce task to take advantage of this feature.*

 For *map* task attempts, the automatic substitution of
 ${mapred.output.dir}/_${taskid} for* *${mapred.output.dir} does not take
 place. You can still access the map task attempt directory, though, by using
 FileOutputFormat http://wiki.apache.org/hadoop/FileOutputFormat
 .getWorkOutputPath(TaskInputOutputContexthttp://wiki.apache.org/hadoop/TaskInputOutputContext).
 Files created there will be dealt with as described above.

 The entire discussion holds true for maps of jobs with reducer=NONE (i.e.
 0 reduces) since output of the map, in that case, goes directly to hdfs.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

inconsistent behavior with destructuring ...

2012-04-19 Thread Sunil S Nandihalli
Hi Everybody,
 I was just wondering if the following behaviour is the right behaviour..
can somebody comment?

user (let [{{a :a b :b :as w} :c a1 :a b1 :b :as w} {:a 10 :b 20 :c {:a
30 :b 40}}] {:a a :b b  :b1 b1 :a1 a1})
{:a 30, :b 40, :b1 40, :a1 30}

user (let [{{a :a b :b :as w} :c a1 :a b1 :b :as w1} {:a 10 :b 20 :c {:a
30 :b 40}}] {:a a :b b  :b1 b1 :a1 a1})
{:a 30, :b 40, :b1 20, :a1 10}


I agree that I have two- 'w' s in the first one while I have 'w' and 'w1'
in the second . And the second behaviour is the expected behaviour..
clojure-version 1.2.1

Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: inconsistent behavior with destructuring ...

2012-04-19 Thread Sunil S Nandihalli
the behaviour seems to be the same in 1.4.0

Sunil.

On Thu, Apr 19, 2012 at 11:31 AM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi Everybody,
  I was just wondering if the following behaviour is the right behaviour..
 can somebody comment?

 user (let [{{a :a b :b :as w} :c a1 :a b1 :b :as w} {:a 10 :b 20 :c {:a
 30 :b 40}}] {:a a :b b  :b1 b1 :a1 a1})
 {:a 30, :b 40, :b1 40, :a1 30}

 user (let [{{a :a b :b :as w} :c a1 :a b1 :b :as w1} {:a 10 :b 20 :c {:a
 30 :b 40}}] {:a a :b b  :b1 b1 :a1 a1})
 {:a 30, :b 40, :b1 20, :a1 10}


 I agree that I have two- 'w' s in the first one while I have 'w' and 'w1'
 in the second . And the second behaviour is the expected behaviour..
 clojure-version 1.2.1

 Thanks,
 Sunil.



-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: inconsistent behavior with destructuring ...

2012-04-19 Thread Sunil S Nandihalli
You think I should file a bug-report?
Sunil.

On Thu, Apr 19, 2012 at 11:53 AM, Meikel Brandmeyer (kotarak)
m...@kotka.dewrote:

 Hi,

 I think this is a bug. This is the expansion without any :as clause:

 (let*
   [map__4496
{:a 10, :b 20, :c {:a 30, :b 40}}
map__4496
(if (clojure.core/seq? map__4496)
  (clojure.core/apply clojure.core/hash-map map__4496)
  map__4496)
map__4497
(clojure.core/get map__4496 :c)
map__4497
(if (clojure.core/seq? map__4497)
  (clojure.core/apply clojure.core/hash-map map__4497)
  map__4497)
a
(clojure.core/get map__4497 :a)
b
(clojure.core/get map__4497 :b)
a1
(clojure.core/get map__4496 :a)
b1
(clojure.core/get map__4496 :b)]
   {:a a, :b b, :b1 b1, :a1 a1})

 Now with the :as clauses:

 (let*
   [w
{:a 10, :b 20, :c {:a 30, :b 40}}
w
(if (clojure.core/seq? w)
  (clojure.core/apply clojure.core/hash-map w)
  w)
w
(clojure.core/get w :c)
w
(if (clojure.core/seq? w)
  (clojure.core/apply clojure.core/hash-map w)
  w)
a
(clojure.core/get w :a)
b
(clojure.core/get w :b)
a1
(clojure.core/get w :a)
b1
(clojure.core/get w :b)]
   {:a a, :b b, :b1 b1, :a1 a1})

 As you can see :as simply replace the generated symbol with the given one.
 This is a mistake however. I think the correct expansion should look
 something like this:

 (let*
   [map__4502
{:a 10, :b 20, :c {:a 30, :b 40}}
map__4502
(if (clojure.core/seq? map__4502)
  (clojure.core/apply clojure.core/hash-map map__4502)
  map__4502)
w map__4502
map__4503
(clojure.core/get map__4502 :c)
map__4503
(if (clojure.core/seq? map__4503)
  (clojure.core/apply clojure.core/hash-map map__4503)
  map__4503)
w map__4503
a
(clojure.core/get map__4503 :a)
b
(clojure.core/get map__4503 :b)
a1
(clojure.core/get map__4502 :a)
b1
(clojure.core/get map__4502 :b)]
   {:a a, :b b, :b1 b1, :a1 a1})

 Kind regards
 Meikel

  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] jark 0.4.0

2012-03-14 Thread Sunil S Nandihalli
Thank you Icy,
 Jark has been a great tool! .. and have had the privelege of being on the
bleeding edge of jark.
Sunil.

On Tue, Mar 13, 2012 at 10:11 AM, isaac praveen icylis...@gmail.com wrote:

 I am pleased to announce the release of jark v0.4.0.
 So why another Clojure tool ?

 Problem

 Startup time of the JVM is slow and therefore the command-line
 applications running on it are slow as well. There are tools like
 Nailgun that partly solve the problem. However, there isn't a tool
 that is Clojure-aware, lightweight, secure and extensible.

 Solution

 * Implement a client/server system that uses a protocol such as nREPL
  to communicate Clojure data structures over the wire

 * Build a client that is extremely lightweight and  has minimum
  runtime dependencies

 * Provide a server-side framework to interact with the JVM Runtime

 Jark is one such tool that helps run clojure programs on the JVM,
 interactively and remotely using the nREPL protocol.
 It has 2 components - a client written in OCaml and a server written
 in Clojure/Java. The client is compiled to native code and is
 extremely tiny (~200KB).

 Here are some features: http://icylisper.in/jark/features.html
 See http://icylisper.in/jark/started.html to get started.

 Catch us on #jark on irc.freenode.net

 Mailing list: https://groups.google.com/group/clojure-jark

 Project page: http://icylisper.in/jark

 Caveats
 ---

 1. The current jark version still uses nREPL 0.0.5.
   However, We are currently working on jark 0.5.0 that uses newer
implementation of the protocol.That should be out soon.

 2. lein plugin / lein2 integration has been moved to 0.5.0
   release. Once that plugin is ready, it should help run lein
   interactively.

 3. The Windows client binary has not been completely tested yet.
   Hopefully we will have a test-suite in place for the client.

 4. REPL does not work on windows yet.

 THANKS to:
 * Martin DeMello, co-author of jark
 * Lucas Stadler
 * Abhijith Gopal
 * Chas Emerick (for nREPL)

 Happy Hacking. Go ahead and give it a try!

 --
 isaac

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: using contains? on transient collections

2012-03-04 Thread Sunil S Nandihalli
Thanks everybody. From your replies it seems like its in my best interest
to just work around it .. :)

Thanks again
Sunil.

On Thu, Mar 1, 2012 at 12:38 PM, Andy Fingerhut andy.finger...@gmail.comwrote:

 Some related JIRA tickets,

 http://dev.clojure.org/jira/browse/CLJ-700
 http://dev.clojure.org/jira/browse/CLJ-757
 http://dev.clojure.org/jira/browse/CLJ-932

 All have patches, although I don't personally know whether they are
 correct fixes.

 Andy

 On Feb 29, 2012, at 10:08 PM, Mark Engelberg wrote:

  It is the expected behavior for everyone who has ever gotten burned by
 this bug :)
 
  Seriously though, this has come up several times over the last couple of
 years.  I remain baffled that this has never been fixed (at least not as of
 1.3).  There are two ways this could potentially be fixed.  On the one
 hand, transients could be made to implement more of the interfaces they are
 expected to implement.  On the other hand, contains? could be modified to
 return a meaningful error rather than false when passed something that
 doesn't support that interface.  Or better yet, both of these fixes would
 be a good thing.

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

using contains? on transient collections

2012-02-29 Thread Sunil S Nandihalli
Hey everybody,
 I did the following

(contains? (transient {:a 10}) :a)

and it returns

false


while doing (:a (transient {:a 10})) returns 10

Is this expected behaviour. Using clojure-version 1.2.1 (I know it is old
.. )

Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

partition-by where the subsequences are also lazy ..

2012-02-27 Thread Sunil S Nandihalli
Hi everybody,
while the partition-by by itself is lazy the subseqs it creates are not
lazy. I was attempting to make that happen. I would like to get comments
from the community about my modification to partition-by so as to make it
create the subsequences in a lazy way ... will this work?


My version :
(defn lazy-partition-by
  Applies f to each value in coll, splitting it each time f returns



   a new value.  Returns a lazy seq of partitions.
  {:added 1.2}
  [f coll]
  (lazy-seq
   (when-let [s (seq coll)]
 (let [fst (first s)
   fv (f fst)
   run (lazy-seq (cons fst (take-while #(= fv (f %)) (next s]
  (cons run (lazy-partition-by f (drop-while #(= fv (f %))
s)))

original version :
(defn partition-by



  Applies f to each value in coll, splitting it each time f returns



   a new value.  Returns a lazy seq of partitions.



  {:added 1.2}



  [f coll]



  (lazy-seq



   (when-let [s (seq coll)]



 (let [fst (first s)



   fv (f fst)



   run (cons fst (take-while #(= fv (f %)) (rest s)))]



   (cons run (partition-by f (drop (count run) s)))


thanks.
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: partition-by where the subsequences are also lazy ..

2012-02-27 Thread Sunil S Nandihalli
Hi Meikel,
 Thanks for your response. This is in relation to something I am working
on. And for my problem,

1. Computation of f is very very cheap
2. The subsequences can be very large by themselves to the extent that it
may not fit in memory.
3. I don't mind the effort of waiting a little extra to avoid writing
un-composable code.

do you think my implementation will meet these requirements.

Thanks,
Sunil.

P.SBasically I am just trying to join very large csv files which are
sorted on the key to be joined. There could be duplicates in the keys.


On Mon, Feb 27, 2012 at 4:40 PM, Meikel Brandmeyer (kotarak) 
m...@kotka.dewrote:

 Hi Sunil,

 your version pays a price when f is expensive since it is applied twice.
 It is sufficient to wrap the drop into a lazy-seq.

 (shameless-self-promotion 
 http://kotka.de/blog/2011/04/Beauty_in_a_bug.html;)

 Meikel

  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: partition-by where the subsequences are also lazy ..

2012-02-27 Thread Sunil S Nandihalli
Thanks Miekel. I can use the count version if it does not store the
previous subseq in memory.
Sunil.

On Mon, Feb 27, 2012 at 5:38 PM, Meikel Brandmeyer (kotarak) 
m...@kotka.dewrote:

 Hi,

 ah. Ok. I understand now your particular issue. Yes. Your approach is
 perfectly feasible. By paying the price of calling f multiple times for an
 element and realising each group twice you can make the two sequences
 (take-while and drop-while) independent and hence don't retain the head of
 the first group when realising the second group. With the count solution
 the first group would have been also realised and kept in memory. However
 since the take and drop are independent the first group is realised, but
 thrown away immediatelly.

 Your posted solution should work fine.


 Meikel

  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

lazy-sequences and memory leaks

2012-02-27 Thread Sunil S Nandihalli
Hi Everybody,
 I am using lazy-seqs to join two very large csv files. I am very certain
that I am not holding on to any of the heads and If I did .. the jvm would
be out of memory far sooner than what I am seeing currently. The size of
the file is something like 73 G and the Ram allocated to the jvm is about
8G . It seems like a very gradual leak. Has anybody else encountered
similar problems? In case some of you feel that my code might be the
culprit, the following gist has the source.

https://gist.github.com/1929345

Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: lazy-sequences and memory leaks

2012-02-27 Thread Sunil S Nandihalli
I would like to hear what you may have to say regarding this. As always.. I
pressed send sooner than I wanted to..

On Tue, Feb 28, 2012 at 9:43 AM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi Everybody,
  I am using lazy-seqs to join two very large csv files. I am very certain
 that I am not holding on to any of the heads and If I did .. the jvm would
 be out of memory far sooner than what I am seeing currently. The size of
 the file is something like 73 G and the Ram allocated to the jvm is about
 8G . It seems like a very gradual leak. Has anybody else encountered
 similar problems? In case some of you feel that my code might be the
 culprit, the following gist has the source.

 https://gist.github.com/1929345

 Thanks,
 Sunil.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: lazy-sequences and memory leaks

2012-02-27 Thread Sunil S Nandihalli
thank you ..
some times it is hard to come up with good names .. suggestions welcome ..
:)
Sunil.

On Tue, Feb 28, 2012 at 9:47 AM, Baishampayan Ghose b.gh...@gmail.comwrote:

   I am using lazy-seqs to join two very large csv files. I am very certain
  that I am not holding on to any of the heads and If I did .. the jvm
 would
  be out of memory far sooner than what I am seeing currently. The size of
 the
  file is something like 73 G and the Ram allocated to the jvm is about 8G
 .
  It seems like a very gradual leak. Has anybody else encountered similar
  problems? In case some of you feel that my code might be the culprit, the
  following gist has the source.

 OT, but I hereby nominate

 `lazy-join-sorted-map-seqs-with-only-second-map-seq-allowed-to-have-duplicate-fields`
 as the most awesome fn name of the decade ;-)

 Regards,
 BG

 --
 Baishampayan Ghose
 b.ghose at gmail.com

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: lazyness

2012-02-24 Thread Sunil S Nandihalli
Thanks Mark,
 I think that worked!!
Sunil.

On Sat, Feb 25, 2012 at 10:54 AM, Mark Rathwell mark.rathw...@gmail.comwrote:

 Try this (you need to wrap the return val of helper in lazy-seq also):

 (defn pair-sequences-by
  ([seq-1 seq-2 f1 f2]
 s1 and s2 are guaranteed to be strictly monotonically increasing
 whith respect to f1 and f2 as keys respectively.
  The return value is pairs of elements e1 from s1 and e2 from s2 such
 that (= (f1 e1) (f2 e2)) is true
 (let [helper (fn helper [s1 s2]
(loop [[x  xs :as wx] s1 [y  ys :as wy] s2]
  (when (and x y)
   (let [[xk yk] (map #(%1 %2) [f1 f2] [x y])]
 (let [cval (compare xk yk)]
   (cond
( cval 0) (recur xs wy)
 (= cval 0) (cons [x y] (lazy-seq (helper xs
 ys)))
 ( cval 0) (recur wx ys)))]
   (lazy-seq (helper seq-1 seq-2
  ([seq-1 seq-2 f] (pair-sequences-by seq-1 seq-2 f f)))

 On Fri, Feb 24, 2012 at 11:36 PM, Sunil S Nandihalli
 sunil.nandiha...@gmail.com wrote:
  Hi Everybody,
   Can somebody comment if the following piece of code is truely lazy?
 
 
 
 
  (defn pair-sequences-by
 
 
 
([seq-1 seq-2 f1 f2]
 
 
 
   s1 and s2 are guaranteed to be strictly monotonically increasing
 whith
  respect to f1 and f2 as keys respectively.
 
 
 
   The return value is pairs of elements e1 from s1 and e2 from s2 such
 that
  (= (f1 e1) (f2 e2)) is true
 
 
 
   (let [helper (fn helper [s1 s2]
 
 
 
  (loop [[x  xs :as wx] s1 [y  ys :as wy] s2]
 
 
 
(when (and x y)
 
 
 
 (let [[xk yk] (map #(%1 %2) [f1 f2] [x y])]
 
 
 
   (let [cval (compare xk yk)]
 
 
 
 (cond
 
 
 
  ( cval 0) (recur xs wy)
 
 
 
  (= cval 0) (cons [x y] (helper xs ys))
 
 
 
  ( cval 0) (recur wx ys)))]
 
 
 
 (lazy-seq (helper seq-1 seq-2
 
 
 
([seq-1 seq-2 f] (pair-sequences-by seq-1 seq-2 f f)))
 
 
 
 
 
 
  https://gist.github.com/e9f6c0ad9bbe535d2d54
 
 
 
 
 
 
  I am running out of ram when I use this.. so any help would be greatly
  appreciated.
 
 
 
  Thanks,
  Sunil.
 
  --
  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 unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [Tutorial] Making core.logic work with custom data structures

2012-01-06 Thread Sunil S Nandihalli
thank you Tassilo, I think this post was long due. :)
Sunil.

On Sat, Jan 7, 2012 at 3:14 AM, Tassilo Horn tass...@member.fsf.org wrote:

 Hi all,

 after spending the last two days making clojure.core.logic work with our
 custom Java data structures, I decided to write a short blog posting
 about it.  Here it is:


 http://tsdh.wordpress.com/2012/01/06/using-clojures-core-logic-with-custom-data-structures/

 A bunch of compliments and thank-yous to Ambrose, who was something like
 my 24/7 support center over last 2 days. :-)

 Bye,
 Tassilo

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [Tutorial] Making core.logic work with custom data structures

2012-01-06 Thread Sunil S Nandihalli
great post! .. just what I wanted.!
Sunil.

On Sat, Jan 7, 2012 at 11:14 AM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 thank you Tassilo, I think this post was long due. :)
 Sunil.


 On Sat, Jan 7, 2012 at 3:14 AM, Tassilo Horn tass...@member.fsf.orgwrote:

 Hi all,

 after spending the last two days making clojure.core.logic work with our
 custom Java data structures, I decided to write a short blog posting
 about it.  Here it is:


 http://tsdh.wordpress.com/2012/01/06/using-clojures-core-logic-with-custom-data-structures/

 A bunch of compliments and thank-yous to Ambrose, who was something like
 my 24/7 support center over last 2 days. :-)

 Bye,
 Tassilo

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: core.logic

2011-12-24 Thread Sunil S Nandihalli
Thanks Ambrose.. That is exactly what I wanted.
Sunil.

On Sat, Dec 24, 2011 at 1:23 PM, Ambrose Bonnaire-Sergeant 
abonnaireserge...@gmail.com wrote:

 Or is this more what you're after? https://gist.github.com/1516727

 Ambrose

 On Sat, Dec 24, 2011 at 3:39 PM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:

 Hi,
  I would like to create a predicate which would accept two keys k1,k2 and
 two maps m1 m2 .. and unify the following
 m1[k1] = k2 and m2[k2] = k1 .. I have spent some time on it.. but been
 unable to figure out how to do this. I would like this to be as efficient
 as possible. I would appreciate any suggestion any of you may have..
 Thanks,
 Sunil.

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: core.logic

2011-12-24 Thread Sunil S Nandihalli
Hi Ambrose,
 I tried to run your code .. the following gist describes how I tried to
run it ...
https://gist.github.com/384b50f23ff99f409b5c
I was expecting the answer to be ([:a :b]) .. but I instead got () ..
can you please clarify?
Thanks,
Sunil.

On Sat, Dec 24, 2011 at 4:05 PM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Thanks Ambrose.. That is exactly what I wanted.
 Sunil.


 On Sat, Dec 24, 2011 at 1:23 PM, Ambrose Bonnaire-Sergeant 
 abonnaireserge...@gmail.com wrote:

 Or is this more what you're after? https://gist.github.com/1516727

 Ambrose

 On Sat, Dec 24, 2011 at 3:39 PM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:

 Hi,
  I would like to create a predicate which would accept two keys k1,k2
 and two maps m1 m2 .. and unify the following
 m1[k1] = k2 and m2[k2] = k1 .. I have spent some time on it.. but been
 unable to figure out how to do this. I would like this to be as efficient
 as possible. I would appreciate any suggestion any of you may have..
 Thanks,
 Sunil.

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

core.logic

2011-12-23 Thread Sunil S Nandihalli
Hi,
 I would like to create a predicate which would accept two keys k1,k2 and
two maps m1 m2 .. and unify the following
m1[k1] = k2 and m2[k2] = k1 .. I have spent some time on it.. but been
unable to figure out how to do this. I would like this to be as efficient
as possible. I would appreciate any suggestion any of you may have..
Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: data.priority-map 0.0.1

2011-12-17 Thread Sunil S Nandihalli
Thanks  that makes sense now...
Sunil.

On Sat, Dec 17, 2011 at 1:15 AM, Mark Engelberg mark.engelb...@gmail.comwrote:

 Fleshing out the solution I outlined in a previous email, here's a
 concrete implementation that lets you use maps as priorities.

 (defn- make-id-generator []
  (let [i (atom 0),
generate-unique-id (fn generate-unique-id [item] (swap! i inc))]
(memoize generate-unique-id)))

 (defn- make-map-comparator []
  (let [id (make-id-generator)]
#(compare [(count %2) (id %2)] [(count %1) (id %1)])))

 (def p (priority-map-by (make-map-comparator)))


 [Note that this implementation keeps the memoization cache local to
 the priority-map, so if your priority map goes out of scope, the
 memoization cache should be garbage collectable]


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

data.priority-map 0.0.1

2011-12-16 Thread Sunil S Nandihalli
Hi,
 The data.priority-map has been a nice library. I have used it quiet often.
Recently, when I used it, I discovered the following unexpected behaviour..
can somebody throw some light on it?

(- (pm/priority-map-by #( (count %1) (count %2)))



(update-in [1] #(assoc (or % {}) 2 3))



(update-in [2] #(assoc (or % {}) 1 3))



(update-in [2] #(assoc (or % {}) 2 4))



(update-in [1] #(assoc (or % {}) 3 4)))

The answer I expected was

{1 {2 3,3 4} , 2 {1 3, 2 4}}

but the one I got was

{1 {2 4, 1 3}, 2 {2 4, 1 3}}

Is this the expected behaviour?.. am I using it wrong?

Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: data.priority-map 0.0.1

2011-12-16 Thread Sunil S Nandihalli
The project file I used ..


(defproject trybug 1.0.0-SNAPSHOT



  :description FIXME: write description



  :dependencies [[org.clojure/clojure 1.3.0]



 [org.clojure/data.priority-map 0.0.1]]



  :repositories {sonatype-oss-public



 https://oss.sonatype.org/content/groups/public/})















Sunil.

On Fri, Dec 16, 2011 at 2:45 PM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi,
  The data.priority-map has been a nice library. I have used it quiet
 often. Recently, when I used it, I discovered the following unexpected
 behaviour.. can somebody throw some light on it?

 (- (pm/priority-map-by #( (count %1) (count %2)))



 (update-in [1] #(assoc (or % {}) 2 3))



 (update-in [2] #(assoc (or % {}) 1 3))



 (update-in [2] #(assoc (or % {}) 2 4))



 (update-in [1] #(assoc (or % {}) 3 4)))

 The answer I expected was

 {1 {2 3,3 4} , 2 {1 3, 2 4}}

 but the one I got was

 {1 {2 4, 1 3}, 2 {2 4, 1 3}}

 Is this the expected behaviour?.. am I using it wrong?

 Thanks,
 Sunil.



-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: data.priority-map 0.0.1

2011-12-16 Thread Sunil S Nandihalli
Thanks Mark, for your response... While I understand what you are saying..
I don't understand as to why the following is working ..

(assoc (pm/priority-map 1 1 2 1) 3 1)

gives
{1 1 2 1 3 1}
Am I not supposed to be using this? will it eventually bite me?

Sunil.

On Fri, Dec 16, 2011 at 3:48 PM, Mark Engelberg mark.engelb...@gmail.comwrote:

 priority-map-by is going to do funky things if your ordering function
 does not obey the trichotomy property (i.e., for all a, b, exactly one
 of ab, a=b, or ab holds).

 The reason for this is that priority-map internally uses Clojure's
 sorted-map, and Clojure's sorted-map does funky things if the ordering
 function does not obey the trichotomy property.

 Let's take a look at the behavior of Clojure's sorted-map with
 something similar to what you are doing:

 user= (def s (sorted-map-by #( (count %1) (count %2
 #'user/s
 user= (def s1 (assoc s {1 3} 2)))
 #'user/s1
 user= s1
 {{1 3} 2}
 user= (assoc s1 {2 3} 3)
 {{1 3} 3}

 Look at what happens here.  Clojure's sorted-map gets confused because
 your ordering function suggests that {2 3} and {1 3} are considered
 equal, so it just overwrites the value associated with {1 3}.

 So since your comparator function screws with sorted-map, it also
 gives bizarre results with priority-map-by.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: clojure starter package for aichallenge ?

2011-10-24 Thread Sunil S Nandihalli
Hi Ulises,
 I get a bad submission key found error when I submit the zip file that
contains
ants.clj
MyBot.clj

Am I doing something wrong?

I did run the test_bot.sh with MyBot.clj .. It seems to work fine.

Thanks,
Sunil.



On Tue, Oct 25, 2011 at 3:52 AM, Ulises ulises.cerv...@gmail.com wrote:

 I tried submitting the started package and it crashed as hills weren't
 implemented.

 I have patched the starter package to include hills (although I
 suspect I'm doing the wrong thing; I blindly copied the behaviour of
 keeping track of the coords for hills too).

 The code resides in: https://github.com/ulises/ai-challenge

 PS: I just submitted it and it passed all tests.

 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 posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: clojure starter package for aichallenge ?

2011-10-24 Thread Sunil S Nandihalli
I failed to mention that both the files are in a directory named

mybot



On Tue, Oct 25, 2011 at 10:58 AM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi Ulises,
  I get a bad submission key found error when I submit the zip file that
 contains
 ants.clj
 MyBot.clj

 Am I doing something wrong?

 I did run the test_bot.sh with MyBot.clj .. It seems to work fine.

 Thanks,
 Sunil.



 On Tue, Oct 25, 2011 at 3:52 AM, Ulises ulises.cerv...@gmail.com wrote:

 I tried submitting the started package and it crashed as hills weren't
 implemented.

 I have patched the starter package to include hills (although I
 suspect I'm doing the wrong thing; I blindly copied the behaviour of
 keeping track of the coords for hills too).

 The code resides in: https://github.com/ulises/ai-challenge

 PS: I just submitted it and it passed all tests.

 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 posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: clojure starter package for aichallenge ?

2011-10-23 Thread Sunil S Nandihalli
Hi Chris,
 Thanks for your startup-package. Can you please tell me if there is a
test_bot.sh for clojure. Can share if you already have one?
Thanks,
Sunil.

On Sat, Oct 22, 2011 at 12:16 PM, Chris Granger ibdk...@gmail.com wrote:

 Hm? My starter package is there:

 http://aichallenge.org/starter_packages.php

 They changed the game at the end and I didn't have time to update it
 for hills, but it actually works just fine as is. Also, it should be
 fairly trivial for someone to add that bit...

 Cheers,
 Chris.

 On Oct 20, 11:58 am, faenvie fanny.aen...@gmx.de wrote:
  hi clojure community,
 
  at the moment there seems to be no applicable
  clojure starter package for thehttp://aichallenge.org/
 
  though some work has be done on it by chris granger, i
  think:https://github.com/ibdknox/aichallenge
 
  are there any plans to get a clojure starter package out ?
  it would be nice to see clojure-programs participate in the
  challenge.
 
  have a successful day

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: clojure starter package for aichallenge ?

2011-10-23 Thread Sunil S Nandihalli
Hi Chris,
 I am sorry, I think I needed to be a little more specific. I get a bad
submission key found error when I submit..
Sunil.

On Sun, Oct 23, 2011 at 9:16 PM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi Chris,
  Thanks for your startup-package. Can you please tell me if there is a
 test_bot.sh for clojure. Can share if you already have one?
 Thanks,
 Sunil.


 On Sat, Oct 22, 2011 at 12:16 PM, Chris Granger ibdk...@gmail.com wrote:

 Hm? My starter package is there:

 http://aichallenge.org/starter_packages.php

 They changed the game at the end and I didn't have time to update it
 for hills, but it actually works just fine as is. Also, it should be
 fairly trivial for someone to add that bit...

 Cheers,
 Chris.

 On Oct 20, 11:58 am, faenvie fanny.aen...@gmx.de wrote:
  hi clojure community,
 
  at the moment there seems to be no applicable
  clojure starter package for thehttp://aichallenge.org/
 
  though some work has be done on it by chris granger, i
  think:https://github.com/ibdknox/aichallenge
 
  are there any plans to get a clojure starter package out ?
  it would be nice to see clojure-programs participate in the
  challenge.
 
  have a successful day

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

core.logic

2011-10-08 Thread Sunil S Nandihalli
Hi everybody,
 I was just trying to implement a simple length of a list in core.logic
(basically solving the 99-problems-in-prolog). I am not able to find a way
to increment values.. Can somebody help me with this... I would like some
thing like the following to work..

(defnu lengtho [l n]
  ([[] 0])
  ([[_ . rst] _] (fresh [n1]
(lengtho rst n1)
(== n (+ n1 1

but I can't do (== n (+ n1 1)) can somebody help me? Even if you tell me
as to how I can covert the regular count function so that I can use it as a
goal.. that would work too.
Thanks,
Sunil.

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: core.logic

2011-10-08 Thread Sunil S Nandihalli
Please replace rst with ?rst ..
Sunil.

On Sat, Oct 8, 2011 at 1:20 PM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi everybody,
  I was just trying to implement a simple length of a list in core.logic
 (basically solving the 99-problems-in-prolog). I am not able to find a way
 to increment values.. Can somebody help me with this... I would like some
 thing like the following to work..

 (defnu lengtho [l n]
   ([[] 0])
   ([[_ . ?rst] _] (fresh [n1]
 (lengtho ?rst n1)
 (== n (+ n1 1

  but I can't do (== n (+ n1 1)) can somebody help me? Even if you tell
 me as to how I can covert the regular count function so that I can use it as
 a goal.. that would work too.
 Thanks,
 Sunil.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: core.logic

2011-10-08 Thread Sunil S Nandihalli
Here is my solution...
(defnu succ [n n+1]
  ([0 1])
  ([1 2])
  ([2 3])
  ([3 4])
  ([4 5])
  ([5 6])
  ([6 7])
  ([7 8])
  ([8 9])
  ([9 10]))

(defn pred [n n-1]
  (succ n-1 n))

(defnu lengtho [l n]
  ([[] 0])
  ([[_ . ?rst] _] (fresh [n1]
(lengtho ?rst n1)
(succ n1 n)

Obviously the above code is not right or efficient and is very limited in
range. I am sure there should be a better solution..

Thanks,
Sunil.

On Sat, Oct 8, 2011 at 1:20 PM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi everybody,
  I was just trying to implement a simple length of a list in core.logic
 (basically solving the 99-problems-in-prolog). I am not able to find a way
 to increment values.. Can somebody help me with this... I would like some
 thing like the following to work..

 (defnu lengtho [l n]
   ([[] 0])
   ([[_ . rst] _] (fresh [n1]
 (lengtho rst n1)
 (== n (+ n1 1

 but I can't do (== n (+ n1 1)) can somebody help me? Even if you tell me
 as to how I can covert the regular count function so that I can use it as a
 goal.. that would work too.
 Thanks,
 Sunil.


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: core.logic

2011-10-08 Thread Sunil S Nandihalli
Thanks Ambrose. that fixed it .. I tried the following along the same lines
but didn't work.. can you suggest as to how I can do it?

(defn nlasto [l last-val]
  (project [l last-val]
   (== last-val (last l

(run* [q] (nlasto [1 2 3 4 5] q))

I do know how to do it in pure relational thing.. I just wanted to try the
non-relational version

Sunil.

On Sat, Oct 8, 2011 at 6:38 PM, Ambrose Bonnaire-Sergeant 
abonnaireserge...@gmail.com wrote:

 Hi Sunil,

 Use the non-relational goal project to get the value of a lvar.

 The is operator in Prolog does similar things AFAIK.

 Untested:

 (defnu lengtho [l n]
   ([[] 0])
   ([[_ . rst] _] (fresh [n1]
 (lengtho rst n1)
 (project [n n1]
  (== n (+ n1 1)

 Thanks,
 Ambrose

 On Sat, Oct 8, 2011 at 3:50 PM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:

 Hi everybody,
  I was just trying to implement a simple length of a list in core.logic
 (basically solving the 99-problems-in-prolog). I am not able to find a way
 to increment values.. Can somebody help me with this... I would like some
 thing like the following to work..

 (defnu lengtho [l n]
   ([[] 0])
   ([[_ . rst] _] (fresh [n1]
 (lengtho rst n1)
 (== n (+ n1 1

 but I can't do (== n (+ n1 1)) can somebody help me? Even if you tell me
 as to how I can covert the regular count function so that I can use it as a
 goal.. that would work too.
 Thanks,
 Sunil.

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


  --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: core.logic

2011-10-08 Thread Sunil S Nandihalli
oh I see. I removed last-val from project and it worked fine..
Thanks,
Sunil.

On Sat, Oct 8, 2011 at 7:55 PM, David Nolen dnolen.li...@gmail.com wrote:

 Your projecting last-val which is unbound. Once projected you have a value
 not a logic var.

 David

 On Saturday, October 8, 2011, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:
  Thanks Ambrose. that fixed it .. I tried the following along the same
 lines but didn't work.. can you suggest as to how I can do it?
  (defn nlasto [l last-val]
(project [l last-val]
 (== last-val (last l
  (run* [q] (nlasto [1 2 3 4 5] q))
  I do know how to do it in pure relational thing.. I just wanted to try
 the non-relational version
  Sunil.
  On Sat, Oct 8, 2011 at 6:38 PM, Ambrose Bonnaire-Sergeant 
 abonnaireserge...@gmail.com wrote:
 
  Hi Sunil,
  Use the non-relational goal project to get the value of a lvar.
  The is operator in Prolog does similar things AFAIK.
  Untested:
  (defnu lengtho [l n]
([[] 0])
([[_ . rst] _] (fresh [n1]
  (lengtho rst n1)
  (project [n n1]
   (== n (+ n1 1)
  Thanks,
  Ambrose
  On Sat, Oct 8, 2011 at 3:50 PM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:
 
  Hi everybody,
   I was just trying to implement a simple length of a list in core.logic
 (basically solving the 99-problems-in-prolog). I am not able to find a way
 to increment values.. Can somebody help me with this... I would like some
 thing like the following to work..
  (defnu lengtho [l n]
([[] 0])
([[_ . rst] _] (fresh [n1]
  (lengtho rst n1)
  (== n (+ n1 1
  but I can't do (== n (+ n1 1)) can somebody help me? Even if you tell
 me as to how I can covert the regular count function so that I can use it as
 a goal.. that would work too.
  Thanks,
  Sunil.
 
  --
  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 unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com 
 clojure%2bunsubscr...@googlegroups.com

  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en 
 http://groups.google.com/group/clojure?hl=en

 
  --
  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 unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com 
 clojure%2bunsubscr...@googlegroups.com

  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en 
 http://groups.google.com/group/clojure?hl=en

 
  --
  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 unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com 
 clojure%2bunsubscr...@googlegroups.com

  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en

 --
 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 unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

  1   2   3   4   >