Re: [O] Data format for keeping track of weekly & yearly stats?

2015-03-13 Thread Thierry Banel
Hi Leo

You may want to have a look at org-aggregate
It provides partial sums, means, and so on,
and also correlation between two columns.

Source code and documentation here:
  https://github.com/tbanel/orgaggregate

Also available as an Emacs package on Melpa:
  (require 'package)
  (add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages";)
t)
  (package-initialize)
  M-x package-list-packages
  install orgtbl-aggregate

Thierry 


Le 12/03/2015 15:24, Leo Ufimtsev a écrit :
> Hello, 
>
> I'm new to Tables/formulas.
>
> I started using a table with formulas to keep track of productivity, # of 
> hours of sleep etc.. 
>
> I have something like this:
>   | Day  |  Dev |  Leo |@ 9 | Sleep |
>   |--+--+--++---|
>   | [2015-03-04 Wed] | 3:01 | 3:55 |  1 |  8:00 |
>   | [2015-03-05 Thu] | 4:00 | 0:52 |  0 |  7:39 |
>   | [2015-03-06 Fri] | 4:03 | 0:00 | .5 |  8:00 |
>   | [2015-03-09 Mon] | 5:09 | 0:00 |  0 |  8:15 |
>   | [2015-03-10 Tue] | 3:14 | 1:12 | .5 |  7:25 |
>   | [2015-03-11 Wed] | 4:55 | 0:53 | .5 |  7:30 |
>   | [2015-03-12 Thu] |  |  |  0 |  7:24 |
>   | [2015-03-13 Fri] |  |  ||   |
>   |--+--+--++---|
>   | March|  3.0 |  3.9 | 0.42857143 |   7.8 |
>   #+TBLFM: 
> @>$4=vmean(@I..@II)::@>$5=vmean(@I..@II);t%.1f::@>$2=vmean(@I$2);t%.1f::@>$3=vmean(@I$3);t%.1f
>
> At the bottom I have averages for each column. (in the future I'd like to 
> make a correlation analysis between sleep and productivity).
>
> Now, I would like weekly *and* yearly totals. I can't seem to come up with a 
> solution that wouldn't involve a lot of hard-coding or insertion of formulas 
> by hand.
>
> Any ideas? Do you think org-collector with two collector tables might be a 
> better solution for this sort of requirement?
>
> Thank you
>
> Leo Ufimtsev | Intern Software Engineer @ Eclipse Team
>
>
>
>




Re: [O] [PATCH} Re: Bug: problem when exporting a org-mode file with a lots of code blocks

2015-03-13 Thread Nicolas Goaziou
"Charles C. Berry"  writes:

> Done -- lines 3--6 below "(src-block ".

Thank you.

> It now reports the src-block name (if any).

OK.


Regards,



Re: [O] Extraneous output from Python code blocks using :session option

2015-03-13 Thread Nicolas Goaziou
Hello,

Kyle Meyer  writes:

> I've attached two patches.  The first one is a proposed way to deal with
> the indentation issues in sessions.  It is very similar to what
> python.el does for multiline input (use a temporary file and then
> execute that from the shell).  The second is an update of my previous
> patch to remove shell prompt characters that are leaking into the
> output.

Thank you.

I'll just comment about code, not functionality.

> +(defconst org-babel-python-indented-lines-session-method
> +  (concat "fname= '%s'; fh = open(fname); "
> +   "exec(compile(fh.read(), fname, 'exec')); "
> +   "fh.close()")
> +  "Single line to execute indented Python code in session.
> +%s will be formatted with the file name of the file containing
> + the code.")
  ^^^
spurious space

> +(defun org-babel-python--indented-p (input)
> +  "Return true if any line in INPUT is indented."

Non-nil if ...

> +  (with-temp-buffer
> +(insert input)
> +(goto-char (point-min))
> +(re-search-forward "^\\s-" nil t)))

aka

  (org-string-match-p "^[ \t]" input)

> +(defun org-babel-python--strip-session-chars (string)
> +  "Remove leading '>>>' and '...' from Python session output.
> +`org-babel-comint-with-output' splits by
> +`comint-prompt-regexp' (which includes '>>>' and '...'), but, in
> +some situations, these still make it through at the start of the
> +output string."

Argument STRING is not explained in the docstring.

> +  (with-temp-buffer
> +(insert string)
> +(goto-char (point-min))
> +(when (looking-at "\\s-*\n\\(\\(>>> \\)\\|\\(\\.\\.\\. \\)\\)*")
> +  (delete-region (match-beginning 0) (match-end 0)))
> +(buffer-string)))

aka

  (replace-regexp-in-string "\\`\\s-*\n\\(>>> \\|\\.\\.\\. \\)*" "" string)


Regards,

-- 
Nicolas Goaziou



[O] BIDI and org-mime-htmlize

2015-03-13 Thread Uwe Brauer


Hello

GNU emacs 24 has BIDI support, for languages such as Hebrew and Arabic.

However when I write an email, and send it via say gnus, the mail text
received it is displayed correctly with one restriction: The text is
displayed in most mail agents, at the left margin instead of the right
margin (I cannot write this here, since it would not displayed
correctly)

Thunderbird offers BIDI email support via HTML. The relevant HTML
elements seem to be

  

Re: [O] lots of CLOCK lines displayed when opening a TODO

2015-03-13 Thread Rainer Stengele
Am 12.03.2015 um 14:39 schrieb Loris Bennett:
> Rainer Stengele  writes:
> 
>> Am 12.03.2015 um 09:03 schrieb Loris Bennett:
>>> Rainer Stengele  writes:
>>>
 Am 05.03.2015 um 09:02 schrieb Loris Bennett:
> Rainer Stengele  writes:
>
>> Hi!
>>
>> I have lots of weekly reoccuring meetings and do collect the clocked
>> time for each meeting.  After a while I have lots of CLOCK
>> lines. Opening the TODO shows all the CLOCK lines shown, but my focus
>> is on text below the CLOCK lines.  I started to use multiple LOGBOOK
>> blocks in order to hide older CLOCK lines. Seems to work fine with
>> clocking etc.  My requirement would be to only open the first LOGBOOK
>> block when opening the headline (TODO).  That way I could hide older
>> entries from using screen space and instead see the text below
>> immediately.
>>
>> Anybody else uses multiple LOGBOOK blocks that way? Other ideas how to
>> work?  Any chance to get this regarded as an enhancement idea?
>>
>> Thank you.
>> Regards, Rainer
>>
>>
>> * TODO [#A] Weekly Services - Action Items
>> :LOGBOOK:
>> CLOCK: [2015-03-04 Mi 10:15]--[2015-03-04 Mi 11:30] =>  1:15
>> CLOCK: [2015-03-02 Mo 11:00]--[2015-03-02 Mo 12:15] =>  1:15
>> :END:
>> :LOGBOOK:
>> CLOCK: [2015-02-25 Mi 10:00]--[2015-02-25 Mi 11:00] =>  1:00
>> CLOCK: [2015-02-16 Mo 10:00]--[2015-02-16 Mo 11:15] =>  1:15
>> CLOCK: [2015-02-06 Fr 09:30]--[2015-02-06 Fr 09:45] =>  0:15
>> CLOCK: [2015-02-06 Fr 10:00]--[2015-02-06 Fr 11:00] =>  1:00
>> CLOCK: [2015-01-23 Fr 13:45]--[2015-01-23 Fr 14:00] =>  0:15
>> CLOCK: [2015-01-22 Do 14:30]--[2015-01-22 Do 14:45] =>  0:15
>> CLOCK: [2015-01-22 Do 13:45]--[2015-01-22 Do 14:00] =>  0:15
>> CLOCK: [2015-01-21 Mi 09:45]--[2015-01-21 Mi 10:45] =>  1:00
>> CLOCK: [2015-01-20 Di 09:45]--[2015-01-20 Di 10:00] =>  0:15
>> CLOCK: [2015-01-19 Mo 16:30]--[2015-01-19 Mo 16:45] =>  0:15
>> CLOCK: [2015-01-19 Mo 13:15]--[2015-01-19 Mo 15:00] =>  1:45
>> CLOCK: [2015-01-19 Mo 10:00]--[2015-01-19 Mo 11:15] =>  1:15
>> CLOCK: [2014-12-15 Mo 10:00]--[2014-12-15 Mo 10:30] =>  0:30
>> CLOCK: [2014-12-03 Mi 10:30]--[2014-12-03 Mi 11:15] =>  0:45
>> CLOCK: [2014-12-01 Mo 09:45]--[2014-12-01 Mo 10:45] =>  1:00
>> CLOCK: [2014-11-03 Mo 10:00]--[2014-11-03 Mo 11:00] =>  1:00
>> CLOCK: [2014-11-10 Mo 09:45]--[2014-11-10 Mo 10:45] =>  1:00
>> CLOCK: [2014-11-19 Mi 10:30]--[2014-11-19 Mi 11:15] =>  0:45
>> CLOCK: [2014-11-24 Mo 10:00]--[2014-11-24 Mo 11:00] =>  1:00
>> CLOCK: [2014-11-25 Di 08:00]--[2014-11-25 Di 10:45] =>  2:45
>> :END:
>>
>> - text I would like to see without having to scroll over all the CLOCK 
>> lines
>
> I use two drawers:
>
> #+DRAWERS: LOGBOOK OLDLOGS
>
> When the LOGBOOK get a bit long I manually move some the lines to
> OLDLOGS.  Both draws only open when I TAB on them.
>
> I don't actually use the data in the logs directly, just as a backup for
> my other time-keeping.  This is mainly because the one-minute resolution
> of the clocking is to fine for my needs.
>
> Have you changed the clocking resolution?  If so, how?  Or are you just
> an amazingly accurate clocker?
>
> Cheers,
>
> Loris
>
 Hi Loris,

 please check variable org-time-stamp-rounding-minutes in order to round 
 time stamps.
>>>
>>> OK, thanks.  I'll have a look at that.
>>>
 You are right, when I am in an org file the logbook drawers do not
 open by default when cycling.  My use case: I am jumping to a headline
 directly from an agenda item. "Tabbing" on that item jumps to the
 headline and shows the complete contents, including drawers.  Not sure
 why this is the case. I would like to have the same behavior as when
 tabbing in the Org file directly. Can you confirm this is the same in
 your setting?
>>>
>>> If I jump from the agenda entry 'Fun', I get something like the
>>> following:
>>>
>>> * Stuff
>>> ** Fun...
>>> ** Boring...
>>>
>>> If I press 'tab', I get
>>>
>>> * Stuff
>>> ** Fun
>>>:LOGBOOK:...
>>>:OLDLOGS:...
>>> ** Boring
>>>
>>> If I press 'tab' again, nothing happens.  If I press 'tab' a third time,
>>> the heading fold back and I get
>>>
>>> * Stuff
>>> ** Fun...
>>> ** Boring...
>>>
>>> again.  I'm not sure why the second press performs no action.  In any
>>> case, I only see the contents of the LOGBOOK draw if I move onto it and
>>> then press 'tab' again.  So quite different from the behaviour you get.
>>>
>>> Regards
>>>
>>> Loris
>>>
 Regards,
 Rainer Stengele


>>>
>>
>> Loris,
>>
>> you do not seem to have CLOCK entries directly under the headline
>> "Stuff", to which you are jumping to from agenda.  Can you add a few
>> CLOCK lines in drawer and simulate this and tell me if these stay
>> closed or not directly after the jump

[O] PATCH: Processing language support in Babel

2015-03-13 Thread Jarmo Hurri

Greetings.

Please find two files attached to this message.

1. A patch implementing Processing programming language support in
   Babel. The commit message of the patch is the following:

   
   ob-processing.el: Support for Processing language in Babel

   * lisp/ob-processing.el: Necessary functions for implementing editing
   and execution of Processing code blocks, and HTML export of the
   resulting Processing sketch.

   Editing Processing blocks requires processing2-emacs mode. Executing
   Processing blocks in Org buffer also requires processing2-emacs, and
   results in the sketch being shown in an external viewer. Such an
   execution produces no results in Org buffer. HTML export of the
   results of a Processing block is also supported, assuming that the
   processing.js module is available: the sketch is then drawn by the
   browser when the HTML page is viewed. This drawing is implemented by
   embedding the Processing code in a script using the processing.js
   module. The user is responsible for making sure that processing.js is
   available in the correct location.

   Console output from a Processing block produced e.g. by println() is
   shown in the Processing compilation window when the code is executed
   in Org buffer, and in text area (console) of the browser when the code
   is embedded in HTML.
   

2. File test.org, illustrating the use of Processing in Org. The HTML
   export of this file can be viewed at

   http://www.syk.fi/~jhurri/org-processing/test.html

   The sketches (figures) on the page will be re-initialised on page
   reload.

I will be writing teaching material using a combination of Org and
Processing, and may add features to Processing support when and if I
find the need.

All the best,

Jarmo

>From 92318f56b2968b05cfbfb894d3b1eee4c7cdde13 Mon Sep 17 00:00:00 2001
From: Jarmo Hurri 
Date: Fri, 13 Mar 2015 14:36:46 +0200
Subject: [PATCH] ob-processing.el: Support for Processing language in Babel

* lisp/ob-processing.el: Necessary functions for implementing editing
and execution of Processing code blocks, and HTML export of the
resulting Processing sketch.

Editing Processing blocks requires processing2-emacs mode. Executing
Processing blocks in Org buffer also requires processing2-emacs, and
results in the sketch being shown in an external viewer. Such an
execution produces no results in Org buffer. HTML export of the
results of a Processing block is also supported, assuming that the
processing.js module is available: the sketch is then drawn by the
browser when the HTML page is viewed. This drawing is implemented by
embedding the Processing code in a script using the processing.js
module. The user is responsible for making sure that processing.js is
available in the correct location.

Console output from a Processing block produced e.g. by println() is
shown in the Processing compilation window when the code is executed
in Org buffer, and in text area (console) of the browser when the code
is embedded in HTML.
---
 lisp/ob-processing.el | 201 ++
 1 file changed, 201 insertions(+)
 create mode 100644 lisp/ob-processing.el

diff --git a/lisp/ob-processing.el b/lisp/ob-processing.el
new file mode 100644
index 000..fb74b55
--- /dev/null
+++ b/lisp/ob-processing.el
@@ -0,0 +1,201 @@
+;;; ob-processing.el --- org-babel functions for evaluation of processing
+
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
+
+;; Author: Jarmo Hurri (adapted from ob-asymptote.el written by Eric Schulte)
+;; Keywords: literate programming, reproducible research
+;; Homepage: http://orgmode.org
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+;;; Commentary:
+
+;; Org-Babel support for evaluating processing source code.
+;;
+;; This differs from most standard languages in that
+;;
+;; 1) there is no such thing as a "session" in processing
+;;
+;; 2) results can only be exported as html; in this case, the
+;;processing code is embedded via a file into a javascript block
+;;using the processing.js module; the script then draws the
+;;resulting output when the web page is viewed in a browser
+;;
+;; 3) when not exporting html, evaluation of processing co

[O] [Org-Caldav] Trouble connecting to a caldav server other Google calendar

2015-03-13 Thread Charles-H. Schulz

Hi,

I'm using the KolabNow service for emails and groupware. As I'm in the 
process of transitioning my email and groupware on Emacs, I was 
interested by org-caldav, and KolabNow claims that their CalDAV calendar 
can integrate with org-mode through org-caldav ( 
https://kolabnow.com/clients/emacs ). So far their suggestions and docs 
pointed me to right thing (TM) but with org-caldav that is not the case.


Looking a bit into the files, I realized the package itself has the 
default configuration set on Google Calendar. I had to adapt it a bit to 
fit KolabNow as the link above describes it. Still after running a M-x 
org-caldav-sync I will get the following error message that "URL of the 
kolabnow calendar server" does not seem to accept DAV requests. I 
tinkered a bit with the authentification credentials but I'm running out 
of ideas. Browsing this list's archives I did find, however, that a few 
other people had problems outside Google Calendar.


Feedback / Help appreciated.

Thanks,

--
Charles-H. Schulz
http://www.standardsandfreedom.net



[O] [bug?] declare org-element-update-syntax

2015-03-13 Thread Rasmus
Hi,

Shouldn't org-element-update-syntax be declared in org.el since
org-add-link-type depends on it?  Or is there some autoload magic going
on?

—Rasmus

-- 
Got mashed potatoes. Ain't got no T-Bone. No T-Bone
>From e5d7961f1c76b2a44cb01a1c4871230161223f30 Mon Sep 17 00:00:00 2001
From: Rasmus 
Date: Thu, 12 Mar 2015 13:55:06 +0100
Subject: [PATCH] org.el: Declare org-element-update-syntax

* org.el: Declare org-element-update-syntax.  Required by org-add-link-type.
---
 lisp/org.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org.el b/lisp/org.el
index 6dd2475..3e8c714 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -182,6 +182,7 @@ Stars are put in group 1 and the trimmed body in group 2.")
 (declare-function org-element-parse-buffer "org-element"
 		  (&optional granularity visible-only))
 (declare-function org-element-type "org-element" (element))
+(declare-function org-element-update-syntax "org-element" ())
 
 (defsubst org-uniquify (list)
   "Non-destructively remove duplicate elements from LIST."
-- 
2.3.2



Re: [O] [Org-Caldav] Trouble connecting to a caldav server other Google calendar

2015-03-13 Thread Rasmus
"Charles-H. Schulz"  writes:

> Looking a bit into the files, I realized the package itself has the
> default configuration set on Google Calendar. I had to adapt it a bit
> to fit KolabNow as the link above describes it. Still after running a
> M-x 
> org-caldav-sync I will get the following error message that "URL of
> the kolabnow calendar server" does not seem to accept DAV requests. I
> tinkered a bit with the authentification credentials but I'm running
> out of ideas. Browsing this list's archives I did find, however, that
> a few other people had problems outside Google Calendar.

So you are not using the correct URL...  You might also have to set
org-caldav-calendar-id to a correct value.

If you have an Android phone you could try Davidroid from F-Droid.  As I
recall, it's pretty good at discovering webdav sources (but it's a long
time since I set it up so this could be completely wrong).

—Rasmus

-- 
Er du tosset for noge' lårt!




Re: [O] [Org-Caldav] Trouble connecting to a caldav server other Google calendar

2015-03-13 Thread Alexis


On 2015-03-14T01:11:35+1100, Charles-H. Schulz  
said:


CS> Browsing this list's archives I did find, however, that a 
CS> few other people had problems outside Google Calendar.


Perhaps this might be of use?

https://github.com/dengste/org-caldav/issues/45#issuecomment-68527518

(i've not yet tried it, myself, though i hope to get to doing so 
in the near future )


There might also be a connection with this Emacs issue:

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18290


Alexis.



Re: [O] Extraneous output from Python code blocks using :session option

2015-03-13 Thread Kyle Meyer
Nicolas Goaziou  wrote:
> Hello,
>
> Kyle Meyer  writes:
>
>> I've attached two patches.  The first one is a proposed way to deal with
>> the indentation issues in sessions.  It is very similar to what
>> python.el does for multiline input (use a temporary file and then
>> execute that from the shell).  The second is an update of my previous
>> patch to remove shell prompt characters that are leaking into the
>> output.
>
> Thank you.
>
> I'll just comment about code, not functionality.

Thanks for your comments.  I've attached updated patches.

>From 41aae465038fd789fe92611ecf1fae7e9d08ab5b Mon Sep 17 00:00:00 2001
From: Kyle Meyer 
Date: Fri, 13 Mar 2015 02:45:04 -0400
Subject: [PATCH 1/2] ob-python.el: Allow indented code in sessions

* lisp/ob-python.el (org-babel-python-evaluate-session): Recognize
indented code in session and treat it differently to avoid syntax
errors.

For session blocks with results set to 'output', go through an
intermediate file when there is indented code to prevent
indentation-related errors when sending code to the Python shell.  For
session blocks with results set to 'value', issue an user-error.
These (usually) would have resulted in a syntax error in the shell
anyway, and the '_' variable can't be used to get the last value here
(as it is for non-indented code) because it isn't set when executing
the code through a file.
---
 lisp/ob-python.el | 17 +
 1 file changed, 17 insertions(+)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index dd3cc66..0dc74ca 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -238,6 +238,14 @@ (defconst org-babel-python-pp-wrapper-method
 
 open('%s', 'w').write( pprint.pformat(main()) )")
 
+(defconst org-babel-python-indented-lines-session-method
+  (concat "fname= '%s'; fh = open(fname); "
+	  "exec(compile(fh.read(), fname, 'exec')); "
+	  "fh.close()")
+  "Single line to execute indented Python code in session.
+%s will be formatted with the file name of the file containing
+the code.")
+
 (defun org-babel-python-evaluate
   (session body &optional result-type result-params preamble)
   "Evaluate BODY as Python code."
@@ -303,6 +311,13 @@ (defun org-babel-python-evaluate-session
 		   (mapc (lambda (line) (insert line) (funcall send-wait))
 			 (split-string body "[\r\n]"))
 		   (funcall send-wait)))
+	 (indented-p (org-string-match-p "^[ \t]" body))
+	 (body (if indented-p
+		   (let ((tmp-file (org-babel-temp-file "python-")))
+		 (with-temp-file tmp-file (insert body))
+		 (format org-babel-python-indented-lines-session-method
+			 tmp-file))
+		 body))
  (results
   (case result-type
 (output
@@ -317,6 +332,8 @@ (defun org-babel-python-evaluate-session
  (funcall send-wait))
2) "\n"))
 (value
+	 (when indented-p
+	   (user-error "Value output limited to unindented lines with session"))
  (let ((tmp-file (org-babel-temp-file "python-")))
(org-babel-comint-with-output
(session org-babel-python-eoe-indicator nil body)
-- 
2.3.1

>From 28b6a003e4ae1dbb1474350203444e76df9e8572 Mon Sep 17 00:00:00 2001
From: Kyle Meyer 
Date: Fri, 13 Mar 2015 02:46:38 -0400
Subject: [PATCH 2/2] ob-python.el: Strip leading session characters

* lisp/ob-python.el (org-babel-python-evaluate-session): Strip extra leading
  "..." and ">>>" from session output.
---
 lisp/ob-python.el | 30 --
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index 0dc74ca..e976d9c 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -321,16 +321,17 @@ (defun org-babel-python-evaluate-session
  (results
   (case result-type
 (output
- (mapconcat
-  #'org-babel-trim
-  (butlast
-   (org-babel-comint-with-output
-   (session org-babel-python-eoe-indicator t body)
- (funcall input-body body)
- (funcall send-wait) (funcall send-wait)
- (insert org-babel-python-eoe-indicator)
- (funcall send-wait))
-   2) "\n"))
+	 (org-babel-python--strip-session-chars
+	  (mapconcat
+	   #'org-babel-chomp
+	   (butlast
+		(org-babel-comint-with-output
+		(session org-babel-python-eoe-indicator t body)
+		  (funcall input-body body)
+		  (funcall send-wait) (funcall send-wait)
+		  (insert org-babel-python-eoe-indicator)
+		  (funcall send-wait))
+		2) "\n")))
 (value
 	 (when indented-p
 	   (user-error "Value output limited to unindented lines with session"))
@@ -356,6 +357,15 @@ (defun org-babel-python-read-string (string)
   (match-string 1 string)
 string))
 
+(defun org-babel-python--strip-session-chars (string)
+  "Remove leading '>>>' and '...' from STRING.
+`org-babel-comint-with-output' splits the Python session output
+b

Re: [O] Data format for keeping track of weekly & yearly stats?

2015-03-13 Thread Leo Ufimtsev
This looks like the promised land here. SQL aggregation in org-mode omg X-D!!

Pretty much what I was looking for. Thank you so much for the link.

Leo Ufimtsev | Intern Software Engineer @ Eclipse Team

- Original Message -
From: "Thierry Banel" 
To: emacs-orgmode@gnu.org
Sent: Friday, March 13, 2015 3:06:18 AM
Subject: Re: [O] Data format for keeping track of weekly & yearly stats?

Hi Leo

You may want to have a look at org-aggregate
It provides partial sums, means, and so on,
and also correlation between two columns.

Source code and documentation here:
  https://github.com/tbanel/orgaggregate

Also available as an Emacs package on Melpa:
  (require 'package)
  (add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages";)
t)
  (package-initialize)
  M-x package-list-packages
  install orgtbl-aggregate

Thierry 


Le 12/03/2015 15:24, Leo Ufimtsev a écrit :
> Hello, 
>
> I'm new to Tables/formulas.
>
> I started using a table with formulas to keep track of productivity, # of 
> hours of sleep etc.. 
>
> I have something like this:
>   | Day  |  Dev |  Leo |@ 9 | Sleep |
>   |--+--+--++---|
>   | [2015-03-04 Wed] | 3:01 | 3:55 |  1 |  8:00 |
>   | [2015-03-05 Thu] | 4:00 | 0:52 |  0 |  7:39 |
>   | [2015-03-06 Fri] | 4:03 | 0:00 | .5 |  8:00 |
>   | [2015-03-09 Mon] | 5:09 | 0:00 |  0 |  8:15 |
>   | [2015-03-10 Tue] | 3:14 | 1:12 | .5 |  7:25 |
>   | [2015-03-11 Wed] | 4:55 | 0:53 | .5 |  7:30 |
>   | [2015-03-12 Thu] |  |  |  0 |  7:24 |
>   | [2015-03-13 Fri] |  |  ||   |
>   |--+--+--++---|
>   | March|  3.0 |  3.9 | 0.42857143 |   7.8 |
>   #+TBLFM: 
> @>$4=vmean(@I..@II)::@>$5=vmean(@I..@II);t%.1f::@>$2=vmean(@I$2);t%.1f::@>$3=vmean(@I$3);t%.1f
>
> At the bottom I have averages for each column. (in the future I'd like to 
> make a correlation analysis between sleep and productivity).
>
> Now, I would like weekly *and* yearly totals. I can't seem to come up with a 
> solution that wouldn't involve a lot of hard-coding or insertion of formulas 
> by hand.
>
> Any ideas? Do you think org-collector with two collector tables might be a 
> better solution for this sort of requirement?
>
> Thank you
>
> Leo Ufimtsev | Intern Software Engineer @ Eclipse Team
>
>
>
>





Re: [O] Citation syntax: a revised proposal

2015-03-13 Thread Richard Lawrence
Hi Aaron and all,

Richard Lawrence  writes:

>> What version of citeproc-hs are you using?  The version under that
>> name is no longer maintained, and I had some trouble getting it to
>> build.
>
> I am in fact using the version under that name (I have not had trouble
> installing/building it via cabal).  I went this way because it seemed to
> have everything we'd need, and I wanted to avoid a dependency on all of
> pandoc.  Maybe this was shortsighted of me, though...  

I've posted a new version that uses pandoc-citeproc rather than
citeproc-hs to do the CSL processing, and uses pandoc itself to render
the output.  This fixes some spacing issues I was having with
citeproc-hs, and made it trivial to add an OpenDocument writer.

I'll take some time this weekend to see if I can wire this together with
the Elisp Aaron wrote for the Org exporter side.

Code is still at: https://github.com/wyleyr/org-citeproc

Best,
Richard



Re: [O] [bug?] declare org-element-update-syntax

2015-03-13 Thread Nicolas Goaziou
Hello,

Rasmus  writes:

> Shouldn't org-element-update-syntax be declared in org.el since
> org-add-link-type depends on it?  Or is there some autoload magic going
> on?

`org-element-update-syntax' is an autoloaded function so it isn't
a problem.

However, it introduces compilation warnings with "make single", so let's
apply it.


Regards,

-- 
Nicolas Goaziou



[O] BUG: Cached named call lines

2015-03-13 Thread Rick Frankel
There are bugs with calling named call lines and blocks when they are cached.

If the callee is cached, the results vary when the caller is re-evaluated.

The following file demonstrates the bug(s). Unfortunately I don't have time
right now to debug...

#+BEGIN_SRC org
  ,* Cached results bug
  ,** Tests
  ,*** Fails with error:
  mapconcat: Wrong type argument: listp, "string=\"foo bar\""
  ,#+call: bad-src(string="foo bar")

  ,*** Fails with =nil= second time evaluated
  ,#+call: word(data=cached(string="bar fly"))

  ,*** Returns different results on second call (quotes words)
  ,#+call: word(data=cached-unwrapped(string="bar fly"))

  ,*** Works
  ,#+call: word(data=src(string="bar fly"))

  ,#+call: word(data=uncached(string="bar fly"))
  ,** Intermediate calls
  ,#+name: cached
  ,#+call: src(string="foo bar") :cache yes :results wrap

  ,#+name: uncached
  ,#+call: src(string="foo bar") :results wrap

  ,#+name: cached-unwrapped
  ,#+call: src(string="foo bar") :cache yes

  ,** Blocks
  ,#+name: bad-src
  ,#+BEGIN_SRC emacs-lisp :var string="" :cache yes
string
  ,#+END_SRC

  This block works when called
  ,#+name: src
  ,#+BEGIN_SRC emacs-lisp :var string=""
string
  ,#+END_SRC

  ,#+name: word
  ,#+BEGIN_SRC emacs-lisp :var data=""
(split-string data)
  #+END_SRC
#+END_SRC



Re: [O] Babel language support for Mathematica

2015-03-13 Thread Richard Stanton
I recently saw this posting about org support for Mathematica. Thanks for 
writing this! 

Unfortunately, while I can get it to work for simple things (e.g., 2+3), even 
slightly more complex things don't seem to work. For example, suppose I'd like 
to define a function f(x) = x + 3, and then calculate f(5). In a MMA notebook, 
if I type

f[x_] := x+3
f[5]

I get the answer 8. If I try the same code in an org-mode code block, here's 
what happens:

#+BEGIN_SRC mathematica 
f[x_] := x+3
f[5]
#+END_SRC

#+RESULTS:
: Null

Am I missing something obvious here?

Thanks very much.

Richard Stanton


Re: [O] Babel language support for Mathematica

2015-03-13 Thread John Kitchin
I wonder if this is an output vs value issue on the return of the
block. If you set :results output does anything change? or, is there a
way to specify a return value? or specifically print something?

Richard Stanton writes:

> I recently saw this posting about org support for Mathematica. Thanks for 
> writing this!
>
> Unfortunately, while I can get it to work for simple things (e.g., 2+3), even 
> slightly more complex things don't seem to work. For example, suppose I'd 
> like to define a function f(x) = x + 3, and then calculate f(5). In a MMA 
> notebook, if I type
>
> f[x_] := x+3
> f[5]
>
> I get the answer 8. If I try the same code in an org-mode code block, here's 
> what happens:
>
> #+BEGIN_SRC mathematica
> f[x_] := x+3
> f[5]
> #+END_SRC
>
> #+RESULTS:
> : Null
>
> Am I missing something obvious here?
>
> Thanks very much.
>
> Richard Stanton

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] Babel language support for Mathematica

2015-03-13 Thread Yi Wang
Dear Richard,

You can do:

#+BEGIN_SRC mathematica
f[x_] := x+3;
f[5]
#+END_SRC

Here are explanations: I actually put everything in the SRC block into a
Print[...].

So in the second example, what actually runs is

Print[f[x_] := x+3
f[5]]

This does not return any value. Because what it really does is print the
value of "f[x_] := x+3 f[5]"

Here is the code:

(concat
 (mapconcat ;; define any variables
  (lambda (pair)
(format "%s=%s;"
(car pair)
(org-babel-mathematica-var-to-mathematica (cdr pair
  vars "\n") "\nPrint[\n" body "\n]\n")

If anybody has idea to improve it, I will be happy to see and work it out!

Best,
Yi




On Sat, Mar 14, 2015 at 7:09 AM John Kitchin 
wrote:

> I wonder if this is an output vs value issue on the return of the
> block. If you set :results output does anything change? or, is there a
> way to specify a return value? or specifically print something?
>
> Richard Stanton writes:
>
> > I recently saw this posting about org support for Mathematica. Thanks
> for writing this!
> >
> > Unfortunately, while I can get it to work for simple things (e.g., 2+3),
> even slightly more complex things don't seem to work. For example, suppose
> I'd like to define a function f(x) = x + 3, and then calculate f(5). In a
> MMA notebook, if I type
> >
> > f[x_] := x+3
> > f[5]
> >
> > I get the answer 8. If I try the same code in an org-mode code block,
> here's what happens:
> >
> > #+BEGIN_SRC mathematica
> > f[x_] := x+3
> > f[5]
> > #+END_SRC
> >
> > #+RESULTS:
> > : Null
> >
> > Am I missing something obvious here?
> >
> > Thanks very much.
> >
> > Richard Stanton
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>


Re: [O] lots of CLOCK lines displayed when opening a TODO

2015-03-13 Thread Xavier Maillard

Leo Ufimtsev  writes:

>>> (org-drawers
>>>(quote
>>> ("FURTHER_READING" "THEORY" "TASKS" "INFO" "TIP" "NOTE" "EG" "LINKS" 
>>> "APPENDIX" "DETAILS" "PROPERTIES" "CLOCK" "LOGBOOK" "RESULTS" "TASKARCHIVE" 
>>> "SOURCE" "TROUBLESHOOTING")))
>
>>OMG ! All of them are used ?
> :-D,  I need to consolidate some of those. Many are left overs from the 
> distant past.

Copy that ! :)

> My todo list is publicly viewable:
> leoufimtsev.github.io./org/dev.org

Thank you for sharing.

> But below might be a more "typical" task.
> You might notice that most of my time stamps are ~30mins
> long. That's because I work in 30 minute time blocks (like pomodoro
> with 5 mins extra).

Interesting approach. Kind of /off topic/ but can you tell me in what
pomodoro is doing for you ? Are you the kind of person (like me) who
loves to have many topic/items and gets quickly bored when spending
too much time on each of them ?

> I use org-pomodoro with some customizations (e.g notifications upon 
> completion, stop/continue functionality etc..).

I need to learn that !

> I then have a 'last week' report that shows me what I've done the
> week before so I can use that to make my weekly reports.

This is something I'd like to produce too in order to fill my
activity report for my boss.

> *** HOLD [[https://bugs.eclipse.org/bugs/show_bug.cgi?id=461616][Bug 461616 – 
> {GTK3} Combo improvements in background/foreground for gtk3]]

[ quite long todo ]

> Let me know if you have any questions.

As I see it, you write down and clock things as much as possible. My
sole question currently is: how do you think to clock things
permanently ? If I look at how I do this, I kind of miss my
clock-in/clock-out :)

Regards
-- Xavier.