Re: Java Metadata Wrapper

2013-09-01 Thread Colin Jones
I thought of protocols initially here too, but protocols just define functions, 
so where would the data live that you want as metadata? 

A closure over the data? This implies extending the protocol on a per-instance 
basis, which afaik doesn't exist (cljs design work aside 
http://dev.clojure.org/display/design/specify+i.e.+reify+for+instances).

Some global map? We can't key on arbitrary java objects since the hashcode can 
change. Is there a key that will work?

A var? We can already do that.

Maybe there's someplace I'm missing where you could store this data and look it 
up later via a protocol implementation?

-- 
-- 
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: Java Metadata Wrapper

2013-09-01 Thread Mark
I think the general solution would be a weak identity map.  

On Sunday, September 1, 2013 6:58:25 AM UTC-7, Colin Jones wrote:
>
> I thought of protocols initially here too, but protocols just define 
> functions, so where would the data live that you want as metadata? 
>
> A closure over the data? This implies extending the protocol on a 
> per-instance basis, which afaik doesn't exist (cljs design work aside 
> http://dev.clojure.org/display/design/specify+i.e.+reify+for+instances).
>
> Some global map? We can't key on arbitrary java objects since the hashcode 
> can change. Is there a key that will work?
>
> A var? We can already do that.
>
> Maybe there's someplace I'm missing where you could store this data and 
> look it up later via a protocol implementation?
>
>

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


Incanter 1.5.4 has been released

2013-09-01 Thread Alex Ott
Hi all

The new bugfix release of Incanter was released as version 1.5.4.
See changelog (https://github.com/liebke/incanter/blob/master/Changes.md)
for details.

Thank you for all who submitted pull requests & issues!

-- 
With best wishes,Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)
Skype: alex.ott

-- 
-- 
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: [ANN] Pedestal 0.2.0 has been released

2013-09-01 Thread Ryan Neufeld
We just pushed 0.2.1 to fix some issues with the app-template discovered by 
Gabe. See https://github.com/pedestal/pedestal/releases/tag/0.2.1 for more info.

-Ryan
On Aug 30, 2013, at 9:03 PM, Ryan Neufeld  wrote:

> Hey Folks,
> 
> We've just released 0.2.0 versions of the Pedestal libraries.
> 
> This is a big one, with revamped templates for both pedestal-app and 
> pedestal-service applications. The biggest change is that developer tooling 
> now lives in *-tools libraries, cleaning up generated projects and making it 
> easier for us to incrementally improve that tooling in the future. You'll 
> also find that pedestal-service now uses Cheshire for JSON reading/writing.
> 
> All this and more is documented in the 0.2.0 Release Notes. Kudos to everyone 
> that contributed to this release.
> 
> Happy Labor Day weekend Hacking!
> 
> - Ryan and the rest of the Pedestal team

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


Compiling Clojure security knowledge

2013-09-01 Thread Vincent Ambo
Hej everyone!

After a short but interesting discussion 
on 
#clojure I'd like to pose some security related questions to a larger 
audience.  
This is mostly about user-facing web applications.

First some short background: In the main web framework I use, Yesod, there 
is a clear and concise list  (scroll 
down to "Type-safe security") of security issues already handled by the 
stack. This includes SQL injections, escaping of user input against XSS, 
CSRF form attacks and such. These aspects are also often mentioned in 
related tutorials and discussed in the community.

Some googling about another well-known web framework, Rails, brought up this 
page  with lots of info about 
securing Rails applications.

Now the main question: Where is this info for Clojure's web stack and, 
assuming there is no collection of info, what do *you* specifically know 
about security in Clojure?

I'm looking to collect information on such matters as

* How and where do we prevent SQL injections? In a stack of Hiccup < 
Compojure < Ring < Korma < JDBC < Postgres-driver - which (if any) of these 
components ensures safety against injections? Is there documentation?

* How and where do we prevent XSS attacks? Do we have templating engines 
that escape things unless told otherwise, or - if not - do these features 
exist in the form of a helper function? If yes, where? (And so on...)

* *Where are these things being discussed* in the Clojure community? 
Googling things like "Clojure web security" brings up almost nothing.

Ideally everybody who knows answers to these points or to points not 
mentioned by me (go for example through the two sites I linked!) should 
post what they know with the ultimate goal to create something like the 
Rails site about our web stack in general, so that future generations don't 
have to go through the same information hunt.  

I'm willing to structure the info and write it together if we can collect 
it, so *go*!

(Note that I have also posted this on 
Reddit
)

-- 
-- 
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: Compiling Clojure security knowledge

2013-09-01 Thread Bruce Durling
Vincent,

On Sun, Sep 1, 2013 at 8:06 PM, Vincent Ambo  wrote:

> * *Where are these things being discussed* in the Clojure community?
> Googling things like "Clojure web security" brings up almost nothing.
>

Some discussions on this have started on the clojure-sec google group here:

https://groups.google.com/forum/#!forum/clojure-sec

Started by Chas Emerick after making Friend

https://github.com/cemerick/friend

Though I think we'd all be happy to have more thinking in this area.

cheers,
Bruce



-- 
@otfrom | CTO & co-founder @MastodonC | mastodonc.com
See recent coverage of us in the Economist http://econ.st/WeTd2i and the
Financial Times http://on.ft.com/T154BA

-- 
-- 
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: Java Metadata Wrapper

2013-09-01 Thread Mikera
I was actually thinking of the case where the metadata was computed in some 
way from the Java object (i.e. when it is more like read-only property). In 
most of the cases where I have wanted metadata on arbitrary Java objects, 
this would have been sufficient.

You probably want to go the wrapper route if you want first-class metadata 
behaviour (with-meta et al.) - in effect you would be creating a new kind 
of object with a new kind of "state" so it's better to wrap (and maybe 
simultaneously add a nice wrapper API with idiomatic Clojure style) than to 
try and pretend that the Java Object is something that it isn't. 

The alternatives of a global metadata map or some kind of memoization look 
really messy to implement - they wouldn't play nicely with the varying 
immutable vs. mutable update semantics that you might see on arbitrary Java 
objects, they often cause subtle concurrency issues and global state is 
usually a bad idea anyway. It might just work if you limit yourself to 
one-off assignment of metadata to object instances, but even that is 
problematic (cloning the Java object wouldn't preserve metadata, for 
example)

On Sunday, 1 September 2013 21:58:25 UTC+8, Colin Jones wrote:
>
> I thought of protocols initially here too, but protocols just define 
> functions, so where would the data live that you want as metadata? 
>
> A closure over the data? This implies extending the protocol on a 
> per-instance basis, which afaik doesn't exist (cljs design work aside 
> http://dev.clojure.org/display/design/specify+i.e.+reify+for+instances).
>
> Some global map? We can't key on arbitrary java objects since the hashcode 
> can change. Is there a key that will work?
>
> A var? We can already do that.
>
> Maybe there's someplace I'm missing where you could store this data and 
> look it up later via a protocol implementation?
>
>

-- 
-- 
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: Clojure On Java Friendly Microcontrollers, Beaglebone, etc

2013-09-01 Thread Jeremy Wright
Here are some updates on my own research.

   1. This 
postis a 
little over a year old, but has the type of information on the 
   BeagleBone I'm looking for. It covers doing some simple I/O using Clojure. 
   The author states that he's unsure what he's doing on the hardware side of 
   things, but it's a start.
   2. This post says 
it's easy to get Clojure working on the Beagleboard, but is a couple 
   of years old and doesn't give too much detail. I do like that the author 
   does some benchmarking that could be adapted to the BeagleBone Black though.
   3. This 
postis
 about a year old, and gives a benchmark comparison of OpenJDK vs 
   Oracle's Embedded JRE on a BeagleBone.
   4. Videos of Kevin Downey (less than a year old) showing a robot using 
   Clojure on a BeagleBone. He gives some insight into how to make using the 
   Bone's I/O system in Clojure a little easier.
   1. Video 1 of 3 
  2. Video 2 of 3 
  3. Video 3 of 3 
   5. Kevin Downey's Beaglebone robot code on 
Github
   .
   6. Kevin Downey mentioned 
clojure-jna which 
   should make working with native code (to do I/O) on the Bone a little 
   easier. The clojure-jna code on GitHub is about 4 years old though, and I 
   may have read something about a newer replacement on this mailing list. I 
   can't remember for sure though.

That's what I've found so far. The information has some age on it and is 
focused on the older BeagleBone and Beagleboard. It's good information to 
get started with though I think.

On Saturday, August 31, 2013 11:13:59 PM UTC-4, Jeremy Wright wrote:
>
> I recently watched Carin Meier's OSCON talk The Joy of Flying Robots with 
> Clojure  and it made me 
> wonder about Clojure on embedded systems. A quick search on this list 
> didn't turn up much so I thought I'd ask. How much work has been done with 
> Clojure on either Java friendly microcontroller systems (i.e. 
> Systronix), 
> or on something like a Beaglebone or Beagleboard? I'm very new to Clojure, 
> so I don't yet understand the challenges that Clojure would face trying to 
> run on a system that may not support all the JVM's features.
>
> Any thoughts on this? Any links you can give me on what's been/being done?
>
> Thanks.
>

-- 
-- 
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: Compiling Clojure security knowledge

2013-09-01 Thread Ivan Kozik
On Sun, Sep 1, 2013 at 7:06 PM, Vincent Ambo  wrote:
> * How and where do we prevent XSS attacks? Do we have templating engines
> that escape things unless told otherwise, or - if not - do these features
> exist in the form of a helper function? If yes, where? (And so on...)

clojars uses 
https://github.com/ato/clojars-web/blob/master/src/clojars/web/safe_hiccup.clj
which automatically escapes.

Ivan

-- 
-- 
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: Clojure On Java Friendly Microcontrollers, Beaglebone, etc

2013-09-01 Thread Nurullah Akkaya
I have not played with Java friendly micros but Clojure works on the
beagle/pi. As for building robots using clojure,

 - Our software for our Robocup team is all Clojure except couple
   hundred lines of C for the firmware running on the AVRs. All heavy
   lifting is done on the PC, AVRs only deal with interfacing with the
   motor controllers, kicking circuit etc. [5] is our old code from
   2012.

 - I was working on a blob tracking nerf gun which I never
   finished. That was using beagleboard for vision and an Arduino for
   controlling the servos. I never finished it and I did port it to
   gambit scheme for some reason I don't remember.

   It used, vision[1] to find/track blobs and cloudino[2] to talk to
   Arduino which controlled the servos of the gun.

   When using beagle/pi you are going to need a seperate
   microcontroller to deal with real time stuff, PWM generation etc.

Another option I am playing with right now is actually putting an
android phone on the robot.

 - I did port a simple autopilot (following a set of waypoints using,
   GPS from the phone and IMU from the AR Drone) to android using lein
   droid [3]. Taped the phone on top of an Ar Drone. It barely worked
   in the lab with mock GPS when there was no wind but the phone is
   too heavy for AR Drone but this scheme would work with a more power
   full quad.

 - I am applying the same idea to a boat now. Android phone on the
   boat, a webapp (http-kit/compojure/hiccup) for getting telemetry
   and setting way points over 3G, usb-serial-for-android[4] for
   talking to arduino which handles interfacing with the motor
   controllers, phone GPS/IMU for navigation.

 [1] https://github.com/nakkaya/vision
 [2] https://github.com/nakkaya/clodiuno
 [3] https://github.com/clojure-android/lein-droid
 [4] http://code.google.com/p/usb-serial-for-android/
 [5] http://dropbox.nakkaya.com/neu-islanders.pdf

Best,

On Mon, Sep 2, 2013 at 6:21 AM, Jeremy Wright  wrote:
> Here are some updates on my own research.
>
> This post is a little over a year old, but has the type of information on
> the BeagleBone I'm looking for. It covers doing some simple I/O using
> Clojure. The author states that he's unsure what he's doing on the hardware
> side of things, but it's a start.
> This post says it's easy to get Clojure working on the Beagleboard, but is a
> couple of years old and doesn't give too much detail. I do like that the
> author does some benchmarking that could be adapted to the BeagleBone Black
> though.
> This post is about a year old, and gives a benchmark comparison of OpenJDK
> vs Oracle's Embedded JRE on a BeagleBone.
> Videos of Kevin Downey (less than a year old) showing a robot using Clojure
> on a BeagleBone. He gives some insight into how to make using the Bone's I/O
> system in Clojure a little easier.
>
> Video 1 of 3
> Video 2 of 3
> Video 3 of 3
>
> Kevin Downey's Beaglebone robot code on Github.
> Kevin Downey mentioned clojure-jna which should make working with native
> code (to do I/O) on the Bone a little easier. The clojure-jna code on GitHub
> is about 4 years old though, and I may have read something about a newer
> replacement on this mailing list. I can't remember for sure though.
>
> That's what I've found so far. The information has some age on it and is
> focused on the older BeagleBone and Beagleboard. It's good information to
> get started with though I think.
>
> On Saturday, August 31, 2013 11:13:59 PM UTC-4, Jeremy Wright wrote:
>>
>> I recently watched Carin Meier's OSCON talk The Joy of Flying Robots with
>> Clojure and it made me wonder about Clojure on embedded systems. A quick
>> search on this list didn't turn up much so I thought I'd ask. How much work
>> has been done with Clojure on either Java friendly microcontroller systems
>> (i.e. Systronix), or on something like a Beaglebone or Beagleboard? I'm very
>> new to Clojure, so I don't yet understand the challenges that Clojure would
>> face trying to run on a system that may not support all the JVM's features.
>>
>> Any thoughts on this? Any links you can give me on what's been/being done?
>>
>> Thanks.
>
> --
> --
> 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.



-- 
Nurullah Akkaya
http://nakkaya.com

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clo