Re: My first Clojure program (and blog post about it)

2015-08-10 Thread kirby urner
> Your way "works" because basically you are building two extra vectors
> which are implicitly getting destructured, but that's syntactically noisy
> and also a lot of extra computational work that is unneeded.
>
> --
>

Thanks!

I cleaned it up a bunch:

https://github.com/4dsolutions/synmods/blob/master/qrays.clj

Kirby

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: My first Clojure program (and blog post about it)

2015-08-08 Thread kirby urner
On Thu, Aug 6, 2015 at 2:35 PM, Mark Engelberg 
wrote:

> Right, so if you use protocols, you'd just have one name:
> add, sub, norm, len, neg
> and use for both vectors and quadrays, rather than a v-add / q-add, etc.
>
>
I have done this vis-a-vis Quadrays and XYZrays as both are types of vector
with essentially the same API.

(defprotocol VectorOps
  (add [this other])
  (sub [this other])
  (len [this])
  (neg [this])
  (norm [this]))

https://github.com/4dsolutions/synmods/blob/master/qrays.clj


> If there are things that apply only to vectors and not quadrays, you could
> make those their own protocol (or individual functions).
>
>
However I didn't take norm out of the interface though, even though it
really only applies to one of the types.

I had XYZray just return "this".  Bad idea?

(defrecord XYZray [OX OY OZ]
   VectorOps
   (norm [this] (this))
   (neg [this](XYZray. (- OX) (- OY) (- OZ)))
   (len [this](Math/sqrt (+ (* OX OX)(* OY OY)(* OZ OZ
   (add [this other] (XYZray. (+ OX (:OX other))
 (+ OY (:OY other))
 (+ OZ (:OZ other
   (sub [this other](add this (neg other


> And of course, multimethods are yet another way to achieve polymorphism in
> Clojure.  Multimethods would really shine if you want to get into
> complicated mixtures of adding vectors and quadrays, etc., or dispatch on
> something other than the type (e.g., maybe pre-normalized quadrays dispatch
> to something more efficient).  Protocols (like traditional OO) can only
> dispatch on the type of the first input.
>

That may be next for me.

If I initialize some plain vanilla Vector with 3 coordinates, it could
recognize that as XYZ and output a vector of that type, or of either type
given they're inter-convertible.


>
> One other code simplification tip: you can destructure in the parameter,
> e.g., if you were to rewrite q-neg to be a plain function as opposed to a
> protocol, you could still get convenient access to the member variables by
> writing it like this:
> (defn q-neg [{:keys [OA OB OC OD]}] (->Quadray (- OA)(- OB)(- OC) (- OD)))
>
> http://www.john2x.com/blog/clojure-destructuring/
>
>

Before:

(defn qray-to-xyzray
  [qray]
  (let [[a] [(:OA qray)]
[b] [(:OB qray)]
[c] [(:OC qray)]
[d] [(:OD qray)]
[x] [(* (/ 1 (Math/sqrt 2))(+ (- (- a b) c) d))]
[y] [(* (/ 1 (Math/sqrt 2))(- (+ (- a b) c) d))]
[z] [(* (/ 1 (Math/sqrt 2))(- (- (+ a b) c) d))]]
(XYZray. x y z)))


After:

(I bet I could use destructuring to shorten the above quite a bit)


>
>
> On Thu, Aug 6, 2015 at 1:52 PM, kirby urner  wrote:
>
>>
>>> Also, don't forget to explore the test framework versus global defs and
>>> print statements.
>>>
>>> --
>>>
>>
>>
Right, still in my queue to get to that.  Very helpful.

Kirby

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reality check: EC2 + Ubuntu + Atom (from GitHub) + Clojure?

2015-08-07 Thread kirby urner
On Fri, Aug 7, 2015 at 7:29 AM, kirby urner  wrote:

>
> So in my Python for kid-newcomers, my back end has been
>
> (A)  for 2D:  POV-Ray, the free ray tracer (povray.org, CompuServ
> license) and
> (B)  for 3D:  a lot of Visual Python (vpython.org) -- once it came down
> the pike, with VRML before that (the Ux is quite similar -- rotate colorful
> shapes in real time, that your program defined).
>
>
Actually (quick addendum), POV-Ray does stellar 3D stills... it's the Time
dimension that gets between 2D and 3D (as I'm leaving out a true Z given
screens are really flat).  With VPython as with VRML you have that
"twirling a polyhedron with a mouse" experience, whereas in 2D, it's a
"still life".

Kirby

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reality check: EC2 + Ubuntu + Atom (from GitHub) + Clojure?

2015-08-07 Thread kirby urner
On Fri, Aug 7, 2015 at 5:02 AM, Gary Verhaegen 
wrote:

> Sorry for steering the discussion away from tooling, but have tou looked
> at Racket and the research in teaching programming that's been going on
> around it for the past ~20 years?
>
> One of their findings was that beginning with functional programming (1
> semester FP followed by 1 semester OOP) yielded better OOP prpgrammers than
> a full year of OOP teaching. Some of them have recently branched out from
> the original scheme-base syntax to a more python-like one. If you're
> designing a curriculum for teaching FP and OOP I believe it's worth
> investigating.
>
> And to steer back towards tooling, you could then use DrRacket, which is a
> fantastic beginner's editor with debugger and code analyzer integrated.
>
>
Thanks for these thoughts.

By way of background...

Yes, I checked into DrScheme / PLT before it became Racket.  At the time I
was on a pilgrimage, away from my commercial bread and butter language, the
lowly Xbase, and seeking "computer graphics" (so I could do more geometry
on the side).  I went to Java then Scheme, then became enamored of J which
I suppose is functional (its heritage is APL).  Then Python (while still
earning my bread and butter with Xbase i.e. VFP9).

We stereotype kid-newcomers to programming as demanding to "write games"
but that's putting words in their mouths, a lot of 'em anyway, as many'd be
just as happy with some fancy visuals, both moving and still.  Fractals (as
in Mandelbrots and Mandelbulbs) fit here.

A language like Mathematica can provide 2D and 3D visuals. Our school had
pre-OST (O'Reilly) roots in working with Wolfram, round tripping those
notebooks twixt calc students and their teachers (this was before I
joined).

But in using a dedicated ray tracer (in this curriculum, POV-Ray) you're
less confined to "mathematical" topics i.e. go ahead and do photo-realistic
art (plus it's free, which Mathematica only is on a Pi, right?).

So in my Python for kid-newcomers, my back end has been

(A)  for 2D:  POV-Ray, the free ray tracer (povray.org, CompuServ license)
and
(B)  for 3D:  a lot of Visual Python (vpython.org) -- once it came down the
pike, with VRML before that (the Ux is quite similar -- rotate colorful
shapes in real time, that your program defined).

Here's a summary of how I'd mix 'em for my classrooms in Portland Oregon
(often under the auspices of saturdayacademy.org):

http://www.4dsolutions.net/ocn/pymath.html

The individual stills you get from a POV-Ray may be strung together into
movies ("cartoons" lets call 'em).

So I'm really explaining the movie industry and the fact of "render farms"
behind rendered movies like Shrek and Toy Story.  For kid-newcommers, this
information is relevant as most of 'em are already avid movie and TV
program consumers -- and we want them to be makers of same (active not just
passive -- both produce *and* consume).

Back to your points:

Saying good grounding in FP makes for better OOP programmers does indeed
sound credible.

But in a way that can be a matter of style i.e Python may be used to
emphasize immutability, or to create a bog of mushy objects all secretly
connected underground by tendrils.  Python is like clay in that way.

So for example, with my Quadrays (a defrecord in Clojure), when I negate
one, I could have had it "stay the same vector, just now facing the other
way" i.e. give it mutable state.

But if direction can change and yet we say it's "the same", then what
*can't* change?  It gets messy when you let "the same things" mutate.

So I of course don't do it that way.

The VectorOps protocol is about returning new immutable Quadrays (or XYZ
vectors), Clojure style.  -v1 creates a new Vector, versus changing the
state of v1.

Saying FP -> OOP is a useful pattern maybe somewhat subversive of what's
preached in the strict FP camp?

Some of the most theological say you won't need a life after FP, i.e. why
would we even bother with an OOP language?  Would anyone still care for
them?  Saying FP makes good OOP coders begs the question of whether we want
any OOP coders.  Some FPers are eager to stomp 'em out perhaps?  That's
extremist, I agree.

Realistically, the two camps are meeting in the middle as Python can be
used in FP-ish ways, plus there's Hy, which overlays a LISP syntax,
targeting the same VM. https://github.com/hylang/hy

That Clojure shares a JVM with OOP's Java is the ultimate truce, right?  So
we could just make it more a circle or spiral (of styles more than just
languages) and go FP -> OOP -> FP -> OOP... in some kind of chaotic
oscillation. Isn't that what we mean by "inter-op" already?  :-D

Kirby

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For m

Re: Reality check: EC2 + Ubuntu + Atom (from GitHub) + Clojure?

2015-08-06 Thread kirby urner

To recap this thread:  I started by looking at GitHub's Atom as an IDE for 
Asynchronous Learning Engine (ALE), a name I'm using for an 
Open Source project.  I'm interested in Clojure + Java + Python as
an example "flight path" through our "curriculum space".

Turns out Eclipse is a strong candidate if a single IDE is required.  

IntelliJ with Cursive is where I'm starting, great beginning!  I use
PyCharm at work.

I now have Python and Clojure both implementing a special kind 
of vector class using PyDev for Python and CounterClockwise 
for Clojure:

http://mybizmo.blogspot.com/2015/08/eclipse-for-python-java-clojure.html

Just screen shots at this point.  

I'm finding much to like in the ease of use department.  

Eclipse remains a strong contender though of course Emacs can do all this 
too.

Kirby
 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: My first Clojure program (and blog post about it)

2015-08-06 Thread kirby urner
>
>
> Also, don't forget to explore the test framework versus global defs and
> print statements.
>
> --
>


Excellent feedback Mark, thank you so much!

This is exactly what I was hoping for.  I will be simplifying said code
accordingly and posting it back.

A great way to learn!

I do think I might add the same protocol to a regular XYZ Vector defrecord
type, but then that would mean changing the names maybe to v-add, v-sub
etc. v for vector.

I have intra-conversion twixt these exotic Quadray and XYZ coordinates,
already in Python.

Plus with vectors ** we expect:  angles between any two; polar coords;
scalar grow-shrink; something like dot and cross product

So I could flesh out the one protocol (inherits from Java interface I
understand) and show how both vector notations share the same API.  That
would seem an appropriate use of the syntax maybe?

Related literature:  http://www.dividedspheres.com/

Kirby


** in this implementation a "vector" is always tail-originating at some
place we locally define as "the origin", so any to vectors will have the
same origination point, meaning a "central angle" is implied.  For
polyhedrons around the origin we build with Edges, each defined with two
vectors; and with Faces (sets of Edges).  A similar notion of vector (vs.
line segment) is found in
http://www.amazon.com/Elementary-Linear-Algebra-Stewart-Venit/dp/0534951902






You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/RvHQPfBKJuM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: My first Clojure program (and blog post about it)

2015-08-06 Thread kirby urner


On Thursday, July 30, 2015 at 6:38:11 PM UTC-7, kirby urner wrote:
>
>
>
> On Thu, Jul 30, 2015 at 6:14 PM, Leif wrote:
>
>> This still seems very verbose to me.  I think it is because the 
>> definition of "open," "opposite," and "closed" are implicit in the great 
>> big blocks of arithmetic you are doing.  I think a useful exercise would be 
>> to define edges in terms of points, and maybe faces in terms of edges and 
>> an `face?` function.  Then define different properties like `open?` in 
>> terms of functions on edges.
>>
>>
> Yes, in the ecosystem I'm coming from, edges are indeed defined by two 
> points, points being likewise vectors (in the coordinate system sense).  
>
> An Edge is defined by two Vectors e.g.  (def a (length (Edge v0 v1))).  
> For vectors, I sometimes use non-XYZ 4-tuples called Quadrays (check 
> Wikipedia).  
>
>
Since last week I've been studying defrecord and defprotocol.  

Again, I expect this is overly verbose, any feedback welcome.  

I posted a link to the Python version I'm working from at the end.

"""
(cl) K. Urner, MIT License 2015
Python -> Java -> Clojure curriculum
2D + 3D Graphics:  Martian Math
Topic:  Quadrays
http://www.grunch.net/synergetics/quadintro.html

*https://en.wikipedia.org/wiki/Quadray_coordinates*


*Asynchronous Learning Engine (Open Source project)*


*http://controlroom.blogspot.com/2015/08/asynchronous-learning-engine-ale.html*""";

(ns test-project.quadrays)

(defprotocol Ops
  (q-add [this other])
  (q-sub [this other])
  (q-len [this])
  (q-neg [this])
  (q-norm [this]))

(defrecord Quadray [OA OB OC OD]
  Ops
  (q-norm [this]
(let [[a b c d] [(:OA this) (:OB this) (:OC this) (:OD this)]
  [x] [(min a b c d)]]
  (Quadray. (- a x) (- b x) (- c x) (- d x

  (q-neg [this] (q-norm (Quadray. (- 0 (:OA this))
  (- 0 (:OB this) )
  (- 0 (:OC this))
  (- 0 (:OD this)

  (q-len [this] (let [[a b c d] [(:OA this) (:OB this) (:OC this) (:OD this)]
  [k] [(/ (+ a b c d) 4)]
  [t0 t1 t2 t3] [(- a k) (- b k) (- c k) (- d k)]]
  (* (Math/sqrt 2.0)
 (Math/sqrt (+  (* t0 t0) (* t1 t1) (* t2 t2) (* t3 t3))

  (q-add [this other]
(q-norm (Quadray. (+ (:OA this) (:OA other))
  (+ (:OB this) (:OB other))
  (+ (:OC this) (:OC other))
  (+ (:OD this) (:OD other)

  (q-sub [this other] (q-add this (q-neg other

(def v0 (Quadray. 1 0 0 0))
(def v1 (Quadray. 0 1 0 0))
(println str (q-sub v0 v1))
(println str (q-add v0 v1))
(println str (q-neg v1))
(println str (q-len v1))


Link to Python version: 
  https://mail.python.org/pipermail/edu-sig/2015-August/011291.html

Kirby


>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reality check: EC2 + Ubuntu + Atom (from GitHub) + Clojure?

2015-08-03 Thread kirby urner
On Mon, Aug 3, 2015 at 1:25 PM, Mark Engelberg 
wrote:



> The main reason I mentioned Intellij was because I didn't know whether
> there was a satisfactory Python plugin for Eclipse and you said you wanted
> to do all three languages on one IDE.
>
>

Gotcha.  The answer is yes, it's called PyDev and even our older version
meets our needs.  Per the link to course content (we open source the
textbooks, just as one may browse in a college book store, to see what the
profs are using) our needs in the IDE department are modest.

A current weakness is our not using Eclipse's native ability to back end
into version control.  There's only so much one wants to cover when billing
the course as Python, plus we're meeting our students as solo coders, not
as dev teams.  ALE could take it all a lot further, in terms of course-ware
topology.

http://courses.oreillyschool.com/  (recap of our learning environments:
CodeRunner, Eclipse, and Visual Studio)

I'm really new to IntelliJ but a happy user of Pycharm, same JetBrains
behind both.

Even if we stick with Eclipse I could see advising students to check out
that platform.

To use a particular IDE is not to be mean or dismissive to all others.  On
the contrary, I admire vim while using it sparingly, just like I'm not
often in a jazz bar on the piano (after closing time maybe, if I know the
owner).

New Yorker says StarBucks is actually good for the local shops because it
schools people in the culture, via something known and mainstream (i.e.
safe) and that gives them the confidence to branch out and get off the
beaten track.

Likewise a glancing but not unpleasant experience with Eclipse could feed a
next generation of Emacs users.  It's more the whole idea of "dashboards
for developers" that we want to get across, and Eclipse is a good example,
both multi-language and free.



> In my role as a tutor to bright comp sci kids, I was using Clojure for
> personal use several years before I was willing to start teaching it to
> kids, mainly because when Clojure first came out, emacs was pretty much the
> only game in town, and I knew it wouldn't go well if I tried to teach new
> programming language concepts to kids while simultaneously inflicting upon
> them an alien editor that behaves completely differently from every other
> editor they've ever used.  So I waited until Counterclockwise reached
> sufficient maturity before incorporating Clojure into my tutoring.
>


My trajectory is similar in that I've used Python with middle through high
school aged, most recently with Saturday Academy, piloting what I call
Martian Math in my four-aspect Digital Math (the others being Supermarket,
Casino, and Neolithic.

I know that sounds weird but the Neolithic-to-Martian axis gives like a
timeline (math meets history) with a science fiction view of the future.
The other axis, with Supermarket the persistence layer (inventory,
bookkeeping) and Casino representing risk, investment, probabilities.
Makes a nice package in that you can fit anything in.

http://wikieducator.org/Digital_Math  FYI.

Anyway, just saying, like you I've not ventured to teach any LISP-family
language and in my post to edu-...@python.org recently (another listserv)
it was all about { Python -> Java -> Clojure } sequence with the former in
high school and the latter not expected until college unless you want an
accelerated experience.

Here's that post:
https://mail.python.org/pipermail/edu-sig/2015-August/011290.html

In other words, just to sketch a possibility (one among many):

(A) use what Phillips-Andover uses, Mathematics for the Digital Age and
Programming in Python, with that high schoolish age group, then

(B) move to Java,

(C) then cap with Clojure, which coming from Java means you'll appreciate
about interop, i.e. you know your heritage.

Not saying that's the best or only trajectory, just that's a good example
of what I imagine the ALE (Asynchronous Learning Machine) --  with some
Open Source license -- could provide the bare bones for.

In favor of the { Python -> Java -> Clojure } track is that it gives the
full dose of OO on the way to FP, and it's in climbing out to that level
that you feel more control over heritage in OO.  I don't think OO is over,
but that the discipline of FP will keep OO from decaying as quickly. :-D

With Clojure, the Java stack is still yours (I understand about the .NET
version) -- and not just the JVM but the libraries.

Plus (maybe not everyone knows this here):  Python likewise comes in a
flavor that targets the JVM as well:  Jython, open source from Oracle.

Seems a promising ecosystem all round!  Thanks for engaging (both here and
on edu-sig).

Kirby

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@google

Re: Reality check: EC2 + Ubuntu + Atom (from GitHub) + Clojure?

2015-08-03 Thread kirby urner
On Mon, Aug 3, 2015 at 8:18 AM, Fluid Dynamics  wrote:

> On Monday, August 3, 2015 at 10:26:34 AM UTC-4, kirby urner wrote:
>>
>>
>> (A) when a student hacks on a Python or Java project and want's mentor
>> feedback, it's *not* a matter of the mentor remoting in to the student
>> instance or accessing the students V: drive.  Rather, we have software
>> infrastructure by the talented Michael Long that zips up the entire Eclipse
>> project and sends it to the mentor's computer, where it unzips.  The mentor
>> can run the code, find bugs, make changes, without touching the student's
>> original.  The mentor can send the whole project back, though usually
>> quotes and comments are sufficient.
>>
>
> Oh, dear God. You *do* know what used to happen to any unix box where
> "Help! I'm a newb, please help me, why won't my script work" was reliably
> synonymous with "sudo root" except for not needing the root password, right?
> Better that it be the virtual box in the cloud than the mentor's computer
> if that should ever happen.
>

Good points!

Yeah we don't do that.  The provisioning of an Ubuntu instance in the cloud
(or a Windows instance in today's version of the ALE) is all about not
helping students with complicated configuration / installing; all platform
specific -- and they don't need sudo rights on the instance we give them,
which instance vanishes without a trace when coursework is done.

There's no huge tech support staff necessary to this picture, since the
only umbilical cord to the learning environment is RDP (remote desktop),
which is platform specific.  But is also the only piece we have to help
with, many free and easy solutions available (I use CoRD from a Mac OSX
(where I'm root if I wanna be -- but this is not part of ALE).

As a mentor I'm on this very same setup in the cloud (running ALE, in-house
version -- we call it Nano). I'm doing my job in a cloud instance via
remote desktop to a rack space somewhere.

In role of  "mentor" I've never been root and don't need to be; Eclipse
fills my entire desktop, no need to touch Windows guts at all -- Terminal
takes me to my Linux sandbox (where I'm just another user, like the
students are)).

We do, on the other hand, encourage students to SFTP their own work back to
local platforms where they take responsibility for setting up their own
setup, mirroring ours if they like (Eclipse + MySQL... basically LAMP) or
going their own way.

It's not for us to tell them what to do when home alone.



>
> PS:  another thing ALE does not do in my world is give mentors a way to
>> assign letter grades or compute grading curves or whatever.
>>
>
> On the other hand, if a mentor grades on a curve, he deserves anything
> that happens to his computer from running students' code there. :)
>
>
We let mentors pick their own pronoun. :-D

I'm trying to stay open minded about curve grading.  I was a classroom
teacher in the brick and mortar sense, both full and part time, and I know
there's such a thing as healthy competition.

I also know a lot of our students really like a tough coach who takes no
nonsense, but on the other hand there's no comparison, no standing out as
better or worse.

Sometimes I'll say "good job, most students average three attempts to get
this -- par for the course -- you got a hole in one" (no I'm not a golfer
in real life) but there's no public scoreboard, no "grades" one has to live
with (or live up to, as the case may be).

Everyone gets the same certificate.

Good grades helped get me into Princeton though (from the Philippines),
i.e. those of us at the high end of the curve have always liked the curve,
or benefited.  But I see no reason to bake it into ALE at a primitive
level.  Could be an add on:  curve-grade.clj  :-D

Kirby

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reality check: EC2 + Ubuntu + Atom (from GitHub) + Clojure?

2015-08-03 Thread kirby urner
On Mon, Aug 3, 2015 at 3:02 AM, Colin Fleming 
wrote:

> For Clojure nothing beats emacs + CIDER
>>
>
> As a clearly biased participant here (I develop Cursive) I'd like to
> politely disagree with this. Lots of people are switching to Cursive from
> Emacs, including many that you've heard of. Obviously different strokes for
> different folks etc, but a lot of experienced Emacs users are finding
> enough additional value in Cursive (and potentially other environments, but
> I can't really speak to them) that they're willing to go through the pain
> of switching editing environments to get it. A lot of people also switch
> from one to the other depending on what they're doing - lein and boot
> provide enough of a layer that this is not painful and allows you to use
> the strengths of one or the other.
>
> Obviously I'm delighted if people are happy with the tools that they're
> using, whatever they may be, but I do think it's time to lay to rest the
> myth that Emacs is the only (or unequivocally the best) environment for
> Clojure. That hasn't been true for a long time - there are lots of good
> options.
>
>
CURRENT USE CASE:

I appreciate all this feedback re choice of editor.  My situation is I've
spent the last few years a working school that teaches Java, Python, Ruby
etc. using either:

(1) browser plugins for code editing and bash shell access (beginner level)
or

(2) Eclipse IDE. [1]

We provision each student using Eclipse with a Windows machine in the
cloud, back ended into a Linux file system (mapping a Windows V:-drive --
for Virtual -- to the student's sandbox).

So they're using Eclipse on client Windows (we pay license fees for that)
back ending into Linux.

One reason we do that is "realism" i.e. we're simulating / emulating a
plain vanilla US corporate cubicle (one could argue), but the main reason
is Visual Studio.  We want to use that too and that's Windows-only.

HYPOTHETICAL FUTURE:

In the hypothetical model I'm working on, based on all of the above, we
replace Windows with Ubuntu in the cloud, on an EC2 instance.

Then for Python do something with I-Py Notebooks and VPython for 2D + 3D
graphics, but then it's starting to look like maybe staying with Eclipse
for Java and Clojure, Ruby and Rails...  not Atom, as I was originally
considering. [2]

However, provisioning students with tools they'll use for a few months then
move on, is quite different from making a personal choice as to one's
favorite IDE.

So even now my comments to students involve mentioning other IDEs they
might want to try, i.e. there's no evangelism for any specific IDE, though
there is evangelism for Open Source, this being O'Reilly of OSCON fame. [3]

REQUIREMENTS BASED ON CURRENT DESIGN:

Two other pieces of this puzzle:

(A) when a student hacks on a Python or Java project and want's mentor
feedback, it's *not* a matter of the mentor remoting in to the student
instance or accessing the students V: drive.  Rather, we have software
infrastructure by the talented Michael Long that zips up the entire Eclipse
project and sends it to the mentor's computer, where it unzips.  The mentor
can run the code, find bugs, make changes, without touching the student's
original.  The mentor can send the whole project back, though usually
quotes and comments are sufficient.

(B) when a student submits work to the mentor, notification goes to a queue
with a time stamp.  The mentor pulls student work off the queue, which is
what triggers the zip / unzip transfer, making the whole process quite
decoupled and asynchronous.  In other words, each mentor is presented with
a "dashboard" of queued submissions per course.  I currently teach four
courses whereas other mentors have taught many more.

So I spend hours every day in Eclipse, looking at one student project after
another, either passing the project or sending it back with feedback for
more revision.

OPEN SOURCE ANGLE:

What I'm brainstorming is a similar workflow migrated from Windows clients
to Ubuntu instances on EC2, meaning a rewritten workflow.  The parent
company has neither the in-house skills nor the funds to accomplish this
overhaul and indeed all the aforementioned capability was intact prior to
our school's purchase.

A typical move in such situations is to wonder if there's a nucleus here
that could help a lot of similar enterprises i.e. what if we package up the
workflow engine as some Open Source product (I'm calling it Asynchronous
Learning Engine or ALE) such that any school or corporate training division
could do the same:  provision training studios in the cloud pre-wired to
facilitate student-mentor workflows as described above? [4]

My motivation for sharing these details here is precisely to start gauging
the interest level around such an Open Source project, which I think could
be of help to colleges and universities as well.   There'd be room for lots
of value added, i.e. the curriculum itself, the actual leaning materials,
are not specified by the ALE.

SUM

Re: Reality check: EC2 + Ubuntu + Atom (from GitHub) + Clojure?

2015-08-02 Thread kirby urner
Having done some more research, I see Atom 1.0 is still very new 
which likely accounts for the a paucity of replies, an no Youtubes
on the topic (that I could find).

Anyway, it's not a set in stone requirement -- in the virtual school 
of my dreams [1] -- that every course should use the same IDE, just 
it's nice when that's an option.

I'm using IntelliJ with the Cursive plug-in for Clojure currently, having
tried LightTable before (for which I did find a demo with Clojure).

The old Mac OSX I'm running on my Mac Air won't even boot Atom, 
so I've got a ways to go exploring that particular configuration. [2]

I'll be on the lookout for demo Youtubes.  It's a little inconvenient 
searching on Atom + Clojure given the "atom" concept is core to
Clojure as a part of the language. :-D

Kirby

[1]  
http://controlroom.blogspot.com/2015/08/asynchronous-learning-engine-ale.html

[2]  Atom 1.0 requires Mac OSX 10.8 or above, but will run in Ubuntu (so 
that's 
a VM option).

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reality check: EC2 + Ubuntu + Atom (from GitHub) + Clojure?

2015-07-31 Thread kirby urner
My day job is teaching Python, but in a school that teaches much else
besides.  We're small and I'd say prototypical given how quickly the
technology is evolving.

The description in the blog post below is science fiction from my angle,
but I'm aiming for a lot of realism:

http://worldgame.blogspot.com/2015/07/pws-personal-workspace.html

What I'm scheming is a track through the CS part of STEM that goes:

Python -> Java -> Clojure 

and then leaves it to each student to build out from there, having 
tackled both OO and FP mindsets.  Jumping into the C family or 
into another LISP family language would be feasible after such a 
sequence.

Given that sequence as a premise, I'm imagining a unified Ux and
wonder if I'm on the right track here.  Any feedback welcome.

Kirby


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: My first Clojure program (and blog post about it)

2015-07-30 Thread kirby urner
On Thu, Jul 30, 2015 at 6:33 PM, Amith George  wrote:

>
> Hi,
>
> From a cursory glance, I didn't really understand the domain, so the
> function names I used in my rewrite might seem silly. But I wanted to
> illustrate that there is a lot of repetition in your code. Also discrete
> functions (with proper names) can make the code easier to grok.
>
> https://gist.github.com/amithgeorge/15b1cb607c32d39b70c7
>


Excellent!  Lots to study here.  I'm still picking up some of the basic
grammar.  Very helpful.

Thanks for taking the time to show me some ropes!

Kirby

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: My first Clojure program (and blog post about it)

2015-07-30 Thread kirby urner
On Thu, Jul 30, 2015 at 6:14 PM, Leif  wrote:

> This still seems very verbose to me.  I think it is because the definition
> of "open," "opposite," and "closed" are implicit in the great big blocks of
> arithmetic you are doing.  I think a useful exercise would be to define
> edges in terms of points, and maybe faces in terms of edges and an `face?`
> function.  Then define different properties like `open?` in terms of
> functions on edges.
>
>
Yes, in the ecosystem I'm coming from, edges are indeed defined by two
points, points being likewise vectors (in the coordinate system sense).

An Edge is defined by two Vectors e.g.  (def a (length (Edge v0 v1))).  For
vectors, I sometimes use non-XYZ 4-tuples called Quadrays (check
Wikipedia).

A Polyhedron is defined as a set of faces, going around clockwise or
counter, giving all the vectors to that face.  Vectors are "tail
originating" by definition i.e. their tails are all anchored at the origin.

Here's my Clojure code after some recent refactoring, minus the redundant
bits I've not changed yet.

I was 2nd powering all the six edge lengths each time inside the three
sub-functions (components of Volume) whereas really Volume should just do
that once.

That's all my let form does anymore:

(ns test-project.synmods)

(defn add-open
  [a2 b2 c2 d2 e2 f2]
  (+ (* f2 a2 b2)
 (* d2 a2 c2)
 (* a2 b2 e2)
 (* c2 b2 d2)
 (* e2 c2 a2)
 (* f2 c2 b2)
 (* e2 d2 a2)
 (* b2 d2 f2)
 (* b2 e2 f2)
 (* d2 e2 c2)
 (* a2 f2 e2)
 (* d2 f2 c2)))

(defn add-closed
  [a2 b2 c2 d2 e2 f2]
  (+ (* a2 b2 d2)(* d2 e2 f2)(* b2 c2 e2)(* a2 c2 f2)))

(defn add-opposite
   [a2 b2 c2 d2 e2 f2]
   (+ (* a2 e2 (+ a2 e2)) (* b2 f2 (+ b2 f2))(* c2 d2 (+ c2 d2

(defn Volume
   [edges]
   (let [[a2 b2 c2 d2 e2 f2] (map (fn [x] (* x x)) edges )]
 (Math/sqrt (*
  (-
(- (add-open a2 b2 c2 d2 e2 f2)(add-closed a2 b2
c2 d2 e2 f2) )
(add-opposite a2 b2 c2 d2 e2 f2))
  0.5

(println (format "All edges D=1, Volume: %s" (Volume [1.0 1.0 1.0 1.0
1.0 1.0]) ))

; A Module
; Fig. 986.421
; http://www.rwgrayprojects.com/synergetics/s09/figs/f86421.html

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: My first Clojure program (and blog post about it)

2015-07-30 Thread kirby urner


Thanks to excellent feedback, I now realize my code was overly verbose, a 
common phenomenon among beginners in many a computer language.

As an example, the newer version replaces this:


===
>
> (ns test-project.synmods)
>
> (defn add-open
>   [edges]
>   (let [[a b c d e f] edges
> [a2 b2 c2 d2 e2 f2] (map (fn [x] (* x x)) edges )]
> (do
>   (reduce + [
>  (reduce * [f2 a2 b2])
>  (reduce * [d2 a2 c2])
>  (reduce * [a2 b2 e2])
>  (reduce * [c2 b2 d2])
>  (reduce * [e2 c2 a2])
>  (reduce * [f2 c2 b2])
>  (reduce * [e2 d2 a2])
>  (reduce * [b2 d2 f2])
>  (reduce * [b2 e2 f2])
>  (reduce * [d2 e2 c2])
>  (reduce * [a2 f2 e2])
>  (reduce * [d2 f2 c2])])
>   )))
>
>


... with this:




(defn add-open
  [edges]
  (let [[a b c d e f] edges
[a2 b2 c2 d2 e2 f2] (map (fn [x] (* x x)) edges )]
(+ (* f2 a2 b2)
   (* d2 a2 c2)
   (* a2 b2 e2)
   (* c2 b2 d2)
   (* e2 c2 a2)
   (* f2 c2 b2)
   (* e2 d2 a2)
   (* b2 d2 f2)
   (* b2 e2 f2)
   (* d2 e2 c2)
   (* a2 f2 e2)
   (* d2 f2 c2))
  ))

Much simpler!  Thank you.  I'll look into testing features.  

In my Python version of the above, I do in fact, invoke the unittest framework.

Kirby


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: My first Clojure program (and blog post about it)

2015-07-30 Thread kirby urner

Excellent feedback so far, I thank experienced Clojure programmers for 
giving me tips.  

I may post a next version after incorporating some of this advice.

Yes, I have much to learn!

Kirby


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


My first Clojure program (and blog post about it)

2015-07-30 Thread kirby urner
Greetings all.  

I'm new to Clojure (but not to programming) and wanted to document a first 
effort.
The blog post:  http://controlroom.blogspot.com/2015/07/ramping-up.html

===

(ns test-project.synmods)

(defn add-open
  [edges]
  (let [[a b c d e f] edges
[a2 b2 c2 d2 e2 f2] (map (fn [x] (* x x)) edges )]
(do
  (reduce + [
 (reduce * [f2 a2 b2])
 (reduce * [d2 a2 c2])
 (reduce * [a2 b2 e2])
 (reduce * [c2 b2 d2])
 (reduce * [e2 c2 a2])
 (reduce * [f2 c2 b2])
 (reduce * [e2 d2 a2])
 (reduce * [b2 d2 f2])
 (reduce * [b2 e2 f2])
 (reduce * [d2 e2 c2])
 (reduce * [a2 f2 e2])
 (reduce * [d2 f2 c2])])
  )))

(defn add-closed
  [edges]
  (let [[a b c d e f] edges
[a2 b2 c2 d2 e2 f2] (map (fn [x] (* x x)) edges )]
(do
  (reduce + [
 (reduce * [a2 b2 d2])
 (reduce * [d2 e2 f2])
 (reduce * [b2 c2 e2])
 (reduce * [a2 c2 f2])])
  )))

(defn add-opposite
  [edges]
  (let [[a b c d e f] edges
[a2 b2 c2 d2 e2 f2] (map (fn [x] (* x x)) edges )]
(do
  (reduce + [
 (reduce * [a2 e2 (+ a2 e2)])
 (reduce * [b2 f2 (+ b2 f2)])
 (reduce * [c2 d2 (+ c2 d2)])])
  )))

(defn Volume
  [edges]
  (let [ open ( add-open edges)
 closed   ( add-closed edges)
 opposite ( add-opposite edges)]
 (Math/sqrt (* (- (- open closed) opposite) 0.5

(println (format "All edges D=1, Volume: %s" (Volume [1.0 1.0 1.0 1.0 1.0 1.0]) 
))

; A Module
(def a 1.0)
(def EF (* a (/ (Math/sqrt 6.0) 12.0 )))
(def EC (* a (/ (Math/sqrt 6.0) 4.0 )))
(def ED (* a (/ (Math/sqrt 2.0) 4.0 )))
(def FC (* a (/ (Math/sqrt 3.0) 3.0 )))
(def CD (/ a 2.0) )
(def DF (* a (/ (Math/sqrt 3.0) 6.0 )))

(def Avol (Volume [EF EC ED FC CD DF]))
(println (format "Amod volume: %s" Avol))

; E Module
; Fig. 986.411A T & E Module
; http://www.rwgrayprojects.com/synergetics/s09/figs/f86411a.html

(def D 1.0)
(def R (/ D 2.0))
(def h R)

(def OC h)
(def OA (* h (Math/sqrt (/ (- 5.0 (Math/sqrt 5.0)) 2.0))) )
(def OB (* h (Math/sqrt (/ (- 9.0 (* 3 (Math/sqrt 5.0))) 2.0
(def CA (* (/ h 2.0) (- (Math/sqrt 5.0) 1.0)))
(def AB (* h (Math/sqrt (- 5.0 (* 2.0 (Math/sqrt 5.0))
(def BC (* (/ h 2.0) (- 3.0 (Math/sqrt 5.0

(def Evol (Volume [OC OA OB CA AB BC]))
(println (format "Emod volume: %s" Evol))

; S Module
; Fig. 988.13A S Quanta Module Edge Lengths
; http://www.rwgrayprojects.com/synergetics/s09/figs/f8813a.html

(def a D)
(def FG (* (/ a 2.0) (*  (Math/sqrt 3.0) (Math/sqrt (- 7.0 (* 3.0 ( Math/sqrt 
5.0) ) )
(def FE (* a (Math/sqrt (- 7.0 (* 3.0 (Math/sqrt 5))
(def FH (* (/ a 2.0) (- (Math/sqrt 5.0) 1.0)))
(def GE (* (/ a 2.0) (Math/sqrt (- 7.0 (* 3.0 ( Math/sqrt 5))
(def EH (* (/ a 2.0) (- 3.0 (Math/sqrt 5.0
(def HG GE)

(def Svol (Volume [FG FE FH GE EH HG]))
(println (format "Smod volume: %s" Svol))

(println (format "sFactor: %s" (/ Svol Evol)))


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.