binary structures/bitstrings

2010-04-17 Thread Scott T
Does anyone know of a clojure library for handling (un)packing of binary structures? I'm looking for something similar to perl/ruby/ python's pack(...) function or something like OCaml's bitstring module. My initial google and clojure-contrib perusing hasn't turned up anything obvious though

database management: curing lock issues

2010-03-25 Thread Scott
Question on best practices on handling SQL database concurrency issues I am pmapping a evaluation to a long list (which calls a computationally intense script) from within clojure. The script itself is designed to be completely free of concurrency side-effects. During the evaluation, several

Re: database management: curing lock issues

2010-03-25 Thread Scott
with locks as well. 2010/3/25 Scott sbuck...@gmail.com Question on best practices on handling SQL database concurrency issues I am pmapping a evaluation to a long list (which calls a computationally intense script) from within clojure.  The script itself is designed to be completely free

Re: database management: curing lock issues

2010-03-25 Thread Scott
thanks for your suggestions two clear options 1) agents and queued transactions 2) MVC enabled databases (postgresql, h2 (neat project)) Ill try the first option and see how it scales, and worst case move to the second Thanks again Scott On Mar 25, 12:47 pm, prhlava prhl...@googlemail.com

Re: binary representation + operators

2010-03-13 Thread Scott
java to the rescue! Thanks to all for your suggestions Scott On Mar 13, 3:45 pm, Michał Marczyk michal.marc...@gmail.com wrote: On 12 March 2010 23:26, Scott sbuck...@gmail.com wrote: How do I write a function 'bit' that converts an integer to binary representation: (bit 0) - 2r0

binary representation + operators

2010-03-12 Thread Scott
-concat 2r011 2r1100) - 2r000 . . . I looked into formats, but everything defaults to integer representation. I need to stay in binary representation. Its for a genetic algorithm with grey coding. Thanks! Scott -- You received this message because you are subscribed to the Google Groups Clojure

performance improvments for the following code

2010-01-27 Thread Scott
wondering if I can please get some advice on how to improve the performance of this piece of code (defn select-n-tournament [popu fit-fn n] (let [k 7] (take n (repeatedly #(first (sort-by fit-fn (take k (shuffle popu)) ) ) The profiler is telling me that first is eating up alot of

function to perform operations on adjacent values

2010-01-21 Thread Scott
looking for something very similar to reduce, but sequentially operate on adjacent values for example if (defn reduce-n [f col n]) (reduce-n + (range 7) 2) = (3 7 11) ie 1+2, 3+4, 5+6 ideas? -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: function to perform operations on adjacent values

2010-01-21 Thread Scott
Thanks! On Jan 21, 7:07 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, On Jan 20, 8:03 pm, Scott sbuck...@gmail.com wrote: (reduce-n + (range 7)  2) = (3 7 11) user= (map #(reduce + %1) (partition 2 (range 1 7))) (3 7 11) Sincerely Meikel -- You received this message because you

stripping parenthesis

2010-01-19 Thread Scott
i am utilizing parenthesis to represent a tree structure within a genetic algorithm I am trying to write a function that can strip all parenthesis such that I can perform crossovers/mutations on the permutation. Ex. ( 1 2 3 4 (5 6 7 8) ((9 10 11 12)) (((13 14 15 16))) ) into ( 1 2 3 4 5 6 7 8

Re: stripping parenthesis

2010-01-19 Thread Scott
, Laurent PETIT laurent.pe...@gmail.com wrote: Maybe you're in quest ofhttp://richhickey.github.com/clojure-contrib/seq-utils-api.html#cloju... ? HTH, -- Laurent 2010/1/19 Scott sbuck...@gmail.com: i am utilizing parenthesis to represent a tree structure within a genetic algorithm I

Re: stripping parenthesis

2010-01-19 Thread Scott
thanks all! On Jan 19, 2:06 pm, kyle smith the1physic...@gmail.com wrote: http://groups.google.com/group/clojure/browse_thread/thread/806ebb1cb... -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Cond, and abusing or

2010-01-15 Thread Scott Burson
, this is a very common idiom in Common Lisp and other older dialects. I guess there are a few people who don't like it, but a lot of us do it routinely. You'll even see stuff like (or (try-to-construct-a-foo) (error Couldn't construct a foo)) -- Scott -- You received this message because you

[ANN] units.clj - unit conversion functions without repeating yourself

2010-01-14 Thread Scott Jaderholm
equations this library will define 168 conversion functions for you (56 each for length, area, and volume). The code is at http://gist.github.com/276662#file_units.clj I'd love to receive feedback. Thanks, Scott Notes [1] For a reliable alternative, see JScience.org -- You received this message

Re: globing filenames via clojure

2009-12-14 Thread Scott
...@gmail.com wrote: On Dec 12, 11:20 am, Scott sbuck...@gmail.com wrote: Trying to learn clojure via some simple examples. I would like to use a simple glob expression to open a file using read- line How would I write the equivalent of: (for [line (read-lines *.txt)]     (print line

globing filenames via clojure

2009-12-12 Thread Scott
Trying to learn clojure via some simple examples. I would like to use a simple glob expression to open a file using read- line How would I write the equivalent of: (for [line (read-lines *.txt)] (print line)) Where *.txt would match only the first file found in the present working

Re: temp variables best practice

2009-09-12 Thread Scott Moonen
/2009/03/01/digest-tag-population-in-ruby/comment-page-1/#comment-1879 -- Scott On Sat, Sep 12, 2009 at 7:23 PM, Terrance Davis terrance.da...@gmail.comwrote: For instance, in Java ... tmpString = JOptionPane.showInputDialog(What is your foobar?); finalFoo = Double.parseDouble(tmpString

Re: Clojure quickstart maven archetype

2009-09-09 Thread Scott Fleckenstein
-Scott On Sep 9, 12:42 am, Fredrik Appelberg fredrik.appelb...@gmail.com wrote: On Tue, Sep 8, 2009 at 4:09 AM, Scott Fleckenstein nullst...@gmail.comwrote: On another note, it's surprising given that how easy creating the archetype was how incredibly arcane writing a plugin is.  Granted

Re: Clojure quickstart maven archetype

2009-09-08 Thread Scott Fleckenstein
, and figure out how best I want to support AOT along with Script execution. -Scott On Sep 7, 9:40 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: Also look at the ClojureShell Maven plugin,http://github.com/fred-o/clojureshell-maven-plugin/tree/master which runs a REPL or Swank server. -SS

[ANN] Clojure quickstart maven archetype

2009-09-07 Thread Scott Fleckenstein
not an easy way to launch a REPL into your code, and no support fr clojure-maven-plugin clojure:run (it uses a script, my archetype assumes a compiled main class). Thanks, Scott Fleckenstein --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Clojure quickstart maven archetype

2009-09-07 Thread Scott Fleckenstein
, I'll figure it out eventually. If I'm able to get a repl goal working, are you open to patches? -Scott On Sep 7, 5:58 pm, Mark Derricutt m...@talios.com wrote: Excellent!  This was one of the missing pieces I was hoping to pull together next. into your code, and no support fr clojure-maven

Re: Request for Discussion: user created reader macros

2009-08-13 Thread Scott
On Aug 13, 1:30 pm, Brian Hurt bhur...@gmail.com wrote: I'm just wondering what people's response would be to allow user-generated reader macros. [...] I think you could get most of the benefits for DSL's by using regular strings, except that regular strings have quoting issues:

Re: Request for Discussion: user created reader macros

2009-08-13 Thread Scott
On Aug 13, 5:47 pm, Chas Emerick cemer...@snowtide.com wrote: A good thought, but #foo is reader syntax for defining a regular   expression with the pattern foo. :-/ Sorry about that, I'm not experienced at Clojure, but I should have been more clear. The first important part isn't which

Re: PeepCode screencast

2009-04-24 Thread Scott Jaderholm
Thanks Phil! I just bought it and look forward to watching it this weekend. Are you planning something more advanced? On Fri, Apr 24, 2009 at 11:03 AM, Phil Hagelberg p...@hagelb.org wrote: I'm proud to announce that the Functional Programming with Clojure PeepCode screencast has just been

Re: Java 6 dependency in clojure-contrib ok?

2009-04-09 Thread Scott Hickey
as possible. It may not make sense to those of us trying new languages on the JVM but it is a reality that is out there. Scott Hickey Senior Consultant Object Partners, Inc. From: Rich Hickey richhic...@gmail.com To: Clojure clojure@googlegroups.com Sent: Wednesday

Re: Parallel Game of Life

2009-03-20 Thread Scott Fraser
-core it is quite colorful and fun. As always, comments appreciate. Here is it: -Scott (import '(javax.swing JFrame JPanel JButton) '(java.awt BorderLayout Dimension Color) '(java.awt.event ActionListener)) (def cells (ref {})) (def running (atom false)) (def x-cells ( * 32 1)) (def y-cells

Re: Parallel Game of Life

2009-03-16 Thread Scott Fraser
that executor pool. -Scott On Mar 16, 11:51 am, Larry Sherrill lps...@gmail.com wrote: Hi Kyle, I added life-conway.clj to the files section last week. It has rand, clear, and bounded buttons, and the ability to use your mouse to draw the pattern rather than rely on rand. It's a good way

Re: Game of Life

2009-03-15 Thread Scott Fraser
to cache the reflected handle to Graphics, but I am still a little new to this so don't have any other ideas on how to eliminate the high amount of reflection without a type hint. -Scott http://fraser.blogs.com/ On Mar 4, 4:17 pm, Larry Sherrill lps...@gmail.com wrote: I've incorporated everyone's

Parallel Game of Life

2009-03-15 Thread Scott Fraser
I have taken Larry's Game of Life example that he originally posted here: http://groups.google.com/group/clojure/msg/fdfc88f1ba95bdee ...and updated it to use all the CPU's your JVM has access to. My first attempts ran into the classic map - pmap slowdown. My next attempt had too much dosync,

Re: What profilers are you using?

2009-03-12 Thread Scott Jaderholm
On Sat, Feb 7, 2009 at 8:16 AM, David Powell djpow...@djpowell.net wrote: Newer versions of JDK 1.6, eg Update 11, have an application called 'jvisualvm' in the bin directory. It lets you attach to any running Java process and it has a profiler that you can switch on at runtime. If you're

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread Aaron Scott
How about e-rest, for the empty set returning version? Perry Trolard wrote: If it's the case that rest will almost exclusively appear in the context of constructing lazy-seqs (lazy-seq (cons [something] (rest [something])) next will appear all over, it makes sense to me to

Re: semi-structured program editing

2009-01-03 Thread Scott Bell
http://mumble.net/~campbell/emacs/paredit.el http://mumble.net/~campbell/emacs/paredit.html Should work out of the box with Clojure and Emacs. - Scott On Jan 2, 8:48 pm, falcon shahb...@gmail.com wrote: http://www.cs.brown.edu/research/plt/software/divascheme/ or http://www.youtube.com

Re: Microsoft SQL Server and the sql contrib

2008-12-17 Thread Scott Jaderholm
using JDBC with MSSQL Express requires some extra setup. On Dec 16, 3:49 pm, Scott Jaderholm jaderh...@gmail.com wrote: I don't think that's a problem: user (. Class (forName com.microsoft.sqlserver.jdbc.SQLServerDriver)) com.microsoft.sqlserver.jdbc.SQLServerDriver On Tue, Dec 16, 2008

Re: Microsoft SQL Server and the sql contrib

2008-12-16 Thread Scott Jaderholm
I don't think that's a problem: user (. Class (forName com.microsoft.sqlserver.jdbc.SQLServerDriver)) com.microsoft.sqlserver.jdbc.SQLServerDriver On Tue, Dec 16, 2008 at 12:21 PM, MikeM michael.messini...@invista.comwrote: To make sure your driver is really on the classpath, try this from

Re: In core structure editor, anyone?

2008-12-10 Thread Scott Fleckenstein
Seems like having something like this would be a good step towards supporting image-based development similar to Smalltalk. Whether that is a good thing or not is a different discussion ;) -Scott Fleckenstein On Dec 10, 8:16 am, Stuart Sierra [EMAIL PROTECTED] wrote: On Dec 10, 7:15 am, Simon

Re: Unary Application of (= ...)

2008-12-04 Thread Scott Fleckenstein
I'm a newbie, so feel free to bash me on the noggin if i'm missing something: Personally, I would love = to support null-ary case; being able to use apply with = seems very powerful, and would remove the need to check for an empty sequence. -Scott On Dec 3, 9:39 pm, Krukow [EMAIL PROTECTED

A request for clojure code critique

2008-11-18 Thread Scott Fleckenstein
, and mirror the send/send-off functions. The -after variants are one shot sends that wait for a specified timeout and then send, whereas the -periodically variants repeatedly send using the given interval. Thanks, Scott Fleckenstein --~--~-~--~~~---~--~~ You received

add-classpath erroring out, post r1100...

2008-11-17 Thread Scott Fleckenstein
a ClassNotFoundException thrown. I don't have enough java experience to know what would cause this problem. Things work as expected on revision 1100. Does anyone know what would cause this? I'd be happy to put in the time to help debug and fix this, but I'm at a loss for where next to go. Thanks, Scott Fleckenstein

Re: add-classpath erroring out, post r1100...

2008-11-17 Thread Scott Fleckenstein
running Repl to learn an API. Oh well, I can tweak my workflow :) -Scott On Nov 17, 10:32 am, Rich Hickey [EMAIL PROTECTED] wrote: On Nov 17, 1:00 pm, Scott Fleckenstein [EMAIL PROTECTED] wrote: Hi All, I've run into a bug since upgrading past revision 1100, specifically around adding

Re: Using a Java Debugger with Clojure

2008-10-28 Thread Scott Hickey
It should work. Before I had a debugging working in Eclipse with Groovy, I used JSwat, JEdit and Ant for project work with success. Scott Hickey Senior Consultant Object Partners, Inc. - Original Message From: Bill Clementson [EMAIL PROTECTED] To: clojure@googlegroups.com Sent

<    1   2