// Version 0.2 - Copyright 2013 - Jim Riecken<EMAIL_ADDRESS>// // Released under the MIT License - https://github.com/jriecken/sat-js // // A simple library for determining intersections of circles and // polygons using the Separating Axis Theorem. /** @preserve SAT.js - Version 0.2 - Copyright 2013 - Jim Riecken<EMAIL_ADDRESS>- released under the MIT License. https://github.com/jriecken/sat-js */ var SAT = (function () { "use strict"; var SAT = {}; // // ## Vector // // Represents a vector in two dimensions with `x` and `y` properties. // Create a new Vector, optionally passing in the `x` and `y` coordinates. If // a coordinate is not specified, it will be set to `0` /** * @param {?number=} x The x position. * @param {?number=} y The y position. * @constructor */ function Vector(x, y) { this['x'] = x || 0; this['y'] = y || 0; } SAT['Vector'] = Vector; // Alias `Vector` as `V` SAT['V'] = Vector; // Copy the values of another Vector into this one. /** * @param {Vector} other The other Vector. * @return {Vector} This for chaining. */ Vector.prototype['copy'] = Vector.prototype.copy = function(other) { this['x'] = other['x']; this['y'] = other['y']; return this; }; // Change this vector to be perpendicular to what it was before. (Effectively // roatates it 90 degrees in a clockwise direction) /** * @return {Vector} This for chaining. */ Vector.prototype['perp'] = Vector.prototype.perp = function() { var x = this['x']; this['x'] = this['y']; this['y'] = -x; return this; }; // Rotate this vector (counter-clockwise) by the specified angle (in radians). /** * @param {number} angle The angle to rotate (in radians) * @return {Vector} This for chaining. */ Vector.prototype['rotate'] = Vector.prototype.rotate = function (angle) { var x = this['x']; var y = this['y']; this['x'] = x * Math.cos(angle) - y * Math.sin(angle); this['y'] = x * Math.sin(angle) + y * Math.cos(angle); return this; }; // Rotate this vector (counter-clockwise) by the specified angle (in radians) which has already been calculated into sin and cos. /** * @param {number} sin - The Math.sin(angle) * @param {number} cos - The Math.cos(angle) * @return {Vector} This for chaining. */ Vector.prototype['rotatePrecalc'] = Vector.prototype.rotatePrecalc = function (sin, cos) { var x = this['x']; var y = this['y']; this['x'] = x * cos - y * sin; this['y'] = x * sin + y * cos; return this; }; // Reverse this vector. /** * @return {Vector} This for chaining. */ Vector.prototype['reverse'] = Vector.prototype.reverse = function() { this['x'] = -this['x']; this['y'] = -this['y']; return this; }; // Normalize this vector. (make it have length of `1`) /** * @return {Vector} This for chaining. */ Vector.prototype['normalize'] = Vector.prototype.normalize = function() { var d = this.len(); if(d > 0) { this['x'] = this['x'] / d; this['y'] = this['y'] / d; } return this; }; // Add another vector to this one. /** * @param {Vector} other The other Vector. * @return {Vector} This for chaining. */ Vector.prototype['add'] = Vector.prototype.add = function(other) { this['x'] += other['x']; this['y'] += other['y']; return this; }; // Subtract another vector from this one. /** * @param {Vector} other The other Vector. * @return {Vector} This for chaiing. */ Vector.prototype['sub'] = Vector.prototype.sub = function(other) { this['x'] -= other['x']; this['y'] -= other['y']; return this; }; // Scale this vector. An independant scaling factor can be provided // for each axis, or a single scaling factor that will scale both `x` and `y`. /** * @param {number} x The scaling factor in the x direction. * @param {?number=} y The scaling factor in the y direction. If this * is not specified, the x scaling factor will be used. * @return {Vector} This for chaining. */ Vector.prototype['scale'] = Vector.prototype.scale = function(x,y) { this['x'] *= x; this['y'] *= y || x; return this; }; // Project this vector on to another vector. /** * @param {Vector} other The vector to project onto. * @return {Vector} This for chaining. */ Vector.prototype['project'] = Vector.prototype.project = function(other) { var amt = this.dot(other) / other.len2(); this['x'] = amt * other['x']; this['y'] = amt * other['y']; return this; }; // Project this vector onto a vector of unit length. This is slightly more efficient // than `project` when dealing with unit vectors. /** * @param {Vector} other The unit vector to project onto. * @return {Vector} This for chaining. */ Vector.prototype['projectN'] = Vector.prototype.projectN = function(other) { var amt = this.dot(other); this['x'] = amt * other['x']; this['y'] = amt * other['y']; return this; }; // Reflect this vector on an arbitrary axis. /** * @param {Vector} axis The vector representing the axis. * @return {Vector} This for chaining. */ Vector.prototype['reflect'] = Vector.prototype.reflect = function(axis) { var x = this['x']; var y = this['y']; this.project(axis).scale(2); this['x'] -= x; this['y'] -= y; return this; }; // Reflect this vector on an arbitrary axis (represented by a unit vector). This is // slightly more efficient than `reflect` when dealing with an axis that is a unit vector. /** * @param {Vector} axis The unit vector representing the axis. * @return {Vector} This for chaining. */ Vector.prototype['reflectN'] = Vector.prototype.reflectN = function(axis) { var x = this['x']; var y = this['y']; this.projectN(axis).scale(2); this['x'] -= x; this['y'] -= y; return this; }; // Get the dot product of this vector and another. /** * @param {Vector} other The vector to dot this one against. * @return {number} The dot product. */ Vector.prototype['dot'] = Vector.prototype.dot = function(other) { return this['x'] * other['x'] + this['y'] * other['y']; }; // Get the squared length of this vector. /** * @return {number} The length^2 of this vector. */ Vector.prototype['len2'] = Vector.prototype.len2 = function() { return this.dot(this); }; // Get the length of this vector. /** * @return {number} The length of this vector. */ Vector.prototype['len'] = Vector.prototype.len = function() { return Math.sqrt(this.len2()); }; // ## Circle // // Represents a circle with a position and a radius. // Create a new circle, optionally passing in a position and/or radius. If no position // is given, the circle will be at `(0,0)`. If no radius is provided, the circle will // have a radius of `0`. /** * @param {Vector=} pos A vector representing the position of the center of the circle * @param {?number=} r The radius of the circle * @constructor */ function Circle(pos, r) { this['pos'] = pos || new Vector(); this['r'] = r || 0; } SAT['Circle'] = Circle; // ## Polygon // // Represents a *convex* polygon with any number of points (specified in counter-clockwise order) // // The edges/normals of the polygon will be calculated on creation and stored in the // `edges` and `normals` properties. If you change the polygon's points, you will need // to call `recalc` to recalculate the edges/normals. // Create a new polygon, passing in a position vector, and an array of points (represented // by vectors relative to the position vector). If no position is passed in, the position // of the polygon will be `(0,0)`. /** * @param {Vector=} pos A vector representing the origin of the polygon. (all other * points are relative to this one) * @param {Array.<Vector>=} points An array of vectors representing the points in the polygon, * in counter-clockwise order. * @constructor */ function Polygon(pos, points) { this['pos'] = pos || new Vector(); this['points'] = points || []; this.recalc(); } SAT['Polygon'] = Polygon; // Recalculates the edges and normals of the polygon. This **must** be called // if the `points` array is modified at all and the edges or normals are to be // accessed. /** * @return {Polygon} This for chaining. */ Polygon.prototype['recalc'] = Polygon.prototype.recalc = function() { // The edges here are the direction of the `n`th edge of the polygon, relative to // the `n`th point. If you want to draw a given edge from the edge value, you must // first translate to the position of the starting point. this['edges'] = []; // The normals here are the direction of the normal for the `n`th edge of the polygon, relative // to the position of the `n`th point. If you want to draw an edge normal, you must first // translate to the position of the starting point. this['normals'] = []; var points = this['points']; var len = points.length; for (var i = 0; i < len; i++) { var p1 = points[i]; var p2 = i < len - 1 ? points[i + 1] : points[0]; var e = new Vector().copy(p2).sub(p1); var n = new Vector().copy(e).perp().normalize(); this['edges'].push(e); this['normals'].push(n); } return this; }; // Rotates this polygon counter-clockwise around the origin of *its local coordinate system* (i.e. `pos`). // // Note: You do **not** need to call `recalc` after rotation. /** * @param {number} angle The angle to rotate (in radians) * @return {Polygon} This for chaining. */ Polygon.prototype['rotate'] = Polygon.prototype.rotate = function(angle) { var i; var points = this['points']; var edges = this['edges']; var normals = this['normals']; var len = points.length; // Calc it just the once, rather than 4 times per array element var cos = Math.cos(angle); var sin = Math.sin(angle); for (i = 0; i < len; i++) { points[i].rotatePrecalc(sin, cos); edges[i].rotatePrecalc(sin, cos); normals[i].rotatePrecalc(sin, cos); } return this; }; // Rotates this polygon counter-clockwise around the origin of *its local coordinate system* (i.e. `pos`). // // Note: You do **not** need to call `recalc` after rotation. /** * @param {number} angle The angle to rotate (in radians) * @return {Polygon} This for chaining. */ Polygon.prototype['scale'] = Polygon.prototype.scale = function(x, y) { var i; var points = this['points']; var edges = this['edges']; var normals = this['normals']; var len = points.length; for (i = 0; i < len; i++) { points[i].scale(x,y); edges[i].scale(x,y); normals[i].scale(x,y); } return this; }; // Translates the points of this polygon by a specified amount relative to the origin of *its own coordinate // system* (i.e. `pos`). // // This is most useful to change the "center point" of a polygon. // // Note: You do **not** need to call `recalc` after translation. /** * @param {number} x The horizontal amount to translate. * @param {number} y The vertical amount to translate. * @return {Polygon} This for chaining. */ Polygon.prototype['translate'] = Polygon.prototype.translate = function (x, y) { var i; var points = this['points']; var len = points.length; for (i = 0; i < len; i++) { points[i].x += x; points[i].y += y; } return this; }; // ## Box // // Represents an axis-aligned box, with a width and height. // Create a new box, with the specified position, width, and height. If no position // is given, the position will be `(0,0)`. If no width or height are given, they will // be set to `0`. /** * @param {Vector=} pos A vector representing the top-left of the box. * @param {?number=} w The width of the box. * @param {?number=} h The height of the box. * @constructor */ function Box(pos, w, h) { this['pos'] = pos || new Vector(); this['w'] = w || 0; this['h'] = h || 0; } SAT['Box'] = Box; // Returns a polygon whose edges are the same as this box. /** * @return {Polygon} A new Polygon that represents this box. */ Box.prototype['toPolygon'] = Box.prototype.toPolygon = function() { var pos = this['pos']; var w = this['w']; var h = this['h']; return new Polygon(new Vector(pos['x'], pos['y']), [ new Vector(), new Vector(w, 0), new Vector(w,h), new Vector(0,h) ]); }; // ## Response // // An object representing the result of an intersection. Contains: // - The two objects participating in the intersection // - The vector representing the minimum change necessary to extract the first object // from the second one (as well as a unit vector in that direction and the magnitude // of the overlap) // - Whether the first object is entirely inside the second, and vice versa. /** * @constructor */ function Response() { this['a'] = null; this['b'] = null; this['overlapN'] = new Vector(); this['overlapV'] = new Vector(); this.clear(); } SAT['Response'] = Response; // Set some values of the response back to their defaults. Call this between tests if // you are going to reuse a single Response object for multiple intersection tests (recommented // as it will avoid allcating extra memory) /** * @return {Response} This for chaining */ Response.prototype['clear'] = Response.prototype.clear = function() { this['aInB'] = true; this['bInA'] = true; this['overlap'] = Number.MAX_VALUE; return this; }; // ## Object Pools // A pool of `Vector` objects that are used in calculations to avoid // allocating memory. /** * @type {Array.<Vector>} */ var T_VECTORS = []; for (var i = 0; i < 10; i++) { T_VECTORS.push(new Vector()); } // A pool of arrays of numbers used in calculations to avoid allocating // memory. /** * @type {Array.<Array.<number>>} */ var T_ARRAYS = []; for (var i = 0; i < 5; i++) { T_ARRAYS.push([]); } // ## Helper Functions // Flattens the specified array of points onto a unit vector axis, // resulting in a one dimensional range of the minimum and // maximum value on that axis. /** * @param {Array.<Vector>} points The points to flatten. * @param {Vector} normal The unit vector axis to flatten on. * @param {Array.<number>} result An array. After calling this function, * result[0] will be the minimum value, * result[1] will be the maximum value. */ function flattenPointsOn(points, normal, result) { var min = Number.MAX_VALUE; var max = -Number.MAX_VALUE; var len = points.length; for (var i = 0; i < len; i++ ) { // The magnitude of the projection of the point onto the normal var dot = points[i].dot(normal); if (dot < min) { min = dot; } if (dot > max) { max = dot; } } result[0] = min; result[1] = max; } // Check whether two convex polygons are separated by the specified // axis (must be a unit vector). /** * @param {Vector} aPos The position of the first polygon. * @param {Vector} bPos The position of the second polygon. * @param {Array.<Vector>} aPoints The points in the first polygon. * @param {Array.<Vector>} bPoints The points in the second polygon. * @param {Vector} axis The axis (unit sized) to test against. The points of both polygons * will be projected onto this axis. * @param {Response=} response A Response object (optional) which will be populated * if the axis is not a separating axis. * @return {boolean} true if it is a separating axis, false otherwise. If false, * and a response is passed in, information about how much overlap and * the direction of the overlap will be populated. */ function isSeparatingAxis(aPos, bPos, aPoints, bPoints, axis, response) { var rangeA = T_ARRAYS.pop(); var rangeB = T_ARRAYS.pop(); // The magnitude of the offset between the two polygons var offsetV = T_VECTORS.pop().copy(bPos).sub(aPos); var projectedOffset = offsetV.dot(axis); // Project the polygons onto the axis. flattenPointsOn(aPoints, axis, rangeA); flattenPointsOn(bPoints, axis, rangeB); // Move B's range to its position relative to A. rangeB[0] += projectedOffset; rangeB[1] += projectedOffset; // Check if there is a gap. If there is, this is a separating axis and we can stop if (rangeA[0] > rangeB[1] || rangeB[0] > rangeA[1]) { T_VECTORS.push(offsetV); T_ARRAYS.push(rangeA); T_ARRAYS.push(rangeB); return true; } // This is not a separating axis. If we're calculating a response, calculate the overlap. if (response) { var overlap = 0; // A starts further left than B if (rangeA[0] < rangeB[0]) { response['aInB'] = false; // A ends before B does. We have to pull A out of B if (rangeA[1] < rangeB[1]) { overlap = rangeA[1] - rangeB[0]; response['bInA'] = false; // B is fully inside A. Pick the shortest way out. } else { var option1 = rangeA[1] - rangeB[0]; var option2 = rangeB[1] - rangeA[0]; overlap = option1 < option2 ? option1 : -option2; } // B starts further left than A } else { response['bInA'] = false; // B ends before A ends. We have to push A out of B if (rangeA[1] > rangeB[1]) { overlap = rangeA[0] - rangeB[1]; response['aInB'] = false; // A is fully inside B. Pick the shortest way out. } else { var option1 = rangeA[1] - rangeB[0]; var option2 = rangeB[1] - rangeA[0]; overlap = option1 < option2 ? option1 : -option2; } } // If this is the smallest amount of overlap we've seen so far, set it as the minimum overlap. var absOverlap = Math.abs(overlap); if (absOverlap < response['overlap']) { response['overlap'] = absOverlap; response['overlapN'].copy(axis); if (overlap < 0) { response['overlapN'].reverse(); } } } T_VECTORS.push(offsetV); T_ARRAYS.push(rangeA); T_ARRAYS.push(rangeB); return false; } // Calculates which Vornoi region a point is on a line segment. // It is assumed that both the line and the point are relative to `(0,0)` // // | (0) | // (-1) [S]--------------[E] (1) // | (0) | /** * @param {Vector} line The line segment. * @param {Vector} point The point. * @return {number} LEFT_VORNOI_REGION (-1) if it is the left region, * MIDDLE_VORNOI_REGION (0) if it is the middle region, * RIGHT_VORNOI_REGION (1) if it is the right region. */ function vornoiRegion(line, point) { var len2 = line.len2(); var dp = point.dot(line); // If the point is beyond the start of the line, it is in the // left vornoi region. if (dp < 0) { return LEFT_VORNOI_REGION; } // If the point is beyond the end of the line, it is in the // right vornoi region. else if (dp > len2) { return RIGHT_VORNOI_REGION; } // Otherwise, it's in the middle one. else { return MIDDLE_VORNOI_REGION; } } // Constants for Vornoi regions /** * @const */ var LEFT_VORNOI_REGION = -1; /** * @const */ var MIDDLE_VORNOI_REGION = 0; /** * @const */ var RIGHT_VORNOI_REGION = 1; // ## Collision Tests // Check if two circles collide. /** * @param {Circle} a The first circle. * @param {Circle} b The second circle. * @param {Response=} response Response object (optional) that will be populated if * the circles intersect. * @return {boolean} true if the circles intersect, false if they don't. */ function testCircleCircle(a, b, response) { // Check if the distance between the centers of the two // circles is greater than their combined radius. var differenceV = T_VECTORS.pop().copy(b['pos']).sub(a['pos']); var totalRadius = a['r'] + b['r']; var totalRadiusSq = totalRadius * totalRadius; var distanceSq = differenceV.len2(); // If the distance is bigger than the combined radius, they don't intersect. if (distanceSq > totalRadiusSq) { T_VECTORS.push(differenceV); return false; } // They intersect. If we're calculating a response, calculate the overlap. if (response) { var dist = Math.sqrt(distanceSq); response['a'] = a; response['b'] = b; response['overlap'] = totalRadius - dist; response['overlapN'].copy(differenceV.normalize()); response['overlapV'].copy(differenceV).scale(response['overlap']); response['aInB']= a['r'] <= b['r'] && dist <= b['r'] - a['r']; response['bInA'] = b['r'] <= a['r'] && dist <= a['r'] - b['r']; } T_VECTORS.push(differenceV); return true; } SAT['testCircleCircle'] = testCircleCircle; // Check if a polygon and a circle collide. /** * @param {Polygon} polygon The polygon. * @param {Circle} circle The circle. * @param {Response=} response Response object (optional) that will be populated if * they interset. * @return {boolean} true if they intersect, false if they don't. */ function testPolygonCircle(polygon, circle, response) { // Get the position of the circle relative to the polygon. var circlePos = T_VECTORS.pop().copy(circle['pos']).sub(polygon['pos']); var radius = circle['r']; var radius2 = radius * radius; var points = polygon['points']; var len = points.length; var edge = T_VECTORS.pop(); var point = T_VECTORS.pop(); // For each edge in the polygon: for (var i = 0; i < len; i++) { var next = i === len - 1 ? 0 : i + 1; var prev = i === 0 ? len - 1 : i - 1; var overlap = 0; var overlapN = null; // Get the edge. edge.copy(polygon['edges'][i]); // Calculate the center of the circle relative to the starting point of the edge. point.copy(circlePos).sub(points[i]); // If the distance between the center of the circle and the point // is bigger than the radius, the polygon is definitely not fully in // the circle. if (response && point.len2() > radius2) { response['aInB'] = false; } // Calculate which Vornoi region the center of the circle is in. var region = vornoiRegion(edge, point); // If it's the left region: if (region === LEFT_VORNOI_REGION) { // We need to make sure we're in the RIGHT_VORNOI_REGION of the previous edge. edge.copy(polygon['edges'][prev]); // Calculate the center of the circle relative the starting point of the previous edge var point2 = T_VECTORS.pop().copy(circlePos).sub(points[prev]); region = vornoiRegion(edge, point2); if (region === RIGHT_VORNOI_REGION) { // It's in the region we want. Check if the circle intersects the point. var dist = point.len(); if (dist > radius) { // No intersection T_VECTORS.push(circlePos); T_VECTORS.push(edge); T_VECTORS.push(point); T_VECTORS.push(point2); return false; } else if (response) { // It intersects, calculate the overlap. response['bInA'] = false; overlapN = point.normalize(); overlap = radius - dist; } } T_VECTORS.push(point2); // If it's the right region: } else if (region === RIGHT_VORNOI_REGION) { // We need to make sure we're in the left region on the next edge edge.copy(polygon['edges'][next]); // Calculate the center of the circle relative to the starting point of the next edge. point.copy(circlePos).sub(points[next]); region = vornoiRegion(edge, point); if (region === LEFT_VORNOI_REGION) { // It's in the region we want. Check if the circle intersects the point. var dist = point.len(); if (dist > radius) { // No intersection T_VECTORS.push(circlePos); T_VECTORS.push(edge); T_VECTORS.push(point); return false; } else if (response) { // It intersects, calculate the overlap. response['bInA'] = false; overlapN = point.normalize(); overlap = radius - dist; } } // Otherwise, it's the middle region: } else { // Need to check if the circle is intersecting the edge, // Change the edge into its "edge normal". var normal = edge.perp().normalize(); // Find the perpendicular distance between the center of the // circle and the edge. var dist = point.dot(normal); var distAbs = Math.abs(dist); // If the circle is on the outside of the edge, there is no intersection. if (dist > 0 && distAbs > radius) { // No intersection T_VECTORS.push(circlePos); T_VECTORS.push(normal); T_VECTORS.push(point); return false; } else if (response) { // It intersects, calculate the overlap. overlapN = normal; overlap = radius - dist; // If the center of the circle is on the outside of the edge, or part of the // circle is on the outside, the circle is not fully inside the polygon. if (dist >= 0 || overlap < 2 * radius) { response['bInA'] = false; } } } // If this is the smallest overlap we've seen, keep it. // (overlapN may be null if the circle was in the wrong Vornoi region). if (overlapN && response && Math.abs(overlap) < Math.abs(response['overlap'])) { response['overlap'] = overlap; response['overlapN'].copy(overlapN); } } // Calculate the final overlap vector - based on the smallest overlap. if (response) { response['a'] = polygon; response['b'] = circle; response['overlapV'].copy(response['overlapN']).scale(response['overlap']); } T_VECTORS.push(circlePos); T_VECTORS.push(edge); T_VECTORS.push(point); return true; } SAT['testPolygonCircle'] = testPolygonCircle; // Check if a circle and a polygon collide. // // **NOTE:** This is slightly less efficient than polygonCircle as it just // runs polygonCircle and reverses everything at the end. /** * @param {Circle} circle The circle. * @param {Polygon} polygon The polygon. * @param {Response=} response Response object (optional) that will be populated if * they interset. * @return {boolean} true if they intersect, false if they don't. */ function testCirclePolygon(circle, polygon, response) { // Test the polygon against the circle. var result = testPolygonCircle(polygon, circle, response); if (result && response) { // Swap A and B in the response. var a = response['a']; var aInB = response['aInB']; response['overlapN'].reverse(); response['overlapV'].reverse(); response['a'] = response['b']; response['b'] = a; response['aInB'] = response['bInA']; response['bInA'] = aInB; } return result; } SAT['testCirclePolygon'] = testCirclePolygon; // Checks whether polygons collide. /** * @param {Polygon} a The first polygon. * @param {Polygon} b The second polygon. * @param {Response=} response Response object (optional) that will be populated if * they interset. * @return {boolean} true if they intersect, false if they don't. */ function testPolygonPolygon(a, b, response) { var aPoints = a['points']; var aLen = aPoints.length; var bPoints = b['points']; var bLen = bPoints.length; // If any of the edge normals of A is a separating axis, no intersection. for (var i = 0; i < aLen; i++) { if (isSeparatingAxis(a['pos'], b['pos'], aPoints, bPoints, a['normals'][i], response)) { return false; } } // If any of the edge normals of B is a separating axis, no intersection. for (var i = 0;i < bLen; i++) { if (isSeparatingAxis(a['pos'], b['pos'], aPoints, bPoints, b['normals'][i], response)) { return false; } } // Since none of the edge normals of A or B are a separating axis, there is an intersection // and we've already calculated the smallest overlap (in isSeparatingAxis). Calculate the // final overlap vector. if (response) { response['a'] = a; response['b'] = b; response['overlapV'].copy(response['overlapN']).scale(response['overlap']); } return true; } SAT['testPolygonPolygon'] = testPolygonPolygon; return SAT; })();


Pig is a folk jeopardy dice game described by John Scarne in 1945, and was an ancestor of the modern game Pass the Pigs® (originally called PigMania®).
The rules are simple: Two players race to reach 100 points. Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player holds and scores the sum of the rolls (i.e. the turn total). At any time during a player's turn, the player is faced with two decisions:
To familiarize yourself with play, you can play an optimal Pig opponent online. The key decision facing a player is how large a turn total should be risked to possibly get an even larger total. To learn more about the game of Pig, visit The Game of Pig web page.
| Summary | The Game of Pig - Milestone-based approach to implementation of the dice game Pig with side opportunities for simple, interesting analysis driven by curiosity to better understand game play. Also includes object-oriented and GUI programming exercises. |
| Topics | Bottom-up, milestone-based development, dynamic programming and Monte Carlo analysis techniques. |
| Audience | Assignment suite below is appropriate for CS1. Upper-level Pig-related assignments for networking, artificial intelligence, etc. are described in Pedagogical Possibilities for the Dice Game Pig. Journal of Computing Sciences in Colleges, vol. 21, no. 6, pp. 149-161, June 2006. |
| Difficulty | These assignments range from beginner to intermediate difficulty. CS1 students complete all but the object-oriented and GUI programming assignments in less than 3 weeks. |
| Strengths | Pig offers one of the best fun-to-SLOC (source lines of code) ratios of any game. One would be hard pressed to find another game with such simple rules that engages and leaves one on the knife-edge of indecision. As such, it is a teaching treasure. Mathematics instructors have long used this game to teach probabilistic concepts. We here offer a rich collection of CS1 Pig exercises that illustrate bottom-up development. Alternatively, one can approach the final "Pig Game" exercise as a good top-down, stepwise refinement exercise. Opportunities for Monte Carlo simulation abound. |
| Weaknesses | Except for GUI assignment, text-based and non-graphical. |
| Dependencies | Most assignments require only understanding of random number generation, text I/O, and simple control structures. GUI assignment requires additional understanding of basic GUI concepts and components including labels, buttons, panel image display, and popup window dialogs. O-O assignment requires understand of basic O-O concepts, including interfaces. |
| Variants | One can easily create variants by choosing different play policies and/or rule variations. Both are described in detail below. |
Each exercise below may be used stand-alone or in a logical sequence of milestones.
| Problem Description | Previous Milestone |
| Hold-at-20 Turn - simulate a single turn of Pig where a player holds at 20 points | |
| Hold-at-20 Outcomes (Estimation) - statistics on Monte Carlo simulations of hold-at-20 turn outcomes | Hold-at-20 Turn |
| Hold-at-20 Outcomes (Computation) - dynamic programming computation of hold-at-20 turn outcomes | Hold-at-20 Turn |
| Hold-at-20-or-Goal Turn - simulate a single turn of Pig where a player holds at 20 points or the goal score | Hold-at-20 Turn |
| Hold-at-20-or-Goal Game - simulate a single game of Pig where a player holds at 20 points or the goal score | Hold-at-20-or-Goal Turn |
| Average Pig Turns - average turns of Monte Carlo simulations of hold-at-20-or-goal games | Hold-at-20-or-Goal Game |
| Two-Player Pig - simulate a single two-player game of Pig with hold-at-20-or-goal players | Hold-at-20-or-Goal Game |
| First-Player Advantage - Monte Carlo simulations estimate the first-player advantage in hold-at-20-or-goal Pig | Two-Player Pig |
| Pig Game - the user plays Pig versus a hold-at-20-or-goal player | Two-Player Pig |
| O-O Pig Game - the user plays Pig versus a hold-at-20-or-goal player. Implementation is object-oriented. | |
| Pig Game GUI - the user plays Pig versus a keep-pace-and-end-race player via a GUI |
Different subsets of these exercises may be chosen according to different
desired goals/emphases. For example:
Pig Game Milestone track: Hold-at-20 Turn,
Hold-at-20-or-Goal Turn,
Hold-at-20-or-Goal Game, Two-Player Pig,
Pig Game
Monte Carlo track: Hold-at-20 Turn,
Hold-at-20 Outcomes (Estimation),
Hold-at-20-or-Goal Turn, Hold-at-20-or-Goal Game,
Average Pig Turns, Two-Player Pig,
First-Player Advantage
Cut-to-the-Chase GUI track:
Pig Game GUI
Minimalist O-O track: O-O Pig Game
Creating variations of the these exercises is simple. One can both vary the simulated play policy, and/or rule variations.
Pig Play Policies: Let i be the player's score, j be the opponent's score, and k be the current turn total.
Game Variations:
With the many ways the problem set above may be thus varied, it is not difficult to craft a unique (i.e. not easily plagiarized) assignment experience for your students.
With its simple rules and engaging play, Pig lends itself to many uses across the Computer Science curriculum:


This program provides the download count of the source code archive from
SALMON-TDDFT website.
For the counting, the subject files must be placed under
{DOCUMENT_ROOT}/download directory.
This program uses the database which is generated from the access log of Apache.
Please click "Update Database" button frequently to reflect the recent access-logs to temporary database.
The update sometimes costs a few minuites.


{% extends 'app/base.html' %} {% load static %} {% block title %}Reset your Password{% endblock title %} {% block main-content %}
An Email has been sent to you with the link to reset your password


This benchmark measures the performance of batch inserting, deleting and searching elements with a dictionary data structure. Each element consists of a key and possibly auxiliary data and the implementation must be based on the following three user supplied functions:
The comparison function on the auxiliary data is used to decide which element to insert when multiple elements have the same key--a maximal value with respect to the partial order must be inserted. The specific benchmark batch inserts a sequence of values, then batch deletes another sequence of values, and finally batch searches a sequence of values. All three sequences can have repeated keys. The code must not take advantage of the specific key and auxiliary types beyond the hash and comparison function.The input and output should be in the sequence file format. For testing the input sequence needs to be partitioned into three equal length parts, the first used for insertion, the second for deletions (after the insertions), and the third for searches (after the insertions and deletions). If the input length is not divisible by 3, then the number of insertions and deletions need to be of length ⌊n/3⌋ and the remaining elements are searches. Note that if the elements consist of both a key and auxiliary data, then the auxiliary data for the deletions and for the searches is ignored. The output sequence consists of the results of all successful searches, including both the key and the auxiliary data. The output sequence should be in the same order as the searches in the input sequence and any repeated successful searches should be included at each occurrence.
randomSeq -t int <n> <filename>
randomSeq -t int -r 100000 <n> <filename>
exptSeq -t int <n> <filename>
trigramSeq <n> <filename>
trigramSeq <n> <tmpname>
addDataSeq -t int <tmpname> <filename>


Welcom to My World!!!!!
My Profile
My Name:
Yu-Ling Chang
my instagram
my github
#target4
My E-mail:
<EMAIL_ADDRESS>My hobby:
listen to music
play the piano
sing
My Education:
Li Lin Elementary
Chong Lin Junior High School
Hsun Chuang Sinior High School
Fu Jen University (MIIA)


{% extends "timepiece/reports/base.html" %} {% load timepiece_tags bootstrap_toolkit %} {% load url from future %} {% block title %}Billable Hours Report{% endblock title %} {% block bodyid %}billable-hours{% endblock bodyid %} {% block crumbs %} {{ block.super }}
There are no entries which match your query.
{% endif %}


"Lorem ipsum dolor sit amet, consectetur adi pisi cing elit, sed do eiusmod tempor exercitationemut labore et dolore magna aliqua. Ut enim ad consequatur quis aliquip ex ea commodo consequat"
Let us assist you to choose your right life partner.
Marriage Solution BD's philosophy is to change attitudes and misconceptions about marriage media of Bangladesh. We trust, changing to right attitude towards marriage will change lives. We believe in integrity, reliability, trust and our far-reaching services to touch the hearts of millions across. We are here to help! Our yearlong experiences will help the clients to match their potential better half. We have successfully carried out – number of marriages till date!
OF BRIDE & THE GROOM
We will share the names of each couple for proper manifestation.
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores"
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores"
Lorem ipsum dolor sit amet, consectetur adi pisi cing elit, sed do eiusmod tempor exercitationemut labore et dolore magna aliqua. Ut enim ad consequatur quis aliquip ex ea commodo consequat
Become Our MemberSCAN TO VIEW


What our customers have to say
Doug (Gig harbor, WA) - These are the fishiest Salmon Cookies that I've ever tasted. I give them 5 Stars!
Scott (Seattle, WA) - As an award-winning Tattoo Artist, I'm pretty picky when it comes to my Salmon Cookies, and I can honestly say, I'd add these to my arm piece any day!
Steve-O (Everett, WA) - I haven't had Salmon Cookies this good since my North Atlantic cruise in the Navy. I give them 5 Stars!
Nick (Seattle, WA) - BEST EVER!
Chase (Seattle, WA) - I'd move across the country for these cookies!


Please click below to see the HTML version of this email.
http://shop.cvsphoto.com/r/3OY6I7H/7PMKZ/V931KA/6VK464H/3NFA7/PN/t?a=3OY6I7H&b=2FJ04&c=8XFS8UQ&d=G24K8P&e=1&f=807f20ca6814e3d823bb
****************************************************
CVS/pharmacy® Photo
****************************************************
25% Off Canvas, 20% Off Calendars & BOGO 50% Off Photo Books >
http://shop.cvsphoto.com/r/3OY6I7H/7PMKZ/V931KA/6VK464H/E68I9/PN/t?a=3OY6I7H&b=2FJ04&c=8XFS8UQ&d=G24K8P&e=1&f=807f20ca6814e3d823bb
****************************************************
Add any Canvas(es) to your shopping cart, enter promo code CANVAS25 and get 25% OFF your Canvas(es) order. Offer valid online only. Promotion ends 1/12/13.
Add any Calendar(s) to your shopping cart, enter promo code CALENDAR20 and get 20% OFF your Calendar(s) order. Promotion ends 1/12/13.
Add a minimum of two (2) Photo Books to your cart, enter promo code BOGOBOOK and get your second Photo Book of equal or lesser value for 50% Off. Offer valid online only. Offer ends 1/12/13.
You are receiving this email because you indicated you wanted to be informed of the latest news and specials from CVSphoto.com. If you prefer not to receive future emails from
CVSphoto.com, please unsubscribe below. Please note, if you have subscribed to receive other CVS email communications you will continue to receive them unless you unsubscribe specifically for those.
http://shop.cvsphoto.com/r/3OY6I7H/7PMKZ/V931KA/6VK464H/AHTX9/PN/t?a=http://shop.cvsphoto.com/u/3OY6I7H/7PMKZ/V931KA/6VK464H/MJ/aHVibGVlcGg2MDZAdHVtYmxyLmNvbQ==/
© Copyright 2013 CVSphoto.com
http://shop.cvsphoto.com/r/3OY6I7H/7PMKZ/V931KA/6VK464H/E68IN/PN/t?a=PhotoEM_10612
One CVS Drive, Woonsocket, RI 02895
[[3OY6I7H-2FJ04-7PMKZ-V931KA-6VK464H-M-M2-20130111-c79e71798e04cdd]]


{% extends "base.html" %} {% block content %}
This App auth-express is just a service that consumes the resources of the api-auth api.
You can find more information in the github and dockerhub repositories.


Beer Admin page
Create New Beer
Light
Brown
Dark
Submit
Update Beer
Light
Brown
Dark
Submit
Delete Beer
Submit
Beer List
GET ALL BEER
ID
Brand
Name
Stock
Percentage
Price
Image


Acetylsalicylic acid and sodium salicylate inhibit LPS-induced NF-kappa B/c-Rel nuclear translocation, and synthesis of tissue factor (TF) and tumor necrosis factor alfa (TNF-alpha) in human monocytes.
Abstract
We have investigated the effects of acetylsalicylic acid and sodium salicylate on the LPS-induced synthesis of the pro-coagulant protein tissue factor (TF) and the pro-inflammatory protein tumor necrosis factor-alpha (TNF-alpha), as well as the prostaglandin PGE2 in human monocytes. Both drugs dose-dependently inhibited LPS-induced TF and TNF-alpha synthesis at the mRNA and the protein level, and reduced PGE2 production. As evidenced by electro mobility shift assay (EMSA) and the use of a NF-kappa B prototypic probe, these drugs probably exert their inhibitory effects by interference with the nuclear translocation of NF-kappa B/c-Rel proteins. These data may expand the understanding of the anti-thrombotic and anti-inflammatory effects of these drugs when activation of monocytes occurs.


Bases: object
A class to represent tables of heterogeneous data.
Table provides a class for heterogeneous tabular data, making use of a numpy structured array internally to store the data values. A key enhancement provided by the Table class is the ability to easily modify the structure of the table by adding or removing columns, or adding new rows of data. In addition table and column metadata are fully supported.
Table differs from NDData by the assumption that the input data consists of columns of homogeneous data, where each column has a unique identifier and may contain additional metadata such as the data units, format, and description.
| Parameters : | data : numpy ndarray, dict, list, or Table, optional
mask : numpy ndarray, dict, list, optional
names : list, optional
dtypes : list, optional
meta : dict, optional
copy : boolean, optional
|
|---|
Attributes Summary
| ColumnClass | |
| colnames | |
| dtype | |
| mask | |
| masked |
Methods Summary
| add_column(col[, index]) | Add a new Column object col to the table. |
| add_columns(cols[, indexes]) | Add a list of new Column objects cols to the table. |
| add_row([vals, mask]) | Add a new row to the end of the table. |
| create_mask() | |
| field(item) | Return column[item] for recarray compatibility. |
| filled([fill_value]) | Return a copy of self, with masked values filled. |
| index_column(name) | Return the positional index of column name. |
| keep_columns(names) | Keep only the columns specified (remove the others). |
| keys() | |
| more([max_lines, max_width, show_name, ...]) | Interactively browse table with a paging interface. |
| next() | Python 3 iterator |
| pformat([max_lines, max_width, show_name, ...]) | Return a list of lines for the formatted string representation of the table. |
| pprint([max_lines, max_width, show_name, ...]) | Print a formatted string representation of the table. |
| read(*args, **kwargs) | Read in data |
| remove_column(name) | Remove a column from the table. |
| remove_columns(names) | Remove several columns from the table |
| rename_column(name, new_name) | Rename a column. |
| reverse() | Reverse the row order of table rows. |
| sort(keys) | Sort the table according to one or more keys. |
| write(data, *args, **kwargs) | Write out data |
Attributes Documentation
Methods Documentation
Add a new Column object col to the table. If index is supplied then insert column before index position in the list of columns, otherwise append column to the end of the list.
| Parameters : | col : Column
index : int or None
|
|---|
Add a list of new Column objects cols to the table. If a corresponding list of indexes is supplied then insert column before each index position in the original list of columns, otherwise append columns to the end of the list.
| Parameters : | cols : list of Columns
indexes : list of ints or None
|
|---|
Add a new row to the end of the table.
The vals argument can be:
This method requires that the Table object “owns” the underlying array data. In particular one cannot add a row to a Table that was initialized with copy=False from an existing array.
The mask attribute should give (if desired) the mask for the values. The type of the mask should match that of the values, i.e. if vals is an iterable, then mask should also be an iterable with the same length, and if vals is a mapping, then mask should be a dictionary.
| Parameters : | vals : tuple, list, dict or None
|
|---|
Return column[item] for recarray compatibility.
Return a copy of self, with masked values filled.
If input fill_value supplied then that value is used for all masked entries in the table. Otherwise the individual fill_value defined for each table column is used.
| Returns : | filled_table : Table
|
|---|
Return the positional index of column name.
| Parameters : | name : str
|
|---|---|
| Returns : | index : int
|
Keep only the columns specified (remove the others).
| Parameters : | names : list
|
|---|
Interactively browse table with a paging interface.
Supported keys:
f, <space> : forward one page
b : back one page
r : refresh same page
n : next row
p : previous row
< : go to beginning
> : go to end
q : quit browsing
h : print this help
| Parameters : | max_lines : int
max_width : int or None
show_name : bool
show_units : bool
|
|---|
Python 3 iterator
Return a list of lines for the formatted string representation of the table.
If no value of max_lines is supplied then the height of the screen terminal is used to set max_lines. If the terminal height cannot be determined then the default is taken from the configuration item astropy.table.pprint.MAX_LINES. If a negative value of max_lines is supplied then there is no line limit applied.
The same applies for max_width except the configuration item is astropy.table.pprint.MAX_WIDTH.
| Parameters : | max_lines : int or None
max_width : int or None
show_name : bool
show_units : bool
html : bool
|
|---|---|
| Returns : | lines : list
|
Print a formatted string representation of the table.
If no value of max_lines is supplied then the height of the screen terminal is used to set max_lines. If the terminal height cannot be determined then the default is taken from the configuration item astropy.table.pprint.MAX_LINES. If a negative value of max_lines is supplied then there is no line limit applied.
The same applies for max_width except the configuration item is astropy.table.pprint.MAX_WIDTH.
| Parameters : | max_lines : int
max_width : int or None
show_name : bool
show_units : bool
|
|---|
Read in data
The arguments passed to this method depend on the format
Remove a column from the table.
This can also be done with:
del table[name]
| Parameters : | name : str
|
|---|
Remove several columns from the table
| Parameters : | names : list
|
|---|
Rename a column.
This can also be done directly with by setting the name attribute for a column:
table[name].name = new_name
| Parameters : | name : str
new_name : str
|
|---|
Reverse the row order of table rows. The table is reversed in place and there are no function arguments.
Sort the table according to one or more keys. This operates on the existing table and does not return a new table.
| Parameters : | keys : str or list of str
|
|---|
Write out data
The arguments passed to this method depend on the format


Utility Methods
Query
This method functions in the same way as CodeIgniter's Query method except that the object is populated with the returned results.
Use this method at your own risk as it will only be as reliable as your query. I highly recommend using the binding approach so your data is automatically escaped.
The Query method will populate the object with the results so it is very important to remember that you should be querying for data from the objects table. For example:
// Create user object $u = new User(); // SQL query on users table $sql = "SELECT * FROM `users` WHERE `username` = 'Fred Smith' AND `status` = 'active'"; // Run query to populate user object with the results $u->query($sql);
Obviously you wouldn't use the Query method for the above situation since DataMapper's Get method would be more appropriate.
As I mentioned before, it is recommended you use bindings when using the Query method. For example, doing the same as above but with bindings:
// Create user object $u = new User(); // SQL query on users table $sql = "SELECT * FROM `users` WHERE `username` = ? AND `status` = ?"; // Binding values $binds = array('Fred Smith', 'active'); // Run query to populate user object with the results $u->query($sql, $binds);
The question marks in the query are automatically replaced with the values in the array in the second parameter of the Query method.
Add Table Name
This method will add the object's table name to the provided field.
Useful for the query method, as well as when you need to run more complicated queries using the normal methods from get and get advanced.
Arguments
- $field: A field or array of field names to prepend the table name to.
$u = new User(); $u->where( 'UPPER(' . $u->add_table_name('name') . ') <>', 'SECRET')->get(); // Produces SELECT * FROM `users` WHERE UPPER(`users`.`name`) <> 'SECRET'
The benefit of this method is you are no longer hard-coding the table name. It may or may not be worth it for your application.
Get SQL
This method returns the SQL for the currently built query, as if get() was called. It clears the current query immediately.
Arguments
- $limit: (Optional) Sets the limit on the query.
- $offset: (Optional) Sets the offset on the query.
$u = new User(); $u->where('name', 'Bob'); echo $u->get_sql();
Check Last Query
This method allows you to debug the last query that was processed. In its simplest form, it outputs the last query, formatted and placed inside <pre> tags.
You can also pass as the first argument in a two-item array with alternative delimiters, or FALSE for no delimiters. The second argument, when TRUE, prevents the method from automatically outputting the query to the browser.
Example
$u = new User(); $u->where('name', 'Joe')->get(); $u->check_last_query();Outputs to the browser:
SELECT `users`.* FROM `users` WHERE `users`.`name` = 'Joe'


{% extends 'base.html' %} {% block content%}
BRINGING YOU THE BEST NEWS STORIES
NEWSHIGHLIGHT {{articles|count}} results
{{articles|count}} results
- {{article.author}}
Posted on {{article.publishedAt}}
{{article.description|truncate(200)}}... View Article on site


vizFB was created by Tony Wang and Horace He at HSHacks 2014. The app was partially insipired by Wolfram Alpha's Facebook analysis features.
This application is open-source, so please feel free to check out our source code at our GitHub: https://github.com/tonynater/fbviz.


Erreur d'analogie métaphorique
The ‘killer apps’ were marketed on the promise that professionals did not need to learn new skills. The applications had been created as metaphoric analogies that were intended to look and act just like the traditional tools that artists and designers already used


Home
About Nicole
About Retreats
Meditation Retreat
Kailash Yatra
Writings
Video & Talks
Contact
Sitemap
Home
About Nicole
About Retreats
Meditation Retreat
Kailash Yatra
Writings
Video & Talks
Contact


Products
Features
For Business
May use cookies, web beacons, tracking pixels, and other tracking technologies when you visit our website Acurateco.com


Tokens¶
TokenMakers consists of Tokenizer, Indexer, Vocabulary, and Embedding Modules.TokenMaker
is responsible for the indexing of text and the generation of the tensors through the embedding module.
Tokenizers¶
Tokenizer Design
class SentTokenizer(name, config): ...
class WordTokenizer(name, sent_tokenizer, config) ...
class SubwordTokenizer(name, word_tokenizer, config) ...
class CharTokenizer(name, word_tokenizer, config) ...
The Tokenizer has a dependency with the other unit’s tokenizer and the tokenize()
function takes the input of text units.
(* unit: unit of input e.g. ‘text’, ‘sentence’ and ‘word’)
tokenizer()
example
>>> text = "Hello World.This is tokenizer example code."
>>> word_tokenizer.tokenize(text, unit="text") # text -> sentences -> words
>>> ['Hello', 'World', '.', 'This', 'is', 'tokenizer', 'example', 'code', '.']
>>> word_tokenizer.tokenize(text, unit="sentence") # text -> words
>>> ['Hello', 'World.This', 'is', 'tokenizer', 'example', 'code', '.']
Several tensors in a sub-level text unit can be combined into a single tensor of higher level via a vector operation. For example, subword level tensors can be averaged to represent a word level tensor.
e.g.) concatenate [word; subword] (subword tokens –average–> word token)
The list of pre-defined
Tokenizers
:
| Text Unit | Language | Name | Example |
|---|---|---|---|
| BPE | All (depend on vocab) | roberta | Hello World -> ["ĠHello", "ĠWorld"] |
| Char | All | character | Hello World -> ["Hello", "World"] -> [["H", "e", "l", "l", "o"], ["W", "o", "r", "l", "d"]] |
| Char | Korean | jamo_ko | "안녕 세상" -> ["안녕", "세상"] -> [["ㅇ", "ㅏ", "ㄴ", "ㄴ", "ㅕ", "ㅇ"], ["ㅅ", "ㅔ", "ㅅ", "ㅏ", "ㅇ"]] |
| Subword | All (but, need vocab.txt) | wordpiece | "expectancy of anyone" -> ["expectancy", "of", "anyone"] -> ["expect", "##ancy", "of", "anyone"] |
| Word | English | nltk_en | - |
| Word | English | spacy_en | - |
| Word | Korean | mecab_ko | - |
| Word | All | bert_basic | - |
| Word | All | space_all | "Hello World" -> ["Hello", "World"] |
| Sent | All | punkt | "Hello World. This is punkt tokenizer." -> ["Hello World.", "This is punkt tokenizer."] |
Token Maker¶
The list of pre-defined
Token Maker
:
| Type | Description | Category | Notes |
|---|---|---|---|
| char | character -> convolution -> maxpool | CharCNN |
- |
| cove | Embeddings from Neural Machine Translation | NMT |
- From Salesforce |
| feature | Do not use embedding function, just pass feature | Feature |
- |
| word | word -> Embedding (+pretrained) | Word2Vec |
- |
| frequent_word | word token + pre-trained word embeddings fixed and only fine-tune the N most frequent | Word2Vec + Fine-tune |
- |
| exact_match | Three simple binary features, indicating whether p_i can be exactly matched to one question word in q, either in its original, lowercase or lemma form. | Feature |
- Sparse or Embedding - Only for RC |
| elmo | Embeddings from Language Models | LM |
From Allennlp |
| linguistic | Linguistic Features like POS Tagging, NER and Dependency Parser | Feature |
- Sparse or Embedding |
Example of tokens in BaseConfig
"token": {
"names": ["char", "glove"],
"types": ["char", "word"],
"tokenizer": { # Define the tokenizer in each unit.
"char": {
"name": "character"
},
"word": {
"name": "treebank_en",
"split_with_regex": true
}
},
"char": { # token_name
"vocab": {
"start_token": "<s>",
"end_token": "</s>",
"max_vocab_size": 260
},
"indexer": {
"insert_char_start": true,
"insert_char_end": true
},
"embedding": {
"embed_dim": 16,
"kernel_sizes": [5],
"num_filter": 100,
"activation": "relu",
"dropout": 0.2
}
},
"glove": { # token_name
"indexer": {
"lowercase": true
},
"embedding": {
"embed_dim": 100,
"pretrained_path": "<glove.6B.100d path>,
"trainable": false,
"dropout": 0.2
}
}
},
# Tokens process
# Text -> Indexed Featrues -> Tensor -> TokenEmbedder -> Model
# Visualization
# - Text: Hello World
# - Indexed Feature: {'char': [[2, 3, 4, 4, 5], [6, 7, 8, 4, 9]], 'glove': [2, 3]}
# - Tensor: {'char': tensor, 'glove': tensor}
# - TokenEmbedder: [char; glove] (default: concatenate)
# - Model: use embedded_value


Tau Framework Migration Tool
{{replace_folder_creation}}
Pending migrates:
{{replace_pending_migrates}}
Executing pending migrates
{{replace_content}}
{{replace_footer}}


New Meeting Proposal Created
Your Chosen Meeting Times
{% for time in session.meet.times %}
{{time.name}}
BEGINS: {{time.start | fmtdate}} {{time.start | fmttime}}
ENDS: {{time.end | fmtdate}} {{time.end | fmttime}}
{% endfor %}
Share this link with meeting attendees. They will use it to note their availablity.
{{session.user_link}}


VSL // The Sabah Dealer
* Jed Foutz is a 5th generation art dealer who takes an old approach to business. Through long-standing relationships and with an amazing eye, Jed curates an incredible array of ancient and contemporary Native American textiles, ceramics, artwork, and jewelry at his gallery in Santa Fe
today’s Very Short List:
style 5 Nov 2014
Mickey Ashmore is the creator of Sabah
Subscribe
* A secluded estate in South Austin, the Hotel Saint Cecilia
* Born in the 1930s from the hospitality of the Deetjen family, the Big Sur Inn
http://link.nyobserver.com/516ca68465217dc6e1b9a3a61ykgq.25r2/TvnrKi0WTdwTHwxwCe6a8
delightful e-mail that shares
cultural gems from a
different curator every day.
If you have any problems reading this e-mail, click here
http://link.nyobserver.com/516ca68465217dc6e1b9a3a61ykgq.25r2/UHyHCJsf7NZSKXrPC53ea
Subscribe
Forward
My Account
Unsubscribe
culture 31 Oct 2014
VSL Editor Alexa Jaccarino celebrates Halloween.
tech 29 Oct 2014
Megan Wright invites you to meet the next billion.
culture 27 Oct 2014
John Supko listens to a few generative music engines.
Editorial Policy
Privacy Policy
Contact Us
Press
Terms + Conditions
very fine print: ©2014
Observer VSL LLC.
321 West 44th Street, 6th Floor
New York, NY 10036 USA
All rights reserved.
Questions?<PHONE_NUMBER>.
This message was intended for<EMAIL_ADDRESS>If you believe this has been sent to you in error, please safely unsubscribe


| File | Statements | Branches | Functions | Lines | |||||
|---|---|---|---|---|---|---|---|---|---|
| index.ts | 0% | 0/21 | 0% | 0/22 | 0% | 0/2 | 0% | 0/16 | |
| jest-global-mocks.ts | 44.44% | 4/9 | 0% | 0/4 | 16.67% | 1/6 | 44.44% | 4/9 | |
| jest.ts | 100% | 2/2 | 100% | 0/0 | 100% | 0/0 | 100% | 2/2 | |
| split.component.ts | 23.08% | 39/169 | 8.05% | 7/87 | 2.17% | 1/46 | 20.69% | 30/145 | |
| splitArea.directive.ts | 19.05% | 8/42 | 27.27% | 6/22 | 0% | 0/14 | 17.95% | 7/39 | |
| splitGutter.directive.ts | 25% | 7/28 | 15.38% | 2/13 | 0% | 0/9 | 22.22% | 6/27 |


See how well your draft picks have performed so far. Your score is based on how well your team is playing, relative to their draft position.
COMING SOON! We'll deliver live updates to your phone, so you can pick your starting goalie in time for the next game.
This is an ongoing project and we like building stuff. So if you have a good suggestion, send us a message.
Login and authenticate your Yahoo! account with Fantasy Stats
Enter Your Yahoo! Fantasy Team ID
Pick the data visualization you would like to see
Enter the Team ID of another player in your league to see their data


"New Relic... might officially set the golden standard as a bike-friendly business" http://btaoregon.org/2013/09/bike-commute-challenge-workplace-spotlight-new-relic/
9/25/2013, 10:31:41 AM
Favs: 0
Retweets: 1
link--- layout: tweet ---
"New Relic... might officially set the golden standard as a bike-friendly business" http://btaoregon.org/2013/09/bike-commute-challenge-workplace-spotlight-new-relic/
9/25/2013, 10:31:41 AM
Favs: 0
Retweets: 1
link


Document content goes here...
Sorry your browser does not support inline frames.
Document content also go here...


#100DaysOfMLCode
First step in any machine learning problem is to load data. In this blog post, we will learn what are the different data loaders and file formats available in Python to do machine learning.
Common file formats used to store data in machine learning as well as deep learning are .csv, .h5 and .pickle. Apart from these, there are some other ways to handle large data files as discussed here.
CSV files
CSV is the most common file format in machine learning. CSV means Comma Separated Values. Each row in the file represents an instance and each column represents an attribute or feature.
When working with CSV files, you need to consider the following factors.
- Does your csv file have headers which represent column names?
- Does your csv file have comments specified using any symbol?
- Does your csv file have delimiter apart from the standard , delimiter?
- Does your csv file have quotes to represent string values separated by space?
For this tutorial, we will consider the famous Iris dataset. You can download the iris.data csv file here. Go to that page, hit ctrl+a, ctrl+c, ctrl+v and save it as iris_dataset.csv. Below is the first 10 rows of Iris dataset which is represented in .csv format.
1 2 3 4 5 6 7 8 9 10 | 5.1,3.5,1.4,0.2,Iris-setosa 4.9,3.0,1.4,0.2,Iris-setosa 4.7,3.2,1.3,0.2,Iris-setosa 4.6,3.1,1.5,0.2,Iris-setosa 5.0,3.6,1.4,0.2,Iris-setosa 5.4,3.9,1.7,0.4,Iris-setosa 4.6,3.4,1.4,0.3,Iris-setosa 5.0,3.4,1.5,0.2,Iris-setosa 4.4,2.9,1.4,0.2,Iris-setosa 4.9,3.1,1.5,0.1,Iris-setosa |
Load CSV using Python
csv module in Python provides a method called reader() to read .csv files. You can specify the delimiter used in your csv file as well as quoting constraints as shown below. You can also convert the data read by csv reader into a numpy array and then use it to do machine learning. The below example prints the shape of the iris dataset using python’s csv reader and numpy.
1 2 3 4 5 6 7 8 9 10 11 12 | import csv import numpy as np # load iris dataset using csv package file_path = "iris_dataset.csv" f = open(file_path, "r") data = csv.reader(f, delimiter=",", quoting=csv.QUOTE_NONE) d = list(data) # use numpy to print the shape data = np.array(d) print(data.shape) # prints (150, 5) |
Load CSV using Numpy
Numpy offers two handy functions to load csv files. numpy.loadtxt() works only if the data present in csv file is of same datatype. numpy.genfromtxt() works for multiple datatype in a single csv file using the argument dtype=None.
1 2 3 4 5 6 7 | import numpy as np # load iris dataset using numpy file_path = "iris_dataset.csv" f = open(file_path, "r") data = np.genfromtxt(f, delimiter=",", dtype=None) print(data) # prints the iris dataset |
Load CSV using Pandas
Pandas offers comprehensive and easier ways to load csv files. pandas.read_csv() method loads the csv data as a pandas dataframe which could directly be used for visualization and machine learning. In the below example, I have specified header names for each column in the csv file and assigned it using names argument in pd.read_csv() function.
1 2 3 4 5 6 7 8 | import pandas as pd # load iris dataset using pandas file_path = "iris_dataset.csv" header_names = ["sepal_length", "sepal_width", "petal_length", "petal_width", "class"] data = pd.read_csv(file_path, names=header_names) print(data.shape) # prints (150, 5) print(type(data)) # prints <class 'pandas.core.frame.DataFrame'> |
Advantages of CSV
- Human-readable format.
- Easy to edit manually.
- Easy to implement and parse.
- Faster to handle for smaller dataset.
Disadvantages of CSV
- Takes huge time to load large data.
- Takes huge time to save large data.
- No standard way to represent binary data and control characters.
- No distinction between numeric and text values.
- No way to represent complex hierarchical data.
HDF5 files
An alternative to CSV file format is the HDF5 file format which is now widely used in Deep Learning. HDF5 is a hierarchical data format to store and manage large chunks of data. It is similar to a filesystem data format which can store complex hierarchical data. Please read this introduction about HDF5 file format and then start using it.
HDF5 includes two major object types.
- Groups - Container like structures to hold datasets and other groups.
- Datasets - Multi-dimensional arrays of a homogeneous type (You could think of a standard numpy array).
Save HDF5 using h5py
You can save any number of numpy arrays in .h5 file format and load it again using a python library called h5py. If you have installed Python via Anaconda, then you should get it by default. Otherwise install it using pip (installing h5py).
The following example creates two random numpy arrays and saves a demo_data.h5 file locally. Notice that we pass the numpy array as a data argument to the create_dataset() function. You can create as many dataset as you want with unique name to each dataset.
If you execute the below code, you would get a demo_data.h5 file which is of size 9.6MB in your localdisk.
1 2 3 4 5 6 7 8 9 10 11 | import numpy as np import h5py # create two random numpy arrays a1 = np.random.random(size = (500, 500)) a2 = np.random.random(size = (1000, 1000)) # save it as a HDF5 file with h5py.File("demo_data.h5", "w") as f: f.create_dataset("dataset1", data=a1) f.create_dataset("dataset2", data=a2) |
Load HDF5 using h5py
You can access the list of keys in the .h5 file using keys() function directly on the file. This returns the list of keys you have created.
You can access the stored dataset using get() function with the dataset’s name passed as the argument. After loading the dataset, you can easily use np.array() function to convert it back to a numpy array.
The following example displays the keys, loads the demo_data.h5 file, loads dataset1, convert it back to numpy array and prints out its shape.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import numpy as np import h5py # load the saved .h5 file with h5py.File("demo_data.h5", "r") as f: # display the list of keys in this file keys = list(f.keys()) print("{0} keys in this file: {1}".format(len(keys), keys)) # prints 2 keys in this file: ['dataset1', 'dataset2'] # load the numpy array data = f.get("dataset1") a1 = np.array(data) print("Shape of dataset1: {0}".format(a1.shape)) # prints Shape of dataset1: (500, 500) |
Save group using h5py
Similar to dataset which holds multi-dimensional numpy arrays, you can create groups to hold datasets and other groups. To do that, you need to use create_group() function and pass in an unique group name.
The following example creates two random numpy arrays, creates two groups with its corresponding dataset. Running this example generates demo_group.h5 file locally that is of size 3.9MB.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import numpy as np import h5py # create two random numpy arrays a1 = np.random.random(size= (500, 500)) a2 = np.random.random(size= (500, 500)) # create groups and datasets with h5py.File("demo_group.h5", "w") as f: group1 = f.create_group("group1") group1.create_dataset("dataset1", data=a1) group2 = f.create_group("group2") group2.create_dataset("dataset2", data=a2) |
Load group using h5py
To load group from a .h5 file, you need to use the same get() function with the group’s name as the argument. As keys() gave datasets in the file, items() will provide the list of groups in the file.
The following example loads the demo_group.h5 file, loads the list of groups in the file using items() function and prints out the contents of group1.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import numpy as np import h5py # read groups and datasets with h5py.File("demo_group.h5", "r") as f: # get the list of items in the file groups = list(f.items()) print("{0} items in this file - {1}".format(len(groups), groups)) # load group1 and print the items group1 = f.get("group1") group1_items = list(group1.items()) print("{0} item in group1 - {1}".format(len(group1_items), group1_items)) # load dataset1 from group1 and print its shape data1 = group1.get("dataset1") a1 = np.array(data1) print("Shape of dataset1 in group1: {0}".format(a1.shape)) |
1 2 3 | 2 items in this file - [('group1', <HDF5 group "/group1" (1 members)>), ('group2', <HDF5 group "/group2" (1 members)>)] 1 item in group1 - [('dataset1', <HDF5 dataset "dataset1": shape (500, 500), type "<f8">)] Shape of dataset1 in group1: (500, 500) |
In case if you found something useful to add to this article or you found a bug in the code or would like to improve some points mentioned, feel free to write it down in the comments. Hope you found something useful here.
Happy learning!


World Wide Web also known as WWW, an advanced information retrieval system that supports many kinds of information such as pictures, videos, graphs, fonts and many more. WWW is based on HyperText Markup Language, commonly referred as HTML, the standard markup language used to create web pages. It is written in the form of HTML elements consisting of tags enclosed in angle brackets, e.g. <tagname>.
The internet uses HTTP to communicate with you, your browser and servers.
For example:
A person logs onto their computer and runs a type of program called a browser. The browser makes requests of servers through the internet using a protocol called HTTP and the server will respond with information that your browser interprets and displays.
Browser - A program (Chrome, FireFox, Safari) that runs on your computer to display files found on the web.
Internet - The world's most largest computer network.
Servers - Computers that host the files that make up the web.
HTTP - The main protocol of the web.
HTTP, shortform for HyperText Transfer Protocol, the set of rules for transferring files (text, graphic images, sound, video, and other multimedia files) on the World Wide Web. As soon as a Web user opens their Web browser, the user is indirectly making use of HTTP.
In computing, a hyperlink is a reference to data that the reader can directly follow either by clicking or by hovering. A hyperlink points to a whole document or to a specific element within a document. Hypertext is text with hyperlinks.
HTML is made up of:
Text content - What you see
Markup - What it looks like
References to other documents - Such as images, videos
Link - Shortcut to other pages
Intro to HTML Tags
HTML Elements
Example:
"<tagname>Contents</tagname>"
<tagname> - Openning tag
Contents - Text to be displayed/effected by the tag.
</tagname> - Closing tag
Reminder: If you do not input the closing tag, the following contents will be formatted as the openning tag.
List of Basics Tags
 tag specifies bold text
 tag renders as emphasized text, it specifies italic
HTML Attributes
HTML elements can have attributes.
Attributes provide additional information about an element
Attributes are always specified in the openning tag
Attributes come in name/value pairs like: name="value"
1. Making Links
HTML links are defined with the  tag. The link address is specified in the href attribute:
text
"value" refers to the link that you wish to direct to
2. Adding Images
HTML images are defined with the  tag.
The alt attribute specifies an alternative text to be used, when an HTML element cannot be displayed.The value of the attribute can be read by "screen readers". This way, someone "listening" to the webpage, i.e. a blind person, can "hear" the element.
The filename of the source (src), and the size of the image (width and height) are all provided as attributes:
Reminder: "" is a void tag, other void tags include "
" etc. Void element does not required any closing tag.
HTML Block Elements and Inline Elements
Most HTML elements are defined as block level elements or inline elements:
Block level elements normally start (and end) with a new line, when displayed in a browser.
Examples:
,
,
,

Inline elements are normally displayed without line breaks.
Examples:
, , ,
The HTML
 element is a block level element that can be used as a container for other HTML elements.
The
 element has no special meaning. It has no required attributes, but style and class are common.
Because it is a block level element, the browser will display line breaks before and after it.
When used together with CSS, the
 element can be used to style blocks of content.
The HTML element is an inline element that can be used as a container for text.
The  element has no special meaning. It has no required attributes, but style and class are common.
Unlike
, which is formatted with line breaks, the  element does not have any automatic formatting.
When used together with CSS, the  element can be used to style parts of the text.
Summary
The 5 most important things to learn from this lesson are:
1.  How Coding Works
3.  Programmers Can't Remember Everything
5. Basic HTML Vocabulary


Polishing off styling. I love the smell of CSS in the morning. 1/28/2009, 9:49:32 AM Favs: 0 Retweets: 0 link


[1]
omnia ll out 12/2/09 - you enduup with 2 or 3 taps.
[2]
Omled screen your buying "programs for average users have more than HTC Touch HD Pocket pc.


We will talk about a short parric example here
We will talk about a short parric example here
Projects Links
Heres a description of piRna
Heres a description of piRNA CPU
Heres a description of IRIS@GPUs
Heres a description of piRna
Heres a description of REU Spring 2018
Heres a description of Grad Research
Heres a description of IRIS@GPUs
Heres a description of IRIS@GPUs
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero odio fugiat voluptatem dolor, provident officiis, id iusto! Obcaecati incidunt, qui nihil beatae magnam et repudiandae ipsa exercitationem, in, quo totam.


The water filter was given 450ml of "dirty" water. The water filter produced 400ml of "clean" water
Sample BeforeSample After
- Define the Problem
- Do Background Research
- Specify the Requirements
- Brainstorm, Evaluate and Choose Solution
- Develop and Prototype Solution
- Test Solution
- Communicate Results
The problem we are trying to solve is the lack of safe drinking water. Our goal is to create a water filter that is capable of decreasing turbidity and removing contaminants.
At this point in the process Micah found out about a type of water filter called the cyclone filter. The design of this filter is that it uses constant pressure and a cone shape to filter out contaminants and release a constant stream of water, no membrane needed. Though because of constraints, we might resort to a membrane filter.
The requirements of this problem where to develop an inexpensive yet effective water filter to help remove harmful contaminants from drinking water sources.
We found an equation for the dimensions of a bradley hydrocyclone and Julian started working on cading them.
During development, we realized that we were unable to develop a hydrocyclone within the deadline with the tools and knowledge that we had so we went back to the brainstorming phase and decided to create a filter with a yogurt cup, coffee filters, charcoal, sand and gravel, pulling loosely from the bio-sand filter’s design.

The result of the traditional filter design was water that was quickly filtered and had a slight but distinct change in color.


The page you were looking for can't be found. Head back to Clean.Data. or send an email to<EMAIL_ADDRESS>about the problem.


Steering geometry
We are all familiar with the idea that turning the steering wheel in a car rotates the front wheels, causing the car to steer into a turn. But why do we normally steer with the front wheels rather than the rear wheels (or all four wheels, as shown below)? Do both front wheels turn the same amount, or is something more complicated going on?
A Mercedes-Benz Typ G 5 (W 152, 1937–1941) housed in Technik Museum Speyer, showing the use of a four-wheel steering system. Image source: Wikimedia Commons (CC BY-SA 3.0) (full-sized image).
Turning rigid bodies
When a rigid body turns in a circle, the four corners of the body all move with different velocities and speeds. If we think of a car as a single rigid body with wheels at the corners, this means the four wheels move with different speeds and also different directions. Car designers can choose different steering arrangements, as shown below, where the steering can be with the front two wheels only (conventional cars), with the rear two wheels only (forklifts), or with all four wheels in some high-performance cars.
| Show: | ||
| Turn radius: | $r = $ m | |
| Vehicle offset: | $d = $ % |
A car turning in a circle, showing the directions that the wheels must point as the turn radius $r$ and offset $d$ change.
Forklifts typically have fixed front wheels and steer with the rear wheels. This gives them great control over the position of the front lifting forks, but makes steering harder for the operator. Rear-wheel steering is a type of non-minimum phase control system. The technical definition of minimum phase is somewhat complicated, but for vehicle steering it essentially means that we have to steer the “wrong way”. For example, to turn right in a forklift we have to first swing the back out to the left. This makes it very easy to accidentally run into obstacles, and is also unstable at higher speeds.
Sometimes in cars it would be convenient to also steer with the rear or trailing wheels, for example when trying to park in a tight spot. We actually have a mechanism for converting a car to trailing-wheel steering, which is to drive backwards, such as when parallel parking.
Ackerman steering geometry
In a conventional car, the rear two wheels are fixed to point straight ahead, while the front two wheels must turn at different but matched angles. To achieve the correct front wheel angles, cars typically use a four-bar linkage as shown below. The pins at $A$ and $B$ are called kingpins (normally actually ball joints in modern cars), the $CD$ rod is called the tie rod, and the $AD$ and $BC$ rods are called steering arms. By correctly choosing the lengths of the linkage rods, the car steering will automatically produce nearly correctly matched front wheel angles to make a perfect turn with any radius of curvature.
Steering pivot offset angle: $\theta = $ °
Adjustable Ackerman steering geometry. The graph shows the radius of curvature for the two front wheels as a function of the rack offset $d$.
Three wheeled vehicles with two wheels in back and one in front (a delta or tricycle configuration) avoid the need for complicated steering geometry, leading Karl Benz to use this system in the world's first automobile.
Episode 4 of Season 9 of Top Gear featured a segment on the Reliant Robin, a three-wheel car produced in the 1970s in the United Kingdom. This Top Gear episode clearly demonstrates some of the reasons that single-wheel steering systems for cars have not achieved long-lasting commercial success.
Three-wheeled cars were rather popular with British manufacturers in the 1960s and 1970s. As well as single-wheel-in-front models like the Reliant Robin, there were also production cars with a single wheel in the back (a tadpole configuration). An example of this is the smallest production car ever made, the Peel 50, shown in another Top Gear episode (Series 10, Episode 3).


$$ \Omega_B - \Omega_A = \int _A ^B \nabla \Omega \cdot \mathbf{ dl }$$
For a given vector field, if $\mathbf{A} \cdot \mathbf{ dl }$ is an exact differential, $\mathbf{A}$ is a conservative field. Then, $\mathbf{A}$ is the
gradient function of some scalar function $\Omega$. That is, $\mathbf{A} = \nabla {\Omega}$.
We can relate $\Omega$ and $\nabla \Omega$ by the equation below:
$$ \int _A ^B \nabla \Omega \cdot \mathbf{ dl } = \Omega_B - \Omega_A$$
From this equation above, we can see that the integral is independent of the path that one takes from A to B,
for it is determined by only the values from the parent function $\Omega_B - \Omega_A$. This is a generalisation of the Fundamental Theorem of Calculus.
Visualisation Guide
- On the right, you can see a gradient field and its scalar parent function.
Change the value of the parameter $a$, and observe the change in $\nabla \Omega$ and $\Omega$.
- Note that as the magnitude of $a$ increases, the length of the arrows in $\nabla \Omega$ increases and the contour of the parent function
$\Omega$ becomes steeper as well. Hence, the gradient vector increases in magnitude as well.
- All gradient fields shown in this suite are conservative. This means that the line integral along the field,
$\int \nabla \Omega \cdot \mathbf{ dl }$ is path independent. Move the path of the ball from Point A to Point B
along 2 different paths, Path 1 and Path 2.
- Observe their function values. Note that along the path, the value of $\Omega$ may be different.
However, when the balls reach Point B, their function values are equal.
- This means that the line integral $\int _A ^B \nabla \Omega \cdot \mathbf{ dl }$ is determined
only by the value of $\Omega$ at the limits, $\Omega_B - \Omega_A$.
 Click the dropdown menu to find out.


We offer a range of mental health counselling and support and mainly work with animal therapy.
Animal therapy is a complementary treatment. It is not a basis for the treatment of any condition and should only enhance or complement other treatment. It is not a replacement for other forms of therapy, such as psychotherapy or physical therapy. This form of therapy might not suit everyone, however. People who do not respond well to animal therapy or are not interested in trying it may ask about other options. These alternatives will vary depending on the person’s condition.
Should you have questions or are in need of any assistance, please do not hesitate to contact us.


PSSET(1) FSF PSSET(1) NAME psset - insert page device request in PostScript files SYNOPSIS psset FILE DESCRIPTION Produce a version of the PostScript FILE with a protected call to the PostScript operator `setpagedevice'. Typical use is making FILE print duplex, or on the manual tray etc. OPTIONS -h, --help display this help and exit -v, --version display version information and exit -q, --quiet don't print informational messages -o, --output=FILE save result in FILE. If FILE is `-', send to stdout -n, --no-fix don't run `fixps' to fix PS problems in FILE -S, --setpagedevice=KEY[:VALUE] pass a page device definition to output. Multiple values accumu‐ late -a, --at=PAGE insert the page device definitions at PAGE. Default is PAGE=0, standing for the Document's Setup section Shortcuts: -m, --manualfeed alias for -SManualFeed:true -s, --simplex alias for -SDuplex:false -d, --duplex alias for -SDuplex:true -STumble:false corresponds to Duplex, binding along the long edge -t, --tumble alias for -SDuplex:true -STumble:true corresponds to Duplex, bind‐ ing along the short edge Produced output is meant for PS level 2 printers. News, updates and documentation: visit http://www.inf.enst.fr/~demaille/a2ps/ AUTHOR Written by Akim Demaille. REPORTING BUGS Report bugs to<EMAIL_ADDRESS>COPYRIGHT Copyright © 1998-1999 Akim Demaille, Miguel Santana This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO a2ps(1), card(1), fixps(1), pdiff(1), psset(1), texi2dvi4a2ps(1). The full documentation for psset is maintained as a Texinfo manual. If the info and psset programs are properly installed at your site, the com‐ mand info psset should give you access to the complete manual. psset 1.3 (GNU a2ps 4.14) March 2014 PSSET(1)


Basic Tags
 Creates an HTML document
 Sets off the title and other information that isn’t displayed on the web page itself
 Sets off the visible portion of the document
Body Attributes
 Sets the background color, using name or hex value
 Sets the text color, using name or hex value
 Sets the color of links, using name or hex value
 Sets the color of followed links, using name or hex value
 Sets the color of links on click
 Disallows text selection with the mouse and keyboard
Text Tags

 Creates preformatted text
<hl></hl> Creates the largest headline

 Creates the smallest headline
 Creates bold text
 Creates italic text
<tt></tt> Creates teletype, or typewriter-style text
 Creates a citation, usually italic
 Emphasizes a word (with italic or bold)
 Emphasizes a word (with italic or bold)
 Sets size of font, from 1 to 7
 Sets font color, using name or hex value
Links
 Creates a hyperlink
 Creates a mailto link
  Creates an image/link
 Creates a target location within a document
 Links to that target location from elsewhere in the document
Formatting

 Creates a new paragraph

 Aligns a paragraph to the left (default), right, or center.

 Inserts a line break

 Indents text from both sides

 Creates a definition list

 Precedes each definition term

 Precedes each definition

 Creates a numbered list

 Creates a bulleted list

 Precedes each list item, and adds a number or symbol depending upon the type of list selected

 A generic tag used to format large blocks of HTML, also used for stylesheets
 Adds an image
 Aligns an image: left, right, center; bottom, top, middle
 Sets size of border around an image

 Inserts a horizontal rule

 Sets size (height) of rule

 Sets width of rule, in percentage or absolute value

 Creates a rule without a shadow
Tables

 Creates a table

 Sets off each row in a table
	 Sets off each cell in a row
	 Sets off the table header (a normal cell with bold, centered text)
Table Attributes

 Sets width of border around table cells

 Sets amount of space between table cells

 Sets amount of space between a cell’s border and its contents

 Sets width of table, in pixels or as a percentage of document width

 or  Sets alignment for cell(s) (left, center, or right)

 or  Sets vertical alignment for cell(s) (top, middle, or bottom)
 Sets number of columns a cell should span (default=1)
 Sets number of rows a cell should span (default=1)
 Prevents the lines within a cell from being broken to fit
Frames
<frameset></frameset> Replaces the  tag in a frames document; can also be nested in other framesets
<frameset rows="value,value"> Defines the rows within a frameset, using number in pixels, or percentage of width
<frameset cols="value,value"> Defines the columns within a frameset, using number in pixels, or percentage of width
<frame> Defines a single frame — or region — within a frameset
<noframes></noframes> Defines what will appear on browsers that don’t support frames
Frames Attributes
<frame src="URL"> Specifies which HTML document should be displayed
<frame name="name"> Names the frame, or region, so it may be targeted by other frames
<frame marginwidth="value"> Defines the left and right margins for the frame; must be equal to or greater than 1
<frame marginheight="value"> Defines the top and bottom margins for the frame; must be equal to or greater than 1
<frame scrolling="value"> Sets whether the frame has a scrollbar; value may equal “yes,” “no,” or “auto.” The default, as in ordinary documents, is auto.
<frame noresize="noresize"> Prevents the user from resizing a frame
Forms
For functional forms, you’ll have to run a script. The HTML just creates the appearance of a form.
<form></form> Creates all forms
<select multiple name="NAME" size=?></select> Creates a scrolling menu. Size sets the number of menu items visible before you need to scroll.
<option> Sets off each menu item
<select name="NAME"></select> Creates a pulldown menu
<option> Sets off each menu item
<textarea name="NAME" cols=40 rows=8></textarea name> Creates a text box area. Columns set the width; rows set the height.
<input type="checkbox" name="NAME"> Creates a checkbox. Text follows tag.
<input type="radio" name="NAME" value="x"> Creates a radio button. Text follows tag
<input type="text" name="NAME" size=20> Creates a one-line text area. Size sets length, in characters.
<input type="submit" value="NAME"> Creates a Submit button
<button type="submit">Submit</button> Creates an actual button that is clicked
<input type="image" border=0 name="NAME" src="name.gif"> Creates a Submit button using an image
<input type="reset"> Creates a Reset button


--- layout: post title: Difference between PR, Marketing, Advertising & Branding [Infographic] date: 2010-04-29 06:00:00.000000000 -05:00 comments: true categories: - Design - graphic - Startup published: true ---
9gag.com has recently put out a nice infographic that illustrates, pretty nicely, the differences between Public Relations, Marketing, Advertising and Branding.


About
I am a Computer Science Junior at Netaji Subhas University Of Technology, East Delhi Campus.
Detail-oriented Software Developer with professional experience in Data Science, Machine Learning, Computer Vision, and Backend-Development.
I am adept in Python, Machine Learning, Computer Vision, and NLP, and familiar with Django and Flask.
Experience
- What After College is a renowned media startup connecting students, educators & institutions. It aims to understand & evaluate the industrial demands & train the students to get them job-ready.
- I am teaching students courses in Data Science and Machine Learning.
- Improved the curriculum of the courses and developing the course content at the moment.
- Tools: Python, Keras, Tensorflow, Scikit-learn, Jupyter, Numpy, Pandas, Matplotlib
- Amnet is a leading technology-driven company providing effective publishing services and solutions to publishers, brands, agencies, and organizations globally for the last 20+ years.
- I was part of the company's ML-AI initiative to develop artificially intelligent end-to-end solutions for the challenges faced in the publishing domain.
- Designed, implemented, and distributed the systems that provided an effortless user experience to the publishers and reduced the workload of editors.
- Designed the data ingestion pipeline and implemented the auto metadata extraction software.
- Worked on the automated data review using Win32 api.
- Implemented an auto image captioning model using InceptionV3 and RNN.
- Developed the desktop application using Tkinter.
- Tools: Python, Keras, Tensorflow, Tkinter, Win32 Api, Django
- I was part of the organization's GRIP internship program which was aimed to mentor and guide students in the field of Data Science and Machine Learning.
- Worked on analysis of data from internal and external sources.
- Implemented various supervised and unsupervised machine learning models in Python.
- Tools: Python, Scikit-learn, Numpy, Pandas, Jupyter
Projects
Detect and classify each face from a real-time feed based on the emotion shown in the facial expression into one of seven categories (Angry, Disgust, Fear, Happy, Sad, Surprise, Neutral).
Covid-19 tracker app with an in-built voice assistant.
A deep GRU neural network that can detect the trigger word from live audio feed and perform specific tasks.
Skills
Languages
Libraries
Frameworks
Other
Education
Delhi, India
Degree: Bachelor of Technology
Major: Computer Science
CGPA: 7.71/10 (till 5th Sem)
- Data Structures
- Object Oriented Programming
- Database Management Systems
- Algorithms Design and Analysis
- Web Technology
Relevant Courseworks:
Delhi, India
Degree: Senior Secondary (Class 12th)
Stream: Science (PCM)
Percentage: 92.8%
- Scored 95% in Mathematics and Physics
Certificates
This course provides a broad introduction to machine learning, datamining, and statistical pattern recognition. Topics include:
- Supervised learning (parametric/non-parametric algorithms, support vector machines, kernels, neural networks).
- Unsupervised learning (clustering, dimensionality reduction, recommender systems, deep learning).
- Best practices in machine learning (bias/variance theory; innovation process in machine learning and AI).
In this Specialization, I built and trained neural network architectures such as
Convolutional Neural Networks, Recurrent Neural Networks, LSTMs, Transformers, and learnt how to
make them better with strategies such as Dropout, BatchNorm, Xavier/He initialization, and more.
I studied theoretical concepts and their industry applications using Python and
TensorFlow and tackle real-world cases such as speech recognition, music synthesis, chatbots,
machine translation, natural language processing, and more.
Testimonials
"It was great working with Mehul, he has a keen interest and amazing knowledge of Data Science and Machine Learning with AI. He was Found to be a professional trainer with high motivation and perfect work ethics. Would happily recommend him to anyone."
"It was a delight to have Mehul as part of my team of ML-AI interns. Self-motivated and professional, Mehul’s enthusiasm to explore new areas and analyze various options for continuous improvement deserves a special mention. All the best, Mehul!"


While the Nanori ‘s narrative has set up a story that provides a reason for the shite to appear, the Kakaru increases momentum before his entrance. More prominent stage position, increased instrumentation, and changing style of vocal delivery raise the Intermedia Index. The elevated energy will be released with the shite’s appearance.
The monk asserts the importance of the memorial service by moving to the center stage (Square 9). Coming from the energetically weaker Square 1, he opens up the stage space and activates one of the most powerful stage positions. Interestingly, the shite will not enter that area in the first act, limiting his actions to the quieter Squares 1 and 2.
This shōdan also marks the first entry of the two hand-percussion instruments that accompany the non-congruent vocal part, with sparse mitsuji patterns performed in flexible rhythmic setting.
In the first three lines, the monk declares respect for the flowers, delivering his praises in kotoba. In the fourth one, he focuses specifically on the . In Buddhism, its ability to rise from murky waters to produce a beautiful and pure flower is a symbol of enlightenment. In Noh, the recitation of a sutra is always delivered in a sung fashion, thus the monk switches at that point from spoken to singing mode. He recites the Lotus Sutra: sōmoku kokudo shi’kai jōbutsudō (plants, trees, all on earth, achieve Buddhahood). The sashinori setting of the chant with its recitative style is well suited for the delivery of a religious text.
At the end of the scene, the monk performs a prayer gesture similar to the one used to close the Nanori. This time, it has a spiritual component as it is performed while the monk is singing the sutra. The monk joins unlike in Nanori when he kept . The separation of his hands at the end is always asymmetric.
It is interesting to note that actors always stay in character. For instance, the can be technically needed only to avoid wrinkling of the costume, but it is done 'as a monk'.