Re: [BUG?] loading Clojure source files from various data sources (classloading)

2015-06-03 Thread Alex Fowler
Hello again!

Well, it has been well over a week already. I appreciate the answers and 
works by the people who suggested the workarounds and the benign question 
about the version of Clojure we are using from the dev team. While the 
proposed workarounds are interesting in themselves and their technological 
complexity, and allow to somewhat approach the solution of that otherwise 
simple task, unfortunately, they do not really solve the problem for us: 
the thread bindings will be flushed on the next call to (require) from 
Clojure code, and creating a whole web service for classloading is an 
unaffordable overkill (though, again, thanks for sharing your thoughts and 
works, I understand that you have worked hard to create them, they just do 
not suit our usecase). Looks like we're failing.. another success story 
here.

-- 
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: [BUG?] loading Clojure source files from various data sources (classloading)

2015-05-21 Thread Alex Fowler
We are using [org.clojure/clojure "1.7.0-beta3"] for desktop and 
[org.clojure-android/clojure 
"1.7.0-beta6"] for Android.

By your question I assume you're refering to the fact that some of the 
links I have made in the original post are for clojure-android, I am sorry, 
apparently I mixed up the browser tabs when copy-pasting the links. 
Tiredness gets in the way.. But that does not change anything - the problem 
is valid both for Android and PC. There is no big difference for Android - 
the DalvikDynamicClassLoader is a descendant of DynamicClassLoader and 
suffers from the same issue. So, there is also a little difference for 
RT.makeClassLoader() for Android concerning that it creates the 
DalvikDynamicClassLoader 
instead of DynamicClassLoader but the issue is the same, it is simply 
mirrored to Android. We have been looking and investigating all this 
yesterday with Sattvik and we together have come to this conclusion. 

четверг, 21 мая 2015 г., 16:05:03 UTC+4 пользователь Alex Miller написал:
>
> What version of Clojure are you using?

-- 
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: [BUG?] loading Clojure source files from various data sources (classloading)

2015-05-21 Thread Alex Fowler
I want also to add that Sun/Oracle realize the importance of loading things 
from other sources, read the very last paragraph of this notice 
.
 
But Clojure currently prevents this by hard-code.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[BUG?] loading Clojure source files from various data sources (classloading)

2015-05-21 Thread Alex Fowler
Hello!

I am developing a Java application where Clojure is used as a library. The 
application is required to load sources (including Clojure sources) from 
arbitrary locations in filesystem, internet and maybe a dozen other places. 
Hence I have developed corresponding classloaders for that, which properly 
implement the required ClassLoader methods.

Loading Clojure sources is realized via this approach:

Compiler.LOADER.alterRoot(getMyClassLoader(), ...);  // changing 
the LOADER to my chain of classloaders
IFn require = Clojure.var("clojure.core", "require");
require.invoke(Clojure.read("example.namespace"));

where the contents of the "example.namespace" are:

(ns example.namespace
  (:require [other.example.namespace :as other])))

I have figured that the loading happens with RT.load() 

 
which delegates to RT.loadResourceScript() 
,
 so 
I just alter the Compiler.LOADER so that RT.baseLoader() returns my 
classloaders. And in my classloaders I simply have to override the 
getResourceAsStream 
and all works!
  
The namespace example.namespace starts loading ok. It successfully loads 
the whole clojure.core and then begins to process the first require - the 
other.example.namespace. And this is where something *bad *happens.

It appears to be that the (require) inside the ns form in the 
example.namespace uses not the RT.load() method, but Compiler.load() 
where
 
on line 7210 
the
 
Compiler.LOADER, which by that moment points to the correct classloader 
created by me, gets replaced by RT.makeClassLoader() 
where
 
the current RT.baseLoader() which is effectively Compiler.LOADER gets 
passed as the parent to the newly created DynamicClassLoader.

So I get Compiler.LOADER which I have set to the correct classloader, 
replaced by the DynamicClassLoader whose parent is my classloader. The 
problem is that DynamicClassLoader inherits from URLClassLoader that 
inherits from ClassLoader which, although accepts a parent classloader on 
its creation, does not delegate getResourceAsStream() in case of its 
personal failure to its parent 
!
 That 
results in that my classloader, although still present in the chain, never 
gets called and the (require) in the ns form of example.namespace fails to 
locate the required namespaces that **are** available at that data source.

The problem is that this behavior is hard-coded in Clojure and it looks 
like it is impossible to change that. Clojure forces us to use a 
classloader that inherits the getResourceAsStream() method from 
java.lang.ClassLoader which does not allow delegation of this request to 
parent classloader. This effectively prevents using Clojure as a library 
together with a plugin system because it renders Clojure incapable of 
working with sources that are fetched from elsewhere than the Java's 
URLClassLoader is capable of retrieving data from. It is impossible to load 
sources from a database, or some internet data source or an encrypted data 
source, or even another location in the filesystem. Wow!

We've went with Clojure and now are in the desperate need to resolve this 
peculiar phenomenon.. What could be a proposed solution for this situation?

Thank you.

-- 
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: Clojure, floats, ints and OpenGL

2013-09-16 Thread Alex Fowler
Timothy, thank you very much for such a good explanation! I fully agree
with you. Actually, except for a few details, that is really how I thought
the things are. It is good that you describe the technical base for
problems with the issue. As well as clearified the human factor. What
you're saying is very much like what I would say if I were in your shoes.
Currently, what you're saying, is the present. In the present we make our
choices for currents. And I also agree with Mikera, that an attempt should
be taken. I would participate in it myself if I was into JVM and Clojure
internals. I plan to learn it, but it will take time.

Mikera, thanks for the reference for the library, I will have a look. Also
I strongly encourage you in the attempt and I will be happy if I can be of
any help, although, you seem to know much more than me. I agree with Tim
that some more decisive steps have to be taken into this direction.

James, ah.. yes, we did benchmarks. We use highly optimized mathematical
calculations, derived from numerical analysis. Every single instruction
matters there. Due to the nature of the calculations, the amout of casts,
however, varies from 3 to N in one computation. There can be 1 to M such
computation for a data unit. And thre can be 1 to P data units. At the end,
what worked on plain Java or Java-stylized Scala, worked that times faster,
NxMxP more instructions to be computed. Where there were 500 fps, sometimes
happen to be 480 fps and sometimes 0.01 fps. And I am not even talking
about operations on vast arrays or NIO buffers. But imagine for example,
you have a 1.5GB float NIO-buffer, that came from an OpenGL data-type and
will go back to it. Operation on each float takes, say 5 casts
double<->float in Clojure.

Also, as Mikera points out, bus speeds come into play too.

Of course, as Timothy said, why don't we go back to C for that kind of
stuff? This is a popular question in such cases. I am not going to go into
details on that, except for saying that we have mostly migrated from C to
JVM and it satisfies our requirements, while giving huge benifits. However,
we still do some things in C. To prevent arguments, here is an
article
that
somewhat describes what one can lose in computation, but does not describe
what one gains in other aspects. The loss is what can be tolerated. But
that loss for JVM is understandable. The one more loss for Clojure is
understandable too, but it can be changed. I think that the discussion
branch of Java vs C may be laid to rest.


On Mon, Sep 16, 2013 at 9:03 PM, James Reeves  wrote:

>
>
>
> On 16 September 2013 09:03, Mikera  wrote:
>
>>
>> Obviously this is just a microbenchmark, but it fits my general
>> experience that floats are a reasonable bit faster than doubles, typically
>> 20-100% (doubles are closer when it is pure number crunching since 64-bit
>> CPUs are actually pretty good at doubles, floats have a bigger advantage
>> when you are manipulating a lot of data points and hence memory bandwidth
>> matters more)
>>
>> Code here for those interested:
>> src/test/java/mikera/vectorz/performance/FloatVsDoubleBenchmark.java
>>
>
> That's a pretty interesting result. I ran some tests of my own, based on
> your code, as I wondered whether or not the time to instantiate the array
> of doubles was biasing the test. My goal was to see whether or not I'd get
> a similar result running an array of floats through a method that processed
> doubles. (See: https://gist.github.com/weavejester/6583367)
>
> It turns out that I get a similar result. Passing floats to a method that
> takes doubles slows things down by a similar amount, unless I've somehow
> botched up the test. Considering that converting between single and double
> precision should be pretty cheap on the CPU, I'm surprised at the
> difference.
>
> This somewhat changes my view on things. It doesn't affect me in practice,
> but I can see how someone might be frustrated by having to drop down to
> Java to achieve performance for floating point calculations.
>
> - James
>
> --
> --
> 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/H5P25eYKBj4/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/groups/opt_out.
>

-- 
-- 
You received this message because you 

Re: Clojure, floats, ints and OpenGL

2013-09-14 Thread Alex Fowler
Excuse me, when I said "Vertex3f" I meant "Vector3f".

суббота, 14 сентября 2013 г., 15:14:01 UTC+4 пользователь Alex Fowler 
написал:
>
> Timothy, thanks,for giving a thorough answer to my questions, I appreciate 
> this! As far as I understood, you did some work for Clojure team, and you 
> have the necessary knowledge to express a knowing opinion on what are the 
> implications of the matter. That was one of the things I wanted to know - 
> the cause of the present situation. However, still I don't understand 
> (although you mentioned a reason) why no one from the core team gives a 
> definite, cut-off answer, like the one, Mikera is also asking for - what is 
> for the future? Probably, as somebody mentioned here (sorry, I look and 
> can't find the message, deleted?), the question would probably be better 
> addressed to clojure-dev. But I have no good knowledge of Clojure internals 
> and would be easily suppressed by an answer of a person, showing a 
> technical knowledge, like yours. Yes, I understand what you're saying, but 
> I do not have knowledge of Clojure or JVM to answer you on par. Simply I do 
> not know what to say, although I feel there is a break between JVM and 
> Clojure that should not be. And I feel, that you have a right in what 
> you're saying - you know the language, you know the people here, more than 
> me. But not to let a discussion on such a topic to die, here I am glad that 
> Mikera, someone who has that knowledge, can sympathise me and say what I 
> cannot say.
>
> James, for some numbers on OpenGL penalties, please refer to message #6 in 
> thread (my initial answer for Timothy). You can also google on it, I am 
> sure, you will find more information, or, why not, simply call NVIDIA or 
> ATI support lines, and ask them. A perfectly valid question for them to 
> consult you on :) As for more Java-friendly answers, you might also be 
> interested in asking on LWJGL or JOGL forums. Personally I work with OpenGL 
> for quite a long time already. Even when we were on C/C++ we never used 
> doubles. Then we went Java, and there too,  doubles are nowhere. One of the 
> cornerstone computational workhorses of LWJGL, for example, the class 
> Vertex3f, has no double version. And that is for a reason, not because Java 
> bindings are bad and we must go C-plus-plusing now. Probably, after 10 
> years we will have only doubles and longs on GPUs... do you believe in it? 
> Why we need them there at all?
>
> I still strongly believe that primitives support should be made one of the 
> highest priorities to support.
>
> Lets look from a perspective of someone who researches the language, 
> considering if to adhere to it. Here is a couple of frustrations that hit 
> me so much that I think could even diverse somone from using the language. 
> Warning: the following three points may cause rage in some individuals 
> (they do cause a rage in me at least, because I really like Clojure) :
>
>  1) Clojure is said to be "data-oriented". Rich Hickey says that in the 
> videos. Cool! I have a stream of millions floats and ints to be processed 
> on the fly! Now we find that it is not data-oriented. It is double, long 
> and Object oriented. Data does not just come as "information" it comes with 
> its data-type. Bending data-sources and data-consumers to your will usually 
> does not sign a good data-processing.
>  2) Clojure is said to make simple things easy. Alright, that's a PC in 
> front of me? With a JVM? Alright, I want to add,multiply, divide and 
> subtract some billion floats. What could be simpler?... Uh... typehints.. 
> alright, sure JVM is typed, we have types in Java and Scala, that's ok! Oh, 
> only local... oh, still always returns doubles... err.. boxed? Cast? Oh...
>  3) As Mikera pointed out, some libraries, like "fast arrays on Clojure" 
> is just.. a little bit too much. Are they faster than Java arrays? A 
> library that implements fast arrays for a language that runs on a VM that 
> has fast arrays? For a language, claimed to be perfect for data-processing? 
> There is nothing wrong with the library, I think it is a masterpiece, but 
> something scares me here.
>
> Surely, preserving semantics while letting full primitives support for 
> Clojure, as it is right now, is a challenge. I really like the symantics as 
> it is now, but the cost is too great. The examples that Timothy and Mikera 
> are discussing right now is a problem. Some my ideas, although I am not as 
> professional with them and some of them might not make sense at all (sorry):
>  1) In computations you do not often use functions that compute floats to 
> compute ints instead. Usually you know what are you comput

Re: Clojure, floats, ints and OpenGL

2013-09-14 Thread Alex Fowler
7) Maybe genclass and stuff can still get away as it is now, falling back 
to boxing and reduced number of types? Or special genclass metadata hints 
be introduced? Still, not everyone will use that. But those who will, could 
spare a couple more hints to the compiler..

-- 
-- 
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: Clojure, floats, ints and OpenGL

2013-09-14 Thread Alex Fowler
Timothy, thanks,for giving a thorough answer to my questions, I appreciate 
this! As far as I understood, you did some work for Clojure team, and you 
have the necessary knowledge to express a knowing opinion on what are the 
implications of the matter. That was one of the things I wanted to know - 
the cause of the present situation. However, still I don't understand 
(although you mentioned a reason) why no one from the core team gives a 
definite, cut-off answer, like the one, Mikera is also asking for - what is 
for the future? Probably, as somebody mentioned here (sorry, I look and 
can't find the message, deleted?), the question would probably be better 
addressed to clojure-dev. But I have no good knowledge of Clojure internals 
and would be easily suppressed by an answer of a person, showing a 
technical knowledge, like yours. Yes, I understand what you're saying, but 
I do not have knowledge of Clojure or JVM to answer you on par. Simply I do 
not know what to say, although I feel there is a break between JVM and 
Clojure that should not be. And I feel, that you have a right in what 
you're saying - you know the language, you know the people here, more than 
me. But not to let a discussion on such a topic to die, here I am glad that 
Mikera, someone who has that knowledge, can sympathise me and say what I 
cannot say.

James, for some numbers on OpenGL penalties, please refer to message #6 in 
thread (my initial answer for Timothy). You can also google on it, I am 
sure, you will find more information, or, why not, simply call NVIDIA or 
ATI support lines, and ask them. A perfectly valid question for them to 
consult you on :) As for more Java-friendly answers, you might also be 
interested in asking on LWJGL or JOGL forums. Personally I work with OpenGL 
for quite a long time already. Even when we were on C/C++ we never used 
doubles. Then we went Java, and there too,  doubles are nowhere. One of the 
cornerstone computational workhorses of LWJGL, for example, the class 
Vertex3f, has no double version. And that is for a reason, not because Java 
bindings are bad and we must go C-plus-plusing now. Probably, after 10 
years we will have only doubles and longs on GPUs... do you believe in it? 
Why we need them there at all?

I still strongly believe that primitives support should be made one of the 
highest priorities to support.

Lets look from a perspective of someone who researches the language, 
considering if to adhere to it. Here is a couple of frustrations that hit 
me so much that I think could even diverse somone from using the language. 
Warning: the following three points may cause rage in some individuals 
(they do cause a rage in me at least, because I really like Clojure) :

 1) Clojure is said to be "data-oriented". Rich Hickey says that in the 
videos. Cool! I have a stream of millions floats and ints to be processed 
on the fly! Now we find that it is not data-oriented. It is double, long 
and Object oriented. Data does not just come as "information" it comes with 
its data-type. Bending data-sources and data-consumers to your will usually 
does not sign a good data-processing.
 2) Clojure is said to make simple things easy. Alright, that's a PC in 
front of me? With a JVM? Alright, I want to add,multiply, divide and 
subtract some billion floats. What could be simpler?... Uh... typehints.. 
alright, sure JVM is typed, we have types in Java and Scala, that's ok! Oh, 
only local... oh, still always returns doubles... err.. boxed? Cast? Oh...
 3) As Mikera pointed out, some libraries, like "fast arrays on Clojure" is 
just.. a little bit too much. Are they faster than Java arrays? A library 
that implements fast arrays for a language that runs on a VM that has fast 
arrays? For a language, claimed to be perfect for data-processing? There is 
nothing wrong with the library, I think it is a masterpiece, but something 
scares me here.

Surely, preserving semantics while letting full primitives support for 
Clojure, as it is right now, is a challenge. I really like the symantics as 
it is now, but the cost is too great. The examples that Timothy and Mikera 
are discussing right now is a problem. Some my ideas, although I am not as 
professional with them and some of them might not make sense at all (sorry):
 1) In computations you do not often use functions that compute floats to 
compute ints instead. Usually you know what are you computing. I wouldn't 
switch, say spatial vector calculations from floats to ints under any 
circumstances. Remember Java - when you write signatures of your 
computational functions - how often do you change types? float<->double or 
int<->long maybe, but still not likely. Even on a lisp.
 2) That leads to the other question - what if you *still* somehow want to 
reuse a computational function for other types? Well, maybe you could make 
functions named (+f) or (+i)? Or have a macros that builds them for you and 
calls them for you?
 3) To simplify furhter: 

Re: Clojure, floats, ints and OpenGL

2013-09-12 Thread Alex Fowler

Does somebody from the development team read this user group? Or maybe I 
have addressed my questions to a wrong place?

-- 
-- 
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: Clojure, floats, ints and OpenGL

2013-09-09 Thread Alex Fowler
While there are "double" types for OpenGL, like GLdouble 
(reference-1<http://opengl.czweb.org/ch03/031-034.html>, 
reference-2 <http://opengl.czweb.org/ch03/031-034.html>), their use is, 
softly speaking, not wide-spread: 
reference-3<http://blog.hvidtfeldts.net/index.php/2012/07/double-precision-in-opengl-and-webgl/>,
 
reference-4<http://stackoverflow.com/questions/10012985/why-does-opengl-use-float-rather-than-double>
 and 
reference-5<http://stackoverflow.com/questions/2079906/float-vs-double-on-graphics-hardware>.
 
I think that the real situation is very clearly described in these papers. 
You won't find an OpenGL programmer using double precision, unless he 
either has a *very* specific task or he does not know what he's doing. 
Doubles may be considered an archaism in OpenGL. At least, that's the 
current plot. I know no programmers who used doulbes in OpenGL since 
version 2.x, as far as I remember.

As for the binding that I am using, - it is LWJGL, please see their javadoc 
<http://lwjgl.org/javadoc/>to find no mentions of double (for real usage at 
least). Also, the function glVertex*d is not often used from Java bindings, 
as far as I know. I did not browse through all their reference pages, but I 
am almost sure, you won't find a single mention of use of 64-bit types. You 
can only find such references in rather old info. Yeah, for what reason? 
Imagine you buy, say 4Gb super-cool NVIDIA videocard to play a game or run 
a scientific sumulation and... suddenly it becomes as if being 2Gb? No, 
doubles are not present on GPUs.

Sorry, I am pretty tired argumenting that on IRC already... :) I work in 
multimedia company, believe me, I know what I'm saying.

And Mikera is right. I did not mention that in my original message, but we 
also work with simply lots of hardware (sometimes we equip huge building 
and complexes, full with all kinds of electronics and comms and devices and 
stuff). Yes, they are 32, 16 and often even 8 bit hardware components. That 
is a huge market, really.

I understand that there can be some challenge implementing the support for 
the datatypes, but, the benifit of doing that outweights the costs so 
much.. like having two hands instead of one. And don't say that most things 
in the world require one hand to do them.. 



On Monday, September 9, 2013 9:12:49 PM UTC+4, tbc++ wrote:
>
> Also, how much of this is a limit of the OpenGL library you are using? The 
> raw OpenGL API supports glVertex3d and glVertex3f. Is the double version 
> not supported by your java interface library?
>
> Timothy
>
>
> On Mon, Sep 9, 2013 at 11:07 AM, Timothy Baldridge 
> 
> > wrote:
>
>> It's worth noting that the restrictions to IFn do not apply to 
>> definterface and deftype. Not that solves all (or any) of your problems, 
>> I've used definterface before to lock down the actual types used. 
>>
>> Timothy
>>
>>
>> On Mon, Sep 9, 2013 at 11:03 AM, Jozef Wagner 
>> 
>> > wrote:
>>
>>> You can typehing ints for locals (let, loop), restrictions are just for 
>>> function arguments.
>>> AFAIK the reason is combinatorial explosion at 
>>> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java#L91
>>> I have the same problem with char. Because I cannot typehint e.g. my 
>>> whitespace? function with ^char, I recieve a boxed Object and thus cannot 
>>> use == for comparison.
>>>
>>> JW
>>>  
>>>
>>> On Mon, Sep 9, 2013 at 6:02 PM, Mikera 
>>> > wrote:
>>>
>>>> +1 for supporting all the JVM primitive types properly.
>>>>
>>>> It is worth noting that the benefits would extend much further than 
>>>> just OpenGL, e.g.:
>>>>  - int is a commonly used type in Java interop. Casting to/from it all 
>>>> the time is a minor annoyance/overhead
>>>>  - int is the type used for array indexing on the JVM
>>>>  - all the small (< 8 byte) primitive types save memory footprint, 
>>>> which is important since memory bandwidth is the limiting factor in some 
>>>> workloads
>>>>  - int/float fit into a register (and therefore perform much better) on 
>>>> 32 bit machines (which still exist, believe it or not)
>>>>  - char is a pretty useful primitive type if you are doing text 
>>>> processing
>>>>  - byte is also frequently useful, especially for IO
>>>>
>>>> I believe that with some enhancements to the Clojure compiler, 
>>>> supporting all the JVM primitive types shouldn't be too difficult, and it 
>>>> would provide many benefits 

Re: Clojure, floats, ints and OpenGL

2013-09-09 Thread Alex Fowler
Think for youself: how much you gain for storing color in 64 bit instead of 
32? How much you gain of storing positions to be projected on a, say, 
1920x1080 screen, in 64 bit, not 32? Considering this, how much you gain 
from manufacturing 64-bit enabled GPUs for average humans to use? And 
putting at least twice much hardware in them, when nobody ever notices the 
difference? And what about the cost? Also, no magical conversion 64->32 is 
done anywhere in the drivers or hardware interface.

On Monday, September 9, 2013 9:12:49 PM UTC+4, tbc++ wrote:
>
> Also, how much of this is a limit of the OpenGL library you are using? The 
> raw OpenGL API supports glVertex3d and glVertex3f. Is the double version 
> not supported by your java interface library?
>
> Timothy
>
>
> On Mon, Sep 9, 2013 at 11:07 AM, Timothy Baldridge 
> 
> > wrote:
>
>> It's worth noting that the restrictions to IFn do not apply to 
>> definterface and deftype. Not that solves all (or any) of your problems, 
>> I've used definterface before to lock down the actual types used. 
>>
>> Timothy
>>
>>
>> On Mon, Sep 9, 2013 at 11:03 AM, Jozef Wagner 
>> 
>> > wrote:
>>
>>> You can typehing ints for locals (let, loop), restrictions are just for 
>>> function arguments.
>>> AFAIK the reason is combinatorial explosion at 
>>> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java#L91
>>> I have the same problem with char. Because I cannot typehint e.g. my 
>>> whitespace? function with ^char, I recieve a boxed Object and thus cannot 
>>> use == for comparison.
>>>
>>> JW
>>>  
>>>
>>> On Mon, Sep 9, 2013 at 6:02 PM, Mikera 
>>> > wrote:
>>>
>>>> +1 for supporting all the JVM primitive types properly.
>>>>
>>>> It is worth noting that the benefits would extend much further than 
>>>> just OpenGL, e.g.:
>>>>  - int is a commonly used type in Java interop. Casting to/from it all 
>>>> the time is a minor annoyance/overhead
>>>>  - int is the type used for array indexing on the JVM
>>>>  - all the small (< 8 byte) primitive types save memory footprint, 
>>>> which is important since memory bandwidth is the limiting factor in some 
>>>> workloads
>>>>  - int/float fit into a register (and therefore perform much better) on 
>>>> 32 bit machines (which still exist, believe it or not)
>>>>  - char is a pretty useful primitive type if you are doing text 
>>>> processing
>>>>  - byte is also frequently useful, especially for IO
>>>>
>>>> I believe that with some enhancements to the Clojure compiler, 
>>>> supporting all the JVM primitive types shouldn't be too difficult, and it 
>>>> would provide many benefits both in terms of overall performance and 
>>>> interop convenience.
>>>>
>>>> On Monday, 9 September 2013 21:43:12 UTC+8, Alex Fowler wrote:
>>>>>
>>>>> Hello!
>>>>>
>>>>> With this letter I would like to receive an answer from somebody from 
>>>>> the development team (if anyone else has something to say, you're surely 
>>>>> welcome :) ).
>>>>>
>>>>> I am working for a big multimedia company and recently I have been 
>>>>> considering moving to Clojure as the main language of development. We 
>>>>> have 
>>>>> been doing Java and Scala before, but now when I tried Clojure and see 
>>>>> the 
>>>>> possibilities it provides, I would definitely stand for it to be our 
>>>>> ground. However, while I am so satisfied with everything - the language, 
>>>>> the community, the Java interop, there is still something that hinders 
>>>>> and 
>>>>> makes me linger. Namely, the lack of good support of floats and ints in 
>>>>> the 
>>>>> language. While many people would not consider it to be a huge 
>>>>> disadvantage 
>>>>> or even notice it, things are not so bright when it comes to OpenGL.
>>>>>
>>>>> The case is that OpenGL and 3D graphics hardware in general has no 
>>>>> support for doubles or longs. Therefore, all libraries, all data and all 
>>>>> computations are meant to be performed with floats and ints (shaders 
>>>>> too). 
>>>>> Due to the lack of good support of these data types in Clojure (for 
&

Re: Logos-oriented Lisp compiled to Javascript | coect.net

2013-09-09 Thread Alex Fowler
Well.. reminds me of Scala implicits. When some people think that implicits 
hurt the pure essense of good, I found them to be particulary useful, 
especially in some scenarios that involved passing many "boring" arguments. 
However, with implicits you could run into troubles, hunting invisible 
errors of type inference (Scala mark), and i am not sure how useful such 
technique will be in a lisp. How the compiler decides between, say 3 
equally valid candidates? These are the wanderings I came into while I was 
doing Scala and thinking over the whole matter, but I think that this is an 
interesting branch of research for computer languages and would like to see 
and know more of the experiments and try them.

On Tuesday, September 10, 2013 12:14:14 AM UTC+4, Mimmo Cosenza wrote:
>
> It seems interesting to be watched. 
>
> Does anyone already know something about it. 
>
> Mimmo 
>
> http://www.coect.net/metajs/ 
>

-- 
-- 
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] nativot 0.1.0 (leiningen plugin) public beta

2013-09-09 Thread Alex Fowler
The license section of the plugin page has been updated. The established 
license is EPL, same as Clojure!

среда, 28 августа 2013 г., 14:02:16 UTC+4 пользователь Alex Fowler написал:
>
> Plugin homepage: https://bitbucket.org/noncom/nativot
>
> As for the license: I have contacted JDotSoft, they're kindly giving the 
> green light! I am providing link to this post, so they can join the 
> discussion.
>
> Also, in the next version I am going to update the plugin and include the 
> current version of JarClassLoader from the website, so it can be used if no 
> internet is available. However, if internet is available, the plugin will 
> still contact the website and download the class, even if it is not newer 
> than the bundled version.
>

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


Clojure, floats, ints and OpenGL

2013-09-09 Thread Alex Fowler
Hello!

With this letter I would like to receive an answer from somebody from the 
development team (if anyone else has something to say, you're surely 
welcome :) ).

I am working for a big multimedia company and recently I have been 
considering moving to Clojure as the main language of development. We have 
been doing Java and Scala before, but now when I tried Clojure and see the 
possibilities it provides, I would definitely stand for it to be our 
ground. However, while I am so satisfied with everything - the language, 
the community, the Java interop, there is still something that hinders and 
makes me linger. Namely, the lack of good support of floats and ints in the 
language. While many people would not consider it to be a huge disadvantage 
or even notice it, things are not so bright when it comes to OpenGL.

The case is that OpenGL and 3D graphics hardware in general has no support 
for doubles or longs. Therefore, all libraries, all data and all 
computations are meant to be performed with floats and ints (shaders too). 
Due to the lack of good support of these data types in Clojure (for 
example, there are no ^float and ^int typehints, float and int values can 
only be typecasted to, all calculations always retain doubles and longs), 
results in too many extra typecasts, which are absolutely unnecessary and 
take too much time. So, calculations become very cumbersome, even if we do 
not take mandatory boxing into account.

Considering that such kinds of calculations are usually abuntant in the 
aforementioned types of applications, the penalty grows really huge. I have 
endeavoured several discussions on the IRC to find out possible 
workarounds. Although many good proposals by many good people were made, 
aimed at improving the situation, none of them could solve the fundamental 
lack of the ability to manipulate 32bit primitive (or even boxed) data 
types. That lack renders Clojure not really suitable for heavy-load OpenGL 
applications that require somewhat extensive calculations: some kinds of 
games, simulations, generative graphics and so on. Considering how superior 
Clojure is to any other language available for JVM, that black spot looks 
especially embarrasing. And I could imagine falling back to Java for fast 
computations, just like we fall back to ASM in, say C, that is very 
undesirable and discouraging, since we want to pick Clojure for Clojure and 
it will be too cumbersome to make 50/50% Java/Clojure apps just to work 
around that design decision.

Therefore, while deciding if to pick Clojure as the base for our 
development, I would like to know answers to the following questions:

1) What is the current reason for the support for these types to be missing?
2) Are there any plans for improvement of support for floats, ints and 
maybe, localized unboxed calculations? Or is there some advice on how to 
enable their support?
3) What is you vision for Clojure + OpenGL applications?
4) Is it possible to request support for floats, ints and maybe shorts for 
the language?
5) Is it possible to request support for localized unboxed calculations, 
like (with-unboxed ... ) and localized float-only and int-only 
calculations, like, say in special macros (with-floats-&-ints ... here go 
(+) (-) and stuff ONLY with floats/ints ... ) ?

Preferably, I would like to hear the answers from somebody from the 
development team, because I have already received enough support from the 
community, on the IRC, I appreciate it, but now I have to make a serious 
choice for our company and I feel quite responsible for that. I also feel 
that these questions are very important for any specialist that works with 
OpenGL and influence Clojure acceptance for OpenGL-enabled applications 
world-wide. Thank you.

-- 
-- 
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: new ClojureDocs experiment

2013-09-09 Thread Alex Fowler
That's really cool! Was always wondering if there's gone be something like 
that ever.. Gonna be visiting often! Wish also that it'd be near 
clojuredocs in search results if you google like "clojure parse", but 
that'a a different effort, I suppose.. keep up!

воскресенье, 8 сентября 2013 г., 12:07:33 UTC+4 пользователь Steven Degutis 
написал:
>
> ClojureDocs.org is pretty awesome, I think I use it nearly every day, 
> especially for the Examples and See Also sections. But sometimes I've 
> been wishing it had Clojure 1.5.1 support. For example, I think as-> 
> and cond-> would have been easier for me to pick up had there been 
> entries for these with community-driven Examples. 
>
> A while back, someone told me "complaining is laziness". So I worked 
> on an experiment that I'd like to propose to you all. It's a github 
> wiki that's been seeded with data scraped from in-process docs and 
> clojuredocs.org's API. Here it is: 
>
> https://github.com/sdegutis/clojuredocs/wiki 
>
> Pros: 
> - Docs are for Clojure 1.5.1 
> - Anyone logged into github can edit it 
> - Any part of it can be edited (to fix typos in docstring, etc) 
> - All namespaces are shown on the Home page for easy searching 
> - Free hosting, free database storage :) 
>
> Cons: 
> - Doesn't have dynamic relevance-based search field 
> - Doesn't have an API (but an external one could be built) 
> - Doesn't have Quick Ref tables (yet) 
> - A few URLs are kind of ugly 
> - The namespace-navigation bar is gone, you'd have to click Home 
> - Doesn't store nearly as much data as clojuredocs.org does 
>
> (But as usual, pros/cons are totally subjective to individual needs. 
> This is just how I saw it. These tables may be reversed for you, who 
> knows.) 
>
> Right now, it only has core namespaces. But I've made it easy to add 
> data from new namespaces, so long as the right dependencies are added 
> to project.clj. 
>
> Thoughts? 
>
> -Steven 
>

-- 
-- 
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: Clojure and freelancing

2013-09-09 Thread Alex Fowler
As for your question, the answer is: absolutely suitable. From my personal 
experience, http://www.luminusweb.net/ gives a good start. People say that 
Pedestal is gonna be great too, but I did not use it yet.

понедельник, 9 сентября 2013 г., 0:31:13 UTC+4 пользователь Mateusz Dobek 
написал:
>
> Is Clojure good choice for one-man-webdevelopment-team?
>
> I switched form Ruby on Rails, and now I'm learing Clojure.  It seems to 
> be really powerfull language, but will it suits for web? 
> Wanna give it a try in Pedestal framework.
>

-- 
-- 
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: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Alex Fowler
I would also add that in case, if you *need* to destructure the `options` 
map for some reason, like:

`(defn search
  "Docstring"
  [mapping-type & {:keys [option-1 option-2] :as options}]
  (do-smth-with-option-1 ...)
  (apply esd/search es-index mapping-type options))`

then you can use `mapply` to apply maps to functions that accept optional 
args maps. The code of mapply is the fllowing:

`(defn mapply [f & args] (apply f (apply concat (butlast args) (last 
args`

Combining it with partial, as adviced, could give you the functionality you 
may sometimes need:

`(mapply (partial es/search es-index) your-options-map)`



понедельник, 9 сентября 2013 г., 12:42:57 UTC+4 пользователь Mark Mandel 
написал:
>
> Hey all,
>
> Relatively new to Clojure, and I'm wondering if there is a better/simpler 
> way to handle what I'm doing.
>
> I'm working with the Elastisch library for interacting with ElasticSearch, 
> and it has the following function:
>
> http://reference.clojureelasticsearch.info/clojurewerkz.elastisch.rest.document.html#var-search
>
> (search index mapping-type & {:as options})
>
> That's all fine, except I want to call it from another function, to 
> provide my default values for `index`, but still allow for the passthrough 
> the options map for the `search` function.
>
> The solution I came up with was:
>
> (defn search
> "Search the mapping-type, with the given properties"
> [mapping-type & {:as options}]
> (apply esd/search (reduce (fn [coll [k, v]] (conj coll k v)) [es-index 
> mapping-type] options)))
>
> Where `es-index` is already defined as a global def.
>
> So basically I break the options apart into a vector, and apply it over 
> the top of the esd/search function (where esd is the elastisch function 
> defined earlier).
>
> Does this make sense? Is there a better way?
>
> It works, but wondering if there is an improvement I could make, 
> especially as I could see myself doing this quite often.
>
> Thanks in advance,
>
> Mark
>
>
>

-- 
-- 
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] nativot 0.1.0 (leiningen plugin) public beta

2013-08-28 Thread Alex Fowler
Plugin homepage: https://bitbucket.org/noncom/nativot

As for the license: I have contacted JDotSoft, they're kindly giving the 
green light! I am providing link to this post, so they can join the 
discussion.

Also, in the next version I am going to update the plugin and include the 
current version of JarClassLoader from the website, so it can be used if no 
internet is available. However, if internet is available, the plugin will 
still contact the website and download the class, even if it is not newer 
than the bundled version.

-- 
-- 
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] nativot 0.1.0 (leiningen plugin) public beta

2013-08-27 Thread Alex Fowler
Oh right, there is the license hassle. I am going to contact JDotSoft and 
see if it is possible to make it all more friendly!

вторник, 27 августа 2013 г., 4:26:42 UTC+4 пользователь Mikera написал:
>
> JarClassLoader looks cool
>
> Aren't there some pretty severe licensing restrictions though? Looks like 
> it is GPLv3 or commercial license only from the website, which rules it out 
> of most EPL projects I think
>
> On Tuesday, 27 August 2013 03:50:10 UTC+8, Alex Fowler wrote:
>>
>>
>> hi, nativot is a leiningen plugin that is intended to deliver clojurians 
>> from the burden of classpath hells of any flavour.
>>
>> highlights:
>>
>> 1) built upon lein uberjar and jdotsoft jarclassloader
>> 2) makes it possible to deploy clojure application that depend upon any 
>> jar-files, native libraries, binary resources and other goodness
>> 3) you can deploy your application as a single jar, as well as a single 
>> jar with externalized resources. more on this at 
>> http://www.jdotsoft.com/JarClassLoader.php
>> 4) simple
>>
>> notes:
>>
>> 1) still in beta
>> 2) requires active internet connection
>> 3) due to some leiningen project management pecularities, requires some 
>> manual project.clj adjustment, see the description at clojars, or the 
>> description in the next post in this thread
>> 4) creates additional source folders in your project
>> 5) worships the "just put that jar/native/binary nearby and it will be 
>> included" approach instead of the traditional "repeatability" maven-induced 
>> one. USE WITH CARE. the plugin is not intended to replace the repeatability 
>> approach. actually they are better used together.
>>
>>
>> clojars link: https://clojars.org/nativot
>>
>> disclaimer: this is my first plugin for leningen and i am new to clojure, 
>> so take it easy. and thanks to Zach Tellman for kind guidance!
>>
>> any success stories, failure stories, bug reports, ideas on improvement 
>> and such are welcomed.
>>
>>
>>

-- 
-- 
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] nativot 0.1.0 (leiningen plugin) public beta

2013-08-26 Thread Alex Fowler
---
description
---

A Leiningen plugin to jar your project with arbitrary jars, native libs and 
resources into main jar.

   Based on the wonderful JDotSoft JarClassLoader.

   USAGE:

A.
---
Create a :nativot profile in your project.clj
The map is this:
:nativot {:nativot-inclusions [\"folder-1\" \"folder-2\"]
  :nativot-main your-project.core ;the main of you project as 
it would normally be
  :nativot-aot [your-project.core jcl.ep]} ;although that did 
not save lein.

B.
---
1) Due to the leiningens pecularities, only :nativot-inclusions matter
2) You have to manually specify :java-source-paths 
[\"src/com/jdotsoft/jarloader\"]
3) You have to manually specify :aot [you-project.core jcl.ep]

Note: The jcl.ep is a must.

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


[ANN] nativot 0.1.0 (leiningen plugin) public beta

2013-08-26 Thread Alex Fowler

hi, nativot is a leiningen plugin that is intended to deliver clojurians 
from the burden of classpath hells of any flavour.

highlights:

1) built upon lein uberjar and jdotsoft jarclassloader
2) makes it possible to deploy clojure application that depend upon any 
jar-files, native libraries, binary resources and other goodness
3) you can deploy your application as a single jar, as well as a single jar 
with externalized resources. more on this at 
http://www.jdotsoft.com/JarClassLoader.php
4) simple

notes:

1) still in beta
2) requires active internet connection
3) due to some leiningen project management pecularities, requires some 
manual project.clj adjustment, see the description at clojars, or the 
description in the next post in this thread
4) creates additional source folders in your project
5) worships the "just put that jar/native/binary nearby and it will be 
included" approach instead of the traditional "repeatability" maven-induced 
one. USE WITH CARE. the plugin is not intended to replace the repeatability 
approach. actually they are better used together.


clojars link: https://clojars.org/nativot

disclaimer: this is my first plugin for leningen and i am new to clojure, 
so take it easy. and thanks to Zach Tellman for kind guidance!

any success stories, failure stories, bug reports, ideas on improvement and 
such are welcomed.


-- 
-- 
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: Getting a living standalone jar with "lein uberjar" and a handful of resources

2013-07-31 Thread Alex Fowler
Thank you for the advice and I will explore the Archiva initiative, 
however, I think it would do for jars, but not to managing application 
resources during development. For example, pictures used in the application 
may change several times a day, depending on how designers work, and having 
it managed by something other than the trivial OS filesystem is an 
overkill.. Besides that, the java engine that I am using, has it's own 
means of loading files from locations available for search which, I think, 
does not include getting something from a repository...

среда, 31 июля 2013 г., 20:19:21 UTC+4 пользователь red...@gmail.com 
написал:
>
> On 7/31/13 4:18 AM, Alex Fowler wrote: 
> > I have an application which is built fine with uberjar with an exception 
> of 
> > two things which do not get incuded: 
> > 1) Additonal jar files (about 150Mb) from various Java libraries that 
> are 
> > not present on Clojars and that I have no power of will or time of 
> trying 
> > to upload them there. This folder is speciiified with :resource-paths in 
> > project.clj 
> > 2) About 150Mb of resources such as pictures and video-files which are 
> > loaded by these java libraries using *their own methods* which I cannot 
> > change. 
> > 
> > What lein uberjar does - it skips these files and simply creates an 
> > incomplete jar with my compiled sources, which does not launch because 
> it 
> > is missing those files. However, "lein run" works just fine! 
> > 
> > My question is: how do I make a single jar with lein that, being run 
> with 
> > "java -jar" exposes the same behavior as simply "lein run"? 
> > 
> > PS: As an idea: when I was programming in Scala, I was using 
> > "com.jdotsoft.jarloader.JarClassLoader" which was the entry point in my 
> app 
> > and I could simply put all files into the jar and it would search them 
> in 
> > that order: 
> > 1) recursively inside the jar 
> > 2) in the same folder as the jar (which would allow simple externalizing 
> of 
> > files like settings files if needed to be exposed to users). 
> > 3) in system path folders... 
> > Maybe there is a way to use that magical JarClassLoader with 
> > Leiningen/Clojure? 
> > 
>
> clojars is just a maven repo, and a simple maven repo is just a http 
> server. 
>
> you can setup your own "private maven repo" easily by copying the 
> directory structure of your ~/.m2 to an http server somewhere. 
>
> for something more full featured you can setup something like apache 
> archiva (which is what I use at work) http://archiva.apache.org/index.cgi 
>
> once you have a private maven repo you can deploy whatever you want to 
> it, and use whatever you deploy has a dependency as normal 
>
>
> -- 
> And what is good, Phaedrus, 
> And what is not good-- 
> Need we ask anyone to tell us these things? 
>
>

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




Getting a living standalone jar with "lein uberjar" and a handful of resources

2013-07-31 Thread Alex Fowler
I have an application which is built fine with uberjar with an exception of 
two things which do not get incuded:
1) Additonal jar files (about 150Mb) from various Java libraries that are 
not present on Clojars and that I have no power of will or time of trying 
to upload them there. This folder is speciiified with :resource-paths in 
project.clj 
2) About 150Mb of resources such as pictures and video-files which are 
loaded by these java libraries using *their own methods* which I cannot 
change.

What lein uberjar does - it skips these files and simply creates an 
incomplete jar with my compiled sources, which does not launch because it 
is missing those files. However, "lein run" works just fine!

My question is: how do I make a single jar with lein that, being run with 
"java -jar" exposes the same behavior as simply "lein run"?

PS: As an idea: when I was programming in Scala, I was using 
"com.jdotsoft.jarloader.JarClassLoader" which was the entry point in my app 
and I could simply put all files into the jar and it would search them in 
that order:
1) recursively inside the jar
2) in the same folder as the jar (which would allow simple externalizing of 
files like settings files if needed to be exposed to users).
3) in system path folders...
Maybe there is a way to use that magical JarClassLoader with 
Leiningen/Clojure?

-- 
-- 
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: ns defaults

2013-07-22 Thread Alex Fowler
A stray comment, but maybe it can give you some going, in a combo with 
:require-macros or cljs repl - 
http://stackoverflow.com/questions/9847013/syntax-of-require-in-the-clojurescript-repl

пятница, 19 июля 2013 г., 23:03:30 UTC+4 пользователь Jozef Wagner написал:
>
> On Friday, July 19, 2013 4:20:36 PM UTC+2, Stuart Sierra wrote:
>>
>> On Thursday, July 18, 2013 4:34:49 AM UTC-4, Jozef Wagner wrote:
>>
>> > Compiler loads and refers clojure.core namespace for each
>> > new namespace. In my projects, I often have one or two
>> > namespaces I use nearly in every other namespace. (e.g.
>> > clojure.tools.logging or clojure.string). It would be
>> > convenient if I could specify ns defaults somewhere and
>> > those declarations would be used for every compiled
>> > namespace.
>>
>>
>> You can do this without hacking the compiler if you're
>> willing to add one extra line to your source files.
>>
>> Just define a function that `require`s and `refer`s all the
>> symbols you want, and call it at the top of each namespace.
>> You'll break tools that expect to be able to infer namespace
>> dependencies from the literal source (e.g. tools.namespace)
>> but it will do what you want.
>>
>> -S
>>
>
> Yes, but this seems to work only in Clojure, not in ClojureScript.
>
> JW
>  
>

-- 
-- 
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: concat primitive arrays

2013-07-21 Thread Alex Fowler
Glad you've found it! :D

As an off-topic side-note: please, use no underscores in naming, use 
hyphens instead, this is lisp's style... like "sizes_r" become "sizes-r". 
Many ppl will thank you later :)

On Sunday, July 21, 2013 11:39:17 PM UTC+4, Brian Craft wrote:
>
> Using getComponentType, it appears to be handling different primitive 
> array types ok:
>
> (defn fconcat [& arrays]
>  (let [sizes (map count arrays)
>sizes_r (vec (reductions + sizes))
>offsets (cons 0 (drop-last sizes_r))
>total (last sizes_r)
>out (make-array (.getComponentType (class (first arrays))) total)]
>(dorun (map #(System/arraycopy %2 0 out %1 %3) offsets arrays sizes))
>out))
>
>
>
> On Sunday, July 21, 2013 12:26:26 PM UTC-7, Brian Craft wrote:
>>
>> (make-array (.getComponentType (class arr)) n)  seems to work.
>>
>> On Sunday, July 21, 2013 12:22:41 PM UTC-7, Brian Craft wrote:
>>>
>>> Is there a way to create an array with the type of another array? (type 
>>> arr) returns the array type, but make-array wants the element type not the 
>>> array type, so 
>>>
>>> (make-array (type arr) n)
>>>
>>> doesn't work as one might hope.
>>>
>>>
>>> On Sunday, July 21, 2013 8:36:22 AM UTC-7, Alex Fowler wrote:
>>>>
>>>> Java's System.arraycopy is the fastest you can get, since it delegates 
>>>> execution to a function implemented in C inside JVM. Simply, this is the 
>>>> fastest that your computer hardware can get. All in all Java arrays meet 
>>>> the same difficulties and implications as C arrays and that is why 
>>>> concationation of raw arrays is so "complex", in contrast to higher-level 
>>>> collections which use objects and pointers (e.g. LinkedList). In other 
>>>> words, difficulties you experience are natural outcome of how computer's 
>>>> memory management is made and there is no way around them. You get the 
>>>> most 
>>>> of the speed from arrays because they are solid (not fragmented) chunks of 
>>>> bytes allocated in memory in the moment of their creation. For that very 
>>>> reason you cannot extend an existing array (the size cannot be changed 
>>>> after creation) and you can't concatenate it with another array since 
>>>> first 
>>>> it would have to be concatenated.
>>>>
>>>> The natural outcome also is that only arrays of same types can be 
>>>> concatenated with System.arraycopy since only array pointers store type 
>>>> data, and the contents are simply untyped bytes. And this is why it is 
>>>> byte-level and no type-checks are ever done besiedes the initial 
>>>> type-check. Again, higher-level pointer-based data structures like 
>>>> LinkedList or Queue can introduce boxed typed values, but that'd be waaay 
>>>> slower. Considering that only arrays of same type are concatenateable, 
>>>> creating a polymorphic function is easy - simply check the argument type 
>>>> like:
>>>>
>>>> ; first save types to use them later
>>>> (def arr-type-int (class (ints 3)))
>>>> ; ... same for other primitives...
>>>>
>>>> ; then in your func:
>>>> (cond
>>>>   (= (class arr) arr-type-int) (do-int-concat)
>>>>   ...)
>>>>
>>>> For more reference:
>>>> http://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
>>>> http://docstore.mik.ua/orelly/java-ent/jnut/ch02_09.htm
>>>>
>>>> As an alternative, try looking into Java NIO buffers - they too are 
>>>> fast and too have some limits. But maybe you could make good of them, 
>>>> depends on your use case.
>>>>
>>>> Although somewhat in another vein, but still relating fast data 
>>>> management is 
>>>> https://groups.google.com/forum/?hl=en#!topic/clojure/BayfuaqMzvs which 
>>>> brings in C-like structs in.
>>>>
>>>> On Sunday, July 21, 2013 2:39:38 AM UTC+4, Brian Craft wrote:
>>>>>
>>>>> Here are some experiments that aren't polymorphic. The 
>>>>> System/arraycopy version is fastest, by far. Is there any good way to 
>>>>> make 
>>>>> the other versions faster, or make them handle any array type?
>>>>>
>>>>> (defn bconcat [& arrays]
>>>>>  (let [sizes (map count arra

Re: java interop: passing int[]

2013-07-21 Thread Alex Fowler
Hmmm,  true about proxies.. as for hiphip - I did not use it yet, but I 
thought that it may be useful for fast array operations, sorry confused the 
posts :) I gonna try it sometime I think.. and I think that it has no 
built-in matrix ops, but there was a library somewhere that did matrix ops..

On Saturday, July 20, 2013 10:05:30 PM UTC+4, Brian Craft wrote:
>
> I've been looking at hiphip, though it's not clear to me how it's related 
> to h2 user functions. ;)
>
> It wasn't immediately clear to me if hiphip handles multidimensional matix 
> operations.
>
> On Saturday, July 20, 2013 9:32:50 AM UTC-7, Alex Fowler wrote:
>>
>> BTW, take a look 
>> http://blog.getprismatic.com/blog/2013/7/10/introducing-hiphip-array-fast-and-flexible-numerical-computation-in-clojure
>>
>> суббота, 20 июля 2013 г., 17:42:36 UTC+4 пользователь Brian Craft написал:
>>>
>>> I'm trying to write a user function for h2. I think that means I need 
>>> gen-class, but I'm extremely fuzzy on how java class loading works. Perhaps 
>>> my question is moot, because I just ran across this obscure note in a 
>>> gen-class example:
>>>
>>> ;; declare only new methods, not superclass methods
>>>
>>> If I'm implementing an interface in h2, does that mean I shouldn't 
>>> declare the methods? I also found a stackoverflow answer that suggested 
>>> something like
>>>
>>> ["[Ljava.lang.Integer;"]
>>>
>>> which looks like black magic, and I can't find this in the docs anywhere.
>>>
>>> On Saturday, July 20, 2013 2:39:06 AM UTC-7, Alex Fowler wrote:
>>>>
>>>> Some questions to clarify things up:
>>>>
>>>> Do you mean - how do you create that type of value or how do you 
>>>> generatte a method that accepts that very type?
>>>>
>>>> Are you sure you need to use gen-class and not proxy or reify?
>>>>
>>>> суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь Brian Craft 
>>>> написал:
>>>>>
>>>>> For implementing a method with this signature
>>>>>
>>>>> int getType(int[] inputTypes) 
>>>>>
>>>>> How would I declare inputTypes in gen-class?
>>>>>
>>>>

-- 
-- 
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: Making RPCs with Shoreleave

2013-07-21 Thread Alex Fowler
Considering the severity of the bug that i found, i want to ask if someone 
is using Shoreleave's rpc without any problems?  Maybe it's me missing 
something? Or maybe someone run into the same problem too?

On Saturday, July 20, 2013 2:16:02 PM UTC+4, Alex Fowler wrote:
>
> That wasn't hte case either. After some buzz with ddellacosta and others 
> on #clojure, it was found that the RPC call is unable to find that very 
> remote procedure I was requesting. Then I have verified that all is 
> properly stored in the remote procedures registry on backend and that the 
> front end makes proper calls. The problem was that the backend was 
> expecting edn while the frontend was sending it in html-form format in 
> request body. I am just a beginner with Clojure's web stack, so I think 
> that maybe I missed some wrappers with Noir or Ring, but I was doing all 
> according to the tutorial and it failed to work. So I had to manually 
> override several functions from Shoreleave back-end and front-end to behave 
> coherently and send and receive data in edn format. I think this makes a 
> patch for the library since the RPC functionality is broken out-of-the-box. 
> Unless I am missing something crucial, but examples I found miss that 
> either...
>
>
>
> четверг, 18 июля 2013 г., 15:42:35 UTC+4 пользователь terjesb написал:
>>
>> The default /_shoreleave endpoint should work if you're running using 
>> lein ring server.
>>
>> Are you running a WAR in a container? If so, I don't think Shoreleave 
>> currently picks up the context. If you have only one client app, you could 
>> proxy this using nginx in front on your container. For multiple client apps 
>> (also standalone, without a container), you may need to do what I did:
>>
>> override default "/_shoreleave" in your app: (wrap-rpc 
>> "/your-context/_shoreleave")
>>
>> and then (binding [shoreleave.remotes.http-rpc/*remote-uri* 
>> "/your-context/_shoreleave"] ) around your client calls.
>>
>> Terje.
>>
>>
>>
>>
>> kl. 10:50:17 UTC+2 mandag 15. juli 2013 skrev Alex Fowler følgende:
>>>
>>> Did not work.. all that is strange since I've been following the manual 
>>> step-by-step.. looks like the shoreleave's wrapper does not even create a 
>>> http route for itself... any other ideas?
>>>
>>> On Friday, July 12, 2013 7:14:42 AM UTC+4, Samrat Man Singh wrote:
>>>>
>>>> I think you need to (use projectname.ajax) in your projectname.handler 
>>>> page. If I remember correctly, there's also a way to specify which 
>>>> namespace your remote function is in.
>>>>
>>>> On Thursday, July 11, 2013 10:42:15 PM UTC+5:45, Alex Fowler wrote:
>>>>>
>>>>> Hi all, this is my first experience with Shoreleave and I'm trying to 
>>>>> use it's RPC mechanism to perform AJAX tasks. However, on a call to a 
>>>>> remote procedure, I get this:
>>>>>
>>>>> `
>>>>>
>>>>>1. POST http://localhost:8080/_shoreleave 404 (Not Found) 
>>>>>cljs.js:25223 <http://localhost:8080/js/cljs.js>
>>>>>   1. 
>>>>> goog.net.XhrIo.sendcljs.js:25223<http://localhost:8080/js/cljs.js>
>>>>>   2. xhr__delegatecljs.js:31416 <http://localhost:8080/js/cljs.js>
>>>>>   3. xhrcljs.js:31423 <http://localhost:8080/js/cljs.js>
>>>>>   4. 
>>>>> remote_callback__delegatecljs.js:32504<http://localhost:8080/js/cljs.js>
>>>>>   5. remote_callbackcljs.js:32515<http://localhost:8080/js/cljs.js>
>>>>>   6. load_storecljs.js:32745 <http://localhost:8080/js/cljs.js>
>>>>>   7. 
>>>>> mk__AMPERSAND__load_store__delegatecljs.js:32755<http://localhost:8080/js/cljs.js>
>>>>>   8. 
>>>>> mk__AMPERSAND__load_storecljs.js:32763<http://localhost:8080/js/cljs.js>
>>>>>   9. example_storecljs.js:33341 <http://localhost:8080/js/cljs.js>
>>>>>   10. simplecljs.js:33361 <http://localhost:8080/js/cljs.js>
>>>>>   11. setup_guicljs.js:33962 <http://localhost:8080/js/cljs.js>
>>>>>   12. setup_allcljs.js:33982 <http://localhost:8080/js/cljs.js>
>>>>>   13. startupcljs.js:41166 <http://localhost:8080/js/cljs.js>
>>>>>   14. onloadapp:2 <http://localhost:8080/app>
>>>

Re: concat primitive arrays

2013-07-21 Thread Alex Fowler
Java's System.arraycopy is the fastest you can get, since it delegates 
execution to a function implemented in C inside JVM. Simply, this is the 
fastest that your computer hardware can get. All in all Java arrays meet 
the same difficulties and implications as C arrays and that is why 
concationation of raw arrays is so "complex", in contrast to higher-level 
collections which use objects and pointers (e.g. LinkedList). In other 
words, difficulties you experience are natural outcome of how computer's 
memory management is made and there is no way around them. You get the most 
of the speed from arrays because they are solid (not fragmented) chunks of 
bytes allocated in memory in the moment of their creation. For that very 
reason you cannot extend an existing array (the size cannot be changed 
after creation) and you can't concatenate it with another array since first 
it would have to be concatenated.

The natural outcome also is that only arrays of same types can be 
concatenated with System.arraycopy since only array pointers store type 
data, and the contents are simply untyped bytes. And this is why it is 
byte-level and no type-checks are ever done besiedes the initial 
type-check. Again, higher-level pointer-based data structures like 
LinkedList or Queue can introduce boxed typed values, but that'd be waaay 
slower. Considering that only arrays of same type are concatenateable, 
creating a polymorphic function is easy - simply check the argument type 
like:

; first save types to use them later
(def arr-type-int (class (ints 3)))
; ... same for other primitives...

; then in your func:
(cond
  (= (class arr) arr-type-int) (do-int-concat)
  ...)

For more reference:
http://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
http://docstore.mik.ua/orelly/java-ent/jnut/ch02_09.htm

As an alternative, try looking into Java NIO buffers - they too are fast 
and too have some limits. But maybe you could make good of them, depends on 
your use case.

Although somewhat in another vein, but still relating fast data management 
is https://groups.google.com/forum/?hl=en#!topic/clojure/BayfuaqMzvs which 
brings in C-like structs in.

On Sunday, July 21, 2013 2:39:38 AM UTC+4, Brian Craft wrote:
>
> Here are some experiments that aren't polymorphic. The System/arraycopy 
> version is fastest, by far. Is there any good way to make the other 
> versions faster, or make them handle any array type?
>
> (defn bconcat [& arrays]
>  (let [sizes (map count arrays)
>sizes_r (vec (reductions + sizes))
>offsets (cons 0 (drop-last sizes_r))
>total (last sizes_r)
>out (float-array total)]
>(dorun (map #(System/arraycopy %2 0 out %1 %3) offsets arrays sizes))
>out))
>
> (defn cconcat [& arrays]
>  (let [vs (map vec arrays)
>cc (apply concat vs)]
>(float-array cc)))
>
> (defn dconcat [& arrays]
>  (let [vs (map vec arrays)
>cc (reduce into [] vs)]
>(float-array cc)))
>
> (defn econcat [& arrays]
>  (let [cc (reduce into [] arrays)]
>(float-array cc)))
>
>
> On Saturday, July 20, 2013 2:24:14 PM UTC-7, Brian Craft wrote:
>>
>> Is there an easy, fast way to concat primitive arrays? I was hoping java 
>> arrays had some common interface for this, but I haven't found much of use. 
>> I mostly see code like this:
>>
>> byte[] c = new byte[a.length + b.length];
>> System.arraycopy(a, 0, c, 0, a.length);
>> System.arraycopy(b, 0, c, a.length, b.length);
>>
>> which only works for bytes (in this case).
>>
>

-- 
-- 
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: java interop: passing int[]

2013-07-20 Thread Alex Fowler
So, out of what you're saying - you want to implement an interface, without 
adding new methods - I strongly suggest using proxy and delegate all the 
type-resolution hassle to JVM (just rely on it).

If you are really sure you need specifying types explicitly, then use type 
hints and dedicated clojure handling functions. Explore typehints like 
`^ints` or `^floats` and array-related functions like (ints) or 
(int-array). I would avoid using gen-class until it is really necessary 
(out of bytecode compatibility requirements I guess)


суббота, 20 июля 2013 г., 17:42:36 UTC+4 пользователь Brian Craft написал:
>
> I'm trying to write a user function for h2. I think that means I need 
> gen-class, but I'm extremely fuzzy on how java class loading works. Perhaps 
> my question is moot, because I just ran across this obscure note in a 
> gen-class example:
>
> ;; declare only new methods, not superclass methods
>
> If I'm implementing an interface in h2, does that mean I shouldn't declare 
> the methods? I also found a stackoverflow answer that suggested something 
> like
>
> ["[Ljava.lang.Integer;"]
>
> which looks like black magic, and I can't find this in the docs anywhere.
>
> On Saturday, July 20, 2013 2:39:06 AM UTC-7, Alex Fowler wrote:
>>
>> Some questions to clarify things up:
>>
>> Do you mean - how do you create that type of value or how do you 
>> generatte a method that accepts that very type?
>>
>> Are you sure you need to use gen-class and not proxy or reify?
>>
>> суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь Brian Craft написал:
>>>
>>> For implementing a method with this signature
>>>
>>> int getType(int[] inputTypes) 
>>>
>>> How would I declare inputTypes in gen-class?
>>>
>>

-- 
-- 
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: java interop: passing int[]

2013-07-20 Thread Alex Fowler
BTW, take a look 
http://blog.getprismatic.com/blog/2013/7/10/introducing-hiphip-array-fast-and-flexible-numerical-computation-in-clojure

суббота, 20 июля 2013 г., 17:42:36 UTC+4 пользователь Brian Craft написал:
>
> I'm trying to write a user function for h2. I think that means I need 
> gen-class, but I'm extremely fuzzy on how java class loading works. Perhaps 
> my question is moot, because I just ran across this obscure note in a 
> gen-class example:
>
> ;; declare only new methods, not superclass methods
>
> If I'm implementing an interface in h2, does that mean I shouldn't declare 
> the methods? I also found a stackoverflow answer that suggested something 
> like
>
> ["[Ljava.lang.Integer;"]
>
> which looks like black magic, and I can't find this in the docs anywhere.
>
> On Saturday, July 20, 2013 2:39:06 AM UTC-7, Alex Fowler wrote:
>>
>> Some questions to clarify things up:
>>
>> Do you mean - how do you create that type of value or how do you 
>> generatte a method that accepts that very type?
>>
>> Are you sure you need to use gen-class and not proxy or reify?
>>
>> суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь Brian Craft написал:
>>>
>>> For implementing a method with this signature
>>>
>>> int getType(int[] inputTypes) 
>>>
>>> How would I declare inputTypes in gen-class?
>>>
>>

-- 
-- 
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: Making RPCs with Shoreleave

2013-07-20 Thread Alex Fowler
That wasn't hte case either. After some buzz with ddellacosta and others on 
#clojure, it was found that the RPC call is unable to find that very remote 
procedure I was requesting. Then I have verified that all is properly 
stored in the remote procedures registry on backend and that the front end 
makes proper calls. The problem was that the backend was expecting edn 
while the frontend was sending it in html-form format in request body. I am 
just a beginner with Clojure's web stack, so I think that maybe I missed 
some wrappers with Noir or Ring, but I was doing all according to the 
tutorial and it failed to work. So I had to manually override several 
functions from Shoreleave back-end and front-end to behave coherently and 
send and receive data in edn format. I think this makes a patch for the 
library since the RPC functionality is broken out-of-the-box. Unless I am 
missing something crucial, but examples I found miss that either...



четверг, 18 июля 2013 г., 15:42:35 UTC+4 пользователь terjesb написал:
>
> The default /_shoreleave endpoint should work if you're running using lein 
> ring server.
>
> Are you running a WAR in a container? If so, I don't think Shoreleave 
> currently picks up the context. If you have only one client app, you could 
> proxy this using nginx in front on your container. For multiple client apps 
> (also standalone, without a container), you may need to do what I did:
>
> override default "/_shoreleave" in your app: (wrap-rpc 
> "/your-context/_shoreleave")
>
> and then (binding [shoreleave.remotes.http-rpc/*remote-uri* 
> "/your-context/_shoreleave"] ) around your client calls.
>
> Terje.
>
>
>
>
> kl. 10:50:17 UTC+2 mandag 15. juli 2013 skrev Alex Fowler følgende:
>>
>> Did not work.. all that is strange since I've been following the manual 
>> step-by-step.. looks like the shoreleave's wrapper does not even create a 
>> http route for itself... any other ideas?
>>
>> On Friday, July 12, 2013 7:14:42 AM UTC+4, Samrat Man Singh wrote:
>>>
>>> I think you need to (use projectname.ajax) in your projectname.handler 
>>> page. If I remember correctly, there's also a way to specify which 
>>> namespace your remote function is in.
>>>
>>> On Thursday, July 11, 2013 10:42:15 PM UTC+5:45, Alex Fowler wrote:
>>>>
>>>> Hi all, this is my first experience with Shoreleave and I'm trying to 
>>>> use it's RPC mechanism to perform AJAX tasks. However, on a call to a 
>>>> remote procedure, I get this:
>>>>
>>>> `
>>>>
>>>>1. POST http://localhost:8080/_shoreleave 404 (Not Found) 
>>>>cljs.js:25223 <http://localhost:8080/js/cljs.js>
>>>>   1. goog.net.XhrIo.sendcljs.js:25223<http://localhost:8080/js/cljs.js>
>>>>   2. xhr__delegatecljs.js:31416 <http://localhost:8080/js/cljs.js>
>>>>   3. xhrcljs.js:31423 <http://localhost:8080/js/cljs.js>
>>>>   4. 
>>>> remote_callback__delegatecljs.js:32504<http://localhost:8080/js/cljs.js>
>>>>   5. remote_callbackcljs.js:32515<http://localhost:8080/js/cljs.js>
>>>>   6. load_storecljs.js:32745 <http://localhost:8080/js/cljs.js>
>>>>   7. 
>>>> mk__AMPERSAND__load_store__delegatecljs.js:32755<http://localhost:8080/js/cljs.js>
>>>>   8. 
>>>> mk__AMPERSAND__load_storecljs.js:32763<http://localhost:8080/js/cljs.js>
>>>>   9. example_storecljs.js:33341 <http://localhost:8080/js/cljs.js>
>>>>   10. simplecljs.js:33361 <http://localhost:8080/js/cljs.js>
>>>>   11. setup_guicljs.js:33962 <http://localhost:8080/js/cljs.js>
>>>>   12. setup_allcljs.js:33982 <http://localhost:8080/js/cljs.js>
>>>>   13. startupcljs.js:41166 <http://localhost:8080/js/cljs.js>
>>>>   14. onloadapp:2 <http://localhost:8080/app>
>>>>   
>>>> XHR ERROR: Not Found 
>>>> `
>>>>
>>>> What is wrong and how do I fix it? I have been following this tutorial: 
>>>> Shoreleave 
>>>> Tutorial 10 - Introducing 
>>>> Ajax<https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-10.md>
>>>>  my 
>>>> code (relevant parts) is this:
>>>>
>>>> Project.clj:
>>>> `
>>>> (defproject projectname "0.1.0-SNAPSHOT"
>>>>   :description "FIXME: write description"
>>>>   :ur

Re: java interop: passing int[]

2013-07-20 Thread Alex Fowler
Some questions to clarify things up:

Do you mean - how do you create that type of value or how do you generatte 
a method that accepts that very type?

Are you sure you need to use gen-class and not proxy or reify?

суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь Brian Craft написал:
>
> For implementing a method with this signature
>
> int getType(int[] inputTypes) 
>
> How would I declare inputTypes in gen-class?
>

-- 
-- 
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: Performance Patterns

2013-07-15 Thread Alex Fowler
I would definitely like to have such a reference because I often work with 
performance-critical code which I mostly delegate to Java. I would like to 
see it organized in categories for easier access, with commentaries to each 
case on why is this so (for example, i would suppose that aset-int should 
be faster in your example, but this is not true). As a recommendation, you 
could probably use some libraries like https://github.com/ptaoussanis/timbre to 
produce more sophisticated tests. Also check for existing materials like 
https://www.youtube.com/watch?v=ii-ajztxALM and such..

Also, afaik, most of Clojure community seem to not be very concerned with 
performance, so not everyone will be deeply interested, but I and someone 
else would definitely be.

On Sunday, July 14, 2013 12:15:04 PM UTC+4, Marc Dzaebel wrote:
>
> I'm often in need of performance comparisons/recommendations about 
> different ways to code the same usecases. E.g.
>
> (time(let [x 2 y [0 1 2 3 4]] (dotimes [_ 1000] (remove *#{x}*y 
> ;~950 ms
> (time(let [x 2 y [0 1 2 3 4]] (dotimes [_ 1000] (remove *#(= % x)*y 
> ;~150 ms
>
> (time(let [a (int-array 10)]  (dotimes [_ 1000] (*aset *a 1 
> 2;~7 ms
> (time(let [a (int-array 10)]  (dotimes [_ 1000] (*aset-int *a 1 
> 2;~430 ms
>
> I'd recommend to gather such information at a central place in a more 
> systematic way. So I wonder:
>
>- where to place such information 
> (Wiki?)
>- whether this information is of use 
>- whether you have more recommendations regarding performance or the 
>form, advices are presented
>
> *Thanks, Marc*
>

-- 
-- 
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: Making RPCs with Shoreleave

2013-07-15 Thread Alex Fowler
Did not work.. all that is strange since I've been following the manual 
step-by-step.. looks like the shoreleave's wrapper does not even create a 
http route for itself... any other ideas?

On Friday, July 12, 2013 7:14:42 AM UTC+4, Samrat Man Singh wrote:
>
> I think you need to (use projectname.ajax) in your projectname.handler 
> page. If I remember correctly, there's also a way to specify which 
> namespace your remote function is in.
>
> On Thursday, July 11, 2013 10:42:15 PM UTC+5:45, Alex Fowler wrote:
>>
>> Hi all, this is my first experience with Shoreleave and I'm trying to use 
>> it's RPC mechanism to perform AJAX tasks. However, on a call to a remote 
>> procedure, I get this:
>>
>> `
>>
>>1. POST http://localhost:8080/_shoreleave 404 (Not Found) 
>>cljs.js:25223 <http://localhost:8080/js/cljs.js>
>>   1. goog.net.XhrIo.sendcljs.js:25223<http://localhost:8080/js/cljs.js>
>>   2. xhr__delegatecljs.js:31416 <http://localhost:8080/js/cljs.js>
>>   3. xhrcljs.js:31423 <http://localhost:8080/js/cljs.js>
>>   4. 
>> remote_callback__delegatecljs.js:32504<http://localhost:8080/js/cljs.js>
>>   5. remote_callbackcljs.js:32515 <http://localhost:8080/js/cljs.js>
>>   6. load_storecljs.js:32745 <http://localhost:8080/js/cljs.js>
>>   7. 
>> mk__AMPERSAND__load_store__delegatecljs.js:32755<http://localhost:8080/js/cljs.js>
>>   8. 
>> mk__AMPERSAND__load_storecljs.js:32763<http://localhost:8080/js/cljs.js>
>>   9. example_storecljs.js:33341 <http://localhost:8080/js/cljs.js>
>>   10. simplecljs.js:33361 <http://localhost:8080/js/cljs.js>
>>   11. setup_guicljs.js:33962 <http://localhost:8080/js/cljs.js>
>>   12. setup_allcljs.js:33982 <http://localhost:8080/js/cljs.js>
>>   13. startupcljs.js:41166 <http://localhost:8080/js/cljs.js>
>>   14. onloadapp:2 <http://localhost:8080/app>
>>   
>> XHR ERROR: Not Found 
>> `
>>
>> What is wrong and how do I fix it? I have been following this tutorial: 
>> Shoreleave 
>> Tutorial 10 - Introducing 
>> Ajax<https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-10.md>
>>  my 
>> code (relevant parts) is this:
>>
>> Project.clj:
>> `
>> (defproject projectname "0.1.0-SNAPSHOT"
>>   :description "FIXME: write description"
>>   :url "http://example.com/FIXME";
>>   :dependencies [[org.clojure/clojure "1.5.1"]
>>  [lib-noir "0.6.3"]
>>  [compojure "1.2.0-SNAPSHOT"]
>>  [ring-server "0.2.8"]
>>  [clabango "0.5"]
>>  [hiccup "1.0.3"]
>>  [com.taoensso/timbre "2.1.2"]
>>  [com.taoensso/tower "1.7.1"]
>>  [markdown-clj "0.9.26"]
>>
>>  ; -- ajax
>>  [shoreleave "0.3.0"]
>>  [shoreleave/shoreleave-remote-ring "0.3.0"]
>>  [shoreleave/shoreleave-remote "0.3.0"]
>>  
>>  ; -- cljs
>>  [com.keminglabs/singult "0.1.6"]
>>  [enfocus "1.0.1"]
>>  [jayq "2.3.0"]
>>  ]
>>   :plugins [[lein-ring "0.8.5"]
>> [lein-cljsbuild "0.3.2"]]
>>   :hooks [leiningen.cljsbuild]
>>   :cljsbuild {
>>   :builds [{
>> :jar true
>> :source-paths ["src/family/webapp"]
>> :compiler {
>>:output-to 
>> "resources/public/js/cljs.js"
>>:optimizations :whitespace
>>:externs ["externs/jquery-1.9.js"]
>>:pretty-print true}}]}
>>   :ring {:handler projectname.handler/war-handler
>>  :initprojectname.handler/init
>>  :destroy projectname.handler/destroy}
>>   :profiles
>>   {:production {:ring {:open-browser? false
>>:stacktraces?  false
>>:auto-reload?  false}}
>>:dev {:dependencies [[ring-mock "0.1.5"]
>> [ring/ring-devel "

Making RPCs with Shoreleave

2013-07-11 Thread Alex Fowler
Hi all, this is my first experience with Shoreleave and I'm trying to use 
it's RPC mechanism to perform AJAX tasks. However, on a call to a remote 
procedure, I get this:

`

   1. POST http://localhost:8080/_shoreleave 404 (Not Found) 
cljs.js:25223
  1. goog.net.XhrIo.sendcljs.js:25223 
  2. xhr__delegatecljs.js:31416 
  3. xhrcljs.js:31423 
  4. 
remote_callback__delegatecljs.js:32504
  5. remote_callbackcljs.js:32515 
  6. load_storecljs.js:32745 
  7. 
mk__AMPERSAND__load_store__delegatecljs.js:32755
  8. 
mk__AMPERSAND__load_storecljs.js:32763
  9. example_storecljs.js:33341 
  10. simplecljs.js:33361 
  11. setup_guicljs.js:33962 
  12. setup_allcljs.js:33982 
  13. startupcljs.js:41166 
  14. onloadapp:2 
  
XHR ERROR: Not Found 
`

What is wrong and how do I fix it? I have been following this tutorial: 
Shoreleave 
Tutorial 10 - Introducing 
Ajax 
my 
code (relevant parts) is this:

Project.clj:
`
(defproject projectname "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME";
  :dependencies [[org.clojure/clojure "1.5.1"]
 [lib-noir "0.6.3"]
 [compojure "1.2.0-SNAPSHOT"]
 [ring-server "0.2.8"]
 [clabango "0.5"]
 [hiccup "1.0.3"]
 [com.taoensso/timbre "2.1.2"]
 [com.taoensso/tower "1.7.1"]
 [markdown-clj "0.9.26"]
   
 ; -- ajax
 [shoreleave "0.3.0"]
 [shoreleave/shoreleave-remote-ring "0.3.0"]
 [shoreleave/shoreleave-remote "0.3.0"]
 
 ; -- cljs
 [com.keminglabs/singult "0.1.6"]
 [enfocus "1.0.1"]
 [jayq "2.3.0"]
 ]
  :plugins [[lein-ring "0.8.5"]
[lein-cljsbuild "0.3.2"]]
  :hooks [leiningen.cljsbuild]
  :cljsbuild {
  :builds [{
:jar true
:source-paths ["src/family/webapp"]
:compiler {
   :output-to "resources/public/js/cljs.js"
   :optimizations :whitespace
   :externs ["externs/jquery-1.9.js"]
   :pretty-print true}}]}
  :ring {:handler projectname.handler/war-handler
 :initprojectname.handler/init
 :destroy projectname.handler/destroy}
  :profiles
  {:production {:ring {:open-browser? false
   :stacktraces?  false
   :auto-reload?  false}}
   :dev {:dependencies [[ring-mock "0.1.5"]
[ring/ring-devel "1.1.8"]]}}
  :min-lein-version "2.0.0")
`

Handler:
`
(ns projectname.handler
  (:use projectname.routes.home
compojure.core)
  (:require [noir.util.middleware :as middleware]
[compojure.route :as route]
[shoreleave.middleware.rpc :refer [wrap-rpc]]))

(def all-routes [home-routes app-routes])

(def app (-> all-routes
 middleware/app-handler
 wrap-rpc
 ;;add your middlewares here
 ))

(def war-handler (middleware/war-handler app))
` 

Remote procedure declaration:
`
(ns projectname.ajax
  (:require [shoreleave.middleware.rpc :refer [defremote]]))

(defremote my-remote-proc [some-arg] (println "remote call ok" some-arg) 
some-arg)
`

Client side ClojureScript code:
`
(ns projectname.webapp.model.store
  (:require
[shoreleave.remotes.http-rpc :refer [remote-callback]]))

(defn do-smth-useful [useful-args]
  (log "This is the last log statement that get's printed")
  (remote-callback :my-remote-proc [useful-args] #(process-feedback %))
`

Thanks!

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

Re: Compiling the Android version of Clojure

2013-05-22 Thread Alex Fowler
My aim is to enable Clojure programming directly on an Android device.. so, 
as I understand, I can use lein-droid to make the pre-compiled JAR to work 
on the device? I seen Clojure 1.4.0 REPL for Android and I wanted to get 
the compiler itself, preferably for 1.5.1, so that I can integrate it into 
my program... I dont't know, though, how well will Clojure's dynamic 
bytecode generation work with Dalvik...

среда, 22 мая 2013 г., 1:39:43 UTC+4 пользователь Daniel Solano Gómez 
написал:
>
> Hello, 
>
> I use Maven to build the Clojure/Android port, so I don't know whethter 
> the Ant build instructions work or how to adapt them to Windows.  Is 
> there a reason you need to build from source?  If not, then using 
> lein-droid or getting the JAR directly from Clojars is probably an 
> easier way to go. 
>
> Sincerely, 
>
> Daniel 
>
>
> On Wed May 22 05:25 2013, Kelker Ryan wrote: 
> >What's wrong with the lein-droid plugin? 
> >https://github.com/clojure-android/lein-droid 
> >� 
> >22.05.2013, 05:21, "Alex Fowler" >: 
>
> > 
> >  Nope, I am on Windows :D.. I guess I could re-write this one into a 
> >  *.bat file... �looking inside the file, however, does not give me a 
> clue 
> >  on how it will help me aside from that maybe maven will somehow 
> manage 
> >  to reolve the deps... 
> > 
> >  On Wed, May 22, 2013 at 12:18 AM, Kelker Ryan 
> >  <[1]thein...@yandex.com > wrote: 
> > 
> >Did you run ./antsetup.sh before trying to build with ant? 
> >� 
> >22.05.2013, 05:01, "Alex Fowler" 
> > <[2]alex.m...@gmail.com>: 
>
> > 
> >  Nope, the installation instruction in the readme of the project 
> says 
> >  nothing about this one (i'm a newb to android development). So 
> if I 
> >  download it, where I put it? 
> > 
> >  On Tue, May 21, 2013 at 11:59 PM, Kelker Ryan 
> >  <[3]thein...@yandex.com > wrote: 
> > 
> >Did you download the Android JAR? 
> >[4]http://www.java2s.com/Code/Jar/a/Downloadandroid32jar.htm 
> > 
> >22.05.2013, 04:52, "Alex Fowler" 
> > <[5]alex.m...@gmail.com>: 
>
> >> I'm trying to build this 
> >project:�[6]https://github.com/clojure-android/clojure�with 
> "ant" 
> >command. It sarts working, but I get this output with errors: 
> >> 
> >> Buildfile: 
> >   
>  C:\Users\Admin\Downloads\clojure-android\clojure-android\build.xml 
> >> 
> >> clean: 
> >> � �[delete] Deleting directory 
> >C:\Users\Admin\Downloads\clojure-android\clojure- 
> >> android\target 
> >> 
> >> init: 
> >> � � [mkdir] Created dir: 
> >C:\Users\Admin\Downloads\clojure-android\clojure-androi 
> >> d\target\classes 
> >> � � [mkdir] Created dir: 
> >C:\Users\Admin\Downloads\clojure-android\clojure-androi 
> >> d\target\classes\clojure 
> >> 
> >> compile-java: 
> >> � � [javac] Compiling 483 source files to 
> >C:\Users\Admin\Downloads\clojure-andro 
> >> id\clojure-android\target\classes 
> >> � � [javac] warning: [options] bootstrap class path not set 
> in 
> >conjunction with 
> >> -source 1.5 
> >> � � [javac] 
> >   
>  C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo 
> >> jure\lang\DalvikDynamicClassLoader.java:13: error: package 
> >android.util does not 
> >> �exist 
> >> � � [javac] import android.util.Log; 
> >> � � [javac] � � � � � � � � � �^ 
> >> � � [javac] 
> >   
>  C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo 
> >> jure\lang\DalvikDynamicClassLoader.java:17: error: package 
> >dalvik.system does no 
> >> t exist 
> >> � � [javac] import dalvik.system.DexFile; 
> >> � � [javac] � � � � � � � � � � ^ 
> >> � � [javac] 
> >   
>  C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo 
> >>

Re: Compiling the Android version of Clojure

2013-05-21 Thread Alex Fowler
Nope, I am on Windows :D.. I guess I could re-write this one into a *.bat
file...  looking inside the file, however, does not give me a clue on how
it will help me aside from that maybe maven will somehow manage to reolve
the deps...


On Wed, May 22, 2013 at 12:18 AM, Kelker Ryan wrote:

> Did you run ./antsetup.sh before trying to build with ant?
>
> 22.05.2013, 05:01, "Alex Fowler" :
>
> Nope, the installation instruction in the readme of the project says
> nothing about this one (i'm a newb to android development). So if I
> download it, where I put it?
>
>
> On Tue, May 21, 2013 at 11:59 PM, Kelker Ryan wrote:
>
> Did you download the Android JAR?
> http://www.java2s.com/Code/Jar/a/Downloadandroid32jar.htm
>
> 22.05.2013, 04:52, "Alex Fowler" :
> > I'm trying to build this project:
> https://github.com/clojure-android/clojure with "ant" command. It sarts
> working, but I get this output with errors:
> >
> > Buildfile:
> C:\Users\Admin\Downloads\clojure-android\clojure-android\build.xml
> >
> > clean:
> >[delete] Deleting directory
> C:\Users\Admin\Downloads\clojure-android\clojure-
> > android\target
> >
> > init:
> > [mkdir] Created dir:
> C:\Users\Admin\Downloads\clojure-android\clojure-androi
> > d\target\classes
> > [mkdir] Created dir:
> C:\Users\Admin\Downloads\clojure-android\clojure-androi
> > d\target\classes\clojure
> >
> > compile-java:
> > [javac] Compiling 483 source files to
> C:\Users\Admin\Downloads\clojure-andro
> > id\clojure-android\target\classes
> > [javac] warning: [options] bootstrap class path not set in
> conjunction with
> > -source 1.5
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:13: error: package android.util
> does not
> >  exist
> > [javac] import android.util.Log;
> > [javac]^
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:17: error: package dalvik.system
> does no
> > t exist
> > [javac] import dalvik.system.DexFile;
> > [javac] ^
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:45: error: package
> android.os.Build does
> >  not exist
> > [javac] DEX_OPTIONS.targetApiLevel =
> android.os.Build.VERSION.SDK_INT;
> > [javac]  ^
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:99: error: cannot find symbol
> > [javac] final DexFile inDexFile =
> DexFile.loadDex(jarPath, dexPa
> > th, 0);
> > [javac]   ^
> > [javac]   symbol:   class DexFile
> > [javac]   location: class DalvikDynamicClassLoader
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:99: error: cannot find symbol
> > [javac] final DexFile inDexFile =
> DexFile.loadDex(jarPath, dexPa
> > th, 0);
> > [javac]   ^
> > [javac]   symbol:   variable DexFile
> > [javac]   location: class DalvikDynamicClassLoader
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:104: error: cannot find symbol
> > [javac] Log.e(TAG,"Failed to load generated class:
> "+name);
> > [javac] ^
> > [javac]   symbol:   variable Log
> > [javac]   location: class DalvikDynamicClassLoader
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:110: error: cannot find symbol
> > [javac] Log.e(TAG,"Failed to define class due to I/O
> exception."
> > ,e);
> > [javac] ^
> > [javac]   symbol:   variable Log
> > [javac]   location: class DalvikDynamicClassLoader
> > [javac] Note: Some input files use unchecked or unsafe operations.
> > [javac] Note: Recompile with -Xlint:unchecked for details.
> > [javac] 7 errors
> > [javac] 1 warning
> >
> > BUILD FAILED
> > C:\Users\Admin\Downloads\clojure-android\clojure-android\build.xml:41:
> Compile f
> > ailed; see the compiler er

Re: Compiling the Android version of Clojure

2013-05-21 Thread Alex Fowler
Nope, the installation instruction in the readme of the project says
nothing about this one (i'm a newb to android development). So if I
download it, where I put it?


On Tue, May 21, 2013 at 11:59 PM, Kelker Ryan wrote:

> Did you download the Android JAR?
> http://www.java2s.com/Code/Jar/a/Downloadandroid32jar.htm
>
> 22.05.2013, 04:52, "Alex Fowler" :
> > I'm trying to build this project:
> https://github.com/clojure-android/clojure with "ant" command. It sarts
> working, but I get this output with errors:
> >
> > Buildfile:
> C:\Users\Admin\Downloads\clojure-android\clojure-android\build.xml
> >
> > clean:
> >[delete] Deleting directory
> C:\Users\Admin\Downloads\clojure-android\clojure-
> > android\target
> >
> > init:
> > [mkdir] Created dir:
> C:\Users\Admin\Downloads\clojure-android\clojure-androi
> > d\target\classes
> > [mkdir] Created dir:
> C:\Users\Admin\Downloads\clojure-android\clojure-androi
> > d\target\classes\clojure
> >
> > compile-java:
> > [javac] Compiling 483 source files to
> C:\Users\Admin\Downloads\clojure-andro
> > id\clojure-android\target\classes
> > [javac] warning: [options] bootstrap class path not set in
> conjunction with
> > -source 1.5
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:13: error: package android.util
> does not
> >  exist
> > [javac] import android.util.Log;
> > [javac]^
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:17: error: package dalvik.system
> does no
> > t exist
> > [javac] import dalvik.system.DexFile;
> > [javac] ^
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:45: error: package
> android.os.Build does
> >  not exist
> > [javac] DEX_OPTIONS.targetApiLevel =
> android.os.Build.VERSION.SDK_INT;
> > [javac]  ^
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:99: error: cannot find symbol
> > [javac] final DexFile inDexFile =
> DexFile.loadDex(jarPath, dexPa
> > th, 0);
> > [javac]   ^
> > [javac]   symbol:   class DexFile
> > [javac]   location: class DalvikDynamicClassLoader
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:99: error: cannot find symbol
> > [javac] final DexFile inDexFile =
> DexFile.loadDex(jarPath, dexPa
> > th, 0);
> > [javac]   ^
> > [javac]   symbol:   variable DexFile
> > [javac]   location: class DalvikDynamicClassLoader
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:104: error: cannot find symbol
> > [javac] Log.e(TAG,"Failed to load generated class:
> "+name);
> > [javac] ^
> > [javac]   symbol:   variable Log
> > [javac]   location: class DalvikDynamicClassLoader
> > [javac]
> C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
> > jure\lang\DalvikDynamicClassLoader.java:110: error: cannot find symbol
> > [javac] Log.e(TAG,"Failed to define class due to I/O
> exception."
> > ,e);
> > [javac] ^
> > [javac]   symbol:   variable Log
> > [javac]   location: class DalvikDynamicClassLoader
> > [javac] Note: Some input files use unchecked or unsafe operations.
> > [javac] Note: Recompile with -Xlint:unchecked for details.
> > [javac] 7 errors
> > [javac] 1 warning
> >
> > BUILD FAILED
> > C:\Users\Admin\Downloads\clojure-android\clojure-android\build.xml:41:
> Compile f
> > ailed; see the compiler error output for details.
> >
> > Total time: 2 seconds
> >
> > My questions are:
> > 1) How can I resolve this dependency issue?
> > 2) If I compile like that, can I run it on Android?
> >
> > --
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.

Compiling the Android version of Clojure

2013-05-21 Thread Alex Fowler
I'm trying to build this project: https://github.com/clojure-android/clojure 
with 
"ant" command. It sarts working, but I get this output with errors:

Buildfile: 
C:\Users\Admin\Downloads\clojure-android\clojure-android\build.xml

clean:
   [delete] Deleting directory 
C:\Users\Admin\Downloads\clojure-android\clojure-
android\target

init:
[mkdir] Created dir: 
C:\Users\Admin\Downloads\clojure-android\clojure-androi
d\target\classes
[mkdir] Created dir: 
C:\Users\Admin\Downloads\clojure-android\clojure-androi
d\target\classes\clojure

compile-java:
[javac] Compiling 483 source files to 
C:\Users\Admin\Downloads\clojure-andro
id\clojure-android\target\classes
[javac] warning: [options] bootstrap class path not set in conjunction 
with
-source 1.5
[javac] 
C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
jure\lang\DalvikDynamicClassLoader.java:13: error: package android.util 
does not
 exist
[javac] import android.util.Log;
[javac]^
[javac] 
C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
jure\lang\DalvikDynamicClassLoader.java:17: error: package dalvik.system 
does no
t exist
[javac] import dalvik.system.DexFile;
[javac] ^
[javac] 
C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
jure\lang\DalvikDynamicClassLoader.java:45: error: package android.os.Build 
does
 not exist
[javac] DEX_OPTIONS.targetApiLevel = 
android.os.Build.VERSION.SDK_INT;
[javac]  ^
[javac] 
C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
jure\lang\DalvikDynamicClassLoader.java:99: error: cannot find symbol
[javac] final DexFile inDexFile = DexFile.loadDex(jarPath, 
dexPa
th, 0);
[javac]   ^
[javac]   symbol:   class DexFile
[javac]   location: class DalvikDynamicClassLoader
[javac] 
C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
jure\lang\DalvikDynamicClassLoader.java:99: error: cannot find symbol
[javac] final DexFile inDexFile = DexFile.loadDex(jarPath, 
dexPa
th, 0);
[javac]   ^
[javac]   symbol:   variable DexFile
[javac]   location: class DalvikDynamicClassLoader
[javac] 
C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
jure\lang\DalvikDynamicClassLoader.java:104: error: cannot find symbol
[javac] Log.e(TAG,"Failed to load generated class: 
"+name);
[javac] ^
[javac]   symbol:   variable Log
[javac]   location: class DalvikDynamicClassLoader
[javac] 
C:\Users\Admin\Downloads\clojure-android\clojure-android\src\jvm\clo
jure\lang\DalvikDynamicClassLoader.java:110: error: cannot find symbol
[javac] Log.e(TAG,"Failed to define class due to I/O 
exception."
,e);
[javac] ^
[javac]   symbol:   variable Log
[javac]   location: class DalvikDynamicClassLoader
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 7 errors
[javac] 1 warning

BUILD FAILED
C:\Users\Admin\Downloads\clojure-android\clojure-android\build.xml:41: 
Compile f
ailed; see the compiler error output for details.

Total time: 2 seconds

My questions are:
1) How can I resolve this dependency issue?
2) If I compile like that, can I run it on Android?

-- 
-- 
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: I tripped out

2013-05-05 Thread Alex Fowler
Tell us more about it.

On Sunday, May 5, 2013 11:54:32 AM UTC+4, JvJ wrote:
>
> Is anyone else tripped out when they realize that when you write args for 
> a function you're basically just destructuring an arg vector?  It trips 
> me 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: A JMonkeyEngine3 wrapper?

2013-05-04 Thread Alex Fowler
Thanks everyone for their input!

I have studied all the proposed codes! Based on them I have created a 
proof-of-concept solution for my case. Although reading the API of Jonathan's 
library inspired me, I avoided looking into the code yet so as to have some 
personal fun (remember I am a Clojure newb). But I came across Aurellem blog 
even before starting this thread, so some neat tricks are (and will be :D)taken 
from there. The entry point is based on example by James. At the end of this 
message I provide a link to the project.

So I would be grateful for answers to the following questions:
1. Why executing (test-init) from the tail of core.clj causes NPE in 
Material.java (namely missing the AssetManager), but doing same thing from a 
REPL does not? I have figured out that sometimes timing matters so I put 
sleepers there, but it does not work for this very case.
2. A couple of general recommendations on where I break some Clojure 
style/traditions

There are lots of silly things, but it's just a POC. The project is a 
CCW/Leiningen one. Load core.clj in REPL and execute (test-init). In the app, 
press S to move backwards to see the whole picture. The song is a freeware by 
Veela, the girl sings about keys, problems, functions, time, immutability and 
stuff so I thought it's pretty functional and clojuric.

Version with JME (unpack-n-go, 80mb): http://db.tt/dRMtImGU
Version w/o JME (put JME jars into 'lib' dir, 8mb): http://db.tt/jP6joeP6

Don't forget 'lein deps' since it will draw in some.

So I think that we might get started developing on the base of Orbit by 
Jonathan and Cortex by Robert, no?

-- 
-- 
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: A JMonkeyEngine3 wrapper?

2013-05-04 Thread Alex Fowler
Thanks everyone for their input!

I have studied all the proposed codes! Based on them I have created a 
proof-of-concept solution for my case. Although reading the API of Jonathan's 
library inspired me, I avoided looking into the code yet so as to have some 
personal fun (remember I am a Clojure newb). But I came across Aurellem blog 
even before starting this thread, so some neat tricks are (and will be :D)taken 
from there. The entry point is based on example by James. At the end of this 
message I provide a link to the project.

So I would be grateful for answers to the following questions:
1. Why executing (test-init) from the tail of core.clj causes NPE in 
Material.java (namely missing the AssetManager), but doing same thing from a 
REPL does not? I have figured out that sometimes timing matters so I put 
sleepers there, but it does not work for this very case.
2. A couple of general recommendations on where I break some Clojure 
style/traditions

There are lots of silly things, but it's just a POC. The project is a 
CCW/Leiningen one. Load core.clj in REPL and execute (test-init). In the app, 
press S to move backwards to see the whole picture. The song is a freeware by 
Veela, the girl sings about keys, problems, functions, time, immutability and 
stuff so I thought it's pretty functional and clojuric.

Version with JME (unpack-n-go, 80mb): http://db.tt/dRMtImGU
Version w/o JME (put JME jars into 'lib' dir, 8mb): http://db.tt/jP6joeP6

Don't forget 'lein deps' since it will draw in some.

So I think that we might get started developing on the base of Orbit by 
Jonathan and Cortex by Robert, no?

-- 
-- 
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: A JMonkeyEngine3 wrapper?

2013-05-04 Thread Alex Fowler
Thanks everyone for their input!

I have studied all the proposed codes! Based on them I have created a 
proof-of-concept solution for my case. Although reading the API of Jonathan's 
library inspired me, I avoided looking into the code yet so as to have some 
personal fun (remember I am a Clojure newb). But I came across Aurellem blog 
even before starting this thread, so some neat tricks are (and will be :D)taken 
from there. The entry point is based on example by James. At the end of this 
message I provide a link to the project.

So I would be grateful for answers to the following questions:
1. Why executing (test-init) from the tail of core.clj causes NPE in 
Material.java (namely missing the AssetManager), but doing same thing from a 
REPL does not? I have figured out that sometimes timing matters so I put 
sleepers there, but it does not work for this very case.
2. A couple of general recommendations on where I break some Clojure 
style/traditions

There are lots of silly things, but it's just a POC. The project is a 
CCW/Leiningen one. Load core.clj in REPL and execute (test-init). In the app, 
press S to move backwards to see the whole picture. The song is a freeware by 
Veela, the girl sings about keys, problems, functions, time, immutability and 
stuff so I thought it's pretty functional and clojuric.

Version with JME (unpack-n-go, 80mb): http://db.tt/dRMtImGU
Version w/o JME (put JME jars into 'lib' dir, 8mb): http://db.tt/jP6joeP6

Don't forget 'lein deps' since it will draw in some.

So I think that we might get started developing on the base of Orbit by 
Jonathan and Cortex by Robert, no?

-- 
-- 
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: A JMonkeyEngine3 wrapper?

2013-05-04 Thread Alex Fowler
Thanks everyone for their input!

I have studied all the proposed codes! Based on them I have created a 
proof-of-concept solution for my case. Although reading the API of Jonathan's 
library inspired me, I avoided looking into the code yet so as to have some 
personal fun (remember I am a Clojure newb). But I came across Aurellem blog 
even before starting this thread, so some neat tricks are (and will be :D)taken 
from there. The entry point is based on example by James. At the end of this 
message I provide a link to the project.

So I would be grateful for answers to the following questions:
1. Why executing (test-init) from the tail of core.clj causes NPE in 
Material.java (namely missing the AssetManager), but doing same thing from a 
REPL does not? I have figured out that sometimes timing matters so I put 
sleepers there, but it does not work for this very case.
2. A couple of general recommendations on where I break some Clojure 
style/traditions

There are lots of silly things, but it's just a POC. The project is a 
CCW/Leiningen one. Load core.clj in REPL and execute (test-init). In the app, 
press S to move backwards to see the whole picture. The song is a freeware by 
Veela, the girl sings about keys, problems, functions, time, immutability and 
stuff so I thought it's pretty functional and clojuric.

Version with JME (unpack-n-go, 80mb): http://db.tt/dRMtImGU
Version w/o JME (put JME jars into 'lib' dir, 8mb): http://db.tt/jP6joeP6

Don't forget 'lein deps' since it will draw in some.

So I think that we might get started developing on the base of Orbit by 
Jonathan and Cortex by Robert, no?

-- 
-- 
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: A JMonkeyEngine3 wrapper?

2013-05-02 Thread Alex Fowler
Hmm, interesting, but games usually involve much state and changes to keep 
up their worlds alive.. how do you abstract over this? For example, if you 
need to move something, then surely you will call for a change.. right 
inside the user code that happens all the time.. isn't it so? Just 
interested in how do you develop the functional philosophy to a really 
usable extent.. I cannot imagine how to avoid changing Vector3f elements at 
runtime.. or maybe you just pass the whole changed app-state to each new 
cycle?

As far as I see, Jonathan and I, too create the wrappers as a side-effect 
of a personal project. I just think that maybe it is possible to factor out 
and assemble the code to a separate library and if you need something in 
your project, you implement it straight to the library and commit. Of 
course that would require a kind of coordination like never before, but it 
is a real FTW and is prone to benifits like finding something you wanted to 
have already being implemented by someone!


четверг, 2 мая 2013 г., 2:14:36 UTC+4 пользователь James Reeves написал:
>
> On 1 May 2013 21:08, Alex Fowler >wrote:
>
>> So, inspired by the latest talks with locals, I propose starting a 
>> collective initiative on creating a full-scale wrapper for JME3.
>>
>> Actually, I am starting to write my Clojure project with JME3 and I feel 
>> like in a desperate need for a clojuric wrapper. So I started implementing 
>> wrappers for Material, Texture, Geometry and so on.. but I think that that 
>> code would be rather universal and there is no point for it to belong to a 
>> personal project. So I think that we might start a community library 
>> project on this with those who is interested. Besides that, I think that I 
>> am a rather newb in Clojure and if I do that on my own, I will not do it as 
>> good as possible :D Is somebody interested in that?
>>
>
> I have a bunch of code for a game I'm working on, but I've taken a 
> slightly different approach to the problem than other people seem to have 
> so far.
>
> When you develop in a functional language like Clojure, you typically want 
> to quarantine all behaviour related to I/O, and avoid touching any mutable 
> values directly. In Ring, for instance, we limit the interaction with the 
> underlying servlet classes to a single function: the adapter.
>
> For jME3, I've been pursuing a similar approach. Essentially I'm aiming 
> for this:
>
>   (run-app (atom initial-app-data))
>
> The only point of contact between the jME3 classes and the logic in 
> Clojure will be that single function. Everything else will happen through 
> modifying reference to a data structure.
>
>  Right now I've got it working with geometries, textures, a simple HUD, 
> events, very limited physics, collisions, and I'm currently writing an 
> interface to NiftyGUI (which isn't easy, as it's not very well designed).
>
> The work I've done on this so far is part of a game, but could potentially 
> be factored out. Currently it's very much a work in progress, and I expect 
> it to take several months before I have anything useful outside of my 
> use-case.
>
> - James
>

-- 
-- 
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: A JMonkeyEngine3 wrapper?

2013-05-01 Thread Alex Fowler
Oh that's interesting! Looking at your code and API, I see many nice design 
solutions, although the style is somewhat different from waht I do.. but me 
are newb.. and I now started from doing wrappers for meshes, vertex 
buffers, geometries and materials and stuff.. since these are the 1st 
things me be interested in :D. But my code is somewhat just 2 pages now and 
untested :D... I will share it tomorrow when I finish it and at least run 
some tests, now I must take some sleep. I think that if we assemble for 
that effort, someone who is good at Clojure will have to propose some 
standard guidelines along which the code is to be written, because JME is a 
big thing and covering it all or at least half of it better follow some 
all-known ideals so that the result will look and feel monolithic.



четверг, 2 мая 2013 г., 1:30:49 UTC+4 пользователь Jonathan Fischer Friberg 
написал:
>
> UI example:
> https://github.com/odyssomay/orbit/blob/master/test/orbit/test/ui.clj#L45
>
> Sorry for the "spam". :)
>
> Jonathan
>
>
> On Wed, May 1, 2013 at 11:28 PM, Jonathan Fischer Friberg <
> odys...@gmail.com > wrote:
>
>> Some info about the current status:
>>
>> * Input handling - missing joystick (not that important I guess).
>> * Networking - "completely" done (might be improved, but works for most 
>> purposes).
>> * Physics - not started.
>> * Materials - usable, but needs work.
>> * Geometry - same as material.
>> * Application + settings - mostly done.
>> * UI - mostly done. Most notably missing "click" handlers.
>>
>> I have also tried to make an enlive-style system for creating user 
>> interfaces and 3d geometry. The ui part is
>> done, but the geometry part is missing.
>>
>> I might have missed something. Just ask if you'd like to know more.
>>
>> Jonathan
>>
>>
>> On Wed, May 1, 2013 at 11:20 PM, Jonathan Fischer Friberg <
>> odys...@gmail.com > wrote:
>>
>>> My effort can be found here:
>>> https://github.com/odyssomay/orbit
>>>
>>> It's kind of "all over the place" in that I have started on a lot of 
>>> things, but not really
>>> finished any parts. In any case, should be some useful stuff in there.
>>>
>>> I haven't really been active on the project lately - there's a bunch of 
>>> other things I'd
>>> like to finish first. But I intend to "finish" the library in the near 
>>> future.
>>>
>>> I renamed the library today which might cause some trouble - just a 
>>> heads up.
>>>
>>> Jonathan
>>>
>>>
>>> On Wed, May 1, 2013 at 10:08 PM, Alex Fowler 
>>> 
>>> > wrote:
>>>
>>>> So, inspired by the latest talks with locals, I propose starting a 
>>>> collective initiative on creating a full-scale wrapper for JME3.
>>>>
>>>> Actually, I am starting to write my Clojure project with JME3 and I 
>>>> feel like in a desperate need for a clojuric wrapper. So I started 
>>>> implementing wrappers for Material, Texture, Geometry and so on.. but I 
>>>> think that that code would be rather universal and there is no point for 
>>>> it 
>>>> to belong to a personal project. So I think that we might start a 
>>>> community 
>>>> library project on this with those who is interested. Besides that, I 
>>>> think 
>>>> that I am a rather newb in Clojure and if I do that on my own, I will not 
>>>> do it as good as possible :D Is somebody interested in that?
>>>>
>>>> -- 
>>>> -- 
>>>> 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/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.




A JMonkeyEngine3 wrapper?

2013-05-01 Thread Alex Fowler
So, inspired by the latest talks with locals, I propose starting a 
collective initiative on creating a full-scale wrapper for JME3.

Actually, I am starting to write my Clojure project with JME3 and I feel 
like in a desperate need for a clojuric wrapper. So I started implementing 
wrappers for Material, Texture, Geometry and so on.. but I think that that 
code would be rather universal and there is no point for it to belong to a 
personal project. So I think that we might start a community library 
project on this with those who is interested. Besides that, I think that I 
am a rather newb in Clojure and if I do that on my own, I will not do it as 
good as possible :D Is somebody interested in 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
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: Using a Java game engine in my project

2013-04-30 Thread Alex Fowler
Finally it works! Had some more issues with Eclipse running on Java 7, but 
wiping out all Java and installing the latest JDK of version 7 and showing 
some little attention to Eclipse did the trick! Thank you very much for the 
directions, atkaaz and other buddies - I would've never been able to figure 
it out alone by myself without the help from the community :)

So looks like having latest CCW beta (todays latest ver. 0.13 beta I think) 
and Java 7 turned out to be necessary for my wish to come true! :D

And looking forward for a fully and correctly maintained JME repo! Just 
want to show encouragement to those who are able :)



вторник, 30 апреля 2013 г., 23:04:01 UTC+4 пользователь atkaaz написал:
>
> I had the issue here: 
> https://code.google.com/p/counterclockwise/issues/detail?id=567
> I think the fix is to use java 7 for eclipse not java 6
>
>
>
> On Tue, Apr 30, 2013 at 10:01 PM, Alex Fowler 
> 
> > wrote:
>
>> Same thing... I have no firewall or other restrictions... Have just 
>> deleted the ccw folder, and now it creates the folder, but does not fetch a 
>> jar into it. And the error is the same... reaally strange that :) Tried 
>> removing all the Run Configs just to be sure.. still same :)  Idk, maybe if 
>> I reboot, it's gonna be ok... I try to reboot now.
>>
>> вторник, 30 апреля 2013 г., 22:48:58 UTC+4 пользователь atkaaz написал:
>>>
>>> actually looks like I spoke too soon, what I said doesn't seem to apply 
>>> to you because the console message says  ccw.server instead of ccw-server  
>>> (dot vs dash), so it should be able to fetch that unless you're not 
>>> allowing it in firewall? I emptied my .m2 folder and it works for me, ccw 
>>> fetches all the artifacts even though I just Ctrl+Alt+L after starting 
>>> eclipse without any Update Dependencies on the project.
>>>
>>>
>>> On Tue, Apr 30, 2013 at 9:42 PM, AtKaaZ  wrote:
>>>
>>>>  sorry I meant, Run As->Run Configurations... :)
>>>>
>>>>
>>>> On Tue, Apr 30, 2013 at 9:41 PM, AtKaaZ  wrote:
>>>>
>>>>> oh yes that thing, just do Run->Run As...  on your project
>>>>> and delete all the children inside Clojure
>>>>> things like:
>>>>> fightingsail Leiningen
>>>>> where fightingsail is the name of the project
>>>>>
>>>>> and when you try to start the REPL again, it will create a new one 
>>>>> with the correct Arguments
>>>>>
>>>>>
>>>>> On Tue, Apr 30, 2013 at 9:35 PM, Alex Fowler wrote:
>>>>>
>>>>>> Right, I had the stable version, not beta, and Ctrl+Alt+L had no 
>>>>>> effect at all. So now I have updated to the latest beta. Now repl 
>>>>>> does 
>>>>>> not start at all :)
>>>>>>
>>>>>> The error in the console is:
>>>>>>
>>>>>> Could not transfer artifact ccw:ccw.server:pom:0.1.0 from/to central (
>>>>>> http://repo1.maven.org/**maven2/ <http://repo1.maven.org/maven2/>): 
>>>>>> repo1.maven.org
>>>>>>
>>>>>> This could be due to a typo in :dependencies or network issues.
>>>>>>
>>>>>>
>>>>>> My Eclipse version is
>>>>>>
>>>>>> Eclipse IDE for Java Developers
>>>>>>
>>>>>> Version: Juno Service Release 2
>>>>>>
>>>>>> Build id: 20130225-0426
>>>>>>
>>>>>>
>>>>>> CCW now is
>>>>>>
>>>>>>   Counterclockwise (Clojure plugin for Eclipse) 0.13.0.201304242239 
>>>>>> ccw.feature.feature.group Counterclockwise team 
>>>>>>
>>>>>>
>>>>>> I looked up and I saw Laurent saying that there is problems of 
>>>>>> backwards compatibility problems in new Eclipse versions... Uhhh so 
>>>>>> sad.. do you have any ideas?
>>>>>>
>>>>>>
>>>>>> вторник, 30 апреля 2013 г., 21:58:04 UTC+4 пользователь AtKaaZ 
>>>>>> написал:
>>>>>>>
>>>>>>> oh nevermind I misread that. So it doesn't work for you with ccw? 
>>>>>>> are you using latest ccw beta?
>>>>>>> When I start the core.clj file with Ctrl+Alt+L to load it in a repl 
>>>>>>> it works for me
>>

Re: Using a Java game engine in my project

2013-04-30 Thread Alex Fowler
Same thing... I have no firewall or other restrictions... Have just deleted 
the ccw folder, and now it creates the folder, but does not fetch a jar 
into it. And the error is the same... reaally strange that :) Tried 
removing all the Run Configs just to be sure.. still same :)  Idk, maybe if 
I reboot, it's gonna be ok... I try to reboot now.

вторник, 30 апреля 2013 г., 22:48:58 UTC+4 пользователь atkaaz написал:
>
> actually looks like I spoke too soon, what I said doesn't seem to apply to 
> you because the console message says  ccw.server instead of ccw-server  
> (dot vs dash), so it should be able to fetch that unless you're not 
> allowing it in firewall? I emptied my .m2 folder and it works for me, ccw 
> fetches all the artifacts even though I just Ctrl+Alt+L after starting 
> eclipse without any Update Dependencies on the project.
>
>
> On Tue, Apr 30, 2013 at 9:42 PM, AtKaaZ >wrote:
>
>> sorry I meant, Run As->Run Configurations... :)
>>
>>
>> On Tue, Apr 30, 2013 at 9:41 PM, AtKaaZ > >wrote:
>>
>>> oh yes that thing, just do Run->Run As...  on your project
>>> and delete all the children inside Clojure
>>> things like:
>>> fightingsail Leiningen
>>> where fightingsail is the name of the project
>>>
>>> and when you try to start the REPL again, it will create a new one with 
>>> the correct Arguments
>>>
>>>
>>> On Tue, Apr 30, 2013 at 9:35 PM, Alex Fowler 
>>> 
>>> > wrote:
>>>
>>>> Right, I had the stable version, not beta, and Ctrl+Alt+L had no effect 
>>>> at all. So now I have updated to the latest beta. Now repl does not 
>>>> start at all :)
>>>>
>>>> The error in the console is:
>>>>
>>>> Could not transfer artifact ccw:ccw.server:pom:0.1.0 from/to central (
>>>> http://repo1.maven.org/maven2/): repo1.maven.org
>>>>
>>>> This could be due to a typo in :dependencies or network issues.
>>>>
>>>>
>>>> My Eclipse version is
>>>>
>>>> Eclipse IDE for Java Developers
>>>>
>>>> Version: Juno Service Release 2
>>>>
>>>> Build id: 20130225-0426
>>>>
>>>>
>>>> CCW now is
>>>>
>>>>   Counterclockwise (Clojure plugin for Eclipse) 0.13.0.201304242239 
>>>> ccw.feature.feature.group Counterclockwise team 
>>>>
>>>>
>>>> I looked up and I saw Laurent saying that there is problems of 
>>>> backwards compatibility problems in new Eclipse versions... Uhhh so 
>>>> sad.. do you have any ideas?
>>>>
>>>>
>>>> вторник, 30 апреля 2013 г., 21:58:04 UTC+4 пользователь AtKaaZ написал:
>>>>>
>>>>> oh nevermind I misread that. So it doesn't work for you with ccw? are 
>>>>> you using latest ccw beta?
>>>>> When I start the core.clj file with Ctrl+Alt+L to load it in a repl it 
>>>>> works for me
>>>>>
>>>>> Eclipse SDK
>>>>>
>>>>> Version: 4.3.0
>>>>> Build id: I20130430-0031
>>>>>   Counterclockwise (Clojure plugin for Eclipse)
>>>>> 0.13.0.201304242239ccw.feature.feature.groupCounterclockwise team
>>>>>  
>>>>>
>>>>> On Tue, Apr 30, 2013 at 8:49 PM, Alex Fowler wrote:
>>>>>
>>>>>> Just tried that! Very nice! Got it running with "lein repl" from 
>>>>>> Windows command prompt!!! However, when I fire up the repl from Eclipse 
>>>>>> CCW, I get:
>>>>>>
>>>>>> ClassNotFoundException com.jme3.app.SimpleApplication 
>>>>>>  java.net.URLClassLoader$1.run (URLClassLoader.java:366)
>>>>>>
>>>>>> I assume, this is due to the fact that when I evaluate te "core" file 
>>>>>> directly, it skips the "project.clj" which specifies the necessary 
>>>>>> :resource-paths... Don't you know, how can I have the repl from CCW? 
>>>>>> Should 
>>>>>> I make some explicit resources loading?
>>>>>>
>>>>>>
>>>>>>
>>>>>> понедельник, 29 апреля 2013 г., 23:46:25 UTC+4 пользователь James 
>>>>>> Reeves написал:
>>>>>>>
>>>>>>> I've been messing around with jME3 as well, and at some point 

Re: Using a Java game engine in my project

2013-04-30 Thread Alex Fowler
Right, I had the stable version, not beta, and Ctrl+Alt+L had no effect at 
all. So now I have updated to the latest beta. Now repl does not start 
at all :)

The error in the console is:

Could not transfer artifact ccw:ccw.server:pom:0.1.0 from/to central 
(http://repo1.maven.org/maven2/): repo1.maven.org

This could be due to a typo in :dependencies or network issues.


My Eclipse version is

Eclipse IDE for Java Developers

Version: Juno Service Release 2

Build id: 20130225-0426


CCW now is

  Counterclockwise (Clojure plugin for Eclipse) 0.13.0.201304242239 
ccw.feature.feature.group Counterclockwise team 


I looked up and I saw Laurent saying that there is problems of backwards 
compatibility problems in new Eclipse versions... Uhhh so sad.. do you 
have any ideas?


вторник, 30 апреля 2013 г., 21:58:04 UTC+4 пользователь AtKaaZ написал:
>
> oh nevermind I misread that. So it doesn't work for you with ccw? are you 
> using latest ccw beta?
> When I start the core.clj file with Ctrl+Alt+L to load it in a repl it 
> works for me
>
> Eclipse SDK
>
> Version: 4.3.0
> Build id: I20130430-0031
>   Counterclockwise (Clojure plugin for Eclipse)0.13.0.201304242239
> ccw.feature.feature.groupCounterclockwise team
>
>
> On Tue, Apr 30, 2013 at 8:49 PM, Alex Fowler 
> > wrote:
>
>> Just tried that! Very nice! Got it running with "lein repl" from Windows 
>> command prompt!!! However, when I fire up the repl from Eclipse CCW, I get:
>>
>> ClassNotFoundException com.jme3.app.SimpleApplication 
>>  java.net.URLClassLoader$1.run (URLClassLoader.java:366)
>>
>> I assume, this is due to the fact that when I evaluate te "core" file 
>> directly, it skips the "project.clj" which specifies the necessary 
>> :resource-paths... Don't you know, how can I have the repl from CCW? Should 
>> I make some explicit resources loading?
>>
>>
>>
>> понедельник, 29 апреля 2013 г., 23:46:25 UTC+4 пользователь James Reeves 
>> написал:
>>>
>>> I've been messing around with jME3 as well, and at some point I might 
>>> release a library for it.
>>>
>>> One of the problems with jME3 is that its deployment mechanism hasn't 
>>> quite caught up with the current century. I'm planning on packaging it up 
>>> eventually, but in the meantime here's the ugly, dirty, terrible hack I've 
>>> been using:
>>>
>>> 1. Download the binaries: http://www.**jmonkeyengine.com/nightly/**
>>> jME3_2013-04-29.zip<http://www.jmonkeyengine.com/nightly/jME3_2013-04-29.zip>
>>> 2. Create a new directory and extract the zip file into it
>>> 3. Create a new Leiningen project
>>> 4. Add the following to your project.clj file: :resource-paths ["lib/*"]
>>> 5. Copy the lib directory from the jME3 binaries into your project 
>>> directory
>>>
>>> Here's an example application to get you going:
>>>
>>> https://gist.github.com/**weavejester/5484183<https://gist.github.com/weavejester/5484183>
>>>
>>> - James
>>>
>>>
>>> On 29 April 2013 20:02, Alex Fowler  wrote:
>>>
>>>> Hello! I have a problem, I will try to explain.. I want to write a game 
>>>> with Clojure and JMonkeyEngine (http://jmonkeyengine.com/). So I take 
>>>> their latest nightie set of jars 
>>>> (http://jmonkeyengine.com/**nightly/<http://jmonkeyengine.com/nightly/>) 
>>>> and what? I can't make use of them in my CCW/Leiningen project no 
>>>> matter how hard I try. So ok, I have found some examples where people get 
>>>> them in the "lib" folder and it works, or where they recommend pushing 
>>>> them 
>>>> to the local maven repo... but they do not tell how they do it, or they 
>>>> show it for some very simple cases. Sure, there is a lot of instructions 
>>>> like "use mvn install:install-file " or "lein 
>>>> localrepo install "... so do I have to do it for all 
>>>> the 30 (thirty) jar files? Considering too, that I have to invent an 
>>>> "artifactId" for every one of them, invent a "version number", type all 
>>>> that in manually. And that is not my library, I do not want to invent 
>>>> that. 
>>>> And even, if I do that, then, how do I specify that all them are 
>>>> interdependant (are parts of one thing) and have to be always drawn in 
>>>> together? I will have to specify the 30 dependencies in my project.clj 
>>

Re: Using a Java game engine in my project

2013-04-30 Thread Alex Fowler
Just tried that! Very nice! Got it running with "lein repl" from Windows 
command prompt!!! However, when I fire up the repl from Eclipse CCW, I get:

ClassNotFoundException com.jme3.app.SimpleApplication 
 java.net.URLClassLoader$1.run (URLClassLoader.java:366)

I assume, this is due to the fact that when I evaluate te "core" file 
directly, it skips the "project.clj" which specifies the necessary 
:resource-paths... Don't you know, how can I have the repl from CCW? Should 
I make some explicit resources loading?



понедельник, 29 апреля 2013 г., 23:46:25 UTC+4 пользователь James Reeves 
написал:
>
> I've been messing around with jME3 as well, and at some point I might 
> release a library for it.
>
> One of the problems with jME3 is that its deployment mechanism hasn't 
> quite caught up with the current century. I'm planning on packaging it up 
> eventually, but in the meantime here's the ugly, dirty, terrible hack I've 
> been using:
>
> 1. Download the binaries: 
> http://www.jmonkeyengine.com/nightly/jME3_2013-04-29.zip
> 2. Create a new directory and extract the zip file into it
> 3. Create a new Leiningen project
> 4. Add the following to your project.clj file: :resource-paths ["lib/*"]
> 5. Copy the lib directory from the jME3 binaries into your project 
> directory
>
> Here's an example application to get you going:
>
> https://gist.github.com/weavejester/5484183
>
> - James
>
>
> On 29 April 2013 20:02, Alex Fowler >wrote:
>
>> Hello! I have a problem, I will try to explain.. I want to write a game 
>> with Clojure and JMonkeyEngine (http://jmonkeyengine.com/). So I take 
>> their latest nightie set of jars (http://jmonkeyengine.com/nightly/) 
>> and what? I can't make use of them in my CCW/Leiningen project no 
>> matter how hard I try. So ok, I have found some examples where people get 
>> them in the "lib" folder and it works, or where they recommend pushing them 
>> to the local maven repo... but they do not tell how they do it, or they 
>> show it for some very simple cases. Sure, there is a lot of instructions 
>> like "use mvn install:install-file " or "lein 
>> localrepo install "... so do I have to do it for all 
>> the 30 (thirty) jar files? Considering too, that I have to invent an 
>> "artifactId" for every one of them, invent a "version number", type all 
>> that in manually. And that is not my library, I do not want to invent that. 
>> And even, if I do that, then, how do I specify that all them are 
>> interdependant (are parts of one thing) and have to be always drawn in 
>> together? I will have to specify the 30 dependencies in my project.clj each 
>> time? Well, and even if I do, then I will still have that pain with 
>> manually copying all that stuff on each new machine where I work, picking 
>> it from the local maven repo and putting it to another maven repo. And 
>> if I want to push it to Clojars, I have do that for each one manually too, 
>> typing in commands in the Windows cmd and taking care for inventing version 
>> numbers?... oh, and maybe I could go about specifying  clauses 
>> in a pom? pinch me am I dreaming a nightmare? :)
>>
>> I have tried to do something along these lines... spent about 15 hours in 
>> general and got almost nothing but headache and eyesore... and a feeling of 
>> being extremily stupid for not being able to plug a few jars into a jvm 
>> program (isn't java all just about putting jars together? :) ). I am a 
>> Clojure newb and maybe I am missing somewhat essential.. but in Scala, with 
>> or without SBT, using Scala IDE for Eclipse, I got everything up and 
>> running in about 15 minutes.
>>
>> Please, could anyone give me a clear explanation or better, a full 
>> example of plugging in the JME3 into a Clojure project? Shouldn't it be 
>> simple? Thank you in advance, the situation is really disappointing for me 
>> :(
>>
>> -- 
>> -- 
>> 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 t

Re: memorize-clj

2013-04-30 Thread Alex Fowler
Agreed! Totally worthwhile. I even do this consciously sometimes.

понедельник, 29 апреля 2013 г., 11:01:17 UTC+4 пользователь Chris Ford 
написал:
>
> Jorge, reinventing the wheel is a very worthwhile pursuit. Maybe you'll 
> come up with something new, and certainly you'll learn something.
>
> Thanks for sharing.
>
> Chris
>
>
> On 29 April 2013 08:23, Baishampayan Ghose 
> > wrote:
>
>> One more reason to read Clojure's source code. Trust me, it's 
>> surprisingly easy to understand.
>>
>> Sent from phone. Please excuse brevity.
>> On 29 Apr 2013 09:29, "Jorge Urdaneta" > 
>> wrote:
>>
>>>  Thank you. Shame on me
>>>
>>> On 28/04/13 23:28, Gary Trakhman wrote:
>>>  
>>> Clojure has the http://clojuredocs.org/clojure_core/clojure.core/memoize 
>>> function 
>>> built-in, as well as https://github.com/clojure/core.memoize for more 
>>> complicated stuff. 
>>>
>>>
>>> On Sun, Apr 28, 2013 at 11:51 PM, Jorge Urdaneta 
>>> 
>>> > wrote:
>>>
 Hi,

 I started a library called memorize-clj 
 https://github.com/jorgeu/memorize-clj
 It provides a function "memorize" that take a function and cache its 
 results using
 guava cache. Of course the function must be pure and the parameters 
 should be
 easy to compare and get a hashcode.

 Maybe I'm reinventing the wheel here but it was fun to build anyway.
 I saw this feature in Groovy and couldn't found anything equivalent for 
 Clojure.

 -- 
 Jorge Urdaneta

 -- 
 -- 
 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/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 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/groups/opt_out.
>>>  
>>>  
>>>
>>>
>>>
>>> -- 
>>> Jorge Urdaneta
>>>
>>>  -- 
>>> -- 
>>> 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/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 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/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:

Re: Using a Java game engine in my project

2013-04-30 Thread Alex Fowler
Good that you've mentioned it! While I use JME for a long time already, I 
started researching LibGDX not so long ago. For now, I program right on my 
Android Tablet PC, using AIDE with libgdx jars in the project. But the 
language is Java... sadly, I find that Clojure did not yet make it into 
Dalvik world (except for the barebones Clojure REPL, which uses 1.4.0 and 
is a year old). I am researching the use of JScheme and SISC insead of 
Clojure there for now... btw, do you have any interestinginfo onhow is 
Clojure going onto the Android platform?

вторник, 30 апреля 2013 г., 14:43:18 UTC+4 пользователь Mikera написал:
>
> Depending on exactly what you want, it may also be worth taking a look at 
> LibGDX:
>
> http://libgdx.badlogicgames.com/
>
> Seems like a pretty promising library, with plenty of cross platform 
> support. Not as much of a complete game engine as jMonkeyEngine, but 
> perhaps more in keeping with the Clojure "compose small standalone 
> libraries" philosophy.
>
> On Tuesday, 30 April 2013 03:02:16 UTC+8, Alex Fowler wrote:
>>
>> Hello! I have a problem, I will try to explain.. I want to write a game 
>> with Clojure and JMonkeyEngine (http://jmonkeyengine.com/). So I take 
>> their latest nightie set of jars (http://jmonkeyengine.com/nightly/) 
>> and what? I can't make use of them in my CCW/Leiningen project no 
>> matter how hard I try. So ok, I have found some examples where people get 
>> them in the "lib" folder and it works, or where they recommend pushing them 
>> to the local maven repo... but they do not tell how they do it, or they 
>> show it for some very simple cases. Sure, there is a lot of instructions 
>> like "use mvn install:install-file " or "lein 
>> localrepo install "... so do I have to do it for all 
>> the 30 (thirty) jar files? Considering too, that I have to invent an 
>> "artifactId" for every one of them, invent a "version number", type all 
>> that in manually. And that is not my library, I do not want to invent that. 
>> And even, if I do that, then, how do I specify that all them are 
>> interdependant (are parts of one thing) and have to be always drawn in 
>> together? I will have to specify the 30 dependencies in my project.clj each 
>> time? Well, and even if I do, then I will still have that pain with 
>> manually copying all that stuff on each new machine where I work, picking 
>> it from the local maven repo and putting it to another maven repo. And 
>> if I want to push it to Clojars, I have do that for each one manually too, 
>> typing in commands in the Windows cmd and taking care for inventing version 
>> numbers?... oh, and maybe I could go about specifying  clauses 
>> in a pom? pinch me am I dreaming a nightmare? :)
>>
>> I have tried to do something along these lines... spent about 15 hours in 
>> general and got almost nothing but headache and eyesore... and a feeling of 
>> being extremily stupid for not being able to plug a few jars into a jvm 
>> program (isn't java all just about putting jars together? :) ). I am a 
>> Clojure newb and maybe I am missing somewhat essential.. but in Scala, with 
>> or without SBT, using Scala IDE for Eclipse, I got everything up and 
>> running in about 15 minutes.
>>
>> Please, could anyone give me a clear explanation or better, a full 
>> example of plugging in the JME3 into a Clojure project? Shouldn't it be 
>> simple? Thank you in advance, the situation is really disappointing for me 
>> :(
>>
>

-- 
-- 
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: Using a Java game engine in my project

2013-04-30 Thread Alex Fowler
Yeah, to have an option is a good idea! I just wanted to say, that I 
wouldn't want it to be removed completely :) As far as I understand, you're 
making up some library-type project.. Do you have a page or a blog where I 
could track the progress and be up-to-date with the current version? I 
think that if you update the JME jars at least once-twice a month, then 
referencing that repository is very good when working on multiple machines!

вторник, 30 апреля 2013 г., 14:18:06 UTC+4 пользователь Jonathan Fischer 
Friberg написал:
>
> I think that for today I will stick with the "lib" folder solution, 
>> proposed by James, but I encourage the knowledgefull people Jonathan and 
>> James to work together to deliver a Clojars or Amazonaws online repository 
>> with more-or-less daily update, since the engine is really well-maintained. 
>> And a Clojure wrapper? I also think that there is no need to strip away the 
>> testdata since it contains many materials and shaders good for prototyping 
>> or prodution.
>>
>
> I think the best solution would be to separate it, that's
> my plan. That is, to have "jme" with only the core, and
> "jme-extra" or similar, with the extra goodies.
>
> Jonathan 
>

-- 
-- 
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: Using a Java game engine in my project

2013-04-30 Thread Alex Fowler
 century. I'm planning on packaging it up 
>>>> eventually, but in the meantime here's the ugly, dirty, terrible hack I've 
>>>> been using:
>>>>
>>>> 1. Download the binaries: 
>>>> http://www.jmonkeyengine.com/nightly/jME3_2013-04-29.zip
>>>> 2. Create a new directory and extract the zip file into it
>>>> 3. Create a new Leiningen project
>>>> 4. Add the following to your project.clj file: :resource-paths ["lib/*"]
>>>> 5. Copy the lib directory from the jME3 binaries into your project 
>>>> directory
>>>>
>>>> Here's an example application to get you going:
>>>>
>>>> https://gist.github.com/weavejester/5484183
>>>>
>>>> - James
>>>>
>>>>
>>>> On 29 April 2013 20:02, Alex Fowler >>> >wrote:
>>>>
>>>>> Hello! I have a problem, I will try to explain.. I want to write a 
>>>>> game with Clojure and JMonkeyEngine (http://jmonkeyengine.com/). So I 
>>>>> take their latest nightie set of jars (
>>>>> http://jmonkeyengine.com/nightly/) and what? I can't make use of 
>>>>> them in my CCW/Leiningen project no matter how hard I try. So ok, I have 
>>>>> found some examples where people get them in the "lib" folder and it 
>>>>> works, 
>>>>> or where they recommend pushing them to the local maven repo... but they 
>>>>> do 
>>>>> not tell how they do it, or they show it for some very simple cases. 
>>>>> Sure, 
>>>>> there is a lot of instructions like "use mvn install:install-file 
>>>>> " or "lein localrepo install 
>>>>> "... so do I have to do it for all the 30 (thirty) 
>>>>> jar 
>>>>> files? Considering too, that I have to invent an "artifactId" for every 
>>>>> one 
>>>>> of them, invent a "version number", type all that in manually. And that 
>>>>> is 
>>>>> not my library, I do not want to invent that. And even, if I do that, 
>>>>> then, 
>>>>> how do I specify that all them are interdependant (are parts of one 
>>>>> thing) 
>>>>> and have to be always drawn in together? I will have to specify the 30 
>>>>> dependencies in my project.clj each time? Well, and even if I do, then I 
>>>>> will still have that pain with manually copying all that stuff on each 
>>>>> new 
>>>>> machine where I work, picking it from the local maven repo and putting it 
>>>>> to another maven repo. And if I want to push it to Clojars, I have do 
>>>>> that for each one manually too, typing in commands in the Windows cmd and 
>>>>> taking care for inventing version numbers?... oh, and maybe I could go 
>>>>> about specifying  clauses in a pom? pinch me am I dreaming a 
>>>>> nightmare? :)
>>>>>
>>>>> I have tried to do something along these lines... spent about 15 hours 
>>>>> in general and got almost nothing but headache and eyesore... and a 
>>>>> feeling 
>>>>> of being extremily stupid for not being able to plug a few jars into a 
>>>>> jvm 
>>>>> program (isn't java all just about putting jars together? :) ). I am a 
>>>>> Clojure newb and maybe I am missing somewhat essential.. but in Scala, 
>>>>> with 
>>>>> or without SBT, using Scala IDE for Eclipse, I got everything up and 
>>>>> running in about 15 minutes.
>>>>>
>>>>> Please, could anyone give me a clear explanation or better, a full 
>>>>> example of plugging in the JME3 into a Clojure project? Shouldn't it be 
>>>>> simple? Thank you in advance, the situation is really disappointing for 
>>>>> me 
>>>>> :(
>>>>>
>>>>> -- 
>>>>> -- 
>>>>> 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, vis

Using a Java game engine in my project

2013-04-29 Thread Alex Fowler
Hello! I have a problem, I will try to explain.. I want to write a game 
with Clojure and JMonkeyEngine (http://jmonkeyengine.com/). So I take their 
latest nightie set of jars (http://jmonkeyengine.com/nightly/) and 
what? I can't make use of them in my CCW/Leiningen project no matter how 
hard I try. So ok, I have found some examples where people get them in the 
"lib" folder and it works, or where they recommend pushing them to the 
local maven repo... but they do not tell how they do it, or they show it 
for some very simple cases. Sure, there is a lot of instructions like "use 
mvn install:install-file " or "lein localrepo 
install "... so do I have to do it for all the 30 
(thirty) jar files? Considering too, that I have to invent an "artifactId" 
for every one of them, invent a "version number", type all that in 
manually. And that is not my library, I do not want to invent that. And 
even, if I do that, then, how do I specify that all them are interdependant 
(are parts of one thing) and have to be always drawn in together? I will 
have to specify the 30 dependencies in my project.clj each time? Well, and 
even if I do, then I will still have that pain with manually copying all 
that stuff on each new machine where I work, picking it from the local 
maven repo and putting it to another maven repo. And if I want to push 
it to Clojars, I have do that for each one manually too, typing in commands 
in the Windows cmd and taking care for inventing version numbers?... oh, 
and maybe I could go about specifying  clauses in a pom? pinch 
me am I dreaming a nightmare? :)

I have tried to do something along these lines... spent about 15 hours in 
general and got almost nothing but headache and eyesore... and a feeling of 
being extremily stupid for not being able to plug a few jars into a jvm 
program (isn't java all just about putting jars together? :) ). I am a 
Clojure newb and maybe I am missing somewhat essential.. but in Scala, with 
or without SBT, using Scala IDE for Eclipse, I got everything up and 
running in about 15 minutes.

Please, could anyone give me a clear explanation or better, a full example 
of plugging in the JME3 into a Clojure project? Shouldn't it be simple? 
Thank you in advance, the situation is really disappointing for me :(

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