Saturday, November 11, 2017

Dawolang version 0.0.1 in GitHub an Pub.

* Small, literal word-based message and command language, that 
eventually grows big, but stays always grateful to dartlang, 
it's little brother.
* Helps in standardizing words, that are used in messages, and 
classifying them to groups.
Github:  https://github.com/heiklap/dawolang/issues

A: Area________________A:GLOBAL A:INNER A:LOCAL A:OUTER A:WAY =5
a: Activity____________a:STAND a:TRANSPORT =2
B: Boost??_____________B:HOORAY =1
C: Command_____________C:CHECK-IN C:CUT C:DO C:FIND C:GEAR C:GRAB C:GO C:HIDE C:IGNORE C:LOCK C:ORDER C:OPEN C:PLAY C:RELAY C:RULE =15
c: command_____________c:TEST c:TODO c:USE c:WAIT c:WAKE-UP-SLEEPY-HEAD c:WAKE =6
D: Data________________D:BUS D:FURY D:PHOTO D:SPLIT D:STUFF =5
E: Effort______________E:ANSWER E:CONQUER E:DEVELOPMENT E:GOAL E:PLAN E:TRY =6
F: Functionality_______=0
G: Gear________________G:IDEA G:SHAPE G:STANCE G:VISION =4
H: Human_______________H:ADM H:GROUP H:KING H:SELF H:STAFF H:TEAM H:X-MEN =7
I: Info________________I:EXAMPLE I:GUIDE I:HELP I:HINT I:INFO I:MAP I:NOTE =7
J: Joint_______________J:JOIN J:SHARE =2
K: Kind________________K:KIND =1
L: Lang________________L:MACRO L:RECORD L:TALK =3
M: Message_____________M:MESSAGE M:PING =2
N: Navigate____________N:BACK N:DISTANCE N:DOWN N:FORWARD N:IN N:OUT N:ROUTE N:TO N:UP =9
O: Order_______________O:FIRST O:LAST O:NEXT O:PREVIOUS O:SECOND =5
#: ## Dawo-object ##___#:BATON #:LANG #:MILL #:PLACARD #:VALUE =5
€: Coding______________€:CODE €:INSTANCE =2
P: Phase_______________P:RUN P:START P:STOP =3
Q: Quest_______________Q:HOW-TO Q:QUEST =2
q: quantity____________q:ANY q:EMPTY q:HOW-MANY q:HOW-MUCH q:HOW-LONG q:ONLY q:ONE q:QUARTER =8
R: Resource____________R:AREA R:USED R:USAGE =3
Rx: Resource_special____=0
?: ?                 __?:CLIENT ?:FOR ?:NAME ?:QUIET ?:SECRET =5
&: &                 __=0
S: State_______________S:ABLE S:CLOSED S:NOT-USED S:OFF S:ON S:OPEN S:PROBLEM S:READY S:ROLE =9
s: speed_______________s:FAST s:SLOW =2
T: Time________________T:HIST T:NEW T:NOW T:OLD T:TOMORROW T:TODAY T:YESTERDAY =7
U: Unknown_____________=0
u: unknown_____________=0
V: Valuable____________V:HIGH V:LOL V:LOW V:MID =4
v: ValueLess___________=0
X:  X or Yes___________X:ALLOW X:ASK X:BLOCKED X:GRANT X:MAYBE X:NO X:NOT X:VALID X:YES =9
Y: ____________________=0
Z: Z?__________________Z:ZEN Z:ZACHRA =2


Tuesday, November 7, 2017

Program and data files in dawo 0.0.5

code_snippets, learn / copy-paste stuff:

  • aldente_func : Simple functions, including some logical errors. Can you spot errors?!
  • bat_loop : Control flow structure samples.
  • learn_stream_sync : Examples of simple Streams. So. async stuff.

app files

  • base_lib : Develop common properties, that other libraries should depend on.
  • base_struct : Structuring base classes. These two libraries do not depend other dawo files.
  • chore : Start of bigger "job" / "chore" for real-world-work. Imitating functionality of other, bigger, same kind of library.
  • connector.dart Connecting ( as #client's) app - mission - chore together, mediating them. Seeking deep, inner connections of objects.
  • (? dawlib_coll : Resources. Examples and hacking material of Dart collections.)
  • dawo.dart : main file, exports : dawo_src.dart.
  • dawo_app : DawoApp class, handles Missions and keeps out-put-buffers in Map.
  • dawo_dev : Classes and data, that help in developing this package. Helper functions for cl (command line)and screen output.
  • dawo_src : File created by stagehand plugin app. Here it imports all other libraries and gathers some information about them.
  • effort.dart : Human activities, chores sub, main user-activity and presentation.
  • equipment.dart : Controlling material resources for Mission and Chore.
  • mill : Plan: processing commands orderly, all they in row, by given priorities.
  • missions : Chunk of command-processing between app and chore. Caring Chores. Missions keep and process data ( #clay) of their favorite area.
  • rumba.dart : Rumba classes .dance method runs here dawo's control-flow (once).
  • shower.dart : presentations on console, mostly box-shaped.
  • tools : Helper tools, sleep, stamps, lists aso.


Dawo 0.0.5 Connector, version 1, inspirational ideas for learning.

Beginner Dart programmer sketching class, that allows objects to 
participate in #commonOperation, and connect to other objects there.
Project in early stage, a bunch of inspirational ideas, not meant
to be developed to production app. Learning process.
Structure and documents of Connector class:
/// * Usability: 7%
/// * Hist: hkl  10.9.2017  0.0.1  dawo/lib  connector.dart
#name:  connector ..is not nice. change to: ______ ??
Connector is in deeply planning state. pp -mission - chore work 
together in same sphere, and there must be something, that they 
have in common; abstraction layer, in which they must work together.
* Every #little operation is "connector-operation", and connector has
knowledge for all of them and can interact with them.
* Sending messages between objects. Stance, approach
* "Connector-operations" have access to certain up-level variables.
* Using GlobalOpClass might be too heavy.!!
* ADD IS-GLOBAL bool field to Operation-classes.
* Connector classes might have precedence in Mill-op.
Might trig some action in their connected sister-operations.
Find common interests, "I have been here".. follow-me, give-take
Other objects also handle things connected to this. So connector might
be just  a simple message (plea) mediator.
Global op does something
NOTE:
devNote: tracking begins.
//  ***********************************************************************
/*      connector:  very weak idea, how to accomplish this. 10 %
        Not much of this functionality is yet done.
        
        Name:   #connector is not the right one. Not nice.
        #clients: = app - mission's - chore's

* Get "service calls" from #members:  app - mission - chore; and 
solve them.
* Have rules of privilege for precedence of missions - chores.
* Give TO > mill commands, "work-orders".
* Should have access to class-buffers to seek data.
* Special language #dawolang, to force commands to certain shape.
* #baton : to carry only-one-can-have-at-a-same-time magic thing.
*
* COMMAND ROLL:
* 1. get command, handle parameters.
* 2. Check command against rules. Take - return - reject.
* 3. Full-fill command;  void obey(sender, receiver, baton, msg, flags)
* 4. Get answer, serve back.
* 5. Mark done.
*
* Questions:
* 1. Where do connector work?  Is it upper-level loop?
*    ..  or is it available all the time.  No need to wake it.
* 2. Where, how, and why is #connector invoked?
* 3. ?
*
* IDEA:  All (commands) might happen in #mill. ( an order processor system ).
* IDEA:  #Callback-like service calls.
* IDEA:  #serviceKey #baton, that only one client can have at a time.
* IDEA:  Privilege key.
*
* MAYBE: Incoming commands have certain form. Classes?  Strings?
* MAYBE: Access to #GOAL aso. variables.
* MAYBE:
* MAYBE:
*
* NOT:  Handle #area #resource #time #money aso. properties.
* NOT:
* NOT:
Properties and methods
///  This class gets same structure base, as other important classes.
///  Connecting clients (app-mission-chore) to work together.
class Connector extends BaseStruct {
  String name = 'connector class';
  String info = 'connecting app - mission - chore together, mediating them';
  String motto = 'do my job, connector, mediates';
  ///  devNote: PLAN: Two fields for to better shape outPut stuff in console.
  String seal; //  like:  ":CONNECTOR:";
  /// emblem can be used in flowC
  String emblem = ':con:X:';  //  or this emblem.
  String indent; // like:  "      ";  3-5-7 empty marks or something visible.
  //  Like: ":ALLOW X :LOW Y :ROLE Z :GOAL XX :OPEN YY
  String clause;  //  Combination of #LANG words in sentence.
  String master; //  Object that owns this.
  // Buffer inside class for output.
  StringBuffer buf = new StringBuffer();
///  Controlling connectors state, working-condition-state values.
bool offB = true;
bool onB = false;
bool pauseB;
bool doneB = false;

///  *****************************************************************
///  GlobalOperation ?* Using GlobalOpClass might be too heavy.!!
///  var msgBus * Sending messages between objects. Stance, approach

///  #New: #Gear Something turns around this.
///  the sail pivots around the axis of a virtually static mast
var pivot;

///  or: void metro() {}   for putting messages to move.
///  PING, Putting messages in queue or sending them immediately.
void ping(var sender, var receiver, var key) {
  ///  code
}
///  Members, that are participating in this connector.
///  Member is a class in base_struct.
Map<String, Member> memberM = {};

///  get / collect bindings
///  Processes, that are bind inside connector.
Map<String, Map<dynamic, dynamic>> bindingM = {};

//  Connect Members action to one or many other Members action.
String bind(var senderProcess, var receiverProcess, var thing) {
  //  Idea: Have some binding-models and types.
  //  add / find from bindingM Map
  return 'binding: #one to: #second';
///  Connector base activity, keep list of Members / their operations.
///  devNote: Or should it be something smaller?  abstract class BasePlacard?
List<GlobalOpClass> opL = new List();

///  Join "clients" / Members to opList. placardM mediates necessary info.
void opJoin(Map<String, String> plcM, String caller) {
  ///  Operations register to Connector with placardM.
  //  'actor': 'Chore',
  //  'sender': 'Chore instance',
  //  'receiver': '',
  //  'command': 'Ch-cmd:',
  //  'msg': 'Ch-msg:',
  //  *******************************
  ///  code:
  print('-->>-->>--  :connector:  C:$caller  -->>-->>--');
 print(info);
  tl.operationMapPrint(plcM);
  print('--<<--<<--  :connector: done   C:$caller  --<<--<<--');
}

///  Here goes normal init-build-roll-show-done -round. No loop.
///  Method for setting class field values to their run-time-values.
///  Called by: roll.
void init() {
  buf.writeln('---  Connector buffer output initialized  ---');
  //  Set fields values.
  buf.writeln('init done');
}
///  Method for setting class in working condition.
///  CalledBy:  roll.
void build(String _emblem, String _master) {
  offB = false; //  off-state ends
  onB = true; //   Connector is in on-state.
  buf.writeln('build done');
}
///  #run / roll method
void roll() {
  buf.writeln('Connector::    $info   :: roll engaged ');
  init(); //  calling init and build methods in this class.
  //  TODO  connector Build parameters.
  build('*CONNECTOR:', 'CONNENCTORS-MASTER:');
  //  code for roll
  //  ***   code missing, see on top of this file
  //
  show();
  done();
  //  code here
}

///  Method for #Members to take part in common operations.
void rollCommon() {
}

///  Gives members privileges in common operations..
void sharer() {
}
///  Presentation method.
void show() {
  print(buf);
}

///  close method
void done() {
  print('Connector::    $info   :: engaged ');
  //  code here
  buf.write('---  Connector buffer output app: done  ---');
  print(buf);
  buf.clear(); //  empty buffer
}
And now section, that handles last small details:
/// TODO Name for next 3 fields might be opTouche aso. /// Solve one unambiguous textual find-decide problem. /// NOTE: might be separate Touche class. String touch(String sender, String key, String source) { // TODO problem return 'solved:toucheStr: '; } /// Search big amount of #clay data for #customer:s key / order. /// .. solve textual problems based on keywords / search in textual data /// NOTE: might be separate Solver class. String solve(String sender, String key, String source) { // TODO problem return 'solved: solveString'; } /// TODO: connector one-time calls must have parameters; /// Sketching one-time commands, coming from clients. void obey(String sender, receiver, baton, msg) { /// #baton to carry only-one-can-have-at-a-same-time magic thing // TODO code, badly missing // handle command / message } // ***************************************************************** /// Calling print/print-to-buffer function from base_lib. /// Getting local variables; Actor and Buffer right. void flowC(String msg, bool p) { /// Call flowServe with #LOCAL variables. flowServe(':con:', buf, msg, p); } /// constructor Connector(this.name, this.info); } /// Create instance of Connector. var con = new Connector('DawoAppconnector', 'Connection operations');
Chore calls this: con.opJoin(placardM, ':Chr:');
///  Testing placardM inside chore.///  Present info for outer process calls.
Map<String, String> placardM = {
  'actor': 'Chore',
  'sender': 'Chore instance',
  'receiver': '',
  'command': 'Ch-cmd:',
  'msg': 'Ch-msg:',
};