Clojure.java.jdbc alias

2012-05-10 Thread WoodHacker
I'm working with leiningen for the first time and trying to use clojure.java.jdbc. All the docs I see use 'sql' before the jdbc commands. How do I set up the sql symbol. Nothing I've tried seems to work. Bill -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: Books on Java Objects and Primitives

2011-05-24 Thread WoodHacker
I think I understand what you're looking for. I have the same concern. There very best Java book I have found is "The Java Developer's Almanac" by Patrick Chan. Volume 2 covers Swing and Volume 1 covers everything else. No nonsense, just answers with great examples. Bill On May 23, 12:16 pm

Strange error

2011-04-25 Thread WoodHacker
Can anyone help me with this? I get the following error: Exception in thread "main" java.lang.IllegalArgumentException: Parameter declaration dosync should be a vector (jjJack.clj:22) Line 22 is the ns statement - no other error line in my program is listed. I've used dosync many times. Every

Re: Clojure Editor

2011-03-17 Thread WoodHacker
27;s not syntax aware. > > I've tried doing this in parentheses-balanced expressions as well, but still > no smarts. I use this feature not only to keep my code neat but also to make > syntax errors visually obvious; it won't help for this if the indentation > isn&#x

Re: Clojure Editor

2011-03-16 Thread WoodHacker
ng of [] or {} (less important for me). > > Thanks, > >  -Lee > > On Mar 14, 2011, at 8:06 AM, WoodHacker wrote:> The file you need should be > there.   First look under the Document/ > > Language Support menu item.   You should see and entry for Clojure. > > Try checking

Re: Clojure Editor

2011-03-14 Thread WoodHacker
sh-us...@lists.ems.ru. On Mar 13, 9:49 am, Shantanu Kumar wrote: > Do I need a plugin? I downloaded the stock 2.0.3-1 version of the > editor and it doesn't even seem to syntax-highlight the Clojure code. > > Regards, > Shantanu > > On Mar 13, 5:09 pm, WoodHacker wrote:> If

Clojure Editor

2011-03-13 Thread WoodHacker
If you are looking for a very good editor for Clojure try Bluefish. It's been around for ever, is very stable, and does everything you would want an editor to do. And it now works with Clojure. http://bluefish.openoffice.nl Bill -- You received this message because you are subscribed to th

Reference Variables Question

2011-03-12 Thread WoodHacker
Hi, I have a simple general question about variables used in Clojure. Often you have an object that must be referenced because it is established at run time and not known beforehand. Lets say we have an block object and it has a certain height. We create a reference to the block's height and u

Help with Java arrays

2011-01-28 Thread WoodHacker
Hi, I'm trying to get the midi sound class in Java to work in Clojure. Everything seems to work fine except for the conversion of the following Java code: MidiChannel[] channels = synthesizer.getChannels; I've tried just dumping the channels into a Clojure object - (let [channels

Map keys

2011-01-23 Thread WoodHacker
Is it possible to create a map key from an integer or string to be used for retrieving data dynamically from a map? Bill -- 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 fro

Help with java conversion

2011-01-21 Thread WoodHacker
I'm converting the java code examples in Killer Game Programming in Java by Andrew Davison to Clojure and am having great fun doing it. But I've hit wall where I can't seem to get the code to work. The following code moves an animated gif strip to a java array: public BufferedImage[] loadStripI

Re: Multidimensional Float arrays

2011-01-12 Thread WoodHacker
nil. > > On Mon, Jan 10, 2011 at 8:32 PM, WoodHacker wrote: > > Hi, > > > Can anybody explain to me how to create a multidimensional array of > > floats such as: > > >   [[1.0 1.0 2.0 2.0] [3.0 2.2 4.0 0.0]] > > > Anything I try gives me errors. > >

Re: Multidimensional Float arrays

2011-01-11 Thread WoodHacker
When all else fails, read the directions. Thanks for the help. On Jan 10, 4:44 pm, Ken Wesson wrote: > On Mon, Jan 10, 2011 at 4:40 PM, WoodHacker wrote: > > The question was how to place data in the array, not create it.   I've > > been > > doing that.   How do y

Re: Multidimensional Float arrays

2011-01-10 Thread WoodHacker
wa (make-array Float/TYPE 4 4)) #'user/wa user=> wa # user=> (aset-float wa 0 0 & 1.0) java.lang.Exception: Unable to resolve symbol: & in this context (NO_SOURCE_FILE:5) user=> What am I missing? On Jan 10, 10:08 am, Albert Cardona wrote: > 2011/1/10 WoodHacker : >

Multidimensional Float arrays

2011-01-10 Thread WoodHacker
Hi, Can anybody explain to me how to create a multidimensional array of floats such as: [[1.0 1.0 2.0 2.0] [3.0 2.2 4.0 0.0]] Anything I try gives me errors. Bill -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Multiple Files

2010-10-19 Thread WoodHacker
Hi all, Can anyone help me with this? I have a program with multiple files. The program uses various data references, which may be accessed from different files. To facilitate this I usually put ref variables in a separate file and then :use that file in all the various modules that make up

Re: Handling keystrokes

2010-10-01 Thread WoodHacker
.This is done all the time, but I have no idea how to do it in Clojure. Bill On Sep 30, 8:16 am, Laurent PETIT wrote: > You have probably mistaken this clojure group for another ... > > 2010/9/30 WoodHacker > I have a keyboard paste problem, > but I think it has more general > >

Handling keystrokes

2010-09-30 Thread WoodHacker
I have a keyboard paste problem, but I think it has more general interest. When the user types Control V in a JTextPane, data from the clipboard will be pasted into the text. I want to act on that pasted text. I can easily capture the keystroke. The problem is that my capture takes place BE

Re: Dynamic defrecord

2010-07-29 Thread WoodHacker
Yes, but I don't want to load all the parts at once. I may have four records that will be part of MyFoo, but I only ever need one - maybe List3 in this case.That's why it's dynamic and why I have the problem in the first place. Bill On Jul 28, 12:40 pm, Armando Blancas wrote: > > It seem t

Re: Dynamic defrecord

2010-07-29 Thread WoodHacker
Hi Stu It is as simple as that. What I'm really working on is my own editor. The file in question is the lexer for various program types.The editor never knows what type of file will be loaded until it's loaded. At that point the proper lexer should be loaded and stored so that the nex

Re: Dynamic defrecord

2010-07-28 Thread WoodHacker
The confusion over type and instance was a sloppy example. Sorry. But in your solution I'm confused by one thing. You create and instance of Foo in the let and then assoc the new value of List1 to it. This has two problems. One is that the loaded data is not permanent. The other is that th

Dynamic defrecord

2010-07-27 Thread WoodHacker
All the examples of defrecord I see seem simple enough and when I experiment in the REPL I get things to work as they should. However, when I move to 'real' code I can't get it to work at all. The problem at hand is simple enough - I want to create a record that hold records. For example I have

Re: Clojure's n00b attraction problem

2010-06-29 Thread WoodHacker
> So I wonder how much making the first few baby steps easier is really > going to help the uptake of Clojure. I have to imagine that the kind > of person that can't figure out  a CLASSPATH is going to have his head > explode when he has to figure out how to restructure all his > iterations in ter

Re: How to reset a counter

2010-05-30 Thread WoodHacker
On May 29, 9:44 am, James Reeves wrote: > On 29 May 2010 14:19, WoodHacker 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

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 t

Testing equality

2010-04-28 Thread WoodHacker
Can someone explain to me why this doesn't work: (let [ p "Bill/" sep (System/getProperty "file.separator") ] (if (= (last p) sep) (println "found separator") (println "no separator") ) The (= (last p) sep) always returns false. If I print

Re: Nubie Question

2010-03-25 Thread WoodHacker
I thank all the people who have sent me solutions to my Conj problem. Unfortunately, none of them seem to work. The issue is adding a value to a defined vector - (def savedColors [black, white]) One solution was given as: (swap! savedColors conj newcolor) This produces still the following run

Re: Nubie Question

2010-03-24 Thread WoodHacker
ou really need > references. You haven't supplied enough context for us to make that > call. > > -Per > > On Tue, Mar 23, 2010 at 8:35 PM, WoodHacker wrote: > > I understand howconjworks.    But how do you add a value to a > > persistent vector?    You have to

Nubie Question

2010-03-23 Thread WoodHacker
I understand how conj works.But how do you add a value to a persistent vector?You have to add the new item to the vector with (conj vector item), but how do you assign the return value to the persistent vector. So far I have it working with a def -- (def vector (conj vector item)) -- but

JColorChooser

2010-03-22 Thread WoodHacker
When I try to use JColorChooser in Clojure I get the followinf error: Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: No matching method found: showDialog for class javax.swing.JColorChooser Shouldn't showDioalog be there? What and I doing wrong. Here's the code: (

For loop question

2010-03-20 Thread WoodHacker
When I run the following: (for [y (range 4)] (for [x (range 4)] (println x y))) I get what I expect - 0 0, 1 0, 2 0, 3 0 etc., but at the end of each y loop I also get 4 nils. ((0 0 1 0 2 0 3 0 nil nil nil nil) (0 1 1 1 2 1 3 1 nil nil nil nil) (0 2 What's going on? And how do I fix it?

Menubar presentation on a Mac

2010-03-09 Thread WoodHacker
Hi All, Can anyone explain how I can get a traditional Mac OS menubar to appear at the top of the screen? Normally I would use (System/setProperty "apple.laf.useScreenMenuBar", "true") and then (.setJMenuBar ...) in my main frame. This does not appear to work. The menu shows up in the frame i