Re: JIT Compilation on Android

2010-05-29 Thread B Smith-Mannschott
On Sat, May 29, 2010 at 05:44, MHOOO thomas.karol...@googlemail.com wrote: I've got 1.2.0-master running on android froyo with a repl. Froyo supports JIT compilation, but whenever I call code which is defining a new class (e.g.: (defn blub [] nil)), I get an Exception:

Re: Android 'dex' stage takes a very long time with Clojure

2010-05-29 Thread Remco van 't Veer
Nice! This will speedup development and allow you to workaround the terribly long startup time with a distracting splash screen. On 2010/05/29 01:06, MHOOO wrote: I've just started with development on android myself, but from what I've read on the internets, you could probably write a .dex

Re: Anyone experienced in using clojure as a database

2010-05-29 Thread Andrzej
Hi Erik, I have a question about primary keys. As far as I can see you're currently using the first field of the relation as a primary key. While that's what other databases do (and it is working well), I think it would be better to make _records_ themselves primary keys. Since records are

Re: 57 varieties

2010-05-29 Thread Joost
On May 28, 9:26 pm, Steve Purcell st...@sanityinc.com wrote: If it helps, I've got a working non-ELPA set-up which you can browse here:  http://github.com/purcell/emacs.d It uses git versions of Slime, Clojure-mode and Swank-clojure (as git submodules). Feel free to mail me off-list with

Re: Newbie question about vector performance

2010-05-29 Thread igorrumiha
On May 28, 3:47 pm, Rubén Béjar rbe...@unizar.es wrote: I would thank a lot any hint, suggestion, comment, or whatever... :-) Here is a version that is approx 10 times faster: http://snipt.org/Olml The code structure is basically the same but it uses integer arrays for storage, some manual

Re: Datatype Usage Examples

2010-05-29 Thread Sina K. Heshmati
Krukow wrote: Sina K. Heshmati wrote: [snip] The only member data _I'm_ able find are the ones that are passed to the default constructor, namely at the time that the abstraction is reified. What if I'd have to give create a member field that is not necessarily known by the caller or

Re: JIT Compilation on Android

2010-05-29 Thread Remco van 't Veer
The dalvikvm does not run java classes and has a different instruction set. That's why you need to do the dex step before deploying your code on android. George Jahad did get a repl/eval to run on android some time ago. See:

Re: Elegant way to replace a few words in string

2010-05-29 Thread Dennis
However, in this case, the point of the code was probably to show/teach somebody how to solve a problem. When teaching, you want to make the point as clear as possible, and I think John is trying to point out, in this instance, the extra code to remove the reflection warnings detracts from that

Re: (apply interleave [[1 2]])

2010-05-29 Thread Paul Hobbs
What code would this make simpler? Are you constantly having to check this special case? If not, I don't see a reason to include it. -- Paul Hobbs On Sat, May 29, 2010 at 1:32 AM, Eugen Dück eu...@dueck.org wrote: When I do (apply interleave some-colls) and some-colls is a

Re: Elegant way to replace a few words in string

2010-05-29 Thread Laurent PETIT
My memory was bad. There's no rampant bug in the code if one does not place type hints. My bad. 2010/5/29 Dennis shr3ks...@gmail.com However, in this case, the point of the code was probably to show/teach somebody how to solve a problem. When teaching, you want to make the point as clear as

Re: Elegant way to replace a few words in string

2010-05-29 Thread Stuart Halloway
This is covered in the coding standards doc [1]: Use type hints for functions that are likely to be on critical code; otherwise keep code simple and hint-free. Reusable libraries are a strong candidate for type hinting. [1]

How to reset a counter

2010-05-29 Thread WoodHacker
I've been working with Lisp and Scheme for the past few years and have migrated to Clojure because of the JVM. I think I get functional programming, but one problem is giving me fits. I'm working on a simple imaging problem. I want to copy an array of pixels to an image buffer. That means

Re: How to reset a counter

2010-05-29 Thread James Reeves
On 29 May 2010 14:19, WoodHacker ramsa...@comcast.net wrote: I'm working on  a simple imaging problem.   I want to copy an array of pixels to an image buffer.   That means that I have to deal both with an array and a matrix (x and y).   As I go along my array, each time x reaches the end of a

Re: JIT Compilation on Android

2010-05-29 Thread MHOOO
Ah yes, applying the commits onto clojure master worked. Thanks! On May 29, 2:06 pm, Remco van 't Veer rwvtv...@gmail.com wrote: The dalvikvm does not run java classes and has a different instruction set.  That's why you need to do the dex step before deploying your code on android. George

Re: Android 'dex' stage takes a very long time with Clojure

2010-05-29 Thread MHOOO
I'd like to try to compile the clojure code (i.e. its different parts like .core, .main, .set, etc) into different .dex files so as to speed up both compilation (since you'll only have to recompile those .dex files which have changed) and start-up (since only those .dex files are loaded which are

Re: do clojure and la(tex) have something in common ?

2010-05-29 Thread Perry Trolard
On May 28, 10:35 pm, Dave Pawson dave.paw...@gmail.com wrote: Which Saxon have you wrapped please? saxon655 or Saxon9he? Currently I'm wrapping the last Saxon 9B before the switch to the three-way split. I plan to stick with it until there's a reason not to; there are some features of B I'd

Re: do clojure and la(tex) have something in common ?

2010-05-29 Thread Dave Pawson
On 29 May 2010 15:44, Perry Trolard trol...@gmail.com wrote: On May 28, 10:35 pm, Dave Pawson dave.paw...@gmail.com wrote: Which Saxon have you wrapped please? saxon655 or Saxon9he? Currently I'm wrapping the last Saxon 9B before the switch to the three-way split. I plan to stick with it

Re: How to reset a counter

2010-05-29 Thread Meikel Brandmeyer
Hi, here an example using clojure sequence library. (require 'clojure.contrib.seq-utils) (doseq [[y vs] (indexed (partition 256 value)) [x v] (indexed vs)] (write-buffer x y v)) Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure

Re: (apply interleave [[1 2]])

2010-05-29 Thread Michael Gardner
On May 29, 2010, at 5:07 AM, Paul Hobbs wrote: What code would this make simpler? Are you constantly having to check this special case? If not, I don't see a reason to include it. I haven't run across this particular issue, but I have many times written code that may end up calling a

Suggession for your website

2010-05-29 Thread Nitin r vasnik vasnik
My name is Nitin Vasnik and I just happen to visit your Website. I see that your company's Website is good but the only thing lacking is page ranking due to keywords. A good page ranking is very helpful in getting more business. We areElsner Media Marketing we provide Seo Services. We have

Transient HashMaps with not more than 8 elements?

2010-05-29 Thread Daniel Borchmann
Hi, recently I discovered the following behaviour of transient hash-maps which seems a bit odd to me: user (def thm (transient {})) #'user/thm user (dotimes [i 10] (assoc! thm i i)) nil user (count thm) 8 user (persistent! thm) {0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7} The same

Re: Transient HashMaps with not more than 8 elements?

2010-05-29 Thread Jarkko Oranen
On May 30, 12:32 am, Daniel Borchmann daniel.borchm...@googlemail.com wrote: The same happens if i goes up to 100, 1000, ... Is this a bug or is this a fundamental misconception of mine? You're using them wrong. Transients are not imperative data structures. You need to capture the return

Re: Android 'dex' stage takes a very long time with Clojure

2010-05-29 Thread MHOOO
Well, that was easy enough. I modified the load function inside RT.java to load classes/namespaces out of .dex files. (use 'my.compiled.namespace) will now look for either the compiled .class (and load it), or it will look for a .clj (and compile load it - thanks to George Jahad's work), or it

Re: (apply interleave [[1 2]])

2010-05-29 Thread Eugen Dück
Paul, I already gave a minimal example of the code it makes simpler, i.e. work in the first place: (apply interleave some-colls) I ran into this a couple of times, and wrote my own variant of interleave that handles the one-coll case. I'd rather see this case handled by interleave. How often

Re: Datatype Usage Examples

2010-05-29 Thread Adrian Cuthbertson
That said, I'd rather make sure that my low-level data structures are being operated on by only one implementation. You could use closures to encapsulate the refs/atoms ... (let [car-mem (ref nil)] (defn set-car-mem [new-car-mem] (dosync (ref-set car-mem new-car-mem))) (defn

Re: Transient HashMaps with not more than 8 elements?

2010-05-29 Thread ataggart
Yup, you need to use the transient functions, e.g., assoc!, just as you would the persistent functions. This is nice since you can write your code in the persistent style, then if you need to make some performance tweaks, simply add some exclamation points; the structure of the code remains the

Re: How to reset a counter

2010-05-29 Thread Adrian Cuthbertson
Also have a look at Christophe's excellent Taming multidim Arrays... http://clj-me.cgrand.net/2009/10/15/multidim-arrays/ -Rgds, Adrian -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note