Copyright Bruce Wilcox<EMAIL_ADDRESS>www.brilligunderstanding.com
Revision 4/24/2022 cs12.1
This manual is a grab bag of various capabilities. There are separate other Advanced manuals like Advanced Topic Manual, Advanced Pattern Manual, Advanced Concept manual, and Advanced Variable Manual for in-depth extras on main CS ideas.
CS is a scripting language for interactivity. Each time CS communicates with the user, this is called a volley.
Volleys are always asynchronous. In CS, each volley actually consists of accepting an incoming input from an arbitrary user, loading data about the user and their state, computing a response, writing out a new state, and sending a response to the user.
The fundamental code mechanism of ChatScript is the topic, which is a collection of rules.
Rules have pattern and code components.
Within a topic each rule is considered in turn by matching its pattern component. Patterns can access global data and the user’s input, can perform comparisons, and can memorize sections of input data.
If the pattern fails, the next rule in the topic is considered. If a pattern succeeds, the rule’s code section is then executed to completion (barring error conditions).
A rule’s code can be a mixture of CS script to execute and words to say to the user.
Code can invoke other topics or directly request execution of a specific rule. When the rule code completes, if user output has been generated, then by default no more rules are initiated anywhere in the system. Rules currently in progress complete their code. If no output was generated, the topic continues on to the next rule, trying to match its pattern. When a topic completes without generating output, it merely returns to its caller code, which continues executing normally.
So how is it that CS handles returning input from the user? A rule that generates user output may have rules called rejoinders that immediately follow the rule.
Rejoinders are intended to analyze the specific next input from the user to see if certain expectations are met and decide what to do. If, for example, we output a yes or no question, one rejoinder rule might look for a yes answer, while another rejoinder hunts for a no answer.
When CS outputs text to the user, if the rule has rejoinders, CS notes the rule. When new user input arrives, CS will try executing the rejoinder rules immediately, to see if they match the user’s input. All previous stack-based functions are gone, all previous stack-based calls from other topics are gone.
CS is just in the here and now of this topic and the rejoinders of that rule. If CS finds a matching rejoinder rule, it continues in this topic. If it doesn’t, CS reverts to globally using whatever the control script dictates it try for any user input.
In addition to script code, ChatScript has data. It supports global
user variables whose names always start with $
, e.g.,
$tmp
. Global means they are visible everywhere. You don’t
have to pre-declare them. You can directly use one and you can just
summon one into existence by assigning into it:
$myvariable = 1 + $yourvariable
$myvariable
is created if it doesn’t already exist. And
if $yourvariable
hasn’t been created, it will be
interpreted as 0 or null
depending on context (here it is
0).
User variables always hold text strings as values.
Numbers are represented as digit text strings, which are converted into binary formats internally as needed.
Text comes in three flavors.
First are simple words (arbitrary contiguous characters with no spaces).
Second are passive strings like meat-loving plants.
Third are active strings (which you haven’t read about yet) like:
^"I like $value"
Active strings involve references to functions or data inside them and execute when used to convert their results into a passive string with appropriate value substitutions.
Other languages would name a CS active string a format string, and have to pass it to a function like sprintf along with the arguments to embed into the format. CS just directly embeds the arguments in the string and any attempt to use the active string implicitly invokes the equivalent of sprintf.
User variables also come in permanent and transient forms.
| variable scope | syntax example |
description |
|---|---|---|
| permanent | $permvar |
start with a single $ and are preserved across user
interactions (are saved and restored from disk). You can see and alter
their value from anywhere. |
| transient | $$transientvar |
start with $$ and completely disappear when a user
interaction happens (are not saved to disk). You can see and alter their
value from anywhere. |
| local | $_localvar |
(described later) start with $_ and completely
disappear when a user interaction happens (are not saved to disk). You
can see and alter their value only within the topic or outputmacro they
are used. |
System variables begin with %. Normally these are simply read-only data, but it is legal to assign to them as well, with certain consequences.
%response = 5
The first consequence is that the change is global, across all bots and users, whether the system is stand-alone or a server.
The other consequence is that usually the change is locked in permanently until you tell the system to release it by assigning a dot to it.
%response = . # release current override and use the normal value again
Some assignments are not locking. %input is one of those.
In addition to overriding system variables, if “regression” via
%regression = 1
is turned on, some variables return fixed values. Things like date and time have a constant value so as not to interfere with regression testing.
ChatScript supports structured triples of data called facts, which can be found by querying for them. The 3 fields of a fact are either text strings or fact references to other facts. So you might have a fact like
(I eat "meat-loving plants")
and you could query CS to find what eats meat-loving plants or what do I eat. Or even more generally what do I ingest (using relationship properties of words).
JSON data returned from website calls are all represented using facts so you can query them to find the bits of data you seek.
Like user variables, facts can be created as transient or permanent.
Permanent facts are saved across user interactions, transient ones disappear automatically. When you want to point a user variable at a fact, the index of the fact is stored as a text number on the variable.
Some of the text in rule output code is intended for the user. There is pending output and committed output.
Pending output consists of whatever isolated words that are not part of executing code exist in the code. They accumulate in a pending output stream, and when the rule finishes successfully, the output is committed. If the rule fails, the pending output is canceled.
You can also make function calls that directly commit output regardless of whether the rule subsequently fails.
When CS receives user input, it tokenizes it into sentences and analyzes each sentence in turn. It “marks” each word of the sentence with what concepts it belongs to.
Concepts always begin with ~
.
Usually concepts are explicit enumerations of words, like
~animals
is a list of all known animals or
~ingest
is a list of all verbs that imply ingestion.
Sometimes concepts are implicit collections handled directly by the
engine, like ~number
is the implied set of all numbers (we
wouldn’t want to actually enumerate them all) or ~noun
is
the set of all nouns or ~mainsubject
is the current subject
of the sentence.
After this marking analysis, patterns can efficiently find whether or not some particular concept is matched at a particular position in the sentence.
CS actually analyzes three streams of input, the raw input of the user, the original input (spellfixed) of the user and a canonical form of it. So the system marks an input sentence of my cat eats mice and also marks the parallel sentence I cat eat mouse, so patterns can be written to catch general meanings of words as well as specific ones.
Rule patterns can dictate memorizing part of the input that matches a
pattern element. The memorized data goes onto “match variables”, which
are numbered _0
, _1
, … in the order in which
the data is captured.
CS memorizes both the original input and the canonical form of it. The pattern can use match variables in comparisons and the output can also access the data captured from the input.
CS scripts execute everything as a call and return (no GOTO).
The return values are the current pending output stream and a code that indicates a control result. That result in part affects how additional rules in the calling topics or functions execute, in that you can make a rule return a failure or success code that propagates and affects the current function, or rule, or topic, or sentence, or input.
So a failure or success down deep can, if desired, end all further script execution by sending the right code back up the calling sequence.
When code returns the “noproblem” value, all callers will complete what they are doing, but if user output was created will likely not initiate any new rules.
Topics are not functions and do not take arguments. CS provides system functions and you can write user functions in ChatScript.
Function names always start with ^
, like
^match(argument1 argument2)
and no commas are used
to separate the arguments (since commas themselves might be
legal arguments).
These are classic functions in that they have arguments and a collection of code to execute. Their code can generate output and/or make calls to other functions, including invoking topics and rules. Functions are a convenient way to abstract and share code.
outputmacro: ^myfunction($_argument1 $_argument2)
$_argument1 += 1
Use of $_
variables in the function definition is a call
by value.
All $_
variables are purely local and cannot be seen
outside of the function (or topic) they are used in. This is the
preferred way to call, unless you need to write back to your caller.
ChatScript also has function argument variables, whose names always
start with ^
and have local (lexical) visibility but
implement call by reference. You can assign back to the caller and write
onto the variable he passed you.
For outputmacros:
outputmacro: ^myfunction(^argument1 ^argument2)
^argument1 += 1
However, unless you need call by reference (being able to assign to the variable and have it affect the caller) you should use call by value so that nothing outside your routine can impact it.
Patternmacros, however, do not normally ever write onto their
arguments, so it is not only safe to use function arguments
^argument1
, but necessary since patternmacros are not
really functions at all. They merely temporarily paste their code into
the pattern stream and so do not save and restore variable values or
have locals per se.
patternmacro: ^myfunction(^argument1 ^argument2)
You can mix call by reference and call by value arguments.
An alternate function format allows you to put the output code within {}, which is more nicely visualized by some editors.
outputmacro: ^myfunction(^argument1 ^argument2)
{
^argument1 += 1
}
Whenever you see a function variable, you can imagine it is as though the script had its argument immediately substituted in. This is a call by reference. So if the script call was this
^myfunction($myvar 1)
then the effect of ^argument1 += 1
is as though
$myvar += 1
were done and $myvar
would now be
one higher.
Of course, had you tried to do ^argument2 += 1
then that
would be the illegal 1 += 1
and the assignment would
fail.
The CS natural language workflow consists of taking the user’s input text, splitting it into tokens and stopping each time at a perceived sentence boundary. It continues with the input after processing that “sentence”. That leaves two tricky bits: what is a token and what is a sentence boundary. The `$cs_token~ variable gives you some control over how these work. The naive definition of a token is a sequence of letters terminating in a space or end of input. But there are exceptions to that like some kind of sentence punctuation (comma, period, colon, exclamation) is not part of a bigger token. The sentence punctuation notion has exceptions, like the period within a floating point number or as part of an abbrviation or webaddress. And hyphens with more letters on the other side are generally not punctuation either. And normally we consider bracketing things like parens not part of a word (except in emoticons). So CS will normally break things apart as it believes they should be done. If you need to actually allow a token to have embedded punctuation in it, you can list the token in the LIVEDATA/SUBSTITUTES/abbreviations.txt file and the tokenizer will respect it.
File or live user input ending in ^ will erase the ^ and join with the next read line.
There are many system functions to perform specific tasks. These are enumerated in the ChatScript System Functions Manual and the ChatScript Fact Manual.
ChatScript can neither see nor act, but it can interact with systems
that do. The convention is that out-of-band information occurs at the
start of input or output, and is encased in [ ]
.
ChatScript does not attempt to perform NLP (postag, parse, mark) any
input sentence which begins with [
and has a closing
]
. It will automatically not try to spellcheck that part or
perform any kind of merge (date, number, propername). In fact, the
[...]
will be split off into its own sentence. You can use
normal CS rules to detect and react to incoming oob messaging. E.g,
input like this
[ speed=10 rate: 50 ] User said this
could be processed by your script. Although the 2 data oob items are
inconsistently shown, the protocol you use is entirely up to you within
the []
area.
Here is a sample pattern to catch oob data.
u: ( < \[ * speed _*1 * \] ) The speed is _0
u: ( < \[ * rate _*1 * \] ) The rate is _0
You need *
in front of your data when you can have
multiple forms of data and you need * \]
after your data to
ensure you don’t match words from user input.
On output you need to do one of these
u: () \[ oob data \] Here is user message
u: () ^"[oob data] Here is user message
OOB output needs to be first, which means probably delaying to one of
the last things you do on the last sentence of the input, and using
^preprint()
. E.g.
u: ( $$outputgesture ) ^preprint( \[ $$outputgesture \] )
You can hand author gestures directly on your outputs, but then you have to be certain you only output one sentence at a time from your chatbot (lest a gesture command get sandwiched between two output sentence). You also have to be willing to hand author the use of each gesture.
I prefer to write patterns for common things (like shake head no or nod yes) and have the system automatically generate gestures during postprocessing on its own output.
The stand-alone engine and the WEBINTERFACE/BETTER scripts automatically handle the following oob outputs:
| OOB Output | description |
|---|---|
| Callback | The webpage or stand-alone engine will wait for the designated
milliseconds and if the user has not begun typing will send in the oob
message [callback] to CS. If user begins typing before the timeout, the
callback is cancelled. e.g. [callback=3000] will wait 3
seconds. |
| Loopback | The webpage or stand-alone engine will wait for the designated
milliseconds after every output from CS and if the user has not begun
typing will send in the oob message [loopback] to CS. If user begins
typing before the timeout, the loopback is cancelled for this output
only, and will resume counting on the next output.
e.g. [loopback=3000] will wait 3 seconds after every
output. |
| Alarm | The webpage or stand-alone engine will wait for the designated
milliseconds and then send in the oob message [alarm] to CS. Input
typing has no effect. e.g. [alarm=3000] will wait 3 seconds
and then send in the alarm. CS can cancel any of these by sending an oob
message with a milliseconds of 0.
e.g. [loopback=0 callback=0 alarm=0] cancels any pending
callbacks into the future. |
^CSSHUTDOWN()
outputmacro: ^CSSHUTDOWN()
This function, if defined by you, will be executed on shutdown or restart of the ChatScript system.
^cs_topic_enter()
outputmacro: ^cs_topic_enter(^topic ^mode)
When the system begins a topic and this function is defined by you,
it will be invoked before the topic is processed. You will be given the
name of the topic and a character representing the way it is being
invoked. Values of ^mode
are: s
,
?
, u
, t
, which represent
statements, questions, both, or gambits. While your function is
executing, neither ^cs_topic_enter
or
^cs_topic_exit
will be invoked.
^cs_topic_exit()
outputmacro: ^cs_topic_exit(^topic ^result)
When the system exits a topic and this function is defined by you, it will be invoked after the topic is processed. You will be given the name of the topic and the text value representing what it returned. E.g., NOPROBLEM. The range of names of these are defined in mainsystem.h (minus _BIT) but are your basic FAILTOPIC, etc.
When a user is initialized for the first time, the system will
attempt to read a top-level file named for the user as
bruce-init.txt
(if user is bruce). If found, commands will
be executed from there (analogous to the :source
command.
This will be read after any source=
command line
parameter.
Windows Defender, Norton, and the like have a real-time monitoring system on files. You can disable the ChatScript folder from being analyzed. On a Mac w/o this stuff, a compile of a bot might take 14 seconds, wherease with AV software interferring on Windows it takes 4 minutes. CS writes to its TOPIC folder and LOGS directories in lots of little pieces, that AV wants to monitor.
Build normally echos out its log messages of what it is currently compiling And and any warning or error messages. If you say quiet, then it will only tell you it succcessfully completed or list the errors it detected. One can set this in a cs init file as buildflags=quiet .
will suppress all warnings about words spelled in various cases, but leave all other warnings intact. nomixedcase can be specified on the local build command as well. One can set this in a cs init file as buildflags=nomixedcase .
Build will warn you of a number of situations which, while not illegal, might be mistakes. It has several messages about words it doesn’t recognize being used as keywords in patterns and concepts. You can suppress those messages by augmenting the dictionary OR just telling the system not to tell you
:build 0 nospell
There is no problem with these words, presuming that you did in fact mean them and they do not represent a typo on your part.
You can get extra spellchecking, on your output words, with this:
:build 0 outputspell
run spellchecking on text output of rules (see if typos exist).
Build will also warn you about repeated keywords in a topic or concept. This means the same word is occurring under multiple forms. Again, the system will survive but it likely represents a waste of keywords. For example, if you write this:
topic: ~mytopic ( cheese !cheese)
you contradict yourself.  The system will not use this keyword. Or if you write this
topic: ~mytopic (cheese cheese~1)
You are saying the word cheese or the wordnet path of cheese meaning #1, which includes the word cheese. You don’t need “cheese”. Or consider:
topic: ~mytopic (cheese cheese~n)
Since you have accepted all forms of cheese, you don’t need to name
cheese~n
. :build
also warns you about various
substitutions that might affect your patterns. You can suppress those
messages with :build filename nosubstitution
When you name a file or directory, :build will ignore files that do not end in .top or .tbl . When you name a directory, it walks all the files in that directory, but does not recurse into subdirectories unless you explicitly ask it to by adding a second slash after the directory name. If the contents of your filesxxx build file had this:
topic.top
subdirectory1/
subdirectory2//
then it would compile topic.top, all files within subdirectory1 non-recursively, and all files recursively in subdirectory2.
Sometimes you might fail to place a paren properly, swallow a whole lot of input and crash. Finding where the problem is may be hard. You can therefore turn on a trace which will show you all the rules it successfully completes.
:build harry trace
Normally, a build will leave your current user identity alone. All state remains unchanged, except that topics you have changed will be reset for the bot (as though it has not yet ever seen those topics). But if you want to start over with the new system as a new user, you can request this on the build command.
:build 0 reset
reinit the current user from scratch (equivalent to
:reset user
).
The build system has two layers, 0 and 1. When you say :build 0, the
system looks in the top level directory for a file
files0.txt
. Similarly when you say :build 1
it
looks for files1.txt
. Whatever files are listed inside a
filesxxx.txt
are what gets built.
And the last character of the file name (e.g., files0
)
is what is critical for deciding what level to build on. If the name
ends in 0, it builds level 0. If it doesn’t, it builds level 1.
You can imagine:
:build common0
- shared data-source (level 0):build george
- george bot-specific (level 1):build henry
- henry bot-specific (level 1):build all
- does george and henry and others (level
1):build system0
- does ALL files, there is no level
1.You can build layers in either order, and omit either.
Note
Avoid something likes files2.txt
and doing a
:build 2
. 2 specifies a level and normal bots are at level
1 (which requires no numbering). Name your file after your bot and it
will default to level 1.
If you put in :quit
as an item (like at the start of the
file), then the rest of the file is skipped.
Normally #
becomes a comment to end of line. But you can
use a block comment as follows:
##<< first junk
some junk
##>> more junk
Because any comment marker kills the rest of the line, the “first junk” will not be seen, nor will the “more junk”. But a comment block was established, so lines between them line “some junk” are also not seen.
A top level declaration in a script can rename a match variable
rename: _bettername _12
before any uses of _bettername
, which now mean
_12
. You can put multiple rename pairs in the same
declaration.
rename: _bettername _12 _okname _14
and you can provide multiple names, so you can later also say
rename: _xname _12
and both _xname and _bettername
refer to
_12
.
Renames can also rename concept sets:
rename: @myset @1
so you can do:
@myset += createfact( 1 2 3)
$$tmp = first(@mysetsubject)
You can also declare your own 32 or 64-bit integer constants. You must use ## when you define it and when you refer to it.
rename: ##first 1
$tmp = ##first
You can use :define
to add a documentation string to
many things. E.g.,
describe: $myvar "used to store data"
_10 "tracks pos tag"
:list
can display documentation on documented items as
well as showing undocumented permanent variables (handy for finalizing a
bot to show you have no spelling errors on variables).
You can have the system include or exclude lines on a line by line basis. To make a line conditional, put a comment left justified where a word is contiguous to the #, like this:
#german u: (test) this is conditionally compiled
This line is normally ignored because it is a comment line and not a
named numeric constant. But if you put the #german
as a
tail parameter of the :build
command, you enable it:
You can also handle blocks of code analogous to the block comment convention by appending a label to the <<## :
<<##german ...
... >>##
:build Harry #german
You may name up to 9 conditions on your build line. In fact, for
language-related conditional lines, you don’t have to declare anything
on the :build
command. The system will automatically accept
lines that name the current language= command line parameter (English
being the default).
Conditional compilation applies to script files and the filesxxx.txt files and LIVEDATA files.
You’ve been building and chatting and something isn’t right but it’s all confusing. Maybe you need a fresh build. Here is how to get a clean start.
Quit chatscript.
Empty the contents of your USER folder, but don’t erase the folder. This gets rid of old history in case you are having issues around things you’ve said before or used from the chatbot before.
Empty the contents of your TOPIC folder, but don’t erase the folder. This gets rid of any funny state of topic builds.
:build 0
- rebuild the common layer
:build xxx
- whatever file you use for your personality
layer
Probably all is good now. If not quit chatscript. Start up and try it now.
Non-topic files include the contents of DICT
and
LIVEDATA
.
You may choose to edit the dictionary files. There are 3 kinds of files.
The facts0.txt
file contains hierarchy relationships in
wordnet. You are unlikely to edit these.
The dict.bin
file is a compressed dictionary which is
faster to read. If you edit the actual dictionary word files, then erase
this file. It will regenerate anew when you run the system again,
revised per your changes. The actual dictionary files themselves… you
might add a word or alter the type data of a word. The type information
is all in dictionarySystem.h
These files are dynamically read per language.
The SUBSTITUTES folder files consist of pairs of data per line. The
first is what to match. Individual words are separated by underscores,
and you can request sentence boundaries <
and
>
.
The output can be missing (delete the found phrase) or words
separated by plus signs (substitute these words) or a %word
which names a system flag to be set (and the input deleted). The output
can also be prefixed with ![…]
where inside the brackets
are a list of words separated by spaces that must not follow this
immediately. If one does, the match fails. You can also use
>
as a word, to mean that this is NOT at the end of the
sentence. The files include:
| file | description |
|---|---|
interjections.txt |
remaps to ~ words standing for interjections or
discourse acts |
contractions.txt |
remaps contractions to full formatting |
substitutes.txt |
(omittable) remaps idioms to other phrases or deletes them. |
british.txt |
(omittable) converts british spelling to us |
spellfix.txt |
(omittable) converts a bunch of common misspellings to correct |
texting.txt |
(omittable) converts common texting into normal english. |
systemessentials.txt |
things needed to handle end punctuation |
expandabbreviations.txt |
does what its name suggests |
queries.txt |
defines queries available to ^query . A query is itself
a script. See the file for more information. |
canonical.txt |
is a list of words and override canonical values. When the word on the left is seen in raw input, the word on the right will be used as its canonical form. |
lowercasetitles.txt |
is a list of lower-case words that can be accepted in a title. Normally lower case words would break up a title. |
Processing done by various of these files can be suppressed by
setting $cs_token
differently. See Control over Input.
plurals.txt
| is a list of word
pairs, singular and plural formcanonicals.txt
| is a list of word pairs, original and
canonical form, that override what CS might have decided.currencies.txt
| map currency words to currency concepts it
definesmonths.txt
| lines of month names and abbreviationsnumbers.txt
| lines of words that have numeric value (see
below)systemfacts.txt
| lines of system concepts, declaring them
as conceptsNumbers.txt entries will list the word, give its value, and define how to interpret its type. REAL_NUMBER is a word that directly represents a number, like two. WORD_NUMBER is a word that implies a number value, like dozen. FRACTION_NUMBER is a word that implies a faction value like half.
^refine
To be efficient in rule processing, I often catch a lot of things in a rule and then refine it.
u: ( ~country ) ^refine() # gets any reference to a country
a: (Turkey) I like Turkey
a: (Sweden) I like Sweden
a: (*) I've never been there.
Equivalently one could invoke a subtopic, though that makes it less obvious what is happening, unless you plan to share that subtopic among multiple responders.
u: ( ~country ) ^respond(~subcountry)
topic: ~subcountry system[]
u: (Turkey) ...
u: (Sweden) ...
u: (*) ...
The subtopic approach makes sense in the context of writing quibbling code. The outside topic would fork based on major quibble choices, leaving the subtopic to have potentially hundreds of specific quibbles.
?: (<what) ^respond(~quibblewhat)
?: (<when) ^respond(~quibblewhen)
?: (<who) ^respond(~quibblewho)
# ...
topic: ~quibblewho system []
?: ( <who knows ) The shadow knows
?: ( <who can ) I certainly can't.
^reuse
To have a conversation, you want to volunteer information with a
gambit line. And that same information may need to be given in response
to a direct question by the user. ^reuse
let’s you share
information.
t: HOUSE () I live in a small house
u: ( where * you * live ) ^reuse(HOUSE)
The rule on disabling a rule after use is that the rule that actually generates the output gets disabled. So the default behavior (if you don’t set keep on the topic or the rule) is that if the question is asked first, it reuses HOUSE.
Since we have given the answer, we don’t want to repetitiously volunteer it, HOUSE gets disabled. But, if the user repetitiously asks the question (maybe he forgot the answer), we will answer it again because the responder didn’t get disabled, just the gambit. And disabling applies to allowing a rule to try to match, not to what it does for output. So one can reuse that gambit’s output any number of times.
If you don’t want that behavior you can either add a disable on the
responder OR tell ^reuse
to skip used rules by giving it a
second argument (anything). So one way is:
t: HOUSE () I live in a small house
u: SELF (where * you * live) ^disable(RULE SELF) ^reuse(HOUSE)
and the other way is:
t: HOUSE () I live in a small house
u: ( where * you * live ) ^reuse(HOUSE skip)
Meanwhile, in the original example, if the gambit executes first, it disables itself, but the responder can still answer the question by saying it again.
Now, suppose you want to notice that you already told the user about the house so if he asks again you can say something like: You forgot? I live in a small house. How can you do that. One way to do that is to set a user variable from HOUSE and test it from the responder.
t: HOUSE () I live in a small house $house = 1
u: ( where * you * live ) [$house You forgot?] ^reuse(HOUSE)
If you wanted to do that a lot, you might make an outputmacro of it:
outputmacro: ^heforgot(^test) [^test You forgot?]
t: HOUSE () I live in a small house $house = 1
u: ( where * you * live ) heforgot($house ) ^reuse(HOUSE)
Or you could do it on the gambit itself in one neat package.
outputmacro: ^heforgot(^test) [^test You forgot?] ^test = 1
t: HOUSE () heforgot($house ) I live in a small house.
u: ( where * you * live ) ^reuse(HOUSE)
Normally when you log in in stand-alone mode, this initiates a new conversation and the chatbot speaks first. If you prefix your login name with *, you get to speak first and this continues any prior conversation you may have had.
You can control the label put before the bot’s output and the user’s input prompt by setting variables $botprompt and $userprompt. I set them in the bot’s initialization code, though you can dynamically change them. The values can be literal or a format string. The value is used as the prompt. Hence the following example:
$userprompt = ^"$login: >"
$botprompt = ^ "HARRY: "
The user prompt wants to use the user’s login name so it is a format string, which is processed and stored on the user prompt variable. The botprompt wants to force a space at the end, so it also uses a format string to store on the bot prompt variable.
In color.tbl is there a reason that the color grey includes both building and ~building?
Yes. Rules often want to distinguish members of sets that have supplemental data from ones that don’t. The set of ~musician has extra table data, like what they did and doesn’t include the word musician itself. Therefore a rule can match on ~musician and know it has supplemental data available.
This is made clearer when the set is named something list
~xxxlist
. But the system evolved and is not consistent.
How are double-quoted strings handled?
First, note that you are not allowed strings that end in punctuation followed by a space. This string “I love you.” is illegal. There is no function adding that space serves.
String handling depends on the context. In input/pattern context, it means translate the string into an appropriately tokenized entity. Such context happens when a user types in such a string:
I liked “War and Peace”
It also happens as keywords in concepts:
concept: ~test[ "kick over"]
and in tables:
DATA:
"Paris, France"
and in patterns:
u: ( "do you know" what )
In output context, it means print out this string with its double quotes literally. E.g.
u: ( hello ) "What say you? " # prints out "What say you? "
There are also the functional interpretations of strings; these are
strings with ^
in front of them.
They don’t make any sense on input or patterns or from a user, but
they are handy in a table. They mean compile the string (format it
suitable for output execution) and you can use the results of it in an
^eval
or match
call.
On the output side, a ^“string” means to interpret the contents inside the string as a format string, substituting any named variables with their content, preserving all internal spacing and punctuation, and stripping off the double quotes.
u: ( test ) ^"This $var is good." # if $var is kid the result is This kid is good.
What really happens on the output side of a rule?
Well, really, the system “evaluates” every token. Simple English words and punctuation always evaluate to themselves, and the results go into the output stream. Similarly, the value of a text string like this is text is itself, and so this is text shows up in the output stream. And the value of a concept set or topic name is itself.
System function calls have specific unique evaluations which affect
the data of the system and/or add content into the output stream.
User-defined macros are just scripts that reside external to the script
being evaluated, so they are evaluated. Script constructs like
IF
, LOOP
, assignment, and relational
comparison affect the flow of control of the script but don’t themselves
put anything into the output stream when evaluated.
Whenever a variable is evaluated, its contents are evaluated and their result is put into the output stream. Variables include user variables, function argument variables, system variables, match variables, and factset variables.
For system variables, their values are always simple text, so that goes into the output stream. And match variables will usually have simple text, so they go into the output stream. But you can assign into match variables yourself, so really they can hold anything. So what results from this:
u: (x)
$var2 = apples
$var1= join($ var2)
I like $var1
$var2
is set to apples. It stores the name (not the
content) of $var2
on $var1
and then I like is
printed out and then the content of $var1
is then
evaluated, so $var2
gets evaluated, and the system prints
out apples.
This evaluation during output is in contrast to the behavior on the pattern side where the goal is presence, absence, and failure. Naming a word means finding it in the sentence.
Naming a concept/topic means finding a word which inherits from that concept either directly or indirectly. Naming a variable means seeing if that variable has a non-null value.
Calling a function discards any output stream generated and aside from other side effects means did the function fail (return a fail code) or not.
How does the system tell a function call w/o ^ from English?
If like is defined as an output macro and if you write:
t: I like (somewhat) ice
how does the system resolve this ambiguity? Here, white space actually matters. First, if the function is a builtin system function, it always uses that. So you can’t write this:
t: I fail (sort of) at most things
When it is a user function, it looks to see if the ( of the argument list is contiguous to the function name or spaced apart. Contiguous is treated as a function call and apart is treated as English. This is not done for built-ins because it’s more likely you spaced it accidently than that you intended it to be English.
How should I go about creating a responder?
First you have to decide the topic it is in and ensure the topic has appropriate keywords if needed.
Second, you need to create a sample sentence the rule is intended to
match. You should make a #!
comment of it. Then, the best
thing is to type :prepare
followed by your sentence. This
will tell you how the system will tokenize it and what concepts it will
trigger. This will help you decide what the structure of the pattern
should be and how general you can make important keywords.
What really happens with rule erasure?
The system’s default behavior is to erase rules that put output into
the output stream, so they won’t repeat themselves later. You can
explicitly make a rule erase with ^disable()
and not erase
with ^keep()
and you can make the topic not allow
responders to erase with keep as a topic flag.
So, if a rule generates output, it will try to erase itself. If a
rule uses ^reuse()
, then the rule that actually generated
the output will be the called rule. If for some reason it cannot erase
itself, then the erasure will rebound to the caller, who will try to
erase himself.
Similarly, if a rule uses ^refine()
, the actual output
will come from a rejoinder()
. These can never erase
themselves directly, so the erasure will again rebound to the
caller.
Note that a topic declared system NEVER erases its rules, neither gambits nor responders, even if you put ^disable(RULE ~) on a rule.
u: (~emogoodbye)
How can I get the original input when I have a pattern
like u: (~emogoodbye)
?
To get the original input, you need to do the following:
u: ( _~emogoodbye )
$_tmp = ^original(_0)
$cs_token = 0
^retry(SENTENCE)
and at the beginning of your main program you need a rule like this:
u: ( $tmptoken _* )
$cs_token = $tmptoken
$tmptoken = null
… now that you have the original sentence, you decide what to do … maybe you had set a flag to know what you wanted to do
If you just want the original of a match, you can use ^original(_0).
There is no GOTO in chatscript. There are only calls. Calls always return. They return with noproblem or end or fail.
Respond/Gambit calls enter a new topic. Any end/fail TOPIC will terminate them and return to the caller.
end(TOPIC)
has no consequence to the caller.
fail(TOPIC)
degrades to a fail-rule and terminates the
calling rule unless the call was wrapped in NOFAIL().
Nofail(TOPIC)
and Nofail(RULE)
are
equivalent (because you can’t get back a failed topic flag). A call to
reuse does not enter a new topic context, so if the reuse calls
end(topic)
, that returns to the calling rule, which has
received an end(topic). If not wrapped in a nofail(TOPIC)
,
then the calling rule terminates with end topic.
Meanwhile, generic output done before gambit/reuse/retry/respond will be forced to output so that if any of those fail, the output is still emitted. Otherwise, normally output generic waits until end of rule to be put out completely or cancelled completely if a fail happens.
Fail does not cancel output from a print or output already emitted. Each rule knows what output count exists at its start, and so when it ends it can tell if it generated output (suppressing further rules of the topic). fail(rule), when the rule has already generated output, does not stop further rules of the topic from being run. It thus allows more output than normal.
Normally you match words in a sentence. But the system sometimes merges multiple words into one, either as a proper name, or because some words are like that. For example “here and there” is a single word adverb. If you try to match We go here and there about town with
u: (* here *) xxx
you will succeed. The actual tokens are “we” “go” “here and there” “about” “town”. but the pattern matcher is allowed to peek some into composite words.
When it does match, since the actual token is “here and there”, the position start is set to that word (e.g., position 3), and in order to allow to match other words later in the composite, the position end is set to the word before (e.g., position 2). This means if your pattern is
u: (* here and there *) xxx
it will match, by matching the same composite word 3 times in a row. The anomaly comes when you try to memorize matches. If your pattern is
u: (_* and _* ) xxx
then _0
is bound to words 1 & 2 “we go”, and matches
“here and there”, and _1
matches the rest, “about
town”.
That is, the system will NOT position the position end before the
composite word. If it did, _1
would be here and there
about town. It’s not.
Also, if you try to memorize the match itself, you will get nothing because the system cannot represent a partial word. Hence
u: ( * _and * ) xxx
would memorize the empty word for _0
. If you don’t want
something within a word to match your word, you can always quote it.
u: ( X * ‘and * ) xxx
does not match here and there about town.
The more interesting case comes when a composite is a member of a set. Suppose:
concept: ~myjunk (and)
u: ( * _~myjunk * ) xxx
What happens here? First, a match happens, because
~myjunk
can match and inside the composite. Second
memorization cannot do that, so you memorize the empty word. If you want
to not match at all, you can write:
u: ( * _'~myjunk * ) xxx
In this case, the result is not allowed to match a partial word, and fails to match. However, given ” My brothers are rare.” and these:
concept: ~myfamily (brother)
u: ( * _'~ myfamily * ) xxx
the system will match and store _0 = brothers
. Quoting a
set merely means no partial matches are allowed. The system is still
free to canonicalize the word, so brothers and brother both match. If
you wanted to ONLY match brother, you could have quoted it in the
concept definition.
concept: ~myfamily (‘brother)
There may be a topic you don’t want code like ^gambit()
to launch on its own, for example, a story. You can block a topic from
accidental gambit access by starting it with
t: (!~) ^fail(topic)
If you are not already in this topic, it cannot start. Of course you need a way to start it. There are two. First, you can make a responder react (enabling the topic). E.g.,
u: ( talk about bees ) ^gambit(~)
If the topic were bees and locked from accidental start, when this responder matches, you are immediately within the topic, so the gambit request does not get blocked.
The other way to activate a topic is simply
^AddTopic(~bees)
. A topic being the current one on the
pending topics list is the definition of ~
. A matching
responder adds the topic to that list but you can do it manually from
outside and then just say ^gambit(~bees)
.
In addition to reasoning about user input, the system can reason about its own output. This is called reflection, being able to see into one’s own workings.
Because the control script that runs a bot is just script and invokes
various engine functions, it is easy to store notes about what happened.
If you called ^rejoinder
and it generated output
(%response
changed value) you know the bot made a reply
from a rejoinder. Etc.
To manage things like automatic pronoun resolution, etc, you also
want the chatbot to be able to read and process its own output with
whatever scripts you want. The set of sentences the chatbot utters for a
volley are automatically created as transient facts stored under the
verb “chatoutput”. The subject is a sentence uttered by the chatbot. The
object is a fact triple of whatever value was stored as
%why
(default is .
), the name of the topic,
and the offset of the rule within the topic.
You can prepare such a sentence just as the system does an ordinary
line of input by calling ^analyze(value)
. This tokenizes
the content, performs the usual parse and mark of concepts and gets you
all ready to begin pattern matching using some topic. Generally I do
this during the post-process phase, when we are done with all user
input. Therefore,
t: ^query(direct_v ? chatoutput ? -1 ? @9 ) # get the sentences
loop()
{
$$priorutter = ^last(@9subject)
^analyze($$priorutter) # prepare analysis of what chatbot said -
respond(~SelfReflect)
}
Reflective information is available during main processing as well.
You can set %why
to be a value and that value will be
associated with any output generated thereafter. E.g.,
%why = quibble
. The system also sets
$cs_tokencontrol
to results that happen from input
processing.
ChatScript gets updated often on a regular basis. And you probably don’t want to have to reintegrate your files and its every time. So here is what you can do.
Create a folder for your stuff: e.g. MYSTUFF. Within it put your
folder that you normally keep in RAWDATA and your
filesxxx.txt
files normally at the top level of ChatScript.
And if you have your own hacked version of files from LIVEDATA, put your
folder there also.
Then create a folder within yours called ChatScript and put the current ChatScript contents within that. You can also create a batch file, probably within your folder, that does a “cd ChatScript” to be in the right directory, and then runs ChatScript with the following parameters:
ChatScript livedata=../LIVEDATA english=LIVEDATA/ENGLISH system=LIVEDATA/SYSTEM
Normally while you might override various substitutes files, you
would not override the ENGLISH
and SYSTEM
folders.
So now, when you want to update to the latest version of ChatScript, merely unpack the zip into your ChatScript folder, overwriting files already there.
There is the GLOBAL dictionary in DICT and local dictionary per level in TOPIC. You can augment your dictionary locally by defining concepts with properties:
concept: ~morenouns NOUN NOUN_PROPER_SINGULAR (Potsdam Paris)
concept: ~verbaugment VERB VERB_INFINITIVE (swalk smeazle)
One can also directly edit the dictionary txt files in DICT/ENGLISH observing how they seem to be formatted, doing nothing crazy, and being careful with consistency of meaning values (if needed) and then just delete dict.bin. If you want to edit the wordnet ontology hierarchy, you need to edit facts.txt and delete facts.bin The system will rebuild them when you run CS.


Classes in Object Oriented Programming
Before Object Oriented Programming there was Procedural Programming. The fundamental underlying concept of Object Oriented Programing that differentiates it from the older style of programming is the use objects which allow for re-usability of code. Object Oriented Programming (OOP), utilizes data structures known as "objects" which incorporate procedures known as "methods".
TO fully understand the fundamentals of OOP there are 3 basics that need to be covered.- Objects
- Everything in OOP can be represented as an object. Each object is characterized by 2 traits, that state it is currently in, and actions available to the object. Objects in programming are often used to represent real-world objects.
- Classes
- Classes can be described as the blueprint from which objects are created. The classs represents the object as a whole.
- Inheritance
- Inheritance offers a concise way to organize and structure your software. Although Classes offer the blueprint for your objects, objects can still differ. For example, the objects of class Bike will have similar qualities and functions however, Inheritance can allow for differences in the Bike suhc as mountain bikes or tandem bikes.
Now lets look at a real-world example of a bike: Class Bike(wheels, speed) def initialize @wheels = wheels @speed = speed end def speeding end def driving end def braking end end In this example we are going to build a bike from the class Bike blueprint. We take the users input for number of wheels and the speed of the bike and initalize them as instance variables to be used throughout the program. we then create different methods for the functions of our bike such as accelerating, steering, and braking.


The Voyages of Doctor Dolittle
by Hugh Lofting
Part 6, Chapter 1: New Popsipetel
Additional Information
- Year Published: 1922
- Language: English
- Country of Origin: England
- Source: Lofting, H. (1922). The Voyages of Doctor Dolittle. London, England: Lippincott Publishing.
-
Readability:
- Flesch–Kincaid Level: 4.2
- Word Count: 1,427
- Genre: Fantasy
- Keywords: 20th century literature, british literature, children's literature
- ✎ Cite This
Downloads
Jong Thinkalot had not ruled over his new kingdom for more than a couple of days before my notions about kings and the kind of lives they led changed very considerably.  I now saw that a king can be the hardest-working man in the world—if he attends properly to his business.
From the moment that he got up, early in the morning, till the time he went to bed, late at night—seven days in the week—John Dolittle was busy, busy, busy. First of all there was the new town to be built. The village of Popsipetel had disappeared: the City of New Popsipetel must be made. With great care a place was chosen for it—and a very beautiful position it was, at the mouth of a large river. The shores of the island at this point formed a lovely wide bay where canoes—and ships too, if they should ever come—could lie peacefully at anchor without danger from storms.
In building this town the Doctor gave the Indians a lot of new ideas. He showed them what town-sewers were, and how garbage should be collected each day and burnt. High up in the hills he made a large lake by damming a stream. This was the water-supply for the town. None of these things had the Indians ever seen; and many of the sicknesses which they had suffered from before were now entirely prevented by proper drainage and pure drinking-water.
Peoples who don't use fire do not of course have metals either; because without fire it is almost impossible to shape iron and steel. One of the first things that John Dolittle did was to search the mountains till he found iron and copper mines. Then he set to work to teach the Indians how these metals could be melted and made into knives and plows and water-pipes and all manner of things.
In his kingdom the Doctor tried his hardest to do away with most of the old-fashioned pomp and grandeur of a royal court. As he said to Bumpo and me, if he must be a king he meant to be a thoroughly democratic one, that is a king who is chummy and friendly with his subjects and doesn't put on airs. And when he drew up the plans for the City of New Popsipetel he had no palace shown of any kind. A little cottage in a back street was all that he had provided for himself.
But this the Indians would not permit on any account. They had been used to having their kings rule in a truly grand and kingly manner; and they insisted that he have built for himself the most magnificent palace ever seen. In all else they let him have his own way absolutely; but they wouldn't allow him to wriggle out of any of the ceremony or show that goes with being a king. A thousand servants he had to keep in his palace, night and day, to wait on him. The Royal Canoe had to be kept up—a gorgeous, polished mahogany boat, seventy feet long, inlaid with mother-o'-pearl and paddled by the hundred strongest men in the island. The palace-gardens covered a square mile and employed a hundred and sixty gardeners.
Even in his dress the poor man was compelled always to be grand and elegant and uncomfortable. The beloved and battered high hat was put away in a closet and only looked at secretly. State robes had to be worn on all occasions. And when the Doctor did once in a while manage to sneak off for a short, natural-history expedition he never dared to wear his old clothes, but had to chase his butterflies with a crown upon his head and a scarlet cloak flying behind him in the wind.
There was no end to the kinds of duties the Doctor had to perform and the questions he had to decide upon—everything, from settling disputes about lands and boundaries, to making peace between husband and wife who had been throwing shoes at one another. In the east wing of the Royal Palace was the Hall of Justice. And here King Jong sat every morning from nine to eleven passing judgment on all cases that were brought before him.
Then in the afternoon he taught school. The sort of things he taught were not always those you find in ordinary schools. Grown-ups as well as children came to learn. You see, these Indians were ignorant of many of the things that quite small white children know—though it is also true that they knew a lot that white grown-ups never dreamed of.
Bumpo and I helped with the teaching as far as we could—simple arithmetic, and easy things like that. But the classes in astronomy, farming science, the proper care of babies, with a host of other subjects, the Doctor had to teach himself. The Indians were tremendously keen about the schooling and they came in droves and crowds; so that even with the open-air classes (a school-house was impossible of course) the Doctor had to take them in relays and batches of five or six thousand at a time and used a big megaphone or trumpet to make himself heard.
The rest of his day was more than filled with road-making, building water-mills, attending the sick and a million other things.
In spite of his being so unwilling to become a king, John Dolittle made a very good one—once he got started. He may not have been as dignified as many kings in history who were always running off to war and getting themselves into romantic situations; but since I have grown up and seen something of foreign lands and governments I have often thought that Popsipetel under the reign of Jong Thinkalot was perhaps the best ruled state in the history of the world.
The Doctor's birthday came round after we had been on the island six months and a half. The people made a great public holiday of it and there was much feasting, dancing, fireworks, speech-making and jollification.
Towards the close of the day the chief men of the two tribes formed a procession and passed through the streets of the town, carrying a very gorgeously painted tablet of ebony wood, ten feet high. This was a picture-history, such as they preserved for each of the ancient kings of Popsipetel to record their deeds.
With great and solemn ceremony it was set up over the door of the new palace: and everybody then clustered round to look at it. It had six pictures on it commemorating the six great events in the life of King Jong and beneath were written the verses that explained them. They were composed by the Court Poet; and this is a translation:
I
(His Landing on The Island) Heaven-sent, In his dolphin-drawn canoe From worlds unknown He landed on our shores. The very palms Bowed down their heads In welcome to the coming King.
II
(His Meeting With The Beetle) By moonlight in the mountains He communed with beasts. The shy Jabizri brings him picture-words Of great distress.
III
(He liberates The Lost Families) Big was his heart with pity; Big were his hands with strength. See how he tears the mountain like a yam! See how the lost ones Dance forth to greet the day!
IV
(He Makes Fire) Our land was cold and dying. He waved his hand and lo! Lightning leapt from cloudless skies; The sun leant down; And Fire was born! Then while we crowded round The grateful glow, pushed he Our wayward, floating land Back to peaceful anchorage In sunny seas.
V
(He Leads The People To Victory in War) Once only Was his kindly countenance Darkened by a deadly frown. Woe to the wicked enemy That dares attack The tribe with Thinkalot for Chief!
VI
(He Is Crowned King) The birds of the air rejoiced; The Sea laughed and gambolled with her shores; All Red-skins wept for joy The day we crowned him King. He is the Builder, the Healer, the Teacher and the Prince; He is the greatest of them all. May he live a thousand thousand years, Happy in his heart, To bless our land with Peace.


Dancing priest wows crowd during high school pep rally
FORT LAUDERDALE, Florida -- A priest at a Catholic high school surprised the audience when he busted a move during their homecoming pep rally.
RELATED: 72-year-old great grandpa 'gets low' on dance floor at northwest Houston wedding
Father Ricardo Rivera had everyone on their feet when he joined the dancers and cheerleaders during their routine. From that point on, he did not miss a single beat.
Father Rivera, who is a theology teacher, surprised everyone except the dance coach.
RELATED: Bellaire High School teacher goes viral with dance videos
The viral video has already received more than 17,000 views on Twitter.


--- layout: post title: "Fiendish Fables MySpace badge" --- Add the Fiendish Fables badge to your website or MySpace page!


val type: String?
the type of the documents in the index; defaults to null. Since ES 6, there can only be one type. Types are deprecated in ES 7 and removed in ES 8.


Create node
Node text:
Size:
Color:
Create node
Calculate shortest path
→
Calculate
Nodes
Links
No linked nodes.
Saved graphs
Save current graph


Company Registry
Add
Logout
×
Add new company
Name
Address
City
Country
Email
Phone
Owners
{{comp.name}}
{{comp.address}}
{{comp.city}}
{{comp.country}}
{{comp.email}}
{{comp.phone}}
{{owner.name}}


Include Class Methods and Validation Using Module in RubyOnRails
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Here my_class_method is Class Method.we can define more class methods in module ClassMethods
Validations and call backs are called without prefix ‘self’. so for validations and call backs we have to explicitly set the class
1 2 3 4 5 6 |
|


Election (1999) 3 1/2 stars out of 4. Starring Reese Witherspoon, Matthew Broderick, Chris Klein and Jessica Campbell.
One of the pleasures of movie reviewing is watching a film that arrives unannounced and charms you with its humor and originality.
Such "sleepers" as "Fargo" and "The Full Monty" fit snugly into this category. And now you can add "Election," an askewed look at the polemics of high school politics.
Everyone of us knows a Tracy Flick. That's the student who always raises his or her hand first, always knowing right answer; the one who cheerfully organizes the car wash to raise the money to fund the prom, the one who is destined to be student body president and lead the school to glory.
We all know a Tracy Flick - and most of us hated her - or him. OK, maybe hate is too strong. Jealous, envious. We admired that student's ease and self-confidence around others while cursing our own tongue-tied inadequacies.

At George Washington Carver High School, Tracy Flick is the classic overachiever, a bright, perky go-getter whose ambition is to be student government president. And it looks like she will succeed, since she is running unopposed.
Jim McAllister is a much beloved, veteran civics teacher at Carver. He has been on the faculty for 12 years and has been recognized three times as "Teacher of the Year."
And he decides that Tracy must be stopped. He sees her treating high school as the first step in a lifelong career strategy that could take her to unimaginable heights.
He also knows Tracy's dark secret. She had an affair with his best friend, a teacher who lost his job after their romance became public.
So McAllister recruits Paul Metzger, a dim-witted, but nice, popular football hero sidelined by an injury to run against her.
Paul is totally unfit for the job, completely in the dark about student government, but McAllister convinces him that it's his civic duty to run.
The situation gets even wilder when Paul's younger sister, Tammy - seeking revenge on the girlfriend who dumped her and began dating her brother - enters the race on a platform of abolishing student government.
Soon life in and out of school begin spinning out of control for McAllister as his plans go awry.
"Election" is a satirical joy, due mainly to the performances of Reese Witherspoon as Tracy, Matthew Broderick as McAllister, Chris Klein as Paul and, especially, Jessica Campbell as Tammy.
Witherspoon's Tracy is bubbly and gushing to the point of nausea. Her Tracy is one of those students who treats others as if they were her serfs. She may be all smiles and dimples on the outside, but underneath she rages and burns with ambition and intolerance for those who do not live up to her standards.
Broderick's deadpan performance is one of low-key desperation, as his various plots to thwart Tracy continue to be upended.
Klein is sincere as the friendly doofus who, unlike Tracy, does not see the election as a life-and-death struggle.
Campbell's Tammy is sarcastic and brutally honest. Her best moment comes during the assembly where the candidates give their campaign speeches. She rallies the students by pointing out the hyprocisy of the system and the ineffectual role of student government, calling for its abolition.
What really sets "Election" apart is the voice-over narrations by the various principals, especially when - at times - what they are saying is in counterpoint to the action on the screen.
The script by Alexander Payne and Jim Taylor, based on a novel by Tom Perrotta, could be seen as an allegory of our democratic process, but I'd rather not be that pretentious.
I look at "Election" like that blind date that turned out to be the most fabulous night of your life. It's a sharp, funny and entertaining movie that will keep you laughing from the opening reel to the closing credits.
Bob Bloom is the film critic at the Journal and Courier in Lafayette, IN. He can be reached by e-mail at<EMAIL_ADDRESS>or at<EMAIL_ADDRESS>cb
Carol Bloom of Bloom Ink Publishing Professionals 3312 Indian Rock Lane West Lafayette, IN 47906-1203<PHONE_NUMBER> fax<PHONE_NUMBER><EMAIL_ADDRESS>Committed to Lifelong Learning through Effective Communication
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


SweetFreeStuff.com
///////////////////////////////////////////
Free Natralia Samples
Posted: 05 Nov 2013 11:45 AM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/qIOVfC7tuio/?utm_source=feedburner&utm_medium=email
The following Natralia samples are currently available: Natralia Eczema
Psoriasis Wash/Shampoo Natralia Eczema Psoriasis Cream Natralia Dry Skin
Lotion Natralia Heel Balm Click here to sign up for a free sample
The post Free Natralia Samples appeared first on SweetFreeStuff.com.
///////////////////////////////////////////
Free Colgate Toothbrush at Target
Posted: 05 Nov 2013 09:04 AM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/FZwrRQdpYD0/?utm_source=feedburner&utm_medium=email
Target has Colgate Extra Clean Toothbrushes for $.94. You can use this $1
off Colgate Oral Care Item coupon to get it for free!
The post Free Colgate Toothbrush at Target appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Delights Pork Skins or Cracklins at Thorntons
Posted: 05 Nov 2013 08:58 AM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/hWVsBuWjylQ/?utm_source=feedburner&utm_medium=email
Download the Thorntons mobile app to redeem a coupon good for a free
Delights Pork Skins or Cracklins. Good through 11/11. View Locations.
The post Free Delights Pork Skins or Cracklins at Thorntons appeared first
on SweetFreeStuff.com.
///////////////////////////////////////////
Free Subscription to Wine Spectator
Posted: 04 Nov 2013 11:10 PM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/9s7Si193cX0/?utm_source=feedburner&utm_medium=email
Get a free 1 year subscription to Wine Spectator Magazine.
The post Free Subscription to Wine Spectator appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Subscription to Cigar Afficianado
Posted: 04 Nov 2013 10:35 PM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/8Xu_nWVKYMk/?utm_source=feedburner&utm_medium=email
Free Subscription to Cigar Afficianado
The post Free Subscription to Cigar Afficianado appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Fall Samples
Posted: 04 Nov 2013 09:00 PM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/Eb4R6IrSN54/?utm_source=feedburner&utm_medium=email
Sign up and start receiving Free Samples for Fall today!
The post Free Fall Samples appeared first on SweetFreeStuff.com.
///////////////////////////////////////////
Free Align Probiotic Sample
Posted: 04 Nov 2013 03:56 PM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/RgClUbBsjo4/?utm_source=feedburner&utm_medium=email
The post Free Align Probiotic Sample appeared first on SweetFreeStuff.com.
///////////////////////////////////////////
Free Sample of Celestial Seasonings Holiday Tea
Posted: 04 Nov 2013 01:29 PM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/CthVqy2phLE/?utm_source=feedburner&utm_medium=email
*There is an issue with their page at the time of this post, but I am
assuming it will be fixed. Get a free sample of Celestial Seasoning Holiday
Tea.
The post Free Sample of Celestial Seasonings Holiday Tea appeared first on
SweetFreeStuff.com.


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
E
- the type of elements held in this collectionpublic interface TransferQueue<E>
A BlockingQueue
in which producers may wait for consumers
to receive elements. A TransferQueue
may be useful for
example in message passing applications in which producers
sometimes (using method transfer
) await receipt of
elements by consumers invoking take
or poll
,
while at other times enqueue elements (via method put
)
without waiting for receipt. Non-blocking and time-out versions of
tryTransfer
are also available. A TransferQueue may also
be queried via hasWaitingConsumer
whether there are any
threads waiting for items, which is a converse analogy to a
peek
operation.
Like any BlockingQueue
, a TransferQueue
may be
capacity bounded. If so, an attempted transfer
operation
may initially block waiting for available space, and/or
subsequently block waiting for reception by a consumer. Note that
in a queue with zero capacity, such as SynchronousQueue
,
put
and transfer
are effectively synonymous.
This interface is a member of the Java Collections Framework.
| Method Summary | |
|---|---|
int |
getWaitingConsumerCount()
Returns an estimate of the number of consumers waiting to dequeue elements via take or poll . |
boolean |
hasWaitingConsumer()
Returns true if there is at least one consumer waiting
to dequeue an element via take or poll . |
void |
transfer(E e)
Inserts the specified element into this queue, waiting if necessary for space to become available and the element to be dequeued by a consumer invoking take or poll . |
boolean |
tryTransfer(E e)
Transfers the specified element if there exists a consumer already waiting to receive it, otherwise returning false
without enqueuing the element. |
boolean |
tryTransfer(E e,
long timeout,
java.util.concurrent.TimeUnit unit)
Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available and the element to be dequeued by a consumer invoking take or poll . |
| Methods inherited from interface java.util.concurrent.BlockingQueue |
|---|
add, contains, drainTo, drainTo, offer, offer, poll, put, remainingCapacity, remove, take |
| Methods inherited from interface java.util.Queue |
|---|
element, peek, poll, remove |
| Methods inherited from interface java.util.Collection |
|---|
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray |
| Method Detail |
|---|
boolean tryTransfer(E e)
false
without enqueuing the element.
e
- the element to transfer
true
if the element was transferred, else
false
java.lang.ClassCastException
- if the class of the specified element
prevents it from being added to this queue
java.lang.NullPointerException
- if the specified element is null
java.lang.IllegalArgumentException
- if some property of the specified
element prevents it from being added to this queuevoid transfer(E e) throws java.lang.InterruptedException
take
or poll
.
e
- the element to transfer
java.lang.InterruptedException
- if interrupted while waiting,
in which case the element is not enqueued.
java.lang.ClassCastException
- if the class of the specified element
prevents it from being added to this queue
java.lang.NullPointerException
- if the specified element is null
java.lang.IllegalArgumentException
- if some property of the specified
element prevents it from being added to this queueboolean tryTransfer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
take
or poll
.
e
- the element to transfertimeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameter
true
if successful, or false
if
the specified waiting time elapses before completion,
in which case the element is not enqueued.
java.lang.InterruptedException
- if interrupted while waiting,
in which case the element is not enqueued.
java.lang.ClassCastException
- if the class of the specified element
prevents it from being added to this queue
java.lang.NullPointerException
- if the specified element is null
java.lang.IllegalArgumentException
- if some property of the specified
element prevents it from being added to this queueboolean hasWaitingConsumer()
true
if there is at least one consumer waiting
to dequeue an element via take
or poll
.
The return value represents a momentary state of affairs.
true
if there is at least one waiting consumerint getWaitingConsumerCount()
take
or poll
. The return
value is an approximation of a momentary state of affairs, that
may be inaccurate if consumers have completed or given up
waiting. The value may be useful for monitoring and heuristics,
but not for synchronization control. Implementations of this
method are likely to be noticeably slower than those for
hasWaitingConsumer()
.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


| File | Statements | Branches | Functions | Lines | |||||
|---|---|---|---|---|---|---|---|---|---|
| collections.ts | 100% | 15/15 | 100% | 0/0 | 100% | 4/4 | 100% | 15/15 | |
| document.ts | 92.31% | 36/39 | 85.71% | 12/14 | 85.71% | 12/14 | 91.67% | 33/36 | |
| document_key.ts | 95% | 19/20 | 100% | 2/2 | 87.5% | 7/8 | 94.74% | 18/19 | |
| document_set.ts | 91.18% | 62/68 | 81.25% | 13/16 | 90% | 18/20 | 90.63% | 58/64 | |
| field_value.ts | 99.09% | 327/330 | 96.03% | 145/151 | 98.82% | 84/85 | 99% | 297/300 | |
| mutation.ts | 95.15% | 196/206 | 73.97% | 54/73 | 91.49% | 43/47 | 94.71% | 179/189 | |
| mutation_batch.ts | 100% | 60/60 | 91.67% | 11/12 | 100% | 11/11 | 100% | 57/57 | |
| path.ts | 97.32% | 145/149 | 92.16% | 47/51 | 100% | 33/33 | 97.12% | 135/139 |


Moved code to src/ dir. see src/index.js and how it makes use of the other js files in that dir. Currently the only dependency is the tap (TestAnythingProtocol) test framework which is optional.
· Run on the commandline by `cd` into dir and then `npm install`
· Then make sure tests pass with `npm test` on commandline (later view test/*.js file to see example unit test)
· Finally run on the commandline by with `npm start`
output should be the same as what we saw in the browser


What is 'scope', and how does it work in JavaScript?
JavaScript has two scopes: global and local. A variable that is declared outside a function definition is a global variable, and its value is accessible and modifiable throughout your program. A variable that is declared inside a function definition is local.
This basically means that if you set a variable ie x = 0 inside a function (locally), x will only equal 0 in relation to that specific function. x can equal anything else outside of that function. If you set a variable ie x = 0 globally ie not inside any specific function x will equal 0 in relation to all functions in the js file.


---
layout: page
title: About
---
{% if page.url == "/" %}
About
Currently developing established skills and experience working towards a bachelors degree in Information Technology, majoring in Information Systems. More on LinkedIn and GitHub.


Toy Story
Toy Story 3
The creators of the beloved "Toy Story" films re-open the toy box and bring moviegoers back to the delightful world of Woody, Buzz and our favorite gang of toy characters in "Toy Story 3." Woody and Buzz had accepted that Andy would grow up someday, but what happens when that day arrives? In the third installment, Andy is preparing to depart for college, leaving his loyal toys troubled about their uncertain fate. Lee Unkrich (co-director of "Toy Story 2" and "Finding Nemo") directs this highly anticipated film, and Michael Arndt, the Academy Award®-winning screenwriter of "Little Miss Sunshine," brings his unique talents and comedic sensibilities to the proceedings. "Toy Story 3" is presented in Disney Digital 3D™.
|


According to the Gospel musician, all the allegations leveled against him about having an intimate relationship with Akuapem Poloo are false.
Bro Sammy explained that all these people peddling these lies are bent on tarnishing his image.
He further disclosed that Akuapem Poloo has never been to his house and they only met on set while shooting a movie.
The gospel musician added that Akuapem Poloo is just his friend and nothing else.
Bro Sammy added that Akuapem Poloo only shot an advertisement for him, explaining that nothing ever happened between them.
According to Bro Sammy he always gets saddened when he is accused of such immoral act because he had never cheated on his wife since he got married.
Watch the video below.
This comes after controversial Kumawood actress Xandy Kamel accused colleague actress and video vixen, Akuapem Poloo of having a sexual relationship with Bro Sammy on Tracey Boakye’s set.


Tablet of Vision:
This devil you fight is the one that tempted Sword Master Iron with eternal life and defeated him.


welcome
What it isn't about:
- .NET vs JVM vs C++ vs ...
- .NET is awesome!!!
- Logic optimizations/cache/db calls/etc
- GC
Agenda
Intro:
- What it's about and what isn't
- Domain field
About the Aho-Corasick algorithm
- The algorithm explained
- Implement the algorithm by ourselves
- The current implementation
Harness:
- Write micro-benchmarks
- Profile code
- Read IL & ASM code
Domain
All websites receive bot traffic.
Not all bots are bad:
- White bots (good) - search engines
- Grey bots (neutral) - crawlers
- Black bots (bad) - fraud
Clients don't want to pay for bot traffic
My User Agent:
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
Google Web search UA:
"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
We use it in DSP, AdServing, etc
- a string searching algorithm
- accepts a finite set of strings we want to find
- it matches all strings simultaneously
- backed by a trie
- additional "failure" collections between nodes
Efficiency vs performance
Lesson 0: First efficiency then performance
Used in grep
Demo: Review the current implementation
Harness
Microbenchmarks it's hard!
Pipeline:
A task → C#
C# + Compiler → IL
IL + BCL + 3rdParty → App
App + CLR → ASM
ASM + CPU → Result
Infrastructure:
OS: Windows, Linux, OS X
Compilers: CSC, Roslyn
CLR: CLR2, CLR4, CoreCLR, Mono
GC: MS, Boehm, Sgen
JIT: Legacy x86 & x64, RyuJIT
Compilation: JIT, NGen, MPGO, .NET Native
We aren't alone!!! BenchmarkDotNet for the rescue!
Demo:
- A sample benchmark
- Config
- Diagnosers
Task: create a benchmark
How does it work???
Review the sources:
- Templates
- MethodInvoker: Pilot, Idle, Warmup, Target, Clocks
- Generated project
- Results (+R plot)
Task:
x86 vs x64
RuyJIT vs LegacyJit
Profiling
Harness: Sandbox console app
Demo:dotTrace & co
Perfview
Demo: Perfview
- Time based sampling
- Memory profiling
- ETW events
Intel VTune Amplifier
- heavy metal of profilers
- $$$
- low overhead
- Languages: C, C++, C#, Fortran, Java, ASM and more.
Demo: Intel VTune Amplifier
Task: find the bottleneck
Task: optimize it
Lesson 1: Know APIs
Demo: use production data
Task: write a benchmark that uses real data
Lesson 2: Use production data
Disassemble
Task: review the IL code
ASM code
Ways to get the guts:
- Visual Studio
- WinDBG
- Intel VTune Amplifier
sxe ld:mscorlib
g
.loadby sos clr
sxe ld:clrjit
g
!dumpdomain
!dumpdomain 000000a930db1d10
!dumpmodule -mt 00007ffc5b172fc8
!dumpmt -md 00007ffc5b174028
!bpmd -md 00007ffc5b174010
!u eip
!dumpmd 000007fa66f83878
!dumpil 000007fa670a0270
!U 000007fa670a0270
Task: get the guts
Demo: Perfview & memory profiling
Demo: BenchmarkDotNet & MemoryDiagnoser
Task: Find the allocation & explain it using Perfview & ILSpy
Lesson 3: Know BCL collections and data structures
Demo: Time for a MR
Demo: Review the dictionary implementation
Lesson 4: Know data structures
BCL is too generic and isn't suitable for high performance
Demo: Intel VTune Amplifier
Basic hotspots -> Memory access
Memory reads
if (pointer.Results.Count > 0)
mov rax, qword ptr [rsp+0x28]
mov rax, qword ptr [rax+0x10]
cmp dword ptr [rax+0x18], 0x0
jle 0x7ffcbc4238a1
Lesson 5: Know overheads
Demo: Intel VTune Amplifier
General Exploration
how CPU works
Wikipedia knows everything
Fetch -> Decode -> Execute
Front-end & Back-end
CPU cache, branch prediction, speculative execution, and out-of-order execution
Intel i7-4770 (Haswell), 3.4 GHz
L1 Data cache = 32 KB
L1 Instruction cache = 32 KB
L2 cache = 256 KB
L3 cache = 8 MB
L1 Data Cache Latency = 4-5 cycles
L2 Cache Latency = 12 cycles
L3 Cache Latency = 36 cycles
RAM Latency = 36 cycles + 57 ns
Demo: Memory access & cache misses (PerfView?)
Lesson 6: Know advanced data structures
Demo: Advanced Hotspots
Lesson 7: Know hacks
var key = _entries[ind].Key;
mov rcx, qword ptr [rcx+0x20]
mov r8, rcx
mov r9d, dword ptr [r8+0x8]
cmp edx, r9d
jnb 0x7fff53830a3a
movsxd r10, edx
Lesson 9: All is Fair in Love and War
MORE???
Optimizations based on real production load
.NET vs JVM vs C++ vs ...
In 99% cases the bottleneck is a developer not a platform


Once upon a time there lived a young boy called Bobby. Bobby had some Bitcoins in a custodial wallet. The greedy Custodian kept Bobby’s private keys and controlled all the cryptos the boy earned so hard. One day, The Custodian was relentlessly hacked by frauds who stole Bobby’s Bitcoins. By the time Bobby realized that, the funds were long gone and lost in the dark deep forest of the Blockchain. Poor boy! Don’t be like Bobby and read this article to learn how to protect your funds from hacking and stealing 👻 Because in the crypto world, security is everything!
When choosing between an exchange account and a wallet, you must know the difference between custodial and non-custodial wallets , since the custodial one is pretty much the same as having an exchange account. It means that you don’t fully control your funds and may lose them in case the wallet (or exchange account) is hacked.
Light non-custodial wallets, like Atomic Wallet, deserve your attention as an easy and secure method to protect your funds from fraud. Such wallets represent an application that encrypts the private key in your computer and/or smartphone. Once initiated, your transaction is automatically signed with that key.
You can also use the cold wallet to protect your crypto from frauds. Cold wallets represent an offline storage of your private keys. To make a transaction, you must connect the device to your computer and sign a transaction with that keys. It is a secure and time-proven tool to keep all your cryptos safe, like a mammoth in the ice❄
Both wallets use a mnemonic seed phrase to generate private keys. Never ever tell it anyone! Losing the seed phrase has quite severe consequences.
You can print your private keys and/or seed phrase as a banknote and put it into a safe deposit box in your bank.
On the other hand, there is always a risk that someone is gonna rob your bank, so you might want to stick with BYOB (be your own bank) principles and store the seed somewhere else. Yet, that risk is way too small in comparison with crypto exchanges ☠
Store two copies of the seed on two pieces paper hidden in different places. You can also store three pieces of paper containing the words in a particular sequence.
Give one piece to someone of your friends or family. Make sure you to put on a tinfoil hat trust the people you are sharing the seed with.
Engrave the most important part the seed phrase on a metal plate. You can’t tear it, you can’t break it. They won’t burn in hell, since they’re fireproof 👹 Awesome!
Multisig (multisignature) is additional security measures for cryptocurrency transactions. Multisignature addresses require another user to sign a transaction before it is broadcasted to the blockchain. When you create an multisig address, you'll be able to set a required number of signatures.
You can make a tattoo of the QR code of your private keys. Although we don’t recommend to you doing something like this, even if you trust your tattoo artist.
Need more safety? Then how about storing your Bitcoin in the rock! There are some companies who provide you with the bunker in a rock!⚔ The vaults are located deep underground and geographically dispersed on three continents. All data are physically stored on offline servers and never have access to the internet.
Unless you are a conspiracy theorist, we suggest you using simple methods to store your mnemonic phrase and private keys.
 Even if your device is broken, lost or stolen, you can restore access to your assets on any other device by importing your mnemonic phrase or private keys 🔄
“I'm not scared on Halloween, because I know I have Atomic Wallet to make me safe”


{%- block page_header -%} {%- set title='User settings for ' + username -%} {% include "header.html" %} {%- endblock page_header -%}
You can delete your account if you no longer want to be part of the snippet system. You can also hide your account if you want to take a break from snippets.
IMPORTANT NOTE: deleting your account does not delete your historical snippets -- they are still visible. All it does is make it so no snippets show up for you in future weeks. You also no longer get reminder emails.
Hiding is similar to deleting, except that your account is automatically re-created, with its settings intact, the next time you enter a snippet. It is appropriate if you want to take an extended break from snippets -- for instance for a sabbatical year -- but may come back to them later.


Snapshots
Snapshots are one of the most verisitile features of Vexil. They are used to support real-time flag monitoring using Combine and provide the primary source of mutability to a FlagPole
.
Subscribing to flag changes
A key part of declerative programming is the ability to react to changes over time. Vexil supports this by declaring a Publisher
that will deliver a Snapshot
of the FlagPole
any time one of its values changes.
This could be the addition or removal of a FlagValueSource
or one of those sources reporting the change. Either way, a new Snapshot
will be delivered that you can subscribe to.
let flagPole = FlagPole(hoist: MyFlags.self)
flagPole.publisher
.sink { snapshot in
// ... do something with the flag snapshot
}
Subscribing to individual flags
A common approach is to subscribe to an individual flag and update your app in response to any changes in that flag’s value:
let flagPole = FlagPole(hoist: MyFlags.self)
flagPole.publisher
.map { $0.subgroup.myBooleanFlag }
.removeDuplicates()
.sink { flag in
// .. do something when flag changes from false <-> true.
}
An in fact Vexil provides a convenience Publisher
for this scenario:
let flagPole = FlagPole(hoist: MyFlags.self)
flagPole.subgroup.$myBooleanFlag.publisher
.sink { flag in
// .. do something when the flag value changes
}
Note: If the type of your Flag
also conforms to Equatable
, the flag-specific publisher will emit the value only when it has changed (using removeDuplicates()
). If your Flag
does not conform to Equatable
it will skip removing the duplicates and emit every time the FlagPole
changes.
Mutating the FlagPole
Having the FlagPole
be immutable directly was a deliberate design decision. It prevents a category of programming mistakes (eg. flagPole.myFlag = true
), but it also keeps the API simple and easy to reason about.
That said - mutating the FlagPole
is stil very straight forward as each Snapshot
also conforms to FlagValueSource
- that means it can be added into your FlagPole
's source hierarchy in any position:
let flagPole = FlagPole(hoist: MyFlags.self)
// create an empty Snapshot and change the values we want
let snapshot = flagPole.emptySnapshot()
snapshot.subgroup.myBooleanFlag = true
// insert that snapshot at the top of the hierarchy so it overrides all the rest
flagPole.insert(snapshot: snaphost, at: 0)
The source hierarchy is also accessible via FlagPole._sources
if you want to manipulate it directly.
Mutating a FlagValueSource
Snapshot
s also provide a way to modify a FlagValueSource
, so you could use it whenever you need to update the UserDefaults
, for example. This is the same capability Vexillographer uses to provide its flag editing user interface.
let flagPole = FlagPole(hoist: MyFlags.self)
// create an empty Snapshot and change the values we want
let snapshot = flagPole.emptySnapshot()
snapshot.subgroup.myBooleanFlag = true
// save that to the UserDefaults
try flagPole.save(snapshot: snapshot, to: UserDefaults.standard)
How Snapshots work
You can think of Snapshot
s as a simple mutable dictionary of flag values. It is literally a [String: Any]
where the string key corresponds to the flag’s key, and the value is the Flag’s value. It then uses the same logic as a FlagPole
in routing requests for the flag’s value to the internal dictionary.
This follows the design philosophy in Vexil that a FlagValueSource
should only return a value if it has been explicitly set in that source, and should otherwise return nil
to allow the next FlagValueSource
to be consulted.
Creating Snapshots
There are two ways to create a Snapshot
, empty or full.
Empty Snapshots
When taking an empty snapshot, its internal dictionary is also empty, and the request for the Flag’s value (when used as a FlagValueSource
) will be nil
. If you access the Flag.wrappedValue
property directly (eg. flagPole.subgroup.myBooleanFlag
) it will return the flag’s default value.
Empty snaptshots are typically used for mutating the FlagPole
or a FlagValueSource
.
let flagPole = FlagPole(hoist: MyFlags.self)
let snapshot = flagPole.emptySnapshot()
Full Snapshots
When taking a full snapshot, the FlagPole
will walk the flag hierarchy and copy the current value of every flag into the Snapshot
, so the internal dictionary will contain every flag key => value currently known.
Full snapshots are used by the FlagPole
's Publisher
when emitting changes.
let flagPole = FlagPole(hoist: MyFlags.self)
let snapshot = flagPole.snapshot()


--- layout: base title: Damir Cavar's Haskell code page author: "Damir Cavar" desc: "This is Damir Cavar's list of Haskell related projects." keywords: "Damir Cavar, Haskell, Computational Linguistics, Natural Language Processing, CL, NLP" link: haskell ---
I developed a few iHaskell notebooks (see Jupyter or Kronos Haskell for Mac) as tutorials and material accompanying different courses in Computational Linguistics (CL), Natural Language Processing (NLP), AI and Machine Learning (ML). The material will eventually be all listed here and made available for download:


Tseslider Examples
Step = 2, minVal = 0, maxVal = 50
Continuous, minVal = 10, defaultVal = 20
Change value
GO


?.Lud\7ip,ia
peruviana
(L.)
Hara
Determin
ed
by
T.P.
Ramamoorthy
1980
Missouri
Botanica!
(Čarden
HERBARIO
DEL
COLEGIO
DE
LA
SALLE
VEDA
DO-HABANA
Num..A444__________________________________Familia___________________________
Co]
Bros.
Main
&
Clemente
pecha
July
15,
1950
SwaBps,nearLaMulata,EinardelRio.
01447676
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


Greta Thunberg to guest-edit BBC radio news programme
The 16-year-old climate change campaigner will be one of five prominent personalities invited to take over the “Today” programme between Christmas and New Year.
by AFPTeenage Swedish environmental activist Greta Thunberg will guest-edit BBC radio’s main daily current affairs programme in December, the broadcaster announced Saturday. The 16-year-old climate change campaigner will be one of five prominent personalities invited to take over the “Today” programme between Christmas and New Year, the British Broadcasting Corporation said.
Ms. Thunberg will speak to the world’s leading climate change figures and hear from frontline activists, said the BBC.
The other four guest editors will be Supreme Court president Brenda Hale, transvestite potter Grayson Perry, poet performer George the Poet and Charles Moore, the former editor of The Daily Telegraph newspaper. Previous guest editors have included Stephen Hawking, Prince Harry, and Angelina Jolie.


object AclManager extends Serializable
Object provides useful functions for seting up ACLs on files on ADLSgen2. Since package is using standard libraries, it is expected to work on all FSes supporting ACLs.
- Alphabetic
- By Inheritance
- AclManager
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
FsPermission(scope: String, permission: String, level: String, granteeObjectId: String) extends Product with Serializable
Use object of this case class to define permission to set on files/folders
Use object of this case class to define permission to set on files/folders
- scope
- can be one of user, group, other, mask
- permission
- posix permisision, e.g. r-- or rwx or --x
- level
- DEFAULT or ACCESS (DEFAULT will apply this permission to all children of the folder)
- granteeObjectId
- user of group ID to apply permissions to
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clearAcl(paths: Array[String], attempt: Int = 0)(implicit conf: Configuration): Array[FsOperationResult]
Removes all but the base ACL entries of profided paths
Removes all but the base ACL entries of profided paths
- paths
- array of paths (strings) - must be absolute path
- attempt
- retry feature - do not use
- conf
- HadoopConfiguration (spark.sparkContext.hadoopConfiguration)
- returns
Array with information which paths were processed and if successfully.
-
def
clearFolderAcl(folderUri: String)(implicit conf: Configuration): Array[FsOperationResult]
Removes all but the base ACL entries of files and directories in the folder/file tree of provided folder
Removes all but the base ACL entries of files and directories in the folder/file tree of provided folder
- folderUri
- parent folder of folder tree to remove ACLs from
- conf
- HadoopConfiguration (spark.sparkContext.hadoopConfiguration)
- returns
- Array with information which paths were processed and if successfully.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
getAclEntries(path: String)(implicit conf: Configuration): Seq[AclEntry]
Gets ACL entries for the path
Gets ACL entries for the path
- path
- absolute path
- conf
- configuration of hadoop. Best to get it is from spark.sparkContext.hadoopConfiguration
- returns
- collection of ACL entries for th path
- def getAclEntry(p: FsPermission): AclEntry
-
def
getAclsForPaths(fs: FileSystem, paths: Array[String]): Array[(String, AclStatus)]
Gets ACLs for the provided paths
Gets ACLs for the provided paths
- fs
- hadoop filesystem
- paths
- list of paths to get ACLs for
- returns
- Array of ACLs
- Attributes
- protected
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
modifyAcl(paths: Array[String], newFsPermission: FsPermission, attempt: Int = 0)(implicit conf: Configuration): Array[FsOperationResult]
Modifies ACLs for all provided paths (path is absolute like<EMAIL_ADDRESS>Modifies ACLs for all provided paths (path is absolute like<EMAIL_ADDRESS>- paths
- Array of paths to modify ACLs for
- newFsPermission
- permission which will be set for all paths provided.
- attempt
- retry feature. Keep at 0 (default)
- conf
- configuration of hadoop. Best to get it is from spark.sparkContext.hadoopConfiguration
- returns
Array of FsOperationResult objects containing information if operation succeeded for each path.
-
def
modifyFolderAcl(folderUri: String, newPermission: FsPermission)(implicit conf: Configuration): Array[FsOperationResult]
Modifies ACLs for folder and all it's files.
Modifies ACLs for folder and all it's files.
- folderUri
- absolute path to the folder like<EMAIL_ADDRESS>- newPermission
- permission to set
- conf
- configuration of hadoop. Best to get it is from spark.sparkContext.hadoopConfiguration
- returns
Array of FsOperationResult objects containing information if operation succeeded for each path.
-
def
modifyTableAcl(db: String, tableName: String, newPermission: FsPermission)(implicit spark: SparkSession): Array[FsOperationResult]
Allows modification of ACLs on files, which belong to particular hive table.
Allows modification of ACLs on files, which belong to particular hive table. List of files for the table is taken from hive metastore cache.
- db
- Hive database name
- tableName
- Hive table name
- newPermission
- permission which should be applied on files. Create new permission using FsPermission case class from this object
- spark
- SparkSession needed to access hive metastore.
- returns
Array of FsOperationResult objects containing information if operation succeeded for each path.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
resetAclEntries(pathUri: String, acls: Seq[AclEntry])(implicit conf: Configuration): Unit
Applies all ACL enties for the path.
Applies all ACL enties for the path. It is different than modifyAcls, because it re-sets ACLs, instead of incrementally modifying them.
- pathUri
- absolute path to the file, e.g<EMAIL_ADDRESS>- acls
- collection of permissions to set
- conf
- configuration of hadoop. Best to get it is from spark.sparkContext.hadoopConfiguration
-
def
synchronizeAcls(uriOfFolderToApplyAclsTo: String, uriOfFolderToTakeAclsFrom: String)(implicit conf: Configuration): Unit
This function will synchronize ACLs on folder/file trees.
This function will synchronize ACLs on folder/file trees. First, it will apply all ACLs on subfolders of uriOfFolderToApplyAclsTo - whenever there is folder with the same name/path. Then all elements (folders and files) will get ACLs from their parent folders.
- uriOfFolderToApplyAclsTo
- top folder of a tree where ACLs should be applied on
- conf
- hadoop configuration (spark.sparkContext.hadoopConfiguration)
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()


Hello World, we are software developers!
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
This is the link to our project
Contrary to popular belief, Lorem Ipsum is not simply random text.  Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.