Fork me on GitHub
#clojure-uk
<
2019-08-02
>
guy07:08:30

Morning folks!

guy07:08:26

β˜• time !

yogidevbear07:08:13

βœ¨β˜•βœ¨

πŸ˜„ 1
dharrigan07:08:48

I'm having a monster drink

guy07:08:13

oh 😱

guy07:08:21

what flavour

dharrigan07:08:32

Absolutely Zero

πŸ˜‚ 1
dharrigan07:08:18

I just realised that the name could 1. be the name of the drink or 2. the actual intensity of the "flavour"

πŸ˜„ 1
Ben Hammond07:08:35

> Blue Rat > "All the Energy of a Rat, > In a Can!"

yogidevbear07:08:27

I was going with intensity of flavour in my interpretation πŸ˜‚

Ben Hammond07:08:34

just started my second pot of coffee

guy07:08:16

I’m waiting for other colleagues to get here before i get my next β˜•

Ben Hammond07:08:47

can't leave the office unattended?

πŸ˜‚ 1
guy07:08:18

haha! We get free coffee upstairs, but I like to chat to people and see what they are doing.

guy07:08:30

More of a social thing + mini knowledge share

maleghast08:08:13

Morning everyone - greetings from North of The Wall...

Aleksander09:08:16

Morning everyone! Any ideas how to profile loading of a namespaces? Some vars get loaded when requiring a namespace which leads to long REPL start-up time - how can I work out what is to blame?

Ben Hammond10:08:50

comment them out?

Ben Hammond10:08:59

wrap them in timing ?

Ben Hammond10:08:45

namespace is loaded in the order that it is laid out on the page I believe

Ben Hammond10:08:58

so just println timestamps on the page?

Aleksander11:08:07

That would mean manually going into all the namespaces and putting printlns all over the place. I was hoping for a tool that would do that for me. It's a thought though. I'll try it out. Thanks!

maleghast11:08:42

Hello everyone...

maleghast11:08:42

If I needed to add another Maven repository to "find" artifacts that are not hosted on Sonatype/Maven Central, how would I do that..?

maleghast11:08:13

(java / maven n00b strikes again)

dharrigan11:08:43

We're using Gradle, migrated away from Maven.

maleghast11:08:11

@dharrigan - I am assuming that I am using Maven as I have a ~/.m2 folder..?

dharrigan11:08:23

well, gradle uses both πŸ˜‰

dharrigan11:08:25

but maven, yes

dharrigan11:08:31

do you have a settings.xml in your .m2 dir?

maleghast11:08:41

Er hold on...

maleghast11:08:25

just a folder called "repository"

dharrigan11:08:35

let me send you an example

dharrigan12:08:24

If I'm using aero and I've got a uberjar, is there a way to override the config.edn in the jar file with one passed in via the -D property?, i.e., "java -Dconfig="production.edn" -jar my-uber-jar.jar"?

guy12:08:26

I just pass that in as different main args

guy12:08:46

["/usr/bin/java", "-jar", "/usr/share/java/some-jar.jar", "default-profile",  "some-other-arg"]

guy12:08:06

(defn -main [profile system-key]
  (let [profile (-> profile edn/read-string keyword)
        system-key (-> system-key edn/read-string keyword)
        config (make-config profile)]
    (ig/load-namespaces config)
    (start-system! config system-key)))
Something like this

guy12:08:26

@dharrigan if that makes sense?

dharrigan12:08:31

yes, perfectly, thank you.

guy12:08:51

i was talking about profiles

guy12:08:05

Yeah so we have 1 config with dev/test/prod in it

guy12:08:22

:bootstrap-servers #profile {:default #env KAFKA_BOOTSTRAP_SERVERS
                                                              :dev "localhost:9092"
                                                              :test "localhost:9092"}

guy12:08:25

sort of thing

dharrigan12:08:34

If I add it to the classpath "java -cp .:uberjar.jar" it picks it up

dharrigan12:08:09

funky! πŸ™‚

πŸ‘ 1
alexlynham12:08:04

@dev964 in cljs apps you can get shadow to profile them for you

Aleksander12:08:14

it’s JVM …

maleghast12:08:51

@guy - sorry to bother you about this all over again, but I am having trouble doing interop with this class:


guy12:08:15

thats a package i think

guy12:08:24

or a few of them

maleghast12:08:16

I am trying to create an empty instance to then run the .open() method but Clojure won't let me

maleghast12:08:32

(as per the usage example)

maleghast12:08:22

(def testncfile (NetcdfFile.))

maleghast12:08:40

gets me this:

Show: Project-Only All 
  Hide: Clojure Java REPL Tooling Duplicates  (20 frames hidden)

2. Unhandled clojure.lang.Compiler$CompilerException
   Error compiling src/ecmwf/core.clj at (21:17)
   #:clojure.error{:phase :compile-syntax-check,
                   :line 21,
                   :column 17,
                   :source
                   "/home/oliver/Code/Cervest/ecmwf/ecmwf/src/ecmwf/core.clj",
                   :symbol new}
             Compiler.java: 7114  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6789  clojure.lang.Compiler/analyze
             Compiler.java: 7094  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6789  clojure.lang.Compiler/analyze
             Compiler.java:   38  clojure.lang.Compiler/access$300
             Compiler.java:  596  clojure.lang.Compiler$DefExpr$Parser/parse
             Compiler.java: 7106  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6789  clojure.lang.Compiler/analyze
             Compiler.java: 6745  clojure.lang.Compiler/analyze
             Compiler.java: 7180  clojure.lang.Compiler/eval
             Compiler.java: 7131  clojure.lang.Compiler/eval
                  core.clj: 3214  clojure.core/eval
                  core.clj: 3210  clojure.core/eval
                  main.clj:  414  clojure.main/repl/read-eval-print/fn
                  main.clj:  414  clojure.main/repl/read-eval-print
                  main.clj:  435  clojure.main/repl/fn
                  main.clj:  435  clojure.main/repl
                  main.clj:  345  clojure.main/repl
               RestFn.java: 1523  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   79  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:   55  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:  142  nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
                  AFn.java:   22  clojure.lang.AFn/run
               session.clj:  171  nrepl.middleware.session/session-exec/main-loop/fn
               session.clj:  170  nrepl.middleware.session/session-exec/main-loop
                  AFn.java:   22  clojure.lang.AFn/run
               Thread.java:  748  java.lang.Thread/run

1. Caused by java.lang.IllegalArgumentException
   No matching ctor found for class ucar.nc2.NetcdfFile

             Compiler.java: 2590  clojure.lang.Compiler$NewExpr/<init>
             Compiler.java: 2667  clojure.lang.Compiler$NewExpr$Parser/parse
             Compiler.java: 7106  clojure.lang.Compiler/analyzeSeq
             Compiler.java: 6789  clojure.lang.Compiler/analyze
             Compiler.java: 7094  clojure.lang.Compiler/analyzeSeq

guy12:08:19

ok how do you import it

guy12:08:23

also did you add it as a dep to the project?

maleghast12:08:41

...
(:import
   [ucar.nc2 NetcdfFile]
...)

maleghast12:08:57

yes I have added the dep to the project and all of that

guy12:08:06

can you send me that too

guy12:08:11

please πŸ™‡

maleghast12:08:48

:dependencies [[org.clojure/clojure "1.10.0"]
                 [edu.ucar/netcdf "4.3.22"]
                 [edu.ucar/grib "8.0.29"]]

guy12:08:29

hmm i cant pull that one is it restricted?

maleghast12:08:43

oh hold on...

maleghast12:08:34

You'll need this in project.clj or analogue thereof in other tools

guy12:08:45

lets switch to PM i think

maleghast12:08:45

:repositories [["unidata-all" ""]]