Fork me on GitHub
#clojure
<
2018-05-06
>
dominicm09:05:38

Is there an existing term for the "state" of namespaces and vars?

stathissideris10:05:13

I’ve launched a new website! Do you want to help Clojure newcomers decide on their Clojure stack? Please share information on your magic mix here! http://www.clojurestacks.com/misc/2018/05/06/a-call-for-clojure-stacks.html

16
Shantanu Kumar15:05:19

This is a great initiative! The community needs something like this, especially in absence of frameworks.

simple_smile 4
dominicm10:05:00

@stathissideris s/boot.build/build.boot/ (or maybe the mistake is an intentional hint at how hard this stuff is)

stathissideris10:05:22

haha, not intentional, will fix asap, thanks

dominicm10:05:54

@stathissideris how do you intend to use this information? Just as a collection set?

stathissideris10:05:23

if I have enough I’ll probably do “review” posts

stathissideris10:05:32

looking at trends, summarising etc

asultanpur11:05:42

I am using Firebase Firestore and I need to pass a POJO to a Java method. One of the field needs to be annotated so that the server will populate the value. I can define a record like below.

(defrecord Message [text author ^ServerTimestamp timestamp])
But the clojure keywords which identify the fields don't get converted to strings. What are my options to convert the record to a POJO?

sobel12:05:11

If a particular Java interface is needed, there's nothing wrong with writing it in Java. Sometimes it's much easier achieve the result like that than manipulating Clojure's class generator.

noisesmith13:05:21

records are definitely not POJOs (deftype is closer but it isn't either), also ^Foo bar isn't an annotation, it attaches the hash map {:type Foo} as metadata on bar. So yeah, much easier to use java to make a POJO

asultanpur17:05:04

Thank you both. I will give that a try.

sobel13:05:57

I could use recommendations on authentication/authorization libraries for use with Undertow/Immutant. There is a nice pac4j demo but I'm not sure how much clj library code I'd end up writing in order to use that with a Clojure app.

robert-stuttaford13:05:39

@matt220 without additional context on your needs, i suggest you start with buddy

robert-stuttaford13:05:22

example usage in http://github.com/robert-stuttaford/bridge if you’d like to steal all the usual login/register/forgot/validate crap stuff 🙂

sobel13:05:44

oh yes, i would love to steal as much as possible. less is more 🙂

robert-stuttaford13:05:14

in return, may i ask that if you have any feedback - whether positive or negative - please share it with me?

sobel13:05:09

sure! i'm not afraid of github's message/feedback system. it might be a little while before i get into regular dev around it.

sobel13:05:47

hm, i wonder if Json Web Signature = JWT

sobel13:05:21

Hrm, no. RFC 7519 vs RFC 7515

abdullahibra16:05:59

how can i use lists like this ?

abdullahibra16:05:41

suppose i have a code which emit these type of structures and want to handle it, what is the best way?

abdullahibra16:05:02

actually the structure is "(data 2018-01-01)"

bronsa16:05:48

no matter how much you quote you can't have the reader read invalid tokens, 2018-01-01 is not a valid clojure token

bronsa16:05:01

use a string or an #inst

zaphodious17:05:29

Is there a simple way to sort a map with keys in a hierarchy, by that hierarchy so that keys in the same branch are grouped and sequential by most-parent to most-child?

bronsa18:05:10

sounds like you want a binary heap

mfikes17:05:00

That sounds like a topological sort on keys. Hrm.

samedhi18:05:03

https://gist.github.com/samedhi/7765488682548c4cd4f220b2b320b0d2#file-troubles-clj-L111 - I am having some trouble seeing a static method on the linked line clojure.lang.Compiler$CompilerException: java.lang.IllegalArgumentException: No matching method: addCallback, compiling:(/Users/stephen/inferno/src/inferno/server.clj:111:6). Not really familiar with the java side of clojure, any idea what I am doing wrong here?

samedhi18:05:55

inferno.server> (->> ApiFutures reflect :members (filter #(= (:name %) 'addCallback)) first)
#clojure.reflect.Method{:name addCallback, :return-type void, :declaring-class com.google.api.core.ApiFutures, :parameter-types [com.google.api.core.ApiFuture com.google.api.core.ApiFutureCallback], :exception-types [], :flags #{:public :static}}

samedhi18:05:45

Seems to be there…

samedhi18:05:55

I’mma genius. Forgot to pass the com.google.api.core.ApiFuture as the first argument there.

huthayfa19:05:37

@mfikes has you ever considered the difference between clucy and the datomic fulltext search. does the datomic have any benefits over that library

mfikes19:05:06

I don't have any experience with Datomic.

huthayfa19:05:40

okay thank you

joelsanchez20:05:01

afaik datomic's fulltext capabilities are limited and can't be configured in any way

joelsanchez20:05:25

yep, found my source https://docs.datomic.com/on-prem/schema.html > Fulltext search is constrained by several defaults (which cannot be altered): searches are case insensitive, remove apostrophe or apostrophe and s sequences, and filter out the following common English stop words:

joelsanchez20:05:19

simply using a language other than english or requiring case sensitivity makes the feature useless, so it has no more benefits than being easier to setup

qqq21:05:12

Let foo be my project root, so my clj files are in foo/src, and I'm starting my repl via foo$ boot repl Now, I want to setup a folder foo/my-dyn-classes/ which contains a bunch of *.class files -- and I want the Clojure repl to constantly (via watch) reload new classes from this directory. So when I add a new class to foo/my-dyn-classes/, wichin 0.1 seconds, I want my repl to reload said class into the repl. What is the simplest way to set this up?

huthayfa23:05:12

@joelsanchez but ES needs to run another process, it's not a library like lucene, right ?

joelsanchez23:05:37

yes but you can use lucene if you prefer, I was just saying that Datomic's use of Lucene is not configurable, and it's treated as an implementation detail

huthayfa23:05:59

yes datomic implementation is limited and if you need to search more than one filed it takes a lot of time, but i don't know why

Oliver George23:05:46

I note that Rich Hickey's request for clojure syntax support in Confluence has been marked "gathering interest". Perhaps there's hope for this if people vote.

Oliver George23:05:39

Alternatives have been proposed. Not sure any are a complete solution.