emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <dominik@science.uva.nl>
To: Carsten Dominik <dominik@science.uva.nl>
Cc: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: Org-mode versus Taskpaper - now for real
Date: Mon, 7 Apr 2008 17:14:56 +0200	[thread overview]
Message-ID: <4EAA29A4-DC04-47D2-BB4D-D1BD95808B27@science.uva.nl> (raw)
In-Reply-To: <DE71611A-88FA-4631-9C04-CDFB1ADD9C06@science.uva.nl>

Hmmmm no more entries. :-(

Anyway, here is my entry, just to prove that N is 8 (at least for now),
and also to show that perl can function as a write-only language.

- Carsten

#!/usr/bin/perl -p
# taskpaper-to-org converter including #+TAGS setup in 239 bytes
/^(\t*)-(.*?)((@\w+ *)*)$/;
@u=grep{$_ ne'@done'}(@t=split/ +/,$3);
@v=@u?('',@u,''):();
$t{$_}++for@u;
$_="*"x(2+length$1).(@t==@u?" TODO":" DONE").$2.join(":",@v)."\n"if$&;
s/^\w.*:\s*$/* $&/;
END{printf "* Setup\n#+TAGS: %s\n",join' ',keys%t}




On Apr 4, 2008, at 11:12 AM, Carsten Dominik wrote:
>
> Well, indeed not exactly the same, but very close.  A way to measure
> the distance between two formats is using a discrete p-N metric.
> The distance between two formats is said to be N if there is
> perl program with less than 2^N (2 to the power N) significant
> characters that will turn this test taskpaper file
>
> /----------------------------------------------------
> | Project 1:
> | - Task 1 @home
> | - Task 2 @work @boss
> | 	- Subtask 2.1 @done
> | 	- Subtask 2.2 @Alice
> |     More text belonging to subtask 2.2
> | - Task 3
> | This is not a project, but text belonging to task 3
> |
> | Project 2:
> | - Task 4
> | - Task 5 @done
> \----------------------------------------------------
>
> into this equivalent Org file:
>
> /----------------------------------------------------
> | * Project 1:
> | ** TODO Task 1 :@home:
> | ** TODO Task 2 :@work:@boss:
> | *** DONE Subtask 2.1
> | *** TODO Subtask 2.2 :@Alice:
> |     More text belonging to subtask 2.2
> | ** TODO Task 3
> | This is not a project, but text belonging to task 3
> |
> | * Project 2:
> | ** TODO Task 4
> | ** DONE Task 5
> \----------------------------------------------------
>
> Anyone wants to take up the challenge?  What N can be achieved?
>
> Bonus points if the program also adds
>
> /---------------------------------
> | #+TAGS: @Alice @boss @work @home
> \---------------------------------
>
> somewhere, but that is not required for a valid entry.
>
> No more than 2^N *significant* characters means that
> after stripping the line invoking the perl interpreter
>
> #+/usr/bin/perl -p
>
> and after stripping newlines and other insignificant whitespace,
> the program may have at most 2^N bytes.
>
> In fact, any other language is also allowed - however, usually
> perl makes the smallest converters and is therefore the best
> measure for distance in p_N space.
>
> - Carsten
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2008-04-07 16:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-01 10:28 Org-mode versus Taskpaper - now for real Carsten Dominik
2008-04-01 11:39 ` Rainer Stengele
2008-04-01 14:30 ` Russell Adams
2008-04-01 15:52 ` Eddward DeVilla
2008-04-01 19:11   ` Carsten Dominik
2008-04-03  9:55   ` Rick Moynihan
2008-04-03 14:26     ` Manish
2008-04-03 15:14       ` Rick Moynihan
2008-04-03 16:59         ` Bastien
2008-04-03 17:27           ` Rick Moynihan
2008-04-04  9:26             ` Bastien
2008-04-04  9:12         ` Carsten Dominik
2008-04-04 12:20           ` Egli Christian (KIRO 433)
2008-04-04 12:38             ` Carsten Dominik
2008-04-07 15:14           ` Carsten Dominik [this message]
2008-04-03 16:26       ` Joel J. Adamson
2008-04-03 17:39         ` Rick Moynihan
2008-04-04  7:49       ` Carsten Dominik
2008-04-03 23:28     ` Jason F. McBrayer
2008-04-01 23:05 ` Sven Bretfeld
2008-04-02  2:54   ` Clint Laskowski
2008-04-03 16:22 ` Tim O'Callaghan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EAA29A4-DC04-47D2-BB4D-D1BD95808B27@science.uva.nl \
    --to=dominik@science.uva.nl \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).