Re: remove a deployed artifact from clojars?

2016-04-17 Thread Kyle R. Burton
That's the one :)


Kyle

On Sunday, April 17, 2016, Sean Corfield <s...@corfield.org> wrote:

> I assume this is the one that should not be there:
>
>
>
> https://clojars.org/repl-from-java
>
>
>
> Sean Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>
>
> On 4/17/16, 9:58 AM, "Kyle R. Burton" <clojure@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','clojure@googlegroups.com');> on behalf of
> kyle.bur...@gmail.com
> <javascript:_e(%7B%7D,'cvml','kyle.bur...@gmail.com');>> wrote:
>
>
>
> Forgot the link (though it shouldn't matter):
>
>
>
> [1] https://clojars.org/com.github.kyleburton/repl-from-java
>
>
>
> On Sun, Apr 17, 2016 at 12:57 PM, Kyle R. Burton <kyle.bur...@gmail.com
> <javascript:_e(%7B%7D,'cvml','kyle.bur...@gmail.com');>> wrote:
>
> Hi,
>
>
>
> I just published a project [1] to clojars and neglected to use an
> organization.  I don't really want to claim a top-level name for the
> project.  Is there a way to unpublish, remove or otherwise deprecate a
> project that I've pushed to clojars.org?  Sorry if it's obvious and I'm
> not seeing it in the clojars interface.
>
>
>
>
>
> Kyle
>
>
>
> --
> 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
> <javascript:_e(%7B%7D,'cvml','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
> <javascript:_e(%7B%7D,'cvml','clojure%2bunsubscr...@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
> <javascript:_e(%7B%7D,'cvml','clojure%2bunsubscr...@googlegroups.com');>.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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/d/optout.


Re: remove a deployed artifact from clojars?

2016-04-17 Thread Kyle R. Burton
Forgot the link (though it shouldn't matter):

[1] https://clojars.org/com.github.kyleburton/repl-from-java

On Sun, Apr 17, 2016 at 12:57 PM, Kyle R. Burton <kyle.bur...@gmail.com>
wrote:

> Hi,
>
> I just published a project [1] to clojars and neglected to use an
> organization.  I don't really want to claim a top-level name for the
> project.  Is there a way to unpublish, remove or otherwise deprecate a
> project that I've pushed to clojars.org?  Sorry if it's obvious and I'm
> not seeing it in the clojars interface.
>
>
> Kyle
>
> --
> Twitter: @kyleburton
> Github: https://github.com/kyleburton
> Blog: http://asymmetrical-view.com/
> Fun: http://snapclean.me/
>



-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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/d/optout.


remove a deployed artifact from clojars?

2016-04-17 Thread Kyle R. Burton
Hi,

I just published a project [1] to clojars and neglected to use an
organization.  I don't really want to claim a top-level name for the
project.  Is there a way to unpublish, remove or otherwise deprecate a
project that I've pushed to clojars.org?  Sorry if it's obvious and I'm not
seeing it in the clojars interface.


Kyle

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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/d/optout.


Re: Jobs in clojure.

2016-03-29 Thread Kyle R. Burton
There are at least two companies in Philadelphia that use Clojure:

* Relay Network (their engineering office is in center city Philly)
* RJ Metrics

I don't know if either is looking for interns, I think both are hiring.  I
used to be at Relay and can put you in touch with people there.  I've never
worked for RJ Metrics, but have worked with several of their people - I'd
be happy to put you in touch with them as well.

Best Regards,

Kyle

On Tue, Mar 29, 2016 at 4:25 PM, Jason Basanese 
wrote:

> I recently have been looking for summer internships. However most of the
> companies I find either do not know what Clojure is or are certain they
> want nothing to do with it as they would much rather stick to Java or
> Javascript. Yes I know that Clojure compiles to both of those but this
> seems to be a mute point in most cases. It is a mute point because telling
> an employer you could make really great black boxes for them is not exactly
> alluring.
>
> Do you guys know of any companies that use Clojure? Have any suggestions
> on how to present Clojure in a more appealing manner? General suggestions
> on where to look for jobs in Clojure, such as startups vs large companies
> or job fairs vs online applications? Basically any suggestion as to how to
> find a job in the field with Clojure?
>
> I have grown to love the language but am failing to find a market for it.
>
> --
> 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/d/optout.
>



-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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/d/optout.


Re: Largest Clojure codebases?

2015-11-16 Thread Kyle R. Burton
At the last company I was with I used sloccount [1] to analyze the
codebase.  I concatenated all the clj files to a .lisp file so sloccount
could analyze it.  I was curious about the cost estimate that sloccount
performs to see how the team measured up (size varied from 2 to 7 over 5
years).  When I did the analysis (over a year ago) we had about 130k lines
of Clojure that represented about two dozen libraries and bout six
services.  Including the javascript, java, C, Ruby and other languages in
our repositories, sloccount estimated over 5x the person years we actually
spent.  This team was also responsible for the whole stack - production
operations, releases, etc.  If someone is doing research, I'd be happy to
reach out to a colleague to see if they would run the analysis again.


Kyle


[1] http://www.dwheeler.com/sloccount/

On Sun, Nov 15, 2015 at 4:06 PM, dennis zhuang  wrote:

> I use cloc(http://cloc.sourceforge.net/) to counting the LOC of our
> projects, it's total about 41025 lines of Clojure  code.
>
>
>
>
>
>
> 2015-11-16 7:22 GMT+08:00 Colin Yates :
>
>> Exactly this. I couldn’t find a reliable way of counting LOC but my
>> (Clojure/ClojureSciprt) src tree (excluding test) in the project I have to
>> hand is 1.5MB.
>>
>>
>> On 15 Nov 2015, at 21:27, Timothy Baldridge  wrote:
>>
>> It's funny, because most of the larger OOP projects I worked on were
>> large because of class bloat, not because of business concerns. For
>> example, the C# app I used to work on was a more or less simple CRUD app.
>> We had a ORM that served up objects to a Silverlight UI. So if we wanted to
>> display information about a person on the UI we normally had to modify
>> around 5 classes in 5 files. We had the following layers
>>
>> ORM - 1.4MB of generated C# for interfacing with the 200 or so SQL tables
>> we had
>> DTO - Data Transfer Object, where used "normal" C# objects to abstract
>> the ORM. This is where we had the "Person" object
>> API - A web service that served up DTOs over HTTP
>> Data Model - Processed views of DTOs formatted in a way that was easily
>> viewable by the UI
>> View Model - UI classes that would take data from a Data Model and emit
>> UI controls.
>>
>> All of that ceremonythat is replaced by one thing in Clojure...data.
>> Hashmaps and vectors replace all the junk you see above.
>>
>> So that's where I often assert "Yes, you may have 1 million lines of Java
>> codebut that would only be ~10,000 lines of Clojure." With proper
>> application of data driven systems (data that configures pipelines and
>> writes code) you can easily get a 100:1 ratio of Java to Clojure code.
>>
>> Timothy
>>
>>
>> On Sun, Nov 15, 2015 at 12:48 PM, Marc O'Morain 
>> wrote:
>>
>>> We have a large app at CircleCI - as of September:
>>>
>>> "The repo for our main app contains 93,983 lines of Clojure code. The
>>> src directory of our main app contains 369 namespaces."
>>>
>>> http://blog.circleci.com/why-were-no-longer-using-core-typed/
>>>
>>>
>>>
>>> On Sun, Nov 15, 2015 at 7:22 PM, dilettante.co...@live.com <
>>> dilettante.co...@live.com> wrote:
>>>
 I've been having a (friendly) argument with a friend who is an
 old-school OOP programmer.  He insists that you need objects to make
 large-scale codebases legible and maintainable over the long run.  Quite
 apart from this argument's virtues or lack thereof, this made me curious --
 what are the largest programs written in Clojure in terms of LOC?  I know
 I've seen mentions of 50k-100k LOC projects (World Singles, if I'm
 remembering correctly), but are there any that are larger?

Vikram

 --
 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/d/optout.

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

Re: 0.1.0 core.async release?

2015-08-08 Thread Kyle R. Burton
Sorry about the '0.1.0', I had indeed found that in the project.clj.

Is there anything I can do to help w/the round of work?

Regards,

Kyle

On Fri, Aug 7, 2015 at 5:12 PM, Alex Miller a...@puredanger.com wrote:

 I don't where the 0.1.0 number is coming from, but yes there are plans to
 do a round of work on core.async and release in the near future.


 On Friday, August 7, 2015 at 1:16:19 PM UTC-5, Kyle Burton wrote:

 Is there a new release planned for core.async anytime in the near future?

 The docs show some functionality that's not in the current release [1].
 Specifically offer! [2] which looks like it's slated for 0.1.0 (love to
 switch to that from alts+timeout).

 Are there (perhaps) tasks that need a dev? (yes, I'm offering to help)

 Regards,

 Kyle



 [1] https://github.com/clojure/core.async shows Latest release:
 0.1.346.0-17112a-alpha
 [2] http://clojure.github.io/core.async/#clojure.core.async/offer!

 --
 Twitter: @kyleburton
 Github: https://github.com/kyleburton
 Blog: http://asymmetrical-view.com/
 Fun: http://snapclean.me/

 --
 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/d/optout.




-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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/d/optout.


0.1.0 core.async release?

2015-08-07 Thread Kyle R. Burton
Is there a new release planned for core.async anytime in the near future?

The docs show some functionality that's not in the current release [1].
Specifically offer! [2] which looks like it's slated for 0.1.0 (love to
switch to that from alts+timeout).

Are there (perhaps) tasks that need a dev? (yes, I'm offering to help)

Regards,

Kyle



[1] https://github.com/clojure/core.async shows Latest release:
0.1.346.0-17112a-alpha
[2] http://clojure.github.io/core.async/#clojure.core.async/offer!

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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/d/optout.


[ANN] clj-xpath 1.4.5 OWASP XXE Vulnerability Fix

2015-08-06 Thread Kyle R. Burton
clj-xpath is a library for working with XML and XPath in Clojure.

This release [1] addresses an issue reported by Louis Nyffenegger [2].
This release changes the default features enabled in the XML parser to
improve security - see the bug for a link to hte OWASP vulnerability.


Best Regards,

Kyle Burton


[1] https://github.com/kyleburton/clj-xpath/releases/tag/clj-xpath-1.4.5

[2] https://github.com/kyleburton/clj-xpath/issues/25

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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/d/optout.


Re: *read-eval* vulnerability

2013-01-30 Thread Kyle R. Burton
On Wed, Jan 30, 2013 at 10:18 AM, Marek Šrank markus.mas...@gmail.comwrote:

 The most simple thing would be to change the default value of *read-eval*
 to false...


Understanding that this may break existing code (how much?), I think it
would reflect well on the community to make decisions to improve safety and
security, especially with respect to defaults like this.  Avoiding
surprises after deployment is a virtue in my option.

+1

Regards,

Kyle Burton

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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




Looking for ideas for a hack-night to contribute back

2012-12-21 Thread Kyle R. Burton
All,

We run a Clojure group out of our company's office.  We want to put
together a hack night where we work on something meaningful.  To that end I
thought I'd put that question to the wider community: what could be
valuable to the community for us to work on?  The group has a pretty varied
amount of experience, some of us use Clojure every day, some are new to it.


Regards,

Kyle


-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Kyle R. Burton
 Dependency information is at the very bottom of the document? How are
 newcomers
 supposed to find it? Please make it more visible.



Good point.  I've moved the dependency info up towards the top of the
README.


Thanks for the feedback.

Best Regards,

Kyle

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Kyle R. Burton
On Tue, Nov 20, 2012 at 10:35 AM, Mark Rathwell mark.rathw...@gmail.comwrote:

 You can contact the maintainers at the address found at the bottom of [1]
 and ask them to remove the clj-xpath group, but you probably don't want to
 do that if anyone is using the library.


Thanks for the link.  I have no idea if anyone is using the library w/o the
group name.  Is there any way to tell via Clojars?


Regards,

Kyle


-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

[ANN] clj-xpath 1.3.3

2012-11-19 Thread Kyle R. Burton
clj-xpath is a library that makes it easier to with XPath from Clojure.

I've never announced this library before (or any for that matter).  Someone
recently sent me a pull request to fix an issue in the README (during the
Conj) so I thought I'd announce it to solicit feedback.

The Leiningen coordiates are:

  [org.clojars.kyleburton/clj-xpath 1.3.3]

An introduction and some documentation is available here:

  http://kyleburton.github.com/clj-xpath/site/

The project is on github here:

  https://github.com/kyleburton/clj-xpath


Best Regards,

Kyle

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

Can't go to the Conj, I have 2 tickets

2012-11-13 Thread Kyle R. Burton
Please contact me off list if anyone is interested in purchasing either of
them.

I contacted the organizers and they are transferable.

I'm sorry I'm not going to be able to make it.

Best Regards,

Kyle

-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

Looking for help with a deadlock issue

2012-07-27 Thread Kyle R. Burton
I encountered a deadlock on one of our production systems (one out of
3) last night.  Looking at a thread dump of the JVM, there are several
(over 200) threads that are all waiting on a
java.util.concurrent.locks.ReentrantLock from Keyword.intern.

I've put up the thread dump and information about the os and jvm versions here:

  https://github.com/relaynetwork/20120727-deadlock-issue

The part of our application that deadlocked is a web service that uses
Compjure and Jetty.  Other parts of the application did not deadlock
(we have AMQP consumers that were still processing successfully).

I have since restarted the service and it is processing again.  I'm
not sure what to look at next, can anyone suggest a next step for
determining the cause?


Best Regards,

Kyle Burton

-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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: Assuring avalaibility of ring web apps

2012-05-16 Thread Kyle R. Burton
 I'm not personally using this but people I trust recommend it highly.
 It has a free option plus fairly reasonable monthly options.

 http://www.pingdom.com/

We use a similar service: cloudkick

We have some custom plugins that we've written for it (to monitor
RabbitMQ consumers and queue sizes -- we have had consumers die and
need to be restarted).

As you are, we are using Nginx.  We have it set up to serve static
content and act as a load balancer and to do SSL termination.  We have
a cluster of app servers set up behind this Nginx load balancer.
Having multiple app servers helps significantly with issues like a
single box going out.  We have 3 configurations for the load balancer:
an A, a B and A+B.   Where each has 50% of the app servers configured.
 Nginx handles any one of the app servers being down, and we perform
releases, we split the cluster in to A, deploy to the boxes in B, wait
for the JVMs to warm up, the flip A and B and release to the A
partition.  When those JVMs have warmed up we put them all back into
rotation (A+B).  We use a symlink to point to the 3 configurations and
do a HUP on Nginx to have it reload its configuration without dropping
any connections.

We're not on AWS yet, if we were I think the same would be
accomplished with ELB instead of Nginx.

I think this is a pretty common set up -- we are following the books:
Scalable Internet Architectures, and Release IT (I highly recommend
both of those books).


Regards,

Kyle

-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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: Macros to help writing closures?

2012-04-22 Thread Kyle R. Burton
 (defmacro foo [fname  body]
   `(defn ~fname []
  (let [~'log (~'makeLogger ~fname)]
    ~@body)))


You may be able to do this as:



(defmacro foo [fname  body]
  `(defn ~fname []
 (let [~'log (~'makeLogger ~(str fname))]
   ~@body)))

Macros can call other functions - so you may be able to just stringify
the function name.

HTH,

Kyle

-- 
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: REQUEST for feedback on http://clojure.org

2010-11-02 Thread Kyle R. Burton
 I'm particularly interested in:
 - new user groups or suggestions for the community page
 - stuff that is just wrong or out of date

Philly Clojure Language Club:
http://groups.google.com/group/phl-clojure-language-club

Kyle

-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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: Creating Java array of specific type

2010-10-25 Thread Kyle R. Burton
 If I have a seq of NameValuePair (a class in Apache HttpClient), how
 do I get an array of that type (NameValuePair[])? I've tried a few
 things but always got Object[].

Two quick ways are make-array and into-array:

   (make-array String 10)

  (into-array String [this that])

These both result in a type of String[].


HTH,


Kyle

-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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: Conj arrivals and Thursday night...

2010-10-18 Thread Kyle R. Burton
Andrew,

Several of us are car pooling down from Philly and should be arriving
some time between 6 and 8pm.  I will be hoping to drop off our bags
and get dinner somewhere and otherwise be social with other
conferencegoers.  Are there any recommendations for dinner the night
before?  Any social events or get-togethers on Thursday evening?

Regards,

Kyle

On Mon, Oct 18, 2010 at 12:32 PM, Andrew Gwozdziewycz apg...@gmail.com wrote:
 Hey Conj goers,

 I'm scheduled to arrive around 6:30, and after I check in am planning
 to spend the rest of the night writing code. Anyone want to help
 commandeer a random lobby to join in on the fun?

 Andrew
 --
 http://www.apgwoz.com

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



-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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


sql and cursors

2010-10-16 Thread Kyle R. Burton
As far as I can tell, contrib.sql's functions do not use database
cursors (at least for PostgreSQL, again as far as I can tell).  For
result sets that are larger than you'd like to load into the running
process, but rather step through the results and have them fetched on
demand from the server, I've tried creating a version of
with-query-results that does this:

(ns db-utils
  (:require [clojure.contrib.sql :as sql]))

(def *default-fetch-size* 50)

(defn with-query-results-cursor [[sql  params :as sql-params] func]
  (sql/transaction
   (with-open [stmt (.prepareStatement (sql/connection) sql)]
 (doseq [[index value] (map vector (iterate inc 1) params)]
   (.setObject stmt index value))
 (.setFetchSize stmt *default-fetch-size*)
 (with-open [rset (.executeQuery stmt)]
   (func (resultset-seq rset))

  ;; example usage:
  (sql/with-connection db-conn-info
(with-query-results-cursor [SELECT * FROM table_name]
  (fn [rs]
(doseq [rec rs]
  (printf rec: %s\n rec)

The Postgres documentation states that auto-commit must be off and the
fetch size must be non-zero for the cursor to work correctly.  Is
there any interest in folding this into contrib.sql?

Best Regards,

Kyle Burton

-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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


sql utilities

2010-10-14 Thread Kyle R. Burton
I've written some sql helper functions that will do things like list
the objects in the database and describe a table.  I've found these
handy when doing interactive development as I don't have to jump over
to another app to see what the make up of tables are.  I've also used
it in some scenarios when generating code from the database schema.

The functions are below, they make use only of standard JDK java.sql
functions and classes.  I'd like to see if there is any interest in
adding these to one of the contrib libraries - I'd be happy to clean
them up, create a patch or send a pull request (I've already submitted
a contributor agreement).

Best Regards,

Kyle Burton


(defn schemas
 Returns a list of the schema names in the database.
 [db]
 (sql/with-connection db
   (let [schemas (.getSchemas (.getMetaData (sql/connection)))]
     (loop [has-next (.next schemas)
            res []]
       (if has-next
         (let [schema  (.getString schemas 1)]
           (recur (.next schemas)
                  (conj res schema)))
         res)

(defn schema-objects
 Returns a list of maps describing the objects in the database.  The
 maps include: :catalog, :schema, :name, :type and :remarks as per
 the JDBC spec.
 [db schema]
 (sql/with-connection db
   (let [db-meta (.getMetaData (sql/connection))
         ;; NB: public is the default for postgres
         tables  (.getTables db-meta nil schema % nil)]
     (loop [has-next (.next tables)
            res []]
       (if has-next
         (let [table {:catalog  (.getString tables  1)
                      :schema   (.getString tables  2)
                      :name     (.getString tables  3)
                      :type     (.getString tables  4)
                      :remakrs  (.getString tables  5)}]
           (recur (.next tables)
                  (conj res table)))
         res)

(defn schema-tables [db schema]
 (filter #(= (:type %1) TABLE) (schema-objects db schema)))

(defn- range-sql [end]
   (range 1 (+ 1 end)))

(defn describe-table
 Returns a list of column descriptions (maps) for the table.  The
  maps
  contain: :name, :catalog, :display-zie, :type, :precision, :scale
  :is-auto-increment, :is-case-sensitive, :is-currency
  :is-definitely-writable, :is-nullable, :is-read-only
  :is-searchable, :is-signed, :is-writable.
 [db table-name]
 (sql/with-connection db
   (let [ps (.prepareStatement (sql/connection) (format SELECT * FROM
%s WHERE 0 = 1 table-name))
         rs (.executeQuery ps)
         rs-meta (.getMetaData rs)]
     (loop [[idx  idxs] (range-sql (.getColumnCount rs-meta))
            res []]
       (if idx
         (recur idxs (conj res {:name
(.getColumnName rs-meta idx)
                                :catalog
(.getCatalogName rs-meta idx)
                                :display-size
(.getColumnDisplaySize rs-meta idx)
                                :type
(.getColumnType rs-meta idx)
                                :precision              (.getPrecision
rs-meta idx)
                                :scale                  (.getScale rs-meta idx)
                                :is-auto-increment
(.isAutoIncrement rs-meta idx)
                                :is-case-sensitive
(.isCaseSensitive rs-meta idx)
                                :is-currency            (.isCurrency
rs-meta idx)
                                :is-definitely-writable
(.isDefinitelyWritable rs-meta idx)
                                :is-nullable            (.isNullable
rs-meta idx)
                                :is-read-only           (.isReadOnly
rs-meta idx)
                                :is-searchable          (.isSearchable
rs-meta idx)
                                :is-signed              (.isSigned rs-meta idx)
                                :is-writable            (.isWritable
rs-meta idx)}))
         res)



-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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: sql utilities

2010-10-14 Thread Kyle R. Burton
 This is fantastic! Does it work reliably for most JDBC drivers? Some
 drivers may not implement meta data API very well, and some drivers
 may have their own idiosyncrasies. You can perhaps setup a GitHub
 project and push to Clojars if this doesn't get into contrib any time
 soon.

I have made an attempt to use only standard SQL and standard JDK api's
- I have tested it against MySQL and PostgreSQL successfully.  I don't
have access to other databases.  I'd be happy to put it into a github
project, but thought I'd offer it to the group first.


Regards,

Kyle


-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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: Clojure meetup group listing

2010-09-21 Thread Kyle R. Burton
We created a Philadelphia Clojure Langauge Club. The google group is here:

  http://groups.google.com/group/phl-clojure-language-club

We're actually meeting again tomorrow night, but don't have any formal
plans beyond that.  We had one lunch meeting, a hack night, and a
pseudo presentation night.  They have all been great.

Kyle



-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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


Philly Clojure Lunch Club

2010-08-27 Thread Kyle R. Burton
A lunch club sounded like a great idea, so I'm organizing one for
Monday the 30th in the Philadelphia suburbs - I've also created a
google group for coordination.  If anyone's able to make it, please
drop an email to the list so I know how many to expect.
http://groups.google.com/group/phl-clojure-language-club

Regards,

Kyle

--
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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


Looking for feedback: Deploying a Clojure App

2010-08-26 Thread Kyle R. Burton
http://news.ycombinator.com/item?id=1636515

Or Direct link:

http://asymmetrical-view.com/2010/08/26/how-were-deploying-our-clojure-applications.html

I thought others might find reading this valuable, I'm sure there are other
ways to do this, it's working for me for now.


Regards,


Kyle



-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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: A simple csv parsing library

2010-06-08 Thread Kyle R. Burton
 I've added my work on the csv reader/writer library to github
 (http://github.com/jonase/cljcsv). Please let me know If anyone finds
 it useful.

Thanks for the implementation, I'm very encouraged that you followed
the RFC (I've seen lots of implementations that haven't).

I took a quick look at both yours and clojure-csv [1].  I'm not using
the 1.2 snapshots so I wasn't able to try out your implementation, but
I did notice clojure-csv is lax about invalidly formatted files - if a
quoted field ends the file but is not terminated before eof, it does
not signal an error.  I think I recognize the same behavior in cljcsv
as well (though as I said I could not try it).  It might be nice to at
least have an option which allows an unterminated field to be
recognized.

Best Regards,

Kyle

[1] http://github.com/davidsantiago/clojure-csv

 On Wed, May 26, 2010 at 6:40 AM, Jonas Enlund jonas.enl...@gmail.com wrote:
 Hi there

 I built a simple csv parsing library[1] last weekend which I want to
 show you guys. It follows the RFC 4180[2] pretty closely but it allows
 for any character as separator and quote mark. It would be great if
 someone would take time and read the code. I would like to know:

 a) Can performance still be improved?
 b) Is it idiomatically written?
 c) What should an idiomatic csv parsing API look like in Clojure?
 Currently there is only one public function, 'parse' (like
 clojure.xml).

 The end of the file contains a few usage examples.

 happy hacking!
 /Jonas

 [1] http://gist.github.com/414023
 [2] http://tools.ietf.org/html/rfc4180


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



-- 
--
kyle.bur...@gmail.comhttp://asymmetrical-view.com/
--

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


jrclj: library for calling clojure from JRuby

2010-03-07 Thread Kyle R. Burton
Hello,

We've been using Clojure and JRuby on a project at work.  For that
project we've got libraries we implemented in clojure and an
application in JRuby - so that we can call the clojure libraries from
the JRuby code I wrote a library, JRClj, to make api easier to deal
with.  The project is installable via jgem, and is on github here:

 http://github.com/kyleburton/jrclj

The JRuby code then looks like this:

  clj = JRClj.new clojure.contrib.str-utils
  puts clj.str_join :, [1,2,3]
  # prints '1:2:3'

I know cross JVM language invocation has come up on the list before so
I thought the list would be interested in the library.

Best Regards,

Kyle Burton

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


getting a library listed on the library page?

2010-02-24 Thread Kyle R. Burton
I've written an XPath library in clojure that wraps the Java api to
make it easier to use from clojure [1].  What is the process for
submitting libraries for inclusion on the clojure library page?  I'm
also not sure if the community feels this is worth including but I
thought I'd offer it to see if it is.

Best regards,

Kyle Burton

[1] http://github.com/kyleburton/clj-xpath

-- 
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: getting a library listed on the library page?

2010-02-24 Thread Kyle R. Burton
Thank you!

I have not yet picked a license for the library, I am open to any of
them, but would like to know what the preferred license is for the
project.  My first leaning is towards a permissive license such as
BSD.  What is preferred or recommended for clojure and its libraries?

Thank you,

Kyle

On Wed, Feb 24, 2010 at 10:44 AM, Krešimir Šojat kso...@gmail.com wrote:
 Hi,

 On Feb 24, 2:59 pm, Kyle R. Burton kyle.bur...@gmail.com wrote:
 I've written an XPath library in clojure that wraps the Java api to
 make it easier to use from clojure [1].  What is the process for
 submitting libraries for inclusion on the clojure library page?

 Instructions on how to get listed are at:
 http://groups.google.com/group/clojure/browse_thread/thread/affb08d66c048c7f/77f10a8a9a55d089#77f10a8a9a55d089

 --
 Krešimir Šojat

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



-- 
--
kyle.bur...@gmail.comhttp://asymmetrical-view.com/
--

-- 
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: Got a Clojure library?

2010-02-24 Thread Kyle R. Burton
 The name of your library

clj-xpath

 Library home page URL

http://github.com/kyleburton/clj-xpath

 Your name

Kyle Burton

 Category (db, web, UI, parsing etc)

XML Processing, XPath

 License

EPL

 A one-paragraph description. Include 3rd party dependencies if any.

Simplified XPath Library for Clojure.  This library provides a thin
layer around basic parsing and XPath interaction for common use cases.
3rd party dependencies are xalan and log4j.  The project can be built
and installed with maven or used as source.

-- 
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: Remote swank cannot recconnect

2010-01-26 Thread Kyle R. Burton
 I've setup slime to remote repl according to
 http://asymmetrical-view.com/2009/08/20/emacs-slime-remote-repl.html
 So far so good (there are some issues, but that other time).

 There is a problem with reconnecting to the remote machine after the
 connection is broken (running on wifi). I have tried also to telnet (at the
 remote machine) to the specified port and connection refused :(

 So I have kill the REPL every time is happens and of course I am loosing all
 the testing stuff in repl.

 Anyone having same problems? Solutions?

Lukas,

If you've lost your network connection, you will probably need to both
re-establish the ssh port forward (i.e. kill the ssh connection -- try
enter ~ .), and run M-x slime-disconnect from your local Emacs.
When the network connection is lost you will likely have to set up all
the parts again - though when I've done it before swank continues to
listen and I can re-establish the port forward and connect again.

In that article I advise against making the swank listener bind to a
port that is open to the internet, which is why I have the example off
using ssh port forwarding.

After your network connectivity returns, can you ssh into the remote
machine again?


Let us know how it goes.

Regards,

Kyle

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


Clojure, Maven and Swank

2010-01-05 Thread Kyle R. Burton
Hello,

I was wondering if anyone else had run into these issues or might know
what we're experiencing.

Our project is using the maven clojure plugin (works superbly) and
swank.  We have a long running service that both runs a swank listener
and a Repl when it starts (so we can connect to and interact with it).
 We've listed swank-clojure as a dependency in the pom.xml file, but
if we require swank.swank from the ns definition in clojure, then
something strange happens: the maven compilation hangs just after the
clojure compiler prints out that it's compiling the last of our
clojure files.  As far as we can tell, neither mvn, or java are doing
anything useful - strace shows that the parent java process (mvn) is
in a call to futex and the child process is in the same system call.
Whatever they are awaiting eventually happens and the compile finishes
- though it takes a significant amount of time.  Removing the require
eliminates the mysterious hang.

We've worked around this by not doing the require in the ns
definition, still mentioning swank as a dependency in the pom, using
assembly:assembly to build a full jar (which includes swank correctly)
and then a simple runner clojure script to require swank and then run
our serivces.

Has anyone else seen this or know what we might be experiencing?


Best Regards,

Kyle

-- 
--
kyle.bur...@gmail.comhttp://asymmetrical-view.com/
--

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


clj-xpath

2009-10-09 Thread Kyle R. Burton

Hello all,

We needed to use xpath at work, and though zip-filter is nice, it
isn't actually xpath and that's what we wanted in this case - so we
wrote a little wrapper library to make using xpath from Clojure
simpler.  I've put the library up on github here:

  http://github.com/kyleburton/clj-xpath

I may not have searched well enough, but I was unable to find anything
that looked like it fit our needs before we embarked on writing this
(admittedly lightweight wrapper library).  We found it useful and
wanted to offer it back to the community.

Any feedback, pointers to other libraries or suggestions will be
greatly appreciated.

Best Regards,

Kyle Burton

-- 
--
kyle.bur...@gmail.comhttp://asymmetrical-view.com/
--

--~--~-~--~~~---~--~~
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: binary serialization

2009-08-10 Thread Kyle R. Burton

 Is there a way to do binary serialization of Clojure/Java values?
 ASCII (read) and (write) are nice, but they are wasting space,
 truncating floats and are probably slow compared to binary
 serialization.

The following utility functions have worked in many cases for me:

(defn object-file [obj file]
  (with-open [outp (java.io.ObjectOutputStream.
(java.io.FileOutputStream. file))]
(.writeObject outp obj)))


(defn file-object [file]
  (with-open [inp (java.io.ObjectInputStream. (java.io.FileInputStream. file))]
(.readObject inp)))

(defn freeze
  ([obj]
 (with-open [baos (java.io.ByteArrayOutputStream. 1024)
 oos  (java.io.ObjectOutputStream. baos)]
   (.writeObject oos obj)
   (.toByteArray baos)))
  ([obj  objs]
 (freeze (vec (cons obj objs)

One caveat though is that currently some of the clojure data types
(like Symbols) that I thought would have been serializable are not.  I
think that in the case of Clojure symbols it is being addressed
though.

Hope this helps,

Regards,

Kyle Burton

--~--~-~--~~~---~--~~
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: creating classes in Clojure

2009-08-10 Thread Kyle R. Burton

On Mon, Aug 10, 2009 at 10:31 PM, fft1976fft1...@gmail.com wrote:

 Is there a way to create a Java class (not instance) in Clojure
 without writing actual Java? e.g.

 public class person {
  public string name;
  public int num_children;
  public double weight;
 }

Yes, tho perhaps not according to the example you have there.  You can
complie a clojure file by using gen-class:

  http://clojure.org/compilation

gen-class does support a state declaration, but it doesn't seem to map
cleanly to member variables as in your example. What is probably more
idiomatic on the clojure side is to use a map for such a data object.

I wrote up an example that uses gen-class and ant to create executable
jars here:

  http://asymmetrical-view.com/2009/06/22/executable-clojure-jars.html

Regards,

Kyle Burton

--~--~-~--~~~---~--~~
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: binary serialization

2009-08-10 Thread Kyle R. Burton

On Mon, Aug 10, 2009 at 10:42 PM, Kyle R. Burtonkyle.bur...@gmail.com wrote:
 Is there a way to do binary serialization of Clojure/Java values?
 ASCII (read) and (write) are nice, but they are wasting space,
 truncating floats and are probably slow compared to binary
 serialization.

 The following utility functions have worked in many cases for me:

 (defn object-file [obj file]
  (with-open [outp (java.io.ObjectOutputStream.
 (java.io.FileOutputStream. file))]
    (.writeObject outp obj)))


 (defn file-object [file]
  (with-open [inp (java.io.ObjectInputStream. (java.io.FileInputStream. file))]
    (.readObject inp)))

 (defn freeze
  ([obj]
     (with-open [baos (java.io.ByteArrayOutputStream. 1024)
                 oos  (java.io.ObjectOutputStream. baos)]
       (.writeObject oos obj)
       (.toByteArray baos)))
  ([obj  objs]
     (freeze (vec (cons obj objs)

Sorry, forgot to offer up the inverse of freeze, thaw:

(defn thaw [bytes]
  (with-open [bais (java.io.ByteArrayInputStream. bytes)
  ois  (java.io.ObjectInputStream. bais)]
(.readObject ois)))


Regards,

Kyle

--~--~-~--~~~---~--~~
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: binary serialization

2009-08-10 Thread Kyle R. Burton

 Does all this work with cycles, Java arrays, etc.?


It will work with anything that implements the Serializable interface
in Java.  Arrays do implement that interface, as do all the
primitives.  With respect to cycles, I'd suspect it does, but would
test it.  If you have a repl handy it should be pretty easy to test
those functions out on your data structures.

What class has the cycle?  Is it a standard collection?

Regards,

Kyle


-- 
--
kyle.bur...@gmail.comhttp://asymmetrical-view.com/
--

--~--~-~--~~~---~--~~
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: executing tasks on a schedule

2009-06-29 Thread Kyle R. Burton

I wrote a basic quartz adapter for calling clojure functions by
submitting a job to call a clojure function by namespace/name or
submitting a closure.  My write-up is here:

  http://asymmetrical-view.com/2009/05/19/quartz-and-clojure.html

The example quartz code is in my github sandbox:

http://github.com/kyleburton/sandbox/tree/master

For me the advantage of using quartz and clojure is that it's in the
same JVM as other parts of the application - I don't need to create a
separate command line runner which can be invoked by cron.  I'm also
exploring creating a scheduling service using Quartz listening on an
AMQP message queue - where you can send it a message with the
scheduling details (one off or recurring) a return queue and an
embedded message body.  At the triggering time it sends the embedded
message back.  This is also more flexible than Cron - it's all handled
within the application and I can register and unregister the triggers.
 Cron would be more difficult to use for cases where I want to defer
some activity by sending it to the scheduler to be returned in say 10
minutes.

The scheduler service isn't in my sandbox yet, but I do plan on
publishing it when its complete and I have the time.

HTH,

Kyle

On Sat, Jun 27, 2009 at 2:55 AM, ataggartalex.tagg...@gmail.com wrote:

 What do you need that a cron job wouldn't provide?

 On Jun 26, 8:43 am, Stuart Halloway stuart.hallo...@gmail.com wrote:
 I am working on a Clojure project that is becoming more and more
 schedule-oriented. So far I have been using Clojure's native
 concurrency constructs, but I am becoming tempted to use Java's
 concurrency primitives to get interruptability, etc. -- or maybe even
 wrap a Java library like Quartz.

 Has anyone else been down this road?

 Stu
 




-- 
--
kyle.bur...@gmail.comhttp://asymmetrical-view.com/
--

--~--~-~--~~~---~--~~
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: timing for map

2009-06-07 Thread Kyle R. Burton

I map produces a lazy sequence, time doesn't force it, if you wrap it
in either a dorun or doall, you should get what you expect:

user (time (map #(Thread/sleep %) '(1000 1000 1000)))
Elapsed time: 0.156 msecs
(nil nil nil)
user (time (doall (map #(Thread/sleep %) '(1000 1000 1000
Elapsed time: 3000.383 msecs
(nil nil nil)
user



I think that is what you're running into.


Kyle

On Sat, Jun 6, 2009 at 5:02 PM, artg artgittle...@gmail.com wrote:

 user= (time (map answer '(50 50)))
 Elapsed time: 0.032826 msecs
 (392330 392711)
 user= (time (answer 50))
 Elapsed time: 6357.131423 msecs
 392849

 When I try to time 'map' it seems to return right away.  How do I time
 the full two executions of 'answer'?

 




-- 
--
kyle.bur...@gmail.comhttp://asymmetrical-view.com/
--

--~--~-~--~~~---~--~~
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: New and stuck ??

2009-06-07 Thread Kyle R. Burton

I think your ls showed it, the jar name is clojure-1.0.0.jar, so the
java -cp argument should point to that instead:

  java -cp clojure-1.0.0.jar clojure.lang.Repl


Kyle

On Sat, Jun 6, 2009 at 6:17 PM, darrell dgalli...@gmail.com wrote:

 Any ideas ?
 Mac OS-X

 ~/Downloads/clojure_1.0.0$ java -cp clojure.jar clojure.lang.Repl
 Exception in thread main java.lang.NoClassDefFoundError: clojure/
 lang/Repl

 ~/Downloads/clojure_1.0.0$ java -cp clojure.jar /clojure.main
 Exception in thread main java.lang.NoClassDefFoundError: /clojure/
 main

 ~/Downloads/clojure_1.0.0$ ls
 build.xml         epl-v10.html      pom.xml           src
 clojure-1.0.0.jar pom-template.xml  readme.txt        svninfo.txt

 ~/Downloads/clojure_1.0.0$ java -version
 java version 1.5.0_16
 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-
 b06-284)
 Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

 -= Darrell

 




-- 
--
kyle.bur...@gmail.comhttp://asymmetrical-view.com/
--

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



Clojure Talk @ Philly Java Users Gropu Tonight

2009-06-03 Thread Kyle R. Burton

I realize this is late notice (didn't think of it till now), there is
a Clojure talk tonight at the Philadelphia Java Users Group - to
attend you'll need to RSVP (see: http://phillyjug.jsync.com/ to sign
up).

The announcement is below.

Regards,

Kyle

Agenda:
6:30 – 7:00  Grab a good seat, some pizza, soft drinks, enjoy life
7:00 – 7:15  Announcements, raffles and giveaways, stretching exercises
7:15 - ??  Scott Fraser on Clojure

Speaker Bio:
Scott Fraser – co-founder, CTO of Portico Systems

Scott has worked professionally in the information technology sector
for more than twenty one years. One of the three original founders of
Portico Systems, he continues to have hands-on involvement with the
company’s Java-based platform. Previously he worked as an independent
consultant specializing in UNIX/Windows C/C++ programming, and
networking.

Scott started working with Java in 1996, and looks forward to 10 more
years with the language that single-handedly saved him from memory
leaks, Win16/32 API’s, and General Protection Faults.

He has a BS in Environmental Biology from Eastern University in St.
David’s PA, and is an avid birder.

Abstract:
Scott has always known about the coming Robot Apocalypse. But only
recently was he convinced, by a Functional Programming evangelist,
that the deconstruction of the Imperative and Object Oriented
programming paradigms that had dominated Scott's career for over 22
years might be imminent. Always paranoid about staying relevant, sure
that the JVM was here to stay, and with many years of highly
multithreaded high performance Java applications behind him, he sought
a functional language that would work for him... and was led to
Clojure.

Clojure is an exciting lisp dialect with baked in concurrency support.
It's creator, Rich Hickey, was inspired by Haskell and ML, and hopes
the language will play as a dynamic language like Python, Ruby and
Groovy, that is as accessible as those languages, but also as
performant as Java and as useful in any context as you would Java. It
sounded perfect. But could it subdue the robots?

Join Scott to learn about Clojure, and what it's creator calls it's Four Legs:

* functional programming
* lisp
* being hosted on the JVM
* direct support for concurrency

And finally, see Real World Examples (tm) of using Clojure to control
robots, for purposes of self defense, amusement of conference
attendees, and otherwise.

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



Clojure Talk @ Philly ETE

2009-03-25 Thread Kyle R. Burton

Clojure and The Robot Apocalypse

Also, I posed those to hackernews in the hope of increasing advocacy
for both that event (which it turns out I can't make) and for Clojure.

The main site is: http://www.phillyemergingtech.com/

The hackernews posts are:

http://news.ycombinator.com/item?id=531855
http://news.ycombinator.com/item?id=531853


Promoting Clojure in Philly,

Kyle

-- 
--
kyle.bur...@gmail.comhttp://asymmetrical-view.com/
--

--~--~-~--~~~---~--~~
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
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: Parallel Game of Life

2009-03-16 Thread Kyle R. Burton
On Mon, Mar 16, 2009 at 12:31 AM, Scott Fraser scott.e.fra...@gmail.com wrote:

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

Scott,

Your changes indeed make it run significantly faster for me.  Thanks!

I added a 'reset' button and changed some of the java method calls to
be a bit more (I think) idomatic clojure.

The full file is here:
http://asymmetrical-view.com/personal/code/clojure/life.clj

And a patch is attached (you also left off the import statements in you email).

FYI: Scott Fraser is giving a talk on clojure at the Philly Emerging
Technologies for the Enterprise conference next week:

  http://phillyemergingtech.com/abstractsTab.php?sessID=39
  http://phillyemergingtech.com/speakers.php


Regards,

Kyle Burton


-- 
--
kyle.bur...@gmail.comhttp://asymmetrical-view.com/
--

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



life.patch
Description: Binary data


Re: Clojure Box

2009-03-16 Thread Kyle R. Burton

Shawn,


Clojure Box works well, I'd like to make a feature request: can you
add paredit [1]?   Including it in the distribution (perhaps with it
disabled) would be great.


Thanks for putting it together.


Kyle


[1] http://www.emacswiki.org/cgi-bin/wiki/ParEdit



-- 
--
kyle.bur...@gmail.comhttp://asymmetrical-view.com/
--

--~--~-~--~~~---~--~~
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
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: My Clojure Emacs Setup (I'll show mine if you show yours)

2008-12-08 Thread Kyle R. Burton

I was wondering, since Emacs knows the file name (or at least the
buffer name) and line number it's sending a form from, and Clojure
represents that as meta-data (I think), could C-x C-e send that along
somehow wrapped in a form that sets these particular values for the
form that was shipped over?  Some kind of equivalent to #line and
#file (form C/C++/Perl)?

Is that possible?

Kyle

On Sun, Dec 7, 2008 at 12:07 AM, Bill Clementson [EMAIL PROTECTED] wrote:

 On Fri, Dec 5, 2008 at 5:23 PM, Mon Key [EMAIL PROTECTED] wrote:

 Nice blog entry :)

 Thanks! :)

 My setup tends to mirror yours esp. as I've culled most of it from
 your blog over the years...
 Most of my startup scripts are modified versions of those you've
 shared elsewhere.

 Glad you've found my posts useful.

 - Bill

 




-- 
--
[EMAIL PROTECTED]http://asymmetrical-view.com/
--

--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: java built in HTTP server, proxy and HttpHandler interface

2008-12-08 Thread Kyle R. Burton

On Mon, Dec 8, 2008 at 5:18 PM, prhlava [EMAIL PROTECTED] wrote:


 Well, it turns out that the following works, but it only prints the
 exchange to stdout,
 if the code is cut and pasted to the REPL but _not_ if run as .clj
 script)...

I have gotten your example to work with a bit of reading and
modification (and thank you, I was after an example http server, this
got me going):

(import
 '(java.io IOException OutputStream)
 '(java.util Iterator List Set)
 '(com.sun.net.httpserver Headers HttpExchange HttpHandler)
 '(java.net InetSocketAddress)
 '(java.util.concurrent Executors)
 '(com.sun.net.httpserver HttpServer))

(defn handle-http-exchange [#^HttpExchange exchange]
  (try
   (do
 (let [hdrs (.getResponseHeaders exchange)]
   (.add hdrs Content-type:  text/plain))
 (.sendResponseHeaders exchange 200 0)
 (let [out (java.io.PrintStream. (.getResponseBody exchange))]
   (.println out (str Time time is:  (java.util.Date.)))
   (.close out)))
   (catch Throwable ex
 (println (str Error:  ex)

(defn start-server [port]
  (let [server (. HttpServer create (new InetSocketAddress port) 0)
handler (proxy [HttpHandler] []
  (handle [#^HttpExchange exchange]
  (handle-http-exchange exchange)))]
(. server createContext / handler)
(. server setExecutor (. Executors newCachedThreadPool))
(. server start)
(print server listening on port: )
(println port)
server))

(def server (start-server 8080))

;; (.stop server 0)


Regards,

Kyle R. Burton

--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: java built in HTTP server, proxy and HttpHandler interface

2008-12-08 Thread Kyle R. Burton

 I have gotten your example to work with a bit of reading and
 modification (and thank you, I was after an example http server, this
 got me going):


A bit more hacking and it's possible to add/replace handlers after the
server has been started:

(import
 '(java.io IOException OutputStream)
 '(java.util Iterator List Set)
 '(com.sun.net.httpserver Headers HttpExchange HttpHandler)
 '(java.net InetSocketAddress)
 '(java.util.concurrent Executors)
 '(com.sun.net.httpserver HttpServer))

(defmacro with-response-print-stream [http-exchange var resp-code
content-type  body]
  (let [ex-var (gensym)
hdrs-var (gensym)]
`(try
  (do
(let [~hdrs-var (.getResponseHeaders ~http-exchange)]
  (.add ~hdrs-var Content-type:  ~content-type))
(.sendResponseHeaders ~http-exchange ~resp-code 0)
(let [~var (java.io.PrintStream. (.getResponseBody
~http-exchange))]
  [EMAIL PROTECTED]
  (.close ~var)))
  (catch Throwable ~ex-var
(println (str Error:  ~ex-var))

(defn start-server [port]
  (let [server (. HttpServer create (new InetSocketAddress port) 0)]
(.setExecutor server (. Executors newCachedThreadPool))
(.start server)
server))

(defn server-add-handler [#^HttpServer server context handler-fn]
  (let [handler (proxy [HttpHandler] []
  (handle [#^HttpExchange exchange]
  (handler-fn exchange)))]
(try
 (.removeContext server context)
 (catch Throwable ex
 :was-not-present))
(.createContext server context handler))
  nil)

(def server (start-server 8080))

(server-add-handler
 server
 /
 (fn [#^HttpExchange exchange]
   (with-response-print-stream exchange out 200 text/html
 (.println out (str bbold/b and iitalic/i))
 (.println out (str You should try: a
href=\/stuff/something/to/find?a=b\this/a, or a
href=\/time\that/a )

(server-add-handler
 server
 /stuff
 (fn [#^HttpExchange exchange]
   (with-response-print-stream exchange out 200 text/plain
 (.println out (str You are in the /stuff context, asking for: 
(.getRequestURI exchange))

(server-add-handler
 server
 /time
 (fn [#^HttpExchange exchange]
   (with-response-print-stream exchange out 200 text/plain
 (.println out (str The time (at now) is: 
(java.util.Date.))

;; (.stop server 0)


I'm new to clojure so I'm sure this isn't good form, but it it useful
to me already.



Kyle

--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: pattern matching in function parameters

2008-11-19 Thread Kyle R. Burton

I have no idea how much effort it would be, but I've found the common
lisp pcond library to be useful for pattern matching and a few other
use cases:

  http://www.cliki.net/pcond

I'd also like to see support for value based as well as structural
shape based pattern matching.


Regards,

Kyle

On Wed, Nov 19, 2008 at 4:16 PM, Mark Volkmann
[EMAIL PROTECTED] wrote:

 I'm reading an excellent article on functional programming at
 http://www.defmacro.org/ramblings/fp.html. Toward the end there is a
 section on pattern matching. They give the following example which
 uses a fictional, Java-like syntax. Can Clojure do something like this
 where the fib function is overloaded using patterns instead of
 arity?

 int fib(0) { return 1; }

 int fib(1) { return 1; }

 int fib(int n) {
return fib(n - 2) + fib(n - 1);
 }

 --
 R. Mark Volkmann
 Object Computing, Inc.

 




-- 
--
Wisdom and Compassion are inseparable.
-- Christmas Humphreys
[EMAIL PROTECTED]http://asymmetrical-view.com/
--

--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Clojure, Emacs and Slime on Windows

2008-11-11 Thread Kyle R. Burton

I've followed the straightforward instructions that BC put together:

  http://bc.tech.coop/blog/081023.html

It worked flawlessly under Linux.  I have lispbox installed on a
windows machine and have been trying to get it to work on that
platform as well.  Emacs + slime + clisp does work.

I created a clojure.bat

--
@set CLOJURE_JAR=c:\Documents and
Settings\kburton\personal\projects\clojure-svn\clojure\trunk\clojure.jar
@set CONTRIB_JAR=c:\Documents and
Settings\kburton\personal\projects\clojure-svn\clojure-contrib\trunk\clojure-contrib.jar
@set CLASSPATH=%CLOJURE_JAR%;%CONTRIB_JAR%;.
@java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=
-server -cp %CLASSPATH% clojure.lang.Repl %*
--

and put it into C:\WINDOWS so it was on the PATH.  I then updated my
dot emacs file:

--
(add-to-list 'load-path C:\\Documents and
Settings\\kburton\\personal\\projects\\clojure-svn\\clojure-mode)
(add-to-list 'load-path C:\\Documents and
Settings\\kburton\\personal\\projects\\clojure-svn\\swank-clojure)
(setq swank-clojure-binary C:\\WINDOWS\\clojure.bat)
; (file-exists-p C:\\WINDOWS\\clojure.bat)
; (setq swank-clojure-binary C:\\Documents and
Settings\\kburton\\bin\\clojure)

(require 'clojure-auto)
(require 'swank-clojure-autoload)
--

Running M-- M-slime clojure^M executes the batch file, so things are
close, but I get the following in the *inferior-lisp* buffer:

--
(clojure/add-classpath file:///c:/Documents and
Settings/kburton/personal/projects/clojure-svn/swank-clojure/)

(clojure/require (quote swank))

nil

(swank/start-server c:/DOCUME~1/kburton/LOCALS~1/Temp/slime.15196
:encoding iso-latin-1-unix)

Listening for transport dt_socket at address: 
Clojure
user= java.lang.Exception: No such namespace: clojure (NO_SOURCE_FILE:1)
user= java.lang.Exception: No such namespace: clojure (NO_SOURCE_FILE:3)
user= nil
user= java.lang.Exception: No such namespace: swank (NO_SOURCE_FILE:7)
user=
user= (resolve 'map)
#'clojure.core/map
user=
--

Resolve finds a standard name, but it finds it in clojure.core.  I'm
not sure what to try next, this implies to me that the Repl is active,
but somehow didn't get bootstrapped?

Any help, advice, questions or suggestions are appreciated.

Regards,

Kyle R. Burton

-- 
--
Wisdom and Compassion are inseparable.
-- Christmas Humphreys
[EMAIL PROTECTED]http://asymmetrical-view.com/
--

--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: string interpolation

2008-10-29 Thread Kyle R. Burton

 Thanks for the macro. =)
 The str function is really a good replacement for interpolation.

Yes, thank you for the macro.  I anticipate using this approach (I'm
accustomed to it from Ruby, Perl and JScheme), but wanted to support a
way of stopping the parser (by backslashing the opening brace:
$\\{x} ).  I think adding the zero-width assertion in the re-matcher
and the replaceAll to knock the backslash out gets me there:

(defn tokenize [s]
 (let [positions (let [mm (re-matcher #\\$(?!)\\{.*?\\} s)]
   (loop [acc []]
 (if (.find mm)
   (recur (conj acc [(.start mm) (.end mm)]))
   acc)))
   intermed (conj (apply vector 0 (apply concat positions))
  (.length s))
   textposns (partition 2 intermed)]
   (my-interleave (map (fn [[a b]] [:text (. (.substring s a b)
 (replaceAll \\$\\{ \\${))])
   textposns)
  (map (fn [[a b]] [:pat (.substring s (+ a 2) (- b 1))])
   positions

Regards,

Kyle Burton


 On Oct 28, 8:29 pm, Graham Fawcett [EMAIL PROTECTED] wrote:
 On Tue, Oct 28, 2008 at 7:27 PM, Graham Fawcett

 [EMAIL PROTECTED] wrote:
  But for fun, here's an (i ...) macro, that will give you ${}
  interpolation in strings (if it works at all, I test it very
  thorougly!).

 Haha, nor did I spell- or grammar-check very thoroughly!

 I meant: I didn't test the code very thoroughly, so I hope it works at all.

 Graham
 


--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---