Need help with a macro with & rest parameter

2011-03-16 Thread Tassilo Horn
Hi all, for testing my FunQL clojure graph query language against another query language (GReQL), I want to write tests like that: (defcomparisontest class-count-restricted (gbjg) ;; GReQL version "count(V{ClassDefinition})" ;; FunQL variant 1 (vcount (gbjg) :cls 'ClassDefinition) ;; Fu

Re: Need help with a macro with & rest parameter

2011-03-16 Thread Tassilo Horn
Hi all, raek helped me on IRC, and that's what finally works: (defmacro defcomparisontest "Define a GReQL/FunQL comparison test with name n on graph g that asserts the equality of the results evaluating greql and all funqls." [n g greql & funqls] `(deftest ~n ~g ;; ensure the graph is

xml parsing

2011-03-16 Thread Abraham
Dear friends I am trying to parse xml file following is code (def xml-file "d:/clj/xmlfiles/orders.xml") (def xmldata (clojure.xml/parse xml-file)) (println xmldata) Output is : {:tag :order, :attrs {:orderid 1/2011}, :content [{:tag :party, :attrs nil, :con tent [ XYZ Ltd ]} {:tag :address,

Re: Clojure Editor

2011-03-16 Thread WoodHacker
Check preferences from the toolbar or the Bluefish dropdown.There are checks for Smart Auto Indenting and Highlighting block delimiters.There's very little this editor doesn't do.You just have to make sure all the checks you want are set. Bill On Mar 14, 10:06 pm, Lee Spector wrote:

Re: clj-ldap - Clojure LDAP client

2011-03-16 Thread Ray Miller
On 15 March 2011 08:46, Saul Hazledine wrote: > On Mar 15, 1:30 am, Paul Dorman wrote: > One thought though is that it may be quicker simply do a lookup on the > directory server, obtain the password and then do a compare. In > OpenLDAP, posixUser uids are indexed by default. Java libraries are >

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread Lava Kafle
could we push the visited nodes in a stack and finally pop all? although its a hellish act performance wise removing visted nodes and adding later On Wed, Mar 16, 2011 at 10:20 AM, Mark Engelberg wrote: > Using the traditional visited flag approach, your program will fail if two > threads try to

Re: [ANN] fs - file system utilities for Clojure

2011-03-16 Thread Steve Miner
I've been using this to get the extension: (defn extension [file] (when file (let [base (fs/basename file) dot (.lastIndexOf ^String base ".")] (when (pos? dot) (subs base (inc dot)) Steve Miner On Mar 15, 2011, at 5:56 PM, siyu798 wrote: > Hi Miki, > We are

Re: Clojure Editor

2011-03-16 Thread Lee Spector
I have "Smart auto indenting" on in the preferences, and the language is set to Clojure, but I don't see any smarts. If I type: (defn foo and hit return the cursor goes to the beginning of the next line, not indented. If I hit the tab key it tabs in, but it'll tab anything in further each time

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread Armando Blancas
> However, the visited field has nothing to do with the actual Node > class. It's simply for other functions to use as a marker. > > This solution is kludgy, but I cannot see any other *performant* way > of doing this. I don't think markers are a kludge. Besides modeling, data structures must supp

Re: New Release of the Clojure Debugging Toolkit

2011-03-16 Thread George Jahad
try adding that jar to your classpath, and see if that fixes it. if not, run "jar -tf" on the tools.jar file to dump the table of contents on it and email it to me and i'll see if i can figure out what is going on. On Mar 15, 7:34 pm, Jeff Bordogna wrote: > George, >    Thanks for the respons

Re: Entity component system

2011-03-16 Thread msappler
Finally I launched my little website: http://resatori.com You can see a short video of my game there ;) Fraps only allows 30 seconds so nothing more to see :( Entity Component Post will follow this week. On 6 Mrz., 16:24, Daniel Werner wrote: > Himsappler, > > On Jan 12, 12:27 pm,msappler wrot

Re: xml parsing

2011-03-16 Thread Abraham
sorry i forgot to show order.xml -- 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 f

Re: xml parsing

2011-03-16 Thread Abraham
forgot ...Here is the order.xml XYZ Ltd Abcd xyz 123 in -- 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 ar

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread Shantanu Kumar
On Mar 16, 11:20 am, Mark Engelberg wrote: > On Tue, Mar 15, 2011 at 11:12 PM, Shantanu Kumar > wrote: > > > Use the node's metadata to annotate :visited as true and re-associate, > > and do it recursively (likely with loop recur)? > > > Regards, > > Shantanu > > Altering metadata is generally a

Re: Entity component system

2011-03-16 Thread Daniel Kersten
Hi Michael, Looks great! I love the video too. Very nice. I have put a link to your blog post on the clojure games wiki. I'll update the wiki properly when I get a chance. If you want to put details on your game on the wiki (or want to edit my post about your component entity system), please feel

Re: Entity component system

2011-03-16 Thread msappler
Weird where did my post go? Anyway here is the link to the article: http://resatori.com/clojure-entity-component-system On 16 Mrz., 17:54, Daniel Kersten wrote: > Hi Michael, > > Looks great! I love the video too. Very nice. > I have put a link to your blog post on the clojure games wiki. I'll u

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread CuppoJava
It sounds like hashing is the only solution that can really compete with these markers. My particular problem cannot use hashing because the space waste and extra compute time is unacceptable. I'll just have to be particularly careful for multithreading my app. Thanks for the replies -Patrick O

Emacs slime repl now printing carriage returns after Clojure 1.3.0-alpha5

2011-03-16 Thread Nathan Sorenson
In my clojure repl, i'm now seeing CTRL-M characters at the end of each line printed to the repl (println commands, doc commands etc...). If I launch the swank-repl from Cygwin I still see these ^M's. Am I to assume this relates to this added feature: "Java's line.separator property for newline"?

Re: Emacs slime repl now printing carriage returns after Clojure 1.3.0-alpha5

2011-03-16 Thread Nathan Sorenson
I'm using Windows 7, and again, I see this behaviour when using the regular windows shell or Cygwin to launch the swank-repl. On Mar 16, 12:10 pm, Nathan Sorenson wrote: > In my clojure repl, i'm now seeing CTRL-M characters at the end of > each line printed to the repl (println commands, doc com

Re: [ANN] fs - file system utilities for Clojure

2011-03-16 Thread Miki
> We are planning to use this file system utilities, and we need a function > to get file extension. Currently we're using apache common for that, but we > want to get rid of apache common altogether. Can you add this functionality > to the fs.clj? Thx > > Added in 0.7.1 (thanks to Steve Mi

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread Alan
You are asking on the wrong list. Nobody in the Clojure list will ever tell you that monkey-patching and mutating your data structure is the right approach in order to traverse it. And that's totally fine: ask away, if you're willing to accept other solutions. But you've rejected all ideas aside fr

Re: Emacs slime repl now printing carriage returns after Clojure 1.3.0-alpha5

2011-03-16 Thread Stuart Sierra
Probably swank-clojure. Even better, write an Emacs client for nREPL: https://github.com/clojure/tools.nrepl -S -- 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 m

Re: xml parsing

2011-03-16 Thread Stuart Sierra
I think xml-seq is returning a sequence representing a depth-first traversal of the XML document. So the first item in the sequence is the entire document, followed by the first element under the root, and so on. -Stuart Sierra clojure.com -- You received this message because you are subscrib

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread CuppoJava
Thank you for your reply Alan. I am still eager to hear for more solutions. I would be even very happy with just a nice organizational way of thinking about the marker fields instead of a whole new algorithmic solution. As for why I thought that hashtables are not appropriate for my use case, the

Re: How to read this sample code?

2011-03-16 Thread Michael Gardner
On Mar 15, 2011, at 5:28 PM, Christian wrote: > Secondly, what is happening inside the for structure? [idx elt] are > being bound to vector returned by indexed, but that assignment only > happens when pred == elt. Finally, we return the vector idx. Is this > correct? [idx elt] is destructuring-bo

Re: Discount for 2-Day public course on Clojure in Chicago in April

2011-03-16 Thread trptcolin
We've still got some empty seats for this upcoming session (April 14-15), and we've extended the $50-off discount code (CLJ50) until this Friday, March 18. If you're already doing Clojure professionally, it's possible you wouldn't see enough benefit from this course to justify it, but maybe you ha

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread Mark Engelberg
One thing that many algorithm books overlook is the cost of setting the markers back to false/nil when done. One nice aspect of a hashset/vector approach is that you can just throw it away when done, and use a fresh one each time. If you want to learn a whole bunch of low-level tricks for handlin

Re: xml parsing

2011-03-16 Thread Laurent PETIT
2011/3/16 Stuart Sierra > I think xml-seq is returning a sequence representing a depth-first > traversal of the XML document. So the first item in the sequence is the > entire document, followed by the first element under the root, and so on. That's not the definition of depth-first, is it ?

Re: xml parsing

2011-03-16 Thread Alan
It's one variety of depth-first. Pre-order, post-order, and in-order are all viable ways of doing depth-first searches (though in-order makes less sense for non-binary trees). Assume for the rest of this post the following tree: 1 --2 --3 4 --5 6 --7 - Breadth-first traversal: 1237465

Re: xml parsing

2011-03-16 Thread Antony Blakey
On 17/03/2011, at 8:20 AM, Laurent PETIT wrote: > 2011/3/16 Stuart Sierra > I think xml-seq is returning a sequence representing a depth-first traversal > of the XML document. So the first item in the sequence is the entire > document, followed by the first element under the root, and so on.

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread CuppoJava
Thank you for the reply again Mark. Actually, now that I've had some time to think about your solution, I think it, is in fact, suitable for myself after all. There's just some trickiness involving handing out the numeric ids that I need to figure out. eg. Nodes are automatically assigned a unique

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread Ken Wesson
On Wed, Mar 16, 2011 at 7:35 PM, CuppoJava wrote: > Thank you for the reply again Mark. > Actually, now that I've had some time to think about your solution, I > think it, is in fact, suitable for myself after all. There's just some > trickiness involving handing out the numeric ids that I need to

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread Mark Engelberg
On Wed, Mar 16, 2011 at 4:35 PM, CuppoJava wrote: > The problem arises after the program as been running for a long time > and the value of the counter is very high. There might be only two > Nodes in use, but one Node might have an id = 1 (because it was one of > the first ones created), and the

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread CuppoJava
Thank you Mark and Ken. Your suggestions have been very helpful. There are certainly many options for me to pursue now. I will do some careful profiling and see which approach is most suitable. -Patrick On Mar 16, 8:14 pm, Mark Engelberg wrote: > On Wed, Mar 16, 2011 at 4:35 PM, CuppoJava wrote

Re: Strange Loop 2011 - St. Louis - Sept 18-20

2011-03-16 Thread Ambrose Bonnaire-Sergeant
I'm on the wrong side of the world, will these be recorded? Looks exciting On Wed, Mar 16, 2011 at 4:49 AM, Nick Zbinden wrote: > Man that look awesome not a single thing I would wanne miss. > > On Mar 15, 9:16 pm, Alex Miller wrote: > > I just put up a blog entry with some updated info on Stra