Re: Migrating from nrepl.el to cider

2014-01-11 Thread mwillson
Thanks for the report - your are probably right re the attribution; I'll 
make a comment on the cider issue list.

Thanks,
-mark

On Saturday, 11 January 2014 08:11:33 UTC, Pink Bobsledder wrote:

 This is a me too.

 I've found this seemingly related 
 https://github.com/clojure-emacs/cider/issues/367

 This appears to be a cider problem more than a clojure issue, perhaps 
 directing this inquiry there would be more beneficial?

 Anyway, my fix is to ignore it - it seems that my repl works fine and I'm 
 able to get work done despite it. I'm using CIDER 0.5.0alpha, so I guess 
 I'm expecting some rough edges. The url I posted above seems to suggest 
 that They are aware of the issue.

 On Tuesday, December 31, 2013 7:56:46 AM UTC-8, Gary Trakhman wrote:

 I've seen the pprint error on startup often.


 On Tue, Dec 31, 2013 at 9:47 AM, mwillson cdr...@gmail.com wrote:

 Folks,

 I've recently migrated to cider on two platforms, Mac OS X (Mavericks) 
 and Debian Wheezy.  With each, I encountered one issue, but different in 
 each case.  If these are worth reporting formally, I'd be happy to do so.

 1. Mac OS X

 Once cider was installed, I was unable to use cider-jack-in; it just 
 hung.  In the process list was this:

 -bin/tcsh -c echo lein repl :headless | eval $SHELL -l


 tcsh is my default emacs shell but It looks like tcsh is not like other 
 shells; the invocation of lein is not echo'd to the login shell.  Replacing 
 the emacs default shell with /bin/bash solved the problem.

 This is probably a rare use-case, but I suppose could affect FreeBSD 
 users.

 2. Debian Wheezy

 The java environment is:

 OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1~deb7u1)
 OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

 This issue manifested itself as an error when issuing cider-jack-in. 
  Intermittently it would generate a stack trace:

 java.lang.IllegalAccessError: pp does not exist
   at clojure.core$refer.doInvoke (core.clj:3849)
   clojure.lang.RestFn.applyTo (RestFn.java:139)
   clojure.core$apply.invoke (core.clj:619)
   clojure.core$load_lib.doInvoke (core.clj:5394)
   clojure.lang.RestFn.applyTo (RestFn.java:142)
   clojure.core$apply.invoke (core.clj:619) ...


 Figuring intermittent issues might be caused by a race between the lein 
 repl coming up and the cider environment, I added a short pause to 
 cider-init-repl-buffer, just before the requires in nrepl-repl-requires-
 sexp are evaluated:

  defun cider-init-repl-buffer (connection buffer optional noprompt)
 Initialize the REPL for CONNECTION in BUFFER.
   Insert a banner, unless NOPROMPT is non-nil.
 (with-current-buffer buffer
   (unless (eq major-mode (quote cider-repl-mode))
 (cider-repl-mode))
   ;; use the same requires by default as clojure.main does
   (sit-for 1) ; allow lein repl to come up fully?
   (cider-eval-sync nrepl-repl-requires-sexp)
   (cider-repl-reset-markers)
   (unless noprompt
 (cider-repl--insert-banner-and-prompt nrepl-buffer-ns))
   (cider-remember-clojure-buffer cider-current-clojure-buffer)
   (current-buffer)))


 The problem has not recurred (yet).

 Anyone else seen similar things?

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


Migrating from nrepl.el to cider

2013-12-31 Thread mwillson
Folks,

I've recently migrated to cider on two platforms, Mac OS X (Mavericks) and 
Debian Wheezy.  With each, I encountered one issue, but different in each 
case.  If these are worth reporting formally, I'd be happy to do so.

1. Mac OS X

Once cider was installed, I was unable to use cider-jack-in; it just hung. 
 In the process list was this:

-bin/tcsh -c echo lein repl :headless | eval $SHELL -l


tcsh is my default emacs shell but It looks like tcsh is not like other 
shells; the invocation of lein is not echo'd to the login shell.  Replacing 
the emacs default shell with /bin/bash solved the problem.

This is probably a rare use-case, but I suppose could affect FreeBSD users.

2. Debian Wheezy

The java environment is:

OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1~deb7u1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

This issue manifested itself as an error when issuing cider-jack-in. 
 Intermittently it would generate a stack trace:

java.lang.IllegalAccessError: pp does not exist
  at clojure.core$refer.doInvoke (core.clj:3849)
  clojure.lang.RestFn.applyTo (RestFn.java:139)
  clojure.core$apply.invoke (core.clj:619)
  clojure.core$load_lib.doInvoke (core.clj:5394)
  clojure.lang.RestFn.applyTo (RestFn.java:142)
  clojure.core$apply.invoke (core.clj:619) ...


Figuring intermittent issues might be caused by a race between the lein 
repl coming up and the cider environment, I added a short pause to 
cider-init-repl-buffer, just before the requires in nrepl-repl-requires-sexp 
are 
evaluated:

 defun cider-init-repl-buffer (connection buffer optional noprompt)
Initialize the REPL for CONNECTION in BUFFER.
  Insert a banner, unless NOPROMPT is non-nil.
(with-current-buffer buffer
  (unless (eq major-mode (quote cider-repl-mode))
(cider-repl-mode))
  ;; use the same requires by default as clojure.main does
  (sit-for 1) ; allow lein repl to come up fully?
  (cider-eval-sync nrepl-repl-requires-sexp)
  (cider-repl-reset-markers)
  (unless noprompt
(cider-repl--insert-banner-and-prompt nrepl-buffer-ns))
  (cider-remember-clojure-buffer cider-current-clojure-buffer)
  (current-buffer)))


The problem has not recurred (yet).

Anyone else seen similar things?

-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: seancorfield /clj-soap

2013-05-18 Thread mwillson
Marc,

I tried and also failed.  I ended up writing my own.  See 
http://www.hydrus.org.uk/journal/soap.html

-mark

On Saturday, 18 May 2013 05:29:40 UTC+1, marc wrote:

 Hoping someone has already explored this. Has anyone ever used clj-soap as 
 a client and managed to pass in Basic authentication credentials?

 I tried putting them into the URL to the WSDL but that did seem to work…

 Off to read up on Axis 2…





-- 
-- 
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: How to represent trees for use with zippers

2012-10-16 Thread mwillson
Dave,

Your first attempt looks OK to me.

(require '(clojure [zip :as z]))

(def zipper (z/vector-zip [:A [:B [:D :E]] [:C [:F :G]]]))

(defn pre-order [loc]
  (when-not (z/end? loc)
(when-not (z/branch? loc)
  (println (z/node loc)))
(recur (z/next loc

user= (pre-order zipper)
:A
:B
:D
:E
:C
:F
:G
nil
user= 

What made you think it didn't work?

-mark

On Monday, October 15, 2012 9:20:14 PM UTC+1, Dave Kincaid wrote:

 I stumbled across the clojure.zip library today which looks extremely 
 useful for working with trees. The only problem is I can't figure out how 
 to represent a tree as a vector so that the zipper will have the correct 
 structure. For example say I want to work with this tree:


 https://lh5.googleusercontent.com/-mq1roiqfqw4/UHxvMDQUIfI/A_o/mNA9pAkOEIs/s1600/tree.png
 my first intuition was a vector like this [:A [:B [:D :E]] [:C [:F :G]]] but 
 that didn't work. Then I thought of something like this: [[:B [:D :E]] :A 
 [:C [:F :G]]]. It seems like that gets me a little bit closer since now 
 the zipper at least gets that :A has two children.

 Can anyone help me understand how to represent a tree in a Clojure vector? 
 Is there a common lispy way of doing this that everyone already knows? It 
 seems like all of the references I could find online all assume that you 
 know how to represent a tree already.

 Thanks,

 Dave


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

Re: How to write XML?

2012-06-16 Thread mwillson
On Wednesday, 13 June 2012 20:35:41 UTC+1, fenton wrote:

 For some reason I cannot create an XML node.  Sample code 
 here.https://gist.github.com/ce66585542f4b426381c Any 
 assistance much appreciated.


I think you need to create a zipper from the root node returned by 
(zip/root), so,

(def joey-text (zd/xml- (zip/xml-zip new-xml) :b2))

-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

Re: Exit delay from java when lazy?

2009-07-30 Thread mwillson

On Jul 29, 8:17 pm, Michael Wood esiot...@gmail.com wrote:
 2009/7/29 mwillson cdr@gmail.com:
 
  I was experimenting with Clojure and XML and stumbled upon a lengthy
  hang when exiting java which was tracked down to the use of
  clojure.contrib.lazy-xml.  Here's a toy example which exhibits the
  issue:

 I haven't looked at clojure.contrib.lazy-xml, but this sounds like
 what happens if you make use of agents.  Shutting down the agents with
 (shutdown-agents) should fix it if so.  Perhaps
 clojure.contrib.lazy-xml uses agents.

Michael,

Thanks for your reply.  You are quite right - adding (shutdown-agents)
does allow the script using lazy-xml to exit promptly.  From a cursory
scan of the lazy-xml/parse-seq code, it does use agents.

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



Exit delay from java when lazy?

2009-07-29 Thread mwillson

Hi,

I was experimenting with Clojure and XML and stumbled upon a lengthy
hang when exiting java which was tracked down to the use of
clojure.contrib.lazy-xml.  Here's a toy example which exhibits the
issue:

Script started on Wed Jul 29 15:06:44 2009
[~/dev/clojure]$ cat read-xml-lazy.clj
(ns strange
  (:use clojure.contrib.lazy-xml)
  (import (java.io ByteArrayInputStream)))

(time (clojure.contrib.lazy-xml/parse-trim
   (ByteArrayInputStream. (.getBytes (slurp msgs.xml)
#_(System/exit 0)

[~/dev/clojure]$ time java -cp clojure-1.0.0.jar\;clojure-contrib.jar
clojure.lang.Script read-xml-lazy.clj
Elapsed time: 691.81977 msecs

real1m1.796s
user0m0.031s
sys 0m0.061s
[~/dev/clojure]$ # now without laziness
[~/dev/clojure]$ cat read-xml-nonlazy.clj
(ns strange
  (import (java.io ByteArrayInputStream)))

(time (clojure.xml/parse
   (ByteArrayInputStream. (.getBytes (slurp msgs.xml)
#_(System/exit 0)


[~/dev/clojure]$ time java -cp clojure-1.0.0.jar\;clojure-contrib.jar
clojure.lang.Script read-xml-nonlazy.clj
Elapsed time: 15493.727555 msecs

real0m16.406s
user0m0.047s
sys 0m0.031s

[~/dev/clojure]$ java -version
java version 1.6.0_14
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)

[~/dev/clojure]$ exit
exit

Script done on Wed Jul 29 15:11:14 2009

While the time to perform the lazy xml read is much less than the non-
lazy, it takes nearly a minute to exit java.  If the (System/exit 0)
form is enabled, then the exit from java is immediate.

This is on a Windows XP platform, using cygwin as the shell, although
the same issue occurs when run under cmd.exe.  The version of clojure-
contrib is that provided by the Programming Clojure download.

The msgs.xml file is about 3.7MB and contains about 1300 XML elements
under the root.  It looks a bit like:

document
Message
...many elements in message
/Message
Message
...many elements in message
/Message
/document

So, it looks like my mother was right and laziness costs in the end.
Is anyone able to shed light on what might be going on here?

Many thanks,
Mark Willson

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