[Omaha.pm] pseudo-code, browser-based ERDs

Jay Hannah jay at jays.net
Fri Mar 28 10:59:17 PDT 2008


Page 2 of this .pdf has a flow-control diagram:

http://www.advms.pl/roczniki_2005_supl_2/volumes/04_Borowska.pdf

A couple days ago someone asked me how to implement that in source code 
with NO goto statements. (Because (1) goto statements are evil, and (2) 
MATLAB doesn't support them.)

Here's the psuedo-code I wrote. It looks right to me? Seemed like a 
simple task?  -ponder-

c=1
j=0
i=-1
k=1
kmax=1
while (1) {
   if (s[i+k]==s[j+k]) {
      k=k+1;
      if (j+k > N-1) {
         c = c+1
         return     # or last or whatever
      }
   } else {
      if (k > kmax) {
         kmax = k
      }
      i = i + 1
      if (i==j) {
         c = c + 1;
         j = j + kmax;
         if (j + 1 > N - 1) {
            return;
         } else {
             i = -1
             k = 1
             kmax = 1
         }
      } else {
         k = 1
      }
   }
}

-----------

WWW SQL Designer is way too cool. 2.0 was released today:

http://ondras.zarovi.cz/sql/

This tool allows you to draw and create database schemas (E-R diagrams) 
directly in browser, without the need for any external programs (flash). 
You only need JavaScript enabled.


Data Monkeys represent!


Cheers,

j




More information about the Omaha-pm mailing list