Jump to content

Simple database: Difference between revisions

m
Formatting
(Added PicoLisp)
m (Formatting)
Line 8:
 
You should track the following details:
* A description of the item. (ege.g., title, name)
* A category or tag (genre, topic, relationship (friend,such family)as “friend” or “family”)
* A date (either the date when the entry was made or some other date that is meaningful, (like the birthday)); (the date may be generated or entered manually)
* Other optional fields
 
Line 19:
* Print all entries sorted by a date
 
The category may be realized as a tag or as structure (by making all entries in that category subitems)
 
The fileformatfile format on disk should be human readable, but it need not be standardized. A natively available format that doesn't need an external library is preferred. Avoid developing your own format however if you can use an already existing one. If there is no existing format available pick one of: [[JSON]], [[S-Expressions]], [[YAML]], or [[wp:Comparison_of_data_serialization_formats|others]].
 
See also [[Take notes on the command line]] for a related task.
 
=={{header|Common Lisp}}==
aA tool to track the episodes you have watched in a series.
testedTested with [[SBCL]] but should work with other implementations.
 
runRun from the commandline as:
a tool to track the episodes you have watched in a series.
tested with [[SBCL]] but should work with other implementations.
 
run from the commandline as:
sbcl --script watch.lisp
 
withoutWithout arguments the function <code>(watch-list)</code> is invoked to show the last episode of each series.
withWith the argument <code>add</code> the function <code>(watch-add)</code> will allow you to add a new episode with series name, episode title, episode number and date watched. ifIf the series does not yet exist, you will be asked if you want to create it.
 
this code is also available under the GNU GPLv3.
 
thisThis code is also available under the GNU GPLv3.
<lang lisp>(defvar db nil)
 
Line 231 ⟶ 230:
 
=={{header|Pike}}==
{{trans|Common Lisp}}
an almost direct translation from common lisp:
<lang Pike>mapping db = ([]);
 
Line 388 ⟶ 387:
 
=={{header|Ruby}}==
 
<lang ruby>require 'date'
require 'json'
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.