Open Source Blogs
Immerse yourself in SAP open source! Discover collaborative projects, insights into the latest technologies, and best practices in open source development.
cancel
Showing results for 
Search instead for 
Did you mean: 
JimSpath
Active Contributor

The phrase "return to standard" was once a tough sentence for a tough development team. Turn off all of our toppings? No way. Sometimes, though, the path to just ice is not clear.


Years ago, when I was a rookie detective, we used DOS programs to get our cases on the books. We didn't have any better tools in our utility belts, so we served what we cooked up. Two words: integration and usability. And a legacy, okay, three words.

Integration

I'm overloading integration to include data transfer as well as features. A new program could read data saved from an older app, and ideally also be able to write data compatible with the old app import capabilities.

The example I'm referencing is a menu or recipe program, though primarily on data store/retrieve over a full feature bake-off. In past adventures, I wrote of "Meal-M" and the plain text files people use to share recipes.

CTQ - critical to quality

While an example of a data integration and usability, recipe management is still practical, and I'd use the same thought process to list desired outcomes in any data/app pick-off. I won't call them CTQs, or deliverables, only "must have". First the app must read prior saved recipe files, in the Meal-M format. Second, it should run under multiple local operating systems (or, if you are cloud-targeted, the same goals apply). Third, at least a subset of Unicode character encoding, specifically Thai, though other Asian characters could be needed. Liken this to upgrading an enterprise application and reviewing the integration and user manuals.

Finally, usability, for this app/project, covers ease of menu navigation, installation simplicity, file management access, and, as much as possible, hiding details such as the database layer and the basic print and import/export paths.

As it turns out with both applications and APIs, what worked in the relatively recent past might be dead in the water, cloud or not. Starting with the original shareware program that became a standard of sorts (one that you might want to return to, say), Meal-M itself. Fortunately captured by archivers, we can view "historic" content to drive current decisions on data access means

"Fortunately a copy of the website is still available on the Internet Archive."

archive.org/web/20081221021301/http://episoft.home.comcast.net/~episoft/mmdown.htm

Text snippets (pinch of this dash of that) from the manual, for the period 1986 - 2004:
Export files are standard "ASCII" files, which can be easily 
used by most word processing and communications programs.

Meal-Master will only import files in "Meal-Master" format.

Conversion program supplied with Meal-Master will process files
from several other recipe programs into files that can be imported
by Meal-Master.

The second option is the SPECIAL: BB format. This format is used for creating
export files compatible with Bulletin Boards and on-line services which
use narrow line formats, such as Prodigy[tm].

The original app has only embedded input/API format, though for exports there were three, similar to blog tools having previews for computer, tablet, and mobile form factors.

The stated limitation of ASCII only (basically 7 bit character set of 128 symbols) restricts both the app and the integration to "English-only" which just won't do. What choices exist as upgrade paths?

I took a closer look at a tool I'd used before to load recipes and save them that ran on Windows and UNIX, called Gourmet (links below),

While it had potential, the encoding of most text fields was ASCII; pasting Asian characters produced question marks. The first work around I tried was including images of the title fields.

TWO


 


Gourmet menu interface


That was substandard, as I expect you can see from the image above. The first record has an image on the left side of the results in a blue background (from source material). It's rather tiny, thus unreadable.

The second record image was pasted from a separate word processing app, saved as an image. It's clearer (since it is machine not human made) than the first.

But the downsides of not being able to read and write characters in different parts of the app made this a short review.

There was a side battle with how to build this app; some platforms only had a Python 2 version. I'd like to have any new apps use Python 3 and avoid a sudden floor dropout.

TWO



Any-Meal import dialogue box


The next app reviewed was "Any-Meal"; instead of being Python-based it's primarily C++.

Database


While you could have an "in-memory" database that bootstraps from a plain text file of recipes, somehow refreshing the cached images as you edit the data, or, you could have a plain-old-database-file life. Here, Any-meal chose SQL-Lite. That file-as-a-database that might remind old hands of <shudder> Access, but my DBA spider-senses say this is all right.

anymeal
m_database.open(dir.filePath("anymeal.sqlite").toUtf8().constData());

It took my rusty file-sleuthing skills a bit longer than I wanted but that database finally was uncovered:
.local/share/anymeal/anymeal.sqlite

Cool, so other apps could read that, perhaps to check ingredients for allergies or whatever.

A brief recovery test, renaming the database file and replacing with an empty version did as expected. I think that makes up for not being able to select a database inside the app, as something like LibreOffice Base can do.

The recipe "categories" are a bit loose, and as I've found, subject to both interpretation and inconsistent search potential. I'd probably keep "old ASCII" database files separate from Unicode international recipes for ease of sharing. Remains to be seen.

Data quality tests


The first test, loading legacy data, worked fine with Any-Meal (not so with Gourmet, though I didn't investigate further given other faults). Export seemed to work, though I didn't try to load back into Gourmet, since the content looked right on visual review. And once Unicode characters were in a recipe, they would choke the gourmet like a chicken bone.

Writing export files had options for encoding (list below), and a test of exporting multi-byte content to a single byte format created a zero-byte file. A better result would have been an error message; at least the code didn't core dump, as can happen.

Writing Thai characters into menu files was satisfying, in the sense that it worked without a hiccup.
$ cat  stick-rice-utf-8-v2.mmf
MMMMM----------------Meal-Master recipe exported by AnyMeal-----------------

Title: Sticky Rice
Categories: Rice
Yield: 1 Bowl

Sticky rice, cooked
Coconut milk [ ????
-] [ Kathi ]
Fruit

Cook rice
:Pour coconut milk over to thicken and sweeten
:Eat with sliced fruit (banana, mango, peaches, etc.)

MMMMM

Naturally, copy-paste in WordPress language-specific diversions doesn't do what I wanted, which should show this:


Correct characters


 







Sticky rice


 

Data load was 100% successful, but were the data correct? Always a good idea to verify a restore with a test suite kitchen.


Americanized [sic] recipe


This is a "data quality" failure as only one ingredient was correctly parsed into the correct data storage. The remainder went into the instructions area, so either the parser logic is faulty (or that format unsupported) or the source data was mangled. A candidate for data audit.

Meta data "brown clipping -- get story" is another branch in need of inspection.

Most were fine on review, meaning the errors are limited to typos or truncations ("oh, I'll type the rest of this/look it up later...").


Bread + Butter Pickles


In this "caught" example, all units look valid except cider vinegar. The legacy logic includes a finite set of measurement types, like a data dictionary of sorts or a benchmarking standards document (the protocols, not the bakes-offs).
Machinely intelligent


Handwriting analysis: ก๋วยเตี๋ยว


This is a positive helpful result of scanning hand-written language text and letting a digital translation service identify the precise phrase. Understanding that optical character recognition has evolved in fantastic dimensions since the first "human readable" star trek miracles I saw in the 1970s IBM research labs on school field trips.

Phonetic translations, like those "lost to the mists of time", were more problematic. The above image shows a pronunciation guide starting with the letters "kwyte"; however, in source materials, I'm seeing this as "qweet" which may be a homophone yet be unhelpful as a search seed.


Yolm


Same as:

ยำ

Usability and usefulness


The old joke about computerizing recipes was asking, "now, how does that dish get made?" Though, in the discussion found on Y Combinator about Any-meal people chatted about robot chefs, so maybe not that funny any more.

But the focus is on the right tool for the right jobs, and this job is only a store and retrieve mechanism, not an online health app or johnny cab driver and plongeur.

The early favorite suspect, Gourmet, has good features and workflow, in its minor orbit.

Coincidentally, the app that I chose was available in a prior incarnation back about 15 years ago; the links below are broken though the material has been migrated to a different URL.

In usability testing, one aspect might be how closely new app screen resembles previous forms, whether digital or paper. Back in the 1980s, dBASE II/III/IV was the bomb, you could write screen forms that worked with a backend database, placing text and enterable columns free form. The art form has evolved and the goal is still the same, keep the user happy by simplifying, you know, returning to standard.

Alternate paths



  • ISO 8859-1 ("Latin-1")

  • ISO 8859-15

  • CP850

  • UTF-8 (Unicode)

  • US-ASCII ("7 bit")


Choosing to support both of these as primary integration streams was wise, since the first lets "ASCII-fied/Americanized" other apps work cleanly, and the second becomes a global sharing platform.


Export data integration formats


ANY-MEAL-EXPORT-FROM-SHIRLEY-2023.mm: ISO-8859 text, with CRLF, CR line terminators
sticky-rice-utf-8-v2.mmf: Unicode text, UTF-8 text, with CRLF line terminators

Perl


https://metacpan.org/pod/MealMaster
561 Aug 23 2018 src/MealMaster/MealMaster-0.28/demo.pl
CHANGES file for MealMaster:
0.28 Sat May 28 10:51:21 BST 2005
- first release

My demo above, 2009.

Python


https://github.com/samjavner/recipeformats
Languages: Python (100.0%)d64672e on Dec 6, 2014
https://github.com/samjavner/recipeformats/blob/master/mmf.py

You may run into issues with text encoding, as Meal-Master is an old program.
You may have to use something like encoding='cp437' depending on the file."
extras

Links related to the chosen app

https://github.com/wedesoft/anymeal

https://wedesoft.github.io/anymeal/

https://web.archive.org/web/20081221021301/http://episoft.home.comcast.net/~episoft/mmdown.htm

https://news.ycombinator.com/item?id=23738543

Release overview: wedesoft.de/software/2020/06/30/anymeal/

Grammar, formats, data dictionary notes: wedesoft.de/software/2020/07/07/mealmaster/

Donate to the The Water Project!
https://thewaterproject.org/
links of historic interest

https://thinkle.github.io/gourmet/
https://github.com/kirienko/gourmet
http://grecipe-manager.sourceforge.net/
https://github.com/thinkle/gourmet
Gourmet 0.17.4 released!
Latest
on Jun 5, 2014
+ 8 releases

 

Pulp fiction


Image from the 2020 case of the missing pantry butler, showing the several data interchange formats supported by Gourmet.



One is their own XML file, one is a rival "My CookBook" I don't need, and the HTML, Meal-M and text formats.

https://blogs.sap.com/2007/04/19/cooking-and-software-efficiency/

https://blogs.sap.com/2009/07/19/how-to-cook-with-logic/

http://www.wedesoft.demon.co.uk/anymeal-api/mealmaster.html#mealmasterFormatGrammarLegend

Code from my archives circa 2009:
#!/usr/pkg/bin/perl

use MealMaster;

my $mm = MealMaster->new();
# my @recipes = $mm->parse(“t/31000.mmf”);
# my @recipes = $mm->parse(“SAMPLE.TXT”);
my @recipes = $mm->parse(“MJEDDRAH.txt”);
foreach my $r (@recipes) {
print “Title: ” . $r->title . ”

*
bash-3.2$ ./recipe-demo.pl
Title: INDIAN LENTIL & VEGETABLE STEW (MJEDDRAH)
Categories: East/orient, Stews, Vegetables

As it turns out, "Indian" might be as misnamed as that Columbus person's reputation in this dish, as Mjeddrah appears to be an Arabic word, rather than Hindi or Bengali or other south Asian languages. My bad, not researching further earlier.

 

 
Top kudoed authors