text:
Date: Tue, 10 Dec 1996 03:33:15 GMT
Server: NCSA/1.4.2
Content-type: text/html
Last-modified: Wed, 22 Nov 1995 07:59:50 GMT
Content-length: 38848

<title> Simon User Guide </title>

Simon User Guide
  Version 0.11

Table of Contents

  Introduction

  Why Simon was Created

  About this release

  Starting Simon Up

  Some simple things to try

Terminology

  How Simon works

  SAL constructs

  Miscellaneous

  Full SAL domains

Appendix

Solving universal goals

Known problems/kludges in this release

SAL bnf

Partial objects

SAL tutorial

Trouble shooting

The tracer

Introduction

Simon is a "softbot" (a software robot) which is being developed at
the University of Washington.  This manual contains technical
information needed to use and work on Simon.

Simon is a descendent of another softbot, "Rodney", and shares a lot
of functionality with Rodney.  The major difference between Simon and
Rodney is that Rodney uses a planner (called XII) to determine a
course of action, whereas Simon's actions are controlled via a
procedural specification expressed in the Simon Action Language (SAL).

This manual assumes that you have read the following sections of the
 Rodney
manual:

The Model Manager

Goal Language

Rodney Action Language

Writing Operators

A few things to bear in mind:

 Wherever the planner would be invoked in Rodney (ie to achieve
goals), Simon invokes the default mechanism outlined  below .  The rest of the Softbot architecture
is pretty much the same.

 Even though Simon does not use XII, it still uses the XII
language for specifying goals, so it is important to understand the
syntax and meaning of the goal language.

 The do and request mechanisms are not
yet fully functional in Simon.

 Actions parameters in SAL do not take list-valued arguments,
hence the all modifier is not to be used.

Simon only understands the annotations: FIND-OUT, SATISFY,
CONTEMPLATE and SCOPE.

After you read those chapters, you can start profitably
playing around with Simon, but you should also read the
following sections before long:

Model Manager Options

Shell Interface

Planner Interface Functions and RAL Commands

Advanced Model Manager

Sensor Functions

Why Simon was Created

The softbot Simon and its action language SAL (Simon Action Language)
were created in the hopes of allowing easier and more elegant
specification of Softbot activity.  SAL can be seen as search control
but is perhaps better seen as an integration of a procedural control
language with simple task reduction planning.  SAL allows for
intuitive procedural action design while also allowing for general
backchaining search.  The Simon kernel is very close in spirit to
RAPS.  But unlike RAPS, we embrace complete ordering and do not
concern ourselves with protected states or explicit checks for
success.  The hope is that we can design a system which better matches
the constraints and opportunities of software environments.  This
means taking advantage of the relative rarity of goal clobbering.

Simon is built on top of RAL (Rodney Action Language).  All RAL constructs
are supported in SAL.  For details on RAL,  please refer to the Rodney
user manual.

About this release

This release of Simon is considered pre-alpha, and as such it should
not be considered stable.  The primary purpose of this release is to
get people acquainted with Simon, in particular on how Simon does its
work and SAL syntax.  Although I hope people can expand the domain on
which Simon can operate, this release is not robust enough for someone
without intermediate knowledge about the Simon kernel to include a
whole new domain without considerable frustration.  However it should
not be as frustrating to modify existing domains (there are three
existing domains in Simon: machine, people and files) or to build upon
them.  The next release should be more robust.  If you are interested
in building domains however, I'll try to give you as much support as I
can.

Starting Simon Up

Simon is compiled on Allegro Common Lisp 4.2 (ACL) on Suns and SGIs.
To get into ACL in a Simon-compatible way,

Place the following line in your .emacs file:
<xmp>(load "/projects/ai/emacs/standard.emacs-4.2.el")</xmp>

Place the following line in your .clinit.cl file:
<xmp>(load "/projects/ai/emacs/standard.clinit.cl")</xmp>

Run emacs on a Sun or SGI machine.

Load a lisp file (anything with the suffix '.cl' will do).

Type C-c l and respond to the prompts by pressing return,
thus accepting the defaults.  After a bit of processing
(during which you can verify that the correct version of LISP --
version 4.2 -- is being loaded), you
should see the ACL prompt, which is <xmp>USER(1):</xmp>

(A little more information on
how to navigate around emacs
while using ACL is available.)

Now load Simon by typing:
<xmp>USER(1): (require 'simon)</xmp>
You may get some  redefinition warning
messages; you can ignore them for now.

Next, we start up Simon.  If you're running under X-windows, just type:
<xmp>
USER(2): :ss
</xmp>

This is a pre-defined alias that start up a shell, a Tracer window (if
you have CLIM 2.0 installed) and the Simon interface.  You can also do
these steps individually, similar to the way Rodney is started:

<xmp>
(start-shell [arguments])
(start-tracer)   ; Only if CLIM 2.0 is available on your system.
(simon)
</xmp>

Note that the shell interface is meant to interface with a shell
process on a Sun.  Hence, we need to make sure that shells, when
started, are run on a Sun machine.  This can be done by either
specifying a :host argument to the start-shell command,
or by setting the variable *shell-default-host* to a
reasonable value, as follows: <xmp> (start-shell :host "sun-host") or
(setq *shell-default-host* "sun-host") </xmp>

Setting the variable in your .clinit.cl is convenient
because it allows the use of the :ss alias.  See the
section "Shell Interface" in the Rodney User Manual for more
information.

If the previous step succeeded, you should now see
the simon prompt:
<xmp>simon></xmp>

To reenter Simon after a crash or after you have (quit),
just type (restart-simon)
or the toplevel command :rr.
<xmp>
USER(24): :rr
Task aborted.
simon>
</xmp>

Some Simple Things To Try

  SAL is an immediate descendant of RAL, so most of this things
demonstrated in the RAL section of the Rodney manual will work with
Simon.  For example:
<xmp>
simon> (display "hello world")
hello world
</xmp>
works fine.
The demo does a couple of some Rodney tasks.  One is finding office phone
and one is finding email address via uactionwin-inspecwin-inspec.
There is a partial object example as well.

For details please look at
/projects/softbots/rodney/working/simon/demo.lisp.

The best way to learn about using Simon is to browse through the
existing domain definitions.  Start with a Unix operator you're
familiar with and trace through all the definitions to see how the
various parts are implemented.  Also, see the brief tutorial for the
general process of adding an operator to the existing domain theories.

The Tracer utility is very handy for monitoring what is happening
under the covers in Simon.  This is quite useful when debugging
domains, since it allows one to observe the order in which goals and
subgoals are generated and worked on, and which actions are used for
them.  See  Appendix G .

Terminology

A brief glossary  of selected terms
is available.

How Simon works

As mentioned earlier, Simon decomposes goals into literals and
operates on these literals.  The general scheme used for each literal
is as follows:

 If the predicate is a fact, then the fact lookup is done.

 The object cache is checked for possible partial-object
     information that would match the literal.  The object cache is an
     attempt to address the partial-object problem ; see  Appendix D  for details.

 The model-manager is checked for LCW and/or presence of a
     matching literal.

 The corresponding action is executed (except for CONTEMPLATE
     goals).

For FIND-OUT and SATISFY goals, Simon will use SAL actions, as
follows.  When presented with a single term goal, Simon will map its
predicate to an action and starts the action.  For example:
<xmp>
     (achieve (find-out (firstname ?p ?d)))
</xmp>

Here we have a one-term goal (firstname ?p ?d).  Simon's
mapping is done by attaching ".action" at the end of the predicate.
So in this case Simon solves the goal by calling the action called
firstname.action.

  When dealing with conjunctive goals Simon processes them in a depth-first
manner. Here is another example:
<xmp>
    (achieve (and (find-out (firstname ?p ?d))
                  (find-out (lastname  ?p "etzioni"))
                  (find-out (office.phone ?p ?num))))
</xmp>

Here, Simon will start off by attempting to satisfy the first
literal. If the firstname.action fails at this point then
the whole conjunctive goal will fail.  Suppose for now that it
succeeds--now Simon will start working on the second conjunct.  If
this conjunct cannot be solved with the constraint placed on
?p by the first conjunct, then Simon will backtrack and
get an alternative binding for the first conjunct.  This general
search process will continue until bindings are obtained, which
satisfy all three conjuncts, or until there are no more alternatives
for backtracking, in which case the goal fails.

As you will see below, there is one other form of backtracking that
Simon allows.  The SAL try statement allows the user to
specify an explicit choice point.  That is to say, the user can
specify a group of methods in which a given goal may be solved.  The
general template for a SAL action is a tree of conditions which bottom
out with try statements.  See the examples below.

This framework allows Simon to efficiently handle the goal level
backtracking discussed above.  If, for example, Simon has failed on
the second goal conjunct above, you want Simon to attempt to find a
NEW binding for (firstname ?p ?d) that hasn't been tried
yet.  Assume that there are three methods for satisfying
(firstname ?p ?d): bindings from the model, action A, and
action B (i.e., A and B are in a try statement).  So,
after all the possible bindings from the model have been tried, Simon
will try action A.  And after all the ways of executing action A, have
been tried, action B will be used.  This continues until a
satisfactory binding has been found or, all the alternatives have been
tried.

SAL constructs

Actions

As mentioned in the previous section, Simon will map an action from a
goal.  For example, a goal like (current.terminal.type
"vt100"), would cause the following action to be invoked:

<xmp>
(defaction current.terminal.type.action (?goal ?type)
  (call-op (set-term ?type) ?goal))
</xmp>

When invoking the action, the first parameter of the action,
?goal here, is bound to the goal that caused the action
to be invoked. The rest of the parameters, in this case
?type, will be bound to the arguments to the predicate
("vt100").

Below are some new SAL syntatic additions to RAL (see
Appendix C for the full BNF specs):

CALL-OP

You can cause an operator to be invoked.  When an an operator is
called, Simon automatically subgoals on achieving the preconditions.

<xmp>
(call-op (<operator-name> <value>*) <simon-goal>)
</xmp>

There are two ways to invoke an operator:

 Call it directly (as in Rodney),  for example:
<xmp>
(finger-firstname ?firstname ?domain)
</xmp>

 Use the call-op construct,  for example:
<xmp>
(call-op (finger-lastname ?lastname ?domain) ?goal)
</xmp>

Whereas it always calls the operator in the first case, Simon will
perform checks on the goal if you use call-op (the second case).

Specifically Simon will check the model manager to see if we have LCW
in the model manager, or whether the goal is already true in the model
manager.  If this is the case, Simon will not call the operator.  This
simulates XII's way of pruning redundant sensing.  In addition, Simon
will check the goal again after it executes the operator to see if the
goal is satisfied.  If the goal is not satisfied, this call-op action
will fail.

<simon-goal> can be either a literal or a variable bound
to a goal.  For example:

<xmp>
(call-op (infer-office-phone-from-finger-rec ?officemate !phone !pt)
				      (office.phone ?officemate !phone))
</xmp>
If the goal is a literal, Simon will bind the variables in the literal
using bindings returned from execution, provided the execution
succeeds.  For example ?officemate and !phone in (office.phone
?officemate !phone) above will be bound.  Normally, the parameters
passed to operator execution (e.g. ?officemate, !phone and !pt) should
also be bound, but notice that if the goal is satisfied before calling
operator, the operator will not execute and thus the parameters will
not be bound.  However variables in the literal will still be bound.
For this example, this means that if the goal literal were true, !pt
wouldn't be bound.

FOREACH

This action has been extended to allow for iteration over all literal
bindings in the model.
<xmp>
(foreach (<variable> <value>) <action>*) |
(foreach <literal> <action>*) |
(foreach (<xii-scope>) <action>*)
</xmp>

Examples:
<xmp>
(setq ?x ("asd" "sdf"))
(foreach (?y ?x) (display ?y))
=>"asd"
  "sdf"

(foreach (userid.room ?u ?room) (find-out (lastname ?u "cs")))
</xmp>

In the latter case, Simon will look into the model manager to find all
the possible bindings for ?u and ?room, and
iterate over them.  The semantics of the literal is a CONTEMPLATE goal
to Simon.

[For a more complete example see FIND below]

FIND

This new action allows for a conditional iteration over a list or
literal bindings.  This is similar to foreach except that iteration
will stop when the first binding has been found that allows a
successful execution of the associated actions, and the FIND action
fails when no such binding can be found.

<xmp>
(find (<variable> <value>) <action>*) |
(find <literal> <action>*) |
(find (<xii-goal>) <action>*)
</xmp>

Examples:
<xmp>
(setq ?x ("asd" "sdf"))
(find (?y ?x) (display ?y))
=> "asd"
</xmp>
This displays only "asd" because (display "asd") is successful so
(display "sdf") will not be executed.

<xmp>
(find (userid.room ?u ?room) (achieve (find-out (lastname ?u "cs"))))
</xmp>
Here, Simon will try to achieve (lastname ?u "cs") by
binding ?u and ?room to all the possible
bindings that already exists in the model manager.

A more complex example:
<xmp>
  (find (machine.netfind.server ?machine)
	(netfind-person ?lastname ?keywords ?machine)
	(if (netfind.result ?keywords ?lastname !userid !domain)
	    (progn (assert (person.domain ?p !domain))
		   ;; do this to make sure the person is there
		   (finger-lastname ?lastname !domain))
	  (fail)))
</xmp>
Here, we try different netfind servers until we successfully find the
person's userid (because sometimes netfind servers are
overloaded).

IF

<xmp>
(if <condition> <action> <action>)

<condition>        :- <literal> |
                      <xii-goal> |
                      <action>
</xmp>

This has been extended to allow more expressive conditions.  You can
specify actions, XII goals or literals or any mixture of these 3.  All
literals without annotations are assumed to be CONTEMPLATE goals if
the goal is a fact, or FIND-OUT goal otherwise.  For actions,
successful completion means the condition is true.

Examples:

 Using a literal:
<xmp>
(if (publication.affiliation !pub !affil)
    (assert (affiliation ?p !affil)))
</xmp>
(Here, (publication.affiliation !pub !affil) is a FIND-OUT goal.)

 Using an XII goal:
<xmp>
(if (contemplate (is-bound ?domain) f)
    (setq ?domain "cs.washington.edu"))
</xmp>

 Using a mixture:
<xmp>
(if (and (userid ?officemate ?u "cs.washington.edu")
	 (neq ?officemate ?person)
	 (call-op
	     (infer-office-phone-from-finger-rec ?officemate
						  !phone !pt)
             (office.phone ?officemate !phone)))
    ;; then
    (assert (office.phone ?person !phone))
  ;; else
  (fail))
</xmp>

The first example shows using a literal as a condition.  The second one
shows an XII goal with annotation CONTEMPLATE and false truth value.
The third example shows a combination of literals,  XII goal and
action inside the condition.

COND

<xmp>
(cond <cond-clause>+)

<cond-clause>      :- ((<condition>) <simple-action>+)
</xmp>

This construct avoids cascades of if statements. This is similar to
the Lisp counterpart, you can also have t at the last
condition to specify a default.  Example:
<xmp>
(defaction finger-userid-action (?goal ?person ?domain)
  (cond ((userid ?person ?userid)
	 (call-op (finger-userid ?userid ?domain) ?goal))
	((lastname ?person ?last)
	 (call-op (finger-lastname ?last ?domain) ?goal))
	((firstname ?person ?first)
	 (call-op (finger-firstname ?first ?domain) ?goal))
	(t (display "Can't finger userid"))))
</xmp>

CASE

Again this is an attempt to make SAL more lisp like.  You can match
constant objects against variables.

<xmp>
(case <variable> <case-choice>*)

<case-choice>      :- (<constant> <action>) | (otherwise <action>) |
                      ((<constant>+) <action>)
</xmp>

Example:
<xmp>
(defaction test-case (?x)
  (achieve (contemplate (annotation ?x ?ann)))
  (case ?ann
    ((satisfy find-out) (display "ASd"))
    (contemplate (display "BDS"))
    (otherwise (display "happy"))))
</xmp>

Here we have an annotation object bound to ?ann, and we
match it against the annotation objects inside the case statements.
Like Lisp, we have have a list of constants (first line of the case
statment) in the case condition.  We can also provide a default case
with otherwise (the third line in the above example).

TRY

<xmp>
(try <action>* [t]) | (try <simon-goal> <action>* [t])
</xmp>

This action allows for specifying an explicit action choice point.
The sequence of actions is processed until one of them succeeds.  If a
t is present then the TRY action will always succeed,
otherwise it will fail if all listed actions fail.  If you provide an
optional goal as its second argument, try will try all the statements
until the goal is satisfied.  The goal can either be the parameter
passed by Simon into an action (for example, ?goal), or a
literal.  If it is a literal, Simon will also try to bind the
variables in the literal.  See the call-op action above for
details.

Here is a simple example of how try works:
<xmp>
(try ?goal
	A
	B
	t)
</xmp>
In this example,  Simon will try action A and see if goal ?goal is satisfied.
If so this try action will terminate successfully,  otherwise Simon will try
B,  if B also fail to satisfy ?goal, this try statment will still terminate
successfully because the last action is a "t".  If it is not a "t",  then
this try statment will fail.

Here is a real example of a try statment:
<xmp>
(defaction office.room.action (?goal ?person !room)
  (if (is-bound ?person)
      (try ?goal
	   (call-op (person-office-room ?person !room) ?goal)
	   (if (lastname ?person ?lastname)
	       (call-op (staffdir ?lastname) ?goal)))
    (fail)))
</xmp>

FAIL

<xmp>
(fail)
</xmp>

Just fails an action.  Usually used in conditionals.

Example:
<xmp>
(if (condition-is-true)
    (do-something)
  (fail))   ;; otherwise we have no method to solve the goal and fail.
</xmp>

<!  I'm not going to include this in the manual
ASSERT-ATTRIBUTE :  This allows the programmer to assert attributes
                      of (partial) objects to the attribute cache.
>

PROGN

<xmp>
(progn <simple-action>+)
</xmp>
This groups actions just like Lisp's progn group procedure calls.
<xmp>
(if (firstname ?person ?firstname)
	(progn (setq ?fi (subseq ?firstname 0 1))
	       (assert (first.initial ?person ?fi))))))
</xmp>

Miscellaneous

 SAL new objects

Simon uses these new object type to distinguish between goal types (e.g.
SATISFY or FIND-OUT goals,  true or false goals etc).

SAL introduces these 2 new object types:

Goal

These are goal objects being passed in variables.  For example,  the
?goal parameters in most SAL actions are bound to these objects.  Literals
are converted into goals if necessary.

Annotation

These are annotation objects representing annotations in alits.  Simon
understands FIND-OUT, SATISFY, CONTEMPLATE and SCOPE.

SAL new facts and predicates

Usually they are used in if statments to analyse the nature of the goal
and perform appropriate actions.  But you can also use them to obtain
values as well.

<xmp>
(goal-tv <goal> <bool>)
<bool> can be one of t, f or u.
<goal> is a goal object.
</xmp>

If bool is bound:

Satisfied if the truth value of the goal matches bool.

If bool is unbound:

Always satisfied.  A side effect is the truth value of the goal is
bound to bool.

<xmp>
universal? <var>
</xmp>
Satisfied if var is universally quantified.

<xmp>
annotation <goal> <annotation>
</xmp>
If annotation is bound:

Satisfied if the annotation of goal matches
annotation.

If annotation is unbound:

Always satisfied.  A side effect is the annotation of
goal is bound to annotation.

The supported annotations in SAL are FIND-OUT, SATISFY, CONTEMPLATE and
SCOPE.

A comprehensive example:
<xmp>
(defaction group.protection.file.action (?goal ?file ?protection)
  (if (annotation ?goal satisfy)
      (if (goal-tv ?goal f)
	  (call-op (group-unprotect-file ?file) ?goal)
	(call-op (group-protect-file ?file) ?goal))
    (protection-on-file ?file !g-read !g-write !g-exec)))

</xmp>

Full SAL domains

Simon currently has rules for 4 domains: general, machine, files and
people.  The most interesting should be the people domain.

The examples reside in

/projects/softbots/rodney/working/simon/domains.
The SAL actions are all included in files with -sal.lisp suffix.

APPENDIX A Solving universally quantified goals

By default, Simon doesn't do anything special for universally
quantified goals.  However, in the case that there are operators with
matching universally quantified effects, we would like to solve such
goals by direct application of these operators.  lcw-match is useful
in allowing us to determine the scope of a goal and thus figuring out
which operators may be applicable.

<xmp>
(lcw-match <var> <scope>
           ((<literal>*) <action>*)+)
</xmp>

Consider an example:
<xmp>
(defaction person.domain.action (?goal ?p ?domain)
  (if (contemplate (is-bound ?domain) f)
      (setq ?domain "cs.washington.edu"))   ;; A hack
  (if (and (universal? ?p) (annotation ?goal scope))
      (lcw-match ?p ?s
                 (((lastname ?p ?l) (firstname ?p ?f))
                   (progn (call-op (finger-firstname ?f ?domain) ?s)
                          (call-op (finger-lastname ?l ?domain) ?s)))
                 (((lastname ?p ?l)) (finger-lastname ?l ?domain))
                 (((firstname ?p ?f)) (finger-firstname ?f ?domain))
                 )
    (progn
      ;; because the partial obj scheme is slightly broken
      (if (and (lastname ?p ?lastname) (is-bound ?lastname))
          (call-op (finger-lastname ?lastname ?domain) ?goal)
        (if (and (firstname ?p ?firstname) (is-bound ?firstname))
            (call-op (finger-firstname ?firstname ?domain) ?goal)
          (fail))))
    ))
</xmp>

Here, ?s is bound to the scope of the universally quantified variable
?p.  The match statement is like a case statement, and we try to
determine which combination of literals appears in the scope.

Note that the call-op would fail if the scope mentioned is more
general than the scope in the operator's effect(s).

APPENDIX B Kludges in this release

These are known problems/bugs/limitations in this release of Simon.  Some
of them may be fixed in the next release but some are more open
questions to be poundered upon.

 Try statments will only backtrack if it is the last statement of
an action.

 The scope of undeclared variables is the block enclosing it's
     first use. This is unwieldy if, for example, we use a new
     variable inside a progn, and then need to reference it in the
     code following the progn.  A workaround is to assign to the
     variable in the outermost scope where the variable is used,
     perhaps by doing a setq to it.

 Cannot setq a variable to nil.  This is because the MM uses nil
     to indicate when no bindings are available.

 Conditions in if statments may be ignored if they are illegal.

 Dies too miserably if you have syntax error in your SAL code...

 Also see Partial objects in Appendix D.  Simon solves partial object
goals partially...

 Universally quantified goals are working but dangerous to play with.

 Conditional effects in operators seems to work by only checking the model
manager.

APPENDIX C SAL BNF

<xmp>

<action> :-
<simple-action> |
<do-action> |
<request-action> |
<select-action> |
<achieve-action> |
<maintain-action> |
<foreach-action> |
<assert-action> |
<if-action> |
<while-action> |
<try-action> |
<case-action> |
<find-action> |
<call-operator-action> |
<assert-attribute-action> |
<fail-action> |
<lcw-match-action> |
<get-lcw-action>

<simple-action>    :- (<action-identifier> <value>*)

<do-action>        :- (do <action>* <task-specifier>*)

<request-action>   :- (request <action>* <task-specifier>*)

<select-action>    :- (select (<variable>*) <literal>*)

<achieve-action>   :- (achieve <aliteral>*) |
                      (achieve <xii-goal>)

<maintain-action>  :- (maintain <aliteral>* <task-specifier>*)

<xii-scope> :- (<var> :in (and <scope>+))

<foreach-action>   :-
(foreach (<variable> <value>) <action>*) |
(foreach <literal> <action>*) |
(foreach (<xii-scope>) <action>*)

<find-action>      :- (find <literal> <action>*) |
                      (find (<variable> <value>) <action>*) |
		      (find (<xii-goal>) <action>*)

<assert-action>    :- (assert <literal>*)

<action> :- <simple-action> | (progn <simple-action>+)

<if-action>        :- (if <condition> <action> <action>) |(cond <cond-clause>+)

<cond-clause>      :- ((<condition>) <simple-action>+)

<while-action>     :- (while <condition> <action>*)

<condition>        :- <literal> |
                      <xii-goal> |
                      <action>

<try-action>       :- (try <action>* [t]) | (try <simon-goal> <action>* [t])

<case-action>      :- (case <variable> <case-choice>*)

<case-choice>      :- (<constant> <action>) | (otherwise <action>) |
((<constant>+) <action>)

<literal> :- (pred <args>*)
<goal-obj> :- <var>
<simon-goal> :- <literal> | <goal-obj>

<call-operator-action> :-
(call-op (<operator-name> <value>*) <simon-goal>) |
(<operator-name> <value>*)

<fail-action> :- (fail)

<assert-attribute-action> :- (assert-attribute <literal>)

<new-prompt-case-list> :- (<prompt-case>*)

<prompt-case>      :- (<new-prompt> <action>)

<precond-selector> :- <num-list>

<task-specifier>   :- <when-spec> |
                      <duration-spec> |

<task-specifier>   :- <when-spec> |
                      <duration-spec> |
                      <priority-spec> |
                      <frequency-spec>

<when-spec>        :- :when always |
                      :when now |
                      :when <literal> |
                      :when (<literal>*) |
                      :when <xii-goal>

<duration-spec>    :- :duration once |
                      :duration continuous |
                      :duration <literal> |
                      :duration (<literal>*) |
                      :duration <xii-goal>

<frequency-spec>   :- :frequency <value>

<action-identifer> :- <action-name> |
                      <operator-name> |
                      <command-name> |

<value>            :- <object-name> | <lisp-object> | <variable> | <list>
<list>             :- ( <value>* )
<variable>         :- <var> | <rvar> | <avar>
<avar>             :- (<avar-arity>? <avar-direction>? <var>)
<avar-arity>       :- a | the | all
<avar-direction>   :- input | output |
</xmp>

APPENDIX D Partial objects

Most of the time Simon will do the right thing with partial objects and
so you don't need to worry about it.   This section documents how Simon
solves the partial object problem.

Partial objects are variables that have a set of constraints but do not
have enough information to form or bind to an object.

Example:
<xmp>
(achieve (and (find-out (firstname ?p "Terrance"))
	      (find-out (person.domain ?p "cs.washington.edu"))))
</xmp>
Here we're specifying that ?p is an object that has the attributes
firstname and person.domain that we know about,  but we don't know the
lastname so we cannot completely specify a person object to bind to ?p.
Here our goal is to lookup some person ?p that has firstname Terrance and
domain cs.

Simon solves the goal by caching the conjuncts(*) of these goals into
an object cache.  When required to lookup some facts about ?p,
Simon will look into this cache and obtain the required information.
For example,  in firstname.action,  we call the operator finger-firstname.
Finger-firstname has a precondition (person.domain ?p ?d),  and Simon already
knows (person.domain ?p "cs.washington.edu") from its object cache,  so it
will unify ?d with "cs.washington.edu".

Currently Simon relies on XII's implementation of object constraints.
This means:

one cannot have a constraint alit that has other than 2 arguments in its
content (i.e. >2 or <2).
e.g.
<xmp>
(defpredicate firstname (person (firstname 1))
  "First field is a person object.  Second field is the person's first name string.")
</xmp>
This works because there are just 2 arguments 'person' and 'firstname',  but
<xmp>
(defpredicate idle.time (userid machine (number 1))
  "user is active on a machine. third parameter is user's idle time")
</xmp>
would never got asserted into the attribute cache because there are 3
arguments,  namely 'userid', 'machine' and 'number'.

one cannot have a constraint alit that has N N relationship.
e.g.
<xmp>
(defpredicate person.domain (person domain)
  "A person and their domain.")

(defpredicate lastname (person (lastname 1))
  "First field is a person object.  Second field is the person's lastname")

(defpredicate firstname (person (firstname 1))
  "First field is a person object.  Second field is the person's firstname
string.")
</xmp>
Of these 3 predicates,  lastname and firstname would get asserted.
Person.domain will not because it defaults to ((person N) (domain N)).

.f goals are not asserted into attribute cache.

(*) A limitation is that Simon cannot cache disjunctions.  So Simon will
ignore conditions specified in dijunction and will not cache them.

APPENDIX E SAL tutorial

A typical sequence of writing SAL actions would be starting with operators.
The operators produces effect terms.  We can start writing actions based on
them.

For example we have the operator CD :
<xmp>
(defoperator CD ((directory ?d) (path ?n))
  (documentation "Change the current working directory")
  (precond (find-out (pathname ?d ?n)))
  (interface ((exec-func execute-unix-command)
              (translation ("cd " ?n))
              (error-func default-unix-error?)
              (terminate-detect read-unix-prompt)))
  (effect (cause (current.directory ?d))))
</xmp>
Here we have the "current.directory" effect.
Hence we begin by writing the rule current.directory.action.

We want to see how many operators will produce this effect.
We can get this information from (operator-producing-pred machine.name),
or the toplevel function opp.
<xmp>
USER(6): :opp current.directory

(PWD CD)
</xmp>
This says the operators PWD and CD both have current.directory as their
effects.  So based on your knowledge about the domain,  you decide on
the conditions when each of these operator would be used to solve the
current.directory goal.

Here is the current.directory.action:
<xmp>
(defaction current.directory.action (?goal ?dir)
  (if (annotation ?goal find-out)
      (call-op (pwd ?dir) ?goal)
    (if (contemplate (pathname ?dir ?n))
	(call-op (cd ?dir ?n) ?goal)
      (fail))))
  </xmp>
It basically says if the goal is a find-out goal,  we should use PWD
to find out the current directory.  Otherwise we will do a CD to that
directory.  If none of these is the case,  then we'll fail.

SAL actions are developed incrementally.  Here the current.directory.action
only solves .t goals.  We may or may not need to add additional code to
this action to support .f goals.  But initially one just need to focus
on the problem one wants to solved and worry about other cases when need
arise.  In fact most of the SAL actions does not distinguish between
find-out and satisfy goals because typically only the find-out variants
appears.

APPENDIX F Trouble Shooting

I've tried to incorporate many error catching for Simon but I'm sure there
are still a lot of holes.  If Simon crashes,  please first make sure your
action is syntatically correct.  I've tried to check for syntax errors but
the parser is not powerful enough to catch all the problems.  Simon can
crash in unknown places if the action specification is syntatically incorrect.

If you're sure it's my fault,  then please let me (ctkwok@cs) know.  In
your bug report it'd be helpful to include the actions involved,  the
action code itself if it's written by you,  and the trace of actions
if there's any, or even the stack trace from :zoom if possible.
(Believe me... I'm not trying to discourage you :-)

APPENDIX G The tracer

Under ACL 4.2 and CLIM2.0,  one can use a simple browse window to see what
Simon is doing.  Currently the tracer is quite simple and just output
a log of what Simon is trying to achieve as Simon moves along.

The Options button will bring up a list of options for printing out the
log.  For example if you're only interested in certain options,  you can
toggle them.  Ultimately you can set the default for what is interesting for
you in a variable *print-enabled* which is a list of what is interesting,
if you're interested you can look at interface.lisp and customize the
variable.

The Clear button removes all the text in the window.

The Save button lets you save the trace in a file.  A dialog box asks
you
the name of the file to save in,  and the file will be appended with the
trace if the file already exists.

The 3 checkboxes between menu bar and text window shows Simon's status
(executing, thinking and Idle).

Note: Whenever you have a new action typed to Simon,  the last trace will
be removed.  So you may want to save it if you want to reference it later.

Questions comments? You can mail me here.

<tt><address>

	Cody Kwok

  Last modified:
	Tue Feb 14 15:07:25 PST 1995
</tt>


text:
<?xml version="1.0"?>

<!--

July 2010

Build file or Makefile for CloudSim.

Note:

  Make sure you have installed 'ant' and put the location of it into
  your path so you can access it anywhere.
  'ant' can be downloadable from http://ant.apache.org/

Usage:

  * Type 'ant' to compile all cloudsim source files, put them into the
    classes/ directory and to create a cloudsim-new.jar file in the jars/ directory

  * Type 'ant clean' to delete all the compiled classes and the classes/
    directory itself. The generated cloudsim-new.jar is not deleted.

Note:

  * You need to set up PATH for ant in Windows and/or Unix.

Acknowledgement:
  Thank to Uros Cibej for providing this file and instruction on
  how to use it.

-->

<project name="CloudSim" basedir="." default="makejar">
    <description>
            This is the build file for CloudSim
    </description>

    <!-- location to store Java classes -->
    <property name="class.dir" location="./classes" />

    <!-- location to store CloudSim source files -->
    <property name="src.dir" location="./sources" />

    <!-- location to store jar files -->
    <property name="jar.dir" location="./jars" />

    <!-- classpath declaration -->
    <path id="classpath">
        <fileset dir="./jars">
            <include name="*.jar" />
        </fileset>
    </path>

    <target name="prepare">
        <mkdir dir="${class.dir}" />
    </target>

    <!-- rule to compile CloudSim source files -->
    <target name="build" depends="prepare">
        <javac srcdir="${src.dir}" destdir="${class.dir}" includeantruntime="false">
 		<classpath refid="classpath"/>
	</javac>
    </target>

    <!-- Rule for making a jar file.

         Note:

           * The new jar file is named as "cloudsim-new.jar" to avoid overriding
             the existing jar file.

           * The new jar file only contains cloudsim classes only.
    -->

    <target name="makejar" depends="build">
        <echo>Compiling a new jar file, named: "cloudsim-new.jar".</echo>
        <echo>This jar file contains CloudSim classes only.</echo>
        <jar destfile="${jar.dir}/cloudsim-new.jar" basedir="${class.dir}" />
    </target>

    <target name="clean" description="clean up" >
        <delete dir="${class.dir}" />
    </target>

</project>

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using System.Windows.Forms;
using System.Drawing;
using System.IO;

namespace ownshot
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        NotifyIcon notifyIcon1;
        public static int ssnamelength = 4;
        string ScreenPath;
        public MainWindow()
        {
            InitializeComponent();
            this.AllowsTransparency = true;
            SetWindowStyle(true);
            new Hotkey(Key.D4, KeyModifier.Shift | KeyModifier.Ctrl, hkhandler);
            new Hotkey(Key.D5, KeyModifier.Shift | KeyModifier.Ctrl, hkhandler);
            new Hotkey(Key.D6, KeyModifier.Shift | KeyModifier.Ctrl, hkhandler);
            notifyIcon1 = new NotifyIcon
            {
                Icon = new Icon(Path.GetFileName(@"image.ico")),
                Text = "OwnShot",
                Visible = true,
                BalloonTipText = "If you see this text, then I forgot to implement some code, sorry.",
                BalloonTipTitle = "Screenshot get!"
            };
            notifyIcon1.BalloonTipClicked += NotifyIcon1_BalloonTipClicked;
        }

        void SetWindowStyle(bool hidden)
        {
            this.Topmost = !hidden;
            this.ResizeMode = ResizeMode.NoResize;
            this.WindowStyle = WindowStyle.None;
            this.ShowInTaskbar = !hidden;
            this.Visibility = (hidden) ? Visibility.Hidden : Visibility.Visible;
            this.Background = (hidden) ? System.Windows.Media.Brushes.Transparent : System.Windows.Media.Brushes.LightGray;
        }

        public void ShowBalloon(string text)
        {
            notifyIcon1.BalloonTipText = text;
            notifyIcon1.ShowBalloonTip(1000);
        }

        public void NotifyIcon1_BalloonTipClicked(object sender, EventArgs e)
        {
            if (!notifyIcon1.BalloonTipText.StartsWith("ERROR:"))
            System.Diagnostics.Process.Start(notifyIcon1.BalloonTipText);
        }

        private void hkhandler(Hotkey hotKey)
        {
            if (hotKey.Key == Key.D4)
            {
                screenCapture(true);
            }
            else if (hotKey.Key == Key.D5)
            {
                WindowCapture();
            }
            else if (hotKey.Key == Key.D6)
            {
                PartOfScreen();
            }
        }

        public void WindowCapture()
        {
            ScreenPath = OwnShotHelpers.RandomName(ssnamelength) + ".png";

            SetWindowStyle(true);
            System.Threading.Thread.Sleep(25);

            OwnShotHelpers.WindowCapture(ScreenPath);

            ShowBalloon(OwnShotHelpers.UploadImage(ScreenPath));

            if (OwnShotHelpers.GetConfig("DeleteMode") == "Yes")
            {
                File.Delete(ScreenPath);
            }
        }

        public void screenCapture(bool showCursor, bool Partial = false)
        {
            ScreenPath = OwnShotHelpers.RandomName(ssnamelength) + (Partial ? "_pre" : "") + ".png";

            SetWindowStyle(true);
            System.Threading.Thread.Sleep(25);

            OwnShotHelpers.CaptureImage(showCursor, ScreenPath);

            if (!Partial) ShowBalloon(OwnShotHelpers.UploadImage(ScreenPath));

            SetWindowStyle(!Partial);

            if (!Partial && OwnShotHelpers.GetConfig("DeleteMode") == "Yes")
            {
                File.Delete(ScreenPath);
            }
        }

        void PartOfScreen()
        {
            screenCapture(false, true);
            BitmapImage imageContent = new BitmapImage();
            imageContent.BeginInit();
            imageContent.CacheOption = BitmapCacheOption.OnLoad;
            imageContent.UriSource = new Uri(Path.Combine(Environment.CurrentDirectory, ScreenPath));
            imageContent.EndInit();
            image.Source = imageContent;

            //+ugh fml
            SetWindowStyle(false);
            this.Left = SystemParameters.VirtualScreenLeft;
            this.Top = SystemParameters.VirtualScreenTop;

            var buttonPos = new System.Windows.Media.TranslateTransform();
            buttonPos.X = (0 - SystemParameters.VirtualScreenLeft) + 15;
            buttonPos.Y = (0 - SystemParameters.VirtualScreenTop) + 15;

            button.RenderTransform = buttonPos;

            BackPanel.Width = image.Width = this.Width = SystemParameters.VirtualScreenWidth;
            BackPanel.Height = image.Height = this.Height = SystemParameters.VirtualScreenHeight;

            selectionRectangle.MouseDown += image1_MouseLeftButtonDown;
            BackPanel.MouseDown += image1_MouseLeftButtonDown;
            image.MouseDown += image1_MouseLeftButtonDown;
            //-ugh fml
        }

        #region "Mouse events"
        private System.Windows.Point anchorPoint;

        private void image1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            anchorPoint.X = e.GetPosition(BackPanel).X;
            anchorPoint.Y = e.GetPosition(BackPanel).Y;

            image.MouseUp += image1_MouseLeftButtonUp;
            BackPanel.MouseUp += image1_MouseLeftButtonUp;
            selectionRectangle.MouseUp += image1_MouseLeftButtonUp;
            image.MouseMove += image1_MouseMove;
            BackPanel.MouseMove += image1_MouseMove;
            selectionRectangle.MouseMove += image1_MouseMove;
            BackPanel.MouseDown -= image1_MouseLeftButtonDown;
            image.MouseDown -= image1_MouseLeftButtonDown;
            selectionRectangle.MouseDown -= image1_MouseLeftButtonDown;
        }

        private void image1_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
        {
            double x = e.GetPosition(BackPanel).X;
            double y = e.GetPosition(BackPanel).Y;
            selectionRectangle.SetValue(Canvas.LeftProperty, Math.Min(x, anchorPoint.X));
            selectionRectangle.SetValue(Canvas.TopProperty, Math.Min(y, anchorPoint.Y));
            selectionRectangle.Width = Math.Abs(x - anchorPoint.X);
            selectionRectangle.Height = Math.Abs(y - anchorPoint.Y);

            selectionRectangle.Visibility = Visibility.Visible;
        }

        private void image1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            selectionRectangle.MouseUp -= image1_MouseLeftButtonUp;
            selectionRectangle.MouseMove -= image1_MouseMove;
            BackPanel.MouseUp -= image1_MouseLeftButtonUp;
            BackPanel.MouseMove -= image1_MouseMove;
            image.MouseUp -= image1_MouseLeftButtonUp;
            image.MouseMove -= image1_MouseMove;

            if (selectionRectangle.Width > 0)
            {
                this.Hide();
                Rect rect1 = new Rect(Canvas.GetLeft(selectionRectangle), Canvas.GetTop(selectionRectangle), selectionRectangle.Width, selectionRectangle.Height);
                Int32Rect rcFrom = new Int32Rect();
                rcFrom.X = (int)((rect1.X) * (image.Source.Width) / (image.Width));
                rcFrom.Y = (int)((rect1.Y) * (image.Source.Height) / (image.Height));
                rcFrom.Width = (int)((rect1.Width) * (image.Source.Width) / (image.Width));
                rcFrom.Height = (int)((rect1.Height) * (image.Source.Height) / (image.Height));
                BitmapSource bs = new CroppedBitmap(image.Source as BitmapSource, rcFrom);
                var PreScreenPath = "";
                using (MemoryStream outStream = new MemoryStream())
                {
                    BitmapEncoder enc = new BmpBitmapEncoder();
                    enc.Frames.Add(BitmapFrame.Create(bs));
                    enc.Save(outStream);
                    PreScreenPath = ScreenPath;
                    ScreenPath = ScreenPath.Replace("_pre", "");
                    new Bitmap(outStream).Save(ScreenPath, System.Drawing.Imaging.ImageFormat.Png);
                }

                ShowBalloon(OwnShotHelpers.UploadImage(ScreenPath));
                SetWindowStyle(true);
                selectionRectangle.Width = 0; //workaround

                if (OwnShotHelpers.GetConfig("DeleteMode") == "Yes")
                {
                    File.Delete(ScreenPath);
                    File.Delete(PreScreenPath);
                }
            }
            selectionRectangle.Visibility = Visibility.Visible;
        }

        #endregion
        private void button_Click(object sender, RoutedEventArgs e)
        {
            SetWindowStyle(true);
            selectionRectangle.MouseUp -= image1_MouseLeftButtonUp;
            selectionRectangle.MouseMove -= image1_MouseMove;
            BackPanel.MouseUp -= image1_MouseLeftButtonUp;
            BackPanel.MouseMove -= image1_MouseMove;
            image.MouseUp -= image1_MouseLeftButtonUp;
            image.MouseMove -= image1_MouseMove;
            selectionRectangle.Width = 0; //workaround

            if (OwnShotHelpers.GetConfig("DeleteMode") == "Yes")
            {
                File.Delete(ScreenPath);
            }
        }
    }
}


text:
"""
This file contains a Distancer object which computes and
caches the shortest path between any two points in the maze.

Example:
distancer = Distancer(gameState.data.layout)
distancer.getDistance( (1,1), (10,10) )
"""

import sys, time, random

class Distancer:
  def __init__(self, layout, default = 10000):
    """
    Initialize with Distancer(layout).  Changing default is unnecessary.
    """
    self._distances = None
    self.default = default
    self.dc = DistanceCalculator(layout, self, default)

  def getMazeDistances(self):
    self.dc.run()

  def getDistance(self, pos1, pos2):
    """
    The getDistance function is the only one you'll need after you create the object.
    """
    if self._distances == None:
      return manhattanDistance(pos1, pos2)
    if isInt(pos1) and isInt(pos2):
      return self.getDistanceOnGrid(pos1, pos2)
    pos1Grids = getGrids2D(pos1)
    pos2Grids = getGrids2D(pos2)
    bestDistance = self.default
    for pos1Snap, snap1Distance in pos1Grids:
      for pos2Snap, snap2Distance in pos2Grids:
        gridDistance = self.getDistanceOnGrid(pos1Snap, pos2Snap)
        distance = gridDistance + snap1Distance + snap2Distance
        if bestDistance > distance:
          bestDistance = distance
    return bestDistance

  def getDistanceOnGrid(self, pos1, pos2):
    key = (pos1, pos2)
    if key in self._distances:
      return self._distances[key]
    else:
      raise Exception("Positions not in grid: " + str(key))

  def isReadyForMazeDistance(self):
    return self._distances != None

def manhattanDistance(x, y ):
  return abs( x[0] - y[0] ) + abs( x[1] - y[1] )

def isInt(pos):
  x, y = pos
  return x == int(x) and y == int(y)

def getGrids2D(pos):
  grids = []
  for x, xDistance in getGrids1D(pos[0]):
    for y, yDistance in getGrids1D(pos[1]):
      grids.append(((x, y), xDistance + yDistance))
  return grids

def getGrids1D(x):
  intX = int(x)
  if x == int(x):
    return [(x, 0)]
  return [(intX, x-intX), (intX+1, intX+1-x)]

##########################################
# MACHINERY FOR COMPUTING MAZE DISTANCES #
##########################################

distanceMap = {}

class DistanceCalculator:
  def __init__(self, layout, distancer, default = 10000):
    self.layout = layout
    self.distancer = distancer
    self.default = default

  def run(self):
    global distanceMap

    if self.layout.walls not in distanceMap:
      distances = computeDistances(self.layout)
      distanceMap[self.layout.walls] = distances
    else:
      distances = distanceMap[self.layout.walls]

    self.distancer._distances = distances

def computeDistances(layout):
    "Runs UCS to all other positions from each position"
    distances = {}
    allNodes = layout.walls.asList(False)
    for source in allNodes:
        dist = {}
        closed = {}
        for node in allNodes:
            dist[node] = sys.maxsize
        import util
        queue = util.PriorityQueue()
        queue.push(source, 0)
        dist[source] = 0
        while not queue.isEmpty():
            node = queue.pop()
            if node in closed:
                continue
            closed[node] = True
            nodeDist = dist[node]
            adjacent = []
            x, y = node
            if not layout.isWall((x,y+1)):
                adjacent.append((x,y+1))
            if not layout.isWall((x,y-1)):
                adjacent.append((x,y-1) )
            if not layout.isWall((x+1,y)):
                adjacent.append((x+1,y) )
            if not layout.isWall((x-1,y)):
                adjacent.append((x-1,y))
            for other in adjacent:
                if not other in dist:
                    continue
                oldDist = dist[other]
                newDist = nodeDist+1
                if newDist < oldDist:
                    dist[other] = newDist
                    queue.push(other, newDist)
        for target in allNodes:
            distances[(target, source)] = dist[target]
    return distances

def getDistanceOnGrid(distances, pos1, pos2):
    key = (pos1, pos2)
    if key in distances:
      return distances[key]
    return 100000


text:
package io.druid.indexing.overlord.http;

import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.ListenableFuture;
import io.druid.indexing.common.TaskLocation;
import io.druid.indexing.common.TaskStatus;
import io.druid.indexing.common.TaskToolbox;
import io.druid.indexing.common.actions.TaskActionClient;
import io.druid.indexing.common.task.AbstractTask;
import io.druid.indexing.common.task.NoopTask;
import io.druid.indexing.common.task.Task;
import io.druid.indexing.overlord.TaskMaster;
import io.druid.indexing.overlord.TaskRunner;
import io.druid.indexing.overlord.TaskRunnerWorkItem;
import io.druid.indexing.overlord.TaskStorageQueryAdapter;
import io.druid.server.security.Access;
import io.druid.server.security.Action;
import io.druid.server.security.AuthConfig;
import io.druid.server.security.AuthenticationResult;
import io.druid.server.security.Authorizer;
import io.druid.server.security.AuthorizerMapper;
import io.druid.server.security.ForbiddenException;
import io.druid.server.security.Resource;
import org.easymock.EasyMock;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Response;
import java.util.Collection;
import java.util.List;

public class OverlordResourceTest
{
  private OverlordResource overlordResource;
  private TaskMaster taskMaster;
  private TaskStorageQueryAdapter tsqa;
  private HttpServletRequest req;
  private TaskRunner taskRunner;

  @Rule
  public ExpectedException expectedException = ExpectedException.none();

  @Before
  public void setUp() throws Exception
  {
    taskRunner = EasyMock.createMock(TaskRunner.class);
    taskMaster = EasyMock.createStrictMock(TaskMaster.class);
    tsqa = EasyMock.createStrictMock(TaskStorageQueryAdapter.class);
    req = EasyMock.createStrictMock(HttpServletRequest.class);

    EasyMock.expect(taskMaster.getTaskRunner()).andReturn(
        Optional.of(taskRunner)
    ).anyTimes();

    AuthorizerMapper authMapper = new AuthorizerMapper(null) {
      @Override
      public Authorizer getAuthorizer(String name)
      {
        return new Authorizer()
        {
          @Override
          public Access authorize(AuthenticationResult authenticationResult, Resource resource, Action action)
          {
            if (resource.getName().equals("allow")) {
              return new Access(true);
            } else {
              return new Access(false);
            }
          }

        };
      }
    };

    overlordResource = new OverlordResource(
        taskMaster,
        tsqa,
        null,
        null,
        null,
        authMapper
    );
  }

  public void expectAuthorizationTokenCheck()
  {
    AuthenticationResult authenticationResult = new AuthenticationResult("druid", "druid");

    EasyMock.expect(req.getAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED)).andReturn(null).anyTimes();
    EasyMock.expect(req.getAttribute(AuthConfig.DRUID_AUTHENTICATION_RESULT))
            .andReturn(authenticationResult)
            .anyTimes();

    req.setAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED, false);
    EasyMock.expectLastCall().anyTimes();

    req.setAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED, true);
    EasyMock.expectLastCall().anyTimes();
  }

  @Test
  public void testLeader()
  {
    EasyMock.expect(taskMaster.getCurrentLeader()).andReturn("boz").once();
    EasyMock.replay(taskRunner, taskMaster, tsqa, req);

    final Response response = overlordResource.getLeader();
    Assert.assertEquals("boz", response.getEntity());
    Assert.assertEquals(200, response.getStatus());
  }

  @Test
  public void testIsLeader()
  {
    EasyMock.expect(taskMaster.isLeader()).andReturn(true).once();
    EasyMock.expect(taskMaster.isLeader()).andReturn(false).once();
    EasyMock.replay(taskRunner, taskMaster, tsqa, req);

    // true
    final Response response1 = overlordResource.isLeader();
    Assert.assertEquals(ImmutableMap.of("leader", true), response1.getEntity());
    Assert.assertEquals(200, response1.getStatus());

    // false
    final Response response2 = overlordResource.isLeader();
    Assert.assertEquals(ImmutableMap.of("leader", false), response2.getEntity());
    Assert.assertEquals(404, response2.getStatus());
  }

  @Test
  public void testSecuredGetWaitingTask() throws Exception
  {
    expectAuthorizationTokenCheck();

    EasyMock.expect(tsqa.getActiveTasks()).andReturn(
        ImmutableList.of(
            getTaskWithIdAndDatasource("id_1", "allow"),
            getTaskWithIdAndDatasource("id_2", "allow"),
            getTaskWithIdAndDatasource("id_3", "deny"),
            getTaskWithIdAndDatasource("id_4", "deny")
        )
    ).once();

    EasyMock.<Collection<? extends TaskRunnerWorkItem>>expect(taskRunner.getKnownTasks()).andReturn(
        ImmutableList.of(
            new MockTaskRunnerWorkItem("id_1", null),
            new MockTaskRunnerWorkItem("id_4", null)
        )
    );

    EasyMock.replay(taskRunner, taskMaster, tsqa, req);

    List<OverlordResource.TaskResponseObject> responseObjects = (List) overlordResource.getWaitingTasks(req)
                                                                                .getEntity();
    Assert.assertEquals(1, responseObjects.size());
    Assert.assertEquals("id_2", responseObjects.get(0).toJson().get("id"));
  }

  @Test
  public void testSecuredGetCompleteTasks()
  {
    expectAuthorizationTokenCheck();

    List<String> tasksIds = ImmutableList.of("id_1", "id_2", "id_3");
    EasyMock.expect(tsqa.getRecentlyFinishedTaskStatuses()).andReturn(
        Lists.transform(
            tasksIds,
            new Function<String, TaskStatus>()
            {
              @Override
              public TaskStatus apply(String input)
              {
                return TaskStatus.success(input);
              }
            }
        )
    ).once();

    EasyMock.expect(tsqa.getTask(tasksIds.get(0))).andReturn(
        Optional.of(getTaskWithIdAndDatasource(tasksIds.get(0), "deny"))
    ).once();
    EasyMock.expect(tsqa.getTask(tasksIds.get(1))).andReturn(
        Optional.of(getTaskWithIdAndDatasource(tasksIds.get(1), "allow"))
    ).once();
    EasyMock.expect(tsqa.getTask(tasksIds.get(2))).andReturn(
        Optional.of(getTaskWithIdAndDatasource(tasksIds.get(2), "allow"))
    ).once();
    EasyMock.replay(taskRunner, taskMaster, tsqa, req);

    List<OverlordResource.TaskResponseObject> responseObjects = (List) overlordResource.getCompleteTasks(req)
                                                                                .getEntity();

    Assert.assertEquals(2, responseObjects.size());
    Assert.assertEquals(tasksIds.get(1), responseObjects.get(0).toJson().get("id"));
    Assert.assertEquals(tasksIds.get(2), responseObjects.get(1).toJson().get("id"));
  }

  @Test
  public void testSecuredGetRunningTasks()
  {
    expectAuthorizationTokenCheck();

    List<String> tasksIds = ImmutableList.of("id_1", "id_2");
    EasyMock.<Collection<? extends TaskRunnerWorkItem>>expect(taskRunner.getRunningTasks()).andReturn(
        ImmutableList.of(
            new MockTaskRunnerWorkItem(tasksIds.get(0), null),
            new MockTaskRunnerWorkItem(tasksIds.get(1), null)
        )
    );
    EasyMock.expect(tsqa.getTask(tasksIds.get(0))).andReturn(
        Optional.of(getTaskWithIdAndDatasource(tasksIds.get(0), "deny"))
    ).once();
    EasyMock.expect(tsqa.getTask(tasksIds.get(1))).andReturn(
        Optional.of(getTaskWithIdAndDatasource(tasksIds.get(1), "allow"))
    ).once();

    EasyMock.replay(taskRunner, taskMaster, tsqa, req);

    List<OverlordResource.TaskResponseObject> responseObjects = (List) overlordResource.getRunningTasks(req)
                                                                                .getEntity();

    Assert.assertEquals(1, responseObjects.size());
    Assert.assertEquals(tasksIds.get(1), responseObjects.get(0).toJson().get("id"));
  }

  @Test
  public void testSecuredTaskPost()
  {
    expectedException.expect(ForbiddenException.class);
    expectedException.expectMessage("Allowed:false, Message:");
    expectAuthorizationTokenCheck();

    EasyMock.replay(taskRunner, taskMaster, tsqa, req);
    Task task = NoopTask.create();
    overlordResource.taskPost(task, req);
  }

  @After
  public void tearDown()
  {
    EasyMock.verify(taskRunner, taskMaster, tsqa, req);
  }

  private Task getTaskWithIdAndDatasource(String id, String datasource)
  {
    return new AbstractTask(id, datasource, null)
    {
      @Override
      public String getType()
      {
        return null;
      }

      @Override
      public boolean isReady(TaskActionClient taskActionClient) throws Exception
      {
        return false;
      }

      @Override
      public TaskStatus run(TaskToolbox toolbox) throws Exception
      {
        return null;
      }
    };
  }

  private static class MockTaskRunnerWorkItem extends TaskRunnerWorkItem
  {
    public MockTaskRunnerWorkItem(
        String taskId,
        ListenableFuture<TaskStatus> result
    )
    {
      super(taskId, result);
    }

    @Override
    public TaskLocation getLocation()
    {
      return null;
    }
  }

}


text: a repo for adopting machine learning in combustion simulation


text:
namespace chrome_apps {
namespace api {

namespace {

typedef base::RepeatingCallback<bool(const void* bytes, size_t size)>
    IsValidMacAddressCallback;

class MacAddressProcessor {
 public:
  explicit MacAddressProcessor(IsValidMacAddressCallback is_valid_mac_address)
      : is_valid_mac_address_(std::move(is_valid_mac_address)),
        found_index_(ULONG_MAX) {}

  // Iterate through the interfaces, looking for the valid MAC address with the
  // lowest IfIndex.
  void ProcessAdapterAddress(PIP_ADAPTER_ADDRESSES address) {
    if (address->IfType == IF_TYPE_TUNNEL)
      return;

    ProcessPhysicalAddress(address->IfIndex, address->PhysicalAddress,
                           address->PhysicalAddressLength);
  }

  void ProcessInterfaceRow(const PMIB_IF_ROW2 row) {
    if (row->Type == IF_TYPE_TUNNEL ||
        !row->InterfaceAndOperStatusFlags.HardwareInterface) {
      return;
    }

    ProcessPhysicalAddress(row->InterfaceIndex, row->PhysicalAddress,
                           row->PhysicalAddressLength);
  }

  std::string mac_address() const { return found_mac_address_; }

 private:
  void ProcessPhysicalAddress(NET_IFINDEX index,
                              const void* bytes,
                              size_t size) {
    if (index >= found_index_ || size == 0)
      return;

    if (!is_valid_mac_address_.Run(bytes, size))
      return;

    found_mac_address_ = base::ToLowerASCII(base::HexEncode(bytes, size));
    found_index_ = index;
  }

  IsValidMacAddressCallback is_valid_mac_address_;
  std::string found_mac_address_;
  NET_IFINDEX found_index_;
};

std::string GetMacAddressFromGetAdaptersAddresses(
    IsValidMacAddressCallback is_valid_mac_address) {
  base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
                                                base::BlockingType::MAY_BLOCK);

  // MS recommends a default size of 15k.
  ULONG bufferSize = 15 * 1024;
  // Disable as much as we can, since all we want is MAC addresses.
  ULONG flags = GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_DNS_SERVER |
                GAA_FLAG_SKIP_FRIENDLY_NAME | GAA_FLAG_SKIP_MULTICAST |
                GAA_FLAG_SKIP_UNICAST;
  std::vector<unsigned char> buffer(bufferSize);
  PIP_ADAPTER_ADDRESSES adapterAddresses =
      reinterpret_cast<PIP_ADAPTER_ADDRESSES>(&buffer.front());

  DWORD result =
      GetAdaptersAddresses(AF_UNSPEC, flags, 0, adapterAddresses, &bufferSize);
  if (result == ERROR_BUFFER_OVERFLOW) {
    buffer.resize(bufferSize);
    adapterAddresses = reinterpret_cast<PIP_ADAPTER_ADDRESSES>(&buffer.front());
    result = GetAdaptersAddresses(AF_UNSPEC, flags, 0, adapterAddresses,
                                  &bufferSize);
  }

  if (result != NO_ERROR) {
    LOG(ERROR) << "GetAdapatersAddresses failed with error " << result;
    return "";
  }

  MacAddressProcessor processor(std::move(is_valid_mac_address));
  for (; adapterAddresses != NULL; adapterAddresses = adapterAddresses->Next) {
    processor.ProcessAdapterAddress(adapterAddresses);
  }
  return processor.mac_address();
}

std::string GetMacAddressFromGetIfTable2(
    IsValidMacAddressCallback is_valid_mac_address) {
  base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
                                                base::BlockingType::MAY_BLOCK);

  // This is available on Vista+ only.
  base::ScopedNativeLibrary library(base::FilePath(L"Iphlpapi.dll"));

  typedef DWORD(NETIOAPI_API_ * GetIfTablePtr)(PMIB_IF_TABLE2*);
  typedef void(NETIOAPI_API_ * FreeMibTablePtr)(PMIB_IF_TABLE2);

  GetIfTablePtr getIfTable = reinterpret_cast<GetIfTablePtr>(
      library.GetFunctionPointer("GetIfTable2"));
  FreeMibTablePtr freeMibTablePtr = reinterpret_cast<FreeMibTablePtr>(
      library.GetFunctionPointer("FreeMibTable"));
  if (getIfTable == NULL || freeMibTablePtr == NULL) {
    LOG(ERROR) << "Could not get proc addresses for machine identifier.";
    return "";
  }

  PMIB_IF_TABLE2 ifTable = NULL;
  DWORD result = getIfTable(&ifTable);
  if (result != NO_ERROR || ifTable == NULL) {
    LOG(ERROR) << "GetIfTable failed with error " << result;
    return "";
  }

  MacAddressProcessor processor(std::move(is_valid_mac_address));
  for (size_t i = 0; i < ifTable->NumEntries; i++) {
    processor.ProcessInterfaceRow(&(ifTable->Table[i]));
  }

  if (ifTable != NULL) {
    freeMibTablePtr(ifTable);
    ifTable = NULL;
  }
  return processor.mac_address();
}

void GetMacAddress(IsValidMacAddressCallback is_valid_mac_address,
                   DeviceId::IdCallback callback) {
  std::string mac_address =
      GetMacAddressFromGetAdaptersAddresses(is_valid_mac_address);
  if (mac_address.empty())
    mac_address = GetMacAddressFromGetIfTable2(is_valid_mac_address);

  static bool error_logged = false;
  if (mac_address.empty() && !error_logged) {
    error_logged = true;
    LOG(ERROR) << "Could not find appropriate MAC address.";
  }

  content::GetUIThreadTaskRunner({})->PostTask(
      FROM_HERE, base::BindOnce(std::move(callback), mac_address));
}

std::string GetRlzMachineId() {
#if BUILDFLAG(ENABLE_RLZ) || defined(VIVALDI_BUILD)
  std::string machine_id;
  if (!rlz_lib::GetMachineId(&machine_id))
    return std::string();
  return machine_id;
#else
  return std::string();
#endif
}

void GetMacAddressCallback(DeviceId::IdCallback callback,
                           const std::string& mac_address) {
  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);

  std::string machine_id = GetRlzMachineId();
  if (mac_address.empty() || machine_id.empty()) {
    std::move(callback).Run("");
    return;
  }
  std::move(callback).Run(mac_address + machine_id);
}

}  // namespace

// static
void DeviceId::GetRawDeviceId(IdCallback callback) {
  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);

  base::ThreadPool::PostTask(
      FROM_HERE, traits(),
      base::BindOnce(
          &GetMacAddress, base::BindRepeating(&DeviceId::IsValidMacAddress),
          base::BindOnce(&GetMacAddressCallback, std::move(callback))));
}

}  // namespace api
}  // namespace chrome_apps


text:
const env = process.env.NODE_ENV;

export default (server) => {
  if (env === 'development') {
    // Calls mocking
    // server.route(callList(mocker));
    // server.route(callDetails(mocker));
    // Partners mocking
    // server.route(partnerList(mocker));
    // server.route(partnerDetails(mocker));
  }
};


text:
package org.dontexist.kb.swing;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.util.Optional;
import java.util.concurrent.CountDownLatch;

/**
 * Modeled after {@link org.dontexist.kb.swing.TextEditor}, but only displays non-editable text.
 */
public class TextDisplayer extends JFrame {

    private static final Logger LOGGER = LoggerFactory.getLogger(TextDisplayer.class);

    private static final String DEFAULT_TEXT_AREA_TEXT = "";
    private static final int DEFAULT_WINDOW_HEIGHT = 30;
    private static final int DEFAULT_WINDOW_WIDTH = 70;
    private static final Optional<CountDownLatch> NO_OUTSIDE_LISTENER = Optional.<CountDownLatch>empty();
    private final String textFrameText;

    private JTextArea textArea;

    public TextDisplayer() {
        this.textFrameText = DEFAULT_TEXT_AREA_TEXT;
        init(NO_OUTSIDE_LISTENER);
    }

    public TextDisplayer(final String windowTitle, final String textFrameText) {
        super(windowTitle);
        this.textFrameText = textFrameText;
        init(NO_OUTSIDE_LISTENER);
    }

    public TextDisplayer(final String windowTitle, final String textFrameText, final CountDownLatch outsideListener) {
        super(windowTitle);
        this.textFrameText = textFrameText;
        init(Optional.of(outsideListener));
    }

    private void init(final Optional<CountDownLatch> optionalOutsideListener) {
        textArea = new JTextArea(textFrameText, DEFAULT_WINDOW_HEIGHT, DEFAULT_WINDOW_WIDTH);
        add(new JScrollPane(textArea));
        add(new JPanel() {{
            final JButton button = new JButton(new AbstractAction("Continue") {

                @Override
                public void actionPerformed(ActionEvent arg0) {
                    optionalOutsideListener.ifPresent(l -> l.countDown());
                }
            });

            add(button);
        }}, BorderLayout.SOUTH);
    }

    /**
     * Create the GUI and show it.  For thread safety, this method should be invoked from the event dispatch thread.
     */
    private static void createAndShowGui(final TextDisplayer frame) {
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationByPlatform(true);
        frame.setVisible(true);
        frame.toFront();
    }

    public static void main(String[] args) {
        displayFrame(new TextDisplayer());

    }

    public static void displayFrame(final TextDisplayer textEditor) {
        //Schedule a job for the event dispatch thread:
        //creating and showing this application's GUI.
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGui(textEditor);
            }
        });
    }

    public void closeFrame() {
        dispose();
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="false">
    <item android:drawable="@drawable/round_spinner_fade_00" android:duration="100"/>
    <item android:drawable="@drawable/round_spinner_fade_01" android:duration="100"/>
    <item android:drawable="@drawable/round_spinner_fade_02" android:duration="100"/>
    <item android:drawable="@drawable/round_spinner_fade_03" android:duration="100"/>
    <item android:drawable="@drawable/round_spinner_fade_04" android:duration="100"/>
    <item android:drawable="@drawable/round_spinner_fade_05" android:duration="100"/>
    <item android:drawable="@drawable/round_spinner_fade_06" android:duration="100"/>
    <item android:drawable="@drawable/round_spinner_fade_07" android:duration="100"/>

</animation-list>


text:
function centroid = polygonCentroid3d(varargin)
%POLYGONCENTROID3D Centroid (or center of mass) of a polygon
%
%   PTC = polygonCentroid3d(POLY)
%   Computes center of mass of a polygon defined by POLY. POLY is a N-by-3
%   array of double containing coordinates of polygon vertices.
%
%   PTC = polygonCentroid3d(VX, VY, VZ)
%   Specifies vertex coordinates as three separate arrays.
%
%   Example
%     % compute centroid of a basic polygon
%     poly = [0 0 0; 10 0 10;10 10 20;0 10 10];
%     centro = polygonCentroid3d(poly)
%     centro =
%         5.0000    5.0000    10.0000
%
%   See also
%   polygons3d, polygonArea3d, polygonCentroid
%
% ------
% Author: David Legland
% e-mail: david.legland@grignon.inra.fr
% Created: 2007-09-18
% Copyright 2007 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas).

if nargin==1
    % polygon is given as a single argument
    pts = varargin{1};

elseif nargin==2
    % polygon is given as 3 corodinate arrays
    px = varargin{1};
    py = varargin{2};
    pz = varargin{3};
    pts = [px py pz];
end

% create supporting plane (assuming first 3 points are not colinear...)
plane = createPlane(pts(1:3, :));

% project points onto the plane
pts = planePosition(pts, plane);

% compute centroid in 2D
centro2d = polygonCentroid(pts);

% project back in 3D
centroid = planePoint(plane, centro2d);


text:
if ls --color >/dev/null 2>&1; then # GNU `ls`
  colorflag="--color"
else # OS X `ls`
  colorflag="-G"
fi

# Always use color output for `ls`
if [[ "$OSTYPE" =~ ^darwin ]]; then
  alias ls="command ls -G"
else
  alias ls="command ls --color"
  export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
fi

alias -- -="cd -"
alias .....="cd ../../../.."
alias ....="cd ../../.."
alias ...="cd ../.."
alias ..="cd .."
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias be="bundle exec"
alias bye="exit"
alias c='pygmentize -O style=monokai -f console256 -g' # `cat` with beautiful colors. requires Pygments installed (sudo easy_install Pygments).
alias cd..="cd .."
alias cleanup="find . -name '*.DS_Store' -type f -ls -delete" # Recursively delete `.DS_Store` files
alias current_date='date +%F\ %R'
alias debug='cat > /tmp/debug.html&&w3m /tmp/debug.html'
alias doctest='python -m doctest'
alias ducks="du -cks *|sort -rn | head"
alias e="$EDITOR"
alias fastping='ping -c 100 -s.2'
alias ff='find . -iname'
alias fs="stat -f \"%z bytes\"" # File size
alias g="git"
alias gaa="git add -A"
alias gb="git branch"
alias gca="git add --all && git commit --amend --no-edit"
alias gcal=gcalcli
alias gco="git checkout"
alias gf="git fetch --all -p"
alias git-things-in-develop="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative master..develop --no-merges"
alias gpl="git pull --rebase --autostash"
alias gpnv='git push --no-verify'
alias gp="git push"
alias gpsf="git push --force"
alias gr='[ ! -z `git rev-parse --show-cdup` ] && cd `git rev-parse --show-cdup || pwd`' # git root
alias gs='git status -sb'
alias hl='hamster list'
alias home='cd ~ && clear'
alias hosts='sudo $EDITOR /etc/hosts' # yes I occasionally 127.0.0.1 twitter.com ;)
alias hsa='hamster start'
alias hso='hamster stop'
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\"" # View HTTP traffic
alias ip_solver="dig +short myip.opendns.com @resolver1.opendns.com"
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
alias irssi='TERM=screen-256color irssi'
alias ks='tmux kill-session'
alias l="ls -l ${colorflag}"   # List all files colorized in long format
alias la="ls -la ${colorflag}" # List all files colorized in long format, including dot files
alias lsd='ls -l | grep "^d"'  # List only directories
alias maild="sudo python -c 'import smtpd, asyncore; smtpd.DebuggingServer((\"127.0.0.1\", 25), None); asyncore.loop()'"
alias map="xargs -n1"
alias mirror-update="sudo reflector --latest 200 --protocol https --sort rate --save /etc/pacman.d/mirrorlist"
alias music=ncmpcpp
alias mux="tmuxinator"
alias nf='neofetch --ascii ~/.neofetch --ascii_colors 18 25 39'
alias nis="npm install --save"
alias now='date +"%T"'
alias nowtime=now
alias nowdate='date +"%d-%m-%Y"'
alias o="gio open"
alias path='echo -e ${PATH//:/\\n}'
alias pcat='pygmentize -O bg=dark'
alias please=sudo                          # be nice
alias plistbuddy="/usr/libexec/PlistBuddy" # PlistBuddy alias, because sometimes `defaults` just doesn't cut it
alias ports='netstat -tulanp'
alias pt=papertrail
alias public_ip="curl ifconfig.me"
alias rot13='tr a-zA-Z n-za-mN-ZA-M' # ROT13-encode text. Works for decoding, too! ;)
alias s="subl3"
alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'" # View HTTP traffic
alias t='tmux a||tmux new-s'
alias tailf="tail -f"
alias trimcopy="tr -d '\n' | pbcopy" # Trim new lines and copy to clipboard
alias v=$VIM
alias vh='vagrant halt'
alias vi=$VIM
alias vim=$VIM
alias vs='vagrant ssh'
alias vsus='vagrant suspend'
alias vu='vagrant up'
alias whois="whois -h whois-servers.net" # Enhanced WHOIS lookups
alias zr='source ~/.zshrc'
alias ~="cd ~" # `cd` is probably faster to type though
if [[ "$OSTYPE" == "linux-gnu" ]]; then alias open=xdg-open; fi
if [ -x "$(command -v thefuck)" ]; then alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R'; fi

## pass options to free ##
alias meminfo='free -m -l -t'
function mem_per_proccess() {
  ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | cut -d "" -f2 | cut -d "-" -f1
}

## get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'

## get top process eating cpu ##
alias pscpu='ps auxf | sort -nr -k 3'
alias pscpu10='ps auxf | sort -nr -k 3 | head -10'

## Get server cpu info ##
alias cpuinfo='lscpu'

## older system use /proc/cpuinfo ##
##alias cpuinfo='less /proc/cpuinfo' ##

## get GPU ram on desktop / laptop##
alias gpumeminfo='grep -i --color memory /var/log/Xorg.0.log'

# OS Upgrade aliases
if [[ ! -e "/etc/os-release" ]]; then
  echo "No os-release"
else
  distribution=$(cat /etc/os-release | grep "ID=" | cut -f2 -d"=")

  case "$distribution" in
  arch*)
    alias os-cleanup='sudo pacman -Rcns $(pacman -Qdtq); sudo pacman -Sc --noconfirm; sudo yay -Sc --noconfirm; sudo rm /var/lib/systemd/coredump/*; sudo journalctl --vacuum-size=1M; sudo rm -r /var/cache/pacman/pkg/*' # Cleans automatically installed deps
    alias os-upgrade='sudo pacman -Syuu; yay -Syyua --noconfirm; flatpak update;'
    alias pacman-disowned-dirs="comm -23 <(sudo find / \( -path '/dev' -o -path '/sys' -o -path '/run' -o -path '/tmp' -o -path '/mnt' -o -path '/srv' -o -path '/proc' -o -path '/boot' -o -path '/home' -o -path '/root' -o -path '/media' -o -path '/var/lib/pacman' -o -path '/var/cache/pacman' \) -prune -o -type d -print | sed 's/\([^/]\)$/\1\//' | sort -u ) <(pacman -Qlq | sort -u)" # Show dirs that don't belong to any package
    alias pacman-disowned-files="comm -23 <(sudo find / \( -path '/dev' -o -path '/sys' -o -path '/run' -o -path '/tmp' -o -path '/mnt' -o -path '/srv' -o -path '/proc' -o -path '/boot' -o -path '/home' -o -path '/root' -o -path '/media' -o -path '/var/lib/pacman' -o -path '/var/cache/pacman' \) -prune -o -type f -print | sort -u ) <(pacman -Qlq | sort -u)"                          # Show files that don't belong to any package:
    ;;
  ubuntu)
    alias os-cleanup='sudo apt-get autoremove; sudo apt-get clean'
    alias os-upgrade='sudo apt-get update; sudo apt-get dist-upgrade'
    ;;
  *)
    echo "No os-release compatible"
    ;;
  esac
fi

# One of @janmoesen's ProTip™s
for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
  alias "$method"="lwp-request -m '$method'"
done

alias restartshell="exec $SHELL -l"
alias pullandmerge="git checkout $1; git pull --rebase; git merge --no-ff $2"

# Utils
alias k='kill -9'
alias i.='(idea $PWD &>/dev/null &)'
alias c.='(code $PWD &>/dev/null &)'
alias o.='open .'
alias up='dot package update_all'


text:
require 'travis/features'

module Travis
  class Task
    class Irc
      class Template
        include Build::Messages

        attr_reader :template, :data

        def initialize(template, data)
          @template = template
          @data = data
        end

        def interpolate
          template.gsub(/%{(#{args.keys.join('|')}|.*)}/) { args[$1.to_sym] }
        end

        def args
          @args ||= {
            :repository     => data['repository']['slug'],
            :build_number   => data['build']['number'].to_s,
            :branch         => data['commit']['branch'],
            :commit         => data['commit']['sha'][0..6],
            :author         => data['commit']['author_name'],
            :commit_message => data['commit']['message'],
            :message        => message,
            :compare_url    => compare_url,
            :build_url      => build_url
          }
        end

        def message
          RESULT_MESSAGE_SENTENCES[result_key(data['build'])]
        end

        def compare_url
          url = data['commit']['compare_url']
          short_urls? ? shorten_url(url) : url
        end

        def build_url
          url = "http://#{Travis.config.host}/#{data['repository']['slug']}/builds/#{data['build']['id']}"
          short_urls? ? shorten_url(url) : url
        end

        private

          def short_urls?
            # TODO Travis::Features wants full models, should probaly change that
            repository = Repository.find(data['repository']['id'])
            Travis::Features.active?(:short_urls, repository)
          end

          def shorten_url(url)
            Url.shorten(url).short_url
          end
      end
    end
  end
end


text:
cask "tibco-jaspersoft-studio" do
  version "6.20.0"
  sha256 "3025aaa6b5bf74f689f75eae5dbe119ee5cf11cad3bdb2661bbfda6c02d38dfe"

  url "https://downloads.sourceforge.net/jasperstudio/JaspersoftStudio-#{version}/TIB_js-studiocomm_#{version}_macosx_x86_64.dmg",
      verified: "sourceforge.net/jasperstudio/"
  name "TIBCO Jaspersoft Studio"
  desc "Eclipse-based report development tool for JasperReports"
  homepage "https://community.jaspersoft.com/project/jaspersoft-studio"

  livecheck do
    url "https://community.jaspersoft.com/project/jaspersoft-studio/releases"
    regex(/TIB[._-]js[._-]studiocomm[._-]v?(\d+(?:\.\d+)+)[._-]macosx[._-]x86[._-]64\.dmg/i)
  end

  auto_updates true

  app "TIBCO Jaspersoft Studio #{version}.app"

  zap trash: [
    "~/JaspersoftWorkspace",
    "~/Library/Application Support/Jaspersoft Studio",
    "~/Library/Preferences/com.jaspersoft.studio.plist",
    "~/Library/Preferences/com.jaspersoft.studio.rcp.product.plist",
    "~/Library/Saved Application State/com.jaspersoft.studio.rcp.product.savedState",
  ]
end


text:
package resources

import (
	"testing"

	"github.com/google/go-cmp/cmp"
)

func TestGetLabelSelector(t *testing.T) {
	want := "events.cloud.google.com/channel=controller,events.cloud.google.com/channel-name=source,events.cloud.google.com/controller-uid=UID"
	got := GetLabelSelector("controller", "source", "UID").String()

	if diff := cmp.Diff(want, got); diff != "" {
		t.Errorf("unexpected (-want, +got) = %v", diff)
	}
}

func TestGetLabels(t *testing.T) {
	want := map[string]string{
		"events.cloud.google.com/channel":        "controller",
		"events.cloud.google.com/channel-name":   "channel",
		"events.cloud.google.com/controller-uid": "UID",
	}
	got := GetLabels("controller", "channel", "UID")

	if diff := cmp.Diff(want, got); diff != "" {
		t.Errorf("unexpected (-want, +got) = %v", diff)
	}
}

func TestGetPullSubscriptionLabelSelector(t *testing.T) {
	want := "events.cloud.google.com/channel=controller,events.cloud.google.com/channel-name=source,events.cloud.google.com/channel-subscriber=subscriber,events.cloud.google.com/controller-uid=UID"
	got := GetPullSubscriptionLabelSelector("controller", "source", "subscriber", "UID").String()

	if diff := cmp.Diff(want, got); diff != "" {
		t.Errorf("unexpected (-want, +got) = %v", diff)
	}
}

func TestGetPullSubscriptionLabels(t *testing.T) {
	want := map[string]string{
		"events.cloud.google.com/channel":            "controller",
		"events.cloud.google.com/channel-name":       "channel",
		"events.cloud.google.com/channel-subscriber": "subscriber",
		"events.cloud.google.com/controller-uid":     "UID",
	}
	got := GetPullSubscriptionLabels("controller", "channel", "subscriber", "UID")

	if diff := cmp.Diff(want, got); diff != "" {
		t.Errorf("unexpected (-want, +got) = %v", diff)
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<meta name="generator" content="JDiff v1.1.0">

<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
Field Differences Index
</TITLE>
<link href="../../../../assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../stylesheet-jdiff.css" rel="stylesheet" type="text/css" />

    Filter the Index:

Fields

Removals

Additions

Changes

Listed as: Added,  Removed,  Changed

A
B
C
D
E
F
G
I
L
M
N
O
P
Q
R
S
T
U
V
W
 TOP

<nobr>ACCESSIBILITY_ENABLED
</nobr>

<nobr>ACCESSIBILITY_SERVICE
</nobr>

<nobr>ACTION_BATTERY_OKAY
</nobr>

<nobr>ACTION_POWER_CONNECTED
</nobr>

<nobr>ACTION_POWER_DISCONNECTED
</nobr>

<nobr>ACTION_POWER_USAGE_SUMMARY
</nobr>

<nobr>ACTION_SEND_MULTIPLE
</nobr>

<nobr>ACTION_SHUTDOWN
</nobr>

<nobr>ADD_SYSTEM_SERVICE
</nobr>

<nobr>allowBackup
</nobr>

<nobr>anticipate_interpolator
</nobr>

<nobr>anticipate_overshoot_interpolator
</nobr>

<nobr>anyDensity
</nobr>

<nobr>autoUrlDetect
</nobr>

B
A
C
D
E
F
G
I
L
M
N
O
P
Q
R
S
T
U
V
W
 TOP

<nobr>backupAgent
</nobr>

<nobr>bounce_interpolator
</nobr>

C
A
B
D
E
F
G
I
L
M
N
O
P
Q
R
S
T
U
V
W
 TOP

<nobr>CHANGE_WIFI_MULTICAST_STATE
</nobr>

<nobr>CODENAME
</nobr>

<nobr>CONFIG_SCREEN_LAYOUT
</nobr>

<nobr>contentDescription
</nobr>

<nobr>CONTEXT_RESTRICTED
</nobr>

<nobr>CPU_ABI
</nobr>

D
A
B
C
E
F
G
I
L
M
N
O
P
Q
R
S
T
U
V
W
 TOP

<nobr>DATA_ACTIVITY_DORMANT
</nobr>

DEFAULT_SORT_ORDER

<nobr> in
android.provider.MediaStore.Audio.Genres.Members
</nobr>

<nobr> in
android.provider.MediaStore.Audio.Media
</nobr>

<nobr>density
</nobr>

DENSITY_DEFAULT

<nobr> in
android.util.DisplayMetrics
</nobr>

<nobr> in
android.util.TypedValue
</nobr>

<nobr>DENSITY_HIGH
</nobr>

<nobr>DENSITY_LOW
</nobr>

<nobr>DENSITY_MEDIUM
</nobr>

DENSITY_NONE

<nobr> in
android.graphics.Bitmap
</nobr>

<nobr> in
android.util.TypedValue
</nobr>

<nobr>densityDpi
</nobr>

<nobr>dropDownHeight
</nobr>

E
A
B
C
D
F
G
I
L
M
N
O
P
Q
R
S
T
U
V
W
 TOP

<nobr>ENABLED_ACCESSIBILITY_SERVICES
</nobr>

<nobr>encodedMessage
</nobr>

<nobr>encodedScAddress
</nobr>

<nobr>ENCODING_16BIT
</nobr>

<nobr>ENCODING_7BIT
</nobr>

<nobr>ENCODING_8BIT
</nobr>

<nobr>ENCODING_UNKNOWN
</nobr>

<nobr>eventsInterceptionEnabled
</nobr>

<nobr>EXTRA_DATA_KEY
</nobr>

<nobr>extraTension
</nobr>

F
A
B
C
D
E
G
I
L
M
N
O
P
Q
R
S
T
U
V
W
 TOP

<nobr>fadeDuration
</nobr>

<nobr>fadeEnabled
</nobr>

<nobr>fadeOffset
</nobr>

<nobr>FILL_IN_PACKAGE
</nobr>

<nobr>FLAG_RESIZEABLE_FOR_SCREENS
</nobr>

<nobr>FLAG_SUPPORTS_LARGE_SCREENS
</nobr>

<nobr>FLAG_SUPPORTS_NORMAL_SCREENS
</nobr>

<nobr>FLAG_SUPPORTS_SCREEN_DENSITIES
</nobr>

<nobr>FLAG_SUPPORTS_SMALL_SCREENS
</nobr>

<nobr>FLAG_TEST_ONLY
</nobr>

<nobr>FLAG_UPDATED_SYSTEM_APP
</nobr>

<nobr>FOCUSABLES_ALL
</nobr>

<nobr>FOCUSABLES_TOUCH_MODE
</nobr>

<nobr>FORWARD_LOCK_PACKAGE
</nobr>

<nobr>FOTA_UPDATE
</nobr>

G
A
B
C
D
E
F
I
L
M
N
O
P
Q
R
S
T
U
V
W
 TOP

<nobr>gestureColor
</nobr>

<nobr>gestureStrokeAngleThreshold
</nobr>

<nobr>gestureStrokeLengthThreshold
</nobr>

<nobr>gestureStrokeSquarenessThreshold
</nobr>

<nobr>gestureStrokeType
</nobr>

<nobr>gestureStrokeWidth
</nobr>

<nobr>GL_ES_VERSION_UNDEFINED
</nobr>

<nobr>glEsVersion
</nobr>

<nobr>GLOBAL_SEARCH
</nobr>

I
A
B
C
D
E
F
G
L
M
N
O
P
Q
R
S
T
U
V
W
 TOP

<nobr>includeInGlobalSearch
</nobr>

<nobr>inDensity
</nobr>

<nobr>inInputShareable
</nobr>

<nobr>inPurgeable
</nobr>

<nobr>inScaled
</nobr>

<nobr>inScreenDensity
</nobr>

<nobr>INSTALL_FAILED_ALREADY_EXISTS
</nobr>

<nobr>INSTALL_FAILED_CONFLICTING_PROVIDER
</nobr>

<nobr>INSTALL_FAILED_DEXOPT
</nobr>

<nobr>INSTALL_FAILED_DUPLICATE_PACKAGE
</nobr>

<nobr>INSTALL_FAILED_INSUFFICIENT_STORAGE
</nobr>

<nobr>INSTALL_FAILED_INVALID_APK
</nobr>

<nobr>INSTALL_FAILED_INVALID_URI
</nobr>

<nobr>INSTALL_FAILED_MISSING_SHARED_LIBRARY
</nobr>

<nobr>INSTALL_FAILED_NO_SHARED_USER
</nobr>

<nobr>INSTALL_FAILED_OLDER_SDK
</nobr>

<nobr>INSTALL_FAILED_REPLACE_COULDNT_DELETE
</nobr>

<nobr>INSTALL_FAILED_SHARED_USER_INCOMPATIBLE
</nobr>

<nobr>INSTALL_FAILED_UPDATE_INCOMPATIBLE
</nobr>

<nobr>INSTALL_LOCATION_PROVIDER
</nobr>

<nobr>INSTALL_PARSE_FAILED_BAD_MANIFEST
</nobr>

<nobr>INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME
</nobr>

<nobr>INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID
</nobr>

<nobr>INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING
</nobr>

<nobr>INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES
</nobr>

<nobr>INSTALL_PARSE_FAILED_MANIFEST_EMPTY
</nobr>

<nobr>INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
</nobr>

<nobr>INSTALL_PARSE_FAILED_NO_CERTIFICATES
</nobr>

<nobr>INSTALL_PARSE_FAILED_NOT_APK
</nobr>

<nobr>INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION
</nobr>

<nobr>INSTALL_SUCCEEDED
</nobr>

<nobr>inTargetDensity
</nobr>

<nobr>INTENT_ACTION_SEARCH_SETTINGS_CHANGED
</nobr>

<nobr>INTENT_ACTION_SEARCHABLES_CHANGED
</nobr>

<nobr>INTENT_ACTION_WEB_SEARCH_SETTINGS
</nobr>

L
A
B
C
D
E
F
G
I
M
N
O
P
Q
R
S
T
U
V
W
 TOP

<nobr>largeScreens
</nobr>

<nobr>LIGHT_NO_MOON
</nobr>

<nobr>linear_interpolator
</nobr>

<nobr>LOGD
</nobr>

<nobr>LOGV
</nobr>

M
A
B
C
D
E
F
G
I
L
N
O
P
Q
R
S
T
U
V
W
 TOP

<nobr>MANUFACTURER
</nobr>

<nobr>MAX_USER_DATA_BYTES
</nobr>

<nobr>MAX_USER_DATA_SEPTETS
</nobr>

<nobr>MAX_USER_DATA_SEPTETS_WITH_HEADER
</nobr>

<nobr>maxSdkVersion
</nobr>

N
A
B
C
D
E
F
G
I
L
M
O
P
Q
R
S
T
U
V
W
 TOP

<nobr>NETWORK_TYPE_1xRTT
</nobr>

<nobr>NETWORK_TYPE_CDMA
</nobr>

<nobr>NETWORK_TYPE_EVDO_0
</nobr>

<nobr>NETWORK_TYPE_EVDO_A
</nobr>

<nobr>normalScreens
</nobr>

O
A
B
C
D
E
F
G
I
L
M
N
P
Q
R
S
T
U
V
W
 TOP

<nobr>onClick
</nobr>

<nobr>overshoot_interpolator
</nobr>

P
A
B
C
D
E
F
G
I
L
M
N
O
Q
R
S
T
U
V
W
 TOP

<nobr>pathPermissions
</nobr>

<nobr>PHONE_TYPE_CDMA
</nobr>

<nobr>PROFILE
</nobr>

<nobr>progressBarStyleInverse
</nobr>

<nobr>progressBarStyleLargeInverse
</nobr>

<nobr>progressBarStyleSmallInverse
</nobr>

Q
A
B
C
D
E
F
G
I
L
M
N
O
P
R
S
T
U
V
W
 TOP

<nobr>queryAfterZeroResults
</nobr>

R
A
B
C
D
E
F
G
I
L
M
N
O
P
Q
S
T
U
V
W
 TOP

<nobr>READ_HISTORY_BOOKMARKS
</nobr>

<nobr>RELEASE
</nobr>

<nobr>REPLACE_EXISTING_PACKAGE
</nobr>

<nobr>reqGlEsVersion
</nobr>

<nobr>resizeable
</nobr>

<nobr>resolveInfo
</nobr>

<nobr>RESULT_ERROR_GENERIC_FAILURE
</nobr>

<nobr>RESULT_ERROR_NO_SERVICE
</nobr>

<nobr>RESULT_ERROR_NULL_PDU
</nobr>

<nobr>RESULT_ERROR_RADIO_OFF
</nobr>

S
A
B
C
D
E
F
G
I
L
M
N
O
P
Q
R
T
U
V
W
 TOP

<nobr>screenLayout
</nobr>

<nobr>SCREENLAYOUT_LONG_MASK
</nobr>

<nobr>SCREENLAYOUT_LONG_NO
</nobr>

<nobr>SCREENLAYOUT_LONG_UNDEFINED
</nobr>

<nobr>SCREENLAYOUT_LONG_YES
</nobr>

<nobr>SCREENLAYOUT_SIZE_LARGE
</nobr>

<nobr>SCREENLAYOUT_SIZE_MASK
</nobr>

<nobr>SCREENLAYOUT_SIZE_NORMAL
</nobr>

<nobr>SCREENLAYOUT_SIZE_SMALL
</nobr>

<nobr>SCREENLAYOUT_SIZE_UNDEFINED
</nobr>

<nobr>SDK
</nobr>

<nobr>SDK_INT
</nobr>

<nobr>searchSettingsDescription
</nobr>

<nobr>searchSuggestThreshold
</nobr>

<nobr>SET_PROCESS_FOREGROUND
</nobr>

<nobr>SHORTCUT_MIME_TYPE
</nobr>

<nobr>SHOW_WEB_SUGGESTIONS
</nobr>

<nobr>smallScreens
</nobr>

<nobr>stat_sys_vp_phone_call
</nobr>

<nobr>stat_sys_vp_phone_call_on_hold
</nobr>

<nobr>STATUS_ON_SIM_FREE
</nobr>

<nobr>STATUS_ON_SIM_READ
</nobr>

<nobr>STATUS_ON_SIM_SENT
</nobr>

<nobr>STATUS_ON_SIM_UNREAD
</nobr>

<nobr>STATUS_ON_SIM_UNSENT
</nobr>

<nobr>STORAGE
</nobr>

<nobr>SUGGEST_COLUMN_INTENT_EXTRA_DATA
</nobr>

<nobr>SUGGEST_COLUMN_SHORTCUT_ID
</nobr>

<nobr>SUGGEST_COLUMN_SPINNER_WHILE_REFRESHING
</nobr>

<nobr>SUGGEST_NEVER_MAKE_SHORTCUT
</nobr>

<nobr>SUGGEST_URI_PATH_SHORTCUT
</nobr>

<nobr>SURACE_FROZEN
</nobr>

<nobr>SURFACE_FROZEN
</nobr>

T
A
B
C
D
E
F
G
I
L
M
N
O
P
Q
R
S
U
V
W
 TOP

targetSdkVersion

<nobr> in
android.R.attr
</nobr>

<nobr> in
android.content.pm.ApplicationInfo
</nobr>

<nobr>tension
</nobr>

<nobr>testOnly
</nobr>

<nobr>textColorPrimaryInverseDisableOnly
</nobr>

<nobr>TONE_CDMA_ABBR_ALERT
</nobr>

<nobr>TONE_CDMA_ABBR_INTERCEPT
</nobr>

<nobr>TONE_CDMA_ABBR_REORDER
</nobr>

<nobr>TONE_CDMA_ALERT_AUTOREDIAL_LITE
</nobr>

<nobr>TONE_CDMA_ALERT_CALL_GUARD
</nobr>

<nobr>TONE_CDMA_ALERT_INCALL_LITE
</nobr>

<nobr>TONE_CDMA_ALERT_NETWORK_LITE
</nobr>

<nobr>TONE_CDMA_ANSWER
</nobr>

<nobr>TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP
</nobr>

<nobr>TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL
</nobr>

<nobr>TONE_CDMA_CALL_SIGNAL_ISDN_PAT3
</nobr>

<nobr>TONE_CDMA_CALL_SIGNAL_ISDN_PAT5
</nobr>

<nobr>TONE_CDMA_CALL_SIGNAL_ISDN_PAT6
</nobr>

<nobr>TONE_CDMA_CALL_SIGNAL_ISDN_PAT7
</nobr>

<nobr>TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING
</nobr>

<nobr>TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI
</nobr>

<nobr>TONE_CDMA_CALLDROP_LITE
</nobr>

<nobr>TONE_CDMA_CONFIRM
</nobr>

<nobr>TONE_CDMA_DIAL_TONE_LITE
</nobr>

<nobr>TONE_CDMA_EMERGENCY_RINGBACK
</nobr>

<nobr>TONE_CDMA_HIGH_L
</nobr>

<nobr>TONE_CDMA_HIGH_PBX_L
</nobr>

<nobr>TONE_CDMA_HIGH_PBX_S_X4
</nobr>

<nobr>TONE_CDMA_HIGH_PBX_SLS
</nobr>

<nobr>TONE_CDMA_HIGH_PBX_SS
</nobr>

<nobr>TONE_CDMA_HIGH_PBX_SSL
</nobr>

<nobr>TONE_CDMA_HIGH_S_X4
</nobr>

<nobr>TONE_CDMA_HIGH_SLS
</nobr>

<nobr>TONE_CDMA_HIGH_SS
</nobr>

<nobr>TONE_CDMA_HIGH_SS_2
</nobr>

<nobr>TONE_CDMA_HIGH_SSL
</nobr>

<nobr>TONE_CDMA_INTERCEPT
</nobr>

<nobr>TONE_CDMA_KEYPAD_VOLUME_KEY_LITE
</nobr>

<nobr>TONE_CDMA_LOW_L
</nobr>

<nobr>TONE_CDMA_LOW_PBX_L
</nobr>

<nobr>TONE_CDMA_LOW_PBX_S_X4
</nobr>

<nobr>TONE_CDMA_LOW_PBX_SLS
</nobr>

<nobr>TONE_CDMA_LOW_PBX_SS
</nobr>

<nobr>TONE_CDMA_LOW_PBX_SSL
</nobr>

<nobr>TONE_CDMA_LOW_S_X4
</nobr>

<nobr>TONE_CDMA_LOW_SLS
</nobr>

<nobr>TONE_CDMA_LOW_SS
</nobr>

<nobr>TONE_CDMA_LOW_SS_2
</nobr>

<nobr>TONE_CDMA_LOW_SSL
</nobr>

<nobr>TONE_CDMA_MED_L
</nobr>

<nobr>TONE_CDMA_MED_PBX_L
</nobr>

<nobr>TONE_CDMA_MED_PBX_S_X4
</nobr>

<nobr>TONE_CDMA_MED_PBX_SLS
</nobr>

<nobr>TONE_CDMA_MED_PBX_SS
</nobr>

<nobr>TONE_CDMA_MED_PBX_SSL
</nobr>

<nobr>TONE_CDMA_MED_S_X4
</nobr>

<nobr>TONE_CDMA_MED_SLS
</nobr>

<nobr>TONE_CDMA_MED_SS
</nobr>

<nobr>TONE_CDMA_MED_SS_2
</nobr>

<nobr>TONE_CDMA_MED_SSL
</nobr>

<nobr>TONE_CDMA_NETWORK_BUSY
</nobr>

<nobr>TONE_CDMA_NETWORK_BUSY_ONE_SHOT
</nobr>

<nobr>TONE_CDMA_NETWORK_CALLWAITING
</nobr>

<nobr>TONE_CDMA_NETWORK_USA_RINGBACK
</nobr>

<nobr>TONE_CDMA_ONE_MIN_BEEP
</nobr>

<nobr>TONE_CDMA_PIP
</nobr>

<nobr>TONE_CDMA_PRESSHOLDKEY_LITE
</nobr>

<nobr>TONE_CDMA_REORDER
</nobr>

<nobr>TONE_CDMA_SIGNAL_OFF
</nobr>

<nobr>TONE_CDMA_SOFT_ERROR_LITE
</nobr>

<nobr>TONE_SUP_CONFIRM
</nobr>

<nobr>TONE_SUP_CONGESTION_ABBREV
</nobr>

<nobr>TONE_SUP_INTERCEPT
</nobr>

<nobr>TONE_SUP_INTERCEPT_ABBREV
</nobr>

<nobr>TONE_SUP_PIP
</nobr>

<nobr>TTS_DEFAULT_COUNTRY
</nobr>

<nobr>TTS_DEFAULT_LANG
</nobr>

<nobr>TTS_DEFAULT_PITCH
</nobr>

<nobr>TTS_DEFAULT_RATE
</nobr>

<nobr>TTS_DEFAULT_SYNTH
</nobr>

<nobr>TTS_DEFAULT_VARIANT
</nobr>

<nobr>TTS_USE_DEFAULTS
</nobr>

U
A
B
C
D
E
F
G
I
L
M
N
O
P
Q
R
S
T
V
W
 TOP

<nobr>uncertainGestureColor
</nobr>

<nobr>URI_INTENT_SCHEME
</nobr>

<nobr>USER_QUERY
</nobr>

V
A
B
C
D
E
F
G
I
L
M
N
O
P
Q
R
S
T
U
W
 TOP

<nobr>VOICE_CALL
</nobr>

<nobr>VOICE_DOWNLINK
</nobr>

<nobr>VOICE_UPLINK
</nobr>

W
A
B
C
D
E
F
G
I
L
M
N
O
P
Q
R
S
T
U
V
 TOP

<nobr>Widget_ProgressBar_Inverse
</nobr>

<nobr>Widget_ProgressBar_Large_Inverse
</nobr>

<nobr>Widget_ProgressBar_Small_Inverse
</nobr>

<nobr>WRITE_EXTERNAL_STORAGE
</nobr>

<nobr>WRITE_HISTORY_BOOKMARKS
</nobr>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <parent>
        <artifactId>resteasy-jaxrs-all</artifactId>
        <groupId>org.jboss.resteasy</groupId>
        <version>3.0.5.Final</version>
        <relativePath>../../../../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.jboss.resteasy.example.oauth</groupId>
    <artifactId>product-portal-example</artifactId>
    <packaging>war</packaging>
    <name>Simple Example Secure Application via Valve</name>
    <description/>

    <repositories>
        <repository>
            <id>jboss</id>
            <name>jboss repo</name>
            <url>http://repository.jboss.org/nexus/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-client</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>skeleton-key-core</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>product-portal</finalName>
        <plugins>
            <plugin>
                <groupId>org.jboss.as.plugins</groupId>
                <artifactId>jboss-as-maven-plugin</artifactId>
                <version>7.4.Final</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>