Fork me on GitHub
Noah Bogart00:05:30

i have some text files that have invalid utf-8 in them. i'd like to write the contents of the files to new files. is that possible?

Noah Bogart00:05:18

using slurp converts the invalid utf-8 to be valid by changing the actual bytes


Yes, don't use slurp


Input and output streams read and write uninterpreted bytes


Readers, writers, and anything with strings or characters do not deal in uninterpreted bytes, instead need an encoding (like utf8)


Hey all. Quick Q: Which version of adoptopenjdk OpenJDK to install? 8 or 11?


...and wow, for once the installation in Linux seems way more complicated than it does in Windows. Yikes.


I recommend using! for your JDKs. It is so easy to install the right jdk on there and switch between them on a later stage, if it should become necessary.


This is (primarily?) for ClojureScript if it matters. Following this (for the 2nd time, now on WSL2 instead of Windows alone):


I guess I'll choose 11, but I'm totally lost with what to do with this step:


Configure AdoptOpenJDK's apt repository by replacing the values in angle brackets:



echo "deb  <codename> main" | sudo tee /etc/apt/sources.list.d/adoptopenjdk.list


Any reason to avoid the default openjdk11 version?


What on Earth do I put in place of <codename>?


In the documentation I see “You need the codename of your Debian or Ubuntu version. It is usually recorded in /etc/os-release and can be extracted on Debian by running cat /etc/os-release | grep VERSION_CODENAME | cut -d = -f 2 and on Ubuntu by running cat /etc/os-release | grep UBUNTU..”


Pretty sure I just did apt-get install openjdk11 when I stuck Java on my Ubuntu setup…?


(well, I think I’m on openjdk15 now)


I'm not trying to avoid anything. Just trying to follow the instructions here:


As for my version question, the ClojureScript Quick Start Guide calls for Version 8 or Version 11. Is that not correct? Outdated?

seancorfield05:05:47 says sudo apt update and then sudo apt install openjdk-11-jdk — ISTR it was harder on Ubuntu 18?


11 is the most recent LTS version so it’s a solid choice.


Good enough for me! Thanks!


17 will be the next LTS version. I was testing against 14 for ages but recently moved up to testing against 16 on my desktop and 15 on my laptop


What's the benefit to you to trying to be on something newer than the latest LTS.


? Affects whether your programs can be used by people who have newer JRE's installed? ...or maybe not...everything is baked into the program?


It just means that Oracle is providing Long Term Support so bug fixes are more likely to be provided over a longer period of time (given that non-LTS releases are only “current” for six months each).


The various non-Oracle groups are providing their own support/fixes/maintenance but it’s easier for LTS versions that are more long-lived.


Right, but what's the advantage of trying use something newer and non-LTS?


I test against recent versions so that it’s easier to move to the next LTS version when it drops (Early Access builds of 17 are already available and I test some of my projects against those already).


I mean I guess the next question is why move to the newest LTS version if the one you developed in originally is still supported?


Right now, a useful thing is the handling of “illegal reflective access” — for several releases, that’s been a warning by default. With 16, the default is to prohibit it, so you have to opt-in if your code (or the libs you use) depend on that feature.


Improved GC is the most common reason folks move to newer JVM versions.


(at work we are fairly proactive about using alpha/beta builds of stuff, at least for testing, so we can evaluate new features and — with Clojure at least — we’re nearly always on the very latest prerelease build in production: Clojure 1.11.0 Alpha 1 right now)


Re: Illegal Reflective Access — in 17 that will be an error with no opt-out, which is why testing against 16 is useful to flush out any instances of that. New Relic’s monitoring agent still relies on it (just just committed to fix it a few months back). Crux, the Clojure database, relies on it too.


OK. Maybe for ClojureScript being at the cutting edge is less valuable (just because of all the other bits that have to work with it?)


Anyway, V11 for me. 🙂


Oh...end still not quite in sight: "The Clojure tools require that either the java command is on the path or that the JAVA_HOME environment variable is set." <--- Important in Linux/Ubuntu?


I've only ever dealt with environment variables in Windows.


Bedtime here, but I'll check back here tomorrow. 🙂


I tend to have JAVA_HOME set ~/.profile but mostly because I have several JDKs installed and have env vars for all of those too so it makes sense to set JAVA_HOME there to whatever is my current default choice.


One more thing I'm running into. I need an X11 display...thing...for my browser within WSL2. You mentioned VcXsrv, but I ran across a (seemingly easier to install and possibly more secure) alternative called X410. VcXsrv still better? ...and downloading from SourceForge trustworthy?


As for the JAVA_HOME, I'll have to look into how to set it (as well as where to point it to).


OK. REALLY bedtime now. Thanks for the help so far. Will act on those two questions above tomorrow!

Edward Ciafardini13:05:19

Hello - I have been stuck on this for a bit and was hoping to gain some insight. I'm trying to implement bi-directional data binding in Reagent. When the user types in the fahrenheit input field, it should update with its own value and the celsius field should update with a conversion function. As of now, the fields do not update - they are static. Using Reagent for this - and my state for temps is in a separate file:


I think you need swap! to update your atom.


You are also missing a closing paren for (def temps

Edward Ciafardini16:05:08

closing paren missing was a copy/paste error. I've tried using swap! but kept getting error messages. Maybe I will try again. Thanks for the input.


Might be better to use a gist or pastebin if you want to share long code


Hi team, any useful materials on how to integrate Summologic Open Telemetry with clojure project?

Grzegorz Smajdor19:05:19

Hi, I want to learn my kids pronunciation so I’m thinking about writing some small cljs site that would show the word / number and call google translate for pronunciation - how to call this page in background;q=67&amp;tl=en&amp;client=tw-ob?


Not sure if this will help, but you reminded me of this recent announcement:

Grzegorz Smajdor19:05:27

right, I’ve seen that but just wondering if this also play it ?

Grzegorz Smajdor20:05:33

Another question, what changes needs to be done in order to deploy reagent template to heroku ? Is there an easy tutorial (or need to follow the heroku guide ?

Grzegorz Smajdor21:05:35

Found and modified my project to fit into this one 🙂

👍 3

Hello. Is there anyone here who has installed VcXsrv for used with WSL2 Ubuntu (20.04) for ClojureScript programming with Emacs CIDER (not sure if that matters)?


I have, but can't really help you... Forgot about it and I'm not on a windows anymore. However I've heard that wsl2 finally got a gui update, this means vcxsrv shouldn't be needed anymore. More info here:


Wow. After hours of combing through info on what X11 is and how to get VcXsrv working. LOl


When I try to run the Quick Start Guide hello world program on the ClojureScript website, though, I get the following error:


`clj --main cljs.main --compile hello-world.core --repl WARNING: When invoking clojure.main, use -M Failed to launch a browser: No X11 DISPLAY variable was set, but this program performed an operation which requires it. You can instead launch a non-browser REPL (Node or Nashorn). You can disable automatic browser launch with this REPL option :launch-browser false and you can specify the listen IP address with this REPL option :host "" Waiting for browser to connect to http://localhost:9000 ... ClojureScript 1.10.758`


clj --main cljs.main --compile hello-world.core --repl WARNING: When invoking clojure.main, use -M Failed to launch a browser: No X11 DISPLAY variable was set, but this program performed an operation which requires it. You can instead launch a non-browser REPL (Node or Nashorn). You can disable automatic browser launch with this REPL option :launch-browser false and you can specify the listen IP address with this REPL option :host "" Waiting for browser to connect to ... ClojureScript 1.10.758


...and actually, after completing set-up of VcXsrv, I'm getting the exact same if I wasted the last few hours. 😕


Just need to find out about this X11 DISPLAY variable I guess...or find some way to force WSL2 to use the newfangled feature you mentioned, @U7S5E44DB


...or is there a chance the Ubuntu 20.04 that goes into WSL2 doesn't even have any graphical browser (or any browser), and that's yet another thing I have to install?


OK, so I think I've set my DISPLAY variable correctly, and now I get a different error upon running


clj --main cljs.main --compile hello-world.core --repl


Failed to launch a browser: The BROWSE action is not supported on the current platform!


@U7S5E44DB That is only available in Insider builds of Windows right now (that's what I'm running). @UH5SE3NM9 and I already had this exact discussion yesterday (or the day before).


Unfortunately, since I updated to the latest WSL2 with Wayland/X11 support builtin, I've forgotten what I used to have DISPLAY set to (you need it on the standard WSL2 setup, but not on the new Wayland version).


Sounds like you've figured it out @UH5SE3NM9 -- now you need a browser installed on Liinux.


Was it DISPLAY=:1 in the end?


I think you should be able to sudo apt install google-chrome or something like that. That's the browser I have installed on WSL2/Ubuntu and it's what starts up automatically when I run a ClojureScript setup...


DISPLAY got set to an IP address with a trailing :0


Ah, :0… can’t remember why I thought :1. Anyways, glad you have that bit working. google-chrome next, eh?

FHE01:05:02's not working.

FHE01:05:31're saying the Ubuntu really didn't ship with a single browser on it?


...and just installing one will resolve this?


@U04V70XH6 Will I installed Chrome, and YIKES. Tons of errors when trying to run it (`google-chrome`):


libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast ...and many more errors, like 'Failed to connect to the bus [...], and 'Exiting GPU process due to errors [...]', and 'Passthrough is not supported'. Sigh.


I did talk to a few people in an Ubuntu chatroom, and they advised against running a Linux browser for this purpose, and said it should be possible to instead get the WSL2-Ubuntu-based program to talk to a Windows browser. (Their main argument was speed, which I don't care much about at this point, but if it would just work...) None of them were ClojureScript devs, though. What do you think?


O...M...G... Even with all those errors, the browser actually did run (under VcXsrv). I was just not noticing a tiny Chrome pop-up that demanded I decide whether to make Chrome my default browser and whether to send crash and usage reports to Google before, you know, actually launching the browser.


It completely freezes the CLI, though. And if I [Ctrl]+[c] to get the CLI back, the browser window disappears.


I just opened a 2nd Ubuntu CLI. Good enough I guess?


Right. When you start up cljs, google-chrome should launch from WSL2 automatically.


And yes, if you start a program from the command-line, it’s going to “freeze the CLI” unless you add & at the end of the command to run it in the background.


OK, thanks! I think I'll just let it freeze that CLI and open a new one. I guess I'd like to keep things as visible as possible. I still can't believe all those errors are normal/fine/ignorable, but I guess I'll move on to my next challenge.