iAiFo

              В 1991 году Митч Кэпор, создатель
              конкурирующей компании Lotus сказал
              репортерам: “Революция закончена.
              Билл Гейтс победил. Нынешняя промышленность
              программного обеспечения -- это Царство Мертвых”.

## Для чего писать скрипты?

  0. Списки пользователей (bash)
  1. Почтовые рассылки (bash, sed, awk, tr)
  2. Очистка строительного мусора (make)
  3. Фильтры (regex, grep)
  4. Перекодировщики (bash, iconv, PS:Out-File <fname> -Encoding ascii)
  5. Шифрование
  6. Генерация скрипта как лог работы с GUI


              ..две ошибки, которые есть в традиционных
              курсах программирования. И первая ошибка,
              ее можно назвать так, это "лишние знания".

              Константин Шеремет,
              Азбука программирования на языке C.

## Для чего писать программы?

  7. Усвоить работу с алгоритмами (EPL (eucip), flowgorithm, raptor)
  8. Пройти курс "Основы программирования" и "Базы данных" (C, C#, SQL)
  9. Понять темы ОС:Ядро, ОС:API, ОС:Драйверы
  A. Строить WEB-сайты (PHP, HTML, CSS, JavaScript). /причины/

## Приложение А

  start
    call Open_Graph_Window( 640, 480)
    call Draw_Circle( 320, 240, 200, Red, 1)
    Wait_For_Key( )
    call Close_Graph_Window( )
  end

Martin Carlisle Raptor converter

  using System;
  using System.IO;
  using System.Text;

  namespace API
  {
     public class main_class
     {
        static System.Random random_generator = new System.Random();
        public static void Main(string[] args)
        {
           open_graph_window(640,480);
           draw_circle(320,240,200,red,1);
           wait_for_key();
           close_graph_window;
        }
     }
  }

Solution: name Target

  // Solution -> Console Application
  // add References -> System.Drawing
  // add References -> System.Windows.Forms

  // Conclusion: Porting from Raptor highly
  // inefficient without Martin Carlisle converting API.

  using System;
  using System.Drawing;
  using System.Windows.Forms;

  namespace target {

    class MainForm : Form {

      private const int mTargetR = 500;
      private const int mMarginL = (580 - mTargetR)/2;
      private const int mMarginT = (550 - mTargetR)/2;

      private Pen mPen, mPenR;
      private SolidBrush mBrush ,mBrushB, mBrushR;

      public MainForm() {
        this.Size = new Size(600, 600);
        mPen = new Pen( Color.Black, 1);
        mPenR = new Pen( Color.Red, 1);
        mBrush = mBrushB = new SolidBrush( Color.Black);
        mBrushR = new SolidBrush( Color.Red);
      }

      protected override void OnPaint(PaintEventArgs e) {
        Rectangle rect;
        Graphics g = e.Graphics;
        int R = 30;
        while (R < mTargetR) {
          rect = new Rectangle(
            mMarginL+R/2, mMarginT+R/2, mTargetR-R, mTargetR-R
          );
          g.DrawEllipse( mPen, rect);
          g.FillEllipse( mBrush, rect);
          R += 20;
          mBrush = (mBrush == mBrushB) ? mBrushR : mBrushB;
        }
      }
    }

    class Program {
      public static void Main(string[] args) {
        Application.Run( new MainForm());
      }
    }
  }

From

  https://stackoverflow.com/questions/38903150
  /integrate-a-c-sharp-console-application-with-a-gui

If you're just looking for a barebones GUI and aren't too worried about it looking polished, I'd suggest you right click on your project

  -> add Windows Form

Then, turning your your Console App into a GUI based application is as simple as instantiating your Form-derived class and calling .ShowDialog().

Note: if you create a new class by clicking PROJECT->Add Windows Form, then this class definition and the constructor are automatically created for you.

Example:

  using System.Windows.Forms;

  // Open MyFancyForm.cs, right click on the form,
  // and click View Code to see it.

  public partial class MyFancyForm : Form
  {
      public MyFancyForm()
      {
          InitializeComponent();
      }
  }

  static void Main(string[] args)
  {
       var guiForm = new MyFancyForm();

       //This "opens" the GUI on your screen

       guiForm.ShowDialog();
  }

It's that simple. I suggest you add add a new class to your project as a WindowsForm instead of just a class so that you have access to the form designer. Of course, it's up to you to add fields to your form class and have it populate the GUI appropriately.

Edit: if you wish replace the Console entirely, right click on your project->properties and then change "output type" to Windows Application.


## Приложение Б

## Vene latinisatsioonide võrdlev tabel

  https://www.eki.ee/knab/tab_rula.htm

Eesti transkriptsioon (traditsiooniline vene nimede kirjutusviis Eestis, viimane versioon vastavalt valitsuse määrusele 1998. a)

Kõigis tabelites latiniseeritakse ühtmoodi järgmisi tähti:

  +-------+
  | А | A |
  |---+---|
  | Б | B |
  |---+---|
  | В | V |
  |---+---|
  | Г | G |
  |---+---|
  | Д | D |
  |---+---|
  | Ж | Ž |
  |---+---|
  | З | Z |
  |---+---|
  | К | K |
  |---+---|
  | Л | L |
  |---+---|
  | М | M |
  |---+---|
  | Н | N |
  |---+---|
  | О | O |
  |---+---|
  | П | P |
  |---+---|
  | Р | R |
  |---+---|
  | Т | T |
  |---+---|
  | У | U |
  |---+---|
  | Ф | F |
  |---+---|
  | Ы | Õ |
  +-------+
  | Э | E |
  +-------+

Диграфы

  +--------------+-----------------------------+
  | Ц            | TS                          |
  +--------------+-----------------------------+
  | Ч            | TŠ                          |
  +--------------+-----------------------------+
  | Ш            | Š                           |
  +--------------+-----------------------------+
  | Щ            | ŠTŠ                         |
  +--------------+-----------------------------+
  | Ю            | JU                          |
  +--------------+-----------------------------+

Erinevalt latiniseeritakse järgmisi tähti ja täheühendeid (näidetega):

  +--------------------------------------------+
  | Vene         | Eesti transkr               |
  +--------------+-----------------------------+

  +--------------+-----------------------------+
  | Е            | E                           |
  +--------------+-----------------------------+
  |              | JE (sõna algul, samuti      |
  |              | vokaali, ъ ning ь-märgi     |
  |              | järel)                      |
  +--------------+-----------------------------+
  | Егор         | Jegor                       |
  +--------------+-----------------------------+
  | Караев       | Karajev                     |
  +--------------+-----------------------------+

  +--------------+-----------------------------+
  | Ё            | JO                          |
  +--------------+-----------------------------+
  | Москалёв     | Moskaljov                   |
  +--------------+-----------------------------+
  |              |                             |
  |              | O (ж, ч, ш ja ч järel)      |
  |              |                             |
  +--------------+-----------------------------+
  | Жёлтый       | Žoltõi                      |
  +--------------+-----------------------------+
  | Ёж           | Jož                         |
  +--------------+-----------------------------+

  +--------------+-----------------------------+
  | И            | I                           |
  +--------------+-----------------------------+
  |              | J (sõna algul vokaali ees)  |
  +--------------+-----------------------------+
  | Иосиф        | Jossif                      |
  +--------------+-----------------------------+
  | ий           | i (kahe- ja enamasilbilise  |
  |              | sõna lõpul)                 |
  +--------------+-----------------------------+
  | Кленский     | Klenski                     |
  +--------------+-----------------------------+

  +--------------+-----------------------------+
  | Й            | I                           |
  +--------------+-----------------------------+
  | Май          | Mai                         |
  +--------------+-----------------------------+
  |              | J (sõna algul vokaali ees)  |
  +--------------+-----------------------------+
  | Йодное       | Jodnoje                     |
  +--------------+-----------------------------+

  +--------------+-----------------------------+
  | С            | S                           |
  +--------------+-----------------------------+
  |              | SS (vokaalide vahel ja sõna |
  |              | lõpul vokaali järel (v. a   |
  |              | liitsõnalise                |
  |              | järelkomponendi algul olev  |
  |              | täht, mille võib asendada   |
  |              | ühekordse vastega))         |
  +--------------+-----------------------------+
  | Косиков      | Kossikov                    |
  +--------------+-----------------------------+
  | Новосельский | Novoselski                  |
  +--------------+-----------------------------+
  | Денис        | Deniss                      |
  +--------------+-----------------------------+

  +--------------+-----------------------------+
  | Х            | H                           |
  +--------------+-----------------------------+
  | Харламов     | Harlamov                    |
  +--------------+-----------------------------+
  |              | HH (vokaalide vahel ja sõna |
  |              | lõpul vokaali järel (v. a   |
  |              | liitsõnalise                |
  |              | järelkomponendi algul olev  |
  |              | täht, mille võib asendada   |
  |              | ühekordse vastega))         |
  +--------------+-----------------------------+
  | Тихомиров    | Tihhomirov                  |
  +--------------+-----------------------------+
  | Самоходов    | Samohodov                   |
  +--------------+-----------------------------+

  +--------------+-----------------------------+
  | Ъ            | jääb ära, virtuaalne tühik  |
  +--------------+-----------------------------+
  | Разъездов    | Razjezdov                   |
  +--------------+-----------------------------+

  +--------------+-----------------------------+
  | Ь            | (jääb ära)                  |
  +--------------+-----------------------------+
  | Игорь        | Igor                        |
  +--------------+-----------------------------+
  |              | J (и ees)                   |
  |              |                             |
  +--------------+-----------------------------+
  | Ильич        | Iljitš                      |
  +--------------+-----------------------------+
  | Васильев     | Vassiljev                   |
  +--------------+-----------------------------+

  +--------------+-----------------------------+
  | Я            | JA                          |
  +--------------+-----------------------------+
  | Якимов       | Jakimov                     |
  +--------------+-----------------------------+
  |              | A (и järel eesnimedes       |
  |              | (üksnes väljaspool          |
  |              | dokumente ja teatmeteosed)) |
  +--------------+-----------------------------+
  | Лидия        | Lidija ~ *Lidia             |
  +--------------+-----------------------------+
  | Евгения      | Jevgenija ~ *Jevgenia       |
  +--------------------------------------------+

Transkriptsioonide allikad

 * eesti transkriptsioon: Vabariigi Valitsuse 25.03.1998 määrus nr 66 (RT I 1998, 31/32, 427)


## Приложение В

EPL Syntax

  http://divancoder.ru/2017/06/backus-naur-form/

  https://www.bcskoolitus.ee/sites/default/files
  /EUCIP%20programmeerimiskeel_%20EPL_syntax_0.pdf

EPL (EUCIP Programming Language) is designed to accomodate the need to test basic understanding of programming at the EUCIP core level.  It is based on a subset of C, and is consistent with core programming constructs found in contemporary programming languages such as Java and C++. The main elements that have been removed from the original C syntax are:

  + "Shorthand" assignment operators such as += and &=.
  + Only simple identfiers (char, int and float) have been retained.
  + All sc specifiers (e.g. auto, static) have been removed.
  + All syntax pertaining to structures has been removed
  + “Non-procedural”  statements (e.g. goto, case and switch)  have been removed.
  + All pre-processor statements have been removed.

It is believed that even with this simplified syntax most of  the core aspects of programming related to algorithmic understanding, syntactic understanding and the flavour of contemporary programming have been retained.

It is expected that candidates to the core level “Build” module will be able to understand and answer questions that utilize EPL. Candidates are permitted to have a reference copy of the syntax when undergoing testing.

The EPL syntax is formally defined in the following paragraphs:

1. Expressions

  expression:
      primary
          - expression
          ! expression
          expression binop expression
          lvalue =  expression
          expression , expression

      primary:
          identifier
          constant
          ( expression )
          primary ( opt-expression-list )
          primary [ expression ]

      lvalue:
          identifier
          primary [ expression]
          ( lvalue )

The primary-expression operators

  ( )  [ ]

have highest priority and group left-to-right.

The unary operators

  -

binop:

  *   /
  +   <   >   <=    >=
  ==  !=
  &&
  ||

Assignment operator (=) groups right-to-left.

The comma operator (,) has the lowest priority, and groups left-to-right.

2. Declarations

  declaration:
      decl-specifiers opt-init-declarator-list ;

  decl-specifiers:
      type-specifier opt-decl-specifiers

  type-specifier:
      char
      int
      float
      typedef-name

  init-declarator-list:
      init-declarator
      init-declarator , init-declarator-list

  init-declarator:
      declarator opt-initializer

  declarator:
      identifier
      ( declarator )
      declarator ()
      declarator [ opt-constant-expression ]

  initializer:
      = expression
      = { initializer-list }
      = { initializer-list , }

  initializer-list:
      expression
      initializer-list , initializer-list
      { initializer-list }

3. Statements

  compound-statement:
      {opt-declaration-list  opt-statement-list }
      if ( expression ) statement else statement
      while ( expression ) statement
      do statement while ( expression );
      for ( opt-expression-1 ; opt-expression-2 ; opt-expression-3 ) statement
      return ;
      return  expression ;
      ;

4 External definitions

  program:
      external-definition
      external-definition program

  external-definition:
      function-definition
      data-definition

  function-definition:
      opt-type-specifier function-declarator function-body

  function-declarator:
      declarator ( opt-parameter-list)

  parameter-list:
      identifier
      identifier, parameter-list

  function-body:
      type-decl-list function-statement

  function-statement:
      { opt-declaration-list statement-list }

  data-definition:
      opt-type-specifier, opt-init-declarator-list;
      opt-type-specifier opt-init-declarator-list;

5 Input/Output Standard for EPL

  printf ("message", variables list)
  readf (variables list)
