Fork me on GitHub
#clojure
<
2021-09-11
>
West07:09:00

So I’m doing some java interop and I’m making my way through this example: https://github.com/apache/commons-imaging/blob/master/src/test/java/org/apache/commons/imaging/examples/WriteExifMetadataExample.java Now the problem I’m encountering, is my Clojure repl is saying there’s no add method for the class TiffOutputDirectory when clearly there is. Maybe I’m doing something wrong here?

(let [exifDirectory (.getOrCreateExifDirectory (TiffOutputSet.))]
  #_(.removeField exifDirectory (TiffTagConstants/TIFF_TAG_IMAGE_DESCRIPTION))
  (.add exifDirectory
        (TiffTagConstants/TIFF_TAG_IMAGE_DESCRIPTION)
        (java.lang.String. "dummy-desc")))

Alex Miller (Clojure team)07:09:11

that signature String... is a java varargs which is implemented in Java as a String[] and in Clojure you need to provide one of those explicitly

Alex Miller (Clojure team)07:09:22

(let [exifDirectory (.getOrCreateExifDirectory (TiffOutputSet.))]
  #_(.removeField exifDirectory (TiffTagConstants/TIFF_TAG_IMAGE_DESCRIPTION))
  (.add exifDirectory
        (TiffTagConstants/TIFF_TAG_IMAGE_DESCRIPTION)
        (into-array String ["dummy-desc"])))

West07:09:52

Thank you, now I know what to look for next time.

West10:09:36

I wonder if there's something wrong with apache.commons.imaging upstream. I can't even read metadata on my jpeg, yet exiftool retrieves it just fine.

pez10:09:02

Good morning! I am testing if making a GitHub Template project out of Rich 4Clojure would make sense. Before I change that repo I am testing the concept here: https://github.com/PEZ/pirate-lang. If anyone want to help me with testing if it makes sense, that would be great. 🙏 ❤️ Context: This repository is a proof-of-concept of developing Clojure programs, even GUI apps, in the browser (without installing anything at all), with full Interactive Programming support (Calva).

❤️ 2
oxalorg (Mitesh)10:09:54

Testing this out! 😁

🙏 2
pez10:09:54

It doesn’t make too much sense to copy this particular project. It’s better to fork it. But for Rich 4Clojure a copy might make sense? I’m undecided. Because maybe a regular clone makes most sense? And then people can pull in any changes we make. Hmmm…

2
oxalorg (Mitesh)10:09:56

WOW! Got this to work, this is by far the EASIEST way to get started with clojure :star-struck:

oxalorg (Mitesh)10:09:08

So basically if we include .gitpod.yml and .gitpod.dockerfile then we can turn any project into something like this? :thinking_face:

oxalorg (Mitesh)10:09:05

> But for Rich 4Clojure a copy might make sense? Yeah I think a fork makes most sense, people can keep merging from upstream and yet have their own commits in there somewhere. But how likely are complete beginners going to worry about getting the latest changes? :thinking_face:

👍 2
pez10:09:10

Almost any project. I'm running into problems with shadow-cljs webapps currently, because CORS. And even if I if I use https for it, there is still something funny. I'll need to make a good test project that the Gitpod people can have a look at, because probably they will need to fix something.

😮 2
pez10:09:41

And I haven't experimented with mobile apps yet.

pez11:09:31

From your excitement, @U013MQC5YKD , I wonder if maybe you have missed this thing? https://calva.io/get-started-with-clojure/

2
bananadance 2
oxalorg (Mitesh)11:09:45

This is amazing!! :star-struck:

Carsten Behring11:09:42

I tried it out, and it is nice in the sense of "zero install", so a beginner friendly way to start with Clojure The questions would be , what should be inside the "clj" files of the template project.

Carsten Behring11:09:45

But I agree with @U0ETXRFEW, that maybe this should be maintained by the Calva community. As GitPod works best with Calva for starting with Clojure

Carsten Behring11:09:23

But https://gitpod.io/#https://github.com/PEZ/get-started-with-clojure does not support "Swing" out of the box. So to add the VNC configuration to it, could be a good enhancement.

pez11:09:53

Oh, yes, I haven’t thought about that. Let’s see if we can find a way to do it without causing distraction.

pez11:09:33

Saw it. Amazing that it was issue 1! 😃

Carsten Behring11:09:18

It does not "distract", IMHO. in the sense of the VNC "preview" gets opened, but stays "decent" in background

Carsten Behring11:09:15

Thanks for the idea..🙂

pez12:09:53

Regarding ownage of template projects. There is an “official” template project that was created as a result of this Getting Started thing. I haven’t gotten around to update it. But I am planning to add deps-new, clj-new, babashka, nbb, and maybe some other tools to it. Along with instructions. I’m thinking of it as follow-up to getting started. When you are ready and eager to create your first project.

hiredman21:09:23

That looks like some kind of template variable

hiredman22:09:23

If it is you need to use the value that the template system is replacing {...} instead of the literal string

Timofey Sitnikov22:09:14

I am just using react interop.

hiredman22:09:35

Maybe try #clojurescript then

Timofey Sitnikov22:09:12

Ahh, yes, this is the clojurescript question.