Re: what is the best forum for keeping up with Clojure?

2024-01-10 Thread Laws
Thank you much.

On Wednesday, January 10, 2024 at 1:26:16 AM UTC-5 Sean Corfield wrote:

> The Clojurians Slack is probably the largest and most activity community 
> these days – http://clojurians.net to self-signup and 
> https://clojurians.slack.com for the content – but there's also 
> https://clojureverse.org if you prefer a "forum" over "chat". And there's 
> r/Clojure on Reddit – which also has a handy list of active Clojure 
> communities online in the right hand column.
>
> Also check out this list of resources on the official website: Clojure - 
> Community Resources <https://clojure.org/community/resources>
>
> Sean A Corfield -- (510) 862-3370
> An Architect's View -- https://corfield.org/
> World Singles Networks, LLC. -- https://worldsinglesnetworks.com/ 
>
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
>
> --
> *From:* clo...@googlegroups.com  on behalf of 
> Laws 
> *Sent:* Tuesday, January 9, 2024 2:46 PM
> *To:* Clojure 
> *Subject:* what is the best forum for keeping up with Clojure? 
>  
> Hi everyone, 
>
> I did a lot with Clojure back 2012-2019, but I've been away from it for 
> several years. Now I'm beginning a big new project in Clojure. I'm curious, 
> where would I go to learn about the newest libraries and projects? There 
> was a time 5 years ago when I knew all of the best and most interesting 
> projects, but nowadays I know very little about the scene. is there any 
> forum where people talk about Clojure and all that is new? 
>
>
> Lawrence Krubner
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with 
> your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+u...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/clojure/04ea0a28-e263-4af9-93f9-a50295fc1bd0n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/clojure/04ea0a28-e263-4af9-93f9-a50295fc1bd0n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/d935fc6e-3c75-4ef1-ba28-cb0a031fa45en%40googlegroups.com.


what is the best forum for keeping up with Clojure?

2024-01-09 Thread Laws
Hi everyone,

I did a lot with Clojure back 2012-2019, but I've been away from it for 
several years. Now I'm beginning a big new project in Clojure. I'm curious, 
where would I go to learn about the newest libraries and projects? There 
was a time 5 years ago when I knew all of the best and most interesting 
projects, but nowadays I know very little about the scene. is there any 
forum where people talk about Clojure and all that is new? 


Lawrence Krubner

-- 
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/04ea0a28-e263-4af9-93f9-a50295fc1bd0n%40googlegroups.com.


Re: how do I debug a cryptic XML error?

2022-02-15 Thread Laws
Okay, this seemed to fix the problem:


cpe-dictionary (-> "official-cpe-dictionary_v2.3.xml"
   (java.io.FileInputStream.)
   (xml/parse))


xmlzipper (clojure.zip/xml-zip cpe-dictionary)

xmlnode (-> xmlzipper
zip/down
zip/right
zip/node)




On Tuesday, February 15, 2022 at 10:44:13 PM UTC-5 Laws wrote:

>
> I changed the code a bit:
>
> cpe-dictionary (-> "official-cpe-dictionary_v2.3.xml"
>(java.io.StringReader.)
>(xml/parse))
>
> xmlzipper (clojure.zip/xml-zip cpe-dictionary)
>
> Now I get this:
>
>   clojure.data.xml/*parse*   
> xml.clj:  84
>
>   clojure.data.xml/*parse*   
> xml.clj: 109
>
> clojure.data.xml.tree/*event-tree*
>   tree.clj:  70
>
>  clojure.core/*ffirst*
>   core.clj: 105
>
>   clojure.core/*first*
>   core.clj:  55
>
>  ...  
>  
>
>clojure.data.xml.tree/seq-tree/*fn*
>   tree.clj:  39
>
> clojure.core/*seq*
>   core.clj: 139
>
>  ...  
>  
>
>   clojure.data.xml.jvm.parse/pull-seq/*fn*   
>   parse.clj:  78
>
> com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next  
> XMLStreamReaderImpl.java: 652
>
> *javax.xml.stream.XMLStreamException*: *ParseError at [row,col]:[1,1]*
>
> * Message: Content is not allowed in 
> prolog.*
>
> *location*: 
> #object[com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl$1 
> 0x296bfddb "Line number = 1\nColumn number = 1\nSystem Id = null\nPublic Id 
> = null\nLocation Uri= null\nCharacterOffset = 0\n"]
>
>
>
>
> On Tuesday, February 15, 2022 at 7:50:12 PM UTC-5 Laws wrote:
>
>> So, I went to the government NVD website:
>>
>> https://nvd.nist.gov/products/cpe
>>
>> I downloaded the CPE Dictionary and unpacked it. It looks like standard 
>> XML. 
>>
>> I copy and paste the standard XML example given on the Clojure XML 
>> documentation page:
>>
>>  cpe-dictionary (-> "official-cpe-dictionary_v2.3.xml" io/resource 
>> io/file clj-xml/parse zip/xml-zip)
>>
>> I get:
>>
>> clojure.xml/*startparse-sax*xml.clj:  76
>> ...   
>>
>>jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke  
>> DelegatingMethodAccessorImpl.java:  43
>>
>>jdk.internal.reflect.NativeMethodAccessorImpl.invoke  
>> NativeMethodAccessorImpl.java:  77
>>
>>   jdk.internal.reflect.NativeMethodAccessorImpl.invoke0   
>> NativeMethodAccessorImpl.java
>>
>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse   
>>   SAXParserImpl.java: 317
>>
>> *java.lang.IllegalArgumentException*: 
>>
>>
>> I'm wondering, how do I figure out what is wrong here? I'm going to 
>> assume the government is offering reasonably standard XML, so where would 
>> the problem arise? How do I figure out a way around this? 
>>
>> The CPE dictionary is 386 megabytes so I can't share the hold file here, 
>> but when I run "head" on it, the beginning looks like this:
>>
>>
>> 
>>
>> http://scap.nist.gov/schema/configuration/0.1; 
>> xmlns="http://cpe.mitre.org/dictionary/2.0; xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance; xmlns:scap-core="
>> http://scap.nist.gov/schema/scap-core/0.3; xmlns:cpe-23="
>> http://scap.nist.gov/schema/cpe-extension/2.3; xmlns:ns6="
>> http://scap.nist.gov/schema/scap-core/0.1; xmlns:meta="
>> http://scap.nist.gov/schema/cpe-dictionary-metadata/0.2; 
>> xsi:schemaLocation="http://scap.nist.gov/schema/cpe-extension/2.3 
>> https://scap.nist.gov/schema/cpe/2.3/cpe-dictionary-extension_2.3.xsd 
>> http://cpe.mitre.org/dictionary/2.0 
>> https://scap.nist.gov/schema/cpe/2.3/cpe-dictionary_2.3.

Re: how do I debug a cryptic XML error?

2022-02-15 Thread Laws

I changed the code a bit:

cpe-dictionary (-> "official-cpe-dictionary_v2.3.xml"
   (java.io.StringReader.)
   (xml/parse))

xmlzipper (clojure.zip/xml-zip cpe-dictionary)

Now I get this:

  clojure.data.xml/*parse* 
  xml.clj:  84

  clojure.data.xml/*parse* 
  xml.clj: 109

clojure.data.xml.tree/*event-tree*  
tree.clj:  70

 clojure.core/*ffirst*  
core.clj: 105

  clojure.core/*first*  
core.clj:  55

 ...
   

   clojure.data.xml.tree/seq-tree/*fn*  
tree.clj:  39

clojure.core/*seq*  
core.clj: 139

 ...
   

  clojure.data.xml.jvm.parse/pull-seq/*fn* 
parse.clj:  78

com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next  
XMLStreamReaderImpl.java: 652

*javax.xml.stream.XMLStreamException*: *ParseError at [row,col]:[1,1]*

* Message: Content is not allowed in 
prolog.*

*location*: 
#object[com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl$1 
0x296bfddb "Line number = 1\nColumn number = 1\nSystem Id = null\nPublic Id 
= null\nLocation Uri= null\nCharacterOffset = 0\n"]




On Tuesday, February 15, 2022 at 7:50:12 PM UTC-5 Laws wrote:

> So, I went to the government NVD website:
>
> https://nvd.nist.gov/products/cpe
>
> I downloaded the CPE Dictionary and unpacked it. It looks like standard 
> XML. 
>
> I copy and paste the standard XML example given on the Clojure XML 
> documentation page:
>
>  cpe-dictionary (-> "official-cpe-dictionary_v2.3.xml" io/resource io/file 
> clj-xml/parse zip/xml-zip)
>
> I get:
>
> clojure.xml/*startparse-sax*xml.clj:  76  
>   ...   
>
>jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke  
> DelegatingMethodAccessorImpl.java:  43
>
>jdk.internal.reflect.NativeMethodAccessorImpl.invoke  
> NativeMethodAccessorImpl.java:  77
>
>   jdk.internal.reflect.NativeMethodAccessorImpl.invoke0   
> NativeMethodAccessorImpl.java
>
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse   
>   SAXParserImpl.java: 317
>
> *java.lang.IllegalArgumentException*: 
>
>
> I'm wondering, how do I figure out what is wrong here? I'm going to assume 
> the government is offering reasonably standard XML, so where would the 
> problem arise? How do I figure out a way around this? 
>
> The CPE dictionary is 386 megabytes so I can't share the hold file here, 
> but when I run "head" on it, the beginning looks like this:
>
>
> 
>
> http://scap.nist.gov/schema/configuration/0.1; 
> xmlns="http://cpe.mitre.org/dictionary/2.0; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance; xmlns:scap-core="
> http://scap.nist.gov/schema/scap-core/0.3; xmlns:cpe-23="
> http://scap.nist.gov/schema/cpe-extension/2.3; xmlns:ns6="
> http://scap.nist.gov/schema/scap-core/0.1; xmlns:meta="
> http://scap.nist.gov/schema/cpe-dictionary-metadata/0.2; 
> xsi:schemaLocation="http://scap.nist.gov/schema/cpe-extension/2.3 
> https://scap.nist.gov/schema/cpe/2.3/cpe-dictionary-extension_2.3.xsd 
> http://cpe.mitre.org/dictionary/2.0 
> https://scap.nist.gov/schema/cpe/2.3/cpe-dictionary_2.3.xsd 
> http://scap.nist.gov/schema/cpe-dictionary-metadata/0.2 
> https://scap.nist.gov/schema/cpe/2.1/cpe-dictionary-metadata_0.2.xsd 
> http://scap.nist.gov/schema/scap-core/0.3 
> https://scap.nist.gov/schema/nvd/scap-core_0.3.xsd 
> http://scap.nist.gov/schema/configuration/0.1 
> https://scap.nist.gov/schema/nvd/configuration_0.1.xsd 
> http://scap.nist.gov/schema/scap-core/0.1 
> https://scap.nist.gov/schema/nvd/scap-core_0.1.xsd;>
>
>   
>
> National Vulnerability Database (NVD)
>
> 4.9
>
> 2.3
>
> 2022-01-25T04:50:56.780Z
>
>   
>
>name="cpe:/a:%240.99_kindle_books_project:%240.99_kindle_books:6::~~~android~~">
>
> $0.99 Kindle Books project $0.99 Kindle Books 
> (aka com.kindle.books.for99) for android 6.0
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure&q

how do I debug a cryptic XML error?

2022-02-15 Thread Laws
So, I went to the government NVD website:

https://nvd.nist.gov/products/cpe

I downloaded the CPE Dictionary and unpacked it. It looks like standard 
XML. 

I copy and paste the standard XML example given on the Clojure XML 
documentation page:

 cpe-dictionary (-> "official-cpe-dictionary_v2.3.xml" io/resource io/file 
clj-xml/parse zip/xml-zip)

I get:

clojure.xml/*startparse-sax*xml.clj:  76
...   

   jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke  
DelegatingMethodAccessorImpl.java:  43

   jdk.internal.reflect.NativeMethodAccessorImpl.invoke  
NativeMethodAccessorImpl.java:  77

  jdk.internal.reflect.NativeMethodAccessorImpl.invoke0   
NativeMethodAccessorImpl.java

com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse 
SAXParserImpl.java: 317

*java.lang.IllegalArgumentException*: 


I'm wondering, how do I figure out what is wrong here? I'm going to assume 
the government is offering reasonably standard XML, so where would the 
problem arise? How do I figure out a way around this? 

The CPE dictionary is 386 megabytes so I can't share the hold file here, 
but when I run "head" on it, the beginning looks like this:




http://scap.nist.gov/schema/configuration/0.1; 
xmlns="http://cpe.mitre.org/dictionary/2.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:scap-core="http://scap.nist.gov/schema/scap-core/0.3; 
xmlns:cpe-23="http://scap.nist.gov/schema/cpe-extension/2.3; 
xmlns:ns6="http://scap.nist.gov/schema/scap-core/0.1; 
xmlns:meta="http://scap.nist.gov/schema/cpe-dictionary-metadata/0.2; 
xsi:schemaLocation="http://scap.nist.gov/schema/cpe-extension/2.3 
https://scap.nist.gov/schema/cpe/2.3/cpe-dictionary-extension_2.3.xsd 
http://cpe.mitre.org/dictionary/2.0 
https://scap.nist.gov/schema/cpe/2.3/cpe-dictionary_2.3.xsd 
http://scap.nist.gov/schema/cpe-dictionary-metadata/0.2 
https://scap.nist.gov/schema/cpe/2.1/cpe-dictionary-metadata_0.2.xsd 
http://scap.nist.gov/schema/scap-core/0.3 
https://scap.nist.gov/schema/nvd/scap-core_0.3.xsd 
http://scap.nist.gov/schema/configuration/0.1 
https://scap.nist.gov/schema/nvd/configuration_0.1.xsd 
http://scap.nist.gov/schema/scap-core/0.1 
https://scap.nist.gov/schema/nvd/scap-core_0.1.xsd;>

  

National Vulnerability Database (NVD)

4.9

2.3

2022-01-25T04:50:56.780Z

  

  

$0.99 Kindle Books project $0.99 Kindle Books 
(aka com.kindle.books.for99) for android 6.0

-- 
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/526fa490-4c26-46dc-acd3-34f377d1eb91n%40googlegroups.com.


Re: pre and post assertions, always in the meta data?

2022-02-03 Thread Laws
Hmmm, okay, I was using slingshot/try+ everywhere and then, just once, I 
used a plain 'try' and forgot to use the correct catch. My fault. 

On Thursday, February 3, 2022 at 1:56:59 PM UTC-5 Laws wrote:

>
> I see this old post by Fogus:
>
> http://blog.fogus.me/2009/12/21/clojures-pre-and-post/
>
> With this example:
>
> (defn constrained–fn [f x]
>   {:pre  [(pos? x)]
>:post [(= % (* 2 x))]}
>   (f x))
>
> But I see this modern example:
>
> https://ostash.dev/posts/2021-07-01-pre-post-conditions/
>
> (defn func ^{:pre [(pos? x)] :post [(< % 100) (> % 1)]} [x] (+ 1 x))
>
> Where it is in the metadata. 
>
> But here I still the old style:
>
> https://clojure.org/reference/special_forms
>
> (defn constrained-sqr [x] {:pre [(pos? x)] :post [(> % 16), (< % 225)]} (* 
> x x))
>
> I was away from Clojure for a few years, so I think it I missed some of 
> its evolution. Is one of these styles favored? 
>
> I'm struggling with an issue where I cannot get the error to show up, even 
> when I deliberately send in data that would cause the assertion to return 
> false. 
>
> My function started: 
>
> (defn get-cisa-advisories
>   [cisa-advisory-urls]
>   {
>:pre [(set? cisa-advisory-urls)]
>:post [(vector? %)]
>}
>   (println "get-cisa-advisories")
>   (try
>
> When I called this with a vector, I got no error, but the app silently 
> died. I'm confused about this. The call to this function is wrapped in a 
> try/catch block, and that assertion must have thrown an error because that 
> is where the app dies, yet I couldn't see the exception in my catch block. 
>

-- 
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/57315054-1970-4e4b-95f7-b61ebd0381d8n%40googlegroups.com.


pre and post assertions, always in the meta data?

2022-02-03 Thread Laws

I see this old post by Fogus:

http://blog.fogus.me/2009/12/21/clojures-pre-and-post/

With this example:

(defn constrained–fn [f x]
  {:pre  [(pos? x)]
   :post [(= % (* 2 x))]}
  (f x))

But I see this modern example:

https://ostash.dev/posts/2021-07-01-pre-post-conditions/

(defn func ^{:pre [(pos? x)] :post [(< % 100) (> % 1)]} [x] (+ 1 x))

Where it is in the metadata. 

But here I still the old style:

https://clojure.org/reference/special_forms

(defn constrained-sqr [x] {:pre [(pos? x)] :post [(> % 16), (< % 225)]} (* 
x x))

I was away from Clojure for a few years, so I think it I missed some of its 
evolution. Is one of these styles favored? 

I'm struggling with an issue where I cannot get the error to show up, even 
when I deliberately send in data that would cause the assertion to return 
false. 

My function started: 

(defn get-cisa-advisories
  [cisa-advisory-urls]
  {
   :pre [(set? cisa-advisory-urls)]
   :post [(vector? %)]
   }
  (println "get-cisa-advisories")
  (try

When I called this with a vector, I got no error, but the app silently 
died. I'm confused about this. The call to this function is wrapped in a 
try/catch block, and that assertion must have thrown an error because that 
is where the app dies, yet I couldn't see the exception in my catch block. 

-- 
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/e8d2b2da-592e-48ac-93e1-ab54ca54d9cdn%40googlegroups.com.


Re: common ways to run regex against either Hickory HTML or zippers?

2022-02-03 Thread Laws
Thank you, everyone.

On Wednesday, February 2, 2022 at 3:22:53 PM UTC-5 lawrence...@gmail.com 
wrote:

> Assume I've been cursed to scrape HTML. If I convert the pages to Hickory 
> I end up with a big mass of data which, sadly, lacks many "class" or "id"s 
> that would let me easily pick out the data I need. However, for the most 
> part, the only thing I really need off this page is the CVEs, which look 
> like this:
>
> CVE-2021-40539
>
> I'm thinking I might write regex against the plain text of the page, but 
> I'm also curious, is it common to take something like Hiccup or Hickory or 
> a zipper and run regex through it? If yes, how is that done? 
>
> A small part of the data looks like this:
>
> :content
> [{:type :element,
>   :attrs
>   {:class "tip-intro", :style "font-size: 15px;"},
>   :tag :p,
>   :content
>   [{:type :element,
> :attrs nil,
> :tag :em,
> :content
> ["This Joint Cybersecurity Advisory uses the MITRE 
> Adversarial Tactics, Techniques, and Common Knowledge (ATT®) framework, 
> Version 8. See the "
>  {:type :element,
>   :attrs
>   {:href
>"
> https://attack.mitre.org/versions/v9/techniques/enterprise/"},
>   :tag :a,
>   :content ["ATT for Enterprise"]}
>  " for  referenced threat actor tactics and for 
> techniques."]}]}
>  "\n\n"
>  {:type :element,
>   :attrs nil,
>   :tag :p,
>   :content
>   ["This joint advisory is the result of analytic efforts 
> between the Federal Bureau of Investigation (FBI), United States Coast 
> Guard Cyber Command (CGCYBER), and the Cybersecurity and Infrastructure 
> Security Agency (CISA) to highlight the cyber threat associated with active 
> exploitation of a newly identified vulnerability (CVE-2021-40539) in 
> ManageEngine ADSelfService Plus—a self-service password management and 
> single sign-on solution."]}
>  "\n\n"
>  {:type :element,
>   :attrs nil,
>   :tag :p,
>   :content
>   ["CVE-2021-40539, rated critical by the Common 
> Vulnerability Scoring System (CVSS), is an authentication bypass 
> vulnerability affecting representational state transfer (REST) application 
> programming interface (API) URLs that could enable remote code execution. 
> The FBI, CISA, and CGCYBER assess that advanced persistent threat (APT) 
> cyber actors are likely among those exploiting the vulnerability. The 
> exploitation of ManageEngine ADSelfService Plus poses a serious risk to 
> critical infrastructure companies, U.S.-cleared defense contractors, 
> academic institutions, and other entities that use the software. Successful 
> exploitation of the vulnerability allows an attacker to place webshells, 
> which enable the adversary to conduct post-exploitation activities, such as 
> compromising administrator credentials, conducting lateral movement, and 
> exfiltrating registry hives and Active Directory files."]}
>  "\n\n"
>

-- 
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/388183d2-7cf6-4b58-900f-aa0d0074cd91n%40googlegroups.com.


Re: How to suppress warnings about namespace replacements?

2022-02-02 Thread Laws
Thank you.

On Tuesday, February 1, 2022 at 6:44:50 PM UTC-5 Alex Miller wrote:

> Most likely a newer version of this library exists that addresses these 
> warnings. In this particular case, the issue was fixed in June 2016 as of 
> tools.analyzer version 0.6.9.
>
> In a namespace with this issue, you can address like this:
>
> (ns whatever
>   (:refer-clojure :exclude [boolean?]))
>
> But you can't really do that from outside the namespace or suppress this 
> warning otherwise.
>
> Alex
>
>
> On Tuesday, February 1, 2022 at 11:22:28 AM UTC-6 Laws wrote:
>
>> I get a lot of warnings like this:
>>
>> WARNING: boolean? already refers to: #'clojure.core/boolean? in 
>> namespace: clojure.tools.analyzer.utils, being replaced by: 
>> #'clojure.tools.analyzer.utils/boolean?
>>
>>
>> Is there an official way to acknowledge that I'm aware of this namespace 
>> issue, such that the warnings disappear? 
>>
>

-- 
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/fc115dbb-8153-4547-9061-aed3ec81bf02n%40googlegroups.com.


How to suppress warnings about namespace replacements?

2022-02-01 Thread Laws
I get a lot of warnings like this:

WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: 
clojure.tools.analyzer.utils, being replaced by: 
#'clojure.tools.analyzer.utils/boolean?


Is there an official way to acknowledge that I'm aware of this namespace 
issue, such that the warnings disappear? 

-- 
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/a179fd52-79dc-4db1-b3c9-01a41ab86965n%40googlegroups.com.


a new Mac, with an old Emacs setup, and Cider won't work

2022-01-22 Thread Laws
I've a new Mac, but I copied over my old Emacs setup. Not sure if this is 
some kind of version conflict. I'm trying to run "cider-jack-in" for the 
first time on this machine and I get this error. Does anyone have a guess 
what this is about? 


Caused by: java.lang.RuntimeException: Invalid token: 
::clojure.test/once-fixtures
 at clojure.lang.Util.runtimeException (Util.java:221)

error in process sentinel: Could not start nREPL server: 
clojure.lang.Compiler$CompilerException: Syntax error reading source at 
(cider/nrepl/middleware/test.clj:129:57).
#:clojure.error{:phase :read-source, :line 129, :column 57, :source 
"cider/nrepl/middleware/test.clj"}
 at clojure.lang.Compiler.load (Compiler.java:7647)
clojure.lang.RT.loadResourceScript (RT.java:381)

-- 
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/bcbbfa78-e4ed-4e21-ad08-6e912d4e5522n%40googlegroups.com.


Ruby on Rails similar functionality for auto-generating an API?

2022-01-07 Thread Laws
In Ruby on Rails, given an existing database, it is very easy to 
autogenerate much of the code needed to serve a simple RESTful API. Does 
the Clojure ecosystem have anything like that? 

-- 
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/383a6a55-7f11-439d-b8a0-cd09a61dee9fn%40googlegroups.com.


Re: What Emacs framework do you prefer?

2021-08-10 Thread Laws
Thank you, everyone, I'll investigate these suggestions. 

On Monday, August 9, 2021 at 10:50:04 PM UTC-4 Laws wrote:

> I've been away from Clojure for 3 years but I've decided my next project 
> will be pure Clojure. I'm setting everything up on a new MacBook Pro that I 
> just bought. I just installed Emacs and I'm wondering what kind of 
> starter-kit or framework do people prefer nowadays? Does anyone want to 
> either recommend a framework or share an init file that has some 
> customizations for Clojure? 

-- 
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/3b75dd32-2093-40df-afb9-3a3ca75156b1n%40googlegroups.com.


What Emacs framework do you prefer?

2021-08-09 Thread Laws
I've been away from Clojure for 3 years but I've decided my next project 
will be pure Clojure. I'm setting everything up on a new MacBook Pro that I 
just bought. I just installed Emacs and I'm wondering what kind of 
starter-kit or framework do people prefer nowadays? Does anyone want to 
either recommend a framework or share an init file that has some 
customizations for Clojure? 

-- 
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/81473f1a-f867-41ef-8dd3-2afd0946c373n%40googlegroups.com.


Re: How can I do something like (= (class ds) next.jdbc.connection) ??

2019-10-22 Thread Laws
> The ds binding that you have will satisfy this check (instance? 
javax.sql.DataSource ds) -- 
> because it is an instance of that Java interface.

My experience so far has been a lot of this stuff seems like commonsense to 
those programmers who have a background with Java, but those of us who 
learn Clojure without knowing Java have a harder time picking this up. Part 
of my question was "How do I know this?" Or in your case, how did you know 
this? The reason I included the link to the Github page is I was hoping to 
find out what on that page I was supposed to look at to figure out the 
answer. 

With the clue you gave me, I can look at that page and I see that 
javax.sql.DataSource is used in two protocols, so I guess I could then look 
to see where those protocols are used. But I'm thinking there might be an 
easier way to reverse-engineer an interface or class to get something that 
I can use in an if statement, when I'm adding in a runtime check? I'm a 
little surprised that (class) and (type) and (ancestors) did not give me 
something that I could use. 


On Friday, October 18, 2019 at 12:23:02 AM UTC-4, Sean Corfield wrote:
>
> You should :require the namespaces, not try to :import things.
>
> (ns your.namespace
>   (:require [next.jdbc :as jdbc]))
>
> I suggest you start off by working through 
> https://cljdoc.org/d/seancorfield/next.jdbc/1.0.9/doc/getting-started 
>
> The ds binding that you have will satisfy this check (instance? 
> javax.sql.DataSource ds) -- because it is an instance of that Java 
> interface.
>
> It sounds like you have quite a few misconceptions about using the library 
> (and perhaps using Clojure in general?) so I highly recommend joining the 
> Clojurians Slack http://clojurians.net and https://clojurians.slack.com 
> where you can ask real time questions in the #beginners channel and 
> next.jdbc-specific questions in the #sql channel.
>
>
>
> On Thu, Oct 17, 2019 at 6:03 PM Laws > 
> wrote:
>
>> If I do this:
>>
>> (class ds)
>>
>> I see: 
>>
>> next.jdbc.connection$url_PLUS_etc$reify__555
>>
>> Is there anyway I can match against this? I'd like a runtime check to 
>> know that the code really does have a database connection. Imagine code 
>> like this:
>>
>> (if (= next.jdbc.connection (class ds))
>>   (println "its next.jdbc.connection")
>>   (println "fail, it is not next.jdbc.connection"))
>>
>> I get errors such as:
>>
>> java.lang.ClassNotFoundException: seancorfield/next.jdbc.Connection, 
>> compiling:(core.clj:1:1)
>>
>> The namespace is here:
>>
>>
>> https://github.com/seancorfield/next-jdbc/blob/master/src/next/jdbc/connection.clj
>>
>>
>>(:import
>>[seancorfield/next.jdbc Connection]
>>)
>>
>>(:import
>>[next.jdbc Connection]
>>)
>>
>>(:import
>>[next.jdbc.connection]
>>)
>>
>>
>> What is the correct way to do this? 
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clo...@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 clo...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/clojure/8a486bd5-bb5f-41ef-bcb6-74e49ed58db4%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/clojure/8a486bd5-bb5f-41ef-bcb6-74e49ed58db4%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> -- 
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
> World Singles Networks, LLC. -- https://worldsinglesnetworks.com/
>
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
>

-- 
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/bb43da65-d4be-4afa-bd86-5707817a5764%40googlegroups.com.


How can I do something like (= (class ds) next.jdbc.connection) ??

2019-10-17 Thread Laws
If I do this:

(class ds)

I see: 

next.jdbc.connection$url_PLUS_etc$reify__555

Is there anyway I can match against this? I'd like a runtime check to know 
that the code really does have a database connection. Imagine code like 
this:

(if (= next.jdbc.connection (class ds))
  (println "its next.jdbc.connection")
  (println "fail, it is not next.jdbc.connection"))

I get errors such as:

java.lang.ClassNotFoundException: seancorfield/next.jdbc.Connection, 
compiling:(core.clj:1:1)

The namespace is here:

https://github.com/seancorfield/next-jdbc/blob/master/src/next/jdbc/connection.clj


   (:import
   [seancorfield/next.jdbc Connection]
   )

   (:import
   [next.jdbc Connection]
   )

   (:import
   [next.jdbc.connection]
   )


What is the correct way to do this? 

-- 
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/8a486bd5-bb5f-41ef-bcb6-74e49ed58db4%40googlegroups.com.


Re: What is the correct way to increment a value in an atom from multiple workers?

2017-02-11 Thread Laws
Thank you

On Friday, February 10, 2017 at 11:08:33 PM UTC-5, Francis Avila wrote:
>
> Not all intermediates appear because in between your completed swap! and 
> your log (really the deref of the atom) the value in the atom changed.
>
> You are using atoms correctly. Your swap! function would me more idiomatic 
> if it used the threading macro (->) but otherwise is fine.
>
> If you really need to log each and every change of value, consider using 
> dosync, one or more refs, and an agent to log. Dosync will not run agent 
> send-off!s until the transaction commits successfully, and it will run 
> exactly once per commit. 
>
>

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


What is the correct way to increment a value in an atom from multiple workers?

2017-02-10 Thread Laws
I don't know what I did wrong here. 

I wanted to build an accuracy test for some search matching code we wrote. 
We match text using things like Levenshtein distance and Jaro-Winkler 
scores. These parameters can be fine-tuned, so I wrote a small app that 
fires 10 million requests at our search match service, with different 
values for the parameters. The idea is to find the number of True 
Positives, False Positives, True Negatives and False Negatives, for each 
algorithm, for each level of strictness. 

So I create a map in an atom, which gets updated, from various workers, in 
different threads. The numbers bounce around:

 {:false {:allowed_jaro_winkler_distance {0.88 192, 0.9 192, 0.92 192, 0.94 
160}, :allowed_levenshtein_distance {2 184, 5 184, 8 184, 11 184}, 
:allowed_high_score {30 184, 40 184, 50 184, 60 184}, 
:allowed_exact_match_score {14 192, 19 192, 24 176, 29 176}}, :total 736}

{:false {:allowed_jaro_winkler_distance {0.88 192, 0.9 192, 0.92 192, 0.94 
166}, :allowed_levenshtein_distance {2 188, 5 186, 8 184, 11 184}, 
:allowed_high_score {30 186, 40 186, 50 185, 60 185}, 
:allowed_exact_match_score {14 192, 19 192, 24 182, 29 176}}, :total 742}

"total" at the end goes from 736 to 742. Normally that wouldn't surprise 
me, given that I'm incrementing from different workers, but what is strange 
is that the intermediate values don't ever appear. It's not that they 
appear out of order, which would be normal, it's that they don't appear at 
all. Why might that be? 

As to the function, I tried to write this with (merge-with) but I could not 
get the syntax correct, so I gave up and went with something simple. Anyone 
who can suggest a more idiomatic approach, please do. 

(defn increment-accuracy-and-precision
  [true-positive-or-false-negative api-context]
  {:pre [(keyword? true-positive-or-false-negative)]}
  "We want to increment true positives and false negatives, for all of the 
different parameters that we tried, so we build a 3 dimensional map that 
tracts :true or :false, plus the parameter, plus the value of the 
parameter, and we increment the total that is 3 dimensions deep."
  (swap! accuracy-and-precision
 (fn [old-values]
   (let [fnil-inc (fnil inc 0)

 old-values (update-in old-values 
[true-positive-or-false-negative :allowed_jaro_winkler_distance 
(:allowed_jaro_winkler_distance api-context)] fnil-inc)

 old-values (update-in old-values 
[true-positive-or-false-negative :allowed_levenshtein_distance 
(:allowed_levenshtein_distance api-context)] fnil-inc)

 old-values (update-in old-values 
[true-positive-or-false-negative :allowed_high_score (:allowed_high_score 
api-context)] fnil-inc)

 old-values (update-in old-values 
[true-positive-or-false-negative :allowed_exact_match_score 
(:allowed_exact_match_score api-context)] fnil-inc)
 old-values (update-in old-values [:total] fnil-inc) 
 ]
 old-values)))
  (timbre/log :trace @accuracy-and-precision))










-- 
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: When did this start? java.lang.IllegalAccessError cond* does not exist nippy

2017-02-07 Thread Laws

> I strongly recommend disabling aot compilation entirely, and if you are 
> going to aot compile, regularly delete target/.

Thank you. I've done so and that seems to help.




On Tuesday, February 7, 2017 at 5:44:50 PM UTC-5, red...@gmail.com wrote:
>
> definitely turn on 
> https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L81 
> :pedantic? :abort and resolve the issues lein deps :tree shows you. 
>
> given that you are aot compiling, but have implicit clean disabled, my 
> guess is you compiled the project once using a version of some library 
> where cond* was present and nippy could use it, made some changes to the 
> versions you were using, but didn't blow away the compiled class files, 
> so nippy was never compiled again, so there was never an error about the 
> missing cond* macro. So the error was never noticed when it was 
> introduced, and now some time later for whatever nippy is being compiled 
> again (fresh checkout, run lein clean, dunno) and versions conflict and 
> the macro is missing. 
>
> This is just a theory, could be all kinds of stuff. 
>
> I strongly recommend disabling aot compilation entirely, and if you are 
> going to aot compile, regularly delete target/. AOT compilation can be a 
> reliable source of bugs that break things at a large distance from the 
> cause. If you are aot compiling only to get a nice launcher for your 
> program, it is not worth it. I have a guide I am trying to contribute to 
> the official docs on how to launch a clojure program without using aot, 
> you can see it here 
>
> https://github.com/hiredman/clojure-site/blob/df56aef005d5d867213a51c2d3bbec5a86b0acad/content/guides/running_a_clojure_program.adoc,
>  
>
> https://github.com/clojure/clojure-site/pull/141 is the pr. 
>
> On 02/07/2017 02:32 PM, Laws wrote: 
> > Sorry about that. Here is the whole of my project.clj. It is a fairly 
> > small app. 
> > 
> > (defproject csv-to-dynamodb "1.0" 
> >   :description "Takes a Super company import file, of CSV format, and 
> > stores the data in DynamoDB, using the company_name as the sharding key" 
> >   :url "https://bitbucket.org/super/poi; 
> >   :license {:name "Copyright Super 2016" 
> > :url "http://www.super.com/"} 
> >   :dependencies [ 
> >  [org.clojure/clojure "1.7.0"] 
> >  [org.clojure/test.check "0.9.0"] 
> >  [org.clojure/data.json "0.2.6"] 
> >  [defun "0.3.0-RC1"] 
> >  [http-kit "2.2.0"] 
> >  [com.taoensso/timbre "4.3.1"] 
> >  [dire "0.5.4"] 
> >  [slingshot "0.12.2"] 
> >  [me.raynes/fs "1.4.4"] 
> >  [clj-stacktrace "0.2.7"] 
> >  [overtone/at-at "1.2.0"] 
> >  [com.taoensso/faraday "1.9.0"] 
> >  ] 
> >   :disable-implicit-clean true 
> >   :warn-on-reflection true 
> >   :source-paths  ["src/clojure"] 
> >   :java-source-paths ["src/java"] 
> >   :main csv-to-dynamodb.core 
> >   :aot :all 
> >   :jvm-opts ["-Xms50m" "-Xmx50m" "-XX:-UseCompressedOops"]) 
> > 
> > 
> > 
> > And this: 
> > 
> > lein deps :tree 
> > 
> > shows me: 
> > 
> > [com.taoensso/faraday "1.9.0"] -> [com.taoensso/nippy "2.12.0"] -> 
> > [com.taoensso/encore "2.67.1"] 
> > 
> > 
> > The full output: 
> > 
> > lein deps :tree 
> > 
> > Possibly confusing dependencies found: 
> > 
> > [lein-checkall "0.1.1"] -> [jonase/eastwood "0.0.2"] -> 
> > [org.clojure/tools.namespace "0.1.2"] 
> >  overrides 
> > [lein-checkall "0.1.1"] -> [lein-kibit "0.0.8"] -> [jonase/kibit 
> > "0.0.8"] -> [org.clojure/tools.namespace "0.2.1"] 
> >  and 
> > [lein-checkall "0.1.1"] -> [lein-bikeshed "0.1.3"] -> 
> > [org.clojure/tools.namespace "0.2.3"] 
> > 
> > Consider using these exclusions: 
> > [lein-checkall "0.1.1" :exclusions [org.clojure/tools.namespace]] 
> > [lein-checkall "0.1.1" :exclusions [org.clojure/tools.namespace]] 
> > 
> > Possibly confusing dependencies found: 
> > [org.clojure/clojure "1.7.0"] 
> >  over

Re: When did this start? java.lang.IllegalAccessError cond* does not exist nippy

2017-02-07 Thread Laws
> I’ll note that if you’re using the com.taoensso libraries, it pays to 
make sure you keep them 
> all in sync because they change a lot

H. 

First of all, this worked, so you are right. Second of all, I am not sure I 
understand why this worked. 

I have run into this problem with Ruby and Bundler, when I have open-ended 
version ranges, such as: 

1.9 ~>

Meaning, any version over 1.9. That can lead to problems. 

But in my project.clj I have everything locked down to specific versions, 
so I don't see how version conflicts can arise. If it's the same versions 
now as a few months ago, I'm not clear how I got a version conflict. 

But it worked, so thank you. 






On Tuesday, February 7, 2017 at 5:58:02 PM UTC-5, Sean Corfield wrote:
>
> Kevin’s provided some solid advice on the AOT stuff.
>
>  
>
> I’ll note that if you’re using the com.taoensso libraries, it pays to make 
> sure you keep them all in sync because they change a lot (that’s both good 
> and bad), and it’s definitely worth using :exclusions fairly liberally to 
> avoid transient dependencies, so you have much more control over the actual 
> versions you pull in. We tend to exclude nearly all of the com.taoensso 
> libraries and then explicitly specify known compatible versions. At the 
> very least, you’re likely to need a more up to date timbre version.
>
>  
>
> Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>  
>
> On 2/7/17, 2:32 PM, "Laws" <clo...@googlegroups.com  on 
> behalf of smashco...@gmail.com > wrote:
>
>  
>
> Sorry about that. Here is the whole of my project.clj. It is a fairly 
> small app. 
>
>  
>
> (defproject csv-to-dynamodb "1.0"
>
>   :description "Takes a Super company import file, of CSV format, and 
> stores the data in DynamoDB, using the company_name as the sharding key"
>
>   :url "https://bitbucket.org/super/poi;
>
>   :license {:name "Copyright Super 2016"
>
> :url "http://www.super.com/"}
>
>   :dependencies [
>
>  [org.clojure/clojure "1.7.0"]
>
>  [org.clojure/test.check "0.9.0"]
>
>  [org.clojure/data.json "0.2.6"]
>
>  [defun "0.3.0-RC1"]
>
>  [http-kit "2.2.0"]
>
>  [com.taoensso/timbre "4.3.1"]
>
>  [dire "0.5.4"]
>
>  [slingshot "0.12.2"]
>
>  [me.raynes/fs "1.4.4"]
>
>  [clj-stacktrace "0.2.7"] 
>
>  [overtone/at-at "1.2.0"]
>
>  [com.taoensso/faraday "1.9.0"]
>
>  ]
>
>   :disable-implicit-clean true
>
>   :warn-on-reflection true
>
>   :source-paths  ["src/clojure"]
>
>   :java-source-paths ["src/java"]
>
>   :main csv-to-dynamodb.core
>
>   :aot :all
>
>   :jvm-opts ["-Xms50m" "-Xmx50m" "-XX:-UseCompressedOops"])
>
>  
>
>  
>
>  
>
> And this:
>
>  
>
> lein deps :tree
>
>  
>
> shows me: 
>
>  
>
> [com.taoensso/faraday "1.9.0"] -> [com.taoensso/nippy "2.12.0"] -> 
> [com.taoensso/encore "2.67.1"]
>
>  
>
>  
>
> The full output: 
>
>  
>
> lein deps :tree
>
>  
>
> Possibly confusing dependencies found:
>
>  
>
> [lein-checkall "0.1.1"] -> [jonase/eastwood "0.0.2"] -> 
> [org.clojure/tools.namespace "0.1.2"]
>
>  overrides
>
> [lein-checkall "0.1.1"] -> [lein-kibit "0.0.8"] -> [jonase/kibit "0.0.8"] 
> -> [org.clojure/tools.namespace "0.2.1"]
>
>  and
>
> [lein-checkall "0.1.1"] -> [lein-bikeshed "0.1.3"] -> 
> [org.clojure/tools.namespace "0.2.3"]
>
>  
>
> Consider using these exclusions:
>
> [lein-checkall "0.1.1" :exclusions [org.clojure/tools.namespace]]
>
> [lein-checkall "0.1.1" :exclusions [org.clojure/tools.namespace]]
>
>  
>
> Possibly confusing dependencies found:
>
> [org.clojure/clojure "1.7.0"]
>
>  overrides
>
> [defun "0.3.0-RC1"] -> [org.clojure/clojure "1.8.0"]
>
>  
>
> Consider using these exclusions:
>
> [defun "0.3.0-RC1" :exclusions [org.clojure/clojure]]
>
>

Re: When did this start? java.lang.IllegalAccessError cond* does not exist nippy

2017-02-07 Thread Laws
3"]
 [org.iq80.snappy/snappy "0.4"]
   [joda-time "2.9.4"]
 [com.taoensso/timbre "4.3.1"]
   [com.taoensso/encore "2.36.2"]
 [com.taoensso/truss "1.1.1"]
 [org.clojure/tools.reader "0.10.0"]
   [io.aviso/pretty "0.1.23"]
 [defun "0.3.0-RC1"]
   [org.clojure/core.match "0.3.0-alpha4"]
 [org.clojure/tools.analyzer.jvm "0.6.5"]
   [org.clojure/core.memoize "0.5.6"]
 [org.clojure/core.cache "0.6.3"]
   [org.clojure/data.priority-map "0.0.2"]
   [org.clojure/tools.analyzer "0.6.4"]
   [org.ow2.asm/asm-all "4.2"]
   [org.clojure/tools.macro "0.1.2"]
 [dire "0.5.4"]
   [org.clojure/core.incubator "0.1.3"]
   [robert/hooke "1.3.0"]
 [expectations "2.0.9"]
   [junit "4.8.1"]
 [http-kit "2.2.0"]
 [me.raynes/fs "1.4.4"]
   [org.apache.commons/commons-compress "1.4"]
 [org.tukaani/xz "1.0"]
 [org.clojure/clojure "1.7.0"]
 [org.clojure/data.json "0.2.6"]
 [org.clojure/test.check "0.9.0"]
 [org.clojure/tools.nrepl "0.2.12" :exclusions [[org.clojure/clojure]]]
 [overtone/at-at "1.2.0"]
 [slamhound "1.3.1"]
 [slingshot "0.12.2"]







On Tuesday, February 7, 2017 at 4:47:10 PM UTC-5, Sean Corfield wrote:
>
> You’ll need to provide a bit more detail than that – what are your 
> project’s dependencies, for example?
>
>  
>
> (if you’re depending on any snapshots or generic “RELEASE” / “LATEST” 
> versions, those could give you different versions)
>
>  
>
> Sean
>
>  
>
> On 2/7/17, 1:31 PM, "Laws" <clo...@googlegroups.com  on 
> behalf of smashco...@gmail.com > wrote:
>
>  
>
> Two months ago I could run "lein uberjar" and my project compiled. Then I 
> had to focus on other things for 2 months. Then today I come back to it, 
> change one line of code, and run "lein uberjar". I get:
>
>  
>
> java.lang.IllegalAccessError: cond* does not exist, 
> compiling:(nippy.clj:1:1)
>
> Exception in thread "main" java.lang.IllegalAccessError: cond* does not 
> exist, compiling:(nippy.clj:1:1)
>
> at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3628)
>
> at clojure.lang.Compiler.compile1(Compiler.java:7323)
>
> at clojure.lang.Compiler.compile1(Compiler.java:7313)
>
> at clojure.lang.Compiler.compile(Compiler.java:7390)
>
> at clojure.lang.RT.compile(RT.java:399)
>
> at clojure.lang.RT.load(RT.java:444)
>
>  
>
> Uh, what? Did something with Nippy change? Clojars? 
>
>  
>
>  
>
> -- 
>

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


When did this start? java.lang.IllegalAccessError cond* does not exist nippy

2017-02-07 Thread Laws
Two months ago I could run "lein uberjar" and my project compiled. Then I 
had to focus on other things for 2 months. Then today I come back to it, 
change one line of code, and run "lein uberjar". I get:

java.lang.IllegalAccessError: cond* does not exist, 
compiling:(nippy.clj:1:1)
Exception in thread "main" java.lang.IllegalAccessError: cond* does not 
exist, compiling:(nippy.clj:1:1)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3628)
at clojure.lang.Compiler.compile1(Compiler.java:7323)
at clojure.lang.Compiler.compile1(Compiler.java:7313)
at clojure.lang.Compiler.compile(Compiler.java:7390)
at clojure.lang.RT.compile(RT.java:399)
at clojure.lang.RT.load(RT.java:444)

Uh, what? Did something with Nippy change? Clojars? 


-- 
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: in Dire, is it possible to mix the "Erlang" style and the Slingshot integration?

2016-03-06 Thread Laws
If I try to use Slingshot like this: 

(defn- check-that-log-file-exists[]
  (if-not (fs/exists? "/var/log/humongorous")
(slingshot/throw+ {:type :humongorous-api.supervisor/no-log-file 
:message "In start/check-that-log-file-exists, we could not find the log 
file /var/log/humongorous" })))

and this is called from (launch) which is called like this: 

(handle-error java.lang.Object #'start/launch)

(defn start []
  (dire/supervise #'start/launch))

The old rule with Slingshot is that if you wanted to catch everything you 
could catch Object, as the universal catch-all, but it is not working for 
me here. I end up with this in the logs: 

Starting the app
#error {
 :cause clojure.lang.PersistentArrayMap cannot be cast to 
java.lang.Throwable
 :via
 [{:type java.lang.ClassCastException
   :message clojure.lang.PersistentArrayMap cannot be cast to 
java.lang.Throwable
   :at [clj_stacktrace.core$parse_exception invoke core.clj 120]}]
 :trace
 [[clj_stacktrace.core$parse_exception invoke core.clj 120]
  [humongorous_api.supervisor_start$fn__71 doInvoke supervisor_start.clj 16]
  [clojure.lang.RestFn invoke RestFn.java 410]
  [clojure.lang.AFn applyToHelper AFn.java 154]
  [clojure.lang.RestFn applyTo RestFn.java 132]
  [clojure.core$apply invoke core.clj 632]
  [dire.core$fn__2985 invoke core.clj 232]
  [clojure.lang.MultiFn invoke MultiFn.java 238]
  [dire.core$supervised_meta doInvoke core.clj 258]
  [clojure.lang.RestFn invoke RestFn.java 425]
  [clojure.lang.AFn applyToHelper AFn.java 156]
  [clojure.lang.RestFn applyTo RestFn.java 132]
  [clojure.core$apply invoke core.clj 634]
  [dire.core$supervise doInvoke core.clj 266]
  [clojure.lang.RestFn invoke RestFn.java 410]
  [humongorous_api.supervisor_start$start invoke supervisor_start.clj 19]
  [humongorous_api.core$start invoke core.clj 11]
  [humongorous_api.core$_main doInvoke core.clj 24]
  [clojure.lang.RestFn invoke RestFn.java 397]
  [clojure.lang.AFn applyToHelper AFn.java 152]
  [clojure.lang.RestFn applyTo RestFn.java 132]
  [humongorous_api.core main nil -1]]}
humongorous-api is shutting down

The last line is "humongorous-api is shutting down" which is set up here: 

;; Enable command-line invocation
(defn -main [& args]
  (try
(.addShutdownHook (Runtime/getRuntime)
  (Thread.
   #(do (println "humongorous-api is shutting down")
(stop
(start)
(catch Exception e (println e

So... if I use the Erlang style I can not match against Object? I'm trying 
to figure out what mistake I have made. 







On Sunday, March 6, 2016 at 7:38:53 PM UTC-5, Laws wrote:
>
> I am a fan of Michael Drogalis's library Dire:
>
> https://github.com/MichaelDrogalis/dire
>
> And I found I was adding logging to any function I wrote to catch errors, 
> so I wrote a macro that added in the logging: 
>
> (defmacro handle-error [object-to-catch symbol-to-target & args]
>   (let [result-fn (first args)]  
> `(dire/with-handler! ~symbol-to-target
>~object-to-catch
>(fn [e# & args#]
>  (let [error-key# (str ~symbol-to-target " " e#)
>error-message# (str (stack/parse-exception e#) " " e# " " 
> args#)]
>(timbre/log :trace (str error-key# " " error-message#)))
>  ~(if (test/function? result-fn)
> `(~result-fn))
>
> That seemed to work. 
>
> But on a new project, I decided I wanted to use the "Erlang" style in 
> Dire. I thought this would only mean changing: 
>
>  `(dire/with-handler! ~symbol-to-target
>
> to:
>
>  `(dire/with-handler ~symbol-to-target
>
> I am not aware of anything else I need to change. 
>
> I was also hoping to use this with Slingshot, but it seems that is only 
> possible with "with-handler!"?  I tried a bunch of things but I could not 
> figure a way to make this work. 
>
>
>
>
>

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


in Dire, is it possible to mix the "Erlang" style and the Slingshot integration?

2016-03-06 Thread Laws
I am a fan of Michael Drogalis's library Dire:

https://github.com/MichaelDrogalis/dire

And I found I was adding logging to any function I wrote to catch errors, 
so I wrote a macro that added in the logging: 

(defmacro handle-error [object-to-catch symbol-to-target & args]
  (let [result-fn (first args)]  
`(dire/with-handler! ~symbol-to-target
   ~object-to-catch
   (fn [e# & args#]
 (let [error-key# (str ~symbol-to-target " " e#)
   error-message# (str (stack/parse-exception e#) " " e# " " 
args#)]
   (timbre/log :trace (str error-key# " " error-message#)))
 ~(if (test/function? result-fn)
`(~result-fn))

That seemed to work. 

But on a new project, I decided I wanted to use the "Erlang" style in Dire. 
I thought this would only mean changing: 

 `(dire/with-handler! ~symbol-to-target
   
to:

 `(dire/with-handler ~symbol-to-target
   
I am not aware of anything else I need to change. 

I was also hoping to use this with Slingshot, but it seems that is only 
possible with "with-handler!"?  I tried a bunch of things but I could not 
figure a way to make this work. 




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


Shouldn't we consider this a bug? "Unable to resolve symbol: % in this context"?

2016-02-14 Thread Laws
If I write this in a file: 

(defn different-order [order]
  {:pre [
 (map? order)
 (:waiter order)
 (:customer order)
 (:menu-item-name order)
 ]
   :post [
  (map? %)
  (:waiter %)
  (:customer %)
  (:menu-item-name %)
  ]}

  )

and then I try "lein uberjar" I get: 

Exception in thread "main" java.lang.RuntimeException: Unable to resolve 
symbol: % in this context

but if I add a line of code to the function body: 

(defn different-order [order]
  {:pre [
 (map? order)
 (:waiter order)
 (:customer order)
 (:menu-item-name order)
 ]
   :post [
  (map? %)
  (:waiter %)
  (:customer %)
  (:menu-item-name %)
  ]}

  (println "hi")

  )

Then it compiles. 

At the very least, we should have a better error message than "Unable to 
resolve symbol: % in this context". Something like "function definition is 
incomplete" would at least communicate what the problem is. 

But if this really needs to be treated as an error, I would like to know 
why it needs to be an error. This does not generate an error: 

(defn different-order [order] )

So why does adding a :post assertion create a compile time error? I'd 
expect a runtime error, but not a compile time error. 

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


conditional logic implemented as pattern-matching and restructuring in the signature of the function

2016-02-08 Thread Laws
Sean Johnson has a great video about pattern matching, where he suggests 
that any function that starts with a conditional should have the 
conditional removed and the conditional logic implemented as 
pattern-matching and restructuring in the signature of the function. But 
after some experimentation, I have failed to figure out a way to do this 
here: 

(defn add-parties-to-customer-queue [parties]
  (if (seq parties)
(swap! customer-queue
   (fn [previous-customer-queue]
 (apply conj previous-customer-queue parties)

"parties" sometimes has a vector of vectors, but sometimes it is simply: ()

Is there any way I can match against that pattern in the function 
signature? 





-- 
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: How is the emphasis of “data over code” different than the XML advocacy of the early 2000s?

2016-02-02 Thread Laws
> I don’t know much about why the industry seems to have rejected XML as 
“bad”

Off-topic, but I think 2 issues dominated

1.) Unnecessary complexity in the 
standards: http://harmful.cat-v.org/software/xml/soap/simple

2.) draconian error-checking. I assume the move to JSON was to get away 
from the strict error checking



On Monday, February 1, 2016 at 5:02:23 PM UTC-5, Josh Tilles wrote:
>
> As I’m watching Michael Drogalis’s Clojure/Conj 2015 presentation “Onyx: 
> Distributed Computing for Clojure” 
> , I'm distracted by a 
> nagging worry that we —as a community— are somehow falling into the same 
> trap as the those advocating XML in the early 2000s. That said, it's a very 
> *vague* unease, because I don’t know much about why the industry seems to 
> have rejected XML as “bad”; by the time I started programming 
> professionally there was already a consensus that XML sucked, and that 
> libraries/frameworks that relied heavily on XML configuration files were to 
> be regarded with suspicion and/or distaste.
>
> So, am I incorrect in seeing a similarity between the “data > code” 
> mentality and the rise of XML? Or, assuming there is a legitimate 
> parallel, is it perhaps unnecessary to be alarmed? Does the tendency to use 
> edn instead of XML sidestep everything that went wrong in the 2000s? Or is 
> it the case that the widespread backlash against XML threw a baby out with 
> the bathwater, forgetting the advantages of data over code?
>
> Cheers,
> Josh
>

-- 
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: java.lang.IllegalArgumentException: Parameter declaration make-response should be a vector

2016-01-10 Thread Laws
Ah, finally found it:

(defn get-stop-response
  (make-response "No company specified" "Session ended" true))


I am surprised that the error was for "make-response" and not 
"get-stop-response". It is "get-stop-response" where I forgot the parameter 
declaration. 



On Sunday, January 10, 2016 at 12:25:57 PM UTC-5, Laws wrote:
>
> The implication, as I read it, is that there is some place where I do 
> something like this: 
>
> response-in-amazon-format (make-response company-name 
> outputSpeech-text false)]
>
> In some other function, and the compiler feels that I am defining a new 
> arity for that other function? But then I would expect to see the name of 
> the other function.
>
>
> On Sunday, January 10, 2016 at 2:52:48 AM UTC-5, James Elliott wrote:
>>
>> That is puzzling indeed. There doesn’t seem to be anything wrong with the 
>> function itself, as you say. I can evaluate it and run it.
>>
>> There must be some other element of your environment which you have not 
>> shared here which is throwing sand in the gears.
>>
>> On Sunday, January 10, 2016 at 1:28:00 AM UTC-6, Laws wrote:
>>>
>>> I've been staring at this for awhile, and moving it around, and 
>>> re-typing it, without seeing what the real error is. 
>>>
>>> I have a file called server.clj which includes this at the top in its 
>>> namespace declaration: 
>>>
>>> (ns salesvoice.server
>>>   (:require
>>>[salesvoice.query :as query]
>>>
>>>
>>> In query.clj, I have this: 
>>>
>>>
>>> (defn make-response
>>>   [company-name outputSpeech-text]
>>>   {"version"  "1.0"
>>>"sessionAttributes"  {
>>>  "company-name"  company-name
>>>  "user-id" "user-id"
>>>  }
>>>"response"  {
>>> "outputSpeech"  {
>>>  "type"  "PlainText"
>>>  "text"  outputSpeech-text
>>>  }
>>> "card"  {
>>>  "type"  "Simple"
>>>  "title"  (str "Sales Report for " company-name)
>>>  "content"  outputSpeech-text
>>>  } 
>>> "reprompt"  {
>>>  "outputSpeech"  {
>>>   "type"  "PlainText"
>>>   "text"  "Can I help you 
>>> with anything else?"
>>>   }
>>>  }
>>> "shouldEndSession"  true
>>> }
>>>})
>>>
>>>
>>> When I type "lein uberjar" at the command line I get: 
>>>
>>>
>>> Exception in thread "main" java.lang.IllegalArgumentException: Parameter 
>>> declaration make-response should be a vector, compiling:(server.clj:1:1)
>>>
>>> The parameter declaration for make-response is a vector. I am not clear 
>>> why I am getting this error. 
>>>
>>> Things I tried:
>>>
>>> 1.) moving this around in the file. It had been in the middle of 
>>> query.clj, but I moved it to the top, its now the first function defined in 
>>> that file
>>>
>>> 2.) re-typing the parameter declaration
>>>
>>> 3.) looking for other functions that have the same name, but grep shows 
>>> this is the only declaration
>>>
>>> So what could the real issue be? 
>>>
>>> Also, why does the error seem to show up when server.clj is including 
>>> query.clj. Shouldn't the error appear when query.clj is compiled? 
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>

-- 
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: java.lang.IllegalArgumentException: Parameter declaration make-response should be a vector

2016-01-10 Thread Laws
The implication, as I read it, is that there is some place where I do 
something like this: 

response-in-amazon-format (make-response company-name 
outputSpeech-text false)]

In some other function, and the compiler feels that I am defining a new 
arity for that other function? But then I would expect to see the name of 
the other function.


On Sunday, January 10, 2016 at 2:52:48 AM UTC-5, James Elliott wrote:
>
> That is puzzling indeed. There doesn’t seem to be anything wrong with the 
> function itself, as you say. I can evaluate it and run it.
>
> There must be some other element of your environment which you have not 
> shared here which is throwing sand in the gears.
>
> On Sunday, January 10, 2016 at 1:28:00 AM UTC-6, Laws wrote:
>>
>> I've been staring at this for awhile, and moving it around, and re-typing 
>> it, without seeing what the real error is. 
>>
>> I have a file called server.clj which includes this at the top in its 
>> namespace declaration: 
>>
>> (ns salesvoice.server
>>   (:require
>>[salesvoice.query :as query]
>>
>>
>> In query.clj, I have this: 
>>
>>
>> (defn make-response
>>   [company-name outputSpeech-text]
>>   {"version"  "1.0"
>>"sessionAttributes"  {
>>  "company-name"  company-name
>>  "user-id" "user-id"
>>  }
>>"response"  {
>> "outputSpeech"  {
>>  "type"  "PlainText"
>>  "text"  outputSpeech-text
>>  }
>> "card"  {
>>  "type"  "Simple"
>>  "title"  (str "Sales Report for " company-name)
>>  "content"  outputSpeech-text
>>  } 
>> "reprompt"  {
>>  "outputSpeech"  {
>>   "type"  "PlainText"
>>   "text"  "Can I help you 
>> with anything else?"
>>   }
>>  }
>> "shouldEndSession"  true
>> }
>>})
>>
>>
>> When I type "lein uberjar" at the command line I get: 
>>
>>
>> Exception in thread "main" java.lang.IllegalArgumentException: Parameter 
>> declaration make-response should be a vector, compiling:(server.clj:1:1)
>>
>> The parameter declaration for make-response is a vector. I am not clear 
>> why I am getting this error. 
>>
>> Things I tried:
>>
>> 1.) moving this around in the file. It had been in the middle of 
>> query.clj, but I moved it to the top, its now the first function defined in 
>> that file
>>
>> 2.) re-typing the parameter declaration
>>
>> 3.) looking for other functions that have the same name, but grep shows 
>> this is the only declaration
>>
>> So what could the real issue be? 
>>
>> Also, why does the error seem to show up when server.clj is including 
>> query.clj. Shouldn't the error appear when query.clj is compiled? 
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

-- 
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: java.lang.IllegalArgumentException: Parameter declaration make-response should be a vector

2016-01-10 Thread Laws
Yes, I edited the namespace declaration. The full namespace declaration, in 
server.clj, is:

(ns salesvoice.server
  (:import
   [java.io FileNotFoundException])
  (:require
   [salesvoice.credentials :as credentials]
   [salesvoice.middleware :as middleware]
   [taoensso.timbre :as timbre]
   [compojure.core :refer :all]
   [compojure.handler :as handler]
   [compojure.route :as route]
   [me.raynes.fs :as fs]
   [clojure.java.io :as io]
   [clojure.string :as st]
   [ring.util.response :as rr]
   [net.cgrand.enlive-html :as enlive]
   [salesvoice.query :as query])
  (:use
   [ring.middleware.params]
   [ring.middleware.keyword-params]
   [ring.middleware.content-type]
   [ring.adapter.jetty :only [run-jetty]]
   [ring.middleware.json]))


Among the many random changes I made, in an attempt to find the real 
problem, I moved this line around:

   [salesvoice.query :as query]

just in case the order of loading might effect something. 

But no. 





On Sunday, January 10, 2016 at 5:59:14 AM UTC-5, Jony Hudson wrote:
>
> This is probably just a copy and paste problem, rather than the solution 
> to your real problem, but ... the namespace declaration you've got in your 
> OP is missing a couple of closing ).
>
>
> Jony
>
> On Sunday, 10 January 2016 07:28:00 UTC, Laws wrote:
>>
>> I've been staring at this for awhile, and moving it around, and re-typing 
>> it, without seeing what the real error is. 
>>
>> I have a file called server.clj which includes this at the top in its 
>> namespace declaration: 
>>
>> (ns salesvoice.server
>>   (:require
>>[salesvoice.query :as query]
>>
>>
>> In query.clj, I have this: 
>>
>>
>> (defn make-response
>>   [company-name outputSpeech-text]
>>   {"version"  "1.0"
>>"sessionAttributes"  {
>>  "company-name"  company-name
>>  "user-id" "user-id"
>>  }
>>"response"  {
>> "outputSpeech"  {
>>  "type"  "PlainText"
>>  "text"  outputSpeech-text
>>  }
>> "card"  {
>>  "type"  "Simple"
>>  "title"  (str "Sales Report for " company-name)
>>  "content"  outputSpeech-text
>>  } 
>> "reprompt"  {
>>  "outputSpeech"  {
>>   "type"  "PlainText"
>>   "text"  "Can I help you 
>> with anything else?"
>>   }
>>  }
>> "shouldEndSession"  true
>> }
>>})
>>
>>
>> When I type "lein uberjar" at the command line I get: 
>>
>>
>> Exception in thread "main" java.lang.IllegalArgumentException: Parameter 
>> declaration make-response should be a vector, compiling:(server.clj:1:1)
>>
>> The parameter declaration for make-response is a vector. I am not clear 
>> why I am getting this error. 
>>
>> Things I tried:
>>
>> 1.) moving this around in the file. It had been in the middle of 
>> query.clj, but I moved it to the top, its now the first function defined in 
>> that file
>>
>> 2.) re-typing the parameter declaration
>>
>> 3.) looking for other functions that have the same name, but grep shows 
>> this is the only declaration
>>
>> So what could the real issue be? 
>>
>> Also, why does the error seem to show up when server.clj is including 
>> query.clj. Shouldn't the error appear when query.clj is compiled? 
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

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


How to use a Java SDK from Amazon?

2016-01-09 Thread Laws
I'm not sure if this is a Clojure question, but I'm not sure where else to 
ask. I've been working on an app for the Amazon Echo. I'm trying to deal 
with this requirement, which I must deal with if I am to get the app into 
the Amazon app store: 

Check the request signature to verify the authenticity of the request. 
Alexa signs all HTTPS requests.
   
   - The Java library does this verification in the SpeechletServlet class. 
   If you do not use the Java library, you must do this verification yourself.
   - If you use the Java library without using the SpeechletServlet class, 
   you can use theSpeechletRequestSignatureVerifier class to do this.


For some bizarre reason, Amazon does not make its SDK available via the 
main Maven repository. Many developers have asked Amazon to change this, 
but for now, we have to: 

git clone g...@github.com:amzn/alexa-skills-kit-java.git

I thought I could then: 

cp -r ../../alexa-skills-kit-java/src/* src/java/

In my project.clj file I have: 

  :source-paths  ["src/clojure"]
  :java-source-paths ["src/java"]
  :main salesslick.core
  :aot :all

So all of alexa-skills-kit-java/src is now in my src/java directory. 

I still end up with these kinds of dependency issues: 

Compiling 47 source files to 
/Users/lkrubner/projects/salesvoiceapp/salescricket/target/classes
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/Session.java:16:
 
error: package org.apache.commons.lang3 does not exist
import org.apache.commons.lang3.Validate;
^
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Intent.java:17:
 
error: package org.apache.commons.lang3 does not exist
import org.apache.commons.lang3.Validate;
^
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Slot.java:13:
 
error: package org.apache.commons.lang3 does not exist
import org.apache.commons.lang3.Validate;
^
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:17:
 
error: package org.slf4j does not exist
import org.slf4j.Logger;
^
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:18:
 
error: package org.slf4j does not exist
import org.slf4j.LoggerFactory;
^
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:29:
 
error: cannot find symbol
private static final Logger log = 
LoggerFactory.getLogger(ApplicationIdVerifier.class);
^
symbol: class Logger
location: class ApplicationIdVerifier
/Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/IntentRequest.java:15:
 
error: package org.apache.commons.lang3 does not exist
import org.apache.commons.lang3.Validate;
^

[shortened to avoid boredom]


What would I have to do to get a line such as this to resolve: 

import org.apache.commons.lang3.Validate;

??? 

I know there are many Clojure developers who also do a great deal of Java 
development, but I am not one of them. I love Clojure/Leinengen because 
most of the time it protects me from this craziness. 

However, if I knew of an easy way to compile the Amazon SDK on its own, 
then I would be happy to compile it and include it as a Jar. I have 
included Jars before, so I am fairly comfortable with that process. 

Any suggestions? 






-- 
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: How to use a Java SDK from Amazon?

2016-01-09 Thread Laws
Nevermind. I just noticed they offer a Jar:

https://github.com/amzn/alexa-skills-kit-java/tree/master/repo/alexa-skills-kit/alexa-skills-kit/1.1

I'll just use that.

Ignore this post. 


On Saturday, January 9, 2016 at 5:14:51 PM UTC-5, Laws wrote:
>
> I'm not sure if this is a Clojure question, but I'm not sure where else to 
> ask. I've been working on an app for the Amazon Echo. I'm trying to deal 
> with this requirement, which I must deal with if I am to get the app into 
> the Amazon app store: 
>
> Check the request signature to verify the authenticity of the request. 
> Alexa signs all HTTPS requests.
>
>- The Java library does this verification in the SpeechletServlet class. 
>If you do not use the Java library, you must do this verification yourself.
>- If you use the Java library without using the SpeechletServlet class, 
>you can use theSpeechletRequestSignatureVerifier class to do this.
>
>
> For some bizarre reason, Amazon does not make its SDK available via the 
> main Maven repository. Many developers have asked Amazon to change this, 
> but for now, we have to: 
>
> git clone g...@github.com:amzn/alexa-skills-kit-java.git
>
> I thought I could then: 
>
> cp -r ../../alexa-skills-kit-java/src/* src/java/
>
> In my project.clj file I have: 
>
>   :source-paths  ["src/clojure"]
>   :java-source-paths ["src/java"]
>   :main salesslick.core
>   :aot :all
>
> So all of alexa-skills-kit-java/src is now in my src/java directory. 
>
> I still end up with these kinds of dependency issues: 
>
> Compiling 47 source files to 
> /Users/lkrubner/projects/salesvoiceapp/salescricket/target/classes
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/Session.java:16:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Intent.java:17:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Slot.java:13:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:17:
>  
> error: package org.slf4j does not exist
> import org.slf4j.Logger;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:18:
>  
> error: package org.slf4j does not exist
> import org.slf4j.LoggerFactory;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:29:
>  
> error: cannot find symbol
> private static final Logger log = 
> LoggerFactory.getLogger(ApplicationIdVerifier.class);
> ^
> symbol: class Logger
> location: class ApplicationIdVerifier
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/IntentRequest.java:15:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
>
> [shortened to avoid boredom]
>
>
> What would I have to do to get a line such as this to resolve: 
>
> import org.apache.commons.lang3.Validate;
>
> ??? 
>
> I know there are many Clojure developers who also do a great deal of Java 
> development, but I am not one of them. I love Clojure/Leinengen because 
> most of the time it protects me from this craziness. 
>
> However, if I knew of an easy way to compile the Amazon SDK on its own, 
> then I would be happy to compile it and include it as a Jar. I have 
> included Jars before, so I am fairly comfortable with that process. 
>
> Any suggestions? 
>
>
>
>
>
>
>

-- 
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: How to use a Java SDK from Amazon?

2016-01-09 Thread Laws
Damn. I tried localrepo, just like I have in the past: 

lein localrepo install alexa-skills-kit-1.1.jar alexa-sdk 1.1

and then in project.clj: 

  :dependencies [[org.clojure/clojure "1.6.0"]
 [alexa-sdk "1.1"]

but I still ran into configuration issues:

Compiling salesvoice.core
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/slf4j/LoggerFactory, compiling:(query.clj:1:1)

Have others dealt with this issue, when using an SDK that uses slf4j? Is 
there an obvious way to configure this? 



On Saturday, January 9, 2016 at 5:17:00 PM UTC-5, Laws wrote:
>
> Nevermind. I just noticed they offer a Jar:
>
>
> https://github.com/amzn/alexa-skills-kit-java/tree/master/repo/alexa-skills-kit/alexa-skills-kit/1.1
>
> I'll just use that.
>
> Ignore this post. 
>
>
> On Saturday, January 9, 2016 at 5:14:51 PM UTC-5, Laws wrote:
>>
>> I'm not sure if this is a Clojure question, but I'm not sure where else 
>> to ask. I've been working on an app for the Amazon Echo. I'm trying to deal 
>> with this requirement, which I must deal with if I am to get the app into 
>> the Amazon app store: 
>>
>> Check the request signature to verify the authenticity of the request. 
>> Alexa signs all HTTPS requests.
>>
>>- The Java library does this verification in the SpeechletServlet class. 
>>If you do not use the Java library, you must do this verification 
>> yourself.
>>- If you use the Java library without using the SpeechletServlet class, 
>>you can use theSpeechletRequestSignatureVerifier class to do this.
>>
>>
>> For some bizarre reason, Amazon does not make its SDK available via the 
>> main Maven repository. Many developers have asked Amazon to change this, 
>> but for now, we have to: 
>>
>> git clone g...@github.com:amzn/alexa-skills-kit-java.git
>>
>> I thought I could then: 
>>
>> cp -r ../../alexa-skills-kit-java/src/* src/java/
>>
>> In my project.clj file I have: 
>>
>>   :source-paths  ["src/clojure"]
>>   :java-source-paths ["src/java"]
>>   :main salesslick.core
>>   :aot :all
>>
>> So all of alexa-skills-kit-java/src is now in my src/java directory. 
>>
>> I still end up with these kinds of dependency issues: 
>>
>> Compiling 47 source files to 
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/target/classes
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/Session.java:16:
>>  
>> error: package org.apache.commons.lang3 does not exist
>> import org.apache.commons.lang3.Validate;
>> ^
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Intent.java:17:
>>  
>> error: package org.apache.commons.lang3 does not exist
>> import org.apache.commons.lang3.Validate;
>> ^
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Slot.java:13:
>>  
>> error: package org.apache.commons.lang3 does not exist
>> import org.apache.commons.lang3.Validate;
>> ^
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:17:
>>  
>> error: package org.slf4j does not exist
>> import org.slf4j.Logger;
>> ^
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:18:
>>  
>> error: package org.slf4j does not exist
>> import org.slf4j.LoggerFactory;
>> ^
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:29:
>>  
>> error: cannot find symbol
>> private static final Logger log = 
>> LoggerFactory.getLogger(ApplicationIdVerifier.class);
>> ^
>> symbol: class Logger
>> location: class ApplicationIdVerifier
>> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/IntentRequest.java:15:
>>  
>> error: package org.apache.commons.lang3 does not exist
>> import org.apache.commons.lang3.Validate;
>> ^
>>
>> [shortened to avoid boredom]
>>
>>
>> What would I have to do to get a line such as this to resolve: 
>>
>> import org.apache.commons.lang3.Validate;
>>
>> ??? 
>>
>> I know there are many Clojure developers who also do a great deal of Java 
>> development, but I am not one of them. I love Clojure/Leinengen because 
>> most of the time it protects me from this craziness. 
>>
>&g

Re: How to use a Java SDK from Amazon?

2016-01-09 Thread Laws

Thanks for all the suggestions. I got this working like this:

I used the Leinengen "localrepo" plugin to install the Amazon SDK like this:

lein localrepo install alexa-skills-kit-1.1.jar alexa-sdk 1.1

and this created a very basic pom.xml file here: 

~/.m2/repository/alexa-sdk/alexa-sdk/1.1/alexa-sdk-1.1.pom

and this file only consisted of: 


http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
  4.0.0
  alexa-sdk
  alexa-sdk
  1.1
  alexa-sdk


So I opened this file up in emacs and I put the cursor between these 2 
lines: 

  alexa-sdk



and then I copy and pasted most of the content of this file: 

https://github.com/amzn/alexa-skills-kit-java/blob/master/samples/pom.xml

I copied 
   

and that got me passed the dependency errors. 




On Saturday, January 9, 2016 at 5:14:51 PM UTC-5, Laws wrote:
>
> I'm not sure if this is a Clojure question, but I'm not sure where else to 
> ask. I've been working on an app for the Amazon Echo. I'm trying to deal 
> with this requirement, which I must deal with if I am to get the app into 
> the Amazon app store: 
>
> Check the request signature to verify the authenticity of the request. 
> Alexa signs all HTTPS requests.
>
>- The Java library does this verification in the SpeechletServlet class. 
>If you do not use the Java library, you must do this verification yourself.
>- If you use the Java library without using the SpeechletServlet class, 
>you can use theSpeechletRequestSignatureVerifier class to do this.
>
>
> For some bizarre reason, Amazon does not make its SDK available via the 
> main Maven repository. Many developers have asked Amazon to change this, 
> but for now, we have to: 
>
> git clone g...@github.com:amzn/alexa-skills-kit-java.git
>
> I thought I could then: 
>
> cp -r ../../alexa-skills-kit-java/src/* src/java/
>
> In my project.clj file I have: 
>
>   :source-paths  ["src/clojure"]
>   :java-source-paths ["src/java"]
>   :main salesslick.core
>   :aot :all
>
> So all of alexa-skills-kit-java/src is now in my src/java directory. 
>
> I still end up with these kinds of dependency issues: 
>
> Compiling 47 source files to 
> /Users/lkrubner/projects/salesvoiceapp/salescricket/target/classes
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/Session.java:16:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Intent.java:17:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/slu/Slot.java:13:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:17:
>  
> error: package org.slf4j does not exist
> import org.slf4j.Logger;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:18:
>  
> error: package org.slf4j does not exist
> import org.slf4j.LoggerFactory;
> ^
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/authentication/ApplicationIdVerifier.java:29:
>  
> error: cannot find symbol
> private static final Logger log = 
> LoggerFactory.getLogger(ApplicationIdVerifier.class);
> ^
> symbol: class Logger
> location: class ApplicationIdVerifier
> /Users/lkrubner/projects/salesvoiceapp/salescricket/src/java/com/amazon/speech/speechlet/IntentRequest.java:15:
>  
> error: package org.apache.commons.lang3 does not exist
> import org.apache.commons.lang3.Validate;
> ^
>
> [shortened to avoid boredom]
>
>
> What would I have to do to get a line such as this to resolve: 
>
> import org.apache.commons.lang3.Validate;
>
> ??? 
>
> I know there are many Clojure developers who also do a great deal of Java 
> development, but I am not one of them. I love Clojure/Leinengen because 
> most of the time it protects me from this craziness. 
>
> However, if I knew of an easy way to compile the Amazon SDK on its own, 
> then I would be happy to compile it and include it as a Jar. I have 
> included Jars before, so I am fairly comfortable with that process. 
>
> Any suggestions? 
>
>
>
>
>
>
>

-- 
You received this message because you a

Re: java.lang.IllegalArgumentException: Parameter declaration make-response should be a vector

2016-01-09 Thread Laws
And yes, I did try running "lein clean".


On Sunday, January 10, 2016 at 2:28:00 AM UTC-5, Laws wrote:
>
> I've been staring at this for awhile, and moving it around, and re-typing 
> it, without seeing what the real error is. 
>
> I have a file called server.clj which includes this at the top in its 
> namespace declaration: 
>
> (ns salesvoice.server
>   (:require
>[salesvoice.query :as query]
>
>
> In query.clj, I have this: 
>
>
> (defn make-response
>   [company-name outputSpeech-text]
>   {"version"  "1.0"
>"sessionAttributes"  {
>  "company-name"  company-name
>  "user-id" "user-id"
>  }
>"response"  {
> "outputSpeech"  {
>  "type"  "PlainText"
>  "text"  outputSpeech-text
>  }
> "card"  {
>  "type"  "Simple"
>  "title"  (str "Sales Report for " company-name)
>  "content"  outputSpeech-text
>  } 
> "reprompt"  {
>  "outputSpeech"  {
>   "type"  "PlainText"
>   "text"  "Can I help you with 
> anything else?"
>   }
>  }
> "shouldEndSession"  true
> }
>})
>
>
> When I type "lein uberjar" at the command line I get: 
>
>
> Exception in thread "main" java.lang.IllegalArgumentException: Parameter 
> declaration make-response should be a vector, compiling:(server.clj:1:1)
>
> The parameter declaration for make-response is a vector. I am not clear 
> why I am getting this error. 
>
> Things I tried:
>
> 1.) moving this around in the file. It had been in the middle of 
> query.clj, but I moved it to the top, its now the first function defined in 
> that file
>
> 2.) re-typing the parameter declaration
>
> 3.) looking for other functions that have the same name, but grep shows 
> this is the only declaration
>
> So what could the real issue be? 
>
> Also, why does the error seem to show up when server.clj is including 
> query.clj. Shouldn't the error appear when query.clj is compiled? 
>
>
>
>
>
>
>
>
>
>

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


java.lang.IllegalArgumentException: Parameter declaration make-response should be a vector

2016-01-09 Thread Laws
I've been staring at this for awhile, and moving it around, and re-typing 
it, without seeing what the real error is. 

I have a file called server.clj which includes this at the top in its 
namespace declaration: 

(ns salesvoice.server
  (:require
   [salesvoice.query :as query]


In query.clj, I have this: 


(defn make-response
  [company-name outputSpeech-text]
  {"version"  "1.0"
   "sessionAttributes"  {
 "company-name"  company-name
 "user-id" "user-id"
 }
   "response"  {
"outputSpeech"  {
 "type"  "PlainText"
 "text"  outputSpeech-text
 }
"card"  {
 "type"  "Simple"
 "title"  (str "Sales Report for " company-name)
 "content"  outputSpeech-text
 } 
"reprompt"  {
 "outputSpeech"  {
  "type"  "PlainText"
  "text"  "Can I help you with 
anything else?"
  }
 }
"shouldEndSession"  true
}
   })


When I type "lein uberjar" at the command line I get: 


Exception in thread "main" java.lang.IllegalArgumentException: Parameter 
declaration make-response should be a vector, compiling:(server.clj:1:1)

The parameter declaration for make-response is a vector. I am not clear why 
I am getting this error. 

Things I tried:

1.) moving this around in the file. It had been in the middle of query.clj, 
but I moved it to the top, its now the first function defined in that file

2.) re-typing the parameter declaration

3.) looking for other functions that have the same name, but grep shows 
this is the only declaration

So what could the real issue be? 

Also, why does the error seem to show up when server.clj is including 
query.clj. Shouldn't the error appear when query.clj is compiled? 









-- 
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: java.lang.IllegalArgumentException: Parameter declaration make-response should be a vector

2016-01-09 Thread Laws
I would guess that I was dealing with some variant of this: 

http://dev.clojure.org/jira/browse/CLJ-1629

but I can not figure out how my function is malformed. 


On Sunday, January 10, 2016 at 2:28:00 AM UTC-5, Laws wrote:
>
> I've been staring at this for awhile, and moving it around, and re-typing 
> it, without seeing what the real error is. 
>
> I have a file called server.clj which includes this at the top in its 
> namespace declaration: 
>
> (ns salesvoice.server
>   (:require
>[salesvoice.query :as query]
>
>
> In query.clj, I have this: 
>
>
> (defn make-response
>   [company-name outputSpeech-text]
>   {"version"  "1.0"
>"sessionAttributes"  {
>  "company-name"  company-name
>  "user-id" "user-id"
>  }
>"response"  {
> "outputSpeech"  {
>  "type"  "PlainText"
>  "text"  outputSpeech-text
>  }
> "card"  {
>  "type"  "Simple"
>  "title"  (str "Sales Report for " company-name)
>  "content"  outputSpeech-text
>  } 
> "reprompt"  {
>  "outputSpeech"  {
>   "type"  "PlainText"
>   "text"  "Can I help you with 
> anything else?"
>   }
>  }
> "shouldEndSession"  true
> }
>})
>
>
> When I type "lein uberjar" at the command line I get: 
>
>
> Exception in thread "main" java.lang.IllegalArgumentException: Parameter 
> declaration make-response should be a vector, compiling:(server.clj:1:1)
>
> The parameter declaration for make-response is a vector. I am not clear 
> why I am getting this error. 
>
> Things I tried:
>
> 1.) moving this around in the file. It had been in the middle of 
> query.clj, but I moved it to the top, its now the first function defined in 
> that file
>
> 2.) re-typing the parameter declaration
>
> 3.) looking for other functions that have the same name, but grep shows 
> this is the only declaration
>
> So what could the real issue be? 
>
> Also, why does the error seem to show up when server.clj is including 
> query.clj. Shouldn't the error appear when query.clj is compiled? 
>
>
>
>
>
>
>
>
>
>

-- 
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] dewdrop 0.1.0 -- lenses made simple(r?)

2016-01-01 Thread Laws
William, thank you for this. At a cultural level, I feel like the Clojure 
community is often torn between being popular, on the one hand, versus 
answering critics from the Haskell community, on the other hand. The 
strength of Clojure is exactly that it takes inscrutable academic ideas and 
makes them easy (unlike another JVM language with Functional pretensions 
which takes inscrutable academic ideas and makes 
them idiosyncratic academic ideas). 

About this:

"Or perhaps I've just described things with fewer technical terms."

I think that is an important task. Some of the leading members of the 
Clojure community sometimes switch to a mode where they are clearly 
thinking "Now I will answer all the criticism that I will surely get from 
the Haskell crowd" and then they use a ton of academic language, which 
basically asserts "See? We can be just as inscrutable as you Haskell guys!" 
 

But that is not what makes Clojure great. What makes Clojure great is the 
ability to take good ideas (some of them with an academic vintage) and make 
them easy to use. 



 




On Friday, January 1, 2016 at 7:54:54 AM UTC-5, William la Forge wrote:
>
> I've been looking at lenses and while it looks pretty simple and very 
> useful, I had a hard time getting it. So I came up with my own take on 
> lenses. https://github.com/laforge49/dewdrop#readme
>
> So perhaps I still do not understand lenses and what I've done is wrong. 
> Or perhaps having been through the exercise I'm now getting it and what 
> I've done is no simpler than what everyone else has done. Or perhaps I've 
> just described things with fewer technical terms.
>
> So I'd appreciate it if you would review this very short document and tell 
> me what I don't understand. Or that I've actually done something worthwhile 
> with lenses???
>
> Thanks!
> Bill
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts 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.


Any examples of using core.async offer!

2016-01-01 Thread Laws
I am looking for examples of some of the newer stuff in core.async. Has 
anyone used offer! in real code? If yes, why and how? Can you post an 
example of the code? 

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