Re: A DSL for writing scripts which have restricted memory and cpu usage

2010-07-12 Thread Heinz N. Gies
On Jul 13, 2010, at 2:44 , Folcon wrote: > > > On Jul 13, 1:36 am, ngocdaothanh wrote: >>> Are there any ways to restrict how many resources a user has access to? >> >> If you use Linux, you see /etc/security/limits.conf. > > That is useful and I will keep that in mind, however I was thinkin

Re: DataLog

2010-07-12 Thread Meikel Brandmeyer
Hi, On Jul 13, 4:02 am, Wilson MacGyver wrote: > Has anyone used clojure.contrib.Datalog for anything serious? What > kind of problem > did you run into if any? I considered using it, but I could never figure out, how to use it correctly. eg. what predicates are available? Can I define my own?

Re: faster flatten?

2010-07-12 Thread Mark Engelberg
Unless you wrap a "doall" around the calls to flatten and my-flatten, you're not really timing anything relevant. -- 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 me

Atomic execution of a SELECT and UPDATE

2010-07-12 Thread Sean
To learn Clojure, I'm writing a system that could be compared to fold...@home. I have a database table of jobs that need to be done, where each row has an id, some data, and a status. The server that issues these jobs to clients is multi-threaded, and I want to ensure that it never issues the same

faster flatten?

2010-07-12 Thread Cam
Another flatten thread! Sorry.. Hello all, before I realized there was a flatten in the master branch (and before I looked at contrib) I wrote this pretty standard code: (defn my-flatten [coll] (lazy-seq (when-let [coll (seq coll)] (let [x (first coll)] (if (sequential? x)

DataLog

2010-07-12 Thread Wilson MacGyver
Has anyone used clojure.contrib.Datalog for anything serious? What kind of problem did you run into if any? What is the performance like? Is there a sweet spot beyond that it's completely in memory only? Thanks, -- Omnem crede diem tibi diluxisse supremum. -- You received this message because

Re: Proposal: Digest

2010-07-12 Thread Alex Osborne
Hi David, David Soria Parra writes: > any feeback on this so far? >> A typical example would be: >> (digest-to-str (digest "hello world" :algorithm "SHA-1")) "digest-to-str" is a bit misleading as hexadecimal digits are not the only way you can represent a digest as a string: base 64 and base 3

Re: A DSL for writing scripts which have restricted memory and cpu usage

2010-07-12 Thread Folcon
On Jul 13, 1:36 am, ngocdaothanh wrote: > > Are there any ways to restrict how many resources a user has access to? > > If you use Linux, you see /etc/security/limits.conf. That is useful and I will keep that in mind, however I was thinking of application users, so they would login to the cloju

Re: A DSL for writing scripts which have restricted memory and cpu usage

2010-07-12 Thread ngocdaothanh
> Are there any ways to restrict how many resources a user has access to? If you use Linux, you see /etc/security/limits.conf. -- 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 pos

A DSL for writing scripts which have restricted memory and cpu usage

2010-07-12 Thread Folcon
I want to provide a scripting api into my program which runs server side, but don't want my users to completely use up the resources on my server. Are there any ways to restrict how many resources a user has access to? Perhaps create a sandboxed environment per user which they can execute their scr

Re: ClojureDocs.org

2010-07-12 Thread j-g-faustus
On Jul 13, 12:25 am, j-g-faustus wrote: > I made my own cheat sheet for private use over the past month or so, > core functions only. It's at the 80% stage, I don't expect it will > ever be 100%, but I have found it useful: > http://faustus.webatu.com/clj-quick-ref.html Looks like the hosting pro

Re: ClojureDocs.org

2010-07-12 Thread j-g-faustus
The site looks very nice, I especially like the "find real world examples" functionality and the fact that it collects documentation for common non-core libraries as well. I made my own cheat sheet for private use over the past month or so, core functions only. It's at the 80% stage, I don't expec

Re: Structure of complex ex-OOP programs

2010-07-12 Thread raould
On Jul 12, 1:26 pm, Nicolas Oury wrote: > The right choice depends somehow of taste. chipping in two cents: try to predict what kinds of change your system needs to support, and use that to help choose a style. (a) fp style: easy to add new operations on a fixed set of data types. (cf. pattern

Re: Structure of complex ex-OOP programs

2010-07-12 Thread Moritz Ulrich
1. would be my favorite too. Multimethods are fine too, but may be a bit slow. 3. is the same as 2. while avoiding multimethods. On Mon, Jul 12, 2010 at 10:26 PM, Nicolas Oury wrote: > > I would do for 1, but other would do differently I think. > Good thing with a multi-paradigm language. --

Re: Structure of complex ex-OOP programs

2010-07-12 Thread Nicolas Oury
1) would be more: - define a protocol for each kind of function (render, serialize...) - define a deftype/defrecord for each type of element, and make them extend the protocol It's not that different from 2. (protocol, as far as I understand, are multimethod whose dispatch function is the type of

Structure of complex ex-OOP programs

2010-07-12 Thread Timothy Baldridge
Okay, I have a fairly complex app I'm thinking of converting to clojure as a way to learn how clojure works. Here's how the basic structure of the app works: 1) Load a SVG (XML) file and parse it into a format usable by the program (convert strings to numbers, etc) 2) Persist the in-memory version

Re: ClojureDocs.org

2010-07-12 Thread Phil Hagelberg
On Sun, Jul 11, 2010 at 4:10 PM, zkim wrote: > If you're willing to continue the discussion, I'd like to keep this > going (maybe another thread?).  As I'm writing this I'm getting the > feeling that I'm not quite articulating my thoughts well, and I think > further discussion will help me to fles

(very simple) Type classes in Clojure

2010-07-12 Thread Nicolas Oury
Dear all, I have written a small experimentation about type-classes in Clojure 1.2, build above protocols. It's not a proposal, not even a good idea, just an idea that was easy enough to try. It allows to give some rules to Clojure in order to extend Protocols when some protocol/interfaces are sa

Re: Maps with functions for default values

2010-07-12 Thread Steve Purcell
On 12 Jul 2010, at 16:13, aria42 wrote: > Is there a way to set up a map so that there is a default function > which depending on the key returns a value if one is not present in > the map. I can obviously write this with a deftype and have it > implement Associative, Seqable, etc. so it behaves l

Re: SAFETY CRITICAL SOFTWARE

2010-07-12 Thread Travis Hoffman
I think the first, most important, step is to identify a JVM which is designed for safety critical systems. The only JVM I know of that has even bothered to consider SC Java is Atego's (formerly Aonix) UltraPERC, and I don't think they've qualified it to the level you seek. To get qualified for Sa

Re: CCW zombie error markers

2010-07-12 Thread Lee Spector
Thanks Laurent. FWIW I had looked for the ccw-specific mailing list but not found it... perhaps that should be advertised a bit more (e.g. I don't see it mentioned on http://code.google.com/p/counterclockwise/). Thanks for pointing it out to me. On the specific issue: I had turned off "build a

Maps with functions for default values

2010-07-12 Thread aria42
Is there a way to set up a map so that there is a default function which depending on the key returns a value if one is not present in the map. I can obviously write this with a deftype and have it implement Associative, Seqable, etc. so it behaves like a built-in map, but just wondering if there w

Re: Proposal: Digest

2010-07-12 Thread David Soria Parra
any feeback on this so far? On 2010-07-10, David Soria Parra wrote: > Hi, > > I want to propose a wrapper around MessageDigest to provide a simple way > to generate digests. > > The following proposal includes a multimethods digest, which operates either > on strings or on arrays of bytes. > > I

Re: CCW zombie error markers

2010-07-12 Thread Laurent PETIT
Hi Lee, Please note that ccw also has a user ml (for an historical reason, it has a name which does not reflect the current name of the project): clojuredev-us...@googlegroups.com Anyway: 2010/7/11 Lee Spector > > I'm using Eclipse/Counterclockwise and on a couple of occasions have had > error

Re: Clojure on BEAM

2010-07-12 Thread ngocdaothanh
This is not Clojure: http://github.com/rvirding/lfe > Are there any works or current attempts currently available? -- 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

Re: Identity and equality for protocols

2010-07-12 Thread Nicolas Oury
Ok. I understand. So, if you want to do some programming that generates insances, it should be done with symbols, at the macro-level? On Mon, Jul 12, 2010 at 10:01 AM, Meikel Brandmeyer wrote: > Hi, > > On Jul 12, 10:44 am, Nicolas Oury wrote: > > > After playing a bit with protocols I found

Re: Clojure on BEAM

2010-07-12 Thread Krukow
On Jul 11, 11:55 am, stewart wrote: > Hi All, > > Has anybody considered implementing Clojure on BEAM. Are there any > works or current attempts currently available? > > In your view where are the real trip ups for this to happen. Instead you should take a look at Erjang /karl -- You receive

Re: Identity and equality for protocols

2010-07-12 Thread Michał Marczyk
On 12 July 2010 10:44, Nicolas Oury wrote: > Is it what it is supposed to do? I think so. The reason why this happens is that the Var backing the protocol holds an immutable map, which extend modifies with alter-var-root; the copy has the old version. You're able to add an implementation of the

Re: Identity and equality for protocols

2010-07-12 Thread Meikel Brandmeyer
Hi, On Jul 12, 10:44 am, Nicolas Oury wrote: > After playing a bit with protocols I found this (which seems odd to me): > > (All of this on clojure-1.2.0-master-SNAPSHOT, downloaded with lein - i > don't know how recent it is) > > user> (defprotocol Foo (foo [x] ))   ; We define a protocol Foo >

Identity and equality for protocols

2010-07-12 Thread Nicolas Oury
Dear all, After playing a bit with protocols I found this (which seems odd to me): (All of this on clojure-1.2.0-master-SNAPSHOT, downloaded with lein - i don't know how recent it is) user> (defprotocol Foo (foo [x] )) ; We define a protocol Foo user> (def bar {:foo Foo}) ; We hide it in a r

Re: terracotta?

2010-07-12 Thread peter veentjer
I don't think it every is going to scale. MVCC/TL2 based STM designs rely on a central clock, so if you can update the clock in 0.1 ms on all machines, the maximum throughput is 1/0.0001 = 10.000 transactions/second... no matter how many machines you throw at it. Even on a single machine the centr