text:
Applied Programming/Functions

Overview
A function is a structuring element grouping statements together, often utilized in a computer program more than once to repeat a task. Without these functions, the alternative to reuse code would be copying it and adapting it to different contexts, which would be a bad idea. Redundant code - repeating code in this case - should be avoided. Using functions usually enhances the comprehensibility and quality of a program. It also lowers the cost for the development and maintenance of the software. Functions have various names in programming languages (e.g., subroutines, routines, procedures, methods, or subprograms).

Let us look at the following code: Output: Program starts Hi Peter Nice to see you again! Enjoy our video! Hi Sarah Nice to see you again! Enjoy our video! Hi Dominque Nice to see you again! Enjoy our video!

Let us have a closer look at the code above. You can see in the code that we are greeting three persons. We use three print statements that are nearly the same; just the name is different. This is what we call redundant code. We are repeating the code three times. This is an example where functions can and should be used to eliminate redundant code.

The following Python code uses a function containing a parameter with the name "name." Redundancy is eliminated and the code is more concise. Take a look: Output: Program starts Hi Peter Nice to see you again! Enjoy our video! Hi Sarah Nice to see you again! Enjoy our video! Hi Dominque Nice to see you again! Enjoy our video!

In the samples above, the use of functions results in less lines of code, 20% less to be specific. Any further reuse of the function would provide even greater efficiency.

A function in Python is defined by a def statement. The general syntax looks like this: The parameter list consists of none or more parameters. Parameters call the actual data to be used (arguments), if the function employs any. The rest of the function body consists of indented statements. The function body gets executed every time the function is called.

Local and Global Variable Scope in Functions
When defined within the function, variable are by default local in scope to the function.

Here's an example:

Output: chimichurri

Example: Output chimichanga

Example:

Output: chimichanga chimichurri

Example: Output: UnboundLocalError                        Traceback (most recent call last)  in          6 7 s = "chimichurri" >8 f 9 print(s)  in f 1 def f: >2    print(s) 3    s = "chimichanga" 4    print(s) 5     UnboundLocalError: local variable 's' referenced before assignment

If we execute the previous script, we get the error message: UnboundLocalError: local variable 's' referenced before assignment.

The variable 's' is ambiguous in f, i.e. in the first print in f the global 's' could be used with the value "chimichurri". After this, we define a local variable s with the assignment s = "chimichanga". Output:

cat dog dog

We made the variable 's' global inside of the script. Therefore anything we do inside of the function body is done to the global variables outside of it.

What is it?
Modular programming is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality. It can be used in a variety of applications and functions with other components of the system. Similar functions are grouped in the same unit of programming code and separate functions are developed as separate units of code so that the code can be reused by other applications.

Why use it?
The purpose of modular programming is to make it easier to develop and maintain large software programs, by breaking them up into smaller parts. Modular programming usually makes your code easier to read because it means separating it into functions that only deal with one aspect of the overall functionality. It can make your files a lot smaller and easier to understand compared to monolithic code. Software that’s split into distinct modules is also ideal for testing. That’s because tests can be much stricter and more detailed when you test small functions that do less, compared to big functions that do many things. This is especially true if you can only test the outputs of a function, rather than seeing the steps it follows. Separating functions in this way can make it much quicker and easier to find what you’re looking for later.

Modular vs Structured vs Object-Oriented
Modular programming is closely related to structured programming and object-oriented programming, all having the same goal of facilitating construction of large software programs and systems by decomposition into smaller pieces. In more specific terms, modular programming refers to the high-level decomposition of the code of an entire program into pieces: structured programming to the low-level code use of structured control flow, and object-oriented programming to the data use of objects, a kind of data structure.

Modules
The code is composed of many different code modules that are developed separately. This allows different developers to take on discrete pieces of the system, designing and implementing them without having to understand all of the rest. But to build large programs out of modules effectively, we need to be able to write modules that are correctly isolated from the rest of the program. Rather than have to think about every other part of the program when developing a code module, we need to be able to use local reasoning. That is reasoning about just the module, and the contract it needs to satisfy with respect to the rest of the program. If everyone has done their job, separately developed code modules can be plugged together to form a working program without every developer needing to understand everything done by every other developer in the team. This is the key idea of modular programming.

Parameters
A function or procedure usually needs some information about the environment, in which it has been called. The relationship between the environment and the function involves special variables, which are called parameters. By using these parameters, it's possible to use all kinds of "outside" objects inside of a function. The syntax for how parameters are declared and the semantics for how the arguments are passed to the parameters of the function depends on the programming language.

Very often the terms parameter and argument are used synonymously, but there is a clear difference. Parameters are inside functions or procedures, while arguments are used in procedure calls (i.e., the values passed to the function at run-time).

The evaluation strategy for arguments (i.e., how the arguments from a function call are passed to the parameters of the function) differs between programming languages. The most common evaluation strategies are "call by value" and "call by reference."

What is it?
A subroutine is a sequence of program instructions that performs a specific task, packaged as a unit. This unit can then be used in programs wherever that task should be performed. Subroutines may be defined within programs, or separately in libraries that can be invoked. In different programming languages, a subroutine may be called a routine, subprogram, function, method, or procedure. Technically, these terms all have different definitions. The generic umbrella term 'callable unit' is sometimes used as well.

Types
There are two types of subroutines: procedures and functions. A procedure is a subroutine that performs a specific task. When the task is complete, the subroutine ends and the main program continues from where it left off. For example, a procedure may be written to reset all the values of an array to zero, or to clear a screen. Meanwhile, a function works in the same way as a procedure, except that it manipulates data and returns a result back to the main program.

Call by value
The most common strategy is the call-by-value evaluation, sometimes also called pass-by-value. This strategy is used in C and C++, for example. In call-by-value, the argument expression is evaluated, and the result of this evaluation is bound to the corresponding variable in the function. So, if the expression is a variable, its value will be assigned (copied) to the corresponding parameter. This ensures that the variable in the caller's scope will stay unchanged when the function returns. In other words, a copy of the argument passed to the function is made. When any operation is done on the copy, the actual value does not change. It only changes the value of the copy which is made inside the function. Here's an unbiased Python example:

Output Before function call: Python Inside function: Python is cool After function call: Python As you can see, a copy of the argument passed to the function is made. When any operation is done on the copy, the actual value does not change. It only changes the value of the copy which is made inside the function.

Call by reference
In call-by-reference evaluation, which is also known as pass-by-reference, a function gets an implicit reference to the argument, rather than a copy of its value. As a consequence, the function can modify the argument, i.e. the value of the variable in the caller's scope can be changed. By using Call by Reference we save both computation time and memory space because arguments do not need to be copied. On the other hand, this harbors the disadvantage that variables can be "accidentally" changed in a function call. So, special care has to be taken to "protect" the values, which shouldn't be changed. Many programming languages support call-by-reference, like C or C++, but Perl uses it as default. In ALGOL 60 and COBOL there has been a different concept called call-by-name, which isn't used anymore in modern languages.

Python uses a mechanism, which is known as "Call-by-Object", sometimes also called "Call by Object Reference" or "Call by Sharing". If you pass immutable arguments like integers, strings or tuples to a function, the passing acts like call-by-value. The object reference is passed to the function parameters. They can't be changed within the function, because they can't be changed at all (i.e., they are immutable). It's different, if we pass mutable arguments. They are also passed by object reference, but they can be changed in place within the function. If we pass a list to a function, we have to consider two cases: elements of a list can be changed in place (i.e., the list will be changed even in the caller's scope); if a new list is assigned to the name, the old list will not be affected (i.e., the list in the caller's scope will remain untouched). A Python example: Output Before function call: ['Hello'] Inside function call: ['Hello', 'world'] After function call: ['Hello', 'world'] On this reference to the original, the arguments is passed and when any operation is performed on the argument the actual value also changes. It changes the value in both function scope and globally.

What is it?
A naming convention is a pre-determined set of rules or guidelines used for your program’s variables, functions, etc. They are general rules applied when creating text scripts for software programming. They have many different purposes, such as adding clarity and uniformity to scripts, readability for third-party applications, and functionality in certain languages and applications.

Why they are needed
Common reasons for following a naming convention include: reducing the effort needed to read and understand source code, to enable code reviews to focus on more important issues than arguing over syntax and naming standards, and to enable code quality review tools to focus their reporting mainly on significant issues other than syntax and style preferences.

Common conventions
Camel case - every word is capitalized except the first. There are no spaces in between words. Example:

Pascal case - every word is capitalized. There are no spaces in between words. Example:

Snake case - every word is lower case. Words are separated by underscores. Example:

Which do I use
C++, Java, and JavaScript typically use camelCase, with PascalCase reserved for libraries and classes. C# primarily uses PascalCase, with camelCase used for parameters. Python uses snake_case for most identifiers. In addition, the following rules apply:
 * Do not start with an underscore (used for technical programming)
 * CONSTANTS IN ALL UPPER CASE (often UPPER_SNAKE_CASE)

title: Applied Programming/Functions


text:
User talk:SamuelHenkels

Welcome
Welcome to Wikibooks, SamuelHenkels!

 First steps tutorial Wikibooks is for collaborative development of free textbooks.

You do not need technical skills to contribute. You can easily change most books. Please introduce yourself, and let us know what interests you.

If you already contribute at other Wikimedia projects, our Wikimedia Orientation should quickly get you started. (Would you like to provide feedback on this message?)

  Getting help   Made a mistake?   Goodies, tips and tricks
 * Read the Using Wikibooks book for a friendly introduction to the project, or our help pages for more information.
 * You can get friendly help from the community in the user assistance room or our IRC channel.
 * Upload freely licensed files to Wikimedia Commons. You may request permission to upload fair use files locally. Please include author and source information and a non-free use rationale for non-free files.
 * You can restore a previously saved version.
 * Pages should follow the  naming convention.
 * Need to rename a page? Use the move tab (is available once your account is 4 days old - until then, ask for help).
 * To request a page be deleted, add to the top of the page.
 * Was a page you made deleted? Please read the deletion policy, and check the deletion log to find out why. Also check the RFD archives if applicable. You can request undeletion at WB:RFU, or ask the administrator who deleted the page.
 * Please fill in the edit summary and preview your edits before saving.
 * Sign your name on discussion pages by typing ~~~~
 * User scripts can make many tasks easier. Look at the Gadgets tab of my preferences; check off the boxes for the scripts you want, and hit save!

--Pi zero (discuss • contribs) 22:05, 27 January 2021 (UTC)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: User talk:SamuelHenkels


text:
Dungeons & Dragons/Learning the game/Player races

The publish materials describe various races starting with the Player's Handbook describing the basic fantasy races; Human, Elf, Orc, Dwarf, Goblin, and Dragonborn, with additional publish materials expanding the selection. In addition Dungeon Master (DM) can create their own character races based on the game scenario, known as Homebrew. Example of an Homebrew races in an aquatic scenario could include races inspire from Mermaid, Shark, Crab, Eels, Lobster, etc.

Selecting a character race for a game
When creating a character it is best to consult with the Dungeon Master. They may suggest options based on the plan game scenario for the game. They may indicate to select from Player's Handbook races if plan for a publish adventure; or present with their own homebrew races if the player is interested.


text:
User:RaduLucian1975

 * 1) RaduLucian1975 - *Radu {_hobbyist[test]} *

title: User:RaduLucian1975


text:
Critique of the 1776 Commission Report/Guide for Contributors/Style Guide

History Content Analysis
Classification Labels
 * Error
 * Omission
 * Exaggeration
 * Understatement
 * Misstatement
 * Faulty Analysis

Memory Content Analysis
Classification Labels
 * Error
 * Omission
 * Exaggeration
 * Understatement
 * Misstatement
 * Faulty Analysis

Rhetoric Analysis
The goal of rhetorical analysis is primarily to classify and label the rhetoric in the original text, and not to identify or correct errors, omissions, or flaws in the author's rhetoric. The only exception to this is labeling Flaws in Reasoning or Logic (see below).

Rhetorical classification has the following structure:

 * 1) Rhetorical Goal & Pattern
 * 2) Rhetorical Strategy
 * 3) Reasoning and Informal Logic
 * 4) Forms
 * 5) Statements about Evidence
 * 6) Flaws in Reasoning and Logic
 * 7) Statements about Truth and Knowledge (Epistemology)

Any given paragraph or section in the original text will have two or three types of labels: 1) a Rhetorical Goal or Pattern, 2) a Rhetorical Strategy, and (optional) 3) Reasoning and Informal Logic -- if that paragraph or section has a goal of being persuasive through reasoning or argument.

 * Note: Any paragraph where this doesn't apply should not have any Rhetoric Analysis. Hypothetical example: "The authors on this project really enjoyed the process of writing and editing this report." This statement would outside the scope of the this book, and therefore should not have any Rhetoric labels or tags.

To this end, a fairly elaborate system of classifications and labels are provided below. Contributors can use Templates for each, as shown in the "What you type" column.

When you enter your analysis of Rhetoric for each paragraph in the original, use the non-verbose template in the "Summary" while the verbose template should be used in your explanatory paragraph(s).

[TODO: Add example ]

Statements About Truth and Knowledge (Epistemology)
Epistemology is a very big topic in philosophy and we aren't doing full analysis in this book. For purposes of rhetoric analysis, we are only concerned with labeling the original text when it includes explicit and specific statements about truth and knowledge. Examples: "Everybody knows...", "Nobody will ever know...", "People who have lived and worked on farms will know...", "It is a universal truth that...", "As humans, we must believe [i.e. have faith that]...", "As revealed to us by our Creator...", and so on.

For our purposes, "truth" includes two definitions/categories: "justifiable true belief" (factual or realist truth) and also "beliefs one is willing to act on, in the court of one's highest interests" (pragmatist truth). This includes "sincere truths" and excludes so-called "truths" that are ironic, satiric, for-the-sake-of-argument, deceitful, or aimed to defeat or undermine the process of argumentation or debate itself. These latter statements have an underlying truth that is at odds with their face value or meaning. The implication of these two definitions of "truth" is that we assume the authors of the original text are trying — in good faith — to convince the reader to take meaningful action in the world, and not merely to entertain, stimulate imagination, provoke controversy, for literary or aesthetic effect, or to subvert debate or action.

Viewpoints Analysis
When you enter your analysis of Viewpoints for each paragraph in the original, use the non-verbose template in the "Summary" while the verbose template should be used in your explanatory paragraph(s).

[TODO: Add example ]

Authorship Analysis
When you enter your analysis of Authorship for each paragraph in the original, use the non-verbose template in the "Summary" while the verbose template should be used in your explanatory paragraph(s).

[TODO: Add example ]


text:
Critique of the 1776 Commission Report/Guide for Contributors/Book-specific Templates

Help page for all Templates specific to this Wikibook


text:
Template:Plagiarism

"Plagiarism" classification label for Authorship Analysis

 * background: light yellow
 * text color: dark red
 * text decoration: red underline (only in 'verbose', for plagiarized text

/Templates

parameters:
 * 1) text that was plagiarized
 * 2) source where it was taken from
 * 3) (optional) verbose

title: Template:Plagiarism


text:
Template:Attribution error

"Attribution Error" classification label for Authorship Analysis

 * background: light orange
 * text color: dark red
 * text decoration: none

parameters:
 * 1) original attribution or source
 * 2) correct attribution or source
 * 3) (optional) verbose

/Templates

- [hover mouse for tooltip]

title: Template:Attribution error


text:
Template:Overly general

"Overly general" classification label for Viewpoints Analysis

 * background: pink
 * text color: black
 * text decoration: none

parameters:
 * 1) text that is overly general (i.e. does not apply to all important viewpoints
 * 2) (optional) verbose

/Templates

title: Template:Overly general


text:
Template:Viewpoints omitted

"Viewpoints Omitted" classification label for Authorship Analysis

 * background: pink
 * text color: black
 * text decoration: none

parameters:
 * 1) list of important viewpoints (classes of people, etc.) that have been omitted
 * 2) (optional) verbose

/Templates

title: Template:Viewpoints omitted


text:
Template:Reasoning

"Reasoning" classification label for Rhetorical Style, Rhetoric Analysis

 * background: light-blue
 * text color: black
 * text decoration: none

parameters:
 * 1) First few words of the line of reasoning...
 * 2) (optional) verbose

/Templates

title: Template:Reasoning


text:
Template:Emotional appeal

"Emotional Appeal" classification label for Rhetorical Strategy, Rhetoric Analysis

 * background: light-blue
 * text color: black
 * text decoration: none

parameters:
 * 1) First few words of the emotional appeal...
 * 2) (optional) verbose

/Templates

title: Template:Emotional appeal


text:
Template:Values

"Values" classification label for Rhetorical Style, Rhetoric Analysis

 * background: light-blue
 * text color: black
 * text decoration: none

parameters:
 * 1) First few words of the appeal to moral or ethical values...
 * 2) (optional) verbose

/Templates

title: Template:Values


text:
Template:Authority

"Authority" classification label for Rhetorical Style, Rhetoric Analysis

 * background: light-blue
 * text color: black
 * text decoration: none

parameters:
 * 1) First few words of assertion of authority...
 * 2) (optional) verbose

/Templates

title: Template:Authority


text: Category:Book:Critique of the 1776 Commission Report/Templates


text:
Free Knowledge Culture Calendar/September 13

Today in 1956 the world’s first commercial hard disk drive was shipped. Advances in the development of hard disk drives have made long-term data storage capacity exhibit the fastest growth of all the basic elements of a computer system. This made storage so incredibly cheap that most people fail to imagine the scale and enabling potential of today’s data storage capacities.


text:
User:Peter197121

Anyone can go to Heaven Just be Good! www.justbegood.net

title: User:Peter197121


text:
Brazilian Portuguese/Chapter 22

Hello, this lesson is related to weather specifically about the verbs related and subjunctive present form of the verb.

To glow/shine - Brilhar

Que eu brilhe - That I glow

Que tu brilhes - That you glow

Que ele/ela brilhe - That he/she glows

Que nós brilhemos - That we glow

Que vós brilhais - That you/thy glow

Que eles/elas brilhem - That they glow

To freeze - Congelar

Que eu congele - That I freeze

Que tu congeles - That you freeze

Que ele/ela congele - That he/she freezes

Que nós congelemos - That we freeze

Que vós congeleis - That you/thy freeze

Que eles/elas congelem - That they freeze

To Pour - Derramar

Que eu derrame - That I pour

Que tu derrames - That you pour

Que ele/ela derrame - That he/she pours

Que nós derramemos - That we pour

Que vós derrameis - That you/thy pour

Que eles/elas derramem - That they pour

To Rain - Chuva -

-

Que chova - That it rains

-

-

Que chovam - That it rains

title: Brazilian Portuguese/Chapter 22


text:
Manchu/Library/The Analects/juwan duici fiyelen

leolen gisuren - juwan duici fiyelen
論語 憲問第十四


text:
Wikibooks:AutoWikiBrowser/CheckPageJSON

{	"enabledusers": [ "1234qwer1234qwer4", "20 upper", "EpicPupper", "Prahlad balaji", "RogueScholar", "Alextejthompson", "Synoman Barris", "Cremastra (JWB)" ],	"enabledbots": [ "Leaderboard", "Leaderbot", "Minorax", "ZI Jony" ] }

title: Wikibooks:AutoWikiBrowser/CheckPageJSON


text:
Wikibooks:AutoWikiBrowser/Config

{   "typolink": "Wikipedia:AutoWikiBrowser/Typos", "allusersenabled": false, "allusersenabledusermode": false, "messages": [ {           "version": "*", "message": "Welcome to Wikibooks; remember to be careful" }   ],    "underscoretitles": [], "nogenfixes": [ "Associative array", "List of musical works in unusual time signatures", "Mathematica", "Wikipedia:Lists of common misspellings" ],   "noregextypofix": [] }

title: Wikibooks:AutoWikiBrowser/Config


text:
Oberon/V2/FileDir

MODULE FileDir; (*NW 12.1.86 / 23.8.90*) IMPORT SYSTEM, Kernel; (*File Directory is a B-tree with its root page at DirRootAdr. 		Each entry contains a file name and the disk address of the file's head sector*) CONST FnLength* = 32; SecTabSize* = 64; ExTabSize* = 12; SectorSize* = 1024; IndexSize* = SectorSize DIV 4; HeaderSize* = 352; DirRootAdr* = 29; DirPgSize* = 24; N = DirPgSize DIV 2; DirMark* = 9B1EA38DH; HeaderMark* = 9BA71D86H; FillerSize = 52; TYPE DiskAdr = LONGINT; FileName* = ARRAY FnLength OF CHAR; SectorTable* = ARRAY SecTabSize OF DiskAdr; ExtensionTable* = ARRAY ExTabSize OF DiskAdr; EntryHandler* = PROCEDURE (name:FileName; sec: DiskAdr; VAR continue: BOOLEAN); FileHeader* = RECORD (Kernel.Sector) (*allocated in the first page of each file on disk*) mark*: LONGINT; name*: FileName; aleng*, bleng*: INTEGER; date*, time*: LONGINT; ext*: ExtensionTable; sec*: SectorTable; fill: ARRAY SectorSize - HeaderSize OF CHAR; END ; IndexSector* = RECORD (Kernel.Sector) x*: ARRAY IndexSize OF DiskAdr END ; DataSector* = RECORD (Kernel.Sector) B*: ARRAY SectorSize OF SYSTEM.BYTE END ; DirEntry* = (*B-tree node*) RECORD name*: FileName; adr*: DiskAdr; (*sec no of file header*) p*: DiskAdr (*sec no of descendant in directory*) END ; DirPage* = RECORD (Kernel.Sector) mark*: LONGINT; m*: INTEGER; p0*: DiskAdr; (*sec no of left descendant in directory*) fill: ARRAY FillerSize OF CHAR; e*: ARRAY DirPgSize OF DirEntry END ; PROCEDURE Search*(VAR name: FileName; VAR A: DiskAdr); VAR i, j, L, R: INTEGER; dadr: DiskAdr; a: DirPage; BEGIN dadr := DirRootAdr; LOOP Kernel.GetSector(dadr, a); L := 0; R := a.m; (*binary search*) WHILE L < R DO 				i := (L+R) DIV 2; IF name <= a.e[i].name THEN R := i ELSE L := i+1 END END ; IF (R < a.m) & (name = a.e[R].name) THEN A := a.e[R].adr; EXIT (*found*) END ; IF R = 0 THEN dadr := a.p0 ELSE dadr := a.e[R-1].p END ; IF dadr = 0 THEN A := 0; EXIT (*not found*) END END END Search; PROCEDURE insert(VAR name: FileName; dpg0: DiskAdr; 				VAR h: BOOLEAN; VAR v: DirEntry; fad: DiskAdr); (*h = "tree has become higher and v is ascending element"*) VAR ch: CHAR; i, j, L, R: INTEGER; dpg1: DiskAdr; u: DirEntry; a: DirPage; BEGIN (*~h*) Kernel.GetSector(dpg0, a); L := 0; R := a.m; (*binary search*) WHILE L < R DO 			i := (L+R) DIV 2; IF name <= a.e[i].name THEN R := i ELSE L := i+1 END END ; IF (R < a.m) & (name = a.e[R].name) THEN a.e[R].adr := fad; Kernel.PutSector(dpg0, a) (*replace*) ELSE (*not on this page*) IF R = 0 THEN dpg1 := a.p0 ELSE dpg1 := a.e[R-1].p END ; IF dpg1 = 0 THEN (*not in tree, insert*) u.adr := fad; u.p := 0; h := TRUE; j := 0; REPEAT ch := name[j]; u.name[j] := ch; INC(j) UNTIL ch = 0X; WHILE j < FnLength DO u.name[j] := 0X; INC(j) END ELSE insert(name, dpg1, h, u, fad) END ; IF h THEN (*insert u to the left of e[R]*) IF a.m < DirPgSize THEN h := FALSE; i := a.m; 					WHILE i > R DO DEC(i); a.e[i+1] := a.e[i] END ; a.e[R] := u; INC(a.m) 				ELSE (*split page and assign the middle element to v*) a.m := N; a.mark := DirMark; IF R < N THEN (*insert in left half*) v := a.e[N-1]; i := N-1; WHILE i > R DO DEC(i); a.e[i+1] := a.e[i] END ; a.e[R] := u; Kernel.PutSector(dpg0, a); Kernel.AllocSector(dpg0, dpg0); i := 0; WHILE i < N DO a.e[i] := a.e[i+N]; INC(i) END ELSE (*insert in right half*) Kernel.PutSector(dpg0, a); Kernel.AllocSector(dpg0, dpg0); DEC(R, N); i := 0; IF R = 0 THEN v := u 						ELSE v := a.e[N]; WHILE i < R-1 DO a.e[i] := a.e[N+1+i]; INC(i) END ; a.e[i] := u; INC(i) END ; WHILE i < N DO a.e[i] := a.e[N+i]; INC(i) END END ; a.p0 := v.p; v.p := dpg0 END ; Kernel.PutSector(dpg0, a) 			END END END insert; PROCEDURE Insert*(VAR name: FileName; fad: DiskAdr); VAR oldroot: DiskAdr; h: BOOLEAN; U: DirEntry; a: DirPage; BEGIN h := FALSE; insert(name, DirRootAdr, h, U, fad); IF h THEN (*root overflow*) Kernel.GetSector(DirRootAdr, a); Kernel.AllocSector(DirRootAdr, oldroot); Kernel.PutSector(oldroot, a); a.mark := DirMark; a.m := 1; a.p0 := oldroot; a.e[0] := U; 			Kernel.PutSector(DirRootAdr, a) 		END END Insert; PROCEDURE underflow(VAR c: DirPage; (*ancestor page*) 			dpg0: DiskAdr; s: INTEGER; (*insertion point in c*) VAR h: BOOLEAN); (*c undersize*) VAR i, k: INTEGER; dpg1: DiskAdr; a, b: DirPage; (*a := underflowing page, b := neighbouring page*) BEGIN Kernel.GetSector(dpg0, a); (*h & a.m = N-1 & dpg0 = c.e[s-1].p*) IF s < c.m THEN (*b := page to the right of a*) dpg1 := c.e[s].p; Kernel.GetSector(dpg1, b); k := (b.m-N+1) DIV 2; (*k = no. of items available on page b*) a.e[N-1] := c.e[s]; a.e[N-1].p := b.p0; IF k > 0 THEN (*move k-1 items from b to a, one to c*) i := 0; WHILE i < k-1 DO a.e[i+N] := b.e[i]; INC(i) END ; c.e[s] := b.e[i]; b.p0 := c.e[s].p; 				c.e[s].p := dpg1; DEC(b.m, k); i := 0; WHILE i < b.m DO b.e[i] := b.e[i+k]; INC(i) END ; Kernel.PutSector(dpg1, b); a.m := N-1+k; h := FALSE ELSE (*merge pages a and b, discard b*) i := 0; WHILE i < N DO a.e[i+N] := b.e[i]; INC(i) END ; i := s; DEC(c.m); WHILE i < c.m DO c.e[i] := c.e[i+1]; INC(i) END ; a.m := 2*N; h := c.m < N 			END ; Kernel.PutSector(dpg0, a) 		ELSE (*b := page to the left of a*) DEC(s); IF s = 0 THEN dpg1 := c.p0 ELSE dpg1 := c.e[s-1].p END ; Kernel.GetSector(dpg1, b); k := (b.m-N+1) DIV 2; (*k = no. of items available on page b*) IF k > 0 THEN i := N-1; WHILE i > 0 DO DEC(i); a.e[i+k] := a.e[i] END ; i := k-1; a.e[i] := c.e[s]; a.e[i].p := a.p0; (*move k-1 items from b to a, one to c*) DEC(b.m, k); WHILE i > 0 DO DEC(i); a.e[i] := b.e[i+b.m+1] END ; c.e[s] := b.e[b.m]; a.p0 := c.e[s].p; 				c.e[s].p := dpg0; a.m := N-1+k; h := FALSE; Kernel.PutSector(dpg0, a) 			ELSE (*merge pages a and b, discard a*) c.e[s].p := a.p0; b.e[N] := c.e[s]; i := 0; WHILE i < N-1 DO b.e[i+N+1] := a.e[i]; INC(i) END ; b.m := 2*N; DEC(c.m); h := c.m < N 			END ; Kernel.PutSector(dpg1, b) 		END END underflow; PROCEDURE delete(VAR name: FileName; dpg0: DiskAdr; VAR h: BOOLEAN; 			VAR fad: DiskAdr); (*search and delete entry with key name; if a page underflow arises, 		balance with adjacent page or merge; h := "page dpg0 is undersize"*) VAR i, j, k, L, R: INTEGER; dpg1: DiskAdr; a: DirPage; PROCEDURE del(dpg1: DiskAdr; VAR h: BOOLEAN); VAR dpg2: DiskAdr; (*global: a, R*) b: DirPage; BEGIN Kernel.GetSector(dpg1, b); dpg2 := b.e[b.m-1].p; 			IF dpg2 # 0 THEN del(dpg2, h); IF h THEN underflow(b, dpg2, b.m, h); Kernel.PutSector(dpg1, b) END ELSE b.e[b.m-1].p := a.e[R].p; a.e[R] := b.e[b.m-1]; DEC(b.m); h := b.m < N; Kernel.PutSector(dpg1, b) 			END END del; BEGIN (*~h*) Kernel.GetSector(dpg0, a); L := 0; R := a.m; (*binary search*) WHILE L < R DO 			i := (L+R) DIV 2; IF name <= a.e[i].name THEN R := i ELSE L := i+1 END END ; IF R = 0 THEN dpg1 := a.p0 ELSE dpg1 := a.e[R-1].p END ; IF (R < a.m) & (name = a.e[R].name) THEN (*found, now delete*) fad := a.e[R].adr; IF dpg1 = 0 THEN (*a is a leaf page*) DEC(a.m); h := a.m < N; i := R; 				WHILE i < a.m DO a.e[i] := a.e[i+1]; INC(i) END ELSE del(dpg1, h); IF h THEN underflow(a, dpg1, R, h) END END ; Kernel.PutSector(dpg0, a) 		ELSIF dpg1 # 0 THEN delete(name, dpg1, h, fad); IF h THEN underflow(a, dpg1, R, h); Kernel.PutSector(dpg0, a) END ELSE (*not in tree*) fad := 0 END END delete; PROCEDURE Delete*(VAR name: FileName; VAR fad: DiskAdr); VAR h: BOOLEAN; newroot: DiskAdr; a: DirPage; BEGIN h := FALSE; delete(name, DirRootAdr, h, fad); IF h THEN (*root underflow*) Kernel.GetSector(DirRootAdr, a); IF (a.m = 0) & (a.p0 # 0) THEN newroot := a.p0; Kernel.GetSector(newroot, a); Kernel.PutSector(DirRootAdr, a) (*discard newroot*) END END END Delete; PROCEDURE enumerate(VAR prefix: ARRAY OF CHAR; dpg: DiskAdr; 			proc: EntryHandler; VAR continue: BOOLEAN); VAR i, j, diff: INTEGER; dpg1: DiskAdr; a: DirPage; BEGIN Kernel.GetSector(dpg, a); i := 0; WHILE (i < a.m) & continue DO 			j := 0; LOOP IF prefix[j] = 0X THEN diff := 0; EXIT END ; diff := ORD(a.e[i].name[j]) - ORD(prefix[j]); IF diff # 0 THEN EXIT END ; INC(j) END ; IF i = 0 THEN dpg1 := a.p0 ELSE dpg1 := a.e[i-1].p END ; IF diff >= 0 THEN (*matching prefix*) IF dpg1 # 0 THEN enumerate(prefix, dpg1, proc, continue) END ; IF diff = 0 THEN IF continue THEN proc(a.e[i].name, a.e[i].adr, continue) END ELSE continue := FALSE END END ; INC(i) END ; IF continue & (i > 0) & (a.e[i-1].p # 0) THEN enumerate(prefix, a.e[i-1].p, proc, continue) END END enumerate; PROCEDURE Enumerate*(prefix: ARRAY OF CHAR; proc: EntryHandler); VAR b: BOOLEAN; BEGIN b := TRUE; enumerate(prefix, DirRootAdr, proc, b) 	END Enumerate; PROCEDURE Init; VAR k: INTEGER; A: ARRAY 2000 OF DiskAdr; PROCEDURE MarkSectors; VAR L, R, i, j, n: INTEGER; x: DiskAdr; hd: FileHeader; B: IndexSector; PROCEDURE sift(L, R: INTEGER); VAR i, j: INTEGER; x: DiskAdr; BEGIN j := L; x := A[j]; LOOP i := j; j := 2*j + 1; IF (j+1 < R) & (A[j] < A[j+1]) THEN INC(j) END ; IF (j >= R) OR (x > A[j]) THEN EXIT END ; A[i] := A[j] END ; A[i] := x 			END sift; BEGIN L := k DIV 2; R := k; (*heapsort*) WHILE L > 0 DO DEC(L); sift(L, R) END ; WHILE R > 0 DO 				DEC(R); x := A[0]; A[0] := A[R]; A[R] := x; sift(L, R) 			END ; WHILE L < k DO Kernel.GetSector(A[L], hd); IF hd.aleng < SecTabSize THEN j := hd.aleng + 1; REPEAT DEC(j); Kernel.MarkSector(hd.sec[j]) UNTIL j = 0 ELSE j := SecTabSize; REPEAT DEC(j); Kernel.MarkSector(hd.sec[j]) UNTIL j = 0; n := (hd.aleng - SecTabSize) DIV 256; i := 0; WHILE i <= n DO 						Kernel.MarkSector(hd.ext[i]); Kernel.GetSector(hd.ext[i], B); (*index sector*) IF i < n THEN j := 256 ELSE j := (hd.aleng - SecTabSize) MOD 256 + 1 END ; REPEAT DEC(j); Kernel.MarkSector(B.x[j]) UNTIL j = 0; INC(i) END END ; INC(L) END END MarkSectors; PROCEDURE TraverseDir(dpg: DiskAdr); VAR i, j: INTEGER; a: DirPage; BEGIN Kernel.GetSector(dpg, a); Kernel.MarkSector(dpg); i := 0; WHILE i < a.m DO 				A[k] := a.e[i].adr; INC(k); INC(i); IF k = 2000 THEN MarkSectors; k := 0 END END ; IF a.p0 # 0 THEN TraverseDir(a.p0); i := 0; WHILE i < a.m DO 					TraverseDir(a.e[i].p); INC(i) END END END TraverseDir; BEGIN Kernel.ResetDisk; k := 0; TraverseDir(DirRootAdr); MarkSectors END Init; BEGIN Init END FileDir.

title: Oberon/V2/FileDir


text:
American Ghost Towns/Ghost towns in Oregon

 * /Ghost towns in Baker County/
 * /Ghost towns in Coos County/
 * /Ghost towns in Curry County/
 * /Ghost towns in Gilliam County/
 * /Ghost towns in Grant County/
 * /Ghost towns in Harney County/
 * /Ghost towns in Jackson County/
 * /Ghost towns in Jefferson County/
 * /Ghost towns in Josephine County/
 * /Ghost towns in Lane County/
 * /Ghost towns in Linn County/
 * /Ghost towns in Malheur County/
 * /Ghost towns in Marion County/
 * /Ghost towns in Morrow County/
 * /Ghost towns in Polk County/
 * /Ghost towns in Umatilla County/
 * /Ghost towns in Union County/
 * /Ghost towns in Wallowa County/
 * /Ghost towns in Wasco County/
 * /Ghost towns in Washington County/
 * /Ghost towns in Wheeler County/


text:
American Ghost Towns/Ghost towns in Oregon/Ghost towns in Baker County

Ghost towns

 * Auburn
 * Bourne
 * Copperfield
 * Cornucopia
 * Eureka
 * Pocahontas
 * Robinette
 * Sanger


text:
American Ghost Towns/Ghost towns in Oregon/Ghost towns in Baker County/Auburn

Auburn was a former gold mining town currently located off Oregon Route 7. At one time it was the largest city in Eastern Oregon, with over 20 stores and 1000 homes to serve the mining industry. It was made the original county seat of Baker County in 1862. It was also home to the first post office in northeastern Oregon.

Page navigation
Previous page: Ghost towns in Baker County Next page: Bourne


text:
User:Ylzzirf

Hello, everyone! Welcome to my user page!

title: User:Ylzzirf


text:
User talk:Ylzzirf

Welcome!
Welcome, Ylzzirf!

If you have any questions, you can ask in the assistance reading room or possibly contact me personally. —Atcovi (Talk - Contribs) 22:18, 24 January 2021 (UTC)

title: User talk:Ylzzirf


text:
American Ghost Towns/Ghost towns in Oregon/Ghost towns in Baker County/Bourne

Bourne (originally named "Cracker City") was a former gold mining town. It lies on Cracker Creek within the Wallowa-Whitman National Forest.

Page navigation
Previous page: Auburn Next page: Copperfield


text:
American Ghost Towns/Ghost towns in Oregon/Ghost towns in Baker County/Copperfield

Copperfield was a former town on the west bank of the Snake River and the north bank of Pine Creek. Platted around 1898, the town saw in increase in population in 1910 due to nearby railroad construction. When construction ended in 1913, the town gained a reputation for lawlessness, prompting then-governor Oswald West to send his secretary, Fern Hobbs along with a state militia to impose martial law. The former site of Copperfield is currently occupied by a park managed by Idaho Power.

Page navigation
Previous page: Bourne Next page: Cornucopia


text:
Acing the SQE

=Introduction= Introduction

=Pass Mark=

SQE1
The pass rate for the FLK1 & FLK2 assessments are not predetermined; instead, they are determined after the assessment is conducted. The SRA Assessment Board establishes the pass mark using the Modified Angoff method, as per the SRA Marking and Standard Setting Policy. This approach involves a panel of qualified solicitors who are knowledgeable about Day One competence. They assess each question and estimate how many out of ten just-competent Day One solicitors would answer it correctly. By compiling and averaging these ratings for each question from each panel member, a cut score is derived. Subsequently, further statistical analysis is performed to account for candidates' actual performance and measurement errors, resulting in the final pass mark for the assessment.

It's important to note that the pass mark for the SQE may vary from one assessment sitting to another to maintain consistent assessment standards. To provide context, the SRA has furnished a table below, offering information based on past SQE1 sittings to give you an idea of the likely pass mark.

=Subject=

FLK1

 * Business Law and Practice
 * Dispute Resolution
 * Contract Law
 * Tort Law
 * Legal System
 * Public Law
 * Legal Services

FLK2

 * Property Practice
 * Wills and Administration of Estates
 * Solicitors Accounts
 * Land Law
 * Equity and Trusts
 * Criminal Law
 * Criminal Procedure

Both
=Mock Test=
 * Professional Conduct
 * SQE1 sample questions 130Q
 * QLTS Sample

title: Acing the SQE


text:
Manchu/Library/The Analects/juwan sunjaci fiyelen

leolen gisuren - juwan sunjaci fiyelen
論語 衛靈公第十五


text:
Manchu/Library/The Analects/juwan ningguci fiyelen

leolen gisuren - juwan ningguci fiyelen
論語 季氏第十六


text: User:TumiMokgethi/sandbox

title: User:TumiMokgethi/sandbox


text:
Manchu/Library/The Analects/juwan nadaci fiyelen

leolen gisuren - juwan nadaci fiyelen
論語 陽貨第十七


text:
Manchu/Library/The Analects/juwan jakūci fiyelen

leolen gisuren - juwan jakūci fiyelen
論語 微子第十八


text: Template:Editnotices/Group/Applied Programming


text: Template:Editnotices/Group/Exercise as it relates to Disease


text:
Manchu/Library/The Analects/juwan uyuci fiyelen

leolen gisuren - juwan uyuci fiyelen
論語 子張第十九


text:
Manchu/Library/The Analects/orici fiyelen

leolen gisuren - orici fiyelen
論語 堯曰第二十


text:
User talk:205.213.208.200

Blocked
You cannot edit for 2 weeks due to disruptive editing. You are welcome to contribute constructively when editing privileges are restored. You may appeal this action with a reasonable argument by adding the text below. —Atcovi (Talk - Contribs) 20:07, 25 January 2021 (UTC)

title: User talk:205.213.208.200


text:
User talk:41.114.60.163

Warning
—Atcovi (Talk - Contribs) 01:04, 26 January 2021 (UTC)

title: User talk:41.114.60.163


text:
User:Amaury Pesteil

User:Amaury Pesteil on Wikipedia

title: User:Amaury Pesteil


text:
User:Kambai Akau

Hi! Pleased to meet you. I am all out to develop a study guide to learning Tyap. You're welcome to join me in the project.

My Wikipedia user page is here!

Sandbox
User:Kambai Akau/sandbox

title: User:Kambai Akau


text:
Tyap

Á̱ tyia̱ ang ma̱aba̱n/a̱la̱baa! Welcome!

Table of contents (A̱tyii nkyangmami)

 * Introduction to Tyap (Á̱son a̱lyiat ma̱ Tyap)
 * Tyap alphabet
 * Tyap numbering system
 * Cardinal numbers
 * Ordinal numbers
 * Numbers according to frequency of occurrence
 * Lessons (Tyiet)
 * Lesson 1: Tyiet 1 (Salutations: Byat)
 * Lesson 2: Tyiet 2 = Introducing yourself (What is your name?)
 * Lesson 3: Tyiet 3 = Introducing yourself (Where do you live?)
 * Grammar (A̱gi̱rama)
 * Vocabulary
 * Articles
 * Nouns
 * Pronouns
 * Verbs
 * Adverbs
 * Adjectives
 * Prepositions
 * Conjunctions
 * Interjections

Introduction to Tyap (Á̱son a̱lyiat ma̱ Tyap)

 * Tyap alphabet
 * Tyap Phonology
 * Tyap numbering system

Lessons (Tyiet)

 * Lesson 1: Salutations
 * Lesson 2: Introducing yourself I (What is your name?)
 * Lesson 3: Introducing yourself II (Where do you live?)

Grammar (A̱gi̱rama)

 * Vocabulary
 * Articles
 * Nouns
 * Pronouns
 * Verbs
 * Adverbs
 * Adjectives
 * Prepositions
 * Conjunctions
 * Interjections

title: Tyap


text:
Tyap/Vocabulary

Contents : Nkyangmami
 * Arts
 * Business and economy
 * Colours
 * Dates and time
 * Environment
 * Food and drinks
 * Health and Medicine
 * History
 * IT
 * Law
 * Linguistics
 * Place names, nationalities, and languages
 * Politics
 * Professionals
 * Science and technology
 * Sports
 * Transportation

A̱sa̱khwot ※ Colours
Others are: a̱da̱nzwak (dark brown), a̱ja̱jiat (pure white), a̱shyui (reddish-brown/maroon), kyai tswazwa (sky blue), a̱shyim a̱kwop (yellowish green), a̱shyim a̱kwop na̱ kyiai ma̱ng bula (bluish-green, cyan), a̱baan/khan (milk).

Apart from A̱shong, A̱sai, A̱dyundyung, lyilyim and A̱ja̱jiat, it is advisable to first say A̱sa̱khwot before saying any of the colours above to make complete meaning.

Lyenlilyem ※ Linguistics
A
 * A̱lama wu = Symbol
 * A̱lyem ka = Language, tongue
 * A̱lyiat na = Speech
 * A̱tyong ka = Syllable; paragraph

B
 * Bwoi a̱lyoot hu = Etymology

G
 * Ga̱lyuut = Font

K
 * Kham a̱lyiat ji = Phrase

L
 * Lang a̱lyiat hu = Sentence
 * Lyiat = to Speak
 * Lyuut hu = to write, writing, script

N
 * Nwap ji = Ethnic group, tribe; language

S
 * Swang a̱lyiat ji = Word

T
 * Ta̱zut = to Inscribe

Y
 * Yei hu = Pronunciation

Z
 * Zwunzwuo ji = Mark, character, code
 * Zwunzwuo a̱lyem ji = Alphabet

Lyulyoot a̱ka̱vwuo, bibyinneet, ma̱ng lilyem ※ Place names, nationalities, and languages

 * Place names

A̱ka̱cyet ※ Transportation
<>

title: Tyap/Vocabulary


text:
User talk:186.148.57.195

The sentence Laborantne nautae? should be translated as Are the sailors working? and not Are the sailors swimming?

title: User talk:186.148.57.195


text:
User talk:Kambai Akau

Hi!

title: User talk:Kambai Akau


text:
User talk:41.114.37.89

Blocked
You cannot edit for 6 hours due to disruptive editing. You are welcome to contribute constructively when editing privileges are restored. You may appeal this action with a reasonable argument by adding the text below. —Atcovi (Talk - Contribs) 15:28, 26 January 2021 (UTC)

title: User talk:41.114.37.89


text:
Oberon/V2/Files

MODULE Files; (*NW 11.1.86 / 22.1.91*) IMPORT SYSTEM, Kernel, FileDir; (*A file consists of a sequence of pages. The first page contains the header. 		Part of the header is the page table, an array of disk addresses to the pages. 		A file is referenced through riders each of which indicate a position.*) CONST MaxBufs = 4; HS = FileDir.HeaderSize; SS = FileDir.SectorSize; STS = FileDir.SecTabSize; XS = FileDir.IndexSize; TYPE DiskAdr = LONGINT; File* = POINTER TO Handle; Buffer = POINTER TO BufferRecord; FileHd = POINTER TO FileDir.FileHeader; Index = POINTER TO IndexRecord; Rider* = RECORD eof*: BOOLEAN; res*: LONGINT; file: File; apos, bpos: INTEGER; buf: Buffer; unused: LONGINT END ; Handle = RECORD next: File; aleng, bleng: INTEGER; nofbufs: INTEGER; modH: BOOLEAN; firstbuf: Buffer; sechint: DiskAdr; name: FileDir.FileName; time, date: LONGINT; unused: ARRAY 1 OF LONGINT; ext: ARRAY FileDir.ExTabSize OF Index; sec: FileDir.SectorTable END ; BufferRecord = RECORD apos, lim: INTEGER; mod: BOOLEAN; next: Buffer; data: FileDir.DataSector END ; IndexRecord = RECORD adr: DiskAdr; mod: BOOLEAN; sec: FileDir.IndexSector END ; (*aleng * SS + bleng = length (including header) 			apos * SS + bpos = current position 			0 <= bpos <= lim <= SS 			0 <= apos <= aleng < PgTabSize 			(apos < aleng) & (lim = SS) OR (apos = aleng) *) VAR root: File; (*list of open files*) PROCEDURE Check(VAR s: ARRAY OF CHAR; 			VAR name: FileDir.FileName; VAR res: INTEGER); VAR i: INTEGER; ch: CHAR; BEGIN ch := s[0]; i := 0; IF ("A" <= CAP(ch)) & (CAP(ch) <= "Z") THEN LOOP name[i] := ch; INC(i); ch := s[i]; IF ch = 0X THEN WHILE i < FileDir.FnLength DO name[i] := 0X; INC(i) END ; res := 0; EXIT END ; IF ~(("A" <= CAP(ch)) & (CAP(ch) <= "Z") 					OR ("0" <= ch) & (ch <= "9") OR (ch = ".")) THEN res := 3; EXIT END ; IF i = FileDir.FnLength THEN res := 4; EXIT END ; END ELSIF ch = 0X THEN name[0] := 0X; res := -1 ELSE res := 3 END END Check; PROCEDURE Old*(name: ARRAY OF CHAR): File; VAR i, k, res: INTEGER; f: File; header: DiskAdr; buf: Buffer; head: FileHd; namebuf: FileDir.FileName; inxpg: Index; BEGIN f := NIL; Check(name, namebuf, res); IF res = 0 THEN FileDir.Search(namebuf, header); IF header # 0 THEN f := root; WHILE (f # NIL) & (f.sec[0] # header) DO f := f.next END ; IF f = NIL THEN NEW(buf); buf.apos := 0; buf.next := buf; buf.mod := FALSE; head := SYSTEM.VAL(FileHd, SYSTEM.ADR(buf.data)); Kernel.GetSector(header, head^); NEW(f); f.aleng := head.aleng; f.bleng := head.bleng; f.time := head.time; f.date := head.date; IF f.aleng = 0 THEN buf.lim := f.bleng ELSE buf.lim := SS END ; f.firstbuf := buf; f.nofbufs := 1; f.name[0] := 0X; f.sec := head.sec; k := (f.aleng + (XS-STS)) DIV XS; i := 0; WHILE i < k DO 						NEW(inxpg); inxpg.adr := head.ext[i]; inxpg.mod := FALSE; Kernel.GetSector(inxpg.adr, inxpg.sec); f.ext[i] := inxpg; INC(i) END ; WHILE i < FileDir.ExTabSize DO f.ext[i] := NIL; INC(i) END ; f.sechint := header; f.modH := FALSE; f.next := root; root := f 				END END END ; RETURN f 	END Old; PROCEDURE New*(name: ARRAY OF CHAR): File; VAR i, res: INTEGER; f: File; header: DiskAdr; buf: Buffer; head: FileHd; namebuf: FileDir.FileName; BEGIN f := NIL; Check(name, namebuf, res); IF res <= 0 THEN NEW(buf); buf.apos := 0; buf.mod := FALSE; buf.lim := HS; buf.next := buf; head := SYSTEM.VAL(FileHd, SYSTEM.ADR(buf.data)); head.mark := FileDir.HeaderMark; head.aleng := 0; head.bleng := HS; head.name := namebuf; Kernel.GetClock(head.time, head.date); NEW(f); f.aleng := 0; f.bleng := HS; f.modH := TRUE; f.time := head.time; f.date := head.date; f.firstbuf := buf; f.nofbufs := 1; f.name := namebuf; f.sechint := 0; i := 0; REPEAT f.ext[i] := NIL; head.ext[i] := 0; INC(i) UNTIL i = FileDir.ExTabSize; i := 0; REPEAT f.sec[i] := 0; head.sec[i] := 0; INC(i) UNTIL i = STS END ; RETURN f 	END New; PROCEDURE UpdateHeader(f: File; VAR h: FileDir.FileHeader); VAR k: INTEGER; BEGIN h.aleng := f.aleng; h.bleng := f.bleng; h.sec := f.sec; k := (f.aleng + (XS-STS)) DIV XS; WHILE k > 0 DO DEC(k); h.ext[k] := f.ext[k].adr END END UpdateHeader; PROCEDURE ReadBuf(f: File; buf: Buffer; pos: INTEGER); VAR sec: DiskAdr; BEGIN IF pos < STS THEN sec := f.sec[pos] ELSE sec := f.ext[(pos-STS) DIV XS].sec.x[(pos-STS) MOD XS] END ; Kernel.GetSector(sec, buf.data); IF pos < f.aleng THEN buf.lim := SS ELSE buf.lim := f.bleng END ; buf.apos := pos; buf.mod := FALSE END ReadBuf; PROCEDURE WriteBuf(f: File; buf: Buffer); VAR i, k: INTEGER; secadr: DiskAdr; inx: Index; BEGIN IF buf.apos < STS THEN secadr := f.sec[buf.apos]; IF secadr = 0 THEN Kernel.AllocSector(f.sechint, secadr); f.modH := TRUE; f.sec[buf.apos] := secadr; f.sechint := secadr END ; IF buf.apos = 0 THEN UpdateHeader(f, SYSTEM.VAL(FileDir.FileHeader, buf.data)); f.modH := FALSE END ELSE i := (buf.apos - STS) DIV XS; inx := f.ext[i]; IF inx = NIL THEN NEW(inx); inx.adr := 0; inx.sec.x[0] := 0; f.ext[i] := inx; f.modH := TRUE END ; k := (buf.apos - STS) MOD XS; secadr := inx.sec.x[k]; IF secadr = 0 THEN Kernel.AllocSector(f.sechint, secadr); f.modH := TRUE; inx.mod := TRUE; inx.sec.x[k] := secadr; f.sechint := secadr END END ; Kernel.PutSector(secadr, buf.data); buf.mod := FALSE END WriteBuf; PROCEDURE Buf(f: File; pos: INTEGER): Buffer; VAR buf: Buffer; BEGIN buf := f.firstbuf; LOOP IF buf.apos = pos THEN EXIT END ; buf := buf.next; IF buf = f.firstbuf THEN buf := NIL; EXIT END END ; RETURN buf END Buf; PROCEDURE GetBuf(f: File; pos: INTEGER): Buffer; VAR buf: Buffer; BEGIN buf := f.firstbuf; LOOP IF buf.apos = pos THEN EXIT END ; IF buf.next = f.firstbuf THEN IF f.nofbufs < MaxBufs THEN (*allocate new buffer*) NEW(buf); buf.next := f.firstbuf.next; f.firstbuf.next := buf; INC(f.nofbufs) ELSE (*take one of the buffers*) f.firstbuf := buf; IF buf.mod THEN WriteBuf(f, buf) END END ; buf.apos := pos; IF pos <= f.aleng THEN ReadBuf(f, buf, pos) END ; EXIT END ; buf := buf.next END ; RETURN buf END GetBuf; PROCEDURE Unbuffer(f: File); VAR i, k: INTEGER; buf: Buffer; inx: Index; head: FileDir.FileHeader; BEGIN buf := f.firstbuf; REPEAT IF buf.mod THEN WriteBuf(f, buf) END ; buf := buf.next UNTIL buf = f.firstbuf; k := (f.aleng + (XS-STS)) DIV XS; i := 0; WHILE i < k DO 			inx := f.ext[i]; INC(i); IF inx.mod THEN IF inx.adr = 0 THEN Kernel.AllocSector(f.sechint, inx.adr); f.sechint := inx.adr; f.modH := TRUE END ; Kernel.PutSector(inx.adr, inx.sec); inx.mod := FALSE END END ; IF f.modH THEN IF f.sec[0] = 0 THEN Kernel.AllocSector(0, f.sec[0]) END ; Kernel.GetSector(f.sec[0], head); UpdateHeader(f, head); Kernel.PutSector(f.sec[0], head); f.modH := FALSE END END Unbuffer; PROCEDURE Register*(f: File); BEGIN IF (f # NIL) & (f.name[0] > 0X) THEN Unbuffer(f); FileDir.Insert(f.name, f.sec[0]); f.next := root; root := f 		END ; END Register; PROCEDURE Close*(f: File); BEGIN IF f # NIL THEN Unbuffer(f) END ; END Close; PROCEDURE Purge*(f: File); VAR a, i, j, k: INTEGER; ind: FileDir.IndexSector; BEGIN IF f # NIL THEN a := f.aleng + 1; f.aleng := 0; IF a <= STS THEN i := a 			ELSE i := STS; DEC(a, i); j := (a-1) MOD XS; k := (a-1) DIV XS; WHILE k >= 0 DO 					Kernel.GetSector(f.ext[k].adr, ind); REPEAT DEC(j); Kernel.FreeSector(ind.x[j]) UNTIL j = 0; Kernel.FreeSector(f.ext[k].adr); j := XS; DEC(k) END END ; REPEAT DEC(i); Kernel.FreeSector(f.sec[i]) UNTIL i = 0 END END Purge; PROCEDURE Length*(f: File): LONGINT; BEGIN RETURN LONG(f.aleng)*SS + f.bleng - HS 	END Length; PROCEDURE GetDate*(f: File; VAR t, d: LONGINT); BEGIN t := f.time; d := f.date END GetDate; PROCEDURE Set*(VAR r: Rider; f: File; pos: LONGINT); VAR a, b: INTEGER; BEGIN r.eof := FALSE; r.res := 0; IF f # NIL THEN IF pos < 0 THEN a := 0; b := HS 			ELSIF pos < LONG(f.aleng)*SS + f.bleng - HS THEN a := SHORT((pos + HS) DIV SS); b := SHORT((pos + HS) MOD SS); ELSE a := f.aleng; b := f.bleng END ; r.file := f; r.apos := a; r.bpos := b; r.buf := f.firstbuf ELSE r.file:= NIL END END Set; PROCEDURE Read*(VAR r: Rider; VAR x: SYSTEM.BYTE); VAR buf: Buffer; BEGIN IF r.apos # r.buf.apos THEN r.buf := GetBuf(r.file, r.apos) END ; IF r.bpos < r.buf.lim THEN x := r.buf.data.B[r.bpos]; INC(r.bpos) ELSIF r.apos < r.file.aleng THEN INC(r.apos); buf := Buf(r.file, r.apos); IF buf = NIL THEN IF r.buf.mod THEN WriteBuf(r.file, r.buf) END ; ReadBuf(r.file, r.buf, r.apos) ELSE r.buf := buf END ; x := r.buf.data.B[0]; r.bpos := 1 ELSE x := 0X; r.eof := TRUE END END Read; PROCEDURE ReadBytes*(VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); VAR src, dst, m: LONGINT; buf: Buffer; BEGIN dst := SYSTEM.ADR(x); IF LEN(x) < n THEN HALT(25) END ; IF r.apos # r.buf.apos THEN r.buf := GetBuf(r.file, r.apos) END ; LOOP IF n <= 0 THEN EXIT END ; src := SYSTEM.ADR(r.buf.data.B) + r.bpos; m := r.bpos + n; 			IF m <= r.buf.lim THEN SYSTEM.MOVE(src, dst, n); r.bpos := SHORT(m); r.res := 0; EXIT ELSIF r.buf.lim = SS THEN m := r.buf.lim - r.bpos; IF m > 0 THEN SYSTEM.MOVE(src, dst, m); INC(dst, m); DEC(n, m) END ; IF r.apos < r.file.aleng THEN INC(r.apos); r.bpos := 0; buf := Buf(r.file, r.apos); IF buf = NIL THEN IF r.buf.mod THEN WriteBuf(r.file, r.buf) END ; ReadBuf(r.file, r.buf, r.apos) ELSE r.buf := buf END ELSE r.res := n; r.eof := TRUE; EXIT END ELSE m := r.buf.lim - r.bpos; IF m > 0 THEN SYSTEM.MOVE(src, dst, m); r.bpos := r.buf.lim END ; r.res := n - m; r.eof := TRUE; EXIT END END END ReadBytes; PROCEDURE NewExt(f: File); VAR i, k: INTEGER; ext: Index; BEGIN k := (f.aleng - STS) DIV XS; IF k = FileDir.ExTabSize THEN HALT(23) END ; NEW(ext); ext.adr := 0; ext.mod := TRUE; f.ext[k] := ext; i := XS; REPEAT DEC(i); ext.sec.x[i] := 0 UNTIL i = 0 END NewExt; PROCEDURE Write*(VAR r: Rider; x: SYSTEM.BYTE); VAR f: File; buf: Buffer; BEGIN IF r.apos # r.buf.apos THEN r.buf := GetBuf(r.file, r.apos) END ; IF r.bpos >= r.buf.lim THEN IF r.bpos < SS THEN INC(r.buf.lim); INC(r.file.bleng); r.file.modH := TRUE ELSE f := r.file; WriteBuf(f, r.buf); INC(r.apos); buf := Buf(r.file, r.apos); IF buf = NIL THEN IF r.apos <= f.aleng THEN ReadBuf(f, r.buf, r.apos) ELSE r.buf.apos := r.apos; r.buf.lim := 1; INC(f.aleng); f.bleng := 1; f.modH := TRUE; IF (f.aleng - STS) MOD XS = 0 THEN NewExt(f) END END ELSE r.buf := buf END ; r.bpos := 0 END END ; r.buf.data.B[r.bpos] := x; INC(r.bpos); r.buf.mod := TRUE END Write; PROCEDURE WriteBytes*(VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; 			n: LONGINT); VAR src, dst, m: LONGINT; f: File; buf: Buffer; BEGIN src := SYSTEM.ADR(x); IF LEN(x) < n THEN HALT(25) END ; IF r.apos # r.buf.apos THEN r.buf := GetBuf(r.file, r.apos) END ; LOOP IF n <= 0 THEN EXIT END ; r.buf.mod := TRUE; dst := SYSTEM.ADR(r.buf.data.B) + r.bpos; m := r.bpos + n; 			IF m <= r.buf.lim THEN SYSTEM.MOVE(src, dst, n); r.bpos := SHORT(m); EXIT ELSIF m <= SS THEN SYSTEM.MOVE(src, dst, n); r.bpos := SHORT(m); r.file.bleng := SHORT(m); r.buf.lim := SHORT(m); r.file.modH := TRUE; EXIT ELSE m := SS - r.bpos; IF m > 0 THEN SYSTEM.MOVE(src, dst, m); INC(src, m); DEC(n, m) END ; f := r.file; WriteBuf(f, r.buf); INC(r.apos); r.bpos := 0; buf := Buf(f, r.apos); IF buf = NIL THEN IF r.apos <= f.aleng THEN ReadBuf(f, r.buf, r.apos) ELSE r.buf.apos := r.apos; r.buf.lim := 0; INC(f.aleng); f.bleng := 0; f.modH := TRUE; IF (f.aleng - STS) MOD XS = 0 THEN NewExt(f) END END ELSE r.buf := buf END END END END WriteBytes; PROCEDURE Pos*(VAR r: Rider): LONGINT; BEGIN RETURN LONG(r.apos)*SS + r.bpos - HS 	END Pos; PROCEDURE Base*(VAR r: Rider): File; BEGIN RETURN r.file END Base; PROCEDURE Delete*(name: ARRAY OF CHAR; VAR res: INTEGER); VAR adr: DiskAdr; namebuf: FileDir.FileName; BEGIN Check(name, namebuf, res); IF res = 0 THEN FileDir.Delete(namebuf, adr); IF adr = 0 THEN res := 2 END END END Delete; PROCEDURE Rename*(old, new: ARRAY OF CHAR; VAR res: INTEGER); VAR adr: DiskAdr; oldbuf, newbuf: FileDir.FileName; head: FileDir.FileHeader; BEGIN Check(old, oldbuf, res); IF res = 0 THEN Check(new, newbuf, res); IF res = 0 THEN FileDir.Delete(oldbuf, adr); IF adr # 0 THEN FileDir.Insert(newbuf, adr); Kernel.GetSector(adr, head); head.name := newbuf; Kernel.PutSector(adr, head) ELSE res := 2 END END END END Rename; BEGIN Kernel.FileRoot := SYSTEM.ADR(root) END Files.

title: Oberon/V2/Files


text:
User:World Authors

Amresh Chandra Satapathy

Author of IAS Physics, India

Author of AP Physics C Mechanics, Universities of USA and Canada

title: User:World Authors


text: Category:User kcg

title: Category:User kcg


text:
Oberon/V2/Modules

MODULE Modules; (*NW 16.2.86 / 7.4.91*) IMPORT SYSTEM, Kernel, FileDir, Files; CONST ModNameLen* = 20; ObjMark = 0F8X; TYPE Module* = POINTER TO ModDesc; Command* = PROCEDURE; ModuleName* = ARRAY ModNameLen OF CHAR; ModDesc* = RECORD SB*, LB*, PB*, BB*, CB*, RB*, IB*, size*, key*: LONGINT; name*: ModuleName; refcnt*: LONGINT; link*: Module END ; VAR res*: INTEGER; importing*, imported*: ModuleName; loop: Command; PROCEDURE ReadName(VAR R: Files.Rider; VAR s: ARRAY OF CHAR; n: INTEGER); VAR ch: CHAR; i: INTEGER; BEGIN i := 0; REPEAT Files.Read(R, ch); s[i] := ch; INC(i) UNTIL ch = 0X; WHILE i < n DO Files.Read(R, ch); s[i] := 0X; INC(i) END END ReadName; PROCEDURE OpenFile(VAR F: Files.File; VAR name: ARRAY OF CHAR); VAR i: INTEGER; ch: CHAR; Fname: ARRAY 32 OF CHAR; BEGIN i := 0; ch := name[0]; (*make file name*) WHILE ch > 0X DO Fname[i] := ch; INC(i); ch := name[i] END ; Fname[i] := "."; Fname[i+1] := "O"; Fname[i+2] := "b"; Fname[i+3] := "j"; Fname[i+4] := 0X; F := Files.Old(Fname) END OpenFile; PROCEDURE PD(mod: Module; pc: LONGINT): LONGINT; BEGIN (*procedure descriptor*) RETURN ASH(pc, 16) + SYSTEM.VAL(LONGINT, mod) END PD; PROCEDURE ThisMod*(name: ARRAY OF CHAR): Module; (*search module in list; if not found, load module*) VAR mod, impmod, md: Module; ch: CHAR; mno, pno: SHORTINT; i, j: INTEGER; nofentries, nofimps, nofptrs, comsize, noflinks, constsize, codesize: INTEGER; varsize, size, key, impkey, k, p, q, pos1, pos2: LONGINT; init: Command; F: Files.File; R: Files.Rider; modname, impname: ModuleName; Fname: ARRAY FileDir.FnLength OF CHAR; import: ARRAY 16 OF Module; PROCEDURE err(n: INTEGER); BEGIN IF res = 0 THEN res := n; COPY(name, imported) END END err; BEGIN res := 0; mod := SYSTEM.VAL(Module, Kernel.ModList); LOOP IF name = mod.name THEN EXIT END ; mod := mod.link; IF mod = NIL THEN EXIT END END ; IF mod = NIL THEN (*load*) OpenFile(F, name); IF F # NIL THEN Files.Set(R, F, 0); Files.Read(R, ch); (*header*) IF ch # ObjMark THEN err(2); RETURN NIL END ; Files.Read(R, ch); IF ch # "6" THEN err(2); RETURN NIL END ; Files.ReadBytes(R, k, 4); (*skip*) Files.ReadBytes(R, nofentries, 2); Files.ReadBytes(R, comsize, 2); Files.ReadBytes(R, nofptrs, 2); Files.ReadBytes(R, nofimps, 2); Files.ReadBytes(R, noflinks, 2); Files.ReadBytes(R, varsize, 4); Files.ReadBytes(R, constsize, 2); Files.ReadBytes(R, codesize, 2); Files.ReadBytes(R, key, 4); ReadName(R, modname, ModNameLen); i := (nofentries + nofptrs)*2 + comsize; pos1 := Files.Pos(R); Files.Set(R, F, pos1 + i + 3); INC(i, nofimps*2); k := (i MOD 4) + i; 				(*imports*) Files.Read(R, ch); IF ch # 85X THEN err(4); RETURN NIL END ; res := 0; i := 0; WHILE (i < nofimps) & (res = 0) DO 					Files.ReadBytes(R, impkey, 4); ReadName(R, impname, 0); Files.Read(R, ch); impmod := ThisMod(impname); IF res = 0 THEN IF impmod.key = impkey THEN import[i] := impmod; INC(i); INC(impmod.refcnt) ELSE res := 3; imported := impname; importing := modname END END END ; IF res # 0 THEN WHILE i > 0 DO DEC(i); DEC(import[i].refcnt) END ; RETURN NIL END ; pos2 := Files.Pos(R); size := k + noflinks*4 + constsize + codesize + varsize; Kernel.AllocBlock(q, p, size); mod := SYSTEM.VAL(Module, q); mod.size := size; mod.BB := p; 				mod.CB := nofentries*2 + p; 				mod.RB := comsize + mod.CB; mod.IB := nofptrs*2 + mod.RB; mod.LB := k + p; 				mod.SB := (noflinks*4 + varsize) + mod.LB; mod.PB := constsize + mod.SB; mod.refcnt := 0; mod.key := key; mod.name := modname; (*entries*) q := mod.CB; Files.Set(R, F, pos1); Files.Read(R, ch); IF ch # 82X THEN err(4); RETURN NIL END ; WHILE p < q DO Files.Read(R, ch); SYSTEM.PUT(p, ch); INC(p) END ; (*commands*) q := mod.RB; Files.Read(R, ch); IF ch # 83X THEN err(4); RETURN NIL END ; WHILE p < q DO Files.Read(R, ch); SYSTEM.PUT(p, ch); INC(p) END ; (*pointer references*) q := mod.IB; Files.Read(R, ch); IF ch # 84X THEN err(4); RETURN NIL END ; WHILE p < q DO Files.Read(R, ch); SYSTEM.PUT(p, ch); INC(p) END ; i := 0; WHILE i < nofimps DO SYSTEM.PUT(p, import[i]); INC(p, 2); INC(i) END ; (*links*) Files.Set(R, F, pos2+1); p := mod.LB; q := noflinks*4 + p; 				WHILE p < q DO 					Files.Read(R, pno); Files.Read(R, mno); IF mno > 0 THEN md := import[mno-1] ELSE md := mod END ; IF pno = -1 THEN SYSTEM.PUT(p, md.SB) (*data segment entry*) ELSE SYSTEM.GET(pno*2 + md.BB, i); SYSTEM.PUT(p, PD(md, i)) (*procedure entry*) END ; INC(p, 4) END ; (*variables*) q := mod.SB; WHILE p < q DO SYSTEM.PUT(p, 0); INC(p) END ; (*constants*) q := mod.PB; Files.Read(R, ch); IF ch # 87X THEN err(4); RETURN NIL END ; WHILE p < q DO Files.Read(R, ch); SYSTEM.PUT(p, ch); INC(p) END ; (*code*) q := p + codesize; Files.Read(R, ch); IF ch # 88X THEN err(4); RETURN NIL END ; WHILE p < q DO Files.Read(R, ch); SYSTEM.PUT(p, ch); INC(p) END ; (*type descriptors*) Files.Read(R, ch); IF ch # 89X THEN err(4); RETURN NIL END ; LOOP Files.ReadBytes(R, i, 2); IF R.eof OR (i MOD 100H = 8AH) THEN EXIT END ; Files.ReadBytes(R, j, 2); (*adr*) SYSTEM.NEW(md, i); p := SYSTEM.VAL(LONGINT, md); q := p + i; 					REPEAT Files.Read(R, ch); SYSTEM.PUT(p, ch); INC(p) UNTIL p = q; 					SYSTEM.PUT(mod.SB + j, md) END ; init := SYSTEM.VAL(Command, mod); init; ELSE COPY(name, imported); err(1) END END ; RETURN mod END ThisMod; PROCEDURE ThisCommand*(mod: Module; name: ARRAY OF CHAR): Command; VAR i: INTEGER; ch: CHAR; comadr: LONGINT; com: Command; BEGIN com := NIL; IF mod # NIL THEN comadr := mod.CB; res := 5; LOOP SYSTEM.GET(comadr, ch); INC(comadr); IF ch = 0X THEN (*not found*) EXIT END ; i := 0; LOOP IF ch # name[i] THEN EXIT END ; INC(i); IF ch = 0X THEN res := 0; EXIT END ; SYSTEM.GET(comadr, ch); INC(comadr) END ; IF res = 0 THEN (*match*) SYSTEM.GET(comadr, i); com := SYSTEM.VAL(Command, PD(mod, i)); EXIT ELSE WHILE ch > 0X DO SYSTEM.GET(comadr, ch); INC(comadr) END ; INC(comadr, 2) END END END ; RETURN com END ThisCommand; PROCEDURE unload(mod: Module; all: BOOLEAN); VAR p: LONGINT; k: INTEGER; imp: Module; BEGIN p := mod.IB; WHILE p < mod.LB DO (*scan imports*) SYSTEM.GET(p, k); imp := SYSTEM.VAL(Module, LONG(k)); IF imp # NIL THEN DEC(imp.refcnt); IF all & (imp.refcnt = 0) THEN unload(imp, all) END END ; INC(p, 2) END ; Kernel.FreeBlock(SYSTEM.VAL(LONGINT, mod)) END unload; PROCEDURE Free*(name: ARRAY OF CHAR; all: BOOLEAN); VAR mod: Module; BEGIN mod := SYSTEM.VAL(Module, Kernel.ModList); LOOP IF mod = NIL THEN res := 1; EXIT END ; IF name = mod.name THEN IF mod.refcnt = 0 THEN unload(mod, all); res := 0 ELSE res := 2 END ; EXIT END ; mod := mod.link END END Free; BEGIN IF Kernel.err = 0 THEN loop := ThisCommand(ThisMod("Oberon"), "Loop") END ; loop END Modules.

title: Oberon/V2/Modules


text: User:Kambai Akau/sandbox

title: User:Kambai Akau/sandbox


text:
Oberon/V2/Input

MODULE Input; (*NW 5.10.86 / 15.11.90 Ceres-2*) IMPORT SYSTEM, Kernel; CONST N = 32; MOUSE = 0FFFFB000H; UART = 0FFFFC000H; ICU = 0FFFF9000H; VAR MW, MH: INTEGER; (*mouse limits*) T: LONGINT; (*time counter*) n, in, out: INTEGER; buf: ARRAY N OF CHAR; PROCEDURE Available*: INTEGER; BEGIN RETURN n 	END Available; PROCEDURE Read*(VAR ch: CHAR); BEGIN REPEAT UNTIL n > 0; DEC(n); ch := buf[out]; out := (out+1) MOD N 	END Read; PROCEDURE Mouse*(VAR keys: SET; VAR x, y: INTEGER); VAR u: LONGINT; BEGIN SYSTEM.GET(MOUSE, u); keys := {0,1,2} - SYSTEM.VAL(SET, u DIV 1000H MOD 8); x := SHORT(u MOD 1000H) MOD MW; y := SHORT(u DIV 10000H) MOD 819; IF y >= MH THEN y := 0 END END Mouse; PROCEDURE SetMouseLimits*(w, h: INTEGER); BEGIN MW := w; MH := h 	END SetMouseLimits; PROCEDURE Time*: LONGINT; VAR lo, lo1, hi: CHAR; t: LONGINT; BEGIN REPEAT SYSTEM.GET(UART+28, lo); SYSTEM.GET(UART+24, hi); t := T - LONG(ORD(hi))*256 - ORD(lo); SYSTEM.GET(UART+28, lo1) UNTIL lo1 = lo; RETURN t 	END Time; PROCEDURE+ KBINT; VAR ch: CHAR; BEGIN SYSTEM.GET(UART+12, ch); (*RHRA*) IF ch = 0FFX THEN HALT(24) END ; IF n < N THEN buf[in] := ch; in := (in+1) MOD N; INC(n) END END KBINT; PROCEDURE+ CTInt; VAR dmy: CHAR; BEGIN SYSTEM.GET(UART+60, dmy); (*stop timer*) INC(T, 0FFFFH); SYSTEM.GET(UART+56, dmy) (*restart timer*) END CTInt; BEGIN MW := 1024; MH := 800; n := 0; in := 0; out := 0; T := 0FFFFH; Kernel.InstallIP(KBINT, 4); Kernel.InstallIP(CTInt, 0); SYSTEM.PUT(UART+16, 10X); (*ACR*) SYSTEM.PUT(UART+ 8, 15X); (*CRA enable*) SYSTEM.PUT(UART, 13X); (*MR1A, RxRdy -Int, no parity, 8 bits*) SYSTEM.PUT(UART, 7X); (*MR2A 1 stop bit*) SYSTEM.PUT(UART+ 4, 44X); (*CSRA, rate = 300 bps*) SYSTEM.PUT(UART+52, 14X); (*OPCR OP4 = KB and OP3 = C/T int*) SYSTEM.PUT(UART+28, 0FFX); (*CTLR*) SYSTEM.PUT(UART+24, 0FFX); (*CTUR*) SYSTEM.GET(UART+56, buf[0]); (*start timer*) SYSTEM.PUT(ICU + 4, 18X); (*clear ICU IMR and IRR bits 0*) SYSTEM.PUT(ICU + 4, 1CX); (*clear ICU IMR and IRR bits 4*) END Input.

title: Oberon/V2/Input


text:
Oberon/V2/Fonts

MODULE Fonts; IMPORT Display; TYPE Name = ARRAY 32 OF CHAR;103 Font = POINTER TO FontDesc; FontDesc = RECORD name: Name; height, minX, maxX, minY, maxY INTEGER; raster: Display.Font END; VAR Default: Font; PROCEDURE This (name: ARRAY OF CHAR): Font; END Fonts.

title: Oberon/V2/Fonts


text:
User talk:Pxdclaps24

--Pi zero (discuss • contribs) 19:34, 26 January 2021 (UTC)

title: User talk:Pxdclaps24


text:
Tyap/Alphabet

Zwunzwuo a̱lyem Tyap ※ Tyap alphabet

The Tyap alphabet (Zwunzwuo A̱lyem Tyap ji) formerly had 39 letters, as drafted by the Tyap Literacy Committee (TLC) during the early 1990s:

 * Tyap alphabet: previous basic before 2018

Capital Letters

A	A̱	B	CH	CHY	D	E	F	G	GB	GH	GHW	GHY	H	I	I̱	J	JHY	K	KH	KP	L	M	N	NG	NY	O	P	R	S	SH	SHY	T	TS	U	V	W	Y	Z

Small letters

a	a̱	b	ch	chy	d	e	f	g	gb	gh	ghw	ghy	h	i	i̱	j	jhy	k	kh	kp	l	m	n	ng	ny	o	p	r	s	sh	shy	t	ts	u	v	w	y	z

Phonetic value

a	ə	b	t͡ʃ	t͡ʃʲ	d	e	f	g	g͡b	ɣ	ɣʷ	ɣʲ	h	i	ɪ	d͡ʒ	ʒʲ	k	x	k͡p	l	m	n	ŋ	ɲ	o	p	r	s	ʃ	ʃʲ	t	t͡s	u	v	w	j	d͡z

However, a current development as of 2018, has the Tyap Basic Alphabetical Chart reduced to 24, as follows:

Capital Letters Small letters The letter "ch" would henceforth be represented by the symbol "c", without the "h". All others remain the same.
 * Tyap alphabet: new basic

Phonetic value Pronounce outrightly as :

 * Some Tyap words associated with the alphabet

<>

title: Tyap/Alphabet


text:
Themes in Literature/Isolation and Community/The Bet

Text
“The Bet,” a short story by Anton Chekhov, as translated by Constance Garnett.

Publication information about “The Bet”
During the winter of 1888, Nikolai Khudekov, editor of Peterburgskaya Gazeta, commissioned Chekhov to write a story for his newspaper. The resulting work, "The Shoemaker and the Devil," was published on Christmas Day. Following this, Alexey Suvorin, editor of the Novoye Vremya, requested that Chekhov write a story to rival it for his newspaper before the year's end. Chekhov's story, divided into three parts, appeared on New Year's Day, 1889, under the title "Fairytale."

While revising the story for inclusion in Volume 4 of Chekhov's Collected Works (1899–1901), he changed the title to "The Bet" and removed part 3 of the original text. Chekhov explained that "as [he] was reading the proofs, [he] came to dislike the end, it occurred to [him] that it was too cold and cruel."

Summary
In the short story “The Bet," Chekhov describes a bet that was placed between two young men, a banker, and a lawyer, regarding capital punishment and imprisonment for life.

According to this bet, the lawyer- who claims that imprisonment for life is preferable than capital punishment- should experience imprisonment for fifteen years under the banker’s watch. The banker believes that lifelong imprisonment is more inhumane than death penalty. The reward of the bet would be two million dollars that the banker should give to the lawyer if the second can endure solitary confinement in a lodge in the banker’s garden for the time they had agreed on. Even though the lawyer would have whatever he wants during his imprisonment, the only way of communication with others would be through a very small window.

Chekhov presents the lawyer’s imprisonment by describing his psychological state, his thoughts, and his hobbies. He reports the prisoner’s relationship with wine, food, smoking, and music, and he also emphasizes the prisoner’s relationship with books and writing. Even though the prisoner suffered severe loneliness and depression in the first years, his relationship with all books totally changed him as a person. During the span of the fifteen years of isolation, the prisoner read many kinds of books that help him value and understand himself and life in general. When the fifteen years have almost passed, the banker decides to kill his prisoner one day before the time fixed so as to not pay the money.

As the banker gets ready to kill the lawyer, who is asleep at the table, he stops to read the letter the lawyer was writing to him. In this letter the lawyer explains that he plans to break the compact since he learned that material goods are not worth anything compare to divine salvation. Shocked and happy after reading the letter, the banker returns home without killing the lawyer. Learning the next day that the lawyer has escaped, the banker locks the letter in his safe to prevent the spread of rumors.

Analysis
In this short story, Chekhov explores the psychological effects of social isolation on a person’s perspective of life and freedom. The setting plays a crucial role in conveying this message to the audience. The lawyer's confinement in a small lodge in the banker’s garden, with only one small window, isolates him from any community. Deprived of human contact, he undergoes various psychological stages to combat depression and emotional distress. The lodge's location in the banker’s garden emphasizes the perception of the lawyer as one of the banker’s possessions, highlighting the banker’s inhumanity and immorality.

A significant narrative element that illustrates the sense of isolation and the transformative power of solitude is the symbolism of books and writing. Over fifteen years, the prisoner reads a diverse range of books, from chemistry to poetry, philosophy, and foreign languages, and writes numerous letters. The variety of books and the letters he writes reflect his evolving psychological state and his quest to understand himself and the world around him. Writing becomes a form of self-expression and therapy, helping him connect with his inner self and process his emotions.

Through reading, the prisoner learns new things and feels productive, which boosts his self-worth and broadens his perspective. His choice of books reveals the different mental and psychological stages he experiences over the fifteen years. He forms a unique community with the books, finding companionship, relaxation, and intellectual stimulation. Initially, he reads languages, philosophy, and history, which prompt him to ponder life and the world. Later, he finds solace in the Gospel for a year before turning to theology and histories, which help him appreciate diverse ideas, beliefs, and theories. Eventually, he reads natural science, chemistry, medicine, novels, Shakespeare, and Byron, enhancing his knowledge and creativity and deepening his understanding of both the physical and metaphysical worlds.

The story’s two main characters, the banker and the prisoner, are central to conveying Chekhov’s message. Initially, both are young and naïve. By the end, they have undergone profound changes. The banker, who starts as a young, nervous, and wealthy man believing life imprisonment to be more inhumane than the death penalty, becomes a cruel, greedy, and desperate individual willing to kill the prisoner to avoid losing his fortune. He disregards the lawyer’s intellectual growth, focusing solely on material wealth.

On the other hand, the prisoner begins as a 25-year-old lawyer who prefers life imprisonment over the death penalty and accepts the banker’s bet to give up his freedom for two million dollars. After fifteen years of confinement, he emerges as a more intellectual individual who has discovered his identity and gained a deeper understanding of life. Unlike the banker, the lawyer no longer values material wealth but instead prioritizes non-material virtues such as truth and beauty.

Glossary

 * Life imprisonment: any sentence of imprisonment for a crime under which convicted persons are to remain in prison either for the rest of their natural life or until pardoned, paroled or otherwise commuted to a fixed term.

 * Capital punishment: a government-sanctioned practice whereby a person is put to death by the state as a punishment for a crime, also known as death penalty.

 * Depression: a mental disorder that is characterized from states of low mood and aversion to activity and can negatively affect a person's thoughts, behavior, motivation, feelings, and sense of well-being.

 * Loneliness: an unpleasant emotional response to perceived isolation.

Critical thinking questions

 * In your opinion, which is more immoral and inhumane, the death penalty or life imprisonment? If you think they are equal, explain why.
 * Would the outcome have been the same if the prisoner did not have so many resources at his disposal? Explain.
 * Do you think the banker would have gone through with the killing if he had not found the prisoner’s letter? Do you feel that it would been the only option for him? Explain why or why not.
 * Do you think there is a moral lesson in Chekhov’s short story? If so, explain what it is.
 * The story's publication history shows it was published New Year's Day. In what ways is this story appropriate for the beginning of a new year?


text:
User:Wednesday743ish

Hengki Ardika is a Mathematician and Statistical Diplomat in Aceh, Indonesia.

title: User:Wednesday743ish


text:
History of video games/Platforms/Panasonic M2

History
The M2 was a planned successor to the 3DO Interactive Multiplayer game console.

In 1995 3DO sold the console to Panasonic/Matsushita for a sum said to be around $100 million dollars. In 1997 the 3DO M2 was cancelled. Following the cancellation of the console, parts were reused in other non-gaming applications.

Panasonic would once again nearly bring a console to market with the Panasonic Jungle.

Throughout the 2010's the collector Anthony Bacon did much to preserve M2 related items. As a result, a free compilation disk was produced containing surviving demo software for the system by February 1st, 2020.

Technology
The system was initially envisioned as an add on to the 3DO instead of its own console with the name M2 being short for Mark 2 Accelerator. (The first design was called Bull Dog), similar to how the Sega 32X was developed into the unreleased Sega Neptune (Though neither concept of the M2 saw release). This development path likely influenced the components chosen for the console.

Standard Components
The M2 was an early adoption of the PowerPC processor architecture in a game console, a choice other console makers would often make later during the 2000s. The system sported two individual Power PC 602 processors each clocked at 66.7 megahertz, as well as 10 custom coprocessors. Though the console was marketed as being 64-bit, this was actually in reference to the bus width of the CPU, as this component was a cost reduced version of the PowerPC 603, a 32-bit CPU. This is yet another trend from the period, where marketers would either mistakenly or misleadingly use bit size as a measure of console power, and would find other specifications which met that bit size, or claim that two components with 32-bit hardware were the same as 64 bit hardware. Even so, the system was quite powerful for its time, and was equipped quite favorably compared to typical desktop computers of 1995, and even some multi processor workstation designs.

The console was outfitted with 16 megabytes of RAM.

Per Model Components
Beyond the basic compute platform, the system had varying specs between prototype models.

Notable Games
Despite the ultimate cancelation of the M2, a solid lineup of games had been planned for the system. Many games that started development on the M2 saw release on other platforms.

D2
A Survival Horror game that was later released on the Sega Dreamcast.

Read more about D2 on Wikipedia

Power Stone
An Innovative fighting game later ported to the Sega Dreamcast.

Read more about Power Stone on Wikipedia.

External Resources

 * Video Game Console Library - Panasonic M2 Page with photos of prototype hardware and historical information.


text:
History of video games/Platforms/Red Jade

Introduction
The turn of the millennium saw a great amount of the general public adopting mobile cell phones to use in their daily life. Yet these majority of these phones were limited, capable of only basic communications and rarely simple applications or games.

While simple mobile gaming and handheld game consoles had existed prior to the Red Jade, this device sought to meld a high end 3D gaming experience to the those on the go with added utility of emerging mobile phone technologies further differentiating the device from established competitors. Many of the technologies pioneered on the device, such as exclusively using digital distribution, would not be seen on major handhelds for nearly a decade. Beyond technological superiority, the console was backed by proven developers and significant financial investments.

However shortly prior to launch a recession ultimately caused the device to be scrapped, with only a smattering of photographs, press releases, and news articles offering any proof of the existence of the console. Still, the device shows an interesting look at the cutting edge technologies for the time, and the trade offs required to achieve them.

Development
In February 2000 Red Jade was founded as a company by DICE founder Fredrik Liliegren, with headquarters in Palo Alto, California. Red Jade sought backing from Sega and Sony, before partnering with Ericsson, who wanted to enter the gaming market to get ahead of their rival Nokia. Ericsson invested $7 to $10 million on the console, with plans to invest up to $500 million further in development (Which did not come to pass), and with Swedish venture capital firm IT Provider providing a further $3 million of backing. With Red Jade developing the system, Ericson would have been in charge of most other responsibilities, including manufacturing the handhelds, distributing the produced consoles, and marketing the consoles, which as a cellular hardware giant they were better positioned to do.

Linux was used on Red Jade development kits.

Red Jade was just a placeholder name, and would have likely been replaced release to launch had the console actually launched.

Legacy
Red Jade was cancelled in April 2001 as a result of the early 2000s recession. The console would have cost anywhere between $100 and $300 at retail, with price being a common concern. Despite the relatively high hardware cost, the console would have used digital distribution for games, allowing Ericsson to sell cheaper gamers at a cost of only $20 instead of the common $30 price point. The console was not planned to sometime in 2002. The console stands out as one of the first handhelds to seriously attempt online game store as it's primary distribution system.

Red Jade was later restarted in 2006 as a game development studio by Fredrik Liliegren, notably assisting with titles such as Battlefield: Bad Company. Ericsson would later produce a console in the Experia Play as Sony Ericson.

Technology
Red Jade took care not to reveal too much about their console, and it seemed like many details were intentionally in flux to quickly adapt to market conditions. As a result, little solid information is known about the console.

The system used either a 32-bit or a 64 bit MIPS architecture processor. The system used a custom 3D chipset, with some suggesting an unconfirmed NVIDIA partnership.

The Red Jade is said to have had software supporting PDA functionality and MP3 Playback.

The Red Jade is said to be capable of 3D graphics comparable to fifth generation home game consoles.

The Red Jade had radios for Bluetooth, Cellular phone networks, and GPS signals. As Ericsson is a telecommunications technology company, and also the inventor of Bluetooth, it makes sense that they would promote such features.

The system would have had a TFT screen without a backlight.

Known Games

 * Quake III Arena was ported to the device.

External Resources

 * Official Website - Archived version.


text:
History of video games/Platforms/Panasonic Jungle

Development
Panasonic had previously attempted to bring a console to market with the M2.

The Panasonic Jungle was developed by the Panasonic Cloud Entertainment division as a handheld game console oriented around playing MMORPGs on the go.

The Panasonic Jungle was shown to the press on October 4th, 2010. The console was met with skepticism on announcement. Unlike many niche consoles, Panasonic took marketing the console very seriously, going as far as to employ the then popular media company Machinima for marketing the console. This resulted in a 7 episode cartoon promoting the console, with a number of stylized mascot characters. The console was also promoted on the MTV show Rob Dyrdek's Fantasy Factory.

Development of the Panasonic Jungle had proceeded relatively well. The Wi-Fi only model would have cost $299.00, with a later pre-launch price reduction to 249.99. The model with a 3G radio cost $349.99. Branded in ear headphones and MicroHDMI cables were listed for sale. However there would be no launch, as the Jungle was officially canceled on Tuesday, March 1st, 2011.

Legacy
The legacy of the Panasonic Jungle is intrinsically tied to the rapidly changing market conditions of the time. A well executed portable handheld designed around playing popular MMORPGs in the early 2010s would have likely been successful in its niche had it only faced traditional competition. However the threat to the Panasonic Jungle posed by Smartphone gaming was not only very real, it quickly became an issue for larger and companies already established in the handheld gaming market such as Nintendo and Sony. Thus the act of canceling the console and avoiding the risk of a launch was thus widely seen as a safe call, though even with smartphone gaming on the rise, the failure of the Jungle was still not a certainty. One can only speculate how the then high end, though likely quite pricy, experience offered by the Jungle would have fared against early smartphone gaming.

A functional prototype Jungle console surfaced in 2018 by a member posting on the forms for the DragonBox Pyra. In 2020 the system was more throughly documented by gaming historian "Developer Jeff".

Technology
It is important to note that for some time little was known about the actual specifications of the Panasonic Jungle, and most sources prior to cancellation give specifications that are either educated guesses, or are based on rumors. Even after a prototype surfaced, solid specifications were elusive for some time.

Compute
The console uses an NVIDIA Tegra 2 SOC containing a 32-bit dual core ARM Cortex A9 processor clocked at 1 gigahertz. This SOC included a GPU which was considered a powerful mobile graphics processor for the time.

The console has about 448 megabytes (448,452 Kb) of LPDDR2 single channel RAM clocked at 300 megahertz. This memory has a bandwidth of 2.4 gigabits per second.

The console has about 4 gigabytes (3,927 megabytes) of internal EMMC flash storage, which is expandable by MicroSD card.

There was a rumor that the device ran a version of Linux as its operating system.

Hardware
The console has a primary IPS LCD display with a resolution of 1280 pixels by 720 pixels, as well as a secondary OLED screen.

The console was designed to connect to the internet, and thus included a radio for Wi-Fi, and optionally included a 3G radio.

The handheld includes a small built in keyboard, which has red LEDs below keys for backlighting in the dark. These LEDs appear to be software controllable, and each key is also touch sensitive.

Supported games

 * Battlestar Galactica Online
 * Runescape
 * Stellar Dawn
 * World of Warcraft (Dubious if this was ever official, or simply media speculation.)

External Resources

 * Official Website - Archived website in 2010.
 * Developer Jeff - In depth look at the console and related materials.


text:
History of video games/Platforms/Kano Pixel

Introduction
The Kano Pixel represents an interesting take on minimalism in a handheld device. The device is interesting in that the sorts of games on it are less constrained by its processing power, but by the limitations of other parts of its hardware instead. While not explicitly marketed as a console, the device does have a dedicated game function on its dial, and is commonly used for gaming, and is thusly included in this book.

History
"My absolute favorite"

Kano got its start in 2013 selling educational computer kits out of London in the United Kingdom.

The Kano Pixel kit was influenced by the previous Kano Powerup kit. The device began crowdfunding on Kickstarter by October 2016. The device was part of a trio of devices also including a camera and a speaker seeking to raise 500,000 collectively, though the Pixel specifically had an earlier a projected ship date of December 2016. The release was pushed back to July 2017, reportedly due to a factory fire in addition to an issue with the antenna of the device. By early August 2017 the device had definitely launched.

The kit cost $99 on kickstarter with an estimated retail price of 129.99 for non backers, though the price did eventually drop to $79.99 regularly.

Technology
"You can make a game, for instance, whose parameters are controlled by the weather outside or whether Messi scored a goal or the density of mentions for a certain word on Twitter."

Kano got its start in 2013 selling educational computer kits.

Compute
The Kano Pixel uses an ESP-Wroom-32 SOC, containing a 32-bit LX6 dual core CPU clocked at 240 megahertz. The system has 520 kilobytes of SRAM.

The system has 16 megabytes of flash storage.

The Kano Pixel is programed using a visual programming language on an external device.

Hardware
The Pixel uses 128 RGB LEDs in a 16 by 8 matrix. The LEDs can generate 16 million colors, and can be updated 30 times a second.

The Kano Pixel has a radio for Wi-Fi on the 802.11n standard. The device also has a Bluetooth radio, though it appears to be unused.

The Pixel includes an omnidirectional MEMS (micro-electromechanical system) microphone. The console includes a tilt sensor, gyroscope, and accelerometer.

The Pixel is powered by a rechargeable lithium battery with a capacity of 1,550 mAh, lasting for about 3 hours of use.

Games
A version of Snake is built into the handheld. As an educational device, most games are made by the user, rather then commercial releases.

External Resources

 * Kano - Website for the Kano Pixel Kit.


text:
History of video games/Platforms/Kitronik GameZip 64

Launch
The Kitronik Game Zip 64 is a handheld gaming device released around 2018 as an add on to the educational BBC MicroBit computer.

A 10 pack kit of the console and accessories was made for classroom use. A more compact and cost reduced version of the console without a built in LED matrix display was also made.

Legacy
Many of the design decisions used on the Game Zip 64 would be reused by the later Kitronik Arcade handheld, released on October 30th, 2019.

BBC Micro Bit
The console is compatible both versions one or two of the BBC MicroBit. The Microbit effectively acts as both the storage medium and the computer, similar too many second generation home game consoles, though unlike those consoles, the Microbit can be reprogrammed.

Hardware
The console contains its own multicolor 64 LED display, which is arranged in an matrix 8 LEDs wide by 8 LEDs high. Because the Micro Bit also has it's own LED matrix, the microbit effectively acts as a secondary display, similar to the Nintendo DS line of handhelds.

The 3 AA batteries also act as grips for holding the console.

The console was manufactured in the United Kingdom.

Case Colors
Several optional laser cut perspex covers were manufactured in the United Kingdom for use with the system. These came in at least four styles.
 * Clear
 * Orange
 * Blue
 * Green


text:
History of video games/Platforms/Creoqode 2048

History
The Ceroqode 2048 Kickstarter crowdfunding campaign launched on June 21st, 2016, reaching its funding goal by July 12, 2016. Following schedule, consoles were shipped to backers on December 16th, 2016.

Technology
The console is powered by an Atmega 2560 R3 processor.

The Creoqode 2048 uses a matrix of RGB LEDs arranged to form a resolution of 64 LEDs by 32 LEDs for 2048 total LEDs, hence the name.

Unlike most handheld consoles, the Creoqode 2048 was not initially designed with battery support, though this was added later.


text:
User talk:2601:1C1:8801:AD30:91A0:C6D:DA2B:6F83

--Matttest (discuss • contribs) 08:29, 27 January 2021 (UTC)


text:
User talk:2001:16A2:C1E8:D51F:39E6:C784:1999:9172

January 2021
--Matttest (discuss • contribs) 08:36, 27 January 2021 (UTC)


text:
User talk:IrisP1998

Wrong language?
You seem to be writing non-English content. Are you looking for et.wikibooks.org? This is the English-language Wikibooks. Leaderboard (discuss • contribs) 09:32, 27 January 2021 (UTC)

title: User talk:IrisP1998


text:
User:Lukong Louis

This is Lukong, Cameroonian 🇨🇲, student in the University of Bamenda studying Computer Engineering.

title: User:Lukong Louis


text:
History of video games/Platforms/LaserCube

History
The LaserCube is a multifunction laser projector which was released around 2019 for about $499. Among the primary functions of the device was gaming using true vector graphics, and as a result a number of arcade style games were released for the system. The commercial LaserCube coincided with a small subsection of the DIY movement which focused on making laser based game hardware due to its unique properties.

At some point before January 2021 the 1 watt version of the LaserCube was discontinued due to a lack of demand, leaving only the higher power 2 watt version left.

Technology
Because the LaserCube is a general purpose device which includes gaming as a function, the designers of the LaserCube made a number of technical decisions which are extremely unusual for a console, but reasonable for a general purpose device.

Vector graphics
The LaserCube is distinct in being one of the few consoles to use a vector display exclusively. A class 4 pure laser diode is used to draw RGB graphics. Depending on the model a 1 watt or a 2 watt laser is used to draw graphics. The manufacturer suggests this laser is expected to last between 10,000 to 20,000 hours of use.

Software
The LaserCube runs games in a standard software environment called LaserOS, which is executed on an external Windows PC, Mac, or Android device. An API is used to extend the LaserCube.

Hardware
A fan is used to cool the 2 watt model, as the LaserCube automatically shuts off when temperatures reach or exceed 104 degrees Fahrenheit.

The American version of the LaserCube, of which only a 2 watt version was ever sold, has several utility functions disabled to comply with safety regulations, leaving entertainment as it's only real purpose.

External Resources

 * PC Mag - Review including pictures.
 * Rerez YouTube Video - Video review focusing on gaming functionality.
 * LinusTechTips YouTube Video - Video briefly demonstrating a LaserCube as part of a larger project.