AllegroCache Tutorial. Franz Inc

Size: px
Start display at page:

Download "AllegroCache Tutorial. Franz Inc"

Transcription

1 AllegroCache Tutorial Franz Inc 1

2 Introduction AllegroCache is an object database built on top of the Common Lisp Object System. In this tutorial we will demonstrate how to use AllegroCache to build, retrieve and search for persistent objects. Loading AllegroCache You may have received AllegroCache as part of your ACL distribution or installed a newer version from our web site. In both cases, you will use require to load AllegroCache, however to load newer versions you will need to supply require with a second argument. For example, on Windows: cl-user(1): (require :acache) ; Fast loading C:\Program Files\acl80\code\acache.001 ;;; Installing acache patch, version 1 Warning: You have loaded AllegroCache version and newer versions have already been downloaded. (If you would like to disable this warning, then create a file named C:\Program Files\acl80\code\acache_inhibit_version_warning.txt. The contents of this file do not matter, so it can be of zero length.) To use one of the newer versions of AllegroCache, change the (require :acache) to one of the following, or, if you used `load' the specific the appropriate version directly: (require :acache "acache fasl") (require :acache "acache fasl") (require :acache "acache fasl") AllegroCache version ; Fast loading C:\Program Files\acl80\code\sax.001 ;;; Installing sax patch, version 1 ; Fast loading C:\Program Files\acl80\code\regexp2.fasl ; Fast loading C:\Program Files\acl80\code\yacc.fasl t cl-user(2): In this case, version is the default, and versions 1.0.3, and have already been installed and are ready to use. To load one of the specific versions listed above, exit Allegro CL and load it: cl-user(1): (require :acache "acache fasl") ; Fast loading C:\Program Files\acl80\code\acache fasl AllegroCache version ; Fast loading C:\Program Files\acl80\code\sax.001 ;;; Installing sax patch, version 1 t cl-user(2): 2

3 Newer versions of AllegroCache are not automatically loaded in preference to older versions. Newer versions of AllegroCache may not be compatible, so the decision to upgrade to newer versions must be a conscious one. Package AllegroCache symbols are in the db.allegrocache package which has the abbreviation db.ac. In the examples below we'll assume that the current package uses the db.allegrocache package so we will not precede AllegroCache symbols with package qualifiers. Sample Program The sample program we'll use in this tutorial is one that creates a tree. A tree consists of a set of nodes. Each node has zero or more child nodes. One node is not the child of any other node and we call that the root node. Nodes with zero children are called leaf nodes. We are interested in computing the maximum depth of each node. The maximum depth of a node is the maximum number of nodes from the given node along a path to a leaf node. The maximum depth of a leaf node is one. Make AllegroCache symbols accessible We ll be working in the user package but we want to be able to access AllegroCache symbols without package qualifiers. In order to do so we do cl-user(5): (defpackage :user (:use :db.allegrocache)) #<The common-lisp-user package> cl-user(6): If you're using the IDE on Windows or Linux then the default package is cg-user, not user, so you'll want to do cl-user(5): (defpackage :cg-user (:use :db.allegrocache)) #<The common-graphics-user package> cl-user(6): Defining a Persistent Class In Common Lisp classes are defined with defclass. When defining a class you specify a metaclass which then determines how objects of the defined class will be built. If you don't specify a metaclass the metaclass standard-class is assumed. In order to define a class whose members will be persistent you specify the metaclass persistent-class. When you define a persistent class you can also specify that a slot is indexed. An index is a table that maps values to objects. You use an index on slot X to answer the question 3

4 which objects have this value in slot X. Below is the defclass we'll use to define the objects we'll use to build our graph in persistent space. The parts of the defclass that are persistent-class specific are highlighted in bold. (defclass node () ((name :initarg :name :reader name :index :any-unique) (children :initarg :children :reader children) (max-depth :initform nil :accessor max-depth :index :any) ) (:metaclass persistent-class)) Each node object has a unique name, a list of children (which are node objects) and a max-depth which is the number of nodes in the longest path from this node to a leaf. We'll want to locate an object given its name thus we've declared an index for the name slot. We'll want to ask which nodes have a certain max-depth and thus we've added an index for the max-depth. The max-depth value isn't necessarily unique thus when we declare the index we don't include 'unique' in the index type. We'll also define a print method for the node class so we can see at a glance the name and max-depth of each node (defmethod print-object ((node node) stream) (format stream "#<node ~s max-depth: ~s>" (name node) (max-depth node))) Creating a Tree We begin by creating a database. In AllegroCache a database is a directory. The directory need not exist when the call to open-file-database is done; AllegroCache will create it. cl-user(5): (open-file-database "testit" :if-does-not-exist :create :if-exists :supersede) #x20fd48a2> The above call removes the database if it exists and then creates the database in the directory testit in the current directory. open-file-database returns a database object that can be passed to many of the functions in AllegroCache. open-file-database also sets the *allegrocache* variable to this database object. Functions that take a database object as an argument use the value of *allegrocache* as the default value, thus we didn't bother to capture the value returned by open-file-database. 4

5 Next we'll create a persistent node object and use retrieve-from-index to recover it from the database using its name. cl-user(6): (make-instance 'node :name "foo") #<node "foo" max-depth: nil> cl-user(7): (retrieve-from-index 'node 'name "foo") #<node "foo" max-depth: nil> AllegroCache is a transactional database which means that nothing is permanent until a commit is done. A rollback undoes all changes to the database since the last commit. Since we really don't want to keep the object we just created we'll rollback our changes (which consisted of creating a node named foo ) and we'll then use retrieve-from-index again to verify that the object is no longer present: cl-user(8): (rollback) 6 cl-user(9): (retrieve-from-index 'node 'name "foo") nil cl-user(10): In order to make an interesting tree we'll add a random number of children to each node. However in order to make this example reproducible we'll write our own random number generator which supplies the same values each time. The buildtree function below first builds the child nodes and then builds the node itself. If the max-children argument is zero then this is to be a leaf node. (defparameter *my-random-state* nil) (defun my-random (max) (mod (or (pop *my-random-state*) (progn (setq *my-random-state* '( )) 11)) max)) (defun buildtree (name max-children) (let (children) (if* (> max-children 0) then (dotimes (i (1+ (my-random max-children))) (push (buildtree (format nil "~a-~a" name i) (- max-children (my-random 3))) children))) (make-instance 'node :name name :children (nreverse children)))) 5

6 We initialize our personal random number generator and build a tree: cl-user(11): (setq *my-random-state* nil) nil cl-user(12): (buildtree "root" 5) #<node "root" max-depth: nil> cl-user(13): The root node of the tree will be named root and its children named root-0, root-1 and so on. At this point the tree is in the private memory of our Lisp process and not in the database, but we can access and modify it just as if it was in the persistent store. One feature of persistent classes not found in normal clos classes is that you iterate over all instances of a persistent class using the doclass macro. (When you run this example your results may be in a different order than shown below). cl-user(14): (doclass (obj 'node) (print obj)) #<node "root" max-depth: nil> #<node "root-1" max-depth: nil> #<node "root-1-0" max-depth: nil> #<node "root-1-0-1" max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root-1-0-0" max-depth: nil> #<node "root " max-depth: nil> #<node "root-0" max-depth: nil> #<node "root-0-3" max-depth: nil> #<node "root-0-3-0" max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root-0-2" max-depth: nil> #<node "root-0-2-0" max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> 6

7 #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root-0-1" max-depth: nil> #<node "root-0-1-0" max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root-0-0" max-depth: nil> #<node "root-0-0-1" max-depth: nil> #<node "root " max-depth: nil> #<node "root-0-0-0" max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> #<node "root " max-depth: nil> nil cl-user(15): Next we'll write a function to compute the max-depth value for each node. (defun compute-max-depth (node) (if* (max-depth node) thenret else (let ((max 0)) (dolist (child (children node)) (setq max (max max (compute-max-depth child)))) (setf (max-depth node) (1+ max))))) You'll note that setting values in persistent objects is done in the same way as in normal clos objects: using setf of a slot-writer function. We run this function beginning at the root node. We use retrieve-from-index to find the node named root. cl-user(15): (compute-max-depth (retrieve-from-index 'node 'name "root")) 9 cl-user(16): 7

8 Now we can verify that all the nodes have been assigned a max-depth value: cl-user(16): (doclass (obj 'node) (print obj)) #<node "root" max-depth: 9> #<node "root-1" max-depth: 5> #<node "root-1-0" max-depth: 4> #<node "root-1-0-1" max-depth: 3> #<node "root " max-depth: 2> #<node "root " max-depth: 1> #<node "root-1-0-0" max-depth: 2> #<node "root " max-depth: 1> #<node "root-0" max-depth: 8> #<node "root-0-3" max-depth: 4> #<node "root-0-3-0" max-depth: 3> #<node "root " max-depth: 2> #<node "root " max-depth: 1> #<node "root-0-2" max-depth: 7> #<node "root-0-2-0" max-depth: 6> #<node "root " max-depth: 5> #<node "root " max-depth: 4> #<node "root " max-depth: 3> #<node "root " max-depth: 2> #<node "root " max-depth: 1> #<node "root " max-depth: 3> #<node "root " max-depth: 2> #<node "root " max-depth: 1> #<node "root " max-depth: 4> #<node "root " max-depth: 3> #<node "root " max-depth: 2> #<node "root " max-depth: 1> #<node "root " max-depth: 1> #<node "root " max-depth: 5> #<node "root " max-depth: 4> #<node "root " max-depth: 3> #<node "root " max-depth: 2> #<node "root " max-depth: 1> #<node "root " max-depth: 3> #<node "root " max-depth: 2> #<node "root " max-depth: 1> #<node "root-0-1" max-depth: 5> #<node "root-0-1-0" max-depth: 4> #<node "root " max-depth: 3> #<node "root " max-depth: 2> #<node "root " max-depth: 1> #<node "root " max-depth: 2> #<node "root " max-depth: 1> #<node "root-0-0" max-depth: 5> 8

9 #<node "root-0-0-1" max-depth: 2> #<node "root " max-depth: 1> #<node "root-0-0-0" max-depth: 4> #<node "root " max-depth: 3> #<node "root " max-depth: 2> #<node "root " max-depth: 1> nil cl-user(17): We can see that the max-depth of the root node is 9 but it's not so clear from the above printing of the nodes which nodes are on the maximum length path from the root to a leaf. So we'll write a function to find and print all maximum paths: (defun print-longest-paths () ;; print the nodes in the longest path from root to leaf ;; there may be more than one solution, we print all ;; of them (let* ((root-node (retrieve-from-index 'node 'name "root"))) (search-longest-paths nil root-node))) (defun search-longest-paths (sofar node) (let ((depth (max-depth node))) (if* (children node) then (dolist (child (children node)) (if* (eql (max-depth child) (1- depth)) then (search-longest-paths (cons node sofar) child))) else ; hit a leaf, print solution (let ((ind 0)) (dolist (node (reverse (cons node sofar))) (dotimes (i ind) (write-char #\space)) (format t "~s~%" node) (incf ind)))))) and we'll run that function cl-user(18): (print-longest-paths) #<node "root" max-depth: 9> #<node "root-0" max-depth: 8> #<node "root-0-2" max-depth: 7> #<node "root-0-2-0" max-depth: 6> #<node "root " max-depth: 5> #<node "root " max-depth: 4> #<node "root " max-depth: 3> #<node "root " max-depth: 2> 9

10 #<node "root " max-depth: 1> #<node "root" max-depth: 9> #<node "root-0" max-depth: 8> #<node "root-0-2" max-depth: 7> #<node "root-0-2-0" max-depth: 6> #<node "root " max-depth: 5> #<node "root " max-depth: 4> #<node "root " max-depth: 3> #<node "root " max-depth: 2> #<node "root " max-depth: 1> nil cl-user(19): You can see that there are two paths of length 9. To save this tree in the database we must commit the transaction. cl-user(20) (commit) t cl-user(21): and finally when we're done with the database we should close it: cl-user(22): (close-database) #<AllegroCache db "testit" #x2072a5e2> cl-user(23): Composite Indexes Object databases such as AllegroCache derive their power from the fact that related objects often point to one another and thus you can navigate between such objects without doing queries over the whole database. There are times however when you want to extract information based on characteristics of objects where there are no explicit relations. In this case we use indexes that map from values to the objects that hold those values in a given slot. An important feature of indexes are that integer and string values in an index are sorted. This allows one to perform range queries using a cursor over the index. For some queries one index is not enough and that is the subject of the following example. A composite index is an index over the values of more than one slot. AllegroCache does not create composite indexes automatically (yet). That means that you must create them yourself and we'll show that this isn't very hard. 10

11 In our example we're keeping track of chess games. We have a set of players and a set of games between those players. In each game there is either a winner and a loser or the game was a draw. We'll define a player class whose instances represent the players. Each player will have a unique player number and then information about the player. We'll define a game class whose instances represent the games played. The information we'll save is a unique game number, the two players involved, and the result of the game. To complete our schema design we have to consider the kinds of queries we're likely to make on the database. We'll want to know how many games a player won, lost and drew. We could just store that information in the player object so that that would be a trivial question to answer. We'll want to to know which games a player won, lost and drew. This is much harder since no fixed and reasonably sized container can hold all the games now and into the future. We could store a three set objects in each player object, one each for win, lose and draw. This would work at some expense in space (now we have four persistent objects for each player). Now what if we wanted a list of all the games where Player A defeated Player B, or all the games where Player A and Player B drew? A matrix seems like the obvious solution but it doesn't scale well. If we have 10,000 players in our database we need a 100,000,000 element matrix to represent the results of two players meeting. One solution that can answer all the queries mentioned in the preceding paragraph is a composite index. We'll describe each game using a triple of these values of the game: the result the winner the loser We'll denote this by a triple: (R,W,L). So if Player 10 defeats Player 20 we'll denote this way: (Victory,10,20). If players 39 and 22 draw we'll denote it (Draw,22,39), making an arbitrary rule that in the case of a draw the lower numbered player is listed first. The next question is how should the triple be represented. The Lispy way would be to use a list but in an index there is no ordering between values that are lists and we'll see that using ordering is important. A better way to represent this triple is to encode the triple as an integer. We'll use this formula to create the integer: (+ (ash result 40) (ash winner 20) loser) where result is 1 if the game is a draw and 0 if the game resulted in a victory. winner and loser are the player's unique numbers. Here we allow 20 bits for the winner number and loser number. That means we can hold roughly a million players in our database. If you think that's too few you can replace the number 20 with a larger number. 11

12 Now that we've encoded the triple as an integer we can take advantage of the ordering of integers in an index. For example all of the games where player 67 wins will have index values greater than or equal to (+ (ash 0 40) (ash 67 20) 0) and less than (+ (ash 0 40) (ash 68 20) 0) We'll see that it's a simple matter in AllegroCache to enumerate all the objects with a range of integer values in an indexed slot. What if you want find all the index values where player 67 lost. The first possible one is (+ (ash 0 40) (ash 0 20) 67) and the next possible on is (+ (ash 0 40) (ash 1 20) 67) These numbers aren't consecutive so the ordering won't help. What you to solve this problem is to store a reverse encoded value in another slot and index on that. Thus (R,W,L) is reverse encoded (+ (ash result 40) (ash loser 20) winner) so that we can now pick a loser number and find all the associated winners in the following index numbers. Let's examine the code for this example. If you're running this under the IDE on Windows replace references to the :user package with the :cg-user package. (eval-when (compile load eval) (require :acache)) (defpackage :user (:use :db.allegrocache)) (in-package :user) (defclass game () ((number :index :any-unique :initarg :number :reader game-number) ; :victory, :draw (result :initarg :result :reader game-result) ; if :draw then winner slot is filled with player ; with the lower player-number (winner :initarg :winner :reader game-winner) (loser :initarg :loser 12

13 :reader game-loser) (encoded :initarg :encoded :index :any :reader game-encoded) (encoded-rev :initarg :encoded-rev :index :any :reader game-encoded-rev)) (:metaclass persistent-class)) (defclass player () ((number :index :any-unique :initarg :number :reader player-number) (name :initarg name :reader player-name)) (:metaclass persistent-class)) In the game object we store the encoding we discussed above in the encoding slot and the reverse encoding in the encoding-rev slot. In the real chess database both the player and game objects would contain a lot more information about the players and the game played. Next we'll show the code to build up a test database on which to run our queries. We create 50 players and pretend that 10,000 games were played between them. That's a lot of chess. (defparameter *number-of-players* 50) (defun build-test-case () (create-file-database "chess.db") ; create a set of players ; we should name them but that's not important ; for the demo (dotimes (i *number-of-players*) (make-instance 'player :number i)) ; make up a set of games (dotimes (i 10000) (multiple-value-bind (result winner loser) (choose-random-result) ; in the case of a draw we put lower numbered player 13

14 ; in the winner slot (if* (and (eq result :draw) (> winner loser)) then (rotatef winner loser)) (make-instance 'game :number i :result result :winner (retrieve-from-index 'player 'number winner) :loser (retrieve-from-index 'player 'number loser) :encoded (encode-game result winner loser) ))) (commit) (close-database)) :encoded-rev (encode-game result loser winner) (defun choose-random-result () (let* ((result (case (random 2) (0 :victory) (1 :draw))) (winner (random *number-of-players*)) (loser (loop (let ((player (random *number-of-players*))) (if* (not (eql player winner)) then (return player)))))) (values result winner loser))) This is the encoding function we mentioned earlier: (defun encode-game (result playera-number playerb-number) (+ (ash (case result (:victory 0) (:draw 1)) 40) (ash playera-number 20) playerb-number)) With just this code loaded we can run (build-test-case) to create and populate our database: cl-user(16): (build-test-case) #<AllegroCache db "/home/jkf/chess/chess.db" #x723cffca> cl-user(17): 14

15 Our first query will be to chose a possible result (e.g. player 23 defeated player 12) and then find in which games (if any) that result occurred. One way to execute this query is to inspect all the game objects (doclass (game 'game)...) and check for the desired result. This will take time proportional to the number of games played as well as causing memory bloat as the game objects are brought into memory (although they will be evicted from memory once the cache fills up). A better way is to use the index on the encoded slot. This index will bring us right to the games where a certain result occurred. (defun test-query-a () (open-file-database "chess.db") (dotimes (i 10) (multiple-value-bind (result winner loser) (choose-random-result) (if* (eq result :draw) then (format t "In which games did player ~s and ~s~ draw?~%" winner loser) (if* (> winner loser) then ; put in canonical order (rotatef winner loser)) else (format t "In which games did player ~s defeat ~ player ~s~%" winner loser)) (let ((enc (encode-game result winner loser))) (let ((games (retrieve-from-index 'game 'encoded enc :all t))) (if* (null games) then (format t " no games~%") else (dolist (game games) (format t " game ~s~%" (game-number game)))))) (terpri))) (close-database) ) The above function runs that type of query over 10 sample results. Most of the function is code to setup the test. The actual query is shown above in bold. It's just a call to retrieve-from-index. The output looks like cl-user(17): (test-query-a) In which games did player 13 and 24 draw? game 5437 game

16 In which games did player 17 defeat player 44 game 1157 game 513 game 9720 game 2040 In which games did player 18 and 46 draw? game 1340 game 1692 game 9468 game 9672 In which games did player 43 and 35 draw? game 9641 game 512 game 4206 game 616 In which games did player 9 defeat player 31 game 5056 In which games did player 26 and 44 draw? game 8179 game 8946 game 3805 game 9678 In which games did player 40 defeat player 21 game 1312 game 7245 In which games did player 0 and 47 draw? game 8630 game 693 game 654 game 3981 game 4106 game 3658 In which games did player 13 defeat player 28 game 4625 In which games did player 41 defeat player 31 game 2106 game 393 game 7303 game 1154 game

17 game 3137 #<AllegroCache db "/home/jkf/chess/chess.db" #x729c9732> cl-user(18): Suppose that you didn't want to know the exact games that a certain result occurred but were just interested in the number of such games. Here's a test that shows how that query is done. (defun test-query-b () (open-file-database "chess.db") (dotimes (i 10) (multiple-value-bind (result winner loser) (choose-random-result) (if* (eq result :draw) then (format t "In how many games did player ~s and ~s draw?~%" winner loser) (if* (> winner loser) then (rotatef winner loser)) else (format t "In how many games did player ~s defeat player ~s~%" winner loser)) (let ((enc (encode-game result winner loser))) (let ((count (length (retrieve-from-index 'game 'encoded enc :all t :oid t)))) (format t " ~s game~p~%" count count))) (terpri))) (close-database)) What is different in this case is that we specify :oid t since we don't want AllegroCache to bother creating the game objects since we're just going to count them. cl-user(18): (test-query-b) In how many games did player 16 defeat player 2 3 games In how many games did player 3 defeat player 10 0 games In how many games did player 20 and 45 draw? 17

18 5 games In how many games did player 46 and 16 draw? 5 games In how many games did player 22 and 20 draw? 5 games In how many games did player 29 defeat player 27 1 game In how many games did player 1 defeat player 36 0 games In how many games did player 37 defeat player 41 1 game In how many games did player 20 defeat player 29 2 games In how many games did player 25 defeat player 43 3 games #<AllegroCache db "/home/jkf/chess/chess.db" #x72c763d2> cl-user(19): Now you want to find a list of the games a player won. We'll use the index on the encoded slot and we'll make use of cursors since we want to examine a segment of the index. We can create a cursor that scans over the precise part of the index range that denotes a game won by a player. We test this on three random players: (defun test-query-win () (open-file-database "chess.db") (dotimes (i 3) (let ((player (random *number-of-players*))) (format t "Player ~s won these games~%" player) (let ((cur (create-index-cursor 'game 'encoded :initial-value (encode-game :victory player 0) (1+ player) 0)))) (unwind-protect :limit-value (encode-game :victory 18

19 (do ((game (next-index-cursor cur) (next-index-cursor cur))) ((null game)) (format t " In game ~s against player ~s~%" (game-number game) (player-number (game-loser game)))) (free-index-cursor cur)))) (terpri)) (close-database)) Running this function produces a large result so we'll omit most of the results below: cl-user(19): (test-query-win) Player 42 won these games In game 8024 against player 0 In game 1412 against player 0 In game 5678 against player 0 In game 1985 against player 1 In game 4164 against player 1... In game 5016 against player 47 In game 6000 against player 49 In game 6813 against player 49 Player 48 won these games In game 786 against player 0 In game 7202 against player 0 In game 7998 against player 0... In game 2087 against player 20 In game 177 against player 20 In game 444 against player 49 Player 22 won these games In game 379 against player 0 In game 9002 against player 0... In game 5872 against player 49 In game 1652 against player 49 #<AllegroCache db "/home/jkf/acl8/src/cl/src/acache/doc/examples/chess/chess.db" #x723dc57a> cl-user(20): Testing to see which games a player lost is the same as above but we check the encodedrev slot's index. 19

20 (defun test-query-lose () (open-file-database "chess.db") (dotimes (i 3) (let ((player (random *number-of-players*))) (format t "Player ~s lost these games~%" player) (let ((cur (create-index-cursor 'game 'encoded-rev :initial-value (encode-game :victory player 0) :limit-value (encode-game :victory (1+ player) 0)))) (unwind-protect (do ((game (next-index-cursor cur) (next-index-cursor cur))) ((null game)) (format t " In game ~s against player ~s~%" (game-number game) (player-number (game-winner game)))) (free-index-cursor cur)))) (terpri)) (close-database)) And finally check to see which games a player drew requires that you check the encoded and the encoded-rev index. The encoded index will show draws with players of higher numbers and the encoded-rev index will show draws with players of lower numbers (defun test-query-draw () (open-file-database "chess.db") (dotimes (i 3) (let ((player (random *number-of-players*))) 0)))) (format t "Player ~s drew these games~%" player) (let ((cur (create-index-cursor 'game 'encoded :initial-value (encode-game :draw player 0) :limit-value (encode-game :draw (1+ player) (unwind-protect (do ((game (next-index-cursor cur) (next-index-cursor cur))) ((null game)) (format t " In game ~s against player ~s~%" (game-number game) (player-number (game-loser game)))) (free-index-cursor cur))) (format t ".. and..~%") 20

21 0)))) (let ((cur (create-index-cursor 'game 'encoded-rev :initial-value (encode-game :draw player 0) :limit-value (encode-game :draw (1+ player) (unwind-protect (do ((game (next-index-cursor cur) (next-index-cursor cur))) ((null game)) (format t " In game ~s against player ~s~%" (game-number game) (player-number (game-winner game)))) (free-index-cursor cur)))) (terpri)) (close-database)) Running this function also produces a large result so we'll omit most of the results below: cl-user(45): (test-query-draw) Player 48 drew these games In game 2204 against player 49.. and.. In game 3549 against player 0 In game 2401 against player 0... In game 1028 against player 46 In game 2582 against player 46 Player 4 drew these games In game 5200 against player 5... In game 5927 against player 28 In game 8885 against player 28 #<AllegroCache db "/home/jkf/acl8/src/cl/src/acache/doc/examples/chess/chess.db" #x71c9afd2> cl-user(46): 21

MITOCW Project: Backgammon tutor MIT Multicore Programming Primer, IAP 2007

MITOCW Project: Backgammon tutor MIT Multicore Programming Primer, IAP 2007 MITOCW Project: Backgammon tutor MIT 6.189 Multicore Programming Primer, IAP 2007 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue

More information

Exploring Strategies to Generate and Solve Sudoku Grids. SUNY Oswego CSC 466 Spring '09 Theodore Trotz

Exploring Strategies to Generate and Solve Sudoku Grids. SUNY Oswego CSC 466 Spring '09 Theodore Trotz Exploring Strategies to Generate and Solve Sudoku Grids SUNY Oswego CSC 466 Spring '09 Theodore Trotz Terminology A Sudoku grid contains 81 cells Each cell is a member of a particular region, row, and

More information

CMPUT 396 Tic-Tac-Toe Game

CMPUT 396 Tic-Tac-Toe Game CMPUT 396 Tic-Tac-Toe Game Recall minimax: - For a game tree, we find the root minimax from leaf values - With minimax we can always determine the score and can use a bottom-up approach Why use minimax?

More information

The Emperor's New Repository

The Emperor's New Repository The Emperor's New Repository I don't know the first thing about building digital repositories. Maybe that's a strange thing to say, given that I work in a repository development group now, and worked on

More information

Positive Triangle Game

Positive Triangle Game Positive Triangle Game Two players take turns marking the edges of a complete graph, for some n with (+) or ( ) signs. The two players can choose either mark (this is known as a choice game). In this game,

More information

MITOCW ocw lec11

MITOCW ocw lec11 MITOCW ocw-6.046-lec11 Here 2. Good morning. Today we're going to talk about augmenting data structures. That one is 23 and that is 23. And I look here. For this one, And this is a -- Normally, rather

More information

Lisp: Case Study ref: Lisp (3 rd Ed) Winston & Horn (Chapter 6) Donald F. Ross

Lisp: Case Study ref: Lisp (3 rd Ed) Winston & Horn (Chapter 6) Donald F. Ross Lisp: Case Study ref: Lisp (3 rd Ed) Winston & Horn (Chapter 6) Donald F. Ross Lisp: Case Study Exercise build a library system object: book collection:library title / author / class (attributes) data

More information

These rules are intended to cover all game elements from the following sets. Pirates of the Spanish Main

These rules are intended to cover all game elements from the following sets. Pirates of the Spanish Main These rules are intended to cover all game elements from the following sets. Pirates of the Spanish Main Pirates of the Mysterious Islands Pirates of the Crimson Coast Pirates of the Frozen North Pirates

More information

Lecture 33: How can computation Win games against you? Chess: Mechanical Turk

Lecture 33: How can computation Win games against you? Chess: Mechanical Turk 4/2/0 CS 202 Introduction to Computation " UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department Lecture 33: How can computation Win games against you? Professor Andrea Arpaci-Dusseau Spring 200

More information

Environmental Stochasticity: Roc Flu Macro

Environmental Stochasticity: Roc Flu Macro POPULATION MODELS Environmental Stochasticity: Roc Flu Macro Terri Donovan recorded: January, 2010 All right - let's take a look at how you would use a spreadsheet to go ahead and do many, many, many simulations

More information

Adversary Search. Ref: Chapter 5

Adversary Search. Ref: Chapter 5 Adversary Search Ref: Chapter 5 1 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans is possible. Many games can be modeled very easily, although

More information

Made by Bla Map War 2 Manual Version 6 ( ) Page 1. Map War 2 Manual

Made by Bla Map War 2 Manual Version 6 ( ) Page 1. Map War 2 Manual Made by Bla Map War 2 Manual Version 6 (201209231931) Page 1 Map War 2 Manual Made by Bla Map War 2 Manual Version 6 (201209231931) Page 2 Content Map War 2 Manual... 1 Content... 2 Intro... 3 Initial

More information

CS 371M. Homework 2: Risk. All submissions should be done via git. Refer to the git setup, and submission documents for the correct procedure.

CS 371M. Homework 2: Risk. All submissions should be done via git. Refer to the git setup, and submission documents for the correct procedure. Homework 2: Risk Submission: All submissions should be done via git. Refer to the git setup, and submission documents for the correct procedure. The root directory of your repository should contain your

More information

COMPUTING CURRICULUM TOOLKIT

COMPUTING CURRICULUM TOOLKIT COMPUTING CURRICULUM TOOLKIT Pong Tutorial Beginners Guide to Fusion 2.5 Learn the basics of Logic and Loops Use Graphics Library to add existing Objects to a game Add Scores and Lives to a game Use Collisions

More information

running go tournaments with wintd

running go tournaments with wintd running go tournaments with wintd Please send comments and corrections to Larry Russ at lruss@stevens-tech.edu or (201) 216-5379 Contents: page I. Getting and Loading the Program 2 II. Running a Tournament

More information

Before displaying an image, the game should wait for a random amount of time.

Before displaying an image, the game should wait for a random amount of time. Reaction Introduction You are going to create a 2-player game to see who has the fastest reactions. The game will work by showing an image after a random amount of time - whoever presses their button first

More information

From Nothing to Something using AutoCAD Electrical

From Nothing to Something using AutoCAD Electrical From Nothing to Something using AutoCAD Electrical Todd Schmoock Synergis Technologies MA2085-L: You purchased AutoCAD Electrical, or are thinking about purchasing it, but you do not know how to use it.

More information

A Tic Tac Toe Learning Machine Involving the Automatic Generation and Application of Heuristics

A Tic Tac Toe Learning Machine Involving the Automatic Generation and Application of Heuristics A Tic Tac Toe Learning Machine Involving the Automatic Generation and Application of Heuristics Thomas Abtey SUNY Oswego Abstract Heuristics programs have been used to solve problems since the beginning

More information

Term Definition Introduced in:

Term Definition Introduced in: 60 Minutes of Access Secrets Key Terms Term Definition Introduced in: Calculated Field A field that displays the results of a calculation. Introduced in Access 2010, this field allows you to make calculations

More information

ENGI0531 Lab 2 Tutorial

ENGI0531 Lab 2 Tutorial ENGI0531 Lab 2 Tutorial Transient Analysis, Operating Points, Parameters and other miscellany Lakehead University Greg Toombs Winter 2009 1. Constructing the Circuit Copying a Cell View Start Cadence as

More information

QUICKSTART COURSE - MODULE 1 PART 2

QUICKSTART COURSE - MODULE 1 PART 2 QUICKSTART COURSE - MODULE 1 PART 2 copyright 2011 by Eric Bobrow, all rights reserved For more information about the QuickStart Course, visit http://www.acbestpractices.com/quickstart Hello, this is Eric

More information

Grade 6 Math Circles Combinatorial Games - Solutions November 3/4, 2015

Grade 6 Math Circles Combinatorial Games - Solutions November 3/4, 2015 Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 6 Math Circles Combinatorial Games - Solutions November 3/4, 2015 Chomp Chomp is a simple 2-player

More information

CMSC 671 Project Report- Google AI Challenge: Planet Wars

CMSC 671 Project Report- Google AI Challenge: Planet Wars 1. Introduction Purpose The purpose of the project is to apply relevant AI techniques learned during the course with a view to develop an intelligent game playing bot for the game of Planet Wars. Planet

More information

For this assignment, your job is to create a program that plays (a simplified version of) blackjack. Name your program blackjack.py.

For this assignment, your job is to create a program that plays (a simplified version of) blackjack. Name your program blackjack.py. CMPT120: Introduction to Computing Science and Programming I Instructor: Hassan Khosravi Summer 2012 Assignment 3 Due: July 30 th This assignment is to be done individually. ------------------------------------------------------------------------------------------------------------

More information

CONTENTS. 1. Number of Players. 2. General. 3. Ending the Game. FF-TCG Comprehensive Rules ver.1.0 Last Update: 22/11/2017

CONTENTS. 1. Number of Players. 2. General. 3. Ending the Game. FF-TCG Comprehensive Rules ver.1.0 Last Update: 22/11/2017 FF-TCG Comprehensive Rules ver.1.0 Last Update: 22/11/2017 CONTENTS 1. Number of Players 1.1. This document covers comprehensive rules for the FINAL FANTASY Trading Card Game. The game is played by two

More information

MITOCW R3. Document Distance, Insertion and Merge Sort

MITOCW R3. Document Distance, Insertion and Merge Sort MITOCW R3. Document Distance, Insertion and Merge Sort The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational

More information

MITOCW watch?v=fp7usgx_cvm

MITOCW watch?v=fp7usgx_cvm MITOCW watch?v=fp7usgx_cvm Let's get started. So today, we're going to look at one of my favorite puzzles. I'll say right at the beginning, that the coding associated with the puzzle is fairly straightforward.

More information

MITOCW watch?v=zkcj6jrhgy8

MITOCW watch?v=zkcj6jrhgy8 MITOCW watch?v=zkcj6jrhgy8 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

More information

Rev a. Single-Area OSPF. c cnac o okbook.com

Rev a. Single-Area OSPF. c cnac o okbook.com Rev. 00.00 a. Single-Area OSPF c cnac o okbook.com C O N F I G U R A T I O N Technically, we're using OSPFv for IPv, but that only matters because IPv uses OSPFv. Wildcard a bitmask controlling address

More information

Contribute to CircuitPython with Git and GitHub

Contribute to CircuitPython with Git and GitHub Contribute to CircuitPython with Git and GitHub Created by Kattni Rembor Last updated on 2018-07-25 10:04:11 PM UTC Guide Contents Guide Contents Overview Requirements Expectations Grab Your Fork Clone

More information

Problem A Rearranging a Sequence

Problem A Rearranging a Sequence Problem A Rearranging a Sequence Input: Standard Input Time Limit: seconds You are given an ordered sequence of integers, (,,,...,n). Then, a number of requests will be given. Each request specifies an

More information

CS 331: Artificial Intelligence Adversarial Search II. Outline

CS 331: Artificial Intelligence Adversarial Search II. Outline CS 331: Artificial Intelligence Adversarial Search II 1 Outline 1. Evaluation Functions 2. State-of-the-art game playing programs 3. 2 player zero-sum finite stochastic games of perfect information 2 1

More information

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger. Project #3: Checkers

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger. Project #3: Checkers UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division CS61B Fall 2004 P. N. Hilfinger Project #3: Checkers Due: 8 December 2004 1 Introduction Checkers

More information

MITOCW R7. Comparison Sort, Counting and Radix Sort

MITOCW R7. Comparison Sort, Counting and Radix Sort MITOCW R7. Comparison Sort, Counting and Radix Sort The following content is provided under a Creative Commons license. B support will help MIT OpenCourseWare continue to offer high quality educational

More information

SteamVR Unity Plugin Quickstart Guide

SteamVR Unity Plugin Quickstart Guide The SteamVR Unity plugin comes in three different versions depending on which version of Unity is used to download it. 1) v4 - For use with Unity version 4.x (tested going back to 4.6.8f1) 2) v5 - For

More information

Three of these grids share a property that the other three do not. Can you find such a property? + mod

Three of these grids share a property that the other three do not. Can you find such a property? + mod PPMTC 22 Session 6: Mad Vet Puzzles Session 6: Mad Veterinarian Puzzles There is a collection of problems that have come to be known as "Mad Veterinarian Puzzles", for reasons which will soon become obvious.

More information

Algorithms for Data Structures: Search for Games. Phillip Smith 27/11/13

Algorithms for Data Structures: Search for Games. Phillip Smith 27/11/13 Algorithms for Data Structures: Search for Games Phillip Smith 27/11/13 Search for Games Following this lecture you should be able to: Understand the search process in games How an AI decides on the best

More information

Triple Challenge.txt

Triple Challenge.txt Triple Challenge 3 Complete Games in 1 Cartridge Chess Checkers Backgammon Playing Instructions For 1 or 2 Players TRIPLE CHALLENGE Triple Challenge.txt TRIPLE CHALLENGE is an exciting breakthrough in

More information

Handling Search Inconsistencies in MTD(f)

Handling Search Inconsistencies in MTD(f) Handling Search Inconsistencies in MTD(f) Jan-Jaap van Horssen 1 February 2018 Abstract Search inconsistencies (or search instability) caused by the use of a transposition table (TT) constitute a well-known

More information

MITOCW R11. Principles of Algorithm Design

MITOCW R11. Principles of Algorithm Design MITOCW R11. Principles of Algorithm Design The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources

More information

ACC-1. Arcade Crane Controller. Manual Rev Page 1 of 9

ACC-1. Arcade Crane Controller. Manual Rev Page 1 of 9 ACC-1 Arcade Crane Controller Manual Rev. 1.5 Page 1 of 9 Table of Contents 1.0 Introduction... 4 2.0 System Configuration... 4 3.0 Accounts Menu... 6 Coins & Bills... 6 Service Credits... 6 Play Count...

More information

Mint Tin Mini Skulduggery

Mint Tin Mini Skulduggery Mint Tin Mini Skulduggery 1-4 player, 10- to 25-minute dice game How much is your spirit worth? Invoke the ethereal realm to roll spirit points, shatter others, and push the limits without unleashing skulduggery!

More information

Force of Will Comprehensive Rules ver. 6.4 Last Update: June 5 th, 2017 Effective: June 16 th, 2017

Force of Will Comprehensive Rules ver. 6.4 Last Update: June 5 th, 2017 Effective: June 16 th, 2017 Force of Will Comprehensive Rules ver. 6.4 Last Update: June 5 th, 2017 Effective: June 16 th, 2017 100. Overview... 3 101. General... 3 102. Number of players... 3 103. How to win... 3 104. Golden rules

More information

Discrete Random Variables Day 1

Discrete Random Variables Day 1 Discrete Random Variables Day 1 What is a Random Variable? Every probability problem is equivalent to drawing something from a bag (perhaps more than once) Like Flipping a coin 3 times is equivalent to

More information

Lesson 2: Choosing Colors and Painting Chapter 1, Video 1: "Lesson 2 Introduction"

Lesson 2: Choosing Colors and Painting Chapter 1, Video 1: Lesson 2 Introduction Chapter 1, Video 1: "Lesson 2 Introduction" Welcome to Lesson 2. Now that you've had a chance to play with Photoshop a little bit and explore its interface, and the interface is becoming a bit more familiar

More information

MITOCW R22. Dynamic Programming: Dance Dance Revolution

MITOCW R22. Dynamic Programming: Dance Dance Revolution MITOCW R22. Dynamic Programming: Dance Dance Revolution The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational

More information

Eleventh Annual Ohio Wesleyan University Programming Contest April 1, 2017 Rules: 1. There are six questions to be completed in four hours. 2.

Eleventh Annual Ohio Wesleyan University Programming Contest April 1, 2017 Rules: 1. There are six questions to be completed in four hours. 2. Eleventh Annual Ohio Wesleyan University Programming Contest April 1, 217 Rules: 1. There are six questions to be completed in four hours. 2. All questions require you to read the test data from standard

More information

MITOCW R9. Rolling Hashes, Amortized Analysis

MITOCW R9. Rolling Hashes, Amortized Analysis MITOCW R9. Rolling Hashes, Amortized Analysis The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources

More information

MITOCW watch?v=2ddjhvh8d2k

MITOCW watch?v=2ddjhvh8d2k MITOCW watch?v=2ddjhvh8d2k The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

More information

QUICKSTART COURSE - MODULE 7 PART 3

QUICKSTART COURSE - MODULE 7 PART 3 QUICKSTART COURSE - MODULE 7 PART 3 copyright 2011 by Eric Bobrow, all rights reserved For more information about the QuickStart Course, visit http://www.acbestpractices.com/quickstart Hello, this is Eric

More information

Bachelor Project Major League Wizardry: Game Engine. Phillip Morten Barth s113404

Bachelor Project Major League Wizardry: Game Engine. Phillip Morten Barth s113404 Bachelor Project Major League Wizardry: Game Engine Phillip Morten Barth s113404 February 28, 2014 Abstract The goal of this project is to design and implement a flexible game engine based on the rules

More information

Physical Inventory System User Manual. Version 19

Physical Inventory System User Manual. Version 19 Physical Inventory System User Manual Version 19 0 Physical Inventory System User Manual 1 Table of Contents 1. Prepare for Physical Inventory... 2. Chapter 1: Starting Inventory... 2.1. CDK/ADP... 3.

More information

CPS331 Lecture: Genetic Algorithms last revised October 28, 2016

CPS331 Lecture: Genetic Algorithms last revised October 28, 2016 CPS331 Lecture: Genetic Algorithms last revised October 28, 2016 Objectives: 1. To explain the basic ideas of GA/GP: evolution of a population; fitness, crossover, mutation Materials: 1. Genetic NIM learner

More information

Introduction to Probability

Introduction to Probability 6.04/8.06J Mathematics for omputer Science Srini Devadas and Eric Lehman pril 4, 005 Lecture Notes Introduction to Probability Probability is the last topic in this course and perhaps the most important.

More information

CS 380: ARTIFICIAL INTELLIGENCE MONTE CARLO SEARCH. Santiago Ontañón

CS 380: ARTIFICIAL INTELLIGENCE MONTE CARLO SEARCH. Santiago Ontañón CS 380: ARTIFICIAL INTELLIGENCE MONTE CARLO SEARCH Santiago Ontañón so367@drexel.edu Recall: Adversarial Search Idea: When there is only one agent in the world, we can solve problems using DFS, BFS, ID,

More information

Lesson 15: Graphics. Introducing Computer Graphics. Computer Programming is Fun! Pixels. Coordinates

Lesson 15: Graphics. Introducing Computer Graphics. Computer Programming is Fun! Pixels. Coordinates Lesson 15: Graphics The purpose of this lesson is to prepare you with concepts and tools for writing interesting graphical programs. This lesson will cover the basic concepts of 2-D computer graphics in

More information

TURNING ADVANTAGE INTO VICTORY IN CHESS: ALGEBRAIC NOTATION (MCKAY CHESS LIBRARY) BY ANDREW SOLTIS

TURNING ADVANTAGE INTO VICTORY IN CHESS: ALGEBRAIC NOTATION (MCKAY CHESS LIBRARY) BY ANDREW SOLTIS Read Online and Download Ebook TURNING ADVANTAGE INTO VICTORY IN CHESS: ALGEBRAIC NOTATION (MCKAY CHESS LIBRARY) BY ANDREW SOLTIS DOWNLOAD EBOOK : TURNING ADVANTAGE INTO VICTORY IN CHESS: ALGEBRAIC NOTATION

More information

CS 540-2: Introduction to Artificial Intelligence Homework Assignment #2. Assigned: Monday, February 6 Due: Saturday, February 18

CS 540-2: Introduction to Artificial Intelligence Homework Assignment #2. Assigned: Monday, February 6 Due: Saturday, February 18 CS 540-2: Introduction to Artificial Intelligence Homework Assignment #2 Assigned: Monday, February 6 Due: Saturday, February 18 Hand-In Instructions This assignment includes written problems and programming

More information

Game Theory and Randomized Algorithms

Game Theory and Randomized Algorithms Game Theory and Randomized Algorithms Guy Aridor Game theory is a set of tools that allow us to understand how decisionmakers interact with each other. It has practical applications in economics, international

More information

CS103 Handout 25 Spring 2017 May 5, 2017 Problem Set 5

CS103 Handout 25 Spring 2017 May 5, 2017 Problem Set 5 CS103 Handout 25 Spring 2017 May 5, 2017 Problem Set 5 This problem set the last one purely on discrete mathematics is designed as a cumulative review of the topics we ve covered so far and a proving ground

More information

CSE 332: Data Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning. Playing Games. X s Turn. O s Turn. X s Turn.

CSE 332: Data Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning. Playing Games. X s Turn. O s Turn. X s Turn. CSE 332: ata Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning This handout describes the most essential algorithms for game-playing computers. NOTE: These are only partial algorithms:

More information

Achieving Desirable Gameplay Objectives by Niched Evolution of Game Parameters

Achieving Desirable Gameplay Objectives by Niched Evolution of Game Parameters Achieving Desirable Gameplay Objectives by Niched Evolution of Game Parameters Scott Watson, Andrew Vardy, Wolfgang Banzhaf Department of Computer Science Memorial University of Newfoundland St John s.

More information

CIS 2033 Lecture 6, Spring 2017

CIS 2033 Lecture 6, Spring 2017 CIS 2033 Lecture 6, Spring 2017 Instructor: David Dobor February 2, 2017 In this lecture, we introduce the basic principle of counting, use it to count subsets, permutations, combinations, and partitions,

More information

NI 272x Help. Related Documentation. NI 272x Hardware Fundamentals

NI 272x Help. Related Documentation. NI 272x Hardware Fundamentals Page 1 of 73 NI 272x Help September 2013, 374090A-01 This help file contains fundamental and advanced concepts necessary for using the National Instruments 272x programmable resistor modules. National

More information

MITOCW Recitation 9b: DNA Sequence Matching

MITOCW Recitation 9b: DNA Sequence Matching MITOCW Recitation 9b: DNA Sequence Matching The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources

More information

Discovering A Lucrative Niche!

Discovering A Lucrative Niche! Lesson #2 Discovering A Lucrative Niche! By Jay Jennings http://www.productcreationstation.com NOTICE: You Do NOT Have the Right to Reprint or Resell this Report! You Also MAY NOT Give Away, Sell or Share

More information

Outline. Game Playing. Game Problems. Game Problems. Types of games Playing a perfect game. Playing an imperfect game

Outline. Game Playing. Game Problems. Game Problems. Types of games Playing a perfect game. Playing an imperfect game Outline Game Playing ECE457 Applied Artificial Intelligence Fall 2007 Lecture #5 Types of games Playing a perfect game Minimax search Alpha-beta pruning Playing an imperfect game Real-time Imperfect information

More information

More on games (Ch )

More on games (Ch ) More on games (Ch. 5.4-5.6) Alpha-beta pruning Previously on CSci 4511... We talked about how to modify the minimax algorithm to prune only bad searches (i.e. alpha-beta pruning) This rule of checking

More information

Can I Change My Wordpress Theme Without Losing Content

Can I Change My Wordpress Theme Without Losing Content Can I Change My Wordpress Theme Without Losing Content Learn how to update a WordPress theme without losing customization. Go to /wpcontent/themes/ and download your theme folder to your computer. Fifteen

More information

The Theory Behind the z/architecture Sort Assist Instructions

The Theory Behind the z/architecture Sort Assist Instructions The Theory Behind the z/architecture Sort Assist Instructions SHARE in San Jose August 10-15, 2008 Session 8121 Michael Stack NEON Enterprise Software, Inc. 1 Outline A Brief Overview of Sorting Tournament

More information

PING. Table of Contents. PING GameMaker Studio Assignment CIS 125G 1. Lane Community College 2015

PING. Table of Contents. PING GameMaker Studio Assignment CIS 125G 1. Lane Community College 2015 PING GameMaker Studio Assignment CIS 125G 1 PING Lane Community College 2015 Table of Contents SECTION 0 OVERVIEW... 2 SECTION 1 RESOURCES... 3 SECTION 2 PLAYING THE GAME... 4 SECTION 3 UNDERSTANDING THE

More information

MAS336 Computational Problem Solving. Problem 3: Eight Queens

MAS336 Computational Problem Solving. Problem 3: Eight Queens MAS336 Computational Problem Solving Problem 3: Eight Queens Introduction Francis J. Wright, 2007 Topics: arrays, recursion, plotting, symmetry The problem is to find all the distinct ways of choosing

More information

Southeastern European Regional Programming Contest Bucharest, Romania Vinnytsya, Ukraine October 21, Problem A Concerts

Southeastern European Regional Programming Contest Bucharest, Romania Vinnytsya, Ukraine October 21, Problem A Concerts Problem A Concerts File: A.in File: standard output Time Limit: 0.3 seconds (C/C++) Memory Limit: 128 megabytes John enjoys listening to several bands, which we shall denote using A through Z. He wants

More information

Adversarial Search 1

Adversarial Search 1 Adversarial Search 1 Adversarial Search The ghosts trying to make pacman loose Can not come up with a giant program that plans to the end, because of the ghosts and their actions Goal: Eat lots of dots

More information

CS 1410 Final Project: TRON-41

CS 1410 Final Project: TRON-41 CS 1410 Final Project: TRON-41 Due: Monday December 10 1 Introduction In this project, you will create a bot to play TRON-41, a modified version of the game TRON. 2 The Game 2.1 The Basics TRON-41 is a

More information

Module 1: From Chaos to Clarity: Traders Let s Get Ready for 2015!

Module 1: From Chaos to Clarity: Traders Let s Get Ready for 2015! Module 1: From Chaos to Clarity: Traders Let s Get Ready for 2015! Hi, this is Kim Krompass and this is Module 1: From Chaos to Clarity: Trader's Let's Get Ready for 2015! In this module, I want to do

More information

ARTIFICIAL INTELLIGENCE (CS 370D)

ARTIFICIAL INTELLIGENCE (CS 370D) Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) (CHAPTER-5) ADVERSARIAL SEARCH ADVERSARIAL SEARCH Optimal decisions Min algorithm α-β pruning Imperfect,

More information

1 In the Beginning the Numbers

1 In the Beginning the Numbers INTEGERS, GAME TREES AND SOME UNKNOWNS Samee Ullah Khan Department of Computer Science and Engineering University of Texas at Arlington Arlington, TX 76019, USA sakhan@cse.uta.edu 1 In the Beginning the

More information

Dependence. Math Circle. October 15, 2016

Dependence. Math Circle. October 15, 2016 Dependence Math Circle October 15, 2016 1 Warm up games 1. Flip a coin and take it if the side of coin facing the table is a head. Otherwise, you will need to pay one. Will you play the game? Why? 2. If

More information

Tutorial: Creating maze games

Tutorial: Creating maze games Tutorial: Creating maze games Copyright 2003, Mark Overmars Last changed: March 22, 2003 (finished) Uses: version 5.0, advanced mode Level: Beginner Even though Game Maker is really simple to use and creating

More information

Coding for Efficiency

Coding for Efficiency Let s suppose that, over some channel, we want to transmit text containing only 4 symbols, a, b, c, and d. Further, let s suppose they have a probability of occurrence in any block of text we send as follows

More information

The Fantom-X Experience

The Fantom-X Experience ÂØÒňΠWorkshop The Fantom-X Experience 2005 Roland Corporation U.S. All rights reserved. No part of this publication may be reproduced in any form without the written permission of Roland Corporation

More information

STARCRAFT 2 is a highly dynamic and non-linear game.

STARCRAFT 2 is a highly dynamic and non-linear game. JOURNAL OF COMPUTER SCIENCE AND AWESOMENESS 1 Early Prediction of Outcome of a Starcraft 2 Game Replay David Leblanc, Sushil Louis, Outline Paper Some interesting things to say here. Abstract The goal

More information

MITOCW 8. Hashing with Chaining

MITOCW 8. Hashing with Chaining MITOCW 8. Hashing with Chaining The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free.

More information

Game Tree Search. CSC384: Introduction to Artificial Intelligence. Generalizing Search Problem. General Games. What makes something a game?

Game Tree Search. CSC384: Introduction to Artificial Intelligence. Generalizing Search Problem. General Games. What makes something a game? CSC384: Introduction to Artificial Intelligence Generalizing Search Problem Game Tree Search Chapter 5.1, 5.2, 5.3, 5.6 cover some of the material we cover here. Section 5.6 has an interesting overview

More information

10 Steps To a Faster PC

10 Steps To a Faster PC 10 Steps To a Faster PC A Beginners Guide to Speeding Up a Slow Computer Laura Bungarz This book is for sale at http://leanpub.com/10stepstoafasterpc This version was published on 2016-05-18 ISBN 978-0-9938533-0-2

More information

33-2 Satellite Takeoff Tutorial--Flat Roof Satellite Takeoff Tutorial--Flat Roof

33-2 Satellite Takeoff Tutorial--Flat Roof Satellite Takeoff Tutorial--Flat Roof 33-2 Satellite Takeoff Tutorial--Flat Roof Satellite Takeoff Tutorial--Flat Roof A RoofLogic Digitizer license upgrades RoofCAD so that you have the ability to digitize paper plans, electronic plans and

More information

Experiments on Alternatives to Minimax

Experiments on Alternatives to Minimax Experiments on Alternatives to Minimax Dana Nau University of Maryland Paul Purdom Indiana University April 23, 1993 Chun-Hung Tzeng Ball State University Abstract In the field of Artificial Intelligence,

More information

SoundCheck 11 Quick Start Guide

SoundCheck 11 Quick Start Guide Software Install Basics Upgrading From an Earlier Version If you are upgrading from an earlier version of SoundCheck 11.1 (or Beta version) you should copy the old installation folder and name it "SoundCheck

More information

The Slide Master and Sections for Organization: Inserting, Deleting, and Moving Around Slides and Sections

The Slide Master and Sections for Organization: Inserting, Deleting, and Moving Around Slides and Sections The Slide Master and Sections for Organization: Inserting, Deleting, and Moving Around Slides and Sections Welcome to the next lesson in the third module of this PowerPoint course. This time around, we

More information

Project 1: A Game of Greed

Project 1: A Game of Greed Project 1: A Game of Greed In this project you will make a program that plays a dice game called Greed. You start only with a program that allows two players to play it against each other. You will build

More information

036-ShopDrawings hsbinoutput/shop Drawings

036-ShopDrawings hsbinoutput/shop Drawings 1 FUNCTION The function of this document is to provide information on how to use the shop drawings (hsbinoutput\shop drawings) in hsb2009+. In hsbcad you have Element drawings that can be generated automatically

More information

More on games (Ch )

More on games (Ch ) More on games (Ch. 5.4-5.6) Announcements Midterm next Tuesday: covers weeks 1-4 (Chapters 1-4) Take the full class period Open book/notes (can use ebook) ^^ No programing/code, internet searches or friends

More information

Read & Download (PDF Kindle) Lotto Winning Wheels For Powerball & Mega Millions, 2006 Edition

Read & Download (PDF Kindle) Lotto Winning Wheels For Powerball & Mega Millions, 2006 Edition Read & Download (PDF Kindle) Lotto Winning Wheels For Powerball & Mega Millions, 2006 Edition The new 2006 2nd edition of Gail Howard s book, Lotto Winning Wheels for Powerball & Mega Millions, has several

More information

What is Dual Boxing? Why Should I Dual Box? Table of Contents

What is Dual Boxing? Why Should I Dual Box? Table of Contents Table of Contents What is Dual Boxing?...1 Why Should I Dual Box?...1 What Do I Need To Dual Box?...2 Windowed Mode...3 Optimal Setups for Dual Boxing...5 This is the best configuration for dual or multi-boxing....5

More information

Huffman Coding - A Greedy Algorithm. Slides based on Kevin Wayne / Pearson-Addison Wesley

Huffman Coding - A Greedy Algorithm. Slides based on Kevin Wayne / Pearson-Addison Wesley - A Greedy Algorithm Slides based on Kevin Wayne / Pearson-Addison Wesley Greedy Algorithms Greedy Algorithms Build up solutions in small steps Make local decisions Previous decisions are never reconsidered

More information

Rolando s Rights. I'm talking about before I was sick. I didn't get paid for two weeks. The owner said he doesn't owe you anything.

Rolando s Rights. I'm talking about before I was sick. I didn't get paid for two weeks. The owner said he doesn't owe you anything. Rolando s Rights Rolando. José, I didn't get paid for my last two weeks on the job. I need that money. I worked for it. I'm sorry. I told you on the phone, I want to help but there's nothing I can do.

More information

How to Make Games in MakeCode Arcade Created by Isaac Wellish. Last updated on :10:15 PM UTC

How to Make Games in MakeCode Arcade Created by Isaac Wellish. Last updated on :10:15 PM UTC How to Make Games in MakeCode Arcade Created by Isaac Wellish Last updated on 2019-04-04 07:10:15 PM UTC Overview Get your joysticks ready, we're throwing an arcade party with games designed by you & me!

More information

CS 480: GAME AI TACTIC AND STRATEGY. 5/15/2012 Santiago Ontañón

CS 480: GAME AI TACTIC AND STRATEGY. 5/15/2012 Santiago Ontañón CS 480: GAME AI TACTIC AND STRATEGY 5/15/2012 Santiago Ontañón santi@cs.drexel.edu https://www.cs.drexel.edu/~santi/teaching/2012/cs480/intro.html Reminders Check BBVista site for the course regularly

More information

RPG CREATOR QUICKSTART

RPG CREATOR QUICKSTART INTRODUCTION RPG CREATOR QUICKSTART So you've downloaded the program, opened it up, and are seeing the Engine for the first time. RPG Creator is not hard to use, but at first glance, there is so much to

More information