Re: [O] column view extension

2012-01-17 Thread Eric S Fraga
ayvango ayva...@zoho.com writes:

 I've found a non-standard use case for org-mode.

I don't think there is a *standard* use case for org!  ;-)

 There is plenty of spreadsheets engine with common drawback:
 spreadsheet cells follow original memory cell abstraction that are
 handy for a computer but is inconvenient for human. Hierarchical
 structures is more natural and in some cases may be used much more
 effective for at almost half of the data models.

Indeed.  And I like your particular example.  Enjoy!

 This method saves me a lot of time but it may not be used with other
 hierarchical data models as simply as for the army list. This models
 may require more complicated summary types than those provided from
 ground. Is there any way to incorporate abstract grammar for defining
 and processing properties. There is already a way to define
 synthesized attributes as well as inherited ones. But there is no way
 to bind them together with a function to calculate output.

I cannot answer this, whether any such way exists or not, but I can add
my +1 if what you want is not possible.


-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
: using Org-mode version 7.8.03 (release_7.8.03.138.gbf1d5)



Re: [O] column view extension

2012-01-17 Thread Michael Brand
Hi ayvango

On Mon, Jan 16, 2012 at 22:00, ayvango ayva...@zoho.com wrote:
 I hope someone become interested in creating spreadtree application
 based on existing properties code.

This would be very useful for me too. There are several resources that
go towards this direction:

*formulas in colum spec #+COLUMNS*

First of course average/sum/min/max/... in the manual and talks, see
the links in
http://thread.gmane.org/gmane.emacs.orgmode/42071/focus=42088
but then there is also this very interesting whole thread about
org-columns-compute and org-columns-compile-map
http://thread.gmane.org/gmane.emacs.orgmode/12067

*org-collector*

See e. g.
http://thread.gmane.org/gmane.emacs.orgmode/42071/focus=42091

*dynamic block columnview with #+TBLFM:*

For an example see indent2_tbl4.org.txt attached here
http://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00072.html
and for some issues see the whole thread here
http://thread.gmane.org/gmane.emacs.orgmode/48764

*remote() in #+TBLFM:*

A simple example that might be interesting for some special cases but
commonly quite inconvenient to change:
#+BEGIN_SRC org
  , #+STARTUP: odd
  , - hours are edited, the rest is calculated with
  ,   M-x org-table-iterate-buffer-tables
  , * parent
  ,   #+TBLNAME: parent
  ,   | days |
  ,   |3 |
  ,   #+TBLFM: @$1 = remote(child1, @$1) + remote(child2, @$1)
  , *** child1
  , #+TBLNAME: child1
  , | days | hours |   relative |
  , |1 | 8 | 0. |
  , #+TBLFM: @$1 = $2 / 8 :: @$3 = $1 / remote(parent, @$1)
  , *** child2
  , #+TBLNAME: child2
  , | days | hours |   relative |
  , |2 |16 | 0.6667 |
  , #+TBLFM: @$1 = $2 / 8 :: @$3 = $1 / remote(parent, @$1)
#+END_SRC

Michael



[O] column view extension

2012-01-16 Thread ayvango
I've found a non-standard use case for org-mode.

There is plenty of spreadsheets engine with common drawback: spreadsheet cells 
follow original memory cell abstraction that are handy for a computer but is 
inconvenient for human. Hierarchical structures is more natural  and in some 
cases may be used much more effective for at almost half of the data models.

I would use a popular wargame Warhammer 40k army list as example. The army list 
consist of the sections: HQ (headquarters), Elite, Troop, FA (fast attack), HS 
(heavy support). Every section divides further on squads and their options. 
Those an hierarchical structure defined. An army list has it limits on choices 
for points spent on, occupied slots and so on.

Spreadsheets is inconvenient for roster accounting since I doesn't  know the 
number of squad, persons it incorporates and their wargear in advance. I would 
rather extend it dynamically. I've tried to write some template in terms of 
cell-processor but found it too complicated. It have expressed perfectly in 
terms of  tree-processor (my own name)  though. I defines some kind of 
attribute grammar as a tree processor.

The file containing referenced army list attached to the post.

Org-mode gives me more powerful instrument than any spreadsheet I've meet. In 
two strings it can express the structure demands plenty of verbosity to be 
recorded in any spreadsheet. I've just defined COLUMNS property for an outline 
and org-mode gather all required information from its subnodes.

This method saves me a lot of time but it may not be used with other 
hierarchical data models as simply as for the army list. This models may 
require more complicated  summary types than those provided from ground. Is 
there any way to incorporate abstract grammar for defining and processing 
properties. There is already a way to define synthesized attributes as well as  
inherited ones. But there is no way to bind them together with a function to 
calculate output.

Example. Every node has its point point cost. Parent node costs calculated by 
summing all its subnodes cost. But I'd like to introduce new attribute: node 
share that represents point weight of the node among its siblings ( 100% * 
node.cost / parent(node).cost ). Another example. I'd like to separate node own 
cost from computed subnodes cost sum. That way I escape creating boring virtual 
parent nodes existing exclusively for summing model cost with costs of it's own 
wargear.

I'm using org-mode for it convenience  but I don't know much about lisp and 
can't extend org-mode. I hope someone become interested in creating spreadtree 
application based on existing properties code.

BA.org
Description: Binary data