Codebase list nutsqlite / HEAD
HEAD

Tree @HEAD (Download .tar.gz)

<PRE>
NUT nutrition software
Copyright (C) 1996-2018 by Jim Jozwiak.

   NUT is nutrition software to record what you eat and analyze your meals for
   nutrient composition.  Besides the usual features of nutrition software, NUT
   includes a novel automatic portion control feature that allows you to plan
   nutritious meals when experimenting with different calorie levels, different
   levels of protein, carbohydate, and fat, and different food exclusions.  NUT
   also offers a well-organized presentation of the nutrients that can help you
   learn human nutrition by simply playing with the software.

   NUTsqlite-2.x offers better performance with a newly structured SQLite 
   database that features fully normalized relational tables.  In addition,
   the database itself is functional even without the graphical user interface,
   so it can be used on any device that presents a shell and has sqlite3
   installed.

INSTALLATION of NUTsqlite

1) Determine if you have Tcl available.  If not, check www.activestate.com for
   free (community) versions of Tcl available for desktop operating systems.

2) Download and unzip the full ascii version of the USDA Nutrient Database in
   the same directory where you unzipped the NUTsqlite files "nut.tcl" and
   "updateNUT.tcl".  The NUT homepage at http://nut.sourceforge.net will have
   the USDA zipfile you need or you can get it from the USDA.  The procedure
   will be the same when the USDA releases a new database and you want to
   upgrade your NUTsqlite database while preserving your personal data.
   On the Mac, unzipping a zip file with multiple files in it results in a
   separate directory, so you need to move all these files to the single 
   directory you are going to use.

3) Run "./updateNUT.tcl" to create or upgrade the NUT code in the SQLite
   database that runs the application.  If upgrading, you have to be in the same
   directory as the "nut.db" file, or else you have to modify
   "updateNUT.tcl" on line 24 to provide the full path to the "nut.db" file.
   After this step, "updateNUT.tcl" is not required for anything and can be
   deleted.  Updating the NUT code with "updateNUT.tcl" is independent of
   updating the USDA database, although it is certainly possible that the USDA
   could change the format of their tables so that a later version of
   "updateNUT.tcl" would be required in order to read their tables or display
   new nutrients.  The main idea is that your personal data is permanent even
   though the application code and USDA tables can change as necessary.

   Mac users should do this step from "Terminal" or else modify "updateNUT.tcl"
   adding a line to "cd" to the directory to be used.

4) If you are using a launcher and cannot specify the working directory, you
   will have to modify "nut.tcl" on line 27 to specify the full path to
   "nut.db".  This is especially important for Mac users.

   Another easy change to "nut.tcl" is the location of the SQLite database file.
   There is also a variable "appSize" that can control the size of the window
   and fonts for Linux users when set between approximately 0.7 to 1.3.  
   Windows and Mac users should leave the value of appSize at 0.0 unless they
   have determined the Linux GUI can work well with their system.

5) Run "nut.tcl" to run NUT.  When "nut.tcl" runs initially, it will load
   the USDA files and any personal data that exists in the NUTsqlite version 1
   database, nut.sqlite.  After NUT performs the initial database load, the USDA
   files can be deleted and NUT will not load any more files until it detects a
   new USDA database in the directory from which NUT is running.  All "nut.tcl"
   really does is to start Tcl and cause Tcl to run the code in the SQLite 
   database.  Because the code in the database does not have to be interpreted
   until required, there may also be better performance from the application.

6) The legacy file "nut.sqlite" will no longer be used.  The new database name
   is "nut.db" and often has two auxiliary files that must not be deleted
   because to do so corrupts the database.

Jim Jozwiak
http://nut.sourceforge.net
jozwiak@gmail.com
</PRE>