This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (18)
- # babashka (19)
- # beginners (90)
- # biff (1)
- # calva (171)
- # cider (2)
- # cljsrn (3)
- # clojure (84)
- # clojure-australia (1)
- # clojure-europe (11)
- # clojurescript (48)
- # crux (10)
- # css (1)
- # data-science (8)
- # datalog (3)
- # emacs (16)
- # events (2)
- # fulcro (3)
- # jackdaw (31)
- # luminus (3)
- # malli (3)
- # off-topic (12)
- # onyx (3)
- # random (1)
- # remote-jobs (2)
- # shadow-cljs (88)
- # vim (1)
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?
Readers, writers, and anything with strings or characters do not deal in uninterpreted bytes, instead need an encoding (like utf8)
...and wow, for once the installation in Linux seems way more complicated than it does in Windows. Yikes. https://adoptopenjdk.net/installation.html#linux-pkg
I recommend using https://sdkman.io/! 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): https://clojurescript.org/guides/quick-start
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…?
I'm not trying to avoid anything. Just trying to follow the instructions here: https://adoptopenjdk.net/installation.html#linux-pkg
As for my version question, the ClojureScript Quick Start Guide calls for Version 8 or Version 11. Is that not correct? Outdated?
sudo apt update and then
sudo apt install openjdk-11-jdk — ISTR it was harder on Ubuntu 18?
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
? 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.
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.
(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?)
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 tend to have
~/.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!
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: https://gist.github.com/esciafardini/eb24ac1e30403943a24c18d883b9e50d
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.
Hi team, any useful materials on how to integrate Summologic Open Telemetry with clojure project?
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 https://translate.google.com/translate_tts?ie=UTF-8&q=67&tl=en&client=tw-ob?
Not sure if this will help, but you reminded me of this recent announcement: https://clojurians.slack.com/archives/C06MAR553/p1619112778011000
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 ?
Found https://github.com/kliph/figwheel-heroku and modified my project to fit into this one 🙂
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: https://github.com/microsoft/wslg https://www.google.com/amp/s/www.techrepublic.com/google-amp/article/linux-on-windows-this-new-upgrade-allows-you-to-run-graphical-apps-simply-and-effectively/
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 "127.0.0.1" 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
and you can specify the listen IP address with this REPL option
Waiting for browser to connect to
...and actually, after completing set-up of VcXsrv, I'm getting the exact same error...as 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
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.
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...
:0… can’t remember why I thought
:1. Anyways, glad you have that bit working.
google-chrome next, eh?
@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.
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.