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?
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)
cool, thanks
(map (fn [x y] [x y])
[1 2 3 4 5]
[2 3 4 5])
Is this any clearer? Check out the clojuredocs on map
if you're not familiar with what it does for variable args :)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. 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
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 <https://adoptopenjdk.jfrog.io/adoptopenjdk/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>
?
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: 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?
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..”
https://otodiginet.com/software/how-to-install-java-openjdk-11-on-ubuntu-20-04-lts/ 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!
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
I think you need swap!
to update your atom.
You are also missing a closing paren for (def temps
Might be better to use a gist or pastebin if you want to share long code
noted & updated
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
right, I’ve seen that but just wondering if this also play it ?
🤷
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)?