This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-18
Channels
- # announcements (43)
- # aws (28)
- # babashka (32)
- # beginners (80)
- # calva (13)
- # chlorine-clover (2)
- # cider (11)
- # clj-kondo (15)
- # cljs-dev (1)
- # clojure (151)
- # clojure-dev (11)
- # clojure-europe (11)
- # clojure-italy (3)
- # clojure-losangeles (3)
- # clojure-nl (4)
- # clojure-spec (20)
- # clojure-uk (58)
- # clojured (3)
- # clojuredesign-podcast (2)
- # clojurescript (37)
- # core-async (4)
- # core-typed (1)
- # cursive (53)
- # datascript (5)
- # datomic (26)
- # duct (23)
- # emacs (3)
- # fulcro (22)
- # graalvm (1)
- # jobs (2)
- # joker (11)
- # juxt (24)
- # lumo (1)
- # mid-cities-meetup (2)
- # nyc (1)
- # off-topic (54)
- # parinfer (1)
- # reagent (13)
- # shadow-cljs (16)
- # sql (9)
- # tree-sitter (9)
- # vim (9)
I'm attempting to create a knowledge graph of all the concepts necessary for Clojure fluency, for a new interactive learning platform. Does anyone know of any prior art in this space?
Chas Emerick used to have a Clojure Atlas that was like that http://clojureatlas.cemerick.com
@porkostomus I guess you know of the technology radar of Thoughtworks (not clojure related, but might be useful) and as for a platform to make the knowledge graph browseable I would recommend https://roamresearch.com/ it makes it easy to link concepts together. And it literally generates a graph. Also clojure toolbox would be related https://www.clojure-toolbox.com/
Hi! I’d like to make a static site with deps.edn (or possibly lein) and while I could assemble the pieces myself I wonder if anyone has an example? Some things I’d like are: • Hiccup • Asset optimization (renaming of css files for cache busting, minification of css etc) • Live reload support
Never tried it, but Bootleg seems to be doing (at least part) of what you want https://github.com/retrogradeorbit/bootleg
Interesting! Was more looking at deps edn aliases though that just run normal clojure namespaces
I find you find something with live reload and asset pipeline features, I would be curious to learn about this
For sure, I’ve had a setup in boot before that did many of these things and could probably just steal the code from the boot plugins. But would love to see some other examples of state of the art.
Oz has great support for SSG w/ live reload https://github.com/metasoarous/oz#static-site-generation
if you want to have static web page generator probably hugo
in go
is the best option. I know this is not Clojure, but right tool for the right job.
https://clojure.wladyka.eu/ - here is an example of my blog in hugo. I was trying crynogen before but IMO hugo win this game
I set up and use hugo
at work, it is nice if you want to write some markdown and get a website out of the other end
> it is nice if you want to write some markdown and get a website out of the other end this is what bootleg (written in Clojure, available as native binary) also can do. how does hugo compare to bootleg?
here's are some blogposts about bootleg: - https://epiccastle.io/blog/generating-xml-with-bootleg/ - https://nextjournal.com/plexus/advent-2019-part-18-exploring-bootleg
Take a look at this this clojurescript react wrapper: https://github.com/Lokeh/helix
It’s a different paradigm that reagent
@viebel Is that related to static HTML generation or are you reacting to something else?
I posted in the wrong slack group. My bad!
hard to compare hugo vs bootleg, because I didn’t use bootleg. hugo solve almost everything for you, but coding template is a nightmare. Debugging and documentation are pretty bad IMO, but many people think documentation is good. So expect debugging part and doc when coding template hugo is very good.
Hugo is a lot more "Rails"-like in that it's very conventions-based. There are pros and cons to this, but it does seem to mean themes work out of the box. You get a set of environmental vars based on TOML config files that can be accessed in your markdown. You have a top level dir with well-known folders and config TOML files: themes, static content, "content" (markdown files in a specific layout) and so on that you run hugo.exe on. If you want to do more than use/minorly edit an off-the-shelf template there's a lot(!) to learn. A divisive feature that sums up the hugo philosophy for me is auto-generating the nav bar for your website by using the dir hierarchy in the content directory. "Easy", not "simple" 🙂
so the downside of hugo is when I code template I feel I use brute force method to guess how it should be written, because errors messages and documentation don’t help. But expect of this, so writing posts, attach images, link structures etc. works pretty good
The author of bootleg wrote this recently: https://epiccastle.io/blog/generating-xml-with-bootleg/ (oops, was already posted above ^^^)
Thanks for the input! I have tried hugo before and it was great for a blog site but I’m making a simple landing page. And I also just think that hiccup is the best thing out there… Oz is also very nice but again more targeted towards blogs etc.
this is the source for the http://epiccastle.io site: https://github.com/epiccastle/epiccastle.io/blob/bce74a8baa757828e510dc463b8b054bf7b4f377/epiccastle.io/blog/index.clj
@retrogradeorbit ^ maybe this is useful feedback
I guess you can just generate one like it is done for the rss feed, I guess it's more low level and less opiniated
the classic static site generators do a lot of stuff for you, but also require you to learn their way and work within it. A bit like a framework.
bootleg is lighter. Its a clojure DSL tailored to processing and transcoding markup. There is no "magic" in it. It's up to you to tie it together however you want. It can be used for more than just static site generation for instance.
I think if you want the automatic magic you could choose one of the others. There is also a clojure static site generator more in the vein of those others called cryogen https://github.com/cryogen-project/cryogen
I was using cryogen before and I found it too limited for my needs. I don’t remember exactly why.
When I've had the same concerns I found Stasis was a good framework to build on. The https://thestrangeloop.com site is a stasis static site build
@alexmiller that definitely seems to fit my use case
@vikeri I noticed above you mentioned asset optimisation. That is something I am going to add to bootleg next. I want to front my site images with a CDN. And I want to minify images for thumbnails inside the code. So some of this will come soon.
I propose we take the static HTML discussion to #off-topic to not bug other Clojure people with this
How do I prevent data.csv
from creating "\"random-string\""
when a cell item is not a string and others are.
data.csv shouldn’t have any logic to replace cell’s value with some arbitrary string by default. Are you sure this string comes from it?
I have a csv file where everything is in a string. But then there are some that aren’t. The result is rows that look like this ["str-1" ... "\"str-2\"" ...]
When I apply read-csv
to is
sounds like your csv file contains something like this foo,"another foo",bar
Yes that’s it.
How does one usually handle this?
in that case data.csv will read "another foo"
as a string "\"another foo\""
to keep every bit of information.
The problem I have is converting it to keywords I end up with :"another-foo"
one option could be to apply some transformation logic over result of reading as it written here - https://github.com/clojure/data.csv#parsing-into-maps
How would I remove the \"
?
(defn normalize [st]
(clojure.string/replace st #"(^\"|\"$)" ""))
(normalize "\"foo\"")
(normalize "foo")
(defn normalize-csv [csv-data]
(map #(map normalize %) csv-data))
Thank you!
I definitely need to learn more about regex type stuff
Doesn’t seem to work on the actual csv data.
I think I’m just going to have to use strings 😅
Since your strings can contain spaces (and maybe other characters), going with raw strings and not using keywords sounds just fine.
Yes, if you know all possible values beforehand, and you have a genuine use case, then keywordize.
When you represent an entity as a Clojure map, then it makes most sense to keywordize IMO.
Doing the normalize
still gives me this. "\"foo"
It only removes one backslash
The RegEx above will only remove " from the beginning and end of the string. Might it be the other " is not at the end?
Because I can’t do a (get csv-data "foo")
It needs to be normalised
"�\"foo\""
I’m actually getting this when I copy from the repl to my editor.
And looking at the documentation, it looks like data.csv should remove the quotes for you. Something else is wrong.
I see. That could very well be my problem
I can’t even get the BOMInputStream working 😅
Unable to resolve classname: BOMInputStream
class clojure.lang.Compiler$CompilerException
And when I try to import it with (:import [
It fails
I just used clj-bom instead lol
https://clojurians.slack.com/archives/C06MAR553/p1582039369250600 Our of curiosity, @alexmiller do you use any automation to figure out the version MAJOR.MINOR.COMMITS?
yes, it's semi-manual in that it requires running script/build/revision to determine the version. I then use that in the jenkins maven release build step. also, it's important that it uses an initial tag "v0.0" on the first commit in the repo.
Ah, so the ship has sailed somewhat for Contrib projects that never started that way? Basically, all the ones I maintain.
I guess the GitHub UI shows the number of commits so that's a way to seed the version at any point...
no, this is git man
you can tag any commit at any time
Right, I just meant a quick way to get the total number of commits at some point in time.
it's been on my todo list for a long time to clean this up and fully automate it, but you know, too many things to do
what is the most useful tool or function to collect how long a function took to complete its task? I know about the function time
I mean, yeah, but I would like something more detailed than just
"Elapsed time: 100.284772 msecs"
you mean like a profiler?
That would be pretty nice
Java profilers like YourKit work but that's a big hammer
https://github.com/clojure-goes-fast/clj-async-profiler is a good flame graph style tool
I tried it but the flamegrapsh aren't explanatory to me
there is some explanation of the profiler and its use among one or more posts here, fwiw: http://clojure-goes-fast.com/blog/
https://github.com/ptaoussanis/tufte is pretty solid and easy to use for profiling.
I am looking at this Library and compared with Criterium. this seems to produce what I want. Now, I am having a hard time to understand few things. Could you help me?
Not sure how much I can help beyond the docs, but feel free to ask me anything.
You might also find this example to be very straighforward. https://github.com/markbastian/clojure-club/blob/8da2994c58292aceaa35436f3b1309c2fec00ab8/src/main/cljc/clojure_club/sudoku/core.cljc
it is more like, getting the pstats from the profiled form. I am getting a map where the numbers are just integers but tufte printed them in seconds.
Yeah, I always just look at the printed output.
What about visualVM?
Not ready for general announcement yet, but you can try it already: Reveal (Read Eval Visualize Loop) https://github.com/vlaaad/reveal
Any relationship to this project, other than the high level goals? https://clojureverse.org/t/introducing-shadow-cljs-inspect/5012
is it correct that you can use it with either socket repl or nrepl? that sounds pretty neat.
@U47G49KHQ minor point, your instructions say main
for socket repl, but perhaps you mean -main
? the latter worked here to bring up a window successfully 🙂
(btw, i had some javafx issue with a jdk 8 jvm, but starting a jdk 11 based jvm seemed to fix things)
Taking a look! > Reveal never touches evaluation results, even the metadata. Can you expand on why this is a problem?
@U0CMVHBL2 no relationship other than high level goals :)
@UG1C3AD5Z can you tell me what's the issue on javafx?
user=> (require '[vlaaad.reveal.prepl :as vrp])
Syntax error (ClassNotFoundException) compiling at (vlaaad/reveal/font.clj:1:1).
com.sun.javafx.tk.Toolkit
$ java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b07)
OpenJDK 64-Bit Server VM (build 25.232-b07-jvmci-19.3-b06, mixed mode)
Hey @U47G49KHQ, this looks super interesting! Really excited to see the direction you're taking here 🙂
@U4AE38Q0H thanks!
i am using Calva and trying to get back into clojure in general, but vscode/calva can’t seem to resolve defroutes
. what do i need to do to make vscode/calva pick it up?
Not sure, but in case you do not find an answer here, there is a #calva-dev channel that might be a more target rich environment for knowledgeable people.
I am using on of the libraries mentioned above (tufte) and the mean is display as 1.286475273E9
how could I evaluate this to an actual number?
the type is a double.
I answered to myself