Posts

Showing posts with the label database

Commmand line pluses.

Image
Open source and the command line is a match made in heaven. The command line allows porting of age old rock solid code to nix. Most command line programs survive in the fact they can do one thing well and be used to pipe data from one form to another all without the fancy gui environment. Text based programs port very well. Of gui front ends can always be added later. For example an old spreadsheet program originally written many years ago for cpm using mbasic still lives with the ability for free basic to recompile (with changes) the code.The following flatfile database originally developed in the DOS environment  is being expanded to have the abilities for a relational database.   Lastly there is a text editor developed in the TRS-80 days that can still be easily used in the command line environment when compiled with freebasic. Programs like dosbox can make the conversion easier.     A bit rusty with it but: Native linux version: ...

Setting up a flat file part 1.

Image
 We are going to setup a simple flat file or two dimensional spreadsheet. What do we want to do with the database I. Design Let us look at the data we might want to collect. Of course file names and the data we want to collect.           Simple database           Datafile: datafile            Metadata: metadat      Name    :      Address :      City    :      State   :      Zip     :  The data we want to collect is described in the meta data file. Sometimes called a data dictionary. With a data dictionary we ca write  a generic routine that will handle different data bases without having to write separate code for each one. 5 Name Addres...

Command line sql database setup.

Image
This is just enough to hang yourself with. #========================================================================== # pseudo-code or generic instructions to set up a lamp web server apps on # Debian based lamp servers you will have to modify it to your needs. # this is assuming a lamp server is already properly set up. # Setup is another discussion. # all rights unreserved by the unknown admin #************************************************************************** # Get file from internet chances are you visited the sit and have the # location of the file to be downloaded. # use Curl for a directory or wget for a single file. use the man pages for # additional instructions wget $website/$subdirectory/$filename # Extract the file in the home directory (not the destination filename for use # in the next step. tar zxvf filename.tar.gz # move the directory into the web document root for use with http # webappdirectory will become webappname sudo...

Experimental mysql database setup scripts.

Image
Some experimental mysql database setup scripts. ( USE AT YOUR OWN RISK !) Original script: #!/bin/bash EXPECTED_ARGS=3 E_BADARGS=65 MYSQL=`which mysql` #Danger do not use GRANT ALL ON *.* Q1="CREATE DATABASE IF NOT EXISTS $1;" Q2="GRANT ALL ON *.* TO '$2'@'localhost' IDENTIFIED BY '$3';" Q3="FLUSH PRIVILEGES;" SQL="${Q1}${Q2}${Q3}" if [ $# -ne $EXPECTED_ARGS ] then echo "Usage: $0 dbname dbuser dbpass" exit $E_BADARGS fi $MYSQL -uroot -p -e "$SQL" To use it, just run: ./createdb testdb testuser secretpass Someone's modified script: #!/bin/bash BTICK=’`’ EXPECTED_ARGS=3 E_BADARGS=65 MYSQL=`which mysql` Q1=”CREATE DATABASE IF NOT EXISTS ${BTICK}$1${BTICK};” Q2=”GRANT ALL ON ${BTICK}$1${BTICK}.* TO ‘$2’@’localhost’ IDENTIFIED BY ‘$3′;” Q3=”FLUSH PRIVILEGES;” SQL=”${Q1}${Q2}${Q3}” if [ $# -ne $EXPECTED_ARGS ] then echo “Usage: $0 dbname dbuser dbpass” exit $E_BADARG...

Simple shell ("sh") database.

Image
From the Rosetta Code --------------------------------- $ sdb create CDs Create DB `CDs' $ sdb add CDs Bookends $ sdb prop CDs Bookends artists "Simon & Garfunkel" $ sdb add CDs "Ode to joy" $ sdb prop CDs "Ode to joy" artist "Beethoven" $ sdb tag CDs Bookends rock folk # I'm not sure about this $ sdb tag CDs "Ode to joy" classical $ sdb show CDs Bookends Description:   artists: Simon & Garfunkel   Tags: folk rock $ sdb prop CDs "Ode to joy" Description "Sym. No. 9" $ sdb show CDs "Ode to joy" Description: Sym. No. 9   artist: Beethoven   Tags: classical $ sdb list-all CDs Tag: classical Ode to joy   Tag: folk Bookends   Tag: rock Bookends   $ sdb drop CDs Delete DB `CDs' $   --------------------   #!/bin/sh   db_create ( ) { mkdir . / "$1" && mkdir "./$1/.tag" && echo "Create DB \ `$1'...

Business office evoluton.

Image
Good old fashioned office. Standalone packages Database: Word processor:   Spreadsheet:   Integrated packages: Office packages: Integrated ERP/CMS: Beyond.....

Business office evoluton.

Image
Good old fashioned office. Standalone packages Database: Word processor:   Spreadsheet:   Integrated packages: Office packages: Integrated ERP/CMS: Beyond.....

Biztools.

Image

Basically.

Image
BASIC (standing for B eginner's A ll Purpose S ymbolic I nstruction C ode) was written (invented) in 1963, at Dartmouth College, by mathematicians John George Kemeny and Tom Kurtzas as a teaching tool for undergraduates. BASIC has been one of the most commonly used computer programming languages, a simple computer language considered an easy step for students to learn before more powerful languages such as FORTRAN . (formula translation) You can read more about the evolution of BASIC at https://en.wikipedia.org/wiki/BASIC . My first computer language was Fortran running on IBM type big iron. Came home from college and saw that my younger brother had purchased a home computer. It was a TRS-80 and came with built in BASIC. I asked my brother how to use it and he stated read the manual. So the next couple of days I devoured the information from the text. BASIC was very much like Fortran, so the transition to learn it was fairly easily. Ended up with the limited memory of...