Go is an abstract strategy board game for two players, in which the aim is to surround more territory than the opponent. The game was invented in China more than 2,500 years ago and is believed to be the oldest board game continuously played to the present day. A 2016 survey by the International Go Federation's 75 member nations found that there are over 46 million people worldwide who know how to play Go and over 20 million current players, the majority of whom live in East Asia; the playing pieces are called "stones". One player uses the other, black; the players take. Once placed on the board, stones may not be moved, but stones are removed from the board if "captured". Capture happens when a stone or group of stones is surrounded by opposing stones on all orthogonally-adjacent points; the game proceeds. When a game concludes, the winner is determined by counting each player's surrounded territory along with captured stones and komi. Games may be terminated by resignation. A teacher might simplify the explanation by saying to a student "you may place your stone on any point on the board, but if I surround that stone, I will remove it."
The standard Go board has a 19×19 grid of lines, containing 361 points. Beginners play on smaller 9×9 and 13×13 boards, archaeological evidence shows that the game was played in earlier centuries on a board with a 17×17 grid. However, boards with a 19×19 grid had become standard by the time the game had reached Korea in the 5th century CE and Japan in the 7th century CE. Go was considered one of the four essential arts of the cultured aristocratic Chinese scholars in antiquity; the earliest written reference to the game is recognized as the historical annal Zuo Zhuan. Despite its simple rules, Go is complex. Compared to chess, Go has both a larger board with more scope for play and longer games, and, on average, many more alternatives to consider per move; the lower bound on the number of legal board positions in Go has been estimated to be 2 x 10170. The word "Go" is derived from the full Japanese name igo, derived from its Chinese name weiqi, which translates as "board game of surrounding" or "encircling game".
To differentiate the game from the common English verb to go, "g" is capitalized, or, in events sponsored by the Ing Chang-ki Foundation, it is spelled "goe". The Korean word baduk derives from the Middle Korean word Badok, the origin of, controversial. Less plausible etymologies include a derivation of "Badukdok", referring to the playing pieces of the game, or a derivation from Chinese 排子, meaning "to arrange pieces". Go is an adversarial game with the objective of surrounding a larger total area of the board with one's stones than the opponent; as the game progresses, the players position stones on the board to map out formations and potential territories. Contests between opposing formations are extremely complex and may result in the expansion, reduction, or wholesale capture and loss of formation stones. A basic principle of Go is that a group of stones must have at least one "liberty" to remain on the board. A "liberty" is an open "point" bordering the group. An enclosed liberty is called an "eye", a group of stones with two or more eyes is said to be unconditionally "alive".
Such groups cannot be captured if surrounded. The general strategy is to expand one's territory, attack the opponent's weak groups, always stay mindful of the "life status" of one's own groups; the liberties of groups are countable. Situations where mutually opposing groups must capture each other or die are called capturing races, or semeai. In a capturing race, the group with more liberties will be able to capture the opponent's stones. Capturing races and the elements of life or death are the primary challenges of Go. A player may pass on determining; the game ends when both players pass, is scored. For each player, the number of captured stones is subtracted from the number of controlled points in "liberties" or "eyes", the player with the greater score wins the game. Games may be won by resignation of the opponent. In the opening stages of the game, players establish positions in the corners and around the sides of the board; these bases help to develop strong shapes which have many options for life and establish formations for potential territory.
Players start in the corners because establishing territory is easier with the aid of two edges of the board. Established corner opening sequences are called "joseki" and are studied independently."Dame" are points that lie in between the boundary walls of black and white, as such are considered to be of no value to either side. "Seki" are mutually alive pairs of black groups where neither has two eyes. A "ko" is a repeated-position shape. After the forcing move is played, the ko may be "taken back" and returned to its original position; some "ko fights" may be important and decide the life of a large group, while others may be worth just one or two points. Some ko fights
In computer graphics, alpha compositing is the process of combining an image with a background to create the appearance of partial or full transparency. It is useful to render image elements in separate passes, combine the resulting multiple 2D images into a single, final image called the composite. For example, compositing is used extensively when combining computer-rendered image elements with live footage. In order to combine these image elements it is necessary to keep an associated matte for each element; this matte contains the coverage information—the shape of the geometry being drawn—making it possible to distinguish between parts of the image where the geometry was drawn and other parts of the image that are empty. To store matte information, the concept of an alpha channel was introduced by Alvy Ray Smith in the late 1970s, developed in a 1984 paper by Thomas Porter and Tom Duff. In a 2D image element, which stores a color for each pixel, additional data is stored in the alpha channel with a value between 0 and 1.
A value of 0 means that the pixel is transparent. A value of 1 means that the pixel is opaque because the geometry overlapped the pixel. If an alpha channel is used in an image, there are two common representations that are available: straight alpha, premultiplied alpha. With straight alpha, the RGB components represent the color of the object or pixel, disregarding its opacity. With premultiplied alpha, the RGB components represent the emission of the object or pixel, the alpha represents the occlusion. A more obvious advantage of this is that, in certain situations, it can save a subsequent multiplication. However, the most significant advantages of using premultiplied alpha are for correctness and simplicity rather than performance: premultiplied alpha allows correct filtering and blending. In addition, premultiplied alpha allows regions of regular alpha blending and regions with additive blending mode to be encoded within the same image, because channel values are stored in a fixed-point format which bounds the values to be between 0 and 1.
Assuming that the pixel color is expressed using straight RGBA tuples, a pixel value of implies a pixel that has 70% of the maximum green intensity and 50% opacity. If the color were green, its RGBA would be. However, if this pixel uses premultiplied alpha, all of the RGB values are as though they were scaled for occlusion by 0.5 and the alpha is appended to the end to yield. In this case, the 0.35 value for the G channel indicates 70% green emission intensity. A pure green emission would be encoded as. For this reason, knowing whether a file uses straight or premultiplied alpha is essential to process or composite it as a different formula is used, it is entirely acceptable to have an RGBA triplet express emission with no occlusion, such as. Fires and flames, glows and other such phenomena can only be represented using associated / premultiplied alpha; the only important difference is in the dynamic range of the colour representation in finite precision numerical calculations: premultiplied alpha has a unique representation for transparent pixels, avoiding the need to choose a "clear color" or resultant artefacts such as edge fringes.
In an associated / premultiplied alpha image, the RGB represents the emission amount, while the alpha is occlusion. Premultiplied alpha has some practical advantages over normal alpha blending because interpolation and filtering give correct results. Ordinary interpolation without premultiplied alpha leads to RGB information leaking out of transparent regions though this RGB information is ideally invisible; when interpolating or filtering images with abrupt borders between transparent and opaque regions, this can result in borders of colors that were not visible in the original image. Errors occur in areas of semitransparancy because the RGB components are not weighted, giving incorrectly high weighting to the color of the more transparent pixels. Premultiplication can reduce the available relative precision in the RGB values when using integer or fixed-point representation for the color components, which may cause a noticeable loss of quality if the color information is brightened or if the alpha channel is removed.
In practice, this is not noticeable because during typical composition operations, such as OVER, the influence of the low-precision colour information in low-alpha areas on the final output image is correspondingly reduced. This loss of precision makes premultiplied images easier to compress using certain compression schemes, as they do not record the color variations hidden inside transparent regions, can allocate fewer bits to encode low-alpha areas. With the existence of an alpha channel, it is possible to express compositing image operations using a compositing algebra. For example, given two image elements A and B, the most common compositing operation is to combine the images such that A appears in the foreground and B appears in the background; this can be expressed as A over B. In addition to over and Duff defined the compositing operators in, held out by, xor from a consideration of choices in blending the colors of two pixels when their coverage
Minesweeper (video game)
Minesweeper is a single-player puzzle video game. The objective of the game is to clear a rectangular board containing hidden "mines" or bombs without detonating any of them, with help from clues about the number of neighboring mines in each field; the game originates from the 1960s, has been written for many computing platforms in use today. It has many offshoots; the player is presented with a grid of undifferentiated squares. Some randomly selected squares, unknown to the player, are designated to contain mines; the size of the grid and the number of mines are set in advance by the user, either by entering the numbers or selecting from defined skill levels, depending on the implementations. The game is played by revealing squares of the grid by otherwise indicating each square. If a square containing a mine is revealed, the player loses the game. If no mine is revealed, a digit is instead displayed in the square, indicating how many adjacent squares contain mines; the player uses this information to deduce the contents of other squares, may either safely reveal each square or mark the square as containing a mine.
In some versions, a question mark may be placed in an unrevealed square to serve as an aid to logical deduction. Implementations may allow players to "clear around" a revealed square once the correct number of mines have been flagged around it; the game is won. Some versions of Minesweeper will set up the board by never placing a mine on the first square revealed. Minesweeper for versions of Windows protects. Minesweeper has its origins in the earliest mainframe games of the 1970s; the earliest ancestor of Minesweeper was Jerimac Ratliff's Cube. The basic gameplay style became a popular segment of the puzzle game genre during the 1980s, with such titles as Mined-Out and Cube. Cube was succeeded by Relentless Logic, by Conway and Smith, available for MS-DOS as early as 1985. S. Command Center. RLogic had greater similarity to Minesweeper than to Cube in concept, but a number of differences exist: In RLogic, the player must navigate through the minefield, from the top left right angled corner to the bottom right angled corner.
It is not necessary to clear all non-mine squares. There is no mechanism for marking mines or counting the number of mines found; the number of steps taken is counted. Although no high score functionality is included, players could attempt to beat their personal best score for a given number of mines. Unlike Minesweeper, the size of the minefield is fixed. However, the player may still specify the number of mines; because the player must navigate through the minefield, it is sometimes impossible to win — namely, when the mines block all possible paths. The gameplay mechanics of Minesweeper are included in a variety of other software titles, including: The mini-game Vinesweeper implemented into the MMORPG RuneScape; this allows for a never-ending game of Minesweeper where the skill is assessed in points rather than "game completion". The PC game Mole Control. You play the local inventor's assistant, tasked with clearing the village of exploding moles, you can take part in the Molar Creek Annual Mole Control competition in a Time Attack Mode.
Versions of Minesweeper are bundled with operating systems and GUIs, including Minesweeper for OS/2, Minesweeper in Windows, KMines in KDE, Gnomine in GNOME and MineHunt in Palm OS. Many clones can be found on the Internet. Variants of the basic game have differently shaped minefields, in either two and three dimensions, may have more than one mine per cell. For example, X11-based XBomb adds triangular and hexagonal grids, Professional Minesweeper for Windows includes these and others. There are variants for more than one player, in which the players compete against each other. Minroob is a turn-based 2-player version of minesweeper introduced in Telegram. In this game, the first player who finds more than half of the mines in the board wins the game. By finding a mine, a player is rewarded another turn; the HP-48G graphing calculator includes a variation on the theme called "Minehunt", where the player has to move safely from one corner of the playfield to the other. The only clues given are how many mines are in the squares surrounding the player's current position.
The Voltorb Flip game in the non-Japanese releases of Pokémon HeartGold and SoulSilver is a variation of Minesweeper and Picross. A logic puzzle variant of minesweeper, suitable for playing on paper, starts with some squares revealed; the player must instead mark the remaining mines correctly. Unlike the usual form of minesweeper, these puzzles have a unique solution; these puzzles appeared under the name "tentaizu", Japanese for a star map, in Southwest Airlines' magazine Spirit in 2008–2009
Applets can play media in formats that are not natively supported by the browser. Pages coded in HTML may embed parameters within them; because of this, the same applet may have a different appearance depending on the parameters that were passed. As applets were available before CSS and DHTML were standard, they were widely used for trivial effects such as rollover navigation buttons; this approach, which posed major problems for accessibility and misused system resources, is no longer in use and was discouraged at the time. Java applets are executed in a sandbox by most web browsers, preventing them from accessing local data like the clipboard or file system; the code of the applet is downloaded from a web server, after which the browser either embeds the applet into a web page or opens a new window showing the applet's user interface. A Java applet extends the class java.applet. Applet, or in the case of a Swing applet, javax.swing. JApplet; the class which must override methods from the applet class to set up a user interface inside itself is a descendant of Panel, a descendant of Container.
As applet inherits from container, it has the same user interface possibilities as an ordinary Java application, including regions with user specific visualization. The first implementations involved downloading an applet class by class. While classes are small files, there are many of them, so applets got a reputation as slow-loading components. However, since.jars were introduced, an applet is delivered as a single file that has a size similar to an image file. The domain from where the applet executable has been downloaded is the only domain to which the usual applet is allowed to communicate; this domain can be different from the domain. Java system libraries and runtimes are backwards-compatible, allowing one to write code that runs both on current and on future versions of the Java virtual machine. Many Java developers and magazines are recommending that the Java Web Start technology be used in place of applets. Java Web Start allows the launching of unmodified applet code, which runs in a separate window.
A Java Servlet is sometimes informally compared to be "like" a server-side applet, but it is different in its language, in each of the characteristics described here about applets. The applet can be displayed on the web page by making use of the deprecated applet HTML element, or the recommended object element; the embed element can be used with Mozilla family browsers. This specifies the applet's location. Both object and embed tags can download and install Java virtual machine or at least lead to the plugin page. Applet and object tags support loading of the serialized applets that start in some particular state. Tags specify the message that shows up in place of the applet if the browser cannot run it due to any reason. However, despite object being a recommended tag, as of 2010, the support of the object tag was not yet consistent among browsers and Sun kept r
Stack (abstract data type)
In computer science, a stack is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, pop, which removes the most added element, not yet removed. The order in which elements come off a stack gives rise to its alternative name, LIFO. Additionally, a peek operation may give access to the top without modifying the stack; the name "stack" for this type of structure comes from the analogy to a set of physical items stacked on top of each other, which makes it easy to take an item off the top of the stack, while getting to an item deeper in the stack may require taking off multiple other items first. Considered as a linear data structure, or more abstractly a sequential collection, the push and pop operations occur only at one end of the structure, referred to as the top of the stack; this makes it possible to implement a stack as a singly linked list and a pointer to the top element. A stack may be implemented to have a bounded capacity.
If the stack is full and does not contain enough space to accept an entity to be pushed, the stack is considered to be in an overflow state. The pop operation removes an item from the top of the stack. Stacks entered the computer science literature in 1946, when Alan M. Turing used the terms "bury" and "unbury" as a means of calling and returning from subroutines. Subroutines had been implemented in Konrad Zuse's Z4 in 1945. Klaus Samelson and Friedrich L. Bauer of Technical University Munich proposed the idea in 1955 and filed a patent in 1957, in March 1988 Bauer received the Computer Pioneer Award for the invention of the stack principle; the same concept was developed, independently, by the Australian Charles Leonard Hamblin in the first half of 1954. Stacks are described by analogy to a spring-loaded stack of plates in a cafeteria. Clean plates are placed on top of the stack, pushing down any there; when a plate is removed from the stack, the one below it pops up to become the new top. In many implementations, a stack has more operations than "push" and "pop".
An example is "top of stack", or "peek", which observes the top-most element without removing it from the stack. Since this can be done with a "pop" and a "push" with the same data, it is not essential. An underflow condition can occur in the "stack top" operation if the stack is empty, the same as "pop". Implementations have a function which just returns whether the stack is empty. A stack can be implemented either through an array or a linked list. What identifies the data structure as a stack in either case is not the implementation but the interface: the user is only allowed to pop or push items onto the array or linked list, with few other helper operations; the following will demonstrate both implementations. An array can be used to implement a stack; the first element is the bottom, resulting in array being the first element pushed onto the stack and the last element popped off. The program must keep track of the size of the stack, using a variable top that records the number of items pushed so far, therefore pointing to the place in the array where the next element is to be inserted.
Thus, the stack itself can be implemented as a three-element structure: structure stack: maxsize: integer top: integer items: array of item procedure initialize: stk.items ← new array of size items empty stk.maxsize ← size stk.top ← 0 The push operation adds an element and increments the top index, after checking for overflow: procedure push: if stk.top = stk.maxsize: report overflow error else: stk.items ← x stk.top ← stk.top + 1 Similarly, pop decrements the top index after checking for underflow, returns the item, the top one: procedure pop: if stk.top = 0: report underflow error else: stk.top ← stk.top − 1 r ← stk.items return r Using a dynamic array, it is possible to implement a stack that can grow or shrink as much as needed. The size of the stack is the size of the dynamic array, a efficient implementation of a stack since adding items to or removing items from the end of a dynamic array requires amortized O time. Another option for implementing stacks is to use a singly linked list.
A stack is a pointer to the "head" of the list, with a counter to keep track of the size of the list: structure frame: data: item next: frame or nil structure stack: head: frame or nil size: integer procedure initialize: stk.head ← nil stk.size ← 0 Pushing and popping items happens at the head of the list. Some languages, notably those in the Forth family, are designed around language-defined stacks that are directly visible to and manipulated by the programmer; the following is an example of manipulating a stack in Common Lisp: Several of the C
Raster graphics editor
A raster graphics editor is a computer program that allows users to create and edit images interactively on the computer screen and save them in one of many "bitmap" or "raster" formats such as JPEG, PNG, GIF. Vector graphics editors are contrasted with raster graphics editors, yet their capabilities complement each other; the technical difference between vector and raster editors stem from the difference between vector and raster images. Vector graphics are created mathematically; each element is manipulated numerically. Raster images include digital photos. A raster image is made up of rows and columns of dots, called pixels, is more photo-realistic; this is the standard form for digital cameras. The image is represented pixel like a microscopic jigsaw puzzle. Vector editors tend to be better suited for graphic design, page layout, logos, sharp-edged artistic illustrations, e.g. cartoons, clip art, complex geometric patterns, technical illustrations and flowcharting. Advanced raster editors, like GIMP and Adobe Photoshop, use vector methods for general layout and elements such as text, but are equipped to deal with raster images down to the pixel and have special capabilities in doing so, such as brightness/contrast, adding "lighting" to a raster image or photograph.
Select a region for editing Draw lines with simulated brushes of different color, size and pressure Fill a region with a single color, gradient of colors, or a texture Select a color using different color models, e.g. RGB, HSV, or by using a color dropper Edit and convert between various color models. Add typed letters in various font styles Remove imperfections from photo images Composite editing using layers Apply filters for effects including sharpening and blurring Convert between various image file formats Comparison of raster graphics editors Vector graphics editor Texture map Text editor 3D modelling software Media related to Bitmap graphics editors at Wikimedia Commons
Recursion occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic; the most common application of recursion is in mathematics and computer science, where a function being defined is applied within its own definition. While this defines an infinite number of instances, it is done in such a way that no loop or infinite chain of references can occur. In mathematics and computer science, a class of objects or methods exhibit recursive behavior when they can be defined by two properties: A simple base case —a terminating scenario that does not use recursion to produce an answer A set of rules that reduce all other cases toward the base caseFor example, the following is a recursive definition of a person's ancestors: One's parents are one's ancestors; the ancestors of one's ancestors are one's ancestors. The Fibonacci sequence is a classic example of recursion: Fib = 0 as base case 1, Fib = 1 as base case 2, For all integers n > 1, Fib:= Fib + Fib.
Many mathematical axioms are based upon recursive rules. For example, the formal definition of the natural numbers by the Peano axioms can be described as: 0 is a natural number, each natural number has a successor, a natural number. By this base case and recursive rule, one can generate the set of all natural numbers. Recursively defined mathematical objects include functions and fractals. There are various more tongue-in-cheek "definitions" of recursion. Recursion is the process a procedure goes through when one of the steps of the procedure involves invoking the procedure itself. A procedure that goes through recursion is said to be'recursive'. To understand recursion, one must recognize the distinction between a procedure and the running of a procedure. A procedure is a set of steps based on a set of rules; the running of a procedure involves following the rules and performing the steps. An analogy: a procedure is like a written recipe. Recursion is related to, but not the same as, a reference within the specification of a procedure to the execution of some other procedure.
For instance, a recipe might refer to cooking vegetables, another procedure that in turn requires heating water, so forth. However, a recursive procedure is where one of its steps calls for a new instance of the same procedure, like a sourdough recipe calling for some dough left over from the last time the same recipe was made; this creates the possibility of an endless loop. If properly defined, a recursive procedure is not easy for humans to perform, as it requires distinguishing the new from the old invocation of the procedure. For this reason recursive definitions are rare in everyday situations. An example could be the following procedure to find a way through a maze. Proceed forward until reaching either an exit or a branching point. If the point reached is an exit, terminate. Otherwise try each branch in turn, using the procedure recursively. Whether this defines a terminating procedure depends on the nature of the maze: it must not allow loops. In any case, executing the procedure requires recording all explored branching points, which of their branches have been exhaustively tried.
Linguist Noam Chomsky among many others has argued that the lack of an upper bound on the number of grammatical sentences in a language, the lack of an upper bound on grammatical sentence length, can be explained as the consequence of recursion in natural language. This can be understood in terms of a recursive definition of a syntactic category, such as a sentence. A sentence can have a structure in which what follows the verb is another sentence: Dorothy thinks witches are dangerous, in which the sentence witches are dangerous occurs in the larger one. So a sentence can be defined recursively as something with a structure that includes a noun phrase, a verb, optionally another sentence; this is just a special case of the mathematical definition of recursion. This provides a way of understanding the creativity of language—the unbounded number of grammatical sentences—because it predicts that sentences can be of arbitrary length: Dorothy thinks that Toto suspects that Tin Man said that.... There are many structures apart from sentences that can be defined recursively, therefore many ways in which a sentence can embed instances of one