Fork me on GitHub
#hoplon
<
2017-01-08
>
candera14:01:24

@meeli Sorry. What I meant is that i have a dim recollection that some browsers are stricter about SVG tags appearing in the correct XML namespace. When I was working on that part of the program, Hoplon wasn’t awesome about getting the namespace correct. Maybe for that reason, I switched to using the DOM API to create some of my SVG elements. But it has been too long for me to remember clearly. My app does work correctly in Firefox.

tbrooke21:01:23

@jumblerg I think someone asked this but are you updating clojars as you go or should we down load UI from github and use a local jar ?

xssive22021:01:34

Does anyone know a resource that provides enough java knowledge to be able to understand java interop from books like living clojure, joy of clojure, etc..? All those books assume knowledge of java. I'm trying to start a database and the instructions to start the server are in java. I've acted like a pattern generator to try and convert it to clojure, but trial and error leads me nowhere. I seem to lack knowledge of methods, classes, static members. And CIDERs autocompletion just suggests that I'm far off. For a H2 database I need the following incantation to start the server. I already did a (import org.h2.tools.Server) and CIDER autocompletion provides me with some clues.. But this: server = Server.createTcpServer().start(); I don't know how to do. (def shizzle (Server)) lead to something, but that just gave me an object I can't seem to use. Thanks in advance

mynomoto21:01:58

@xssive220 don't start the server for h2, I only refer to a file. You want clojure.java.jdbc to connect to the db.

xssive22021:01:28

@mynomoto I know, but that gives me embedded mode. I want server mode, since I'll have multiple clients. using tcp however, seems to require the database to be started first.

xssive22021:01:20

@mynomoto I had it working in embedded mode and that is indeed ridiculously simple

wasserspiegel21:01:12

My first hoplon/New Year project is a Klondike/Solitaire game https://wasserspiegel.github.io/hoplon-demos/klondike/

mynomoto21:01:12

@xssive220 sorry, I wasn't aware that there is a server mode for h2.

mynomoto21:01:34

@wasserspiegel that is pretty cool!

xssive22021:01:58

@mynomoto I now run the server jar from the cli with -tcpAllowOthers, and then my project connects happily to port 9092. Getting it to run on the same jvm requires a java incantation 😞

xssive22021:01:35

@wasserspiegel Darn... That's pretty cool!

xssive22021:01:36

@wasserspiegel You are already ruining my productivity 😂

candera22:01:10

@xssive220 That expression can be written as (.start Server/createTcpServer). Note: fewer parens than Java. 🙂

candera22:01:23

Oh, darn. I screwed it up.

candera22:01:38

(.start (Server/createTcpServer). Note: same number of parens as Java. 😉

candera22:01:05

But the trick there is that (ClassName/methodName …) is how you invoke a static method.

candera22:01:44

As far as resources, I believe Eric Normand has or is working on a class at http://purelyfunctional.tv that is Java ideas for Clojure programmers.

candera22:01:59

That said, the number of things you have to know is, in practice, very very small.

candera22:01:55

Sorry - hope that didn’t come across as “It’s easy!” It’s not, clearly. But the hopeful thing is that the number of concepts to master is not huge.

xssive22022:01:03

@candera Thank a lot. There's methods, static methods, static fields, instance fields. I don't understand when to use a dot a slash or dot-slash. And the fact that I'm shoving my first production application out the door and I can't do it without learning about those is honestly kind of frustrating. Up till now I was never bothered by clojure being a hosted language. I'll find out what a static member is and such, because this is going to bite me in the b*tt in the future. I need some recipe for browsing javadocs and translating what I read into clojure incantations. Thanks for the help. On the number of concepts thing: Books like the joy of clojure showed me the underlying simplicity and it's all remarkably elegant. After you enlightened me, I guess I should have a talk with my REPL 🙂

xssive22023:01:16

@candera Alas... I keep getting no such field exceptions.

wasserspiegel23:01:25

@xssive220 sorry for the distraction 🙂 I thought it is a nice addition to the demos, I probably should have read something about card game development first...

xssive22023:01:18

@wasserspiegel Nope... this is great. Especially if you didn't read up first. I found it's easy to throw things together in hoplon. Smooth sailing (almost) all the way 🙂

xssive22023:01:58

@wasserspiegel This is what stimulates newcomers. We can't have enough of these.