A database connection is a measure of the number of devices that are using your app's database simultaneously. This isn't the same as the total number of users of your app or visitors to your site. It's any open network connection to our database servers, including streaming REST API requests. All our plans have a hard limit on the number of database connections. Our Free and Prototype plans are limited to 100 .So did with launch plan to 500. The limit cannot be raised. The Unlimited plans have a courtesy limit of 10,000 database connections. This can be removed to permanently allow Unlimited connections if you email us at<EMAIL_ADDRESS>. The reason we impose this courtesy limit is to prevent abuse and to ensure that we are prepared to handle our largest customers. Please contact us at least 24 hours in advance so we can lift this limit and ensure we have enough capacity available for your needs.
We also help the world’s leading companies and startups build amazing websites, apps and services that are simple, beautiful and easy to use.


WITNESS LIST Economic Development Committee May 17, 1999-8:45A SB 538 For: Aslakson, Jill (Texas Medical Association) Rothstein, Mark A. (Self)


This website template has been designed by Free Website Templates for you, for free. You can replace all this text with your own text. You can remove any link to our website from this website template, you're free to use this website template without linking back to us. If you're having problems editing this website template, then don't hesitate to ask for help on the Forums.
Read MoreDonec odio nunc, consectetur fringilla tincidunt nec, cursus vitae ipsum. Read More
Donec odio nunc, consectetur fringilla tincidunt nec, cursus vitae ipsum. Read More
Donec odio nunc, consectetur fringilla tincidunt nec, cursus vitae ipsum. Read More


|
Your device is currently not configured with a password. This password will be used for both the
access point and for root login (must be between 8 and 63 characters long.) Please be aware that
if 'Caps Lock' is "on", the letters of your password will be capitalized.
A root password must be set to enable SSH access to the device via wireless. Once set, it can be changed at a later time by running configure_edison --password on the command line.
|
|


This is one of the outer islands of Palau and lies some 350 miles SW of the main island. It is a National Park and just 4 people live there.
This classic desert island is just 8 feet above sea level and is covered in trees. It is surrounded by a reef.
Position 2°52.48'N, 131°43.13'E.
This is NOT a Port of Entry and official clearance into Palau cannot be made here, but the rangers on the island welcome a call from passing yachts.
They can be contacted via VHF radio but with only handheld sets, their range is limited.
Last updated June 2011.
There is a pass through the reef and the rangers can advise on an anchorage with good holding in 15m.


\closing{text}
The letter closes with a \closing command, where the mandatory argument, text is the desired text, for example:
\closing{Sincerely yours,}
The signature will be taken from the \signature declaration.
See Letters
Return to the LaTeX Table of Contents


News
- HW 5 is out, due Sun 6/11
Logic Programming
Traditional Languages
Program = Algorithm + Data Structures
Execute
Prolog
Program = Facts + Rules
Query
Logic Programming
Prolog History
1970s: Logic + Automated Theorem Proving
Developed for Artificial Intelligence
Prolog : Original Vision “Expert Systems”
Collection of Facts
- Carnitas is Mexican isMexican(carnitas)
Collection of Rules
- Mexican food is delicious if isMexican(X) then isDelicious(X)
Queries
- What is a delicious food ? hey! solve for Y. s.t. isDelicious(Y)
Deductions
- Carnitas!
You don’t RUN Prolog, you ASK it QUESTIONS
Declarative Programming
Specify what you want
Specify desired properties of result
Not how to obtain result
Declarative: Ideal for SEARCHING For Results
Declarative Programming
Ideal for Searching Large Space of Results
Philosophy
It is often hard to specify search algorithm
But easy to specify the characteristics of the solution.
Declarative Programming Examples…
Declarative Programming: Orbitz/Expedia/etc.
Collection of Facts
- Airports, Flights, Times, Durations, Costs
Collection of Rules
- If travel from
A
toB
with price (P1
) ANDB
toC
with price (P2
)…
Then
- travel from
A
toC
with price (P1 + P2
) …
Queries
- What is cheapest flight from SAN to JFK with duration < 6 Hrs ?
Declarative Programming: Linear Programming
Collection of Facts
- El Cuervo makes CA Burrito (profit =
$2
), Fish Taco (profit =$1
)
Collection of Rules
- Burrito Capacity <
200
- Taco Capacity <
400
- Total Capacity <
300
Query: How many burritos and tacos to maximize profit?
max 2.burr + 1.taco /* profit */
s.t. burr < 200 /* burrito capacity */
taco < 400 /* taco capacity */
burr+taco < 300 /* total capacity */
0 <= burr
0 <= taco /* must produce! */
Declarative Programming
Used heavily in many domains (together with statistical methods)
- Scheduling
Travel, Sports, …
- Rule-based Anomaly detection
Credit card fraud!
- SQL (and similar DB Query Languages)
- Find all pairs of stocks, with same price on same day,
More than 50 times last year
Many of these are inspired-by / subsets of Prolog …
Prolog: New Way To Think About Programming …
Prolog: … Programming As Proving!
Plan
Language
- Terms
- Facts
- Queries (Implementation: Unification)
- Rules
- Programs (Implementation: Backtracking Search)
Programming
- Numeric Computation
- Data Structures
- Puzzle Solving
Language: Terms
Prolog Program
- Facts
- Rules
… but facts and rules about what ?
- Terms
Terms are Prolog’s way of representing Data
“Tree-like” values, similar to Ocaml ADTs
Four Kinds of Terms
Constants
Atoms
Variables
Compound Terms
Prolog Terms: Constants
Constants the simplest term, representing primitive values
Basic types like integers, reals
Examples:
1
,92
,4.4
Prolog Terms: Atoms
Atom: any identifier starting with lower-case
x
,alice
,taco
,giraffe
,appleSauce
Atoms are NOT variables
Prolog Terms: Atoms
Atom: any identifier starting with lower-case
x
,alice
,taco
,giraffe
,appleSauce
Atoms are not variables
Elements of a single mega enum type
Similar to tags used in ML types (except ML tags are uppercase)
type atoms = x | alice | taco | giraffe | appleSauce | ...
Prolog Terms: Atoms
Atom: any identifier starting with lower-case
x
,alice
,taco
,giraffe
,appleSauce
Atoms are Uninterpreted Constants (Names)
Prolog knows NOTHING about the tags, they are just names
- Each tag is equal to itself (more later…)
alice = alice
taco = taco
- Each tag is disequal to every other tag
alice = taco
never holds in Prolog
Prolog Terms: Variables
Variables: any identifier starting with upper-case
X
,Y
,Z
,Head
,Tail
,Taco
,Burrito
,Alice
,Bob
_
is the wildcard variable, similar toML
Variables are quite special …
Even though
x = a
makes no sense to Prolog ……
X = a
does have a meaning but not what you might think!
Warning: Upper vs. Lowercase leads to errors
Prolog Terms: Compound Terms
Compound terms are of form atom(term1, term2, term3, ...)
Where each term
is one-of
- constant
- atom
- variable
- compound term
Prolog Terms: Compound Terms
Compound terms are of form atom(term1, term2, term3, ...)
Where each term
is one-of
- constant
- atom
- variable
- compound term
Examples
x(y, z) % y, z are atoms
parent(alice, bob) % alice, bob are atoms
parent(alice, Child) % alice is an atom, Child is a variable
Prolog Terms ARE NOT function calls
Prolog Compound Terms
Terms are NOT Function Calls!
More like trees
Prolog Terms: Compound Terms
Compound terms are of form atom(term1, term2, term3, ...)
Each term
is one-of
- constant
- atom
- variable
- compound term
An Ocaml Type For Prolog Terms
type term
= Constant of int
| Atom of string
| Variable of string
| Compound of string * term list
QUIZ: An Ocaml Type For Prolog Terms
type term
= Constant of int
| Atom of string
| Variable of string
| Compound of string * term list
(Hint: atom = lowercase, variable = uppercase)
Which Ocaml value of type term
represents Prolog term
parent(alice, bob)
?
A. parent ("alice", "bob")
B. parent (Atom "alice", Atom "bob")
C. [Atom "parent"; Atom "alice"; Atom "bob"]
D. Compound ("parent", [Atom "alice"; Atom "bob"])
E. Compound (Atom "parent", [Atom "alice"; Atom "bob"])
Prolog Compound Terms
Prolog term parent(alice, Charlie)
is represented by:
Ocaml Value
Compound ("parent", [Atom "alice"; Var "Charlie"])
Tree
QUIZ: An Ocaml Type For Prolog Terms
type term
= Constant of int
| Atom of string
| Variable of string
| Compound of string * term list
(Hint: atom = lowercase, variable = uppercase)
What Ocaml value of type term
represents Prolog term factorial(5)
?
A. factorial(5)
B. factorial(Atom 5)
C. 120
D. Constant 120
E. Compound ("factorial", [Constant 5])
Prolog Terms
Prolog term factorial(5)
is simply the tree
- The term is just a box containing
5
labeledfactorial
Function Symbols
factorial
just a label called a function symbolProlog has no idea about implementation of function …
Prolog Terms = (Tree) Structured Data
Plan
Language
- Terms
- Facts
- Queries (Implementation: Unification)
- Rules
- Programs (Implementation: Backtracking Search)
Programming
- Numeric Computation
- Data Structures
- Puzzle Solving
Language: Facts
Language: Facts
Example
The following facts specify a list of parent-child relationships
parent(kim, holly).
parent(margaret, kim).
parent(herbert, margaret).
parent(john, kim).
parent(felix, john).
parent(albert, felix).
Note
kim
,holly
,margaret
etc. are all atomsFacts are just terms (typically without variables.)
Specified by term followed by
.
Prolog maintains a Database of facts
You can make up and add new facts to the collection
We will be able to ask Prolog queries over these facts
Predicates = Function Symbols Used For Facts
Represent functions that evaluate to a boolean
e.g.
parent
is a predicate of arity 2 (that takes 2 arguments)
Predicates Are Just Names: No Meaning Or Implementation
parent
is a predicate of arity 2 (that takes two arguments)- Programmer mentally notes that:
parent(kim, holly)
meanskim
is a “parent-of”holly
parent(margaret, kim)
meansmargaret
is a “parent-of”kim
- etc.
Plan
Language
- Terms
- Facts
- Queries (Implementation: Unification)
- Rules
- Programs (Implementation: Backtracking Search)
Programming
- Numeric Computation
- Data Structures
- Puzzle Solving
Running Prolog via Queries
Language: Queries
Standard interface is a REPL shell
$ rlwrap swipl
130f@ieng6-202]:~:501$ swipl
Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 5.10.5)
Copyright (c) 1990-2011 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
?-
Language: Queries
Suppose we have a collection of facts saved in lec-prolog.pl
You can load the facts in …
?- consult('lec-prolog.pl').
% foo.pl compiled 0.00 sec, 10,640 bytes
true.
… or you can add them one-at-a-time
?- assert(parent(margaret, kim)).
Language: Queries
Once facts are loaded, you query Prolog as follows:
Plg: Prompts you to type a query
You: Type a query
Plg: Tries to prove your query
Plg: Prints out the result (or
failure
)Repeat (go to 1)
Lets ask some questions!
Language: Queries
The simplest possible query …
?- parent(margaret, john).
… a fact but typed at the prompt.
Language: Queries
The simplest possible query …
?- parent(margaret, john).
… a fact but typed at the prompt.
Meaning
O Prolog, is this fact in your Database … or can it be inferred from your database?
Language: Queries
The simplest possible query …
?- parent(margaret, john).
… a fact but typed at the prompt.
Meaning
O Prolog, is this fact in your database … or can it be inferred from your database?
Prolog Replies
?- parent(margaret, john).
false.
- This is not one of the facts we gave it, and,
- We are yet to supply it with rules for inferring new facts.
Language: Queries
A slightly different query yields a different result.
Language: Queries
A slightly different query yields a different result.
?- parent(margaret, kim).
true.
- As this was indeed one of the facts loaded in lec-prolog
Pfft. Big deal? Is Prolog just a table lookup?!
Things get more interesting when queries have variables …
Queries With Variables
This is where Prolog starts to depart radically from other paradigms…
?- parent(margaret, X).
Meaning
O Prolog, for which value(s) of X
is the fact provable ?
Queries With Variables
This is where Prolog starts to depart radically from other paradigms…
?- parent(margaret, X).
Meaning
O Prolog, for which value(s) of X
is the fact provable ?
Prolog Replies
X = kim.
As when prolog plugs-in kim
for X
,
- It can infer
parent(margaret, kim)
.
Queries With Variables
Suppose we flip the query.
?- parent(X, kim).
O Prolog, for which value(s) of X
is parent(X, kim)
provable ?
Queries With Variables
Suppose we flip the query.
?- parent(X, kim).
O Prolog, who are the parents-of kim
?
Queries With Variables
Suppose we flip the query.
?- parent(X, kim).
O Prolog, who are the parents-of kim
?
Prolog Replies
?- parent(X, kim).
X = margaret ; % [press ';' if you want another solution]
X = john ; % [press ';' if you want another solution]
false. % [thats all folks, no more solutions ]
Returns all solutions for X
that make parent(X, kim)
provable.
Queries With Variables
We can write queries with multiple variables.
?- parent(X, Y).
O Prolog, for which pairs X
, Y
is parent(X, Y)
provable?
Queries With Variables
We can write queries with multiple variables.
?- parent(X, Y).
O Prolog, for which pairs X
, Y
is parent(X, Y)
provable?
Prolog Replies
?- parent(X, Y).
X = kim, Y = holly ;
X = margaret, Y = kim ;
X = herbert, Y = margaret;
X = john, Y = kim ;
X = felix, Y = john ;
X = albert, Y = felix ;
X = albert, Y = dana ;
X = felix, Y = maya .
Enumerates all facts in the parent
database.
QUIZ: Queries With Variables
Suppose we want to know if there are any strange circularities in the database:
Does there exist any person who is their own parent ?
Which of the following encodes the above in Prolog?
A. parent(kim, kim)
B. parent(x, x)
C. parent(X, X)
D. parent(X, Y)
E. parent(Y, X)
Queries are magic!
Queries Work Like Magic
In Java/C# or for that matter ML/Scala/… you would need
- Some
parentOf
orchildOf
methods- to represent parent-child relationship
- Some looping or iteration
- to search through all pairs
- Instead, Prolog uses facts and queries
- to search forwards and backwards
- to enumerate all results
- in a single uniform declarative manner!
Magic = Unification + Backtracking Search
Plan
Language
- Terms
- Facts
- Queries (Implementation: Unification)
- Rules
- Programs (Implementation: Backtracking Search)
Programming
- Numeric Computation
- Data Structures
- Puzzle Solving
Unification: Prolog’s computational heart
Unification: When does one term MATCH another?
Unification
Two Terms Can Be Unified If
We can substitute values for their variables to make the terms identical
Unification
Two terms can be unified if we can substitute values for variables to make the terms identical
Equality Is Unification
In Prolog, when you write (e.g. in a query)
?- term1 = term2.
you are asking whether term1
can be unified with term2
.
Unification By Example
Unification: Atoms
Two terms can be unified if we can substitute values for variables to make the terms identical
Example
?- kim = kim.
true.
Two same atoms are trivially unified.
Unification: Atoms
Two terms can be unified if we can substitute values for variables to make the terms identical
Example
?- kim = holly.
false.
Two different atoms can never be unified.
Unification: Compound Terms Are Recursively Unified
Two terms can be unified if we can substitute values for variables to make the terms identical
Example
?- foo(kim) = foo(kim).
true.
As there are no variables, and the terms are already identical.
Example
?- foo(kim) = foo(holly).
false.
As there are no variables, and the terms can never be identical.
Unification: Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
Example
?- X = kim.
Q: When is the term
X
identical to the termkim
?A: When we substitute
X
with the valuekim
!
Unification: Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
Example
?- foo(X) = foo(kim).
Q: When is the term
X
identical to the termkim
?A: When we substitute
X
with the valuekim
!
Prolog Responds
?- foo(X) = foo(kim).
X = kim.
- Pretty simple…
QUIZ: Unification With Multiple Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
How does Prolog respond to the following query?
?- foo(X, dog) = foo(cat, Y).
A. false
B. X = cat, Y = cat.
C. X = dog, Y = dog.
D. X = dog, Y = cat.
E. X = cat, Y = dog.
Unification With Multiple Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
?- p(X, dog, X) = p(cat, Y, Y).
Unification With Multiple Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
?- p(X, dog, X) = p(cat, Y, Y).
The top nodes of both trees have same predicate … go inside.
Unification With Multiple Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
?- p(X, dog, X) = p(cat, Y, Y).
To unify X
and cat
use substitution X = cat
Unification With Multiple Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
?- p(X, dog, X) = p(cat, Y, Y).
Apply substitution X = cat
to both terms. Move on to next leaf…
Unification With Multiple Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
?- p(X, dog, X) = p(cat, Y, Y).
To unify dog
and Y
use substitution Y = dog
…
Unification With Multiple Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
?- p(X, dog, X) = p(cat, Y, Y).
… and apply substitution throughout both terms.
Unification With Multiple Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
?- p(X, dog, X) = p(cat, Y, Y).
Uh oh, now last leaf has different atoms…
Unification With Multiple Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
?- p(X, dog, X) = p(cat, Y, Y).
… impossible to unify cat
and dog
. Unification fails.
Unification With Multiple Variables
Two terms can be unified if we can substitute values for variables to make the terms identical
?- p(X, dog, X) = p(cat, Y, Y).
false.
QUIZ: Recursively Unify Subtrees
Two terms can be unified if we can substitute values for variables to make the terms identical
How does Prolog respond to the following unification query?
?- a(W, foo(W, Y), Y) = a(2, foo(X, 3), Z).
A. false.
(No unification possible)
B. W = 2, X = 2, Y = 2, Z = 2.
C. W = 2, X = 2, Y = 3, Z = 3.
D. W = 3, X = 3, Y = 2, Z = 2.
C. W = 2, X = 3, Y = 2, Z = 3.
Recursively Unify Subtrees
Two terms can be unified if we can substitute values for variables to make the terms identical
How does Prolog respond to the following unification query?
?- a(W, foo(W, Y), Y) = a(2, foo(X, 3), Z).
Subst
W = 2
. Query is:a(2, foo(2, Y), Y) = a(2, foo(X, 3), Z).
Subst
X = 2
. Query is:a(2, foo(2, Y), Y) = a(2, foo(2, 3), Z).
Subst
Y = 3
. Query is:a(2, foo(2, 3), 3) = a(2, foo(2, 3), Z).
Subst
Z = 3
. Query is:a(2, foo(2, 3), 3) = a(2, foo(2, 3), 3).
Done!
Recursively Unify Subtrees
Two terms can be unified if we can substitute values for variables to make the terms identical
How does Prolog respond to the following unification query?
?- a(W, foo(W, Y), Y) = a(2, foo(X, 3), Z).
W = 2,
X = 2,
Y = 3,
Z = 3.
QUIZ: Recursively Unify Subtrees
Two terms can be unified if we can substitute values for variables to make the terms identical
How does Prolog respond to the following unification query?
?- a(W, foo(W, Y), Y) = a(2, foo(X, 3), X).
A. false.
(No unification possible)
B. W = 2, X = 2, Y = 2, Z = 2.
C. W = 2, X = 2, Y = 3, Z = 3.
D. W = 3, X = 3, Y = 2, Z = 2.
E. W = 2, X = 3, Y = 2, Z = 3.
Recursively Unify Subtrees
Two terms can be unified if we can substitute values for variables to make the terms identical
How does Prolog respond to the following unification query?
?- a(W, foo(W, Y), Y) = a(2, foo(X, 3), X).
Subst
W = 2
. Query is:a(2, foo(2, Y), Y) = a(2, foo(X, 3), X).
Subst
X = 2
. Query is:a(2, foo(2, Y), Y) = a(2, foo(2, 3), 2).
Subst
Y = 3
. Query is:a(2, foo(2, 3), 3) = a(2, foo(2, 3), 2).
3 = 2
cannot be unified, Fail!
Unification: Powerful Way To Answer Queries
Unification is a Powerful Way To Answer Queries
When we ask
?- parent(margaret, X).
Prolog checks if the above term can be unified with any known fact (term).
- If unification succeeds then it replies
true
- And also the unifying substitutions for
X
- Which are the solutions for the query!
- And also the unifying substitutions for
- If unification fails then it replies
false
Unification is a Powerful Way To Answer Queries
When we ask
?- parent(margaret, X).
Prolog checks if the above term can be unified with any known fact (term).
- If unification succeeds then it replies
true
(and the solutions forX
) - If unification fails then it replies
false
Above Query Has One Solution
?- parent(margaret, X).
X = kim.
Unification is a Powerful Way To Answer Queries
When we ask
?- parent(X, kim).
Unification is a Powerful Way To Answer Queries
When we ask
?- parent(X, kim).
Prolog checks if the above term can be unified with any known fact (term).
- If unification succeeds then it replies
true
(and the solutions forX
) - If unification fails then it replies
false
Unification is a Powerful Way To Answer Queries
When we ask
?- parent(X, kim).
Prolog checks if the above term can be unified with any known fact (term).
- If unification succeeds then it replies
true
(and the solutions forX
) - If unification fails then it replies
false
This Query Has Many Solutions
?- parent(X, kim).
X = margaret ;
X = john .
Unification is a Powerful Way To Answer Queries
Finally, when we ask
?- parent(X, Y).
Unification is a Powerful Way To Answer Queries
Finally, when we ask
?- parent(X, Y).
Prolog checks if the above term can be unified with any known fact (term).
- If unification succeeds it replies
true
(and solutions forX
,Y
) - If unification fails it replies
false
Unification is a Powerful Way To Answer Queries
Finally, when we ask
?- parent(X, Y).
Prolog checks if the above term can be unified with any known fact (term).
- If unification succeeds it replies
true
(and solutions forX
,Y
)
This Query Has Many Solutions: All known facts
?- parent(X, Y).
X = kim, Y = holly ;
X = margaret, Y = kim ;
X = herbert, Y = margaret;
X = john, Y = kim ;
X = felix, Y = john ;
X = albert, Y = felix ;
X = albert, Y = dana ;
X = felix, Y = maya .
Unification Lets Prolog Answer Queries Magically!
Plan
Language
- Terms
- Facts
- Queries (Implementation: Unification)
- Rules
- Programs (Implementation: Backtracking Search)
Programming
- Numeric Computation
- Data Structures
- Puzzle Solving
Rules
Digression: Conjunctions, Queries about MANY terms
Conjunction: Comma-separated Sequence of terms
Often useful to ask questions over multiple terms.
- For example, to determine if
margaret
is the grandparent ofholly
Conjunction: Comma-separated Sequence of terms
Often useful to ask questions over multiple terms.
- For example, to determine if
margaret
is the grandparent ofholly
?- parent(margaret, X), parent(X, holly).
Is there a person
X
who is a child ofmargaret
AND a parent ofholly
?Is there
X
s.t.parent(margaret, X)
ANDparent(X, holly)
?
Conjunction: Comma-separated Sequence of terms
Often useful to ask questions over multiple terms.
- For example, to determine if
margaret
is the grandparent ofholly
?- parent(margaret, X), parent(X, holly).
Is there a person
X
who is a child ofmargaret
AND a parent ofholly
?Is there
X
s.t.parent(margaret, X)
ANDparent(X, holly)
?
Apparently
?- parent(margaret, X), parent(X, holly).
X = kim.
Conjunction: Comma-separated Sequence of terms
Often useful to ask questions over multiple terms.
- For example, to find the great-grandparents of
kim
Conjunction: Comma-separated Sequence of terms
Often useful to ask questions over multiple terms.
- For example, to find the great-grandparents of
kim
?- parent(GGP, GP), parent(GP, P), parent(P, kim).
Note: how we link the terms with a variable to capture relationships.
Conjunction: Comma-separated Sequence of terms
Often useful to ask questions over multiple terms.
- For example, to find the great-grandparents of
kim
?- parent(GGP, GP), parent(GP, P), parent(P, kim).
Note: how we link the terms with a variable to capture relationships.
Prolog finds appropriate unifiers and replies
?- parent(margaret, X), parent(X, holly).
GGP = john,
GP = felix,
P = albert.
i.e. john
is a great-grandparent following the above chain.
QUIZ: Conjunctions
Which of these queries is true iff margaret
and kim
are (half-) siblings?
A. parent(margaret, kim)
B. parent(margaret, X), parent(X, kim).
C. parent(kim, X), parent(X, margaret).
D. parent(margaret, X), parent(kim, X).
E. parent(X, margaret), parent(X, kim).
Recap: Conjunctions
Conjunctions let us mine the database for complex relationships…
… but its cumbersome to repeatedly write down long queries
We need a way to compose complex queries from simple queries…
Rules
Rules: Complex Predicates from Simple Queries
Format
headQuery :- condQuery1, condQuery2, condQuery3,...
Rules: Complex Predicates from Simple Queries
Format
headQuery :- condQuery1, condQuery2, condQuery3,...
Intuition 1 (Forwards)
If you can prove
condQuery1
ANDcondQuery2
AND...
Then you can prove
headQuery
Rules: Complex Predicates from Simple Queries
Format
headQuery :- condQuery1, condQuery2, condQuery3,...
Intuition 2 (Backwards)
To prove the goal
headQuery
…Prove subgoals
condQuery1
ANDcondQuery2
AND …
Rules: Complex Predicates from Simple Queries
An Example: Defining a grandparent
predicate
Our database includes a
parent
predicateLet us use it to define a
grandparent
predicate
Rules: Complex Predicates from Simple Queries
An Example: Defining a grandparent
predicate
grandparent(GP, GC) :- parent(GP, P), parent(P, GC).
Intuition
GP
is a grandparent of GC
if GP
is a parent of P
and P
is a parent of GC
Rules: Complex Predicates from Simple Queries
An Example: Defining a grandparent
predicate
grandparent(GP, GC) :- parent(GP, P), parent(P, GC).
Querying The Defined Predicate
?- grandparent(X, kim). % who are the grandparents of kim
X = herbert ; % hit ; to see next
X = felix ; % hit ; to see next
false. % thats it!
Rules: Complex Predicates from Simple Queries
An Example: Defining a grandparent
predicate
grandparent(GP, GC) :- parent(GP, P), parent(P, GC).
Querying The Defined Predicate
?- grandparent(X, kim). % who are the grandparents of kim
X = herbert ; % hit ; to see next
X = felix ; % hit ; to see next
false. % thats it!
How? Because Prolog can prove
?- parent(herbert, P), parent(P, kim). %% Solution 1. X = herbert
P = margaret.
?- parent(felix, P), parent(P, kim). %% Solution 2. X = felix
P = john .
QUIZ: Complex Predicates from Simple Queries
Which of the following is a valid greatgrandparent
predicate?
(Btw, greatgrandparent is the parent of a grandparent.)
bob -> sachin -> krishna -> ranjit
% A
greatgrandparent(X, Y) :- parent(X, Y), grandparent(X, Y).
% B
greatgrandparent(X, Y) :- parent(X, Z), grandparent(Z, Y).
% C
greatgrandparent(X, Y) :- grandparent(X, Z), parent(Z, Y).
% D
greatgrandparent(X, Y) :- parent(X, Z), parent(Z, Y).
% E
greatgrandparent(X, Y) :- parent(X, Z), parent(Z, Z1), parent(Z1, Y).
anc(albert,DESC) parent(albert, felix) ==> anc(felix, DESC) parent(albert, dana) ==> anc(dana, DESC)
anc(X, Y) :- anc(Z1, Y), parent(X, Z1).
anc(albert,DESC) anc(Z1, DESC) anc(Z1’, DESC) anc(Z1’‘, DESC) anc(Z1’’’, DESC)
Rules: Complex Predicates from Simple Queries
An Example: Defining a greatgrandparent
predicate
greatgrandparent(GGP, GC) :- parent(GGP, GP), grandparent(GP, GC).
Rules: Complex Predicates from Simple Queries
An Example: Defining a greatgrandparent
predicate
greatgrandparent(GGP, GC) :- parent(GGP, GP), grandparent(GP, GC).
Querying The Defined Predicate
?- greatgrandparent(X, holly).
X = herbert.
That was our first Prolog program!
Plan
Language
- Terms
- Facts
- Queries (Implementation: Unification)
- Rules
- Programs (Implementation: Backtracking Search)
Programming
- Numeric Computation
- Data Structures
- Puzzle Solving
Prolog Programs = Facts + Rules!
Prolog Programs = Facts + Rules!
Facts and Rules are two kinds of clauses
Fact: Clause without any conditions
Rules: Clause with conditions
Programs
Basic Facts / Predicates
Rules for generating new Facts / Predicates
Prolog Programs = Facts + Rules!
Complex Programs need Complex Predicates with Multiple Rules
Scope
Multiple Rules: Disjunction
Multiple Rules: Recursion
Prolog Programs = Facts + Rules!
Complex Programs need Complex Predicates with Multiple Rules
Scope
Multiple Rules: Disjunction
Multiple Rules: Recursion
Programs = Facts + Rules : Scope
A word about scope.
In the grandparent
rule, the variable GP
appears twice
greatgrandparent(GGP, GC) :- parent(GGP, GP), grandparent(GP, GC).
Scope: All Variables Are Local To A Single Rule
In Prolog, the scope of a variable is the single rule containing it.
There is no connection between variables across rules.
Programs = Facts + Rules : Scope
A word about scope.
Scope: All Variables Are Local To A Single Rule
In Prolog, the scope of a variable is the single rule containing it.
There is no connection between variables across rules.
Example
foo(P) :- bar(P). % There is no connection between P
stuff(P) :- thing(P). % across the two rules
Prolog Programs = Facts + Rules!
Complex Programs need Complex Predicates with Multiple Rules
Scope
Multiple Rules: Disjunction
Multiple Rules: Recursion
Complex Predicates: Disjunction
Lets write a predicate has_family
which is true for persons who
either have a parent
or have a child
Complex Predicates: Disjunction
Lets write a predicate has_family
which is true for persons who
either have a parent
or have a child
has_family(X) :- parent(X, _). % if X is the parent of some _
has_family(X) :- parent(_, X). % if X is the child of some _
_
is a wildcard or dont-care variable (as in ML, Scala)
Disjunction via Multiple Rules
If we can prove
parent(X, _)
Then we can provehas_family(X)
If we can prove
parent(_, X)
Then we can provehas_family(X)
Complex Predicates: Disjunction
Lets write a predicate has_family
which is true for persons who
either have a parent
or have a child
has_family(X) :- parent(X, _). % if X is the parent of some _
has_family(X) :- parent(_, X). % if X is the child of some _
Executing the Query
?- has_family(holly).
true. % Second rule fires for holly
?- has_family(mugatu).
false.
Semicolon ;
indicates disjunction.
Prolog Programs = Facts + Rules!
Complex Programs need Complex Predicates with Multiple Rules
Scope
Multiple Rules: Disjunction
Multiple Rules: Recursion
Complex Predicates: Recursion
Lets write a predicate ancestor(Anc, Child)
which is true if
parent(Anc, Child)
… orparent(Anc, P)
andparent(P, Child)
… orparent(Anc, GP)
andparent(GP, P)
andparent(P, Child)
… or… if some chain of parent-links holds between
Anc
andChild
.
Complex Predicates: Recursion
Lets write a predicate ancestor(Anc, Child)
which is true if
… if some chain of parent-links holds between Anc
and Child
.
Base Case
If
Anc
is the parent ofChild
ancestor(Anc, Child) :- parent(Anc, Child).
Inductive Case
If
P
is the parent ofChild
andAnc
is an ancestor ofP
ancestor(Anc, Child) :- parent(P, Child), ancestor(Anc, P).
Complex Predicates: Recursion
Lets write a predicate ancestor(Anc, Child)
which is true if
… if some chain of parent-links holds between Anc
and Child
.
ancestor(Anc, Child) :- parent(Anc, Child).
ancestor(Anc, Child) :- parent(P, Child), ancestor(Anc, P).
Complex Predicates: Recursion
Lets write a predicate ancestor(Anc, Child)
which is true if
… if some chain of parent-links holds between Anc
and Child
.
ancestor(Anc, Child) :- parent(Anc, Child).
ancestor(Anc, Child) :- parent(P, Child), ancestor(Anc, P).
Lets take it out for a spin!
First, lets find descendants (forwards)
?- ancestor(kim, X).
X = holly.
Complex Predicates: Recursion
Lets write a predicate ancestor(Anc, Child)
which is true if
… if some chain of parent-links holds between Anc
and Child
.
ancestor(Anc, Child) :- parent(Anc, Child).
ancestor(Anc, Child) :- parent(P, Child), ancestor(Anc, P).
Lets take it out for a spin!
Next, lets find ancestors (backwards)
?- ancestor(X,kim).
X = margaret ;
X = john ;
X = herbert ;
X = felix ;
X = albert .
kim
has a long ancestry!
Pretty neat: go forward or back, in just 2 lines…
…Try doing that in any other language!
Plan
Language
- Terms
- Facts
- Queries (Implementation: Unification)
- Rules
- Programs (Implementation: Backtracking Search)
Backtracking Search
TBD
Order Matters!
TBD
Language
- Terms
- Facts
- Queries (Implementation: Unification)
- Rules
- Programs (Implementation: Backtracking)
Programming
- Numeric Computation
- Data Structures
- Puzzle Solving
Backtracking Search
How does prolog answer recursive queries?
- Brute force backtracking search
View each clause as a proof rule:
goal :- subgoal_1, subgoal_2,...
Thus, the rules for ancestor are as follows:
ancestor(X,Y) :- parent(X,Y). %rule 1
ancestor(X,Y) :- parent(Z,Y),ancestor(X,Z). %rule 2
To prolog, these rules mean “to prove ancestor(X,Y)
, try to:
- Prove the subgoal
parent(X,Y)
, or, failing that, - Prove the subgoal
parent(X,Z), **and then** the subgoal
ancestor(X,Z)`.
Suppose we ask it the query:
?- ancestor(felix,holly).
To prove this query, it undertakes the following backtracking search:
- NOTE there are multiple
Z
variables (Z'
andZ''
…) - These are introduced each time the corresponding sub-goals are triggered.
ancestor(felix,holly)?
/ \
parent(felix,holly) parent(Z,holly)
NO ancestor(felix,Z)
|
| Z = kim (by fact)
|
ancestor(felix,kim)
/ \
parent(felix,kim) parent(Z',kim)
NO ancestor(felix,Z') ----------|
| | Z'=john
Z'=margaret | |
| ancestor(felix,john)
ancestor(felix,margaret) |
/ \ parent(felix,john)
parent(felix,margaret) parent(Z'',margaret) YES
NO ancestor(felix,Z'')
|
Z'' = herbert |
|
ancestor(felix, herbert)
/ |
parent(felix,herbert) parent(Z''',herbert)
NO NO
Queries with Variables
Backtracking Search is done for every query.
?- ancestor(X,kim).
- Prolog does the proof search
- Returns all unifiers for
X
for which the proof succeeds withYES
.
That is, literally programming by proving.
Hint: Trace mode in prolog shows the tree:
?- trace.
?- help(trace).
The subsequent query is traced…
Order is Very Important!
- Order of clauses & terms influences unification & backtracking.
For each
- goal different clauses are selected in order,
- clause subgoals unified from left-to-right.
Bad Order Causes Non-Termination!
So, different orders of recursive sub-query can cause non-termination
Suppose we wrote:
ancestor(X,Y) :- ancestor(X,Z), parent(Z,Y).
ancestor(X,Y) :- parent(X,Y).
Then we see:
?- ancestor(felix,holly).
Why? The search tree looks like this now!
ancestor(felix,holly)?
|
|
|
ancestor(felix,Z) %prove first subgoal,
| %then parent(Z,holly)
|
|
ancestor(felix,Z') %prove first subgoal,
| %then parent(Z',Z)
|
|
ancestor(felix,Z'')
.
.
.
To Avoid Stack Overflow
Place the
parent
subgoal first (in the recursive rule).Then unification with the base facts (parent), fixes
Z
Thereby guaranteeing termination.
QUIZ
Which of these will terminate?
% A
ancestor(X,Y) :- ancestor(X,Z), parent(Z,Y).
ancestor(X,Y) :- parent(X,Y).
% B
ancestor(X,Y) :- parent(X,Y).
ancestor(X,Y) :- ancestor(X,Z), parent(Z,Y).
% C
ancestor(X,Y) :- parent(X,Y).
ancestor(X,Y) :- parent(Z,Y), ancestor(X,Z).
% D
ancestor(X,Y) :- parent(Z,Y), ancestor(X,Z).
ancestor(X,Y) :- parent(X,Y).
QUIZ
Lets define a sibling
predicate:
sibling(X, Y)
ifX
andY
have the sameparent
.
% A
sibling(X, Y) :- parent(P, X), parent(P, Y).
% B
sibling(X, Y) :- parent(P, X), parent(P, Y), not(X = Y).
% C
sibling(X, Y) :- not(X = Y), parent(P, X), parent(P, Y).
Ordering and Unification
Unfortunately to prolog
?- X = Y.
X = Y
is always true, and so the not
always fails
?- not(X = Y).
false.
So the following query always fails
- if
X
andY
are variables!
sibling(X, Y) :- not(X = Y), parent(P, X), parent(P, Y).
Ensure Disequality Check After Unification
Solution
- Ensure goal
not(X=Y)
fires afterX
andY
are unified to atoms
sibling(X, Y) :- parent(P, X), parent(P, Y), not(X = Y).
and now we get:
?- sibling(X,Y).
X = john
Y = maya ;
X = felix
Y = dana ;
X = dana
Y = felix ;
X = maya
Y = john ;
No
Programming
Next, lets do some programmaing in prolog.
- Numeric Computation
- Data Structures
- Puzzle Solving
Numeric Computation
Two big problems:
How do we even evaluate? e.g.
2 + 3
?How do we write functions e.g.
let add x y = x + y
?
Problem 1: How to Evaluate?
- Everything is a term and
=
is a unification operator:
?- X = 2 + 3.
X = 2 + 3
- Pfft. To “compute” we need some evaluation mechanism!
Evaluation with the is
Operator
The is
operator lets us evaluate terms:
?- X is 2 + 3.
X = 5.
To solve is
goal TERM1 is TERM2
, prolog:
- **Evaluates*
TERM2
and then - Unifies result with
TERM1
.
However, watch out!
?- Y is X+2, X=1.
ERROR: Args are not sufficiently instantiated
?- X=1, Y is X+2.
X=1
Y=3
Variables must solved to numbers before evaluation.
Order of evaluation matters!
Numeric Computation
Two big problems:
How do we even evaluate? e.g.
2 + 1
?How do we write functions e.g.
let incr x = x + 1
?
Problem 2: How to Write Functions?
Oops. Everything is a predicate in prolog!
- Facts are the basic predicates, and
- Rules let us get new facts from the basic ones.
How can we even represent a function e.g.
let add x y = x + y
using predicates?
QUIZ
Which of the following represents let add x y = x + y
?
% A
addP(X, Y) :- Z is X + Y. % wtf is Z ?
% B
addP(X, Y, Z) :- Z is X + Y. % wtf is Z ?
% C
addP(X, Y, X + Y).
% D
addP(X, Y) :- X + Y.
% E
addP(X, Y, Z) :- X + Y is Z.
Functions as Predicates
Every function of the form:
let foo x y = out
corresponds to a predicate of the form:
fooP(X, Y, OUT).
i.e. a predicate that is True
for those triples (X, Y, OUT)
s.t.
- The function
foo X Y
evaluated toOUT
!
The predicate
captures the input-output relation of the function.
Factorial
Lets write a predicate capturing the IO relationship of factorial
:
factorial(X, OUT)
holds only when OUT
is the factorial of X
.
**DO IN CLASS**
When we are done, we can call the function with a query:
?- factorial(0, OUT).
OUT = 1
?- factorial(5, OUT).
OUT = 120
Programming
- Numeric Computation
- Data Structures
- Puzzle Solving
Data Structures: Lists
TBD
Programming
- Numeric Computation
- Data Structures
- Puzzle Solving
Data Structures: Accumulators
TBD
Puzzle Solving
- Towers of Hanoi
- Farmer, Wolf, Goat, Cabbage
Towers of Hanoi
TBD
Farmer, Wolf, Goat, Cabbage
TBD


Many people still face barriers while casting their ballot, and Athens is no exception.
The postcard
July 5, Rose Butcher received a postcard in the mail from the Athens County Board of Elections indicating her polling location had been changed.
Rose Butcher is a resident of Rome Township. Before the Aug. 8 election, her polling location had been the Federal Hocking Middle School, located at 8461 state Route 144, Stewart, OH, 45778. Her notice indicated that her voting location, along with all residents of Carthage and Rome Township, had been changed to the Carthage Township Volunteer Fire Department, located at 21200 Holly Lane Guysville, OH, 45735.
Cole Patterson | Director of Multimedia
The change came as a shock to Rose Butcher, as she was never given an explanation as to why the polling location was changed. She said she had talked with other Rome Township community members who had similar concerns.
She was never informed of any problems or issues indicating that a change was necessary, just a simple postcard in the mail a month before election day.
“It makes you think, ‘Why?’” Rose Butcher said. “Do they just do this because they don’t want you to vote?”
Rose Butcher voted early at the polling location on Court Street, so she did not have to find her new polling location for herself. However, when she was taking someone else to the fire department to vote, she realized there was a problem with the directions.
“It makes you think, ‘Why?’ Do they just do this because they don’t want you to vote?” -Rose Butcher
The location
She pulled out her phone and searched “Carthage Township Volunteer Fire Department” in Google Maps, but nothing came up.
Nothing was adding up to Rose Butcher; she said she thought it had to be a mistake.
However, Rome Township residents were not alone in their struggles. Nancy Pierce, a resident of Carthage Township, affirmed that the road to the fire department does not easily catch people's attention.
“It’s a small road I barely see off the highway,” Pierce said. “But it’s marked, and I found it when I needed to.”
Beau Murphree, another resident of Rome Township, said one of the reasons he was deterred from voting in this special election was due to the change in his voting location.
Murphree said for as long as he can remember this was the first time the location was changed from Federal Hocking Middle School.
Similar to Rose Butcher, Murphree wanted to discover where he could find his new polling location. After driving along U.S. Route 50, he came across the path to the fire department, but he was reluctant to continue.
To get to the fire department, you need to drive across the highway, which can be difficult for those of older age, he said.
David Butcher, Rose’s husband, is also a resident of Rome Township. He added that Rome Township is home to a variety of people with varying social classes and races.
“There are very diverse groups of people in this area, maybe one of the most diverse in Athens County,” David Butcher said. “It is a very underserved community, and it has been for a long time.”
Many people experienced difficulty and confusion when trying to find the fire department online, but David Butcher questioned how those without the internet would be able to find the new polling location. Even some who had directions from the internet were unable to find the fire department; David Butcher said it would be even harder for those without the internet to search for directions.
“To think everyone has the internet in my community is not right,” David Butcher said.
The explanation
Athens Board of Election Board Member Aundrea Carpenter-Colvin said other polling locations were also temporarily, and in some cases permanently, moved due to unavailability, parking and traffic lot concerns and misuse of polling equipment and capacity.
However, Carpenter-Colvin said the Board of Elections received the most calls with questions about the new Rome and Carthage Township polling site.
There must be yearly inspections on voting sites to ensure the polling locations meet the Americans with Disabilities, or ADA, Act of 1990 law. During the inspection of Federal Hocking Middle School for the Aug. 8 election, it was determined that the school did not meet the guidelines, Carpenter-Colvin said.
Cole Patterson | Director of Multimedia
One of the major issues was a 2% cross slope which makes it difficult for people in wheelchairs to easily enter and exit the building. Another key issue was parking compliance; all parking spaces, including handicapped spots, were not wide enough, Carpenter-Colvin said.
She contacted the middle school about moving the polling to a different area in the building, but the school could not meet the requested accommodations.
Carpenter-Colvin spoke with school board members, Rome Township trustees and the Federal Valley Resource Center to find the next best location for the residents of Rome and Carthage Township.
The board had considered Carthage’s Volunteer Fire Department in the past – four years ago – but at the time the site did not meet ADA regulations. Since then, the facility has made renovations and improvements to achieve ADA compliance.
When determining where to move the polling location for the Aug. 8 election, the fire department was brought into question. An accessibility coordinator reevaluated the facility and said it met ADA guidelines with 100% compliance.
Carpenter-Colvin said the Board of Elections board members voted Wednesday, June 21, to affirm the new polling location. She said announcements were made on Thursday, June 22. Posts about the change were made on Facebook and the homepage of the Athens County Board of Elections website, and postcards were also sent.
ADA
The Athens City Commission on Disabilities is a committee whose purpose is to provide a means for the concerns of people with disabilities. Each year the ADA evaluates polling locations based on the committee’s guidelines to ensure all voters are given the same equitable experience while voting.
Dianne Bouvier, vice chair of the committee, and Allyson Hughes, secretary of the committee, were not responsible for determining that the precinct location in Rome and Carthage Township did not meet ADA’s guidelines, but they did speak about their thoughts and concerns with the unexplained polling location change.
Hughes said it is a “huge red flag” that voters were only notified within one month before the election and that Google and Apple Maps were giving different locations and directions.
“For those with intellectual differences, this can be confusing,” Bouvier said. “It’s confusing and unclear when different websites are showing different locations for voting.”
Additionally, some browsers do not designate Carthage Township Volunteer Fire Department as a verified organization, stating, “Some users are reporting that this business does not exist.”
“It’s confusing and unclear when different websites are showing different locations for voting.” -Dianne Bouvier
However, with the slope of the sidewalk entrance at Federal Hocking Middle School being at 2%, it does prove to be a challenging barrier for those with physical disabilities, so a change needed to be made, Bouvier said.
“Having a 2% cross slope is scary for a person in a wheelchair,” Bouvier said.
Bouvier said this is not the first time Athens County has experienced confusing voting issues. She acknowledged that voting is better than it has been in previous years, but she also has experienced confusion with her polling location.
“It seems like they’re creating more barriers, and the perception is that they are making it harder to vote,” Bouvier said.
When Bouvier and Hughes found out that Carthage’s Volunteer Fire Department was given a 100% ADA-compliant score, they were surprised. They decided to visit the location to see for themselves.
The women set off to the fire department, and to their surprise, they were impressed by the voting location, in terms of access, Bouvier said.
Though they did not give the fire department an official score when they visited, Bouvier acknowledged it had a van-accessible parking space, a level concrete sidewalk to the entrance and the door has a button actuator and signage.
Although they did not have the opportunity to go inside the building, they could see through the windows that it could easily be an accessible place to vote with clear pathways.
Cole Patterson | Director of Multimedia
“If they went from a space with a 2% cross slope to this one; they made a good decision,” Bouvier wrote in an email. “Of course, the main issue would then be whether or not people knew about the location change in time.”
Nonetheless, Bouvier and Hughes acknowledged that the changing of the polling location created confusion for multiple people, and though they determined – from an unofficial observation – that the fire department was an equitable site for all voters, they believed there were still flaws in communication.
“A barrier is a barrier, even if it’s small, it shouldn’t happen,” Hughes said.
Who voted?
On Aug. 8, a high number of registered voters cast their ballots across Ohio either in support or dissent for Issue 1.
A ‘yes’ vote on Ohio’s special ballot was in favor of increasing the number of votes required to pass a voter-initiated amendment from 50% to 60%; if passed, it would have also required initiative petitions proposing an amendment for the ballot to be signed by 5% of the electors in each of Ohio’s 88 counties, as opposed to the state’s present 44.
Ultimately, the majority of Ohio voted ‘no’ in this special election; with 1,744,094 people voting ‘no’ and 1,315,346 voting ‘yes,’ according to NPR.
The number of registered voters in Athens who voted ‘no’ was 9,743 and 4,043 voted ‘yes,’ according to the Athens County Board of Elections.
In last year's Nov. 8 election, Rome Township had 826 registered voters with 463 cast ballots – a 56.05% voter turnout. In the Aug. 8 special election, there were 793 registered voters with 314 total ballots cast – a 39.6% voter turnout.
Carthage Township saw a similar trend. In last year’s Nov. 8 election, there were 1,009 registered voters in Carthage Township with 576 cast ballots – a 57.09% voter turnout. On Aug. 8, there were 977 registered voters with 402 ballots cast – a 41.15% voter turnout.
Compared to last year’s general election, there was a 15%-16% decrease in voter turnout in both townships for the Aug. 8 election. Though the decrease is significant, the comparison is made between a general election and a special election, so some decline may be expected.
Will the location change again?
Carpenter-Colvin said the board is looking into finding a precinct closer to Rome Township for those residents. However, she does not anticipate the change happening anytime soon.
She advised people to continue to keep an open mind about the situation. She said there is always a possibility for the site to go back to Federal Hocking Middle School.
Currently, the Federal Valley Resource Center received a grant to help fund its work toward ADA compliance to – potentially – become a polling location.
Though she struggled with the location change as a Carthage resident, Pierce also said she does not believe there was any malice behind the decision.
“I have tremendous confidence in the Board of Elections,” Pierce said. “I know how well they know the law and how careful they are with it. My guess is I’d be very surprised if any (voting barriers are) happening in Athens.”
Moving forward
There is not a direct answer as to whether Rome and Carthage Townships’ polling location will once again be Federal Hocking Middle School, but the Athens County Board of Elections website states that the voting location for those areas has been permanently moved.
During general election day, which is always held on the first Tuesday in November, the weather can be noncooperative – it can be cold, snowing or raining – and Rose Butcher mentioned how it could deter people from wanting to vote at the fire department.
“I feel the nightmare isn’t over yet,” David Butcher said.


| EstimationUtils |
|
| EstimatorBasicAvg |
Basic average case estimator for matrix sparsity:
sp = 1 - Math.pow(1-sp1*sp2, k)
|
| EstimatorBasicWorst |
Basic average case estimator for matrix sparsity:
sp = Math.min(1, sp1 * k) * Math.min(1, sp2 * k).
|
| EstimatorBitsetMM |
This estimator implements a naive but rather common approach of boolean matrix
multiplies which allows to infer the exact non-zero structure and thus is
also useful for sparse result preallocation.
|
| EstimatorBitsetMM.BitsetMatrix |
|
| EstimatorBitsetMM.BitsetMatrix1 |
This class represents a boolean matrix and provides key operations.
|
| EstimatorBitsetMM.BitsetMatrix2 |
|
| EstimatorDensityMap |
This estimator implements an approach called density maps, as introduced in
David Kernert, Frank Köhler, Wolfgang Lehner: SpMacho - Optimizing Sparse
Linear Algebra Expressions with Probabilistic Density Estimation.
|
| EstimatorDensityMap.DensityMap |
|
| EstimatorLayeredGraph |
This estimator implements an approach based on a so-called layered graph,
introduced in
Edith Cohen.
|
| EstimatorLayeredGraph.LayeredGraph |
|
| EstimatorMatrixHistogram |
This estimator implements a remarkably simple yet effective
approach for incorporating structural properties into sparsity
estimation.
|
| EstimatorMatrixHistogram.MatrixHistogram |
|
| EstimatorSample |
This estimator implements an approach based on row/column sampling
Yongyang Yu, MingJie Tang, Walid G.
|
| EstimatorSampleRa |
This estimator implements an approach based on row/column sampling
Rasmus Resen Amossen, Andrea Campagna, Rasmus Pagh:
Better Size Estimation for Sparse Matrix Products.
|
| MMNode |
Helper class to represent matrix multiply operators in a DAG
along with references to its abstract data handles.
|
| SparsityEstimator |
|


I'm Tyler, a recent graduate from the University of Pittsburgh.
After exploring many subjects in college, I have realized that design is my passion. Since then, I have been working tirelessly to develop and improve my design skills. With my work, I am passionate about improving the lives of others and am always reading, researching, and studying to improve my designs.
I am also people-oriented with a focus on equality, social justice, diversity, and maintaining accessible design standards. As designers, we have the power and responsibility to make sure that everyone has access to what we create.


To: {{to.name}}
{{mailview.mail.attach.length}} attachments — Download all attachmentsView all images
{{att.name}}


data outbreak response makers decision approaches disease decision-making {border-style analytic Ebola control infectious px;} #ffffff;} outbreaks used analysis interventions epidemiological different modelling quantitative management forecasting responses risk transmission analytics decisions forecasts needs phase time tools health help helpful important need px; response. responses. use using {font-family Data Decision collection especially experts factors font-size logistical methods planning public statistical team teams understanding approach collected considerable data, double; epidemiology field improve investigation issue monitoring operational support understand work Health However, West available border-color border-width cleaning control. deployment descriptions dynamics epidemic example example, information large multiple new published quality review robust scale-up science solid; systems {font-style {font-weight Modelling Quantitative Soc. Thompson agents animals article better bold cholera consider courier; data. development diseases early em; examples framework human humans, hypotheses improved increasingly key limited linkage needed operationally optimal outbreak. outbreaks. parameters patients phase, plants: previous pt;} relevant resources sources supplies surveillance timeliness uncertainty vaccination virus visualization


Zooid Tutorial/walkthrough
Introduction
theories/Tutorial.v
. After
reading the HTML version of this document, we encourage you to go
interactively over the file. This will allow you to modify and test
things, and moreover go over the proofs step by step. Tutorial.v
also contains extra theorems whose study would help the understanding
of the more complex proofs.
The protocol definition: a global type
Definition pp_server := 0. Definition pp_client := 1.
In this protocol, the server will wait for messages from the
client, the client will choose to either send a 'Ping' message and
wait for the 'Pong' response, and repeat, or it will choose to send
'Bye' to end the protocol.
For this purpose we define three message identifiers as labels of each
message. Again, labels are also reprsented by natural numbers.
Definition Bye := 0. Definition Ping := 1. Definition Pong := 1.
Definition ping_pong :=
g_rec ( g_msg pp_client pp_server
[:: (Bye, (T_unit, g_end));
(Ping, (T_nat, g_msg pp_server pp_client
[:: (Pong, (T_nat, g_var 0))]))]).
The local types of the participants
Definition pp_env := \project ping_pong.
Definition pp_server_lt := \get pp_env pp_server.
Definition pp_client_lt := \get pp_env pp_client.
pp_env contains the types for all participants from which we get
the types of each role.
First, we will implement the server. The server is in a sense simpler
because it will implement all the behaviours since in this protocol
only the client has meaningful choices (i.e.: to ping or quit). As a
policy for the payloads this server will simple echo back the payload
of the Ping message.
First start with a definition of an intrinsically typed process
wt_proc of type pp_server_lt.
Definition ping_pong_server : wt_proc pp_server_lt :=..
The protocol starts with a fix point, so the first (smart) constructor
should be loop to allow for the recursion to happen.
Definition ping_pong_server : wt_proc pp_server_lt := loop ..
Following the protocol, the server has to respond to the client's
choice, we do this with \branch pp_client [alts | ... ] where the
alternatives are either Bye carrying a unit or Ping carrying a
natural number: [alts | \lbl Bye, _ : T_unit; ... | \lbl Ping, x :
T_nat; ...]
The server quits if it receives Bye with the process smart
constructor finish and otherwise it sends back Pong with the same
value it received in variable x.
\send pp_client Pong x ...
To repeat the loop, we use again de-bruijn indices and we jump back
with jump 0.
The complete definition of the server is thus:
The process implementations
The implementation of the server
Definition ping_pong_server : wt_proc pp_server_lt :=
loop ( \branch pp_client
[alts | \lbl Bye, _ : T_unit; finish
| \lbl Ping, x : T_nat; (\send pp_client Pong x (jump 0))] ).
The first client -- Always be saying goodbye
Definition ping_pong_client0 : wt_proc pp_client_lt :=
loop (\select pp_server
[sel | \otherwise => Bye, tt \as T_unit ! finish
| \skip => Ping, T_nat !
l_msg l_recv pp_server [:: (Pong, (T_nat, l_var 0))]
]).
In this client we use the \select pp_server ... construct to
make a choice, for this we need to offer a series of conditions that
if met they are executed, or skipping some parts of the protocol. The
skips are necessary to simplify arguing that the local type of the
process corresponds to the one inferred from the terms (i.e.: avoiding
this would lead to more proof obligations).
The selection arguments:
[sel | \otherwise => Bye, tt \as T_unit !...| \skip => Ping, T_nat !...]
has two branches \otherwise that is
always taken and \skip that says that this branch is never taken,
note that \skip is annotated with the type of the continuation that
is skipped.
The second client -- Always be pinging
Definition ping_pong_client1 : wt_proc pp_client_lt :=
loop ( \select pp_server
[sel | \skip => Bye , T_unit ! l_end
| \otherwise => Ping, 1 \as T_nat !
(\recv pp_server \lbl Pong, x : T_nat; (jump 0)) ] ).
The implementation of this client does not use new elements, it
simply uses the elements that we knew of in a different way.
The third client -- Always be pinging just one time
Definition ping_pong_client2 :=
[proc \select pp_server
[sel | \otherwise => Bye, tt \as T_unit ! finish
| \skip => Ping, T_nat !
l_msg l_recv pp_server [:: (Pong, (T_nat, pp_client_lt))] ] ].
- no type annotation, we use Coq's type inference to get the type of
this Zooid program.
- instead of starting with loop we start the process with [proc
...] to signal to Coq that this is a Zooid implicitely typed
process.
- instead of sending Bye after receiving Pong we call pp_client_lt (the process that always says bye) to terminate the execution of the protocol and not have to implement it again.
Lemma pp_c2 : of_lt_unr pp_client (to_proc ping_pong_client2) pp_env.
Proof.
exists (projT1 ping_pong_client2); split.
- by apply: (projT2 (projT2 ping_pong_client2)).
- rewrite -[projT1 ping_pong_client2]/(lunroll 1 pp_client_lt).
by rewrite -LUnroll_ind;
apply: l_expand_unr.
Qed.
The proof should be simple enough as it resorts unroll and unravel
the coinductive types.
This client shows how to use Coq infrastructure in Zooid code taking
advantage of Zooid's nature a shallow embedding in Coq.
This version of the client is the n-ary version of the previous one,
and we compute that using Coq's Fixpoint
The first definition is a recursive function that computes the process
that sends n times Ping.
The fourth client -- Always be useful
Fixpoint ping_pong_client3 n {struct n}:=
match n with
| 0 => [proc
\select pp_server
[sel | \otherwise => Bye, tt \as T_unit ! finish
| \skip => Ping, T_nat !
l_msg l_recv pp_server
[:: (Pong, (T_nat, pp_client_lt))]] ]
| m.+1 => [proc
\select pp_server
[sel | \skip =>
Bye, T_unit ! l_end | \otherwise => Ping, n \as T_nat ! (\recv
pp_server \lbl Pong, x : T_nat; projT2 (ping_pong_client3 m)) ] ]
end.
This unravels the local type n times.
Fixpoint l_unravel_n n L :=
match n, lunroll (lrec_depth L) L with
| n.+1, l_msg p q Ks => l_msg p q [seq (K.1, (K.2.1, l_unravel_n n K.2.2)) | K <- Ks]
| _, _ => L end.
match n, lunroll (lrec_depth L) L with
| n.+1, l_msg p q Ks => l_msg p q [seq (K.1, (K.2.1, l_unravel_n n K.2.2)) | K <- Ks]
| _, _ => L end.
This shows that it works for one unravelling. The general proof is
left as an excercise.
Goal projT1 (ping_pong_client3 0) = l_unravel_n 1 pp_client_lt.
by [].
Qed.
by [].
Qed.
The fifth client -- Always be willing to stop
Definition ping_pong_client4 :=
[proc \select pp_server
[sel | \skip => Bye, T_unit ! l_end
| \otherwise => Ping, 1 \as T_nat !
loop(\recv pp_server \lbl Pong, x : T_nat;
\select pp_server
[sel | \case (x > 3) => Bye, tt \as T_unit ! finish
| \otherwise => Ping, x + 1 \as T_nat ! jump 0])]].
By now you have read ping_pong_client4 and you may be convinced
that it follows the protocol. However, given that the process is not
constructed to follow the exact structure of the local type, Coq is
also not convinced.
The following theorem shows that the inferred type projT1
ping_pong_client4 and pp_client_lt are unrollings of eachother.
Goal forall Li Lc, (Li = projT1 ping_pong_client4 /\
Lc = l_expand pp_client_lt) -> LUnroll Li Lc.

This proof is also about unfoling and aligning the two types, and
while it is a bit frutrating to do, it does not require great
insights. In the future, Zooid will provide tools to automate these
proofs as much as possible.
This tutorial explores how to implement processes using Zooid. The
remaining aspects are how to extract the code, and for that we invite
you to check the
Thank you very much for your attention.
The Zooid team.
Final words
theories/Code.v
file where all the examples are
extracted. Finally, to connect to the OCaml, first use the interactive
example walkthrough by running ./run.sh
from the root directory of
the Zooid distribution/docker container that contains pointers and
explanation of all the important details.
This page has been generated by coqdoc


|
Nakama C++ Client SDK
2.4.1
Client for Nakama Server
|
A tournament on the server. More...
#include <NTournament.h>
Public Attributes | |
| std::string | id |
| The ID of the tournament. More... | |
| std::string | title |
| The title for the tournament. More... | |
| std::string | description |
| The description of the tournament. May be blank. More... | |
| uint32_t | category = 0 |
| The category of the tournament. e.g. "vip" could be category 1. More... | |
| uint32_t | sortOrder = 0 |
| ASC or DESC sort mode of scores in the tournament. More... | |
| uint32_t | size = 0 |
| The current number of players in the tournament. More... | |
| uint32_t | maxSize = 0 |
| The maximum number of players for the tournament. More... | |
| uint32_t | maxNumScore = 0 |
| The maximum score updates allowed per player for the current tournament. More... | |
| bool | canEnter = false |
| True if the tournament is active and can enter. A computed value. More... | |
| NTimestamp | createTime = 0 |
| The UNIX time when the tournament was created. More... | |
| NTimestamp | startTime = 0 |
| The UNIX time when the tournament will start. More... | |
| NTimestamp | endTime = 0 |
| The UNIX time when the tournament will be stopped. More... | |
| uint32_t | endActive = 0 |
| The UNIX time when the tournament stops being active until next reset. A computed value. More... | |
| uint32_t | nextReset = 0 |
| The UNIX time when the tournament is next playable. A computed value. More... | |
| uint32_t | duration = 0 |
| Duration of the tournament in seconds. More... | |
| uint32_t | startActive = 0 |
| The UNIX time when the tournament start being active. A computed value. More... | |
| std::string | metadata |
| Additional information stored as a JSON object. More... | |
A tournament on the server.
| bool NTournament::canEnter = false |
True if the tournament is active and can enter. A computed value.
| uint32_t NTournament::category = 0 |
The category of the tournament. e.g. "vip" could be category 1.
| NTimestamp NTournament::createTime = 0 |
The UNIX time when the tournament was created.
| std::string NTournament::description |
The description of the tournament. May be blank.
| uint32_t NTournament::duration = 0 |
Duration of the tournament in seconds.
| uint32_t NTournament::endActive = 0 |
The UNIX time when the tournament stops being active until next reset. A computed value.
| NTimestamp NTournament::endTime = 0 |
The UNIX time when the tournament will be stopped.
| std::string NTournament::id |
The ID of the tournament.
| uint32_t NTournament::maxNumScore = 0 |
The maximum score updates allowed per player for the current tournament.
| uint32_t NTournament::maxSize = 0 |
The maximum number of players for the tournament.
| std::string NTournament::metadata |
Additional information stored as a JSON object.
| uint32_t NTournament::nextReset = 0 |
The UNIX time when the tournament is next playable. A computed value.
| uint32_t NTournament::size = 0 |
The current number of players in the tournament.
| uint32_t NTournament::sortOrder = 0 |
ASC or DESC sort mode of scores in the tournament.
| uint32_t NTournament::startActive = 0 |
The UNIX time when the tournament start being active. A computed value.
| NTimestamp NTournament::startTime = 0 |
The UNIX time when the tournament will start.
| std::string NTournament::title |
The title for the tournament.


☰
Log Out
(current)
Yojana
×
Home
Login
Sign Up
×
Home
Manage
New Project
Project Details
Project Manager
Update
Cancel
Please fill in the fields highlighted in red.
Snap! Couldn't Add the project.


{% load wagtailcore_tags %} {% if posts %} {% comment %} Does not use blog_list_item.html include because we don't want to show authors on the person page {% endcomment %}


1. Normal CENTER
CENTER tag width:80px; height: 80px;
2. CENTER height is 1px and not text and has border.
CENTER tag width:100px; height: 5px; border:1px solid #000;
3. CENTER height is 1px and not text and has not border, but has background.
CENTER tag width:100px; height: 5px; background:gray;
The followings don't have problems
A1.
A2.
| container width:120px -> CENTER width: 100% -> TABLE |
A2.
container width:100px; padding:50px; -> CENTER width 100px
A3.
container width:100px; border:5px; -> CENTER width 100px
A4.
CENTER overflow container box
A4.
CENTER style is width:160px; margin:0 auto;
A5.CENTER height is 1px and not text and has not border.
A6.
CENTER style is float:left
A7.
CENTER tag width:100%;
A8.
CENTER tag width:auto;


First Name
[Using Input Text]
:
Simple Text input
Text input with maxlength
Text input with size
Simple Text input with value
Text input with placeholder
Text input with Color
State
[Using Data List / Selection options (option list) input]
:
Data list - Text Input
Selection List / Option List - Basic
---- Please select ----
Perak
Ipoh
Johor
Perak
Ipoh
Selection List / Option List - with size
---- Please select ----
Perak
Ipoh
Johor
Perak
Ipoh
Selection List / Option List - with multiple selection
---- Please select ----
Perak
Ipoh
Johor
Perak
Ipoh
Selection List / Option List - with option groups
Ipoh
Taiping
Parit Puntar
Ampang
Gombak
Setapak
Selection List / Option List - selected certain value
---- Please select ----
Perak 1
Ipoh 1
Johor 2
Perak 2
Ipoh 2
Gender
[Using radio buttons input]
:
Incorrect - Reasons: using different name's value
Female
Male
Correct - Using same name's value
Female
Male
Correct (Radion buttons - with checked selection)
Female
Male
Correct (Radio button with Clickable labels)
Female
Male
Birthdate
[Using date input]
:
Basic Date
Date with restriction date
Enter a date before 1980-01-01:
Enter a date after 2000-01-01:
Date with Datetime-local format
Birthday (date and time):
Month and Year Format
Birthday (month and year):
Language
[Using Checkbox input]
:
Checkboxes
without
checked function
Malay
Chinese
English
Checkboxes
with
selected function
Malay
Chinese
English
Height
[Using Number input]
:
Basic Number
Basic Number with value
Number with min and max properties
[Min:100 / Max:200]
Number with step properties
[Step value:2]
[Step value:4]
Vote
[Using Range input]
:
Basic Range
Basic Range with value
Range with min and max properties
1
200
Range with step properties
[Step value:2]
[Step value:4]
Subject
[Using Fieldset and legend tags]
:
Subject
Math
English
History
Comments
[Using Textarea]
:
Basic Text area
Please comments here
Text area cols and rows attributes
Please comments here
Validation
[Using URL properties]
:
Homepage:
Validation
[Using email properties]
:
Basic email
Email:
Email with pattern properties
E-mail:
Validation
[Using Password input]
:
Basic Password
Password:
Password with pattern properties
Password:
Validation
[Using Text input]
:
Country code:
Correct (Note: inside the form)
Wrong (Note: outside the form)


inavibe
bass
harp
piano
drums
brass
organ
bells
flute
violin
alto sax
western piano
ballad guitar
blown bottles
soft voices
electric guitar
pizzicato
oldstrings
numb
Gospel Organ
loadMetro
midi
Assign Controller
Assign Volume
Reverb
WahWah
Overdrive
Chorus
Phaser
Cabinet
Tremolo
Delay
Compressor
filter
Metronome
BPM
Your ID is :
Connect to musician:
Video Chat Room
Video On
Video Off


California Preparing for State Takeover of Electric Company - Governor
WASHINGTON (Sputnik) - California has appointed an energy czar to develop a plan for a possible state takeover of Pacific Gas & Electric (PG&E) after the utility company left millions in the dark during recent wildfires, Governor Gavin Newsom said in a statement.
Wildfires raged across California this month due to strong winds that forced PG&E to leave around 1.5 million without power. A state regulator launched a probe on Monday into the unprecedented number of so-called Public Safety Power Shut-offs (PSPS) as wildfires threatened California residents.
"The state will not hesitate to step in and restructure the utility", Newsom said on Medium.com on Friday. "To that end, I have tapped my Cabinet Secretary, Ana Matosantos, to serve as the state’s Energy Czar to lead a dedicated energy team… and prepare a plan should the state need to intervene. All options are on the table".
Long and widespread blackouts highlighted PG&E's "culture of ineptitude" and resistance to change, the governor added.


Machine Learning-Empowered Pathology
The overarching goal of our lab is to establish robust, generalizable, and fair artificial intelligence (AI) methods for quantitative pathology evaluation. We developed the first fully-automated algorithm to analyze digital whole-slide pathology images. Our methods successfully identified cancer diagnoses, predicted molecular subtypes, and informed patients' prognoses.


--- title: Python Twitter Bot redirect_from: /slides/python-twitter-bot ---
{%- include "analytics.njk" -%}A script that routinely interacts with Twitter
while True:
# implement logic here
# download data
# manipulate data
# post a tweet
time.sleep(60)
St Paul, MN: The clouds are saying hi, it's foggy right now.
— Weather By Brian (@WeatherByBrian) January 23, 2017
Eden Prairie, MN: The forecast for today is mostly cloudy starting in the evening. 21ºF/2ºF. Sweet!
— Weather By Brian (@WeatherByBrian) February 9, 2017
Minneapolis, MN: Get ready, there's a Freezing Rain Advisory until Tue, Feb 07 at 12:00:00 CST. https://t.co/OtpCQ26e3d
— Weather By Brian (@WeatherByBrian) February 7, 2017
Static or dynamic
Twitter has geolocation data...
def get_location_from_user_timeline(username, fallback):
"""
Load the 20 most recent tweets of a given twitter handle and
return a models.WeatherLocation object of the most recent location.
This function will find a tweet with coordinates or a place,
preferring coordinates. If a location is not found in the most
recent 20 tweets, the given fallback location will be returned.
:type username: str
:param username: twitter username to follow
:type fallback: models.WeatherLocation
:param fallback: a fallback in case no location can be found
:return: models.WeatherLocation
"""
api = get_tweepy_api()
# gets the 20 most recent tweets from the given profile
try:
timeline = api.user_timeline(screen_name=username,
include_rts=False,
count=20)
for tweet in timeline:
# if tweet has coordinates (from a smartphone)
if tweet.coordinates is not None:
lat = tweet.coordinates['coordinates'][1]
lng = tweet.coordinates['coordinates'][0]
name = tweet.place.full_name
logging.debug('Found %s: %f, %f', name, lat, lng)
return models.WeatherLocation(lat=lat,
lng=lng,
name=name)
# if the location is a place, not coordinates
elif tweet.place is not None:
point = utils.centerpoint(
tweet.place.bounding_box.coordinates[0])
lat = point[0]
lng = point[1]
name = tweet.place.full_name
logging.debug('Found the center of bounding box at '
'%s: %f, %f', name, lat, lng)
return models.WeatherLocation(lat=lat,
lng=lng,
name=name)
# fallback to hardcoded location if there is no valid data
logging.warning('Could not find tweet with location, '
'falling back to hardcoded location')
return fallback
except tweepy.TweepError as err:
logging.error(err)
logging.warning('Could not find tweet with location, '
'falling back to hardcoded location')
return fallback
import traceback
...
try:
while True:
...
except Exception as err:
logging.error(err)
logging.error('We got an exception!', exc_info=True)
if CONFIG['basic']['dm_errors']:
api = get_tweepy_api()
api.send_direct_message(screen_name=api.me().screen_name,
text=str(random.randint(0, 9999))
+ traceback.format_exc())
I also would love some code review 🙃


唔會幫你整電腦
0
IT Dog 01
IT Dog 02
IT Dog 03
Sticker 01
Sticker 02
Sticker 03
Sticker 04
Sticker 05
Sticker 06
Sticker 07
All stickers are licensed by
A0朋友
Download
You can resize the banner to whatever size you like!
Type whatever text you want it to be in the banner!
Click to add sticker!
Press
ESC
/
DEL
to remove
those added from banner!
Thanks
A0朋友
for the stickers!
Download you work and then share it to your friends!


Welcome to Bethany's Pie Shop
Our history
For many years, Bethany has been baking the most delicious pies at her home. In 2013, we opened our first store in Brussels (Belgium) in a cosy little street near the Grand Market. People from all over the world fell in love with the soft cakes, heavenly cheese cakes, spicy apple pies.... The store became a success in no time.
In 2015, no less than 100 pies were sold every day and Bethany's Pie Shop moved into a larger building. After receiving many requests, it became clear that our next step was making it possible to order pies from the comfort of your own home and from anywhere in the world. You are now looking at the result of this: our very own webstore, making it possible to order Bethany's delicious pies whenever you feel like it!
Our weekly promotions
Cheese cake
$12.95 - serves 4


Improved Initiative was created by Evan Bailey. All Wizards of the Coast content provided under terms of the Open Gaming License Version 1.0a.
Roll monster HP when adding to combat:
Allow combatants to have negative hit points:
Automatically prompt for concentration checks:
Automatically add creatures to initiative group:
Automatically reroll initiative at the end of each round:
Display Round Counter:
Display Turn Timer:
Display Encounter Difficulty:
Monster HP Verbosity:
Player HP Verbosity:
Hide monsters when encounter is not active:
Allow players to suggest damage/healing:
Active combatant at top of initiative list:
Additional player view options available with Epic Initiative


--- layout: post title: On metaphors date: 2011-07-15 08:09:55.000000000 -04:00 categories: - Books - Commentary on works - Social Science tags: [] status: publish type: post published: true meta: _edit_last: '7106425' author: login: samarthbhaskar email<EMAIL_ADDRESS>display_name: samarthbhaskar first_name: '' last_name: '' ---
The Chronicle of Higher Education has a review of James Geary's I is an other, a new book on the place of metaphors in language. This quote from Geary was well received -
Metaphor conditions our interpretations of the stock market and, through advertising, it surreptitiously infiltrates our purchasing decisions. In the mouths of politicians, metaphor subtly nudges public opinion; in the minds of businesspeople, it spurs creativity and innovation. In science, metaphor is the preferred nomenclature for new theories and new discoveries; in psychology, it is the natural language of human relationships and emotions.
Although I wouldn't go as far as someone like Derrida, I think there is definitely value in the work of someone like George Lakoff who advanced the idea that metaphors are a conceptual (not merely linguistic) construction. His forays into political science, through things like conservative concepts of the paternal state versus progressive concepts of a maternal state, are pretty useful.


Usage
This design is good for anyone who wishes to display images or photos on the homepage of there site. I have provided the PSD files along with the source code and imagery. Have fun amending but please keep the backlink in the footer. Images are from sxc.hu a great site for free imagery.
Author
My names Callum Rimmer and I run a web software company in Bath, England. We have created a simple content management system and hosting package for small companies and individuals called
iFrame. iFrame is made to as easy to use as possible whilst giving you the flexibilty to design your site how you like. You can use any of the free designs on OSWD.org as an iFrame template.
Contact
If you would like to contact me for some help using this template (and to get the associated PSD files) or if you would like to known more about iFrame,
Email me.
Navigation:
Portfolio of Photos:


My name is Yaegashi Misato. I'm a student at KEIO UNIVERCITY.
I'm learning Python and JavaScript.
I can speak English and Japanese.
I had danced on stage for 5years!
I design and sell T-shirt.
I want to develop softwear to help people!
I want to terch dancing for children!
I want to cook anything!
I want to work in a zoo!


Functions to access Twitter's filter, sample, and user streams, and to parse the output into data frames.
| Version: | 0.4.5 |
| Depends: | R (≥ 2.12.0), RCurl, rjson, ndjson |
| Suggests: | ROAuth (≥ 0.9.0) |
| Published: | 2018-12-09 |
| Author: | Pablo Barbera |
| Maintainer: | Pablo Barbera <pablo.barbera at nyu.edu> |
| License: | GPL-2 |
| NeedsCompilation: | no |
| Materials: | ChangeLog |
| In views: | WebTechnologies |
| CRAN checks: | streamR results |
| Reference manual: | streamR.pdf |
| Package source: | streamR_0.4.5.tar.gz |
| Windows binaries: | r-devel: streamR_0.4.5.zip, r-release: streamR_0.4.5.zip, r-oldrel: streamR_0.4.5.zip |
| OS X binaries: | r-release: streamR_0.4.5.tgz, r-oldrel: streamR_0.4.5.tgz |
| Old sources: | streamR archive |
| Reverse imports: | readtext, tweet2r |
Please use the canonical form https://CRAN.R-project.org/package=streamR to link to this page.


10.6 Compressed Files
Although
storage space and transmission bandwidth are increasingly cheap and
abundant, in many cases you can save such resources, at the expense
of some computational effort, by using compression. Since
computational power grows cheaper and more abundant even faster than
other resources, such as bandwidth, compression's
popularity keeps growing. Python makes it easy for your programs to
support compression by supplying dedicated modules for compression as
part of every Python distribution.
10.6.1 The gzip Module
The gzip module lets
you read and write files compatible with those handled by the
powerful GNU compression programs gzip and
gunzip. The GNU programs support several
compression formats, but module gzip supports only
the highly effective native gzip format,
normally denoted by appending the extension .gz
to a filename. Module gzip supplies the
GzipFile class and an open
factory function.
class GzipFile(filename=None,mode=None,compresslevel=9,
fileobj=None)
|
|
Creates and returns a file-like object f
that wraps the file or file-like object
fileobj. f
supplies all methods of built-in file objects except
seek and tell. Thus,
f is not seekable: you can only access
f sequentially, whether for reading or
writing. When fileobj is
None, filename must be
a string that names a file: GzipFile opens that
file with the given mode (by default,
'rb'), and f wraps the
resulting file object. mode should be one
of 'ab', 'rb',
'wb', or None. If
mode is None,
f uses the mode of
fileobj if it is able to find out the
mode; otherwise it uses 'rb'. If
filename is None,
f uses the filename of
fileobj if able to find out the name;
otherwise it uses ''.
compresslevel is an integer between
1 and 9: 1
requests modest compression but fast operation, and
9 requests the best compression feasible, even if
that requires more computation.
File-like object f generally delegates all
methods to the underlying file-like object
fileobj, transparently accounting for
compression as needed. However, f does not
allow non-sequential access, so f does not
supply methods seek and tell.
Moreover, calling
f.close does
not close fileobj
when f was created with an argument
fileobj that is not
None. This behavior of
f.close is very
important when fileobj is an instance of
StringIO.StringIO, since it means you can call
fileobj.getvalue after
f.close to get the
compressed data as a string. This behavior also means that you have
to call fileobj.close
explicitly after calling
f.close.
open(filename,mode='rb',compresslevel=9)
|
|
Like
GzipFile(filename,mode,compresslevel),
but filename is mandatory and there is no
provision for passing an already opened
fileobj.
Say that you have some function
f(x)
that writes data to a text file object x,
typically by calling
x.write and/or
x.writelines. Getting
f to write data to a
gzip-compressed text file instead is easy:
import gzip
underlying_file = open('x.txt.gz', 'wb')
compressing_wrapper = gzip.GzipFile(fileobj=underlying_file, mode='wt')
f(compressing_wrapper)
compressing_wrapper.close( )
underlying_file.close( )
This example opens the underlying binary file
x.txt.gz and explicitly wraps it with
gzip.GzipFile, and thus, at the end, we need to
close each object separately. This is necessary because we want to
use two different modes: the underlying file must be opened in binary
mode (any translation of line endings would produce an invalid
compressed file), but the compressing wrapper must be opened in text
mode because we want the implicit translation of
os.linesep to \n. Reading back
a compressed text file, for example to display it on standard output,
is similar:
import gzip, xreadlines
underlying_file = open('x.txt.gz', 'rb')
uncompressing_wrapper = gzip.GzipFile(fileobj= underlying_file, mode='rt')
for line in xreadlines.xreadlines(uncompressing_wrapper):
print line,
uncompressing_wrapper.close( )
underlying_file.close( )
This example uses module xreadlines, covered
earlier in this chapter, because GzipFile objects
(at least up to Python 2.2) are not iterable like true file objects,
nor do they supply an xreadlines method.
GzipFile objects do supply a
readlines method that closely emulates that of
true file objects, and therefore module xreadlines
is able to produce a lazy sequence that wraps a
GzipFile object and lets us iterate on the
GzipFile object's lines.
10.6.2 The zipfile Module
The zipfile module
lets you read and write ZIP files (i.e., archive files compatible
with those handled by popular compression programs
zip and unzip,
pkzip and pkunzip,
WinZip, and so on). Detailed information on the
formats and capabilities of ZIP files can be found at http://www.pkware.com/appnote.html and
http://www.info-zip.org/pub/infozip/. You
need to study this detailed information in order to perform advanced
ZIP file handing with module
zipfile.
Module zipfile can't handle ZIP
files with appended comments, multidisk ZIP files, or
.zip archive members using compression types
besides the usual ones, known as stored (when a file is copied to the
archive without compression) and deflated (when a file is compressed
using the ZIP format's default algorithm). For
invalid .zip file errors, functions of module
zipfile raise exceptions that are instances of
exception class zipefile.error. Module
zipfile supplies the following classes and
functions.
Returns True if the file named by string
filename appears to be a valid ZIP file,
judging by the first few bytes of the file; otherwise returns
False.
class ZipInfo(filename='NoName',date_time=(1980,1,1,0,0,0))
|
|
Methods getinfo and infolist of
ZipFile instances return instances of
ZipInfo to supply information about members of the
archive. The most useful attributes supplied by a
ZipInfo instance z are:
- comment
-
A string that is a comment on the archive member
- compress_size
-
Size in bytes of the compressed data for the archive member
- compress_type
-
An integer code recording the type of compression of the archive
member
- date_time
-
A tuple with 6 integers recording the time of last modification to
the file: the items are year, month, day (1 and
up), hour, minute, second (0 and up)
- file_size
-
Size in bytes of the uncompressed data for the archive member
- filename
-
Name of the file in the archive
class ZipFile(filename,mode='r',compression=zipfile.ZIP_STORED)
|
|
Opens a ZIP file named by string filename.
mode can be 'r', to
read an existing ZIP file; 'w', to write a new ZIP
file or truncate and rewrite an existing one; or
'a', to append to an existing file.
When mode is 'a',
filename can name either an existing ZIP
file (in which case new members are added to the existing archive) or
an existing non-ZIP file. In the latter case, a new ZIP file-like
archive is created and appended to the existing file. The main
purpose of this latter case is to let you build a self-unpacking
.exe file (i.e., a Windows executable file that
unpacks itself when run). The existing file must then be a fresh copy
of an unpacking .exe prefix, as supplied by
www.info-zip.org or by other
purveyors of ZIP file compression tools.
compression is an integer code that can be
either of two attributes of module zipfile.
zipfile.ZIP_STORED requests that the archive use
no compression, and zipfile.ZIP_DEFLATED requests
that the archive use the deflation mode of
compression (i.e., the most usual and effective compression approach
used in .zip files).
A ZipFile instance z
supplies the following methods.
Closes archive file
z. Make sure the close
method is called, or else an incomplete and unusable ZIP file might
be left on disk. Such mandatory finalization is generally best
performed with a try/finally
statement, as covered in Chapter 6.
Returns a ZipInfo instance that supplies
information about the archive member named by string
name.
Returns a list of ZipInfo instances, one for each
member in archive z, in the same order as
the entries in the archive itself.
Returns a list of strings, the names of each member in archive
z, in the same order as the entries in the
archive itself.
Outputs a textual directory of the archive
z to file sys.stdout.
Returns a string containing the uncompressed bytes of the file named
by string name in archive
z. z must be
opened for 'r' or 'a'. When the
archive does not contain a file named
name, read raises an
exception.
Reads and checks the files in archive z.
Returns a string with the name of the first archive member that is
damaged, or None when the archive is intact.
z.write(filename,arcname=None,compress_type=None)
|
|
Writes the file named by string filename
to archive z, with archive member name
arcname. When
arcname is None,
write uses filename as
the archive member name. When
compress_type is None,
write uses
z's compression type;
otherwise, compress_type is
zipfile.ZIP_STORED or
zipfile.ZIP_DEFLATED, and specifies how to
compress the file. z must be opened for
'w' or 'a'.
zinfo must be a ZipInfo
instance specifying at least filename and
date_time.
bytes is a string of bytes.
writestr adds a member to archive
z, using the metadata specified by
zinfo and the data in
bytes. z must
be opened for 'w' or 'a'. When
you have data in memory and need to write the data to the ZIP file
archive z, it's simpler
and faster to use
z.writestr rather than
z.write. The latter
approach would require you to write the data to disk first, and later
remove the useless disk file. The following example shows both
approaches, each encapsulated into a function, polymorphic to each
other:
import zipfile
def data_to_zip_direct(z, data, name):
import time
zinfo = zipfile.ZipInfo(name, time.localtime( )[:6])
z.writestr(zinfo, data)
def data_to_zip_indirect(z, data, name):
import os
flob = open(name, 'wb')
flob.write(data)
flob.close( )
z.write(name)
os.unlink(name)
zz = zipfile.ZipFile('z.zip', 'w', zipfile.ZIP_DEFLATED)
data = 'four score\nand seven\nyears ago\n'
data_to_zip_direct(zz, data, 'direct.txt')
data_to_zip_indirect(zz, data, 'indirect.txt')
zz.close( ) Besides being faster and more concise,
data_to_zip_direct is handier because, by working
in memory, it doesn't need to have the current
working directory be writable, as
data_to_zip_indirect does. Of course, method
write also has its uses, but
that's mostly when you already have the data in a
file on disk, and just want to add the file to the archive.
Here's how you can print a list of all files
contained in the ZIP file archive created by the previous example,
followed by each file's name and contents:
import zipfile
zz = zipfile.ZipFile('z.zip')
zz.printdir( )
for name in zz.namelist( ):
print '%s: %r' % (name, zz.read(name))
zz.close( )
10.6.3 The zlib Module
The zlib module
lets Python programs use the free InfoZip zlib
compression library (see http://www.info-zip.org/pub/infozip/zlib/),
Version 1.1.3 or later. Module zlib is used by
modules gzip and zipfile, but
the module is also available directly for any special compression
needs. This section documents the most commonly used functions
supplied by module zlib.
Module zlib also supplies functions to compute
Cyclic-Redundancy Check (CRC) checksums, in order to detect possible
damage in compressed data. It also provides objects that can compress
and decompress data incrementally, and thus enable you to work with
data streams that are too large to fit in memory at once. For such
advanced functionality, consult the Python library's
online reference.
Note that files containing data compressed with
zlib are not automatically interchangeable with
other programs, with the exception of files that use the
zipfile module and therefore respect the standard
format of ZIP file archives. You could write a custom program, with
any language able to use InfoZip's free
zlib compression library, in order to read files
produced by Python programs using the zlib module.
However, if you do need to interchange compressed data with programs
coded in other languages, I suggest you use modules
gzip or zipfile instead. Module
zlib may be useful when you want to compress some
parts of data files that are in some proprietary format of your own,
and need not be interchanged with any other program except those that
make up your own application.
Compresses string str and returns the
string of compressed data. level is an
integer between 1 and 9:
1 requests modest compression but fast operation,
and 9 requests compression as good as feasible,
thus requiring more computation.
Decompresses the compressed data string
str and returns the string of uncompressed
data.
|


Created by Ali Yazdanpanah for Master's proposal presentation - Winter 2021
Created by Ali Yazdanpanah for Master's proposal presentation - Winter 2021
GPUs were originally designed for graphics computing and image processing purposes
GPU workloads have exclusive designs
A kernel with full resource usage is not always the case[12]
Tools like Kubernetes[9], Torque[11] and Slurm[10] can't schedule multiple taks
GPU workloads have exclusive designs
With great computing power comes high power consumption
Can be solved with techniques like Kernel fusion[15]
Preemtion is a young technology introduced by Tesla P100
Their method was power efficient missed intra-node communications
They only focused on load balancing between nodes
Our research is alligned with these researches in terms of resource sharing
The final goal of this research is to create a workload aware framework to maximize gpu utilization based on performance, memory and power consumption in multi-task environments
We aim to accomplish preformance utilization through methods like memory masking, dynamic kernel scheduling using preemption and live monitoring and enabling multi-kernel launches
We aim to accomplish memory utilization through methods like memory aware multi-kernel launch, memory swapping and kernel checkpoints
We aim to accomplish power utilization through methods like kernel fusion
GPU optimization is a focus concern in cloud and cluster environments. Unlike other researches out aim is to address all three of power, performance and memory problems
[1] “Amazon AWS.”https://aws.amazon.com/cn/nvidia/
[2] “MicrosoftAzure.”https://www.nvidia.com/en-us/data-center/gpu-cloud-computing/microsoft-azure/
[3] “Google Cloud.”https://cloud.google.com/gpu
[4] “Top 500 list at Nov 2019.”https://www.top500.org/lists/2019/11/
[5] “Summit.”https://www.olcf.ornl.gov/summit
[6] C. Chen, Y. Du, H. Jiang, K. Zuo, and C. Yang, “Hpcg: Preliminary eval-uation andoptimization on tianhe-2 cpu-only nodes,” in2014 IEEE 26thInternational Symposium onComputer Architecture and High PerformanceComputing, pp. 41–48, Oct 2014.
[7] Q. Xu, H. Jeon, and M. Annavaram, “Graph processing on gpus: Whereare thebottlenecks?,” in2014 IEEE International Symposium on WorkloadCharacterization(IISWC), pp. 140–149, 2014.
[8] H. Jeon and M. Annavaram, “Warped-dmr: Light-weight error detectionfor gpgpu,”in2012 45th Annual IEEE/ACM International Symposium onMicroarchitecture, pp. 37–47,2012.
[9] “Kubernetes.”https://kubernetes.io
[10] “Slurm.”https://www.schedmd.com/index.php
[11] “Torque.”http://www.adaptivecomputing.com/products/torque/
[12] M. Lee, S. Song, J. Moon, J. Kim, W. Seo, Y. Cho, and S. Ryu, “Improvinggpgpuresource utilization through alternative thread block scheduling,” in2014 IEEE 20thInternational Symposium on High Performance ComputerArchitecture (HPCA), pp. 260–271, IEEE, 2014.
[13] “NVIDIAHyper-Q.”http://developer.download.nvidia.com/compute/DevZone/C/html_x64/6_Advanced/simpleHyperQ/doc/HyperQ.pdf.
[14] “NVIDIA MPS.” https://docs.nvidia.com/deploy/mps/index.html
[15] G. Wang, Y. Lin, and W. Yi. Kernel fusion: An effective method forbetter powerefficiency on multithreaded gpu. In2010 IEEE/ACM Int’lConference on Green Computingand Communications Int’l Conferenceon Cyber, Physical and Social Computing, pages 344–350, Dec 2010.
[16] Sreepathi Pai, Matthew J. Thazhuthaveetil, and R.Govindarajan.2013.ImprovingGPGPUconcurrencywithelastickernels.SIGPLANNot.48,4(March2013),407-418.DOI:https://doi.org/10.1145/2499368.2451160.
[17] Jason Jong Kyu Park, Yongjun Park, and Scott Mahlke. 2015.Chimera: CollaborativePreemption for Multitasking on a Shared GPU.SIGARCH Comput. Archit. News 43, 1(March 2015), 593-606. DOI:https://doi.org/10.1145/2786763.2694346
[18] Z. Wang, J. Yang, R. Melhem, B. Childers, Y. Zhang and M. Guo,SimultaneousMultikernel GPU: Multi-tasking throughput processorsvia fine-grained sharing, 2016 IEEEInternational Symposium on HighPerformance Computer Architecture (HPCA), Barcelona,2016, pp. 358-369.
[19] Maas, Martin,Asanovi Krste,Harris Tim, Kubiatowicz John.Taurus:SchedulingConcurrent Applications on a Cluster of CPU-GPU Nodes.2012 12th IEEE/ACMInternational Symposium on Cluster, Cloud andGrid Computing (ccgrid 2012).pp.140-147.
[20] Agulleiro, J. I., et al. Dynamic load scheduling on CPU-GPU for iterativetomographicreconstruction. 2012 IEEE 10th International Symposiumon Parallel and DistributedProcessing with Applications. IEEE, 2012.
[21] Chen, Long, Oreste Villa, and Guang R. Gao. Exploring fine-grainedtask-basedexecution on multi-GPU systems. 2011 IEEE InternationalConference on ClusterComputing. IEEE, 2011.
[22] T.Allen,X Feng, R.Ge.Slate: Enabling Workload-Aware Efficient Multi-processing forModern GPGPUs. 2019 IEEE International Parallel andDistributed Processing Symposium(IPDPS).pp. 252-261.
[23] Jason Jong Kyu Park, Yongjun Park, and Scott Mahlke. 2017. DynamicResourceManagement for Efficient Utilization of Multitasking GPUs.In Proceedings of the Twenty-Second International Conference on Ar-chitectural Support for Programming Languages andOperating Systems(ASPLOS ’17). ACM, New York, NY, USA, 527-540.
[24] C. Yu et al., SMGuard: A Flexible and Fine-Grained Resource Man-agementFramework for GPUs, in IEEE Transactions on Parallel andDistributed Systems, vol. 29, no.12, pp. 2849-2862, 1 Dec. 2018.
[25] Kang, Daeyoun, et al. ConVGPU: GPU management middleware incontainer basedvirtualized environment. 2017 IEEE International Con-ference on Cluster Computing(CLUSTER). IEEE, 2017.
[26] Gu, Jing, et al. GaiaGPU: Sharing GPUs in Container Clouds. 2018IEEE Intl Conf onParallel & Distributed Processing with Applica-tions, Ubiquitous Computing &Communications, Big Data & CloudComputing, Social Computing & Networking,SustainableComputing&Communications(ISPA/IUCC/BDCloud/SocialCom/SustainCom).IEEE, 2018.


--- layout: default title: Video Policy comments: hidden ---
Lost Decade Games grants permission for anyone to make videos of our games and share them freely for reviews, walkthroughs, or any other legal purpose. We also grant permission to monetize these videos on YouTube or similiar sites. We very much appreciate players taking the time to enjoy our games and share them with others.
The music in our games is generally composed by Joshua Morse and you are free to include the music alongside gameplay video. All we ask is that you include some text crediting him and linking to his website: http://www.jmflava.com/
If you have any questions or need clarification on our video policy, please contact us.


Hi this is second page.
Am I The Bot?
Or Maybe I'm Not!!!!
Am I The Bot?
Or Maybe I'm Not!!!!
Am I The Bot?
Or Maybe I'm Not!!!!
Am I The Bot?
Or Maybe I'm Not!!!!
Am I The Bot?
Or Maybe I'm Not!!!!