Re: New AWS services supported by Cognitect Labs' aws-api.

2019-12-04 Thread Michael Glaesemann



> On 2019–12–04, at 16:41, David Chelimsky  wrote:
> 
> Over the past couple of days, AWS has announced a number of new services at 
> AWS re:Invent, and released support for these services in their SDKs. As of 
> today, Cognitect Labs' aws-api supports the new services listed below. See 
> https://github.com/cognitect-labs/aws-api/blob/master/latest-releases.edn for 
> a full listing of all of the services aws-api supports.
> 
> Enjoy!

You rock, David!

Michael Glaesemann
grzm seespotcode net



-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/A4027188-98E5-4C1D-8ABC-DCFF1C5A7DD5%40seespotcode.net.


Re: [ANN] Clojure 1.10 has been released!

2018-12-17 Thread Michael Glaesemann



> On 2018–12–17, at 17:12, Sean Corfield  wrote:
> 
> I'm not touching it until Sean Corfield has it running in production ;)
>  
> We have a mix of RC3 and RC4 in production right now. Clojure 1.10 “gold” is 
> already on QA so it’ll go to production in the next few days 😊
>  
> And, yeah, this was the first release of Clojure itself that I got a patch 
> into… and it was just a backport of a patch from the ASM Java code, so it 
> wasn’t really even my contribution!

Thanks, Sean :)

Michael Glaesemann
grzm seespotcode net



-- 
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: [ANN] com.cognitect.aws/api-0.8.155

2018-12-12 Thread Michael Glaesemann



> On 2018–12–12, at 19:07, David Chelimsky  wrote:
> 
> com.cognitect.aws/api-0.8.155 is now available.

Rock on!

Michael Glaesemann
grzm seespotcode net



-- 
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: [ANN] Programming Clojure, 3rd edition

2018-02-21 Thread Michael Glaesemann
Congrats!

> On 2018-02-21, at 10:04, Alex Miller  wrote:
> 
> The 3rd edition of Programming Clojure is now available on Pragmatic:
> 
> https://pragprog.com/book/shcloj3/programming-clojure-third-edition
> 
> The 1st edition was the first Clojure book available and was written by 
> Stuart Halloway around Clojure 1.0. The second edition was an update by Aaron 
> Bedra around Clojure 1.3 timeframe. 
> 
> This 3rd edition is an update by me bringing everything up to date with 
> Clojure 1.9. There is a new chapter on spec, a new section on transducers (as 
> a more intermediate topic, this is really just an intro - Clojure Applied has 
> more detail), a bit on clj (what I could do based on timing), and many small 
> updates throughout.
> 
> Alex
> 
> -- 
> 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.

Michael Glaesemann
grzm seespotcode net



-- 
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: [ANN] Clojure 1.9.0-RC2

2017-11-27 Thread Michael Glaesemann

> On 2017-11-27, at 16:17, Alex Miller  wrote:
> 
> I should also mention that I've re-built the Clojure doc automation process 
> and the Clojure docs have refreshed for the first time in a long while.

Thanks, Alex!

Michael Glaesemann
grzm seespotcode net



-- 
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: Clojure/conj hotel reservations

2017-09-22 Thread Michael Glaesemann
I have a double room with an extra bed at the conference Hilton. If you're 
interested in sharing a room, please email me directly!

See you there!

> On 2017-09-18, at 08:55, Duncan McGreggor  wrote:
> 
> Hey all,
> 
> If anyone else is registering late for conj, the website is showing rooms as 
> sold out, but there are still a few available -- you have to call the hotel. 
> Let them now the discount is under "Cognitect, Inc." I as of a few minutes 
> ago there about 8 rooms still available ...
> 
> See you there!
> 
> d
> 
> -- 
> 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.

Michael Glaesemann
grzm seespotcode net



-- 
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: Stubbing with instrument and generators

2017-06-30 Thread Michael Glaesemann
Thanks for taking a look. Here's a ticket: 
https://dev.clojure.org/jira/browse/CLJ-2197

> On 2017-06-30, at 11:52, Alex Miller  wrote:
> 
> I don't think this is the same case as CLJ-2095 as the instrumented var 
> should have the opportunity to use the gen overrides you've included. In 
> particular, it seems like stest/instrument-choose-fn is currently passing the 
> :gen overrides map when getting the gen for the stubbed var. I'm wondering if 
> there is a bug there where the spec has already been resolved and thus the 
> gen key (::y) is not getting matched. Feel free to file a ticket for this.
> 
> On Friday, June 30, 2017 at 9:37:42 AM UTC-5, Michael Glaesemann wrote:
> Using spec instrument to stub functions is really helpful. I'm using stubbing 
> to test Stuart Sierra-style components with some success. However, I've been 
> surprised that generator override doesn't work as I would expect it to. 
> Here's an example: 
> 
> ;; [org.clojure/spec.alpha "0.1.123"] 
> 
> (require '[clojure.spec.alpha :as s]) 
> (require '[clojure.spec.gen.alpha :as gen]) 
> (require '[clojure.spec.test.alpha :as stest]) 
> 
> (defprotocol Y 
>   (-do-y [r])) 
> 
> (def y? (partial satisfies? Y)) 
> (s/def ::y y?) 
> 
> ;; Protocol methods can't be spec'd, so wrap it in a function. 
> 
> (defn do-y [r] 
>   (-do-y r)) 
> 
> (s/fdef do-y :args (s/cat :y-er ::y)) 
> 
> ;; Example of the protocol implementation that we're going to stub. 
> 
> (defrecord BadYer [] 
>   Y 
>   (-do-y [_] (throw (Exception. "can't make me!" 
> 
> 
> ;; Confirm BadYer instances are valid with respect to the protol spec. 
> 
> (s/valid? ::y (->BadYer)) 
> ;; => true 
> 
> ;; And confirm BadYer instances will throw when called. 
> 
> (try 
>   (do-y (->BadYer)) 
>   (catch Exception e 
> (.getMessage e))) 
> ;; => "can't make me!" 
> 
> 
> (def y-gen (gen/return (->BadYer))) 
> 
> ;; Confirm generator works as expected: 
> 
> (gen/sample y-gen 1) 
> ;; => (#spec_ex.core.BadYer{}) 
> 
> ;; We want to stub `do-y`, providing y-gen as a generator for `::y` 
> 
> (try 
>   (stest/instrument `do-y {:stub #{`do-y} 
>:gen {::y (fn [] y-gen)}}) 
>   (catch Exception e 
> (ex-data e))) 
> ;; => #:clojure.spec.alpha{:path [:y-er], :form :spec-ex.core/y, :failure 
> :no-gen} 
> 
> ;; However, we *can* stub `do-y` if we replace its spec. 
> 
> (stest/instrument `do-y 
>   {:stub #{`do-y} 
>:spec {`do-y (s/fspec 
>   :args (s/cat :y-er (s/with-gen ::y 
>(fn [] y-gen}}) 
> ;; => [spec-ex.core/do-y] 
> 
> There is a ticket open[ (CLJ-2095[1]) regarding using overrides s/gen with 
> custom generators. Is this a case where this applies? I can imagine that it 
> could be. Not overriding something that isn't there would result in the thing 
> still not being there, thus the :no-gen failure. And it is something that can 
> be worked around.  It would be decidedly more succinct if the gen override 
> worked rather than the spec override. 
> 
> Best, 
> 
> Michael Glaesemann 
> grzm seespotcode net 
> 
> 
> [1]: https://dev.clojure.org/jira/browse/CLJ-2095 
> 
> 
> -- 
> 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.

Michael Glaesemann
grzm seespotcode net



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


Stubbing with instrument and generators

2017-06-30 Thread Michael Glaesemann
Using spec instrument to stub functions is really helpful. I'm using stubbing 
to test Stuart Sierra-style components with some success. However, I've been 
surprised that generator override doesn't work as I would expect it to. Here's 
an example:

;; [org.clojure/spec.alpha "0.1.123"]

(require '[clojure.spec.alpha :as s])
(require '[clojure.spec.gen.alpha :as gen])
(require '[clojure.spec.test.alpha :as stest])

(defprotocol Y
  (-do-y [r]))

(def y? (partial satisfies? Y))
(s/def ::y y?)

;; Protocol methods can't be spec'd, so wrap it in a function.

(defn do-y [r]
  (-do-y r))

(s/fdef do-y :args (s/cat :y-er ::y))

;; Example of the protocol implementation that we're going to stub.

(defrecord BadYer []
  Y
  (-do-y [_] (throw (Exception. "can't make me!"


;; Confirm BadYer instances are valid with respect to the protol spec.

(s/valid? ::y (->BadYer))
;; => true

;; And confirm BadYer instances will throw when called.

(try
  (do-y (->BadYer))
  (catch Exception e
(.getMessage e)))
;; => "can't make me!"


(def y-gen (gen/return (->BadYer)))

;; Confirm generator works as expected:

(gen/sample y-gen 1)
;; => (#spec_ex.core.BadYer{})

;; We want to stub `do-y`, providing y-gen as a generator for `::y`

(try
  (stest/instrument `do-y {:stub #{`do-y}
   :gen {::y (fn [] y-gen)}})
  (catch Exception e
(ex-data e)))
;; => #:clojure.spec.alpha{:path [:y-er], :form :spec-ex.core/y, :failure 
:no-gen}

;; However, we *can* stub `do-y` if we replace its spec.

(stest/instrument `do-y
  {:stub #{`do-y}
   :spec {`do-y (s/fspec
  :args (s/cat :y-er (s/with-gen ::y
   (fn [] y-gen}})
;; => [spec-ex.core/do-y]

There is a ticket open[ (CLJ-2095[1]) regarding using overrides s/gen with 
custom generators. Is this a case where this applies? I can imagine that it 
could be. Not overriding something that isn't there would result in the thing 
still not being there, thus the :no-gen failure. And it is something that can 
be worked around.  It would be decidedly more succinct if the gen override 
worked rather than the spec override.

Best,

Michael Glaesemann
grzm seespotcode net


[1]: https://dev.clojure.org/jira/browse/CLJ-2095

-- 
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: Native Clojure

2010-12-20 Thread Michael Glaesemann

On Dec 20, 2010, at 15:23, Konrad Hinsen wrote:

> On 20 Dec 2010, at 18:19, Ken Wesson wrote:
> 
>> Is it really necessary, though? Hotspot's JIT yields up
>> native-ballpark speeds when you really need them, if you optimize your
>> code appropriately.
> 
> For me, a native-code implementation of Clojure would be of interest for 
> interfacing with libraries written in C, C++, and Fortran. The same goal 
> could probably be achieved otherwise (compiling Java bytecode to native code, 
> or simply a JVM with a better native interface than JNI), but at the moment I 
> see no satisfying solution.

Have you looked at JNA? <https://jna.dev.java.net/>

Michael Glaesemann
grzm seespotcode net



-- 
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: Trouble understanding let

2010-10-09 Thread Michael Glaesemann

On Oct 10, 2010, at 0:01 , Andreas Kostler wrote:

> From "Programming Clojure", Chapter 2 - Bindings:
> "The bindings are then in effect for exprs, and the value of the let
> is the value of the last expression in exprs."
> To me this reads:
> user=> (let [k (+ 2 2)])
>  4
> 
> However, repl says:
> user=> (let [k (+ 2 2)])
>  nil
> 
> What is it I get wrong?

You have no expressions (after the brackets) in your let statement, only 
bindings (the stuff inside the brackets).

>From 
><http://clojure.org/special_forms#Special%20Forms--(let%20[bindings*%20]%20exprs*)>
(let [bindings* ] exprs*)

To get the result you want:

user> (let [k (+ 2 2)] k)
4

Michael Glaesemann
grzm seespotcode net



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


"splitting" sql results by attribute

2009-05-14 Thread Michael Glaesemann

Hello!

I'm new to clojure and new to lisp, so I'm still getting accustomed to  
working functionally and I'm trying to take advantage of clojure's  
sequences when appropriate.

I'm working on a project to display a variety of measurements and  
comparing values across various intervals. I'm pulling the measurement  
data from an SQL database and its most efficient to pull all of the  
attributes for a given interval at once. When I'm comparing the same  
measurements from different intervals, I need to split the attributes  
into individual series.

Here's an example of the results. The first vector is the data from  
today: the second is from yesterday.

(def stats ([{:timestamp 1.238226902583523E12,
:attr-1 221, :attr-2 1220553964, :attr-3 1899985 }
   {:timestamp 1.238227202350991E12,
:attr-1 221, :attr-2 1220553964, :attr-3 1899985 }
   {:timestamp 1.2382275025300952E12,
:attr-1 221, :attr-2 1220553964, :attr-3 1899985 }]
[{:timestamp 1.2382281021213591E12,
:attr-1 221, :attr-2 1220553964, :attr-3 1899985 }
  {:timestamp 1.238227202230129E12,
   :attr-1 220, :attr-2 1212431385, :attr-3 1899985 }
  {:sampled_at_js_timestamp 1.238227501935876E12,
   :attr-1 220, :attr-2 1212431385, :attr-3 1899985 }])

And here's the results transformed:

{"attr-1":{"today":[[1.238226902583523E12,221],
 [1.238227202350991E12,221],
 [1.2382275025300952E12,221]],
"yesterday":[[1.2382269016771082E12,220],
 [1.238227202230129E12,220],
 [1.238227501935876E12,220]]},
  "attr-2":{"today":[[1.238226902583523E12,1220553964],
 [1.238227202350991E12,1220553964],
 [1.2382275025300952E12,1220553964]],
"yesterday":[[1.2382269016771082E12,1220553964],
 [1.238227202230129E12,1212431385],
 [1.238227501935876E12,1212431385]]},
  "attr-3":{"today":[[1.238226902583523E12,1899985],
 [1.238227202350991E12,1899985],
 [1.2382275025300952E12,1899985]],
"yesterday":[[1.2382269016771082E12,1899985],
 [1.238227202230129E12,1899985],
 [1.238227501935876E12,1899985]]}}

Here's what I'm currently using:

(let [get-2ple (fn [row col-name] (vector (row :timestamp) (row col- 
name)))
   map-stats (fn [col-name stats] (map #(get-2ple % col-name)  
stats))
   collect-stats (fn [col-name stats]
   (hash-map "today" (map-stats col-name (first  
stats))
 "yesterday" (map-stats col-name  
(first (next stats)
   chart-data (hash-map "attr-1" (collect-stats :attr-1 stats)
"attr-2" (collect-stats :attr-2 stats)
"attr-3" (collect-stats :attr-3 stats))]
   chart-data)

However, this requires multiple passes over the result data. I should  
think it'd be possible to do it in one, but I can't seem to wrap my  
head around it.

Any pointers would be much appreciated.

Cheers!

Michael Glaesemann
grzm seespotcode net


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