datavis

meow 2015-12-24T00:11:57.000780Z

OMG - most mathematicians cannot communicate for sh@t!!!

eggsyntax 2015-12-24T00:12:21.000781Z

With non-mathematicians, or in general?

meow 2015-12-24T00:12:22.000782Z

I get so tired of reading stuff written by them that relates to programming. Ugh!!!!

meow 2015-12-24T00:12:40.000783Z

@eggsyntax: with me!

eggsyntax 2015-12-24T00:12:43.000784Z

LOL

eggsyntax 2015-12-24T00:12:50.000785Z

Curious to see the example that triggered that.

meow 2015-12-24T00:13:18.000786Z

So much of what they write is utter nonsense hidden inside their pseudo-language

meow 2015-12-24T00:15:00.000787Z

@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.

meow 2015-12-24T00:15:49.000788Z

Right now it is polygon mesh processing. Before that is was L-Systems and cellular automata.

meow 2015-12-24T00:18:43.000789Z

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.

meow 2015-12-24T00:20:05.000790Z

I think only about 1% of mathematical writing is of any value - the rest is crap. Not kidding.

eggsyntax 2015-12-24T00:22:36.000791Z

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.

eggsyntax 2015-12-24T00:23:13.000792Z

He's not a mathematician proper, but a lot of his work is heavily math-based.

meow 2015-12-24T00:23:45.000793Z

Yeah, it's nice to find someone worth reading, and they usually turn out to be good programmers as well.

2015-12-24T08:35:34.000794Z

@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

2015-12-24T14:45:46.000795Z

@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?

2015-12-24T14:48:56.000796Z

@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)

2015-12-24T14:52:34.000797Z

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)

2015-12-24T14:53:02.000798Z

the main Vector3 implementations folks are using seem to be vecmath’s Vector3f and org.apache.commons.math3.geometry.euclidean.threed.Vector3D

2015-12-24T14:54:26.000799Z

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

2015-12-24T14:55:48.000800Z

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

2015-12-24T14:55:50.000801Z

(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)?

2015-12-24T14:56:04.000802Z

ah, gotcha

2015-12-24T14:57:08.000803Z

In some cases your renderer may accept double arrays directly, in which case you get a bonus :-)

2015-12-24T14:57:21.000804Z

oh touche...

2015-12-24T14:57:44.000805Z

sending over a native buffer, thats true

2015-12-24T14:58:48.000806Z

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

2015-12-24T14:59:18.000807Z

converting JOGL’s Vector3’s sounds like a stretch anyway

2015-12-24T15:02:06.000808Z

i’d expect some resistance though, since quite a few things are more intuitive to program with Vector3s as the variables

2015-12-24T15:02:19.000809Z

but maybe that could be proven wrong….

2015-12-24T16:08:37.000810Z

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

2015-12-24T16:09:58.000811Z

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

2015-12-24T17:07:10.000813Z

@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)

2015-12-24T17:08:45.000814Z

that is really the main use case that is in mind with all of this

2015-12-24T17:09:56.000815Z

but fine, i’ll swap my particle sims over to core.matrix 😉

2015-12-24T17:13:44.000816Z

oh, @eggsyntax have you poked at landofquil from this year’s clojurecup?

2015-12-24T17:14:36.000817Z

err more importantly, i saw someone bootstrap their rendering system with CLJS, so its fully in-browser with no serverside stuff

eggsyntax 2015-12-24T17:14:43.000818Z

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:

2015-12-24T17:15:13.000819Z

i’m just thinking cljs-mathbox + codemirrror + bootstrapped cljs for a full in-browser deal

eggsyntax 2015-12-24T17:15:37.000820Z

For our project, we have to have serverside stuff, so we’re unlikely to go that direction…

2015-12-24T17:15:43.000821Z

aha, gotcha

eggsyntax 2015-12-24T17:15:48.000822Z

But not because of the graphics side of it, by any means.

2015-12-24T17:16:02.000823Z

ya you just have tons of data on the backend

eggsyntax 2015-12-24T17:16:18.000824Z

Yep. That kind of setup would be badass, though :simple_smile:

eggsyntax 2015-12-24T17:16:52.000825Z

Be great for live-demoing MB :simple_smile:

2015-12-24T17:17:26.000826Z

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

eggsyntax 2015-12-24T17:18:08.000827Z

Oh shit, totally :simple_smile:

eggsyntax 2015-12-24T17:18:38.000828Z

Has someone done a cljs wrapper for codemirror? That’d be handy :simple_smile:

eggsyntax 2015-12-24T17:19:03.000829Z

If you were inspired to implement that, I suspect the MB author would be really psyched to use it.

2015-12-24T17:19:04.000830Z

i havent quite figured out how folks are doing it, but there are some git repos up that at least have compiled working demos

eggsyntax 2015-12-24T17:19:16.000831Z

Cool

2015-12-24T17:19:17.000832Z

i mean i’d go straight to clojurescript, but yeah

2015-12-24T17:19:41.000833Z

okey, might have some questions coming your way about that then

eggsyntax 2015-12-24T17:19:52.000834Z

Totes!

meow 2015-12-24T17:29:09.000835Z

I looked into wrapping codemirror using cljs in order to do repl stuff in devcards.

2015-12-24T17:29:52.000836Z

@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

meow 2015-12-24T17:29:54.000837Z

Was about a month ago or so.

eggsyntax 2015-12-24T17:30:19.000838Z

Hasn’t someone done an in-browser REPL already?

2015-12-24T17:30:42.000840Z

there’s your codemirror + 3D rendering

meow 2015-12-24T17:31:29.000841Z

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.

eggsyntax 2015-12-24T17:31:38.000842Z

Gotcha

2015-12-24T17:32:03.000843Z

@mikera: ooo, hopefully more idiomatic than clj-ml? I definitely just call Weka directly these days. any particular algorithms you’re targeting?

meow 2015-12-24T17:32:12.000844Z

I didn't find anything that I could easily incorporate into my own projects.

meow 2015-12-24T17:32:46.000845Z

Kept hoping someone else would do it.

meow 2015-12-24T17:32:51.000846Z

Maybe they have by now.

2015-12-24T17:33:24.000847Z

@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

2015-12-24T17:33:41.000848Z

@mikera: also, is it going to be CLJS friendly?

eggsyntax 2015-12-24T17:33:50.000849Z

Totally, that makes sense!

2015-12-24T17:34:20.000850Z

Neural network / deeplearning stuff mostly. But should be extensible to other algos

2015-12-24T17:34:52.000851Z

ah ok, which would be good to be written by a matrix wizard such as yourself

2015-12-24T17:34:55.000852Z

Based on core.matrix, so should be portable to cljs once the core.matrix cljs support is complete

2015-12-24T17:35:24.000853Z

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

meow 2015-12-24T17:37:43.000854Z

https://github.com/joakin/cljs-browser-repl

2015-12-24T18:19:38.000856Z

You can check out the core.matrix cljs stuff here

2015-12-24T18:21:09.000859Z

Would appreciate any testing / sanity checking, I'm not really a cljs expert but I think Jeff has done a pretty impressive job

2015-12-24T19:33:53.000861Z

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)

2015-12-24T19:58:06.000862Z

hey @eggsyntax i’ve run into a thing. does mathbox do some global stuff when it is loaded (specifically to the threeJS variables)?

2015-12-24T19:58:36.000863Z

given that i’m splicing cljs-mathbox into that threejs codemirror demo

2015-12-24T19:58:43.000864Z

just doing a require of [cljs-mathbox.mathbox :as mb]

2015-12-24T19:58:55.000865Z

seems to modify the existing threeJS render

eggsyntax 2015-12-24T19:59:53.000866Z

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.

2015-12-24T19:59:55.000867Z

like, i thiiiink it is actually still working, but just taking control of the viewport and BG color

eggsyntax 2015-12-24T20:00:14.000868Z

It certainly does that at instance-creation time.

2015-12-24T20:00:31.000869Z

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

2015-12-24T20:00:45.000871Z

and resizing the viewport

2015-12-24T20:01:13.000872Z

yeah your stuff looks fine

2015-12-24T20:01:38.000873Z

i think it is [cljsjs.mathbox] that is doing something globally

2015-12-24T20:01:48.000874Z

was just wondering if you’d run into that, i can try to track it down

eggsyntax 2015-12-24T20:02:23.000875Z

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.

eggsyntax 2015-12-24T20:02:37.000876Z

Which would be annoying 😛

eggsyntax 2015-12-24T20:02:58.000877Z

Have to afk for a bit, back within 30 or so.

eggsyntax 2015-12-24T20:28:37.000878Z

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

eggsyntax 2015-12-24T20:29:26.000880Z

Also, if it is, I might be able to prevent it by delaying by delaying the require until instance creation time.

2015-12-24T20:44:22.000881Z

yeah i’m poking at undoing that clearcolor and camera init stuff

2015-12-24T20:44:37.000882Z

no rush or anything, im just having fun

eggsyntax 2015-12-24T20:52:38.000883Z

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

2015-12-24T20:55:28.000885Z

mmm ❤️ checkouts

2015-12-24T20:55:36.000886Z

wasnt aware it worked for JS source too

eggsyntax 2015-12-24T20:56:00.000887Z

I’m assuming so, but could be wrong.

eggsyntax 2015-12-24T20:56:01.000888Z

afk

2015-12-24T20:57:22.000889Z

but it isnt a biggie, ill eventually figure out how to override that initialization stuff, and have to get an idea about that anyway

2015-12-24T21:09:05.000890Z

arrr actually checkouts requires a project.clj

eggsyntax 2015-12-24T21:19:50.000891Z

You don’t have one? How are you requiring it?

eggsyntax 2015-12-24T21:20:00.000892Z

Is this a Boot thing? 😉

2015-12-24T21:24:40.000893Z

oh no, i mean for Mathbox.js

2015-12-24T21:24:57.000894Z

the project being checked out needs a project.clj

eggsyntax 2015-12-24T21:25:21.000895Z

Oh, I meant a local copy of cljs-mathbox.

2015-12-24T21:25:42.000896Z

oh i get it

eggsyntax 2015-12-24T21:26:10.000897Z

That said, you might be able to do it with mathbox on cljsjs. https://cljsjs.github.io/

eggsyntax 2015-12-24T21:26:36.000899Z

https://clojars.org/cljsjs/mathbox

eggsyntax 2015-12-24T21:26:58.000900Z

Hmm, you’d have to do a local checkout of the whole cljsjs repo, but that’s nbd.

eggsyntax 2015-12-24T21:27:28.000901Z

You could clone it from here: https://github.com/cljsjs/packages

eggsyntax 2015-12-24T21:28:26.000903Z

No, sorry, I’m mistaken — that doesn’t have a project.clj either, only a build.boot.

eggsyntax 2015-12-24T21:29:20.000904Z

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.

2015-12-24T21:29:36.000905Z

mmm

2015-12-24T21:30:11.000906Z

i think it would probably be useful to just figure out how to get at the threejs variables from mathbox

2015-12-24T21:30:36.000907Z

since there will be a need to modify the overlay/renderer to fit the codemirror pane anyway

eggsyntax 2015-12-24T21:30:42.000908Z

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.

2015-12-24T21:30:53.000909Z

no not really

2015-12-24T21:30:59.000911Z

i just want the threejs variables : P

eggsyntax 2015-12-24T21:31:38.000912Z

Yeah, you ought to be able to do that just in your own code by getting them on your MB instance.

2015-12-24T21:31:59.000913Z

mmm, there is a bit of cljs learning curve going on here too 😉

eggsyntax 2015-12-24T21:33:07.000914Z

& just use the JS interop functions. ie (.-theDesiredProperty my-instance) and (.theDesiredMethod my-instance).

2015-12-24T21:33:25.000915Z

oh - for property, there we go

2015-12-24T21:33:26.000916Z

thank yoU!

eggsyntax 2015-12-24T21:34:23.000917Z

Totally! Coming from clj, I remember losing a couple of hours trying to figure out why the hell (.theDesiredProperty my-instance) wasn’t working… 😡

eggsyntax 2015-12-24T21:34:50.000918Z

Really useful article on JS interop here: http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/