OMG - most mathematicians cannot communicate for sh@t!!!
With non-mathematicians, or in general?
I get so tired of reading stuff written by them that relates to programming. Ugh!!!!
@eggsyntax: with me!
LOL
Curious to see the example that triggered that.
So much of what they write is utter nonsense hidden inside their pseudo-language
@eggsyntax: if it was limited to one or two examples that would be one thing. Over the past year I have read so many math-related texts that covered stuff I was coding. And when I then wrote the code I realized that the math texts were 95% bullshit.
Right now it is polygon mesh processing. Before that is was L-Systems and cellular automata.
Do any kind of google search on L-Systems and you will find stuff about the various kinds of systems: stochastic, parametric, context-sensitive, etc. all in capitalized letters like it was special. It can all be represented with functions that take arguments - no big deal. But they act like it is.
I think only about 1% of mathematical writing is of any value - the rest is crap. Not kidding.
Sure. You might enjoy some of the Mathbox author's presentations for an awesome counterexample, eg http://acko.net/blog/how-to-fold-a-julia-fractal/ I personally don't care for his writing on social issues at all, but his math & graphics presentations are pretty amazing.
He's not a mathematician proper, but a lot of his work is heavily math-based.
Yeah, it's nice to find someone worth reading, and they usually turn out to be good programmers as well.
@Kephale if you are lucky you can get the JVM to do the right escape analysis and allocate small fixed size 3D vectors (like the vectorz Vector3) on the stack. In which case they are pretty cheap
@mikera: I don’t quite get it, it looks like Vector3 in vectorz enumerates dimensions as x,y,z and then will translate to array vectors if you ask it to, if I’m not mistaken?
@mikera: or are you saying that the conversion is pretty cheap? (where the case that i believe we are talking about is, handling matrices Nx3 and doing a bunch of lin alg on those, then swapping back to a renderer which always expect something like Vector3)
relatedly, i’ll be gathering with a bunch of folks in germany in a few weeks to work on some code for GB/TB image analysis, and a few of these folks have different renderers (and a few are JOGL contributors)
the main Vector3 implementations folks are using seem to be vecmath’s Vector3f and org.apache.commons.math3.geometry.euclidean.threed.Vector3D
which upsets me, because the former is certainly being used on the JOGL side for rendering, and the latter is being used for a lot of mesh ops (because it has better math), but if you want to do work on meshes in real-time you’re paying unnecessary conversion overhead
Yeah my point is that the conversion is very cheap, assuming escape analysis works. You can do the bulk of processing on a big Nx3 array, and only switch to Vector3 implementaions for the final render call
(noting that most of the code is getting written in pure Java, but I’ll be writing Clojure wrappers) any thoughts on a way to consolidate (would be totally down for trying to convert people to vectorz)?
ah, gotcha
In some cases your renderer may accept double arrays directly, in which case you get a bonus :-)
oh touche...
sending over a native buffer, thats true
perhaps the suggestion i’ll push for is to stop doing meshops on data encoded in Vector3’s and instead do it all in matrices
converting JOGL’s Vector3’s sounds like a stretch anyway
i’d expect some resistance though, since quite a few things are more intuitive to program with Vector3s as the variables
but maybe that could be proven wrong….
I think it really depends on use cases. For stuff like particle simulations, I'd definitely use matrices because there are so many identical computations and you get a huge benefit from matrix ops. If you are just storing the co-ordinates of a higher level scene object, Vector3 s are probably more convenient and performance will be fine
I tried to write vectorz and core.matrix so that the two are fairly easy to convert between, e.g (add! x dx) will do the equivalent thing with both vectors and arrays
@mikera: well a lot of the discussions i’m involved in are about meshops, which i’d argue are something of a grey area there. lots of identical operations, but sometimes you need to go Nx3 -> (N+M)x3, and sometimes you might just be drilling down and expanding from a single initial set of Vector3s (like subdivision of faces type of stuff)
that is really the main use case that is in mind with all of this
but fine, i’ll swap my particle sims over to core.matrix 😉
oh, @eggsyntax have you poked at landofquil from this year’s clojurecup?
err more importantly, i saw someone bootstrap their rendering system with CLJS, so its fully in-browser with no serverside stuff
I took a quick look. Very cool :simple_smile:. I did a lot of Processing for years, and I’ve played with Quil, so it wasn’t worth going through the examples in detail, but I was impressed as hell that they pulled that off :simple_smile:
i’m just thinking cljs-mathbox + codemirrror + bootstrapped cljs for a full in-browser deal
For our project, we have to have serverside stuff, so we’re unlikely to go that direction…
aha, gotcha
But not because of the graphics side of it, by any means.
ya you just have tons of data on the backend
Yep. That kind of setup would be badass, though :simple_smile:
Be great for live-demoing MB :simple_smile:
im teaching a machine learning course in the spring, and the thought of being able to demo ML algorithms live (plus getting students up and running with no installation) is incredibly appealing
Oh shit, totally :simple_smile:
Has someone done a cljs wrapper for codemirror? That’d be handy :simple_smile:
If you were inspired to implement that, I suspect the MB author would be really psyched to use it.
i havent quite figured out how folks are doing it, but there are some git repos up that at least have compiled working demos
Cool
i mean i’d go straight to clojurescript, but yeah
okey, might have some questions coming your way about that then
Totes!
I looked into wrapping codemirror using cljs in order to do repl stuff in devcards.
@kephale I am working on a Clojure machine learning library with Jeff Rose and his company... Might be too early for your uses but it is going to be pretty awesome
Was about a month ago or so.
Hasn’t someone done an in-browser REPL already?
there’s your codemirror + 3D rendering
What I found was a variety of initial attempts at repl in the browser, but nothing rock solid. And I wanted it to work in devcards with omnext.
Gotcha
@mikera: ooo, hopefully more idiomatic than clj-ml? I definitely just call Weka directly these days. any particular algorithms you’re targeting?
I didn't find anything that I could easily incorporate into my own projects.
Kept hoping someone else would do it.
Maybe they have by now.
@eggsyntax: BTW, the thought is really just to smoosh that threejs-cljs-playground with cljs-mathbox-example to convince myself that it will work, and move on from there
@mikera: also, is it going to be CLJS friendly?
Totally, that makes sense!
Neural network / deeplearning stuff mostly. But should be extensible to other algos
ah ok, which would be good to be written by a matrix wizard such as yourself
Based on core.matrix, so should be portable to cljs once the core.matrix cljs support is complete
oh cool, i’d seen the CLJS issue on core.matrix, but wasn’t aware of how much of a push there was for that
You can check out the core.matrix cljs stuff here
Would appreciate any testing / sanity checking, I'm not really a cljs expert but I think Jeff has done a pretty impressive job
ooo, will do, that would definitely be useful for demoing ML stuff (noting that the neural net/deep learning part of the course comes at the end of the spring)
hey @eggsyntax i’ve run into a thing. does mathbox do some global stuff when it is loaded (specifically to the threeJS variables)?
given that i’m splicing cljs-mathbox into that threejs codemirror demo
just doing a require of [cljs-mathbox.mathbox :as mb]
seems to modify the existing threeJS render
Oh, at load time? Not that I recall, but I haven’t dug into that part of the MB internals. But lemme go verify that I’m not doing it at the cljs level.
like, i thiiiink it is actually still working, but just taking control of the viewport and BG color
It certainly does that at instance-creation time.
at one point i was able to see the edge of that sine curve, but i’m whittling it down, and it seems like when that require is called, it is at least setting background color
and resizing the viewport
yeah your stuff looks fine
i think it is [cljsjs.mathbox] that is doing something globally
was just wondering if you’d run into that, i can try to track it down
Yeah, I just double-checked that as well & I’m sure it’s not at the cljs-mathbox level. But yeah, it could be at the MB level.
Which would be annoying 😛
Have to afk for a bit, back within 30 or so.
Not anything I can do today, but if MB itself is doing something globally, it should be visible in https://github.com/unconed/MathBox.js/blob/legacy/build/MathBox-core.js
Also, if it is, I might be able to prevent it by delaying by delaying the require
until instance creation time.
yeah i’m poking at undoing that clearcolor and camera init stuff
no rush or anything, im just having fun
If you want to try delaying the require, I can test that here & send you a patch if you want. Of course, you’d have to switch to a local copy of MB to try it (instead of requiring from clojars), but that’s quite easy using checkouts
:
http://stackoverflow.com/a/7411652
mmm ❤️ checkouts
wasnt aware it worked for JS source too
I’m assuming so, but could be wrong.
afk
but it isnt a biggie, ill eventually figure out how to override that initialization stuff, and have to get an idea about that anyway
arrr actually checkouts requires a project.clj
You don’t have one? How are you requiring it?
Is this a Boot thing? 😉
oh no, i mean for Mathbox.js
the project being checked out needs a project.clj
Oh, I meant a local copy of cljs-mathbox.
oh i get it
That said, you might be able to do it with mathbox on cljsjs. https://cljsjs.github.io/
Hmm, you’d have to do a local checkout of the whole cljsjs repo, but that’s nbd.
You could clone it from here: https://github.com/cljsjs/packages
No, sorry, I’m mistaken — that doesn’t have a project.clj either, only a build.boot.
But again, I just meant checking out cljs-mathbox locally — wouldn’t let you dig into the MB internals, but you could do the dependency locally and then delay the require in there.
mmm
i think it would probably be useful to just figure out how to get at the threejs variables from mathbox
since there will be a need to modify the overlay/renderer to fit the codemirror pane anyway
If you really want to do the Mathbox.js dependency, locally though, I know how you could do that (it’s what I did before I put it on cljsjs.
no not really
i just want the threejs variables : P
Yeah, you ought to be able to do that just in your own code by getting them on your MB instance.
mmm, there is a bit of cljs learning curve going on here too 😉
& just use the JS interop functions. ie (.-theDesiredProperty my-instance)
and (.theDesiredMethod my-instance)
.
oh - for property, there we go
thank yoU!
Totally! Coming from clj, I remember losing a couple of hours trying to figure out why the hell (.theDesiredProperty my-instance)
wasn’t working… 😡
Really useful article on JS interop here: http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/