Example of roadall in php, please

23 views
Skip to first unread message

Essentiae

unread,
Sep 30, 2014, 8:01:03 AM9/30/14
to akra...@googlegroups.com
Hi all, 

Does someone have an example of their use of the new roadall in php, please? Just a small snippet would be great. I'm having trouble figuring out how to create a function for it (am not a programmer) and would love to reverse engineer someone's example if there's one out there.

Thanks!
Essy

Daniel Reeves

unread,
Sep 30, 2014, 7:25:17 PM9/30/14
to akratics
Glad you asked! Here [1] is an example php program that uses the new
roadall to do like an extreme retroratchet where it just blows away
the whole road matrix and replaces it with a perfectly straight road
that ends wherever the road dial currently indicates. The code below
will actually work with the test goal beeminder.com/test1602/test .
Right now that goal has a flat spot. Running this program will get rid
of it, just like retroratchet.

Note the "can't make it easier between now and the akrasia horizon"
constraint. That constraint is shown visually on the graph as the pink
shaded area where the new road is not allowed to touch.

Is this all making sense?

Php library is at github.com/beeminder

[1] The actual code: https://gist.github.com/dreeves/dc077334d6cd1b4e66d9
> --
> You received this message because you are subscribed to the Google Groups
> "Akratics Anonymous" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akratics+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
http://dreev.es -- search://"Daniel Reeves"
Goal tracking + Commitment contracts == http://beeminder.com

Essentiae

unread,
Oct 1, 2014, 6:29:12 AM10/1/14
to akra...@googlegroups.com
Neat!!
Thanks!!!
I'm going to play with it with my goals right now.

Essentiae

unread,
Oct 1, 2014, 7:18:26 AM10/1/14
to akra...@googlegroups.com
Pro tip: do NOT iterate over all goals if you don't fully understand the code. Whoopsy... (I kinda derailed ten goals)
Otherwise, this is great. I'm still playing around with it to see what I can get it to do, but I LOVE the idea of cleaning up old, ugly yellow roads with all kinds of kinks in them that make it harder to see the trends (I can't help it; my eyes want to follow the bright yellow lines.)

Thanks for this feature and for the code example!
Reply all
Reply to author
Forward
0 new messages