JBLLL

        It does a lot of things half well and it's just a 
        garbage heap of ideas that are mutually exclusive. 
        (Ken Thompson on C++)

        Seibel, Peter (2009). Coders At Work. p. 475.
        
# About text file formats
-------------------------

BE  - big endian
LE  - little endian
BOM - Byte order mark:

  UTF-16: ff fe
  UTF-8:  ef bb bf
 
  EOL: 0d 0a   Windows
       0a      Unix

ANSI C -> C++ -> C#


# FROM ANSI C STANDARD LIBRARY
------------------------------

  http://www.csse.uwa.edu.au/programming/ansic-library.html

<ctype.h>

// isalpha(c) or isdigit(c) :

1   int isalnum(int c);  

// isupper(c) or islower(c) :

2   int isalpha(int c);  

// is control character :

3   int iscntrl(int c);  

// is decimal digit :

4   int isdigit(int c);  

// is printing character other than space :

5   int isgraph(int c);  

// is lower-case letter :

6   int islower(int c);  

// is printing character (including space) :

7   int isprint(int c);  

// is printing character other than space, letter, digit :

8   int ispunct(int c);  

// is space, formfeed, newline, carriage return, tab, vertical tab :

9   int isspace(int c);  

// is upper-case letter :

10  int isupper(int c);  

// is hexadecimal digit :

11  int isxdigit(int c); 

// return lower-case equivalent :

12  int tolower(int c);  

// return upper-case equivalent :

13  int toupper(int c);  

<string.h>

// Copy ct to s including terminating NUL. Return s. :

14  char* strcpy(char* s, const char* ct);  

// Copy at most n characters of ct to s Pad with NULs if ct is of length less than n. Return s. :

15  char* strncpy(char* s, const char* ct, int n);  

// Concatenate ct to s. Return s. :

16  char* strcat(char* s, const char* ct);  

// Concatenate at most n characters of ct to s. Terminate s with NUL and return it. :

17  char* strncat(char* s, const char* ct, int n);  

// Compare cs and ct. Return negative if cs < ct, zero if cs == ct, positive if cs > ct. :

18  int strcmp(const char* cs, const char* ct);  

// Compare at most n characters of cs and ct. Return negative if cs < ct, zero if cs == ct, positive if cs > ct. :

19  int strncmp(const char* cs, const char* ct, int n);  

// Return pointer to first occurrence of c in cs, or NULL if not found. :

20  char* strchr(const char* cs, int c);  

// Return pointer to last occurrence of c in cs, or NULL if not found. :

21  char* strrchr(const char* cs, int c);  

// Return length of prefix of cs consisting entirely of characters in ct. :

22  size_t strspn(const char* cs, const char* ct);  

// Return length of prefix of cs consisting entirely of characters not in ct. :

23  size_t strcspn(const char* cs, const char* ct);  

// Return pointer to first occurrence within cs of any character of ct, or NULL if not found. :

24  char* strpbrk(const char* cs, const char* ct);  

// Return pointer to first occurrence of ct in cs, or NULL if not found. :

25  char* strstr(const char* cs, const char* ct);  

// Return length of cs. :

26  size_t strlen(const char* cs);  

// Return pointer to implementation-defined string corresponding with error n. :

27  char* strerror(int n);  

// A sequence of calls to strtok returns tokens from s delimted by a character in ct. Non-NULL s indicates the first call in a sequence. ct may differ on each call. Returns NULL when no such token found. :

28  char* strtok(char* s, const char* t);  

// Copy n characters from ct to s. Return s. Does not work correctly if objects overlap. :

29  void* memcpy(void* s, const void* ct, int n);  

// Copy n characters from ct to s. Return s. Works correctly even if objects overlap. :

30  void* memmove(void* s, const void* ct, int n);  

// Compare first n characters of cs with ct. Return negative if cs < ct, zero if cs == ct, positive if cs > ct. :

31  int memcmp(const void* cs, const void* ct, int n);  

// Return pointer to first occurrence of c in first n characters of cs, or NULL if not found. :

32  void* strchr(const char* cs, int c, int n);  

// Replace each of the first n characters of s by c. Return s. :

33  void* strchr(char* s, int c, int n);  


DECIMAL TO HEX CONVERTER

  https://www.geeksforgeeks.org/program-decimal-hexadecimal-conversion/

Example C#

  using System;
  using System.Linq;

  class GFG {
      static string int2hex(int an) {
          string strHex = "";
          int remainder = 0;
          
          while (an != 0) {
              remainder = an % 16;
              if (remainder < 10) strHex += (char)(remainder + 48);
              else                strHex += (char)(remainder + 55);
              an /= 16;
          }

          return new string(strHex.Reverse().ToArray());
      }

      public static void Main(String[] args) {
          int n = 2545;
          Console.WriteLine( n + " -> " + int2hex(n));
          Console.ReadKey();
      }
  }


Example: Flowgorithm API

TODO: isInteger, isReal, isBoolean, more..

<?xml version="1.0"?>
<flowgorithm fileversion="2.11">
    <attributes>
        <attribute name="name" value=""/>
        <attribute name="authors" value=""/>
        <attribute name="about" value=""/>
        <attribute name="saved" value=""/>
        <attribute name="created" value=""/>
        <attribute name="edited" value=""/>
        <attribute name="edited" value=""/>
        <attribute name="edited" value=""/>
        <attribute name="edited" value=""/>
    </attributes>
    <function name="Main" type="None" variable="">
        <parameters/>
        <body>
            <call expression="containerEncrypt()"/>
        </body>
    </function>
    <function name="beginTokenAt" type="Integer" variable="j">
        <parameters>
            <parameter name="aS" type="String" array="False"/>
            <parameter name="aT" type="Integer" array="False"/>
        </parameters>
        <body>
            <declare name="fBreak" type="Boolean" array="False" size=""/>
            <declare name="j, t" type="Integer" array="False" size=""/>
            <assign variable="fBreak" expression="false"/>
            <assign variable="j" expression="aT"/>
            <assign variable="t" expression="Len( aS) - 1"/>
            <assign variable="fBreak" expression="false"/>
            <while expression="!fBreak">
                <if expression="Char( as, j) != &quot; &quot;">
                    <then>
                        <assign variable="fBreak" expression="true"/>
                    </then>
                    <else>
                        <assign variable="j" expression="j+1"/>
                        <if expression="j &gt;= t">
                            <then>
                                <assign variable="fBreak" expression="true"/>
                            </then>
                            <else/>
                        </if>
                    </else>
                </if>
            </while>
        </body>
    </function>
    <function name="bin2int" type="Integer" variable="vN">
        <parameters>
            <parameter name="aS" type="String" array="False"/>
        </parameters>
        <body>
            <declare name="vN" type="Integer" array="False" size=""/>
            <assign variable="vN" expression="0"/>
            <declare name="upper" type="Integer" array="False" size=""/>
            <assign variable="upper" expression="Len( aS) - 1"/>
            <declare name="i" type="Integer" array="False" size=""/>
            <for variable="i" start="0" end="upper" direction="inc" step="1">
                <assign variable="vN" expression="vN * 2"/>
                <if expression="Char( aS, i) == &quot;0&quot;">
                    <then/>
                    <else>
                        <assign variable="vN" expression="vN + 1"/>
                    </else>
                </if>
            </for>
        </body>
    </function>
    <function name="containerBeginEndTokenAt" type="None" variable="">
        <parameters/>
        <body>
            <declare name="s" type="String" array="False" size=""/>
            <declare name="start, stop" type="Integer" array="False" size=""/>
            <assign variable="start" expression="0"/>
            <input variable="s"/>
            <while expression="start &lt; Len( s) - 1">
                <assign variable="stop" expression="endTokenAt( s, start)"/>
                <output expression="substring( s, start, stop)" newline="True"/>
                <assign variable="start" expression="beginTokenAt(s, stop)"/>
            </while>
        </body>
    </function>
    <function name="containerBin2int" type="None" variable="">
        <parameters/>
        <body>
            <declare name="bS" type="String" array="False" size=""/>
            <input variable="bS"/>
            <output expression="bin2int( bS)" newline="True"/>
        </body>
    </function>
    <function name="containerEncrypt" type="None" variable="">
        <parameters/>
        <body>
            <declare name="i" type="Integer" array="False" size=""/>
            <declare name="s" type="String" array="False" size=""/>
            <declare name="se" type="String" array="False" size=""/>
            <input variable="s"/>
            <assign variable="se" expression="&quot;&quot;"/>
            <for variable="i" start="0" end="Len( s) - 1" direction="inc" step="1">
                <assign variable="se" expression="se &amp; int2bin( toCode( Char( s, i))) &amp; &quot; &quot;"/>
            </for>
            <output expression="se" newline="True"/>
            <declare name="start, stop" type="Integer" array="False" size=""/>
            <assign variable="start" expression="0"/>
            <while expression="start &lt; Len( se) - 1">
                <assign variable="stop" expression="endTokenAt( se, start)"/>
                <output expression="toChar( bin2int( substring( se, start, stop-1))) &amp; &quot; &quot;" newline="False"/>
                <assign variable="start" expression="beginTokenAt(se, stop)"/>
            </while>
        </body>
    </function>
    <function name="containerMerge" type="None" variable="">
        <parameters/>
        <body>
            <declare name="a" type="Integer" array="False" size=""/>
            <for variable="a" start="0" end="90" direction="inc" step="5">
                <output expression="mergeStrings(&quot;sin(&quot; &amp; toString(a) &amp; &quot;) = &quot; &amp; toString( sin( deg2rad(a))), 30, &quot;cos(&quot; &amp; toString(a) &amp; &quot;) = &quot; &amp; toString( cos( deg2rad(a))))" newline="True"/>
            </for>
        </body>
    </function>
    <function name="containerParse" type="None" variable="">
        <parameters/>
        <body>
            <declare name="s" type="String" array="False" size=""/>
            <input variable="s"/>
            <declare name="nxt, pos, vto" type="Integer" array="False" size=""/>
            <assign variable="pos" expression="-1"/>
            <assign variable="nxt" expression="0"/>
            <if expression="Len(s) != 0">
                <then>
                    <while expression="nxt != pos">
                        <assign variable="pos" expression="nxt"/>
                        <assign variable="nxt" expression="nextTokenAt( s, pos)"/>
                        <if expression="nxt == pos">
                            <then>
                                <assign variable="vto" expression="Len(s) - 1"/>
                            </then>
                            <else>
                                <assign variable="vto" expression="nxt - 1"/>
                            </else>
                        </if>
                        <output expression="subString( s, pos, vto)" newline="True"/>
                    </while>
                </then>
                <else/>
            </if>
        </body>
    </function>
    <function name="containerTestThemAll" type="None" variable="">
        <parameters/>
        <body>
            <declare name="s" type="String" array="False" size=""/>
            <input variable="s"/>
            <call expression="containerToHex( s)"/>
            <output expression="toUpper( S)" newline="True"/>
            <output expression="toLower( S)" newline="False"/>
        </body>
    </function>
    <function name="containerToHex" type="None" variable="">
        <parameters>
            <parameter name="as" type="String" array="False"/>
        </parameters>
        <body>
            <declare name="i" type="Integer" array="False" size=""/>
            <for variable="i" start="0" end="len( aS) - 1" direction="inc" step="1">
                <output expression="toString( int2hex( toCode( char( aS, i)))) &amp; &quot; &quot;" newline="False"/>
            </for>
            <output expression="toChar( 13)" newline="False"/>
        </body>
    </function>
    <function name="containerTrim" type="None" variable="">
        <parameters/>
        <body>
            <declare name="s" type="String" array="False" size=""/>
            <input variable="s"/>
            <output expression="trim( s)" newline="True"/>
        </body>
    </function>
    <function name="deg2rad" type="Real" variable="r">
        <parameters>
            <parameter name="a" type="Integer" array="False"/>
        </parameters>
        <body>
            <declare name="r" type="Real" array="False" size=""/>
            <assign variable="r" expression="a * PI / 180"/>
        </body>
    </function>
    <function name="endTokenAt" type="Integer" variable="i">
        <parameters>
            <parameter name="as" type="String" array="False"/>
            <parameter name="at" type="Integer" array="False"/>
        </parameters>
        <body>
            <declare name="fBreak" type="Boolean" array="False" size=""/>
            <declare name="i, t" type="Integer" array="False" size=""/>
            <assign variable="fBreak" expression="false"/>
            <assign variable="i" expression="at"/>
            <assign variable="t" expression="Len( aS) - 1"/>
            <while expression="!fBreak">
                <if expression="Char( as, i) == &quot; &quot;">
                    <then>
                        <assign variable="fBreak" expression="true"/>
                    </then>
                    <else>
                        <assign variable="i" expression="i+1"/>
                        <if expression="i &gt;= t">
                            <then>
                                <assign variable="fBreak" expression="true"/>
                            </then>
                            <else/>
                        </if>
                    </else>
                </if>
            </while>
        </body>
    </function>
    <function name="int2bin" type="String" variable="vS">
        <parameters>
            <parameter name="aN" type="Integer" array="False"/>
        </parameters>
        <body>
            <declare name="vS" type="String" array="False" size=""/>
            <declare name="number, remainder" type="Integer" array="False" size=""/>
            <assign variable="vS" expression="&quot;&quot;"/>
            <assign variable="remainder" expression="-1"/>
            <assign variable="number" expression="aN"/>
            <while expression="number &lt;&gt; 0">
                <assign variable="remainder" expression="number % 2"/>
                <assign variable="vS" expression="remainder &amp; vS"/>
                <assign variable="number" expression="number / 2"/>
            </while>
        </body>
    </function>
    <function name="int2hex" type="String" variable="strHex">
        <parameters>
            <parameter name="an" type="Integer" array="False"/>
        </parameters>
        <body>
            <declare name="strHex" type="String" array="False" size=""/>
            <assign variable="strHex" expression="&quot;&quot;"/>
            <declare name="remainder" type="Integer" array="False" size=""/>
            <while expression="an != 0">
                <assign variable="remainder" expression="an % 16"/>
                <if expression="remainder &lt; 10">
                    <then>
                        <assign variable="strHex" expression="toChar( remainder + 48) &amp; strHex"/>
                    </then>
                    <else>
                        <assign variable="strHex" expression="toChar( remainder + 55) &amp; strHex"/>
                    </else>
                </if>
                <assign variable="an" expression="an / 16"/>
            </while>
        </body>
    </function>
    <function name="lTrim" type="String" variable="s">
        <parameters>
            <parameter name="as" type="String" array="False"/>
        </parameters>
        <body>
            <declare name="s" type="String" array="False" size=""/>
            <declare name="i, m, vFrom" type="Integer" array="False" size=""/>
            <declare name="fBreak" type="Boolean" array="False" size=""/>
            <assign variable="m" expression="Len( as) - 1"/>
            <assign variable="fBreak" expression="False"/>
            <assign variable="vFrom" expression="0"/>
            <for variable="i" start="0" end="m" direction="inc" step="1">
                <if expression="Char( as, i) != &quot; &quot; AND !fBreak">
                    <then>
                        <assign variable="vFrom" expression="i"/>
                        <assign variable="fBreak" expression="true"/>
                    </then>
                    <else/>
                </if>
            </for>
            <assign variable="s" expression="subString( as, vFrom, m)"/>
        </body>
    </function>
    <function name="max" type="Integer" variable="mx">
        <parameters>
            <parameter name="aa" type="Integer" array="False"/>
            <parameter name="ab" type="Integer" array="False"/>
        </parameters>
        <body>
            <declare name="mx" type="Integer" array="False" size=""/>
            <if expression="aa &gt; ab">
                <then>
                    <assign variable="mx" expression="aa"/>
                </then>
                <else>
                    <assign variable="mx" expression="ab"/>
                </else>
            </if>
        </body>
    </function>
    <function name="mergeStrings" type="String" variable="s">
        <parameters>
            <parameter name="asa" type="String" array="False"/>
            <parameter name="at" type="Integer" array="False"/>
            <parameter name="asb" type="String" array="False"/>
        </parameters>
        <body>
            <declare name="s" type="String" array="False" size=""/>
            <declare name="i, j, wa, wb" type="Integer" array="False" size=""/>
            <assign variable="s" expression="&quot;&quot;"/>
            <assign variable="j" expression="0"/>
            <assign variable="wa" expression="Len( asa)"/>
            <assign variable="wb" expression="Len( asb)"/>
            <for variable="i" start="0" end="at + wb - 1" direction="inc" step="1">
                <if expression="i &lt; at">
                    <then>
                        <if expression="i &lt; wa">
                            <then>
                                <assign variable="s" expression="s &amp; Char( asa, i)"/>
                            </then>
                            <else>
                                <assign variable="s" expression="s &amp; &quot; &quot;"/>
                            </else>
                        </if>
                    </then>
                    <else>
                        <assign variable="s" expression="s &amp; Char( asb, j)"/>
                        <assign variable="j" expression="j + 1"/>
                    </else>
                </if>
            </for>
        </body>
    </function>
    <function name="min" type="Integer" variable="mn">
        <parameters>
            <parameter name="aa" type="Integer" array="False"/>
            <parameter name="ab" type="Integer" array="False"/>
        </parameters>
        <body>
            <declare name="mn" type="Integer" array="False" size=""/>
            <if expression="aa &gt; ab">
                <then>
                    <assign variable="mn" expression="ab"/>
                </then>
                <else>
                    <assign variable="mn" expression="aa"/>
                </else>
            </if>
        </body>
    </function>
    <function name="rTrim" type="String" variable="s">
        <parameters>
            <parameter name="as" type="String" array="False"/>
        </parameters>
        <body>
            <declare name="s" type="String" array="False" size=""/>
            <declare name="i, m, vTo" type="Integer" array="False" size=""/>
            <declare name="fBreak" type="Boolean" array="False" size=""/>
            <assign variable="m" expression="Len( as) - 1"/>
            <assign variable="fBreak" expression="False"/>
            <assign variable="vTo" expression="m"/>
            <for variable="i" start="m" end="0" direction="dec" step="1">
                <if expression="Char( as, i) != &quot; &quot; AND !fBreak">
                    <then>
                        <assign variable="vTo" expression="i"/>
                        <assign variable="fBreak" expression="true"/>
                    </then>
                    <else/>
                </if>
            </for>
            <assign variable="s" expression="subString( as, 0, vTo)"/>
        </body>
    </function>
    <function name="subString" type="String" variable="s">
        <parameters>
            <parameter name="as" type="String" array="False"/>
            <parameter name="afrom" type="Integer" array="False"/>
            <parameter name="ato" type="Integer" array="False"/>
        </parameters>
        <body>
            <declare name="s" type="String" array="False" size=""/>
            <declare name="i" type="Integer" array="False" size=""/>
            <assign variable="s" expression="&quot;&quot;"/>
            <for variable="i" start="afrom" end="ato" direction="inc" step="1">
                <assign variable="s" expression="s &amp; Char( as, i)"/>
            </for>
        </body>
    </function>
    <function name="toLower" type="String" variable="su">
        <parameters>
            <parameter name="as" type="String" array="False"/>
        </parameters>
        <body>
            <declare name="su" type="String" array="False" size=""/>
            <declare name="i" type="Integer" array="False" size=""/>
            <assign variable="su" expression="&quot;&quot;"/>
            <for variable="i" start="0" end="Len( as) - 1" direction="inc" step="1">
                <if expression="((toCode( Char( as,i)) &gt;= toCode(&quot;A&quot;)) AND (toCode( Char( as,i)) &lt;= toCode(&quot;Z&quot;))) == True">
                    <then>
                        <assign variable="su" expression="su &amp; toChar(toCode( Char( as, i)) + 32)"/>
                    </then>
                    <else>
                        <assign variable="su" expression="su &amp; Char( as, i)"/>
                    </else>
                </if>
            </for>
        </body>
    </function>
    <function name="toUpper" type="String" variable="su">
        <parameters>
            <parameter name="as" type="String" array="False"/>
        </parameters>
        <body>
            <declare name="su" type="String" array="False" size=""/>
            <declare name="i" type="Integer" array="False" size=""/>
            <assign variable="su" expression="&quot;&quot;"/>
            <for variable="i" start="0" end="Len( as) - 1" direction="inc" step="1">
                <if expression="((toCode( Char( as,i)) &gt;= toCode(&quot;a&quot;)) AND (toCode( Char( as,i)) &lt;= toCode(&quot;z&quot;))) == True">
                    <then>
                        <assign variable="su" expression="su &amp; toChar(toCode( Char( as, i)) - 32)"/>
                    </then>
                    <else>
                        <assign variable="su" expression="su &amp; Char( as, i)"/>
                    </else>
                </if>
            </for>
        </body>
    </function>
    <function name="trim" type="String" variable="s">
        <parameters>
            <parameter name="as" type="String" array="False"/>
        </parameters>
        <body>
            <declare name="s" type="String" array="False" size=""/>
            <assign variable="s" expression="lTrim( rTrim( as))"/>
        </body>
    </function>
</flowgorithm>


# LINKS

1. Flowgorithm vectors & matrices

  http://wscg.zcu.cz/Flowgorithm/Arrays2D/Index.html
  

# ANNEX A. SAMPLE DATA

Flowgorithm loves UNIX formats (EOL:0a, ANSI, UTF-8)

  zero.   zéro.
  one.    une.
  two.    deux.
  three.  trois.
  four.   quatre.
  five.   cinq.
  six.    six.
  seven.  sept.
  eight.  huit.
  nine.   neuf.

ABCDEFGHIJKLMNOPQRSTUVWXYZ










