Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Can agents perform 'group by' as well as ordering? (Read 7430 times)
Greg Askew
Full Member
*
Offline



Posts: 5

Can agents perform 'group by' as well as ordering?
Sep 11th, 2008, 10:36am
 
Just a quick question for the Tinderbox elite here...

I'm currently learning how to bake rye sourdough bread - no mean feat, as I'm quickly discovering. I'm using Tinderbox as a diary through each attempt - notes for each preparatory step, and a single note that I use as an analysis of the entire procedure.

My analysis note is prototyped to include an attribute called 'Recipe', so that I can quickly determine which recipe I used in the bread making. I also have an agent that finds all the analysis notes that I've made (pattern matching the note's name with 'analysis'), and drops them into a list.

Having made a number of attempts to make my bread, I'm finding that the number of recipes and analysis notes are building up quickly. I'd now like to improve my agent's result list by sorting the analysis notes into visible groups based on the value of the note's recipe attribute (essentially a sql 'group by' clause). Within each group, I'd then 'order by' the analysis notes' creation date, to give a structure to my progress with that recipe.

I could write an agent for each recipe, however my instinct is to avoid unnecessary duplication of work where possible. Further, each time I started a new receipe, I'd have to write an additional agent. I could also use the two levels of ordering available to an agent; this option isn't scaleable, and would work only if the note's name is structured to provide an explanation of the sort sequence, otherwise the list becomes confusing - there are no obvious breaks from one recipe to the next.

Am I asking too much of agents, or is such a structured result possible?
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Can agents perform 'group by' as well as ordering?
Reply #1 - Sep 11th, 2008, 6:14pm
 
(Deleted by author - see Mark B's post two down from here)
Back to top
 
« Last Edit: Sep 13th, 2008, 12:13pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Can agents perform 'group by' as well as ordering?
Reply #2 - Sep 12th, 2008, 5:18pm
 
On topic (bread) but not TB related, I sympathise re the rye bread issue. My wife and I have been doing OK with rye sourdough bread based on the leaven in Dan Lepard's book The Handmade Loaf. Although the rye loaves taste fine, getting them to rise - and hold shape - is a different matter. On the leaven front we found it took several weeks before we got good results even though it was very active within a few days - I guess it needs to mature a little. I think the answer is a proving basket, as using home-made mock-up of said utensil has helped though I think a proper purpose-made basket is the long term answer.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Can agents perform 'group by' as well as ordering?
Reply #3 - Sep 13th, 2008, 2:20am
 
Actually, I think this is an easy problem.

Tinderbox provides two sort parameters; SortBy and AlsoSortBy.  So, you can sort by the group, and then also sort by the secondary criteria.  In your case, you sort by Recipe, and then also sort by Version (or Date).

This gives you almost everything you want.  But what if you also would like, say, a separator to make the groups clearer?  You can do this too; just give the separator a Version or Date that will sort to the top of its group.

(Yes, you'll need to make a new separator for each group.  But that's not terribly onerous for recipes you might be revising many times. And you'll have to wait for the bread to rise anyway!
Back to top
 
 
WWW   IP Logged
Greg Askew
Full Member
*
Offline



Posts: 5

Re: Can agents perform 'group by' as well as ordering?
Reply #4 - Sep 13th, 2008, 8:18pm
 
Thanks for all of your replies. I guess that I was looking for something more... erm... 'database-ey', but I'm quite happy with the suggestions that you've both put forward. I think that my analysis processes that I undertake at work might have placed unrealistic expectations on TB! Mind you, TB isn't so far away from being an analysis tool, and I certainly wouldn't have been unconsciously grouping by attributes if the spark wasn't there!

For what it's worth, where I was heading towards was something like this:

Find all my notes in the tinderbox
where the notes name is like '%analysis%'
group by Recipe Attribute and Rye Culture Number Attribue
order by date

With a 'Greg's perfect world' result of something like:

* Agent
- * Reinhart's 100% Sourdough||Rye Culture 1
-- * 2008-08-15 Analysis (Rye Loaf 1)
-- * 2008-08-22 Analysis (Rye Loaf 2)
-- * 2008-09-01 Analysis (Rye Loaf 3)
- * Oliver's Rye Sourdough||Rye Culture 1
-- * 2008-09-10 Analysis (Rye Loaf 4)

PS. Thanks to TB, I've finally created an edible, good looking loaf of rye bread. It took four attempts, but the journaling and organization in TB kept my brain from having to try and recall six weeks of readings, practice and procedure.

By using TB, I've reduced my stress and frustration levels from making stupid mistakes through forgetfulness (each stupid mistake would have cost me 2-3 days of baking), saved money on not buying extra flour, and saved money from not having to buy lunches this week (since I can make my own).

It's the little things that all add up in the long run.
Back to top
 
« Last Edit: Sep 13th, 2008, 8:20pm by Greg Askew »  
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Can agents perform 'group by' as well as ordering?
Reply #5 - Sep 14th, 2008, 3:22am
 
How's this?  You could create a synthetic attribute with the sort properties you desire -- a secondary key, for all you database fans out there.  For example:  YYYY-MM-DD AA CC, where AA is the recipe attribute and  CC is the name of the culture.  This attribute is assigned by a rule, and then we sort of the synthetic attribute. Voila!
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print