This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-28
Channels
- # ai (1)
- # beginners (190)
- # boot (24)
- # cider (43)
- # cljsjs (3)
- # cljsrn (29)
- # clojars (6)
- # clojure (310)
- # clojure-dev (6)
- # clojure-nl (6)
- # clojure-russia (11)
- # clojure-spec (66)
- # clojure-uk (95)
- # clojurescript (103)
- # clojurewerkz (2)
- # core-async (9)
- # cursive (4)
- # datomic (5)
- # hoplon (163)
- # lein-figwheel (52)
- # off-topic (6)
- # om (6)
- # onyx (42)
- # perun (8)
- # re-frame (16)
- # reagent (10)
- # ring (7)
- # ring-swagger (1)
- # rum (1)
- # slack-help (2)
- # uncomplicate (1)
- # untangled (80)
hi when i run boot task which does (comp (aot) (repl {:server true ...})(new-system)(target))
, and i have a core.clj file with only a -main
function and (:gen-class :name myns.Core)
, i can see the Core.java file created, but i cannot instantiate it, I get java.lang.NoClassDefFoundError: Could not initialize class myns.Core
, i found that the issue to be java.lang.NoSuchMethodError: clojure.lang.Util.loadWithClass(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
which is referring to the clojure.lang.Util.loadWithClass method. I see that it is part of clojure lang and it has that method there, why is it not finding it? is it because the clojure.jar (or any of the dependencies) are not copied to the target directory?
i can instantiate other classes from http://java.xxx package or any other ones from the libraries, but I cannot instantiate the gen-class created ones
any pointers on finding/understanding the issue would be greatly appreciated. It has taken the whole day but i can still not figure out what is causing it! 😞
About replacing strings in files, I got a task working, but on 250 files it takes about 2500ms while sed
does it in 300ms. Probably doing something very inefficiently. Code review welcome:
@vikeri What does the updated script look like?
@juhoteperi I updated it in place, so it’s the one that I pasted
Ah okay. Seems okay then, slurp and string replace performance is probably fine for smaller files.
If it had to work with larger files, like hundedrs of megabytes, I think storing the file as string would get slow. Then you'd use something that doesn't require storing the whole file on memory, like streams or memory mapped IO. But I think it would be lots of work and probably no noticeable difference for small files.
I think sed works by reading the files line by line
Alright, yeah this is just sort of a hack for now. Hopefully we’ll sort out something more robust in the future.
there's also my favorite unix util, rpl
: https://linux.die.net/man/1/rpl
decomplecting sed
🙂
I need to run both a (cljs :optimizations :advanced)
for selenium testing and (cljs :optimization : none)
for my development repl/server. I want both of these to trigger when I save a file. I am outputting the result of both into /target
. Is there any way to specify that dev should go to /target
and selenium testing should go to /selenium_target
?
Basically I have some concern that maybe having two separate task writing to the same directory might be introducing errors...
@samedhi there is a target task
you can pass a dir
@thedavidmeister Thanks. That did it. I actually just skipped over it because I looked at the help for target and got -d, --dir PATH Conj PATH onto the set of directories to write to (target)
Which probably shows a lack of understanding, but that seems to say that you are adding (`conj`) a path into the set of directories written to (target)
.
@samedhi i think the -d
option for target
actually specifies the directories to write the current fileset into. So to get the fileset written into selenium_target
that pipeline should end with (target :dir "selenium_target")
http://ingesolvoll.github.io/2016/12/26/how-boot-solved-our-ftp-upload-problem.html
great article about making an FTP task
covers almost everything about making a task, except pods