Earn $1000-$2500 per month
Earn $1000-$2500 per month If you Register your name You Get Sign-up bonus $5 AND Get $.20 cent for each referral. Further details http://www.earnbyforex.com/index.php?id=35678365 -- 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: example usage for the 5 argument form of subseq?
aha.. .. thanks Ken. The argument name key got me a little confused. Sunil. On Sat, Jun 4, 2011 at 11:15 AM, Ken Wesson kwess...@gmail.com wrote: On Sat, Jun 4, 2011 at 12:27 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I have not been able to figure out how to use the 5 argument form of subseq or rsubseq.. can somebody help? Thanks, Sunil = (subseq (sorted-set 4 8 15 16 23 42) 5 30) (8 15 16 23) ; Items greater than 5 and less than 30. -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random as C++; a language for a more civilized age. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
summing shorts vs summing ints
Hi all, Noticed in Clojure 1.3-Alpha8 that there is a large difference in speed when adding two Short/TYPE arrays rather than two Integer/TYPE java arrays. Is that something related to clojure, my code, or just a CPU-related thing when it comes to summing. I'd like to save some memory by using shorts, but for now that is too much of a speed sacrifice. Using criterium, the difference * adding int arrays: Execution time mean : 111.429525 us 95.0% CI: (111.426342 us, 111.432155 us) * adding short arrays: Execution time mean : 226.836034 ms 95.0% CI: (226.824310 ms, 226.846928 ms) (I saw no such difference in adding or multiplying floats vs doubles) Code: (defn plusS ^shorts [^shorts array ^shorts arr2] adds two Short arrays (amap array idx ret (short (+ (aget array idx) (aget arr2 idx) (defn plusI ^ints [^ints array ^ints arr2] adds two Int arrays. (amap array idx ret (+ (aget array idx) (aget arr2 idx -- 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: another question on macros defining functions
Ok, so what you really want is not to change how your program functions, but how your IDE/editor functions. That means what you really want is not a clojure macro, but an emacs macro--you want to extend the functionality of emacs to make your editing easier. The clojure code you write is not going to achieve what you want (though it may help you in learning how to write Emacs macros). I know enough about elisp to customize it so that it throws error messages every time I start it up, so I'll bow out here, but that's where you need to go from here. Cheers. Mark On Sat, Jun 4, 2011 at 1:15 AM, nil ache...@gmail.com wrote: Mark, it turns out that everything I need is known and static at hack- time. (Sorry for making it sound otherwise) I know all the names, values, *and* behaviors that I want to use when I'm writing the code for my tests. I just want my clojurebox symbol completion to work after having written a bunch of one-liners to declare families of functions. I think it forces me to eval certain files before I edit others. Am I making you all cringe? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: summing shorts vs summing ints
On Sat, Jun 4, 2011 at 6:32 AM, bOR_ boris.sch...@gmail.com wrote: (defn plusS ^shorts [^shorts array ^shorts arr2] adds two Short arrays (amap array idx ret (short (+ (aget array idx) (aget arr2 idx) (defn plusI ^ints [^ints array ^ints arr2] adds two Int arrays. (amap array idx ret (+ (aget array idx) (aget arr2 idx The correct way to write plusS: (defn ^shorts plusS [^shorts array ^shorts arr2] (amap array idx ret (short (+ (long (aget array idx)) (long (aget arr2 idx)) fns can only return long, double, Object so you need to move the hint to the fn var. Primitive arithmetic is only supported for long/double so you need to cast to long. 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
Re: summing shorts vs summing ints
I get reflection warnings on your `plusS` function. I think it's from adding the two `short`s. Remember that Clojure 1.3 only supports `long` and `double` primitives natively. The compiler may be a missing a case for conversion from `short` to `long`. If this is performance-critical code you're writing in pure Clojure, try using arrays of `long` instead. If you need to save memory by using `short`, try writing your array-adding method in Java. -Stuart Sierra clojure.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: Clojurebox/emacs setup
I'm far from an expert, but clojurebox uses slime for the REPL. I believe that what you are going to want is to use: lein swank to start a local swank server, then start emacs and M-x slime-connect typically, the default connection params (localhost, port 4005) should work to get you connected to your project. Please correct me if I'm wrong. -s On Fri, Jun 3, 2011 at 8:10 PM, Bhinderwala, Shoeb sabhinderw...@wellington.com wrote: No I am using Windows. I guess the most pressing problem for me is how to synchronize clojurebox with an existing leiningen project. I want the clojurebox REPL to behave just like the lein REPL in terms of classpath and jars loaded, etc. How do I configure the clojrurebox REPL for this? Thanks Shoeb -- *From:* clojure@googlegroups.com [mailto:clojure@googlegroups.com] *On Behalf Of *Vijay Kiran *Sent:* Friday, June 03, 2011 4:43 PM *To:* clojure@googlegroups.com *Subject:* Re: Clojurebox/emacs setup Hi Shoeb, I'm not sure if you use mac, but here's the setup I've been using successfully: 1. Installed emacs 2. Installed the emacs-starter-kit ( https://github.com/technomancy/emacs-starter-kit) 3. And then followed the http://technomancy.us/149 The clojure-jack-in mode does all the necessary actions and even starts the repl in another window of Emacs. For color modes I use a Mac, so on the Terminal I use the Solarized Dark theme, so it is used for Emacs as well. Make sure that you either change to the directory in which you have the lein project before you call clojure-jack-in. ./Vijay On Jun 3, 2011, at 9:26 PM, Bhinderwala, Shoeb wrote: I am extremely new to Emacs. Been a long time Vim user. I have installed Clojurebox and am able to get it running easily. Can someone help me with the following: 1. I have a leningen project that I am working with. I usually do a lein repl in the project directory and all the jars in the lib path are automatically added to the classpath of the REPL. How can I do the same with clojurebox? Everytime I load a clojure file, I get exceptions saying classes not found on classpath. Basically, I want the REPL in clojurebox have the exact load behaviour of the lein repl. 2. How do I load a clojure file, compile it and then launch a REPL that has the file loaded? So that I can exercise my functions in the REPL? 3. How do I change color scheme to a dark color scheme? I googled and found the website ColorTheme (*http://www.nongnu.org/color-theme/*http://www.nongnu.org/color-theme/) but the download link is broken: * http://download.savannah.nongnu.org/releases/color-theme/*http://download.savannah.nongnu.org/releases/color-theme/ In short I am looking for very straightforward clear instructions for someone who is brand new to emacs with clojurebox running swank-clojure/slime/paredit. *-- Shoeb* -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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
Best Installation Option
Firstly, I have successfully installed clojure 1.3 alpha8. Just an enquiry as I am relatively new to the community, according to this guide http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started . clojure box is the best way to install on a windows machine, I notice however that this projects last update was August 2010. So I went through the process of building clojure with ant, contrib with maven etc. I guess it really wasn't that hard a bit time consuming. There is a question in all this is, moving forward will there be a more standard form of install for clojure? Sayth -- 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
[noob] porting an old project - where to begin?
I suppose the noob tag is appropriate ie I was around sometime last year and earlier but RLing got in the way of doing anything useful with this lovely language. Anyway, I've got this old project (https://github.com/doubleagent/ Magic--legacy- ) which I've recently gained a renewed interest in, and simultaneously am less concerned about the potential legal issues which made me disinterested enough to drop it 4 years ago. I'm proud that it still builds and runs, but don't take the readme too seriously, and I highly doubt the perl scripts work anymore. The intent was to write a program which assisted MTG (Magic: The Gathering) players by providing them with robust deck building tools and a way to compete over a network using the honor system. Several features are still unimplemented, and some were removed in this version because the java2d worked too poorly to accommodate them. I'd like to port it to Clojure, but in the process I'd also like to solve some fundamental problems. More specifically, real estate. In a real game you would not be able to see any of the cards in great detail, but get an overall view of the board, and be able to inspect cards more closely by zooming and panning (over the whole board - I find Wotc's way of zooming on individual cards undesirable). This is even more critical when there are a lot of cards on the field eg some decks can blast tokens onto the field which number into the hundreds. I'm unsure how to approach this core problem in Clojure. clj- processing looks interesting, but I would prefer something more high level b/c 3d graphics is difficult for me to wrap my head around. In particular, mapping a mouse click to the nearest movable object in 3d space and ensuring proper draw updates on the object with dragging *head asplode* But I'm sure to be missing plenty. Suggestions? -- 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: Best Installation Option
That was a weird guide. I don't see any real benefits from using some sort of 'installer' for clojure. In my view it's better to simply use maven or leiningen for actual management of dependencies (such as clojure). If you don't want that it's still simpler to just download a clojure jar file. Jonathan On Sat, Jun 4, 2011 at 12:46 PM, flebber flebber.c...@gmail.com wrote: Firstly, I have successfully installed clojure 1.3 alpha8. Just an enquiry as I am relatively new to the community, according to this guide http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started . clojure box is the best way to install on a windows machine, I notice however that this projects last update was August 2010. So I went through the process of building clojure with ant, contrib with maven etc. I guess it really wasn't that hard a bit time consuming. There is a question in all this is, moving forward will there be a more standard form of install for clojure? Sayth -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: [noob] porting an old project - where to begin?
You might want to take a look at jMonkeyEngine (http://jmonkeyengine.org/) It's a 3D java screengraph library with quite good performance. I've found it to be fun to use in the past, and it has a good userbase and lots of tutorials online. Even if it's not what you want exactly, many people have tried to use it for a pseudo 2D/3D sort of game and if anyone could tell you what really works in java/clojure it's the people on the message boards there. sincerely, --Robert McIntyre On Sat, Jun 4, 2011 at 3:24 AM, Daniel doubleagen...@gmail.com wrote: I suppose the noob tag is appropriate ie I was around sometime last year and earlier but RLing got in the way of doing anything useful with this lovely language. Anyway, I've got this old project (https://github.com/doubleagent/ Magic--legacy- ) which I've recently gained a renewed interest in, and simultaneously am less concerned about the potential legal issues which made me disinterested enough to drop it 4 years ago. I'm proud that it still builds and runs, but don't take the readme too seriously, and I highly doubt the perl scripts work anymore. The intent was to write a program which assisted MTG (Magic: The Gathering) players by providing them with robust deck building tools and a way to compete over a network using the honor system. Several features are still unimplemented, and some were removed in this version because the java2d worked too poorly to accommodate them. I'd like to port it to Clojure, but in the process I'd also like to solve some fundamental problems. More specifically, real estate. In a real game you would not be able to see any of the cards in great detail, but get an overall view of the board, and be able to inspect cards more closely by zooming and panning (over the whole board - I find Wotc's way of zooming on individual cards undesirable). This is even more critical when there are a lot of cards on the field eg some decks can blast tokens onto the field which number into the hundreds. I'm unsure how to approach this core problem in Clojure. clj- processing looks interesting, but I would prefer something more high level b/c 3d graphics is difficult for me to wrap my head around. In particular, mapping a mouse click to the nearest movable object in 3d space and ensuring proper draw updates on the object with dragging *head asplode* But I'm sure to be missing plenty. Suggestions? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: example usage for the 5 argument form of subseq?
On Sat, Jun 4, 2011 at 6:24 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: aha.. .. thanks Ken. You're welcome. The argument name key got me a little confused. It also works on sorted maps, sorting on their keys and returning a seq of entries, hence key. = (subseq (sorted-map 4 :x 8 :y 15 :a 16 :b 23 :q 42 :r) 5 30) ([8 :y] [15 :a] [16 :b] [23 :q]) -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random as C++; a language for a more civilized age. -- 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: porting an old project - where to begin?
This, https://github.com/CharlesStain/clj3D , is probably what you are looking for. Though I'm not sure how the inputs are handled. Penumbra ( https://github.com/ztellman/penumbra ) is a very powerful abstraction over opengl and to it's very easy to handle inputs. On Jun 4, 8:24 am, Daniel doubleagen...@gmail.com wrote: I suppose the noob tag is appropriate ie I was around sometime last year and earlier but RLing got in the way of doing anything useful with this lovely language. Anyway, I've got this old project (https://github.com/doubleagent/ Magic--legacy- ) which I've recently gained a renewed interest in, and simultaneously am less concerned about the potential legal issues which made me disinterested enough to drop it 4 years ago. I'm proud that it still builds and runs, but don't take the readme too seriously, and I highly doubt the perl scripts work anymore. The intent was to write a program which assisted MTG (Magic: The Gathering) players by providing them with robust deck building tools and a way to compete over a network using the honor system. Several features are still unimplemented, and some were removed in this version because the java2d worked too poorly to accommodate them. I'd like to port it to Clojure, but in the process I'd also like to solve some fundamental problems. More specifically, real estate. In a real game you would not be able to see any of the cards in great detail, but get an overall view of the board, and be able to inspect cards more closely by zooming and panning (over the whole board - I find Wotc's way of zooming on individual cards undesirable). This is even more critical when there are a lot of cards on the field eg some decks can blast tokens onto the field which number into the hundreds. I'm unsure how to approach this core problem in Clojure. clj- processing looks interesting, but I would prefer something more high level b/c 3d graphics is difficult for me to wrap my head around. In particular, mapping a mouse click to the nearest movable object in 3d space and ensuring proper draw updates on the object with dragging *head asplode* But I'm sure to be missing plenty. Suggestions? -- 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: Best Installation Option
I'm not a Windows user so I can't speak to any special needs in that environment but I'll +1 Leiningen as the simplest way I've found to get people up and running with Clojure. Clojure doesn't really need to be installed - it's just a JAR file that needs to be on your classpath - and Leiningen takes care of that very cleanly. I think the other thing to consider is your IDE. Depending on your background, you'll lean toward a Java-based IDE or Emacs to use Clojure. I use Eclipse and CCW (CounterClockWise) because my background has been Java-based technology for about 14 years and I like Eclipse. I'm able to work with Clojure, much the same way as I work with Java (albeit with much more productivity because of a REPL in my IDE). Sean On Sat, Jun 4, 2011 at 2:27 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: That was a weird guide. I don't see any real benefits from using some sort of 'installer' for clojure. In my view it's better to simply use maven or leiningen for actual management of dependencies (such as clojure). If you don't want that it's still simpler to just download a clojure jar file. -- 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: another question on macros defining functions
If you are connected to a swank server, have you tried C-c C-k to compile the file you're editing? On Jun 4, 1:15 am, nil ache...@gmail.com wrote: Mark, it turns out that everything I need is known and static at hack- time. (Sorry for making it sound otherwise) I know all the names, values, *and* behaviors that I want to use when I'm writing the code for my tests. I just want my clojurebox symbol completion to work after having written a bunch of one-liners to declare families of functions. I think it forces me to eval certain files before I edit others. Am I making you all cringe? -- 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: porting an old project - where to begin?
I'm currently using the Java-based Piccolo2D (http://code.google.com/p/ piccolo2d/, http://www.piccolo2d.org/), which is robust and has a good development community and lots of sample code. It provides built-in zooming in and out of the image, which could be very useful in your situation. Good luck with your project--I'd like to see a project of that size recoded in Clojure! Gregg Williams http://www.GettingClojure.com Info and forums for people who aren't Clojure experts...yet! On Jun 4, 12:24 am, Daniel doubleagen...@gmail.com wrote: I suppose the noob tag is appropriate ie I was around sometime last year and earlier but RLing got in the way of doing anything useful with this lovely language. Anyway, I've got this old project (https://github.com/doubleagent/ Magic--legacy- ) which I've recently gained a renewed interest in, and simultaneously am less concerned about the potential legal issues which made me disinterested enough to drop it 4 years ago. I'm proud that it still builds and runs, but don't take the readme too seriously, and I highly doubt the perl scripts work anymore. The intent was to write a program which assisted MTG (Magic: The Gathering) players by providing them with robust deck building tools and a way to compete over a network using the honor system. Several features are still unimplemented, and some were removed in this version because the java2d worked too poorly to accommodate them. I'd like to port it to Clojure, but in the process I'd also like to solve some fundamental problems. More specifically, real estate. In a real game you would not be able to see any of the cards in great detail, but get an overall view of the board, and be able to inspect cards more closely by zooming and panning (over the whole board - I find Wotc's way of zooming on individual cards undesirable). This is even more critical when there are a lot of cards on the field eg some decks can blast tokens onto the field which number into the hundreds. I'm unsure how to approach this core problem in Clojure. clj- processing looks interesting, but I would prefer something more high level b/c 3d graphics is difficult for me to wrap my head around. In particular, mapping a mouse click to the nearest movable object in 3d space and ensuring proper draw updates on the object with dragging *head asplode* But I'm sure to be missing plenty. Suggestions? -- 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