Re: Confusion about cljs.build.api/build

2015-06-30 Thread Zack Maril
Update: thanks to a comment at the bottom of one of the files in the 
clojurescript project 
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L1828,
 
I think I know how to fix this. Instead of a list, I should have used a 
vector. I don't know why this works, I imagine there is a seq? somewhere it 
shouldn't be but I really don't know. 
-Zack

On Monday, June 29, 2015 at 9:29:42 PM UTC-4, Zack Maril wrote:

 Hello,

 I'm trying to use cljs.build.api/build to compile dynamically generated 
 clojurescript into one javascript string. I've been running into many weird 
 errors and I'm quite certain I'm doing something wrong. The simplest test 
 case I've found is the following: 

 (cljs.build.api/build '((ns test.test)) {:optimizations :advanced})

 The above prints a parse error from closure I think and then returns a 
 string that contains generic javascript about Math but nothing else: 
 ERROR: JSC_PARSE_ERROR. Parse error. primary expression expected at 
 test.test line 3 : 1

 Are there other options I am supposed to be passing in? Do I have the 
 nesting wrong on the structures? I've tried a list like '(+ 1 1) instead 
 but the string output doesn't look to be doing any work and that level of 
 nesting doesn't seem to be what is implied by cljs.closurei/compile-for-seq 
 with it's forms argument. Any what is going on? 
 -Zack


-- 
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.


Confusion about cljs.build.api/build

2015-06-29 Thread Zack Maril
Hello,

I'm trying to use cljs.build.api/build to compile dynamically generated 
clojurescript into one javascript string. I've been running into many weird 
errors and I'm quite certain I'm doing something wrong. The simplest test 
case I've found is the following: 

(cljs.build.api/build '((ns test.test)) {:optimizations :advanced})

The above prints a parse error from closure I think and then returns a 
string that contains generic javascript about Math but nothing else: 
ERROR: JSC_PARSE_ERROR. Parse error. primary expression expected at 
test.test line 3 : 1

Are there other options I am supposed to be passing in? Do I have the 
nesting wrong on the structures? I've tried a list like '(+ 1 1) instead 
but the string output doesn't look to be doing any work and that level of 
nesting doesn't seem to be what is implied by cljs.closurei/compile-for-seq 
with it's forms argument. Any what is going on? 
-Zack

-- 
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-03 Thread Zack Maril
Use :optimize :memory maybe? Section 10 here seems like your use 
case: https://github.com/Engelberg/instaparse/blob/master/docs/Performance.md
Watch htop and see if you have a process that is hitting swap without the 
optimization.
-Zack

On Wednesday, December 3, 2014 1:29:23 AM UTC-5, Sunil Nandihalli wrote:

 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.na...@gmail.com 
 javascript: 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.


Re: ANN: State of Clojure 2014 Survey - please contribute!!

2014-10-14 Thread Zack Maril
ClojureBridge and conj grants are excellent ways to encourage all types of 
folks to join Clojure and I'm stoked that these programs have emerged from 
the community. These are Good Things and should be continued and improved 
upon wherever possible. I'd personally like to know how much good these 
efforts do and tracking demographics of the Clojure community, whether it 
is through the State of Clojure survey or other means, would allow us to 
measure the distance between our ideals and reality. I'm proud of the 
attempts and efforts undertaken to increase diversity within the community 
and, beyond the specifics of this current conversation, I'm confident that 
Clojure will make strides towards a more diverse user base. 

For the issue at hand, I believe that by including demographics within the 
State of the Clojure survey the Clojure leadership would be making a strong 
statement indicating their desire for a more desire community. The survey 
measures that which has been deemed important to know and understand in 
terms of the stewardship and development of Clojure. Including demographic 
questions in the survey, along with the context of why they were included, 
would indicate that there is a strong desire to understand and improve the 
diversity of the community by those who lead the community. Inclusion of 
such questions on the survey would be another opportunity for Clojure to be 
more than just not unwelcoming to atypical folks and allow us to 
purposefully invite more people to this relative paradise we inhabit. For a 
relatively small effort* it would show atypical folks that we care to know 
that they exist in the context of Clojure usage and that we are interested 
in understanding and improving their situation. 
-Zack

*If I've misgauged the difficultly of adding such questions to the survey, 
please say so. My impression is that this would be straightforward 
technologically and, by perhaps copying questions from similar surveys, 
straightforward in terms of survey design. I don't mean to ask you to drop 
everything and try to solve all the problems of sexism all at once but only 
to do something which seems, from an outside perspective, fairly economical 
with low costs and high benefits. 


On Tuesday, October 14, 2014 10:15:27 AM UTC-5, Bridget wrote:

 Great points from everyone about the lack of diversity in the Clojure 
 world and the need to track improvement on that. I like the idea of finding 
 a tangible thing that we can measure. Collecting demographic information in 
 the annual survey is an interesting idea, and I think we should take it 
 under consideration for next year. There are aspects of that I would want 
 to think through first. 

 A metric I would love to know and have no idea how to obtain is the number 
 of women, number of people of color, number of Latinos, etc. employed 
 writing Clojure.

 And while none of these numbers are currently good, I am fairly certain 
 they are improving. By informal measures - such as the number of women 
 attending Clojure conferences - things are significantly improving over the 
 last year or two, although certainly not enough. There are definitely women 
 and people of color using Clojure, and I would like for them to be visible. 
 I just ran through who I follow on Twitter, and I counted 13 women 
 (including me) who get paid to write Clojure. So we are out there.

 Bridget

 On Tuesday, October 14, 2014 8:50:37 AM UTC-4, Rick Moynihan wrote:

 On 13 October 2014 22:05, Alex Miller al...@puredanger.com wrote: 
  I do not need a poll to see that Clojure developers are predominantly 
 white 
  men, although that's also true of most programming languages and a  
  consequence of larger pervasive issues in the industry. However, I 
 think the 
  Clojure community has been making progress on increasing diversity 
 through 
  efforts like ClojureBridge http://www.clojurebridge.org/ and the 
  Clojure/conj opportunity grants http://clojure-conj.org/grants/. 

 You might not need a poll to see that the community lacks diversity, 
 but you might need a poll to see if the community is improving its 
 diversity or not.  Without measuring things we just don't know. 

 I don't think it's for me to say whether this is best done in the 
 clojure annual survey or not; but it seems we  should measure this 
 metric if we care about improving it. 

 R. 

  You might also find this project's data interesting: 
  http://alyssafrazee.com/gender-and-github-code.html 
  
  I would humbly submit that you should choose your language based on the 
 best 
  tool for the job and then work to hire, train, and improve diversity of 
 the 
  community regardless of what that tool may be. 
  
  Alex 
  
  
  
  On Monday, October 13, 2014 1:50:13 PM UTC-5, Zack Maril wrote: 
  
  Next year, I would appreciate questions that measure the demographics 
 of 
  Clojure users be included. Out of the hundreds of people I've heard 
 and seen 
  talking about using

Re: ANN: State of Clojure 2014 Survey - please contribute!!

2014-10-13 Thread Zack Maril
Next year, I would appreciate questions that measure the demographics of 
Clojure users be included. Out of the hundreds of people I've heard and 
seen talking about using Clojure, the vast majority of them have been white 
men. I've thought about it for a few days now and I can only think of three 
or four women who I know use Clojure and only a few non white men. I'd like 
to know if selecting Clojure as my default/main programming language means 
that I'll be forced to select from a fairly homogeneous group of potential 
coworkers and miss out on the benefits of a diverse working environment. 
-Zack 


On Friday, October 10, 2014 5:27:50 PM UTC-5, Jony Hudson wrote:

 If this is the unofficial survey post of academics using Clojure then I'd 
 better add myself to the list :-)

 @Bruce do you know what course they're going to be teaching Clojure on at 
 Birkbeck?


 Jony


 On Friday, 10 October 2014 08:08:28 UTC+1, Bruce Durling wrote:

 I also know that Birkbeck College University of London is going to be 
 teaching Clojure this year. 
 On Oct 10, 2014 12:01 AM, Lee Spector lspe...@hampshire.edu wrote:


 FWIW I'm another person using Clojure mostly for academic research. And 
 for computer science education, e.g. I'm currently teaching a Clojure-based 
 AI course. I'd be curious to know how many others of us are out there. And 
 BTW I think that attention to users in these categories could help to grow 
 the community.

  -Lee

 On Oct 9, 2014, at 12:32 AM, Mars0i mars...@logical.net wrote:

  Thanks for the survey!
 
  I have a couple of suggestions/questions:
 
  For domains, there are no categories for scientific or other research 
 applications.  For example, I mainly use Clojure for writing agent-based 
 models for academic research.  Would a set of categories in this area be 
 usedful?
 

 --
 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.


Re: ECHELON: Wrangling messy political data

2014-09-17 Thread Zack Maril
One issue we've been having is that we are using Datomic in a non standard 
way (I think). We're touching all the data all at once for some resolution 
steps and Datomic wasn't necessarily made for that (at least that has been 
my impression). I've been trying to understand the Datomic query system 
better so I know the limitations of the system and how to work with them. 
ECHELON takes a few hours to run right now and we're looking to increase 
the amount of data we collect and link by an order of magnitude or two in 
the next year. It's fine to let ECHELON run for a few days (the batch 
resolution step only needs to be run once, the streaming approach should 
always be fast) but it would be nice if we knew for sure that we had found 
the upper limit for how fast ECHELON can resolve things. If anybody has 
resources about how to abuse Datomic in this manner correctly, I'd be 
really happy if you sent them my way. I'll see if I can't push for a 
technical right up soon so I can provide more information about how ECHELON 
actually works.
-Zack

On Wednesday, September 17, 2014 2:47:10 AM UTC-5, Joshua Ballanco wrote:

 Very interesting project! (and congrats on joining SunlightLabs)   

 As someone who has, on occasion, contributed to various SunlightLabs 
 foundation projects, my only question would be: what do you need help with? 

 I understand completely if this project is not at a point where you’re 
 looking for outside contribution yet, but if there’s any area you’d like 
 help with, I’d be interested to throw at least a few weekend hours in your 
 general direction. 

 Cheers, 

 Josh 


 On Tuesday, September 16, 2014 at 20:48, Zack Maril wrote: 

  This might be of interest to the Clojure/Datomic community:   

  
 http://sunlightfoundation.com/blog/2014/09/16/wrangling-messy-political-data-into-usable-information/
  
  https://github.com/sunlightlabs/echelon 

  I'm part of the Influence Explorer team at the Sunlight Foundation. 
 We're building a system with Datomic and Instaparse to disentangle and 
 analyze the web of relationships between lobbyists, special interest 
 groups, and legislators. It's been surprisingly successful so far, as in it 
 works as well as we hoped it would when we first started building it. 
 Datomic has been a pleasure to use and Instaparse has been excellent so 
 far. The above link is a results oriented blog post about what we did and 
 why we did it. We haven't written up the technical details yet as they are 
 still evolving (we're attempting to move from the current static batch 
 processing system to hopefully a streaming approach in the near future). 
 But, if you have any questions about the project I'd be happy to answer 
 them. 
  -Zack 

  --   
  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 
 javascript: (mailto:clo...@googlegroups.com javascript:) 
  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 javascript: (mailto:
 clojure+u...@googlegroups.com javascript:) 
  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 javascript: (mailto:
 clojure+u...@googlegroups.com javascript:). 
  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.


ECHELON: Wrangling messy political data

2014-09-16 Thread Zack Maril
This might be of interest to the Clojure/Datomic community: 

http://sunlightfoundation.com/blog/2014/09/16/wrangling-messy-political-data-into-usable-information/
https://github.com/sunlightlabs/echelon

I'm part of the Influence Explorer team at the Sunlight Foundation. We're 
building a system with Datomic and Instaparse to disentangle and analyze 
the web of relationships between lobbyists, special interest groups, and 
legislators. It's been surprisingly successful so far, as in it works as 
well as we hoped it would when we first started building it. Datomic has 
been a pleasure to use and Instaparse has been excellent so far. The above 
link is a results oriented blog post about what we did and why we did it. 
We haven't written up the technical details yet as they are still evolving 
(we're attempting to move from the current static batch processing system 
to hopefully a streaming approach in the near future). But, if you have any 
questions about the project I'd be happy to answer them.
-Zack

-- 
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: ECHELON: Wrangling messy political data

2014-09-16 Thread Zack Maril
I had submitted a talk to clojure conj but it wasn't accepted. Stiff
competition this year. This project is ongoing though so I imagine sometime
in the next year I'll try again and give a talk at a conference about all
the weird stuff ECHELON can do. Like, it only took the better part of an
afternoon to make a prototype for an intelligent search engine for
corporations within the database. We just turned the output of the parser
into an index on corporations and firms. So a search for Coca Cola should
turn up records like Coca Cola Inc. formerly known as COCA-COLA COMPANY,
The Washington Group on behalf of Coca Cola Inc., and COCA COLA
INCORPORATED. We're still exploring what's possible and what would
actually be useful for folks.
-Zack

On Tue, Sep 16, 2014 at 1:27 PM, Ashton Kemerling ashtonkemerl...@gmail.com
 wrote:

 That's really neat. Planning on giving a talk?


 On Tue, Sep 16, 2014 at 12:08 PM, kovas boguta kovas.bog...@gmail.com
 wrote:

 Thats very cool!!

 On Tue, Sep 16, 2014 at 1:48 PM, Zack Maril thewitzb...@gmail.com
 wrote:
  This might be of interest to the Clojure/Datomic community:
 
 
 http://sunlightfoundation.com/blog/2014/09/16/wrangling-messy-political-data-into-usable-information/
  https://github.com/sunlightlabs/echelon
 
  I'm part of the Influence Explorer team at the Sunlight Foundation.
 We're
  building a system with Datomic and Instaparse to disentangle and
 analyze the
  web of relationships between lobbyists, special interest groups, and
  legislators. It's been surprisingly successful so far, as in it works
 as
  well as we hoped it would when we first started building it. Datomic
 has
  been a pleasure to use and Instaparse has been excellent so far. The
 above
  link is a results oriented blog post about what we did and why we did
 it. We
  haven't written up the technical details yet as they are still evolving
  (we're attempting to move from the current static batch processing
 system to
  hopefully a streaming approach in the near future). But, if you have
 any
  questions about the project I'd be happy to answer them.
  -Zack
 
  --
  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 a topic in the
 Google Groups Clojure group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/clojure/lxpsgkwITCw/unsubscribe.
 To unsubscribe from this group and all its topics, 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

Re: [ANN] Grenchman, for running Clojure code quickly

2013-10-09 Thread Zack Maril
How does this vary from flatland/drip?
-Zack

On Tuesday, October 8, 2013 9:49:16 PM UTC-5, Phil Hagelberg wrote:

 When we've polled Leiningen users in the past[1], the #1 pain point 
 people always report is its startup time. While there have been a number 
 of strategies suggested to reduce the annoyance of slow JVM startup time 
 and project loading, keeping your JVMs around can lead to awkward 
 workflows in some situations given the tooling we've had so far. 

 To this end I'm happy to announce the release of Grenchman, a tool for 
 executing Clojure code in a running process *quickly*: 

 http://leiningen.org/grench.html 

 With Grenchman you can launch an nREPL server in the background 
 (typically with `lein trampoline repl :headless`, but you can also embed 
 an nREPL server in a production setting) and then connect to it directly 
 From the command-line with minimal overhead: 

 $ time grench eval '(println Hello, world!)' 
 Hello, world! 

 real0m0.117s 
 user0m0.024s 
 sys 0m0.024s 

 This opens up a number of new command-line-centric workflows. 

 You can also invoke Leiningen tasks from Grenchman if you launch a 
 separate out-of-project `lein repl :headless` server: 

 $ time grench lein version 
 Leiningen 2.3.3 on Java 1.6.0_27 OpenJDK 64-Bit Server VM 
 real0m0.118s 
 user0m0.032s 
 sys 0m0.020s 

 Finally, Grenchman includes its own interactive nREPL client using GNU 
 Readline: 

 $ grench repl 
 user= (System/getProperty user.dir) 
 /home/phil/src/syme 
 [...] 

 Plans for the next version[3] include completion in the repl client and 
 support for repl history and multi-line form input. While it is a very 
 young project, the non-interactive functionality is quite stable. 

 Please give Grenchman a try if this sounds interesting to you. The 
 install process is the same as Leiningen where you download and chmod an 
 executable, except that there is a different executable for different 
 platforms; I have precompiled binaries for several common platforms at 
 the link above and will post user-contributed builds for other platforms 
 I don't have access to if there is demand. 

 thanks, 
 Phil 

 [1] - https://lein-survey-2013.herokuapp.com/results and 
 https://lein-survey-2012.herokuapp.com/results 

 [2] - https://github.com/technomancy/leiningen/wiki/Faster 

 [3] - 
 https://github.com/technomancy/grenchman/issues?milestone=2state=open 

 [4] - Grenchman was inspired to a degree by Jark 
 (http://icylisper.github.io/jark/) but does not share any code with 
 it. 

 [5] - Timings above are taken from my 4½-year-old laptop; newer hardware 
 would perform better. 


-- 
-- 
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: The Eclipse Public License is not a good license

2013-09-11 Thread Zack Maril
 It may have been chosen uncarefully. Other permissive licenses better 
fulfill Rich Hickey's spirit.
https://groups.google.com/forum/#!topic/clojure/TuojEIsu1G4
Rich Hickey choose the license himself. While you may disagree whether he 
made the right choice, it is highly unlikely that Rich did something as 
important as this, without taking much care as to why he did it. 
-Zack

On Wednesday, September 11, 2013 9:48:33 AM UTC-5, Laurent PETIT wrote:

 AFAICT it has been chosen carefully, but you are of course free to 
 think otherwise 

 2013/9/11 Kalinni Gorzkis musicde...@gmail.com javascript:: 
  I think that Clojure should switch to a better license with similar 
 spirit like Apache 2.0, BSD, or MIT. 
  While the EPL doesn't have the evil copyleft requirement of GPL, and 
 therefore allows and encourages commercial uses of the code, it has a 
 requirement that makes it incompatible with the GPL: If you create modified 
 versions of EPL-covered software, you must slap your name (or any other 
 identity) on it. In my humble opinion, this restriction isn't justified. 
 (All, or most, creators of modified versions will do that anyway). It may 
 have been chosen uncarefully. Other permissive licenses better fulfill Rich 
 Hickey's spirit. 
  
  -- 
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.comjavascript: 
  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 javascript: 
  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 javascript:. 
  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: ANN: Potemkin 0.3.0

2013-06-19 Thread Zack Maril
We've been using Potemkin inside Titanium, Ogre, and Archimedes. It works 
well for importing functions, but I'm about to do a rewrite of Titanium and 
Ogre because of complications arising from being clever with importing 
dynamic vars. I would caution against trying to import dynamic vars (or 
functions that rely on dynamic vars) between libraries. 
-Zack

On Wednesday, June 19, 2013 3:12:41 PM UTC-4, Zach Tellman wrote:

 Potemkin [1] is a collection of facades and utilities that I've found 
 helpful when writing larger-scale libraries or applications.  I've never 
 formally announced it before, but I think it's gotten to the point where 
 others can benefit from it.

 A few highlights:

 * 'def-map-type', which allows for the definition of custom map-like 
 objects with 10x less code
 * 'unify-gensyms', which allows for more concise nested syntax-quotes
 * 'import-vars', which allows for code sprinkled across multiple 
 namespaces to be exposed via a single namespace

 It's been pointed out before that ideally a library should have no 
 dependencies but Clojure itself, or we risk transitive dependency conflicts 
 when everyone uses different versions of a utility library.  In deference 
 to this, Potemkin is licensed such that any piece of code can be simply 
 pasted into your library, as long as there's a comment describing the 
 origin.

 If anyone has questions, I'm happy to answer them.  If anyone has moral or 
 aesthetic objections to 'import-vars', you're not alone, but please 
 remember you're under no obligation to use it.

 Zach

 [1] https://github.com/ztellman/potemkin


-- 
-- 
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: Graph API

2013-06-17 Thread Zack Maril
Take a look at Tinkerpop's blueprints for a well tested Java API and 
Archimedes for simple graph operations in Clojure. 
http://www.tinkerpop.com/
https://github.com/clojurewerkz/archimedes

As far as the suggested protocols go, I would suggest doing something 
useful with them before opening it up to the community for comments. 
There's not much there to discuss in terms of merits or anything else. 
-Zack

On Monday, June 17, 2013 4:14:34 PM UTC-4, dgrnbrg wrote:

 I think that there's already a project working on this called Loom. The 
 furthest-developed fork is here: https://github.com/aysylu/loom which 
 appears to have protocols for graphs, bindings to Titanium (the 
 Clojurewerkz graph DB library), visualization support, and implementations 
 of several algorithms.

 Maybe there's a way to incorporate these projects?

 On Monday, June 17, 2013 3:38:45 PM UTC-4, Stephen Kockentiedt wrote:

 Hello,

 I want to create a graph API similar to what core.matrix is for matrices. 
 I have created some protocols which every graph implementation has to 
 satisfy and a prototype implementation. Now I want your feedback on these 
 protocols. Which functions do you want to see which aren't there? Which 
 functions should be changed? Are there problems with the general design? 
 Have you any other feedback?

 Here are the protocol definitions:

 (defprotocol PGraph
   Minimal functionality of a graph.
   (directed? [g]
 Returns true if the graph is directed and false if the
  graph is undirected. If it is undirected, all functions
  taking two nodes must be commutative with regard to
  these nodes.)
   (nodes [g]
 Returns a set or sequence of all nodes of the graph. May
  not contain duplicates.)
   (has-edge? [g n1 n2]
 Returns true if the graph g has an edge from node n1
  to node n2.)
   (direct-successors [g n]
 Returns a set or sequence of all nodes n2 for which
  (has-edge? g n n2) returns true. May not contain
  duplicates.))

 (defprotocol PPredecessorGraph
   Optional functionality of a graph which can give a
list of all direct predecessors of a node.
   (direct-predecessors [g n]
 Returns a set or sequence of all nodes n2 for which
  (has-edge? g n2 n) returns true. May not contain
  duplicates.))

 (defprotocol PEditableGraph
   Minimal functionality of an editable graph.
   (mutable? [g]
 Returns true if the graph is mutated in place.
  If true is returned, the other functions change
  the graph passed as the first argument and return
  the same graph object. If false is returned, the
  functions return a new graph and the old graph is
  unchaged.)
   (add-node [g n]
 Adds the node n to the graph g. If it already
  contained n, the graph will not be changed.)
   (remove-node [g n]
 Removes the node n from the graph g. If it did
  not contain n, the graph will not be changed.)
   (add-edge [g n1 n2]
 Adds an edge from node n1 to node n2 to the graph g.
  If one or both of the nodes is not present it will
  be added to the graph. If the edge was already present,
  the graph will not be changed.)
   (remove-edge [g n1 n2]
 Removes the edge from node n1 to the node n2 from
  the graph g. If it did not contain the edge, the graph
  will not be changed.))

 (defprotocol PWeightedGraph
   Functionality of a graph whose edges can be weighted.
   (edge-weight [g n1 n2]
 Returns the weight of the edge from node n1 to
  node n2.))

 (defprotocol PEditableWeightedGraph
   Functionality of a weighted graph whose weights can be
changed.
   (update-edge-weight [g n1 n2 f]
 Updates the weight of the edge from node n1 to node n2,
  where f is a function taking the old value and returning
  the new one. If the graph did not contain the edge, it
  will be created.))

 (defprotocol PNodeDataGraph
   Functionality of a graph which stores data with its
nodes.
   (node-data [g n]
 Returns the data of the node n.))

 (defprotocol PEditableNodeDataGraph
   Functionality of a graph which stores editable data
with its nodes.
   (update-node-data [g n f]
 Updates the data of the node n, where f is a function
  taking the old value and returning the new one. If the
  graph did not contain the node, it will be added.))

 (defprotocol PEdgeDataGraph
   Functionality of a graph which stores data with its edges.
   (edge-data [g n1 n2]
 Returns the data of the edge from node n1 to node n2.))

 (defprotocol PEditableEdgeDataGraph
   Functionality of a graph which stores editable data
with its edges.
   (update-edge-data [g n1 n2 f]
 Changes the data of the edge from node n1 to n2, where
  f is a function taking the old value and returning the
  new one. If the graph did not contain the edge, it will
  be added.))



-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, 

Re: [ANN] Instaparse 1.1.0

2013-06-16 Thread Zack Maril
That is what I meant, should have been clearer. Those reasons make sense. 
Thank you!
-Zack

On Saturday, June 15, 2013 10:41:49 PM UTC-4, puzzler wrote:

 On Sat, Jun 15, 2013 at 7:21 PM, Zack Maril thewi...@gmail.comjavascript:
  wrote:

 Why does instaparse not throw errors? Curious about the reasoning behind 
 this design. 
 -Zack


 I'm not sure what you mean.  It does throw errors for certain kinds of 
 invalid grammars and other fatal problems.

 Perhaps what you're asking is why a string that doesn't fit the grammar 
 will return a failure object.  There are several reasons:
 1. In my view, it's not really an error -- the parser should return some 
 kind of value that indicates that the string didn't match the parser, and 
 the value should contain information about why it didn't match the parser.  
 It's sort of like choosing to return NaN rather than throwing an error for 
 certain arithmetic ops.
 2. The failure object is a simple Clojure map that can be explored, 
 serialized, whatever.  (I've chosen to print it somewhat like a thrown 
 error, but it is in fact a value).
 3. More consistent when you look at things like the total parse mode, 
 which need to indicate parse failure and return a valid parse 
 simultaneously.  You can't do that if the only way to indicate failure is 
 by throwing an error.
 4. Makes it possible to chain the output of a parser directly to the 
 transform function.
 5. Makes it possible to do things like mapping a parser across a 
 collection of strings to parse.


-- 
-- 
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: [ANN] Instaparse 1.1.0

2013-06-15 Thread Zack Maril
Why does instaparse not throw errors? Curious about the reasoning behind 
this design. 
-Zack

On Wednesday, June 12, 2013 9:46:06 AM UTC-4, JeremyS wrote:

 Hi puzzler,

 I have a project https://github.com/JeremS/cljss-core/tree/v0.4.0 that 
 I have been meaning to be useable from Clojure and ClojureScript. To do so 
 I am using lein-dalap http://birdseyesoftware.github.io/lein-dalap.docs/
 .

 I totally agree with you about the issues you have foreseen. The protocols 
 aren't exactly the same, the java specific parts would need to be rewritten 
 in cljs, I don't know how much work it would need to have the incremental 
 vector working in cljs since hashing isn't 
 'embedded' in JavaScript (cljs uses the google closure libraries for 
 that). lein-dalap http://birdseyesoftware.github.io/lein-dalap.docs/ helps 
 resolve some of these issues but not all of them. 
 (cljxhttps://github.com/lynaghk/cljx might 
 also be an alternative)

 I will totally add a request on github. I know it's a big wish to see 
 instaparse in cljs and I'd love to contribute as best I can.

 I'd also like to give a little rationale for the cljs adaptation. I am a 
 big fan of LightTable, which I use most of the time now. LT is written
 in ClojureScript and I can't wait to see the plugin system released in 
 future versions. Using instaparse to extend it would be really neet since 
 it supports ABNF grammar and, as your wiki taught me, ABNF makes for 
 standard grammars that we can find on the internet. It  would be nice to 
 exploit directly these grammar in LT using instaparse. 

 Another useful use case is in browser editors for syntaxes like markdown. 
 I have read a blog post considering markdown potentially armful and arguing 
 in favour of the wiki creole syntax. There is an EBNF grammar for creole...

 Last but very not the least, there are some very inspiring talks from Alan 
 Kay that advocate lisp philosophy of programming, 
 molding the language to your problem and coding in a language that suits 
 the domain of the problem. Instaparse is a great 
 tool to generate our own languages and I am coding some ClojureScript code 
 at the moment so call me biased... :)

 Cheers,

 Jeremys



 On Wednesday, June 12, 2013 12:09:56 AM UTC+2, puzzler wrote:

 Honestly I hadn't yet given it any thought.  Thanks for the interest in 
 having it on Clojurescript.  Here are a few issues that come to mind:

 1.  To achieve performance, I've spent time coding custom data structures 
 that implement various Clojure and Java interfaces.  I haven't done much 
 with Clojurescript, but my impression is that the ecosystem of protocols is 
 completely different, so I imagine that could be a pain to transfer over.

 2.  I don't know much about the performance of Javascript/Clojurescript's 
 underlying data structures.  For example, in Java, the substring operation 
 used to be O(1), but recently, much to my dismay, they changed it to O(n).  
 That change was annoying, and it means I'm going to have to rework some 
 code to deal with that, but at least I heard about it and can take it into 
 account.  But in Javascript I don't even *know* the performance 
 characteristics of its strings and substring operation.  What other 
 Javascript performance gotchas don't I know about?

 3. I'm assuming that due to the above, it won't be as simple as just 
 recompiling the code for Clojurescript.  I have no idea what's involved 
 with maintaining a code base for the two target languages simultaneously.  
 Sounds non-trivial, although maybe it won't seem so intimidating once 
 things have settled down and I'm not making quite so many performance 
 tweaks and feature enhancements to the code.

 In any case, please add your request as a github issue, so I don't forget 
 about it.

 On Tue, Jun 11, 2013 at 8:06 AM, JeremyS jschof...@gmail.com wrote:

 Hi Puzzler,

 I was wondering if you planned to port Instaparse to ClojureScript. I 
 know it's asking a lot, but I am one of those who would love
 to be able to run it in a browser or in node.js...

 Cheers,

 Jeremys.



-- 
-- 
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: Local database recommendation?

2013-06-12 Thread Zack Maril
No. We have done nothing with laziness. If your graph doesn't change much, 
you could probably roll your own. If it is changing often, I'm not sure 
laziness would be such a good thing. One way of rolling your own could be 
going through and getting all the ids of the elements you want and then 
mapping across those lazily while doing any work you want with the objects 
they represent. That shouldn't be too difficult to do and all your id's 
might easily fit into memory without any problems. 
-Zack

On Wednesday, June 12, 2013 10:30:02 PM UTC-4, Cedric Greevey wrote:

 I have some additional questions about Titanium, as the documentation did 
 not make these particular matters sufficiently clear:

 1. Can query results take the form of a lazy sequence, one which will not 
 result in an OOME if it's too large so long as the head is not held onto 
 while it is consumed? E.g. (take 3 (run-query-with-ten-zillion-results)) 
 should not blow up.

 2. In particular, can indexed-key searches do so?

 3. Given a backing DB that supports global queries of the whole graph, and 
 supposing the graph was ginormous and a query returned all or most of the 
 nodes, could *those* be lazily consumed in an OOME-avoiding manner?
  

-- 
-- 
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: Local database recommendation?

2013-05-27 Thread Zack Maril
Use postgres. If it makes sense later on, then try a nosql solution. Until 
then, postgres will probably do 95% of what you want out of the box. 
-Zack

On Sunday, May 26, 2013 6:20:02 PM UTC-4, Amirouche Boubekki wrote:


  1) Is it structured aka. an object can have several fields possibly 
 complex fields like list or hashmaps but also integers ? dates and uuids 
 can be emulated with strings and integers
 2) Do objects have relations ? a lot of relations ?
 3) is the data schema fixed at compilation or do you need to have the 
 schema to be dynamic ?


 Much of the data is conditional in a certain sense -- if it's an X, it's 
 also a Y and it may be a W or a Z as well, but if it's a G it's certainly 
 not a W, etc.; though simply storing a large number of boolean columns that 
 may be unused by many of the table rows would be acceptable.

 The thing that makes me slightly dubious about relational here is that 
 there will necessarily either be many columns unused by many rows, as 
 there's a lot of data that's N/A unless certain other conditions are met; 
 or else there will be many whole tables and a lot of expensive joins, as we 
 have a table of Foos, with an isBar? column with either a BarID or a null, 
 and a table of Bars with an isBaz? column, and a table of Bazzes with an 
 isQuux? column, and then a need to do joins on *all* of those tables to run 
 a query over a subset of Quuxes and have access to some Foo table columns 
 in the results.
  
 This sort of thing points towards an object database more than any other 
 sort, with inherited fields from superclasses, or a map database that 
 performs well with lots of null/missing keys in most of the maps. But maybe 
 a relational DB table with very many columns but relatively few used by any 
 given row would perform OK.


 The only kind of object database that does ACID across documents on the 
 JVM I know of is Tinkerpop' Blueprints. Blueprints is an abstraction layer 
 on top of many graph databases among which Neo4j an OrientDB. The 
 difference between a graph database and an object database is that 
 «pointers» in a graph database are known at both ends. If you don't know 
 graph you will need to learn a bit of it. Basicaly, if A is connected to B, 
 B knows also about A being connected to it, which is not the case with a 
 pointer. Otherwise said, like in relationnal database, you can ask for «all 
 things connected to B» or «all things B connects to». The same query in an 
 object database will cost more. On top of that it's schemaless, like an 
 object database, but there is no notion of class, similar to what is found 
 OO programming (even if you can model the graph to have the concept of 
 classes).
  


 The DB must be able to grow larger then available RAM without crashing 
 the JVM and the seqs resulting from queries like the above will also need 
 to be able to get bigger than RAM.
  
  

 My own research suggests that H2 may be a good choice, but it's a 
 standard SQL/relational DB and I'm not 100% sure that fits well with the 
 type of data and querying noted above. Note though that not all querying 
 will take that form; there'll also be strings, uuids, dates, and other 
 such 
 field types and the need to query on these and to join on some of them; 
 also, to do less-than comparisons on dates.


 Depending on your speed needs and the speed of the database, a kv store 
 can be enough, you serialize the data as strings and deserialize it when 
 you need to do computation. Except that kv store are not easy to deal with 
 when you have complex queries, but again it depends on the query.


 I expect they'd also have problems with transactional integrity if, say, 
 there was a power cut during an update. Anything involving serialize the 
 data as strings sounds unsuited to either the volume I'm envisioning or 
 the need for consistency. It certainly wouldn't do to overwrite the file 
 with half of an updated version of itself and then lose power! Keeping the 
 previous version around as a .bak file is scarcely much better. It pretty 
 much needs to be ACID since there will need to be coordinated changes to 
 more than one bit of the data sometimes and having an update interrupted 
 with only half the changes done, and having it stay in that half-done 
 state, would potentially be disastrous.


 At least unqlite is a embeddable kv store that is ACID across several 
 keys, you won't have data cut in half (based on what is  advertised), I 
 think berkley db is also transactional.

 Also I'm interested only in opensource software so there might be 
 proprietary softwares that solve you problem best, but I doubt that ;)


-- 
-- 
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

Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Zack Maril
One of the reasons I program is because I'm furious. 

By most accepted metrics, I went to one of the best technical public high 
schools in the country. I was average there and I was taking graph theory 
and multivariable calculus as a senior my last semester. The smart kids 
though? They were doing real analysis, topology, and winning international 
competitions for mathematics and science. I'm just finishing up college now 
and I'm watching the geniuses from my high school go from MIT and Stanford 
to high frequency trading firms or work for places like palantir and 
facebook. They're using their gifts to remove liquidity from the 
markets[0], to help fight wars based on lies[1], and to maximize the amount 
of money they can sell my privacy for[2]. Most of them use programming to 
indirectly decrease the quality of my life. I'd love it if I could invest 
money without fear of the markets going crazy because of a tweet[3], if I 
could support the government without worrying about them killing innocent 
citizens[4], and if I could connect with my friends and family without 
worrying about my privacy being sold to the highest bidder. My former 
classmates are and will be using computers to indirectly prevent me from 
doing the above with any sort of peace of mind. It is infuriating. 

When I sit down to program, I now make a conscious effort to build tools 
that I can use in the future to fight against the trends above. I use 
Clojure because it's the language I've been able to get the most done in 
the shortest amount of time. If there were a language that let me do as 
much as fast, I'd drop Clojure like a rock and learn that. If I want to 
stem the negative effects the geniuses are having on my life, I'll need to 
use the best tools possible. That means constantly learning more powerful 
concepts and building better tools. I've been on a graph theory and network 
science kick lately because I noticed that google, palantir, and facebook 
got where they are by virtue of being really good at graph theory. The 
concepts are crazy powerful and provide immense power to the people who can 
successfully employ them. 

So, when I sit down to work on certain projects, the main motivating factor 
for me is that I'm furious that my classmates are worsening my life. 
There's a ton of work that I need to do before I can do anything about it 
though. I'm obviously on a futile crusade fueled by my youth and naiveté, 
but for the moment, that's why I program.  
-Zack

[0] http://www.nanex.net/aqck2/4136.html
[1] http://krugman.blogs.nytimes.com/2013/04/27/the-great-degrader/
[2] https://www.facebook.com/legal/terms
[3] 
http://seekingalpha.com/article/1362731-obama-is-dead-tweet-makes-for-flash-crash
[4] 
http://www.latimes.com/news/opinion/editorials/la-ed-drones-policy-obama-koh-20130513,0,4160911.story

On Monday, May 13, 2013 11:35:33 PM UTC+4, Erlis Vidal wrote:

 Let me share this tale with you guys, hope you like it as much as I do: 

 It is said that Socrates met a worker who asked: what are you doing good 
 man? Don't you see I'm cutting a stone to earn my salary and so I can eat
  the worker replied. He moved on and later found another worker 
 questioning the same way as the previous one, he replied I'm building a 
 wall, continued Socrates finding their way to a third worker, also 
 questioning, the answer was I'm building a beautiful palace 


 On Mon, May 13, 2013 at 2:17 PM, Timothy Baldridge 
 tbald...@gmail.comjavascript:
  wrote:

 I doubt I'm unique in this area, but for me, programming is a drug. I 
 have to code, or the ideas and thoughts build up in my mind. For me, 
 actually writing down and implementing these is a stress relief. Just ask 
 my parents when I was growing up, or my wife today. Keep me in a room 
 without a computer for a week, and I'll start writing code on paper just to 
 get the thoughts down.

 So I guess you could say I'm an addict.

 Timothy Baldridge 


 On Mon, May 13, 2013 at 12:09 PM, Ulises ulises@gmail.comjavascript:
  wrote:

  Code that matters is code that's used by other people. For me 
 personally
  the ability to share my code with others is the thing that makes
  programming worth doing in the first place.

 This is a rather important point. One of the most asked questions
 (random made up fact) by newcomers to a language is what can I code?
 what open source programs can I help?. All with the aims of getting
 better acquainted with the language itself and, hopefully, helping
 others. I normally direct people to Advice to Aimless, Excited
 Programmers (http://prog21.dadgum.com/80.html). For those who'd rather
 read the rest of this email, the tl;dr version is: got scratch your
 own itch, you might be building an itch-scratcher for others.

 The real question now becomes (at least for me): how do you know when
 an itch is worth scratching? how do you know it's a shared itch?

 I've seen more experienced programmers immediately recognise what'd be
 useful at 

Re: [ANN] Clojars policy change

2013-05-13 Thread Zack Maril
Is the policy for SNAPSHOT artifacts still that you can overwrite as much 
and as often as you want?
-Zack

On Tuesday, May 14, 2013 3:30:19 AM UTC+4, Phil Hagelberg wrote:


 Phil Hagelberg writes: 

  In the aftermath of the recent Linode intrusion[1][2], we determined 
  that Clojars' policy of allowing artifacts to be overwritten[3] makes it 
  much more difficult to detect an attack than it would be if artifacts 
  were immutable like they are in most other repositories. 

 I've rolled this back briefly due to a bug surrounding deploying 
 SNAPSHOT versions over scp. 

 -Phil 


-- 
-- 
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: link for clojure programs

2013-05-06 Thread Zack Maril
Once I had really cut your teeth on the introductory materials, I found 
that reading parts of the Clojure source code can be helpful. 

https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj
This one file defines over half of the functions you'll be working with day 
to day. There are patches of code here and there that are very readable and 
patches that are still way beyond me. No matter what my skill level has 
been, every time I open that file up I learn something new about the 
language, whether it is a new function, a new language feature, or just a 
new way of thinking about how to implement certain ideas. It's not the 
right way to get started today, but reading the source has been one of the 
ways I've felt I've leveled up with Clojure the fastest.
 
-Zack

On Monday, May 6, 2013 8:45:27 PM UTC+4, Mimmo Cosenza wrote:

 In some way, what we miss is a book on co-recursion (the dual of 
 recursion). In my experience in teaching clojure to mathematicians, they 
 very naturally get co-recursion, because they really know how to be elegant 
 and concise. 

 Is there any very good online resource on co-recursion with clojure?

 thanks

 Mimmo



 On May 6, 2013, at 5:03 PM, Niels van Klaveren wrote:

 +1 to Clinton's advice. If anything, SICP et al teach the wrong habits fo 
 working with Clojure.

 Christophe Grand, one of the authors of the aforementioned Clojure 
 Programming http://www.clojurebook.com/book, held a great presentation 
 called You aren't gonna need 
 ithttp://www.ehrdclj.org/files/27-March-2013-cgrand-YAGNI.pdf 
 at the first meetup of the The Hague/Rotterdam Clojure group. In it he gave 
 some solid advice what you should concentrate on (and what not) when 
 learning Clojure.

 Learning the core (higher order) functions of Clojure is paramount, and I 
 found working through the 4clojure problems http://www.4clojure.com/ a 
 great way to the rationale behind and working with them.  

 If you need practical help with setting up your Clojure development 
 environment, or other indepth tutorials for specific parts of the language, 
 clojure-doc.org is great. It lacks a bit in overview, and hasn't got the 
 narrative qualities of a book for guiding you from one subject to another 
 though, so I'd recommend one of 
 themhttp://clojure-doc.org/articles/ecosystem/books.htmlas well.

  Clojuredocs.org is great as cheat-sheet and for short examples.

 my experience, being inculcated with Scheme will make your Clojure 
 code look insane, as idiomatic Clojure (insomuch as there is such a 
 thing) doesn't have functions nested with a butt-load of anonymous 
 functions. 

 http://clojure-doc.org is great and you should go there first. Don't 
 freak out about your environment just yet. Use whatever you use now, 
 and if you're lucky enough to use Vim or Emacs, it'll work for the 
 future, too. 

 Clojure Programming is, in my opinion, the best book out there right 
 now for Clojure. Check it out if you get the chance. 

 Do not rush into refs, atoms, agents, or any of that stuff. Just right 
 some simple code, learn it, and then expand. I've been writing Clojure 
 code for about 15 or so months, with the last six being every day 
 professionally and I still have never created a protocol. 

 Good luck! Clojure is no harder than Python, C#, or whatever you come 
 from, and is totally rewarding. Learning it will be a pleasure. 

 Best, 
 Clinton 


 On Mon, May 6, 2013 at 6:11 AM, Catonano cato...@gmail.com wrote: 
  2013/5/4 nre...@yahoo.com nre...@yahoo.com 
  
  Can anybody give me a link/websites of codes for BEGINNERS FOR 
 CLOJURE? 
  thanks a lot... 
  
  
  There are tons of resources on line. 
  
  But in my experience, the famous MIT course  with Abelsson and Sussman 
 is a 
  must. It´s about Scheme, not Clojure, but it´s important anyway. 
  
  There is also a course on youtube on Scheme by another professor, from 
  Stanford. That can be important too. 
  
  Then, you have to set up an enviroinment. That´s not a subtlety, it´s a 
 main 
  concern. 
  
  As for that, I strongly suggest the Peepcode footage about Emacs and 
 then 
  live-emacs ( https://github.com/overtone/emacs-live ) 
  
  On my shameful github account I have a little watered down game life 
 with a 
  little visual layer made with Quilt. So you can see your bot filling 
 square 
  tiles according to your strategy. 
  
  It was an exercise from the lambda-next clojure training event. I´m not 
 sure 
  about its license but I don´t think the guys are gonna object ;-) 
  
  It uses refs and can be a good first step in learning. The 
 multithreading 
  stuff is specific to Clojure on the Jvm, I think. It has no readme file 
 but 
  I could give you a couple of directions in order to have it up and 
 running. 
  
  That´s all comes to m mind at the moment ;-) 
  
  Bye 
  Catonano 
  
  -- 
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this 

Re: ANN Titanium 1.0.0-beta1 is released

2013-05-02 Thread Zack Maril
Michael is being far too kind. We've already had multiple people from the 
Clojure community opening issues and pull requests on all three of the 
graphy projects.  Thank you all! On the flip side, if you are interested in 
getting started with (or getting involved) with these projects, shoot me an 
email and I'll find a juicy morsel or issue for you to work on. I've got 
more cool and interesting ideas to work on than I can handle right now and 
I'm always happy to help people get started. I'm trying to take care of the 
dirty API/documentation work so you can focus on doing all the cool stuff.
-Zack

On Thursday, May 2, 2013 10:24:37 PM UTC+4, Michael Klishin wrote:

 Titanium [1] is a Clojure graph library built on top of Aurelius Titan.

 1.0.0-beta1 is a major development milestone that upgrade Titanium to 
 Titan 0.3,
 extracts Blueprints graph operations into a separate library (Archimedes) 
 and
 switches Titanium to Ogre [2] for graph querying. This release has major 
 public API changes.

 Archimedes and Ogre also matured quite a bit since the last Titanium 
 release.

 Release notes:

 http://blog.clojurewerkz.org/blog/2013/05/02/titanium-1-dot-0-0-beta1-is-released/

 I'd like to thank Zack Maril for his hard work on Titanium, Archimedes and 
 Ogre.
 Clojure shapes up to be a great ecosystem for data processing and graph 
 analysis
 in general, in large part thanks to his efforts!

 1. http://titanium.clojurewerkz.org
 2. http://ogre.clojurewerkz.org
 -- 
 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.




Re: [GSoC 2013] core.logic CLP(Prob)

2013-04-24 Thread Zack Maril
Lately, I've been on a bit of a jag into probabilistic programming with 
Clojure, specifically embedding Church inside of Clojure. The results so 
far are promising from a syntactic level, but, like David said, getting it 
to actually work is another matter entirely. I wanted to share what I've 
been able to get working so far and some of the potential challenges of 
embedding Church in Clojure. 

https://gist.github.com/zmaril/5447488

The above gist is a self contained Clojure program that implements, among 
other things, `query-by-rejection` and `flip`. With these two functions, we 
can already do most of what Church seems to do. What's missing from 
a functionality standpoint is support for various distributions and some 
useful functions related to tolerance (and, of course, a good MCMC/Gibbs 
implementation). What's been gained is, via some careful macro writing, the 
ability to reuse code, specifically to reuse memoized functions. 

One of the key ideas behind Church is that memoization allows one to 
express complicated scenarios very concisely. So, to code up a randomized 
persistent trait (like a person's eye color), you simply define a memoized 
function that takes in a person and returns their eye color. Every time a 
new world is generated, the memoized function gets recreated. But within 
the world (or current experiment), the trait persists and can be referenced 
again in various places without too much hassle.  Note that a new memoized 
function must be created for each experiment, i.e. you can't just memoize 
the function outside the query and bring that back in. Within the gist 
above, binding is used to carefully rebind any function provided in the 
:memobound clause for each experiment. By declaring a var to be dynamic, we 
can write queries that are pretty short but all rely on the same logic. 
From a syntactic standpoint, it took about one evening of work to cut down 
the length of most of the Church examples by at least half. 

From a speed standpoint, Church is way, way ahead of the above. Sampling 
via rejection is quite slow compared to modern methods like MCMC or Gibbs. 
It might not even be possible to do the dynamic rebinding of memoized 
functions mentioned above and get as fast as Church is. I really don't 
know. Here's one of the first papers on Church:
http://www.stanford.edu/~ngoodman/papers/churchUAI08_rev2.pdf

The paper is about five years old now, but section 4.1 goes into how Church 
was first implemented with a MCMC. The key idea they introduce here is the 
computation trace. I won't try to summarize it here because I don't fully 
understand it yet. If it means what I think it means though, then it should 
be possible to build and keep track of the computation trace thanks to the 
JVM and Clojure. My intuition says that a very dedicated student could 
probably produce a Clojure library to catch Church in terms of speed by the 
end of the summer, simply by emulating what they have done and letting pmap 
take care of the rest.  
-Zack

On Wednesday, April 24, 2013 12:48:56 AM UTC+4, David Nolen wrote:

 On Tue, Apr 23, 2013 at 2:10 PM, Radosław Piliszek 
 radzi...@gmail.comjavascript:
  wrote:

 1) Is this place the best to discuss this?


 Yes.
  

 2) Are there some set goals that CLP(Prob) should achieve? (,,Basic 
 support of CLP(Prob).'' does not express it too well! :-P )


 This seems like a pretty challenging one as there are a variety of 
 possible approaches. Basic support for CLP(Prob) could very well mean 
 *several* prototypes. That said the probabilistic Prolog variants are 
 probably worthy of the most study as core.logic is closest to that model.
  

 3) Is there any API sketch that should be followed? Is it still yet to be 
 discussed? And, most importantly, how would you see CLP(Prob) fit in 
 core.logic's ecosystem?


 There is no API sketch. It's extremely important to survey the links, try 
 out existing implementations, assess their advantages / disadvantages and 
 devise a syntax (or several) that works reasonably well with what we've 
 already established in core.logic. 

 Of the projects listed this is probably the most experimental and 
 research-y. I think if anyone seriously wants to take this on they have to 
 be extremely focused / self-directed and be willing to put in a 
 *considerable* amount of time. I'm of course willing to help in whatever 
 way I can as far as implementation  integration approach - but it will be 
 a big learning experience for me as well!

 David


-- 
-- 
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 

Re: Hacker News, Clojure, and GSOC

2013-04-18 Thread Zack Maril
Some fun facts:
1. You could probably get a full history of Hacker News by carefully 
crawling the HNSearch API[0]. Chronically crawling the new page for links 
would allow you to stay in synch with Hacker News proper, and a monthly 
refresh of the data would probably be smart to hit anything you might miss. 
2. The source code for an early version of Hacker News has been floating 
around, distributed with Arc if I remember correctly. From PG's comments, 
the main updates to the site has mainly been dealing with spammers and 
voting ring detection.

Combining the two together, it is quite possible to make a read-only 
version of hacker news with a full history and proper linking. Most of the 
changes have been made only to the write only sections. So, it would be 
pretty straightforward to clone hacker news and keep it cloned if you throw 
out the write parts. Additionally, if you got the lag for updates down 
below a few seconds, you could piggyback off hacker news and just redirect 
submissions and comments there (you could even really tricky with an iframe 
if that tickles your fancy). In that manner, you could clone the 
functionality of hacker news with a full history. It seems like this 
wouldn't even really take a whole summer to do. Maybe a week of 
concentrated effort, depending on how fast you can pull down the data from 
the API and how well you understand your stack.

-Zack

[0] https://www.hnsearch.com/api

On Wednesday, April 17, 2013 5:13:19 PM UTC+4, Stuart Sierra wrote:



 On Wednesday, April 17, 2013 3:27:59 AM UTC-4, da...@axiom-developer.orgwrote:

 Does anyone know anyone associated with Hacker News? 
 Can we clue them into immutable data structures? 


 I know that Hacker News is mostly written by Paul Graham in Arc [1], his 
 personal dialect of Lisp. As such, it's unlikely anyone will be able to 
 convince him to switch to Clojure. :)

 P.G. recently wrote an article [2] about how he broke the site when 
 manipulating the production database from the REPL.

 -S

 [1]: http://paulgraham.com/arc.html
 [2]: https://news.ycombinator.com/item?id=5239673


-- 
-- 
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.




Ogre, a Clojure library for querying graphs

2013-03-16 Thread Zack Maril
Gremlin is a java library that lets you query graphs (real mathematical 
graph theory graphs): 
https://github.com/tinkerpop/gremlin/wiki

Ogre is a library that wraps Gremlin up all pretty like: 
https://github.com/zmaril/ogre

OgreDocs is a website that documents just how pretty Ogre is: 
http://ogredocs.com

There's still a lot to be done with the project, but it exists and doesn't 
seem to suck. I hope you like it.
-Zack

-- 
-- 
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.




Bumi, a project for loading a git repo into a Titan graph database

2013-02-21 Thread Zack Maril
https://github.com/zmaril/bumi

Bumi loads a git repo into a Titan graph database[0]. You can then ask 
questions about the history of the project with Faunus[1]. I've 
successfully loaded the Linux kernel onto an AWS instance. I'm working now 
to start asking good questions and see if I can't find out anything neat. 
Any suggestions about paths of investigation to pursue would fall on open 
ears. I'm open sourcing this now in case anybody wants to play around with 
it. In theory, it should work with any git repo. In practice, I've only 
tested it on the Linux kernel so far. It's written in Clojure, using 
Hermes[2]. 

-Zack

[0] http://thinkaurelius.github.com/titan/ 
[1] http://thinkaurelius.github.com/faunus/
[2] https://github.com/gameclosure/hermes

-- 
-- 
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: Bumi, a project for loading a git repo into a Titan graph database

2013-02-21 Thread Zack Maril
codeq looks fantastic and I've looked into using it before. The project 
seems to have undergone a flurry of activity last October/November and then 
nothing has really happened with it since then. I haven't seen anybody 
actually do anything impressive with it, so I decided to write Bumi 
instead. If you can point me towards an example of someone doing something 
nontrivial with the project, then I'd happily reconsider starting another 
code analysis project in clojure. codeq looks fantastically powerful from 
the outside, but nobody has done anything yet with it that would actually 
exhibit this perceived power. Which worries me, since if it were so 
powerful, somebody would have easily done something neat with it by now and 
talked about it. The lack of results implies to me that it might not be as 
powerful or useful as people say. 
-Zack

On Thursday, February 21, 2013 8:19:59 PM UTC+4, Rich Morin wrote:

 On Feb 21, 2013, at 08:00, Zack Maril wrote: 
  Bumi loads a git repo into a Titan graph database[0]. You can then ask 
 questions 
  about the history of the project with Faunus[1]. I've successfully 
 loaded the 
  Linux kernel onto an AWS instance. I'm working now to start asking good 
 questions 
  and see if I can't find out anything neat. Any suggestions about paths 
 of 
  investigation to pursue would fall on open ears. ... 

 Rich Hickey's Codeq project 

   http://blog.datomic.com/2012/10/codeq.html 

 extracts both metadata and code quanta (semantically meaningful code 
 snippets) 
 from Git repos.  This allows it to answer questions about (say) code churn 
 and hot 
 spots in terms of individual functions, etc.  It also (implicitly) opens 
 the door 
 to other information sources (eg, dynamically harvested metadata).   

 I would urge you to consider (a) what can be learned from Codeq and (b) 
 whether 
 any sort of cooperation and/or interoperability might be possible. 

 -r 

  -- 
 http://www.cfcl.com/rdmRich Morin 
 http://www.cfcl.com/rdm/resume r...@cfcl.com javascript: 
 http://www.cfcl.com/rdm/weblog +1 650-873-7841 

 Software system design, development, and documentation 




-- 
-- 
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: abstraction on two libraries

2013-02-13 Thread Zack Maril
To do that from scratch would probably be pretty hard and not worth the 
effort. It would be an interesting learning experience, but for building 
something significant, I would recommend selecting one of the libraries and 
just sticking with that one at first. Hermes and Titanium are both wrappers 
around Titan, so they should in theory play nice, but I cannot make 
any guarantees about that. Effectively, you would be creating a third 
library wrapping two wrappers. 
-Zack


On Wednesday, February 13, 2013 8:30:06 PM UTC+4, AtKaaZ wrote:

 Hi.
  Suppose you want to make an abstraction on top of two similar but 
 different libraries (hermes and titanium), so that I could switch between 
 using either of them(or both of them) at compiletime or runtime, how would 
 you do something like that?

 Thanks.

 -- 
 Please correct me if I'm wrong or incomplete,
 even if you think I'll subconsciously hate it.

  

-- 
-- 
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: ANN Titanium, a Clojure library on top of Titan

2013-02-12 Thread Zack Maril
Primary author of Hermes here. We've put a fair amount of work into getting 
transactions right from the very beginning. 

Try reading: 
https://github.com/gameclosure/hermes/wiki/Transaction-Management
And:
https://github.com/gameclosure/hermes/wiki/Opening-graphs

I'm working on a project now that might require adding support for 
BatchGraph to hermes (if it doesn't exist already with 
hermes.core/with-graph). If you have any questions or comments, 
don't hesitate to reach out. 

As far as compare and contrast goes, philosophically, it seems that both 
libraries started from two very different places. Titanium was written 
after the authors had already written neocons, a great wrapper around the 
rest endpoint of neo4j. They say that they would like to roughly match the 
functionality of titanium with neocons. In the documentation for titanium, 
they suggest that right now, for production graphs, you should go use 
neocons/neo4j instead. I can't speak much more to the development of the 
library because I didn't develop it and didn't know it existed until 
yesterday.

Hermes was written relatively from scratch. There were some other libraries 
floating around that sort of paired Clojure with Titan, but none of them 
were much more than somebody's monthlong fascination with a new open source 
project. So, I was learning the in's and out's of Titan, writing a library, 
and trying to get it into production as fast as possible all at once. We 
put (probably too much) thought into managing transactions. This let us 
build hermes.core/transact! and hermes.core/retry-transact! easily, both of 
which greatly simplify working with transactions. We added in methods for 
making updating the database as easy as possible, hermes.vertex/upsert! and 
hermes.edge/upconnect!. We have a pretty solid test suite at this point. 
I'd feel comfortable telling somebody to put it into production, with the 
normal caveat that goes with any software that hasn't hit a stable 1.0.0, 
things will break and only a few people in the world will know why. 

From a philosophical standpoint, I'm not comfortable with the idea that an 
API written to wrap a REST endpoint should serve as inspiration for the API 
to wrap the in process interactions with the database. Before writing 
hermes, I used neocons for a month or so and making titanium gracefully 
match seems like a tough feat to pull off. But if anybody can do it, I'm 
sure the ClojureWerkz team can. I've tried to resist talking about hermes 
too much when titanium has come up, mostly to let them have some breathing 
room and because I've been quite busy with my own Titan project as of 
late[0]. I recommend you try out both libraries and see which one best fits 
what you want to build. 

So, in summary, quid pro quo, two libraries enter, one library leaves, 
postgres probably already does what you want.
-Zack 

[0] The project loads git repo's into Titan for analysis via Faunus. I've 
got it loading up the linux kernel on an ec2 instance right now. I'm able 
to ask a variety of questions via Faunus. Still reworking it to load repo's 
quickly and use Titan the right way for the size of the graphs likely to be 
encountered. I expect it will be formally announced once I figure out some 
neat things about the linux kernel. 

On Wednesday, February 13, 2013 12:16:15 AM UTC+4, AtKaaZ wrote:

 I did not look at hermes, wasn't aware of it, but I'll look, thanks.


 On Tue, Feb 12, 2013 at 8:56 PM, Jeroen van Dijk 
 jeroentj...@gmail.comjavascript:
  wrote:

 Looks interesting. I'm just wondering if you had a look at hermes [1], 
 and if so, how is it different?

 [1] https://github.com/gameclosure/hermes


 On Tue, Feb 12, 2013 at 6:39 PM, AtKaaZ atk...@gmail.com 
 javascript:wrote:

 is there a way to use nested transactions, yet? 
 I am looking at [1] and [2]

 [1] 
 https://github.com/thinkaurelius/titan/wiki/Multi-Threaded-Transactions
 [2] https://github.com/tinkerpop/blueprints/wiki/Graph-Transactions



 On Mon, Feb 11, 2013 at 6:37 PM, Michael Klishin 
 michael@gmail.comjavascript:
  wrote:

 Titanium [1] is a Clojure graph library that is built on top of  Titan 
 [2].
 It combines a Clojure-friendly API and graph processing DSL with the 
 power of Titan.

 Full announcement and more details:
 http://blog.clojurewerkz.org/blog/2013/02/11/introducing-titanium/

 1. http://titanium.clojurewerkz.org
 2. http://thinkaurelius.github.com/titan/
 -- 
 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 clo...@googlegroups.comjavascript:
 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 javascript:
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this 

Re: How to Process Files in Background

2013-02-11 Thread Zack Maril
Is there any reason why a future wouldn't work? 
http://clojuredocs.org/clojure_core/clojure.core/future
-Zack

On Monday, February 11, 2013 8:50:03 PM UTC+4, Ari wrote:

 Hi, 

 I'd like my web application to process uploaded text files in the 
 background; in which ways can I accomplish this? I thought of using a 
 message queue like 0mq to push jobs to workers within the web app itself. 
 While relatively straight forward this option seems a bit involved. 
 Suggestions/recommendations appreciated.

 Best,
 Ari 


-- 
-- 
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: How to read a txt file?

2013-02-01 Thread Zack Maril
Look at slurp. 
http://clojuredocs.org/clojure_core/1.2.0/clojure.core/slurp

On Friday, February 1, 2013 4:17:43 PM UTC+4, Roger75 wrote:

 I'd like to read a txt file using clojure. How do I do that? Any examples?

-- 
-- 
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: How to solve Collatz Conjecture problem for huge numbers using clojure parallelism tricks?

2013-01-31 Thread Zack Maril
Take a look at this gist:
https://gist.github.com/4688693

It uses memoize to eek out a little bit more performance.
λ ~/Projects/experiments/collatz  lein run
Compiling collatz.core
[9 19]
Elapsed time: 30.236 msecs
[97 118]
Elapsed time: 5.532 msecs
[871 178]
Elapsed time: 22.529 msecs
[6171 261]
Elapsed time: 114.061 msecs
[77031 350]
Elapsed time: 578.955 msecs
[837799 524]
Elapsed time: 3686.937 msecs
[8400511 685]
Elapsed time: 40478.64 msecs

On my machine it is usually significantly faster than when I run the 
provided code:
λ ~/Projects/experiments/collatz  lein run
Compiling collatz.core
{:n 9, :count 19}
Elapsed time: 22.024 msecs
{:n 97, :count 118}
Elapsed time: 6.838 msecs
{:n 871, :count 178}
Elapsed time: 56.313 msecs
{:n 6171, :count 261}
Elapsed time: 293.266 msecs
{:n 77031, :count 350}
Elapsed time: 962.113 msecs
{:n 837799, :count 524}
Elapsed time: 9529.107 msecs
λ ~/Projects/experiments/collatz  lein run
Compiling collatz.core
{:n 9, :count 19}
Elapsed time: 28.077 msecs
{:n 97, :count 118}
Elapsed time: 8.1 msecs
{:n 871, :count 178}
Elapsed time: 31.023 msecs
{:n 6171, :count 261}
Elapsed time: 144.956 msecs
{:n 77031, :count 350}
Elapsed time: 944.857 msecs
{:n 837799, :count 524}
Elapsed time: 10030.467 msecs
{:n 8400511, :count 685}
Elapsed time: 113490.494 msecs

Of course, there is a bunch of optimizations you can take mathematically:
http://en.wikipedia.org/wiki/Collatz_conjecture
-Zack
On Friday, February 1, 2013 4:29:53 AM UTC+4, Leandro Moreira wrote:

 The problem is known as Collatz Conjecture (also 3n + 1 conjecture).
 Basically given a n number then you apply the following rule.

 If n is even then n/2 otherwise 3 * n + 1, you keep applying this until you 
 reach the number 1.
 For instance, starting with *n = 6*, one gets the sequence 6, 3, 10, 5, 16, 
 8, 4, 2, 1. (with *8 items*)

 Now the challenge tell the *n* with n descending from 100 to 1 and with 
 the *greater number of items*.

 Then I did the program bellow (I'm very happy for feedback since I'm totally 
 noobie to clj), but it takes forever, there is anyway to make it fast?

 (defn- apply-collatz-conjecture 
   Given n, it returns n/2 if it's even or n*3+1 if it's odd.
   [n]
   (if (even? n)
   (/ n 2)
   (+ (* 3 n) 1)))
  
 (defn- collatz-conjecture-seq
   Given n, it returns the sequence of collatz-conjecture.
   [n]
   (loop [n n sequence []]
   (if (not= n 1)
   (recur (apply-collatz-conjecture n) (cons 
 (apply-collatz-conjecture n) sequence))
   (reverse sequence
  
 (defn- collatz-conjecture-number-of-items
   It returns a map with n and number of items on its collatz-conjecture 
 sequence.
   [n]
   { :n n :count (count (collatz-conjecture-seq n)) } )
  
 (defn- greater 
   Given x and y, it returns the element with greater count.
   [x y]
   (if ( (:count x) (:count y))
   x
   y))
  
 (defn n-with-more-items
   Given n, it applies collatz-conjecture for the range 1..n 
   and return the n with more items.
   [n]
   (reduce greater (pmap collatz-conjecture-number-of-items (range 1 n


 The only thing I thought was use pmap but it didn't make it super fast.

 *Using only map*
 user= (time (n-with-more-items  99))
 Elapsed time: *21191.762883 msecs*
 {:n 837799, :count 524}

 *Using pmap*
 user= (time (n-with-more-items  99))
 Elapsed time: *13230.919979 msecs*
 {:n 837799, :count 524}

 Any thoughts on how can I apply parallelism to solve this (especially on 
 my frustrate try of use map and reduce)?


-- 
-- 
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: ANN: rewryte.com uses clojure for automated writing feedback

2013-01-27 Thread Zack Maril
What file format does this take? I tried pdf and it barfed. 

On Monday, January 28, 2013 1:04:31 AM UTC+4, Ron Toland wrote:

 It's been eight months in the making, but rewryte.com is live! 

 We're using Clojure on the back-end for all our data processing. Our goal 
 is to provide quick, automated feedback on your writing. 

 We're in public beta, so please check us out and let us know what you 
 think! 

 Ron Toland

-- 
-- 
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: Blog Post: The Magic of Macros: Lighting-Fast Templating in ClojureScript

2013-01-26 Thread Zack Maril
That was seriously impressive, in terms of performance and simplicity. Way 
to go! Thanks for writing that up.
-Zack

On Tuesday, January 22, 2013 1:45:34 PM UTC-5, Aria Haghighi wrote:

 Hi all,

   I've done a follow-up post on the Prismatic blog about our dommy, our 
 ClojureScript templating library. We added some macros to parse nested 
 vector data structures at compile time
 into direct DOM creation code. The resulting speedup is pretty dramatic 
 about 5x, bring ClojureScript templating to roughly 3x faster than a jQuery 
 baseline. This is a trick I know Hiccup and some other libraries do but I 
 thought it might be worth document/explaining this kind of application of 
 macros. 


 http://blog.getprismatic.com/blog/2013/1/22/the-magic-of-macros-lighting-fast-templating-in-clojurescript

 Thanks, Aria


-- 
-- 
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




[ANN] Hermes, wrapper around Titan (0.2.2)

2012-11-20 Thread Zack Maril
Ma chere Mailing List, it is with deepest pride 
and greatest pleasure that we email you tonight. 
And now we invite you to relax, let us pull up 
a chair as Game Closure http://gameclosure.com/ proudly presents - 
Hermes https://github.com/gameclosure/hermes!

Be our guest! Be our guest!
Put our library to the test!
Titan is a wonderful new graph 
databasehttp://thinkaurelius.github.com/titan/[0], 
cherie
And we'll provide the rest.
Transactions du jour,
Hot upserts,
Why, we only live to serve
Try upconnect! 

Hermes is auspicious!

Don't believe me? Ask the 
testshttps://github.com/gameclosure/hermes/tree/master/test/hermes
They can sing, they can dance[1]
After all, Miss, this is Game Closure!
And a project here is never second best
Go on, and open up the source
Take a glance and then you'll
Be our guest
Oui, our guest
Be our guest!

---

A few weeks ago, we got really excited when we realized we could write
a wrapper around Titan in Clojure. And so, after some polish, we've
open sourced Hermes. Hermes provides access to smart transaction
management and classic operations like upsert and upconnect. The test
suite exists (yay!) AND covers most aspects of the library so far.
Documentation is admittedly sparse, but should rapidly improve within
the next few weeks. It's a blast to work with and lets you build some
great systems quite quickly[2].

And so. 

Be our guest! 
Be our guest! 
Be our guest! 
Please, be our guest!
-Zack Maril

[0] Actually, I think it is a transactor like Datomic, but it's easier to 
say database. 
[1] May depend upon your definition of sing and/or dance. 
[2] If you like working with Clojure, graph databases, or puppies you 
should really send me email and introduce yourself (z...@gameclosure.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

Re: [ANN] Hermes, wrapper around Titan (0.2.2)

2012-11-20 Thread Zack Maril
Dependency information has been added. Thank you! 

The documentation will go more into this, but the example is showing how to 
get started with transaction management. Hermes has a very strict way of 
dealing with transactions (it will throw errors if you aren't using it as 
intended). If you get an Titan object back from a transaction, then you 
must use the vertex or edge refresh methods first before being able to use 
that object within another transaction.  The defs were used to show how to 
keep an object around and then reuse it later on in a different 
transaction. The forthcoming docs will explain all of this. Thank you for 
the feedback! 
-Zacm

On Tuesday, November 20, 2012 9:30:19 PM UTC-8, Michael Klishin wrote:

 2012/11/21 Zack Maril thewi...@gmail.com javascript:

 Documentation is admittedly sparse, but should rapidly improve within
 the next few weeks.


 There is no dependency/installation information in the README.
 Please add it or beginners won't be able to use your library.

 If you need an example:
 https://github.com/michaelklishin/welle#maven-artifacts

 I'd also recommend not using def in examples where a local will do.
 -- 
 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

Re: Documenting clojure data structures

2012-10-31 Thread Zack Maril
Not sure this is exactly what you are looking for, but clojure.reflect has 
been helping me a ton lately. I've written a few wrappers around it that 
I've found quite useful: 
https://gist.github.com/3990888
Hope this helps!
-Zack

On Wednesday, October 31, 2012 2:26:38 PM UTC-7, Paul deGrandis wrote:



 This sounds like a fantastic approach.  Do you have any of your thoughts 
 of how the spec would look like publicly available?  (or maybe a github 
 project) 


 It's not in the public currently but I'm hoping to have something together 
 for consumption by Conj (Nov 14th).

 At this time, the best supported approach is still protocols, membership 
 functions, contracts, generative testing, and comments - as stated earlier 
 in the thread.

 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

Re: maths, functions and solvers

2012-05-24 Thread Zack Maril
Off topic:
How hard would it be to build on 
core.logichttps://github.com/clojure/core.logic#corelogicto do math 
functions? 
-Zack

On Thursday, May 24, 2012 9:30:12 PM UTC-2, Stephen Compall wrote:

 On May 24, 2012 8:42 AM, jlk lachlan.kana...@gmail.com wrote:
  However the only way I can think of converting the argument list and the 
 function into a function of one argument is with an intermediate function.

 Apply is the standard way to listify a function's arguments.  Where f is a 
 function taking n args, (partial apply f) is a function taking (among other 
 disjoint possibilities) one arg being a list of n values.

  (defn -cat
example math function
[{:keys [E A alpha t2 t1 W1 W2 g L T1 T2]}]
(- (+ (* E A alpha (- t2 t1)) (/ (* (sq W1) (sq g) (sq L) E A) (* 24.0 
 (sq T1))) T2) T1 (/ (* (sq W2) (sq g) (sq L) E A) (* 24.0 (sq T2)

 Take a look at (meta #'-cat) in this example; you may find it of use.

  As a side note, being able to define functions in infix would also be 
 nice, but I don't feel up to creating a maths parser and dealing with ASTs, 
 although I can visualise how I might manage the variables using this 
 approach.

 If you parse Clojure lists, this reduces to a problem of grouping and 
 flipping back to prefix.

 Traversable functors and the writer monad are good choices for collecting 
 vars as you are grouping and flipping, though you perhaps have something 
 else in mind.  The real trouble is discriminating between bound and free 
 vars.

 -- 
 Stephen Compall
 Greetings from sunny Appleton!


-- 
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: GSOC Idea: Interactive documentation with autodoc

2012-03-26 Thread Zack Maril
Here's one way of going about getting the bare bones for examples:

Simple examples with autodoc:
http://clojure-examples.herokuapp.com/clojure.core-api.html#clojure.core/+

The changes to autodoc required to make this happen:
https://github.com/zmaril/autodoc/commit/4cb3d7aa1079f0859b129469ea1163e306a1f5ef

Adding in metadata to the + function:
https://github.com/zmaril/clojure/commit/2d4902239d8595af74cf17264414a51128de639a

It sounds like the community has rejected the inclusion of examples in the
past. But, for reference, it's *really* easy to include examples and make
them work out of the box. You can just include whatever code you want and
eval it (no security/speed worries since it is static html you yourself
are compiling).
-Zack

On Mon, Mar 26, 2012 at 12:40 PM, Colin Jones trptco...@gmail.com wrote:

 One thing missing from reply's clojuredocs integration is the ability
 to have a local cache of the examples. Currently, we're just making an
 API call every time (using the clojuredocs-client library), which is
 great for getting off the ground and for having the latest examples,
 but not so great for offline work and speed.

 I talked very briefly about this at Clojure/West with Lee Hinman
 (author of clojuredocs-client) and Zack Kim (of clojuredocs fame), and
 it sounded like they're open to this idea and even have ideas about
 how it might work. I'm not sure whether it's big or interesting enough
 for a GSOC project, or even which projects would be involved, but it's
 certainly something I'd like to have.




 On Mon, Mar 26, 2012 at 9:09 AM, David Nolen dnolen.li...@gmail.com
 wrote:
  Zack,
 
  Having examples in the Clojure source has come up before and it's
 probably
  not going to happen. Also the repl-y project that is now integrated into
  lein 2 has this functionality. However I think you're on an interesting
  track as far as how Mathematica works. I don't think anyone has tackled a
  rich interactive REPL with good integrated graphics support (that is also
  interactive). I recall that Chas Emerick and others were interested in
 this.
 
  David
 
  On Sat, Mar 24, 2012 at 11:10 AM, Zack Maril thewitzb...@gmail.com
 wrote:
 
  Goal of project: Extend (or fork) autodoc such that it can create and
 run
  interactive documentation for any project.
 
  Example for the take function:
 
 
  take
 
  function
 
  Usage: (take n coll)
 
  Returns a lazy sequence of the first n items in coll, or all items if
  there are fewer than n.
 
  Example:
  textarea (take 10 (range 20))/textarea button Eval!/button
  Output:
  [0 1 2 3 4 5 6 7 8 9]
  Added in Clojure version 1.0
  And then the user could change the code in the browser, it would be sent
  off to the server, and the new user would get the answer back:
  Example: textarea (take 5 (range 20))/textarea button
 Eval!/button
  Output: [0 1 2 3 4]
 
  To make this work, autodoc would need to be extended in two major ways:
  1. When generating the html, autodoc would look for metadata within
  each definition. If it found :examples within the data, then it would
 add in
  a number of textarea elements and eval buttons prefilled with the
 given
  examples.
  Example definition:
  (defn take
 
Returns a lazy sequence of the first n items in coll, or all items if
there are fewer than n.
{:added 1.0
 :static true
 :examples ['(take 5 (range 10)),'(take 3 (drop 5 (range 1 11)))]}
[n coll]
(lazy-seq
 (when (pos? n)
   (when-let [s (seq coll)]
(cons (first s) (take (dec n) (rest s)))
 
  2. Have it ship with a webserver that runs something similar to
 tryclojure
  and has all of the routes set up for the documentation to work
  automagically. A very basic use of clojail. An
 interesting challenge would
  be finding a way to get  outputs besides text to work (things like
 charts
  for incanter).
 
  Conceptually, this isn't too hard to imagine as a project. The main
 brunt
  of the work would be writing all of the examples for each project. Even
  then, there are a ton of examples on clojuredocs.org that are under
 the EPL
  license. Having interactive documentation would be pretty cool though.
 The
  only place I have seen it so far has been in Mathematica, and that was
 only
  after you bought the program. If people are interested in this being
 made,
  I'll be the first to volunteer as a student.
 
  Would people be interested in this as a project for GSOC?
  -Zack
 
  --
  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 Dev group.
  To post

GSOC Idea: Interactive documentation with autodoc

2012-03-24 Thread Zack Maril
Goal of project: Extend (or fork) autodoc such that it can create and run 
interactive documentation for any project.

Example for the take function:
 
*take*function

Usage: (take n coll)

Returns a lazy sequence of the first n items in coll, or all items if
there are fewer than n.

*Example: *
*textarea (take 10 (range 20))/textarea button Eval!/button*
*Output: *
*[0 1 2 3 4 5 6 7 8 9]*
Added in Clojure version 1.0
And then the user could change the code in the browser, it would be sent 
off to the server, and the new user would get the answer back:
*Example: textarea (take 5 (range 20))/textarea button Eval!/button*
*Output: [0 1 2 3 4]*
*
*
To make this work, autodoc would need to be extended in two major ways:
1. When generating the html, autodoc would look for metadata within 
each definition. If it found :examples within the data, then it would add 
in a number of textarea elements and eval buttons prefilled with the 
given examples.   
Example definition:
(defn take

  Returns a lazy sequence of the first n items in coll, or all items if
  there are fewer than n.
  {:added 1.0
   :static true
   :examples ['(take 5 (range 10)),'(take 3 (drop 5 (range 1 11)))]}
  [n coll]
  (lazy-seq
   (when (pos? n) 
 (when-let [s (seq coll)]
  (cons (first s) (take (dec n) (rest s)))

2. Have it ship with a webserver that runs something similar to tryclojure 
and has all of the routes set up for the documentation to work 
automagically. A very basic use of clojail. An interesting challenge would 
be finding a way to get  outputs besides text to work (things like charts 
for incanter). 

Conceptually, this isn't too hard to imagine as a project. The main brunt 
of the work would be writing all of the examples for each project. Even 
then, there are a ton of examples on clojuredocs.org that are under the EPL 
license. Having interactive documentation would be pretty cool though. The 
only place I have seen it so far has been in Mathematica, and that was only 
after you bought the program. If people are interested in this being made, 
I'll be the first to volunteer as a student.

Would people be interested in this as a project for GSOC?
-Zack 

-- 
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: GSoC: Browser-based Clojure(Script) editor

2012-03-23 Thread Zack Maril
I think you would probably have the most meaningful success if you focused 
on making things that let people teach themselves Clojurescript. Making the 
editor intuitive for beginners would be a major win. Allowing them to 
visualize data structures and algorithms that they have written in 
Clojurescript would be excellent. Look into maybe incorporating 
http://keminglabs.com/c2/ or just start up d3. 

The ideal for beginners you would be working towards: 
http://reference.wolfram.com/mathematica/guide/Mathematica.html 

This is the best documentation I have ever seen. I taught myself not just 
Mathematica but vast swaths of math and statistics with this.* If you can 
make a set of examples that people can open up in their editor and evaluate 
and change right there in the browser, Clojurescript would win the 
internet. In fact, if you don't apply to GSoC with this idea, I will. 
-Zack

*Full disclosure: I've been employed by Wolfram previously. Total fan boy 
here. 

On Thursday, March 22, 2012 8:23:53 AM UTC-2, Martin Forsgren wrote:

 Hello! 
 I am thinking of applying to GSoC and I found the proposal to continue 
 working on Chris Grangers Clojure(script)-editor in Bret Victor- 
 style really interesting. 

 I have some ideas on features that I think would be nice to have, 
 other than opening, saving and compiling files: 

 Visualization of functions à la Bret Victor (Let the user give example 
 input, then print the values of all local vars (and maybe return 
 values of function calls) at the side of the function). Using 
 clojure.tools.trace or CDT perhaps? 
 Possibility to add the example input and the corresponding expected 
 output as an unit test for the function. 

 Pluggable ui-widgets (like the slider and colorpicker in Brets talk). 
 Examples: slider, checkbox, colorpicker, filechooser, datepicker, 
 mouse movement recorder, piano?, whatever. 
 (predicate dispatch to determine what widget to choose? :) 

 Pluggable widgets for visualising data(structures) could also be 
 created.(Perhaps inline widgets? Although I think that most often 
 would be more annoying than helpful.) 

 Use kibit to highlight code that could be rewritten. 

 Visualising the call-stack (as Chris suggested) 

 Graphs of relations between namespaces. 

 What do you think? Do you have other ideas? What features do you think 
 one should focus on first ? Please give some feedback. 


-- 
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

Open source Clojure projects

2011-11-09 Thread Zack Maril
For many of the older languages I look at, there are big open source 
projects that people are working on that are making a big impact. C has 
linux, Javascript has jQuery and Khan Academy's frameworks, Java has their 
libraries, etc. etc. 

Are there any Clojure projects I could contribute to?

I know new ideas are being developed all the time, I can see them cropping 
up on here everyday. It seems like by the time I hear about it, they are 
implemented already and most of the bugs have been sussed out though. 
Besides hacking on clojure itself, there doesn't seem like there are any 
projects I could add to (and I would have to learn way more to be able to 
contribute anything useful with the clojure code). 
-Zack

-- 
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: small project to learn clojure

2011-09-18 Thread Zack Maril
Confession:The best way I have found to learn a language is to pick a
girl and make something that impresses her.

When I was learning to use Node.js, I made a chat room for my
girlfriend and I to talk in when we doing a long distance
relationship. It had a sassy robot that pulled pictures of lolcats
from reddit on command. Another weekend, I made a robot that would
sext pickup lines if a girl messaged the right number. The simpler a
project sounds, a  flirty robot that I can sext!, the more
complicated the implementation will be. Although it was easy to do in
node, I imagine that making a sexting robot service with clojure would
make you learn a great deal about state if you tried to go from simple
pick up lines to a robot that could conduct multiple conversations at
once with several different people/numbers.

It's what has worked for me and will probably be the technique I use
for the foreseeable future.  The idea is limited to topics that can be
wrapped up into packages to impress women, but that is really just a
exercise in imagination and creativity. Make friends with a math major
and a whole field of abstract topics crop up that are fair game.

Good luck!
-Zack a.k.a American College Male

P.S. I am extremely sorry if females feel left out by this advice.
This is what has worked for me as a guy wishing to learn programming.
I wish I had advice for you that would be more useful if you were
trying to learn a language. If you generalized to make something you
would want to show your friends, then it is probably still pretty
applicable.

On Sep 17, 3:23 am, Thorsten Wilms t...@freenet.de wrote:
 On 09/16/2011 11:50 PM, Dennis Haupt wrote:

  i feel compelled to do something more complex in clojure. not too big,
  but bigger than what fits in 100 lines and offers some chances to use
  macros.
  it should also be fun, maybe something like robocode.

 Something that is not primitive but may stay small or at least has
 clearly defined boundaries right from start ... if you rule out pure
 logic puzzles, this does point to games, I think.

 There are so many simple games, some of which must have been implemented
 a million times. You could try to do one of those, but with a twist,
 perhaps.

 Like a Pacman, but where you steer the ghosts (only one at a time,
 changing the direction it heads to).

 Dungeonmaster-Sokoban, where you have to push boxes to create a path
 that will lead to the hero's death, once he arrives. That without
 trapping your own worker.

 OR, you look for an existing project, where you could implement a
 missing feature. Ideally one where you could interact with the
 author/contributors via IRC.http://www.webnoir.org/might be a
 candidate, where a comment system or tagging come to mind (I'm not
 affiliated and don't know if something like that is underway, already).

 --
 Thorsten Wilms

 thorwil's design for free software:http://thorwil.wordpress.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


Re: Stanford AI Class

2011-08-09 Thread Zack Maril
If you looks here, http://aima.cs.berkeley.edu/code.html, you can see
that the data/code is provided in formats for Java, Lisp, Python, and
just some plaintext as well. Here is his rationale, and other info,
about why he switched: http://norvig.com/python-lisp.html
Personally, I plan on giving it all a shot with Clojure. It makes the
most sense to me right now and its the language I want to learn.
-Zack

On Aug 8, 7:41 pm, Mark Engelberg mark.engelb...@gmail.com wrote:
 On Mon, Aug 8, 2011 at 2:18 PM, daly d...@axiom-developer.org wrote:
  It is trivial to make Lisp look like Python,
  just put each paren on its own line and move them hard right.
  Add a few macros (e.g. for) and you could probably parse it.

 I agree with most of what you said, but not this.

 There's a big difference between the readability of:
 a[i+1] += 2
 and
 (vector-set! a (add1 i) (+ (vector-ref a (add1 i)) 2)  ; Scheme
 or
 (swap! a (assoc a (inc i) (+ (a (inc i)) 2))  ; Clojure

 Python is widely regarded as the most readable language.  My
 understanding is that this AI class is a cross-disclipine class at
 Stanford, taught to engineers and others who have minimal background
 in programming.  My impression is that there will be little to no
 programming assignments in the class, however, there are programs in
 the book as a sort of executable pseudocode to describe the
 algorithms.  In other words, they are optimizing for readability, not
 writability.  If there does end up being programming in the class, my
 guess from the syllabus is that it will be very heavy on linear
 algebra; Python has good libraries for that.

 On the other hand, Lisp's prefix notation, while natural for some
 things, looks very unnatural in many contexts, especially math, where
 people have a whole lifetime of seeing infix notation.  Furthermore,
 Clojure requires a fundamentally different way of thinking about state
 and simulation, and nearly every classical algorithm (many of which
 are stateful) would have to be reworked in a less stateful manner
 and/or wrapped in layers of refs, dosyncs, alters and dereferencing,
 all of which potentially distract from the clarity of the algorithm.

 I personally prefer Clojure to Python, but in the context of this
 class, I have no doubt that Python is the more appropriate choice.

-- 
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