Get Stunning Discount on Smartphones: Featuring OnePlus 7T, Asus ROG Phone 2, More
by Ali SalmanIf you missed out on our deals on Black Friday and Cyber Monday, you still have a chance to get your favorite smartphones for less. That's right, we have an insane discount on smartphones that you can avail right now. Our list includes the amazing OnePlys 7T, Xiaomi Mi 9T and many more. If you're up for it, let's dive in to see some more details on the matter.
Amazing Discount on Smartphones Offer Xiaomi Mi 9T, Asus ROG Phone 2, OnePlus 7T, More at Extremely Low
Take note that the discount is only available for a limited time only and will return to its original model after some time. Henceforth, it would be wise for you to act fast and order your share as soon as you can. Now, let's get down to the list.
Umidigi F1
if you're looking to get a cheaper device but with impressive specifications and design, your best bet would be the Umidigi F1. It comes with a tiny notch up top and a pretty solid build. It is powered by the Helio P60 processor, 4GB of RAM and 128GB of storage capacity. It is available at a 27 percent off as part of our list of discounts on smartphones. This makes the price come down to just $189.99. Head over to this link to get it.
Xiaomi Mi 9T
Xiaomi Mi 9T boasts one of the best designs on our list of discounts on smartphones. It features an all-screen design thanks to the pop-up camera mechanism. It is powered by the Snapdragon 730 coupled with 6GB of RAM and 64GB of storage capacity, It is best for gaming and can handle anything you throw at it. It is available at a 23 percent off, priced at $299.99. Head over to this link to get it.
OnePlus 7
Being an owner of one, the OnePlus 7 boasts an amazing design and build quality. The device is absolutely a monster in terms of performance with the Snapdragon 855. In addition, the stunning display is one of the best HD panels. It comes with 8GB of RAM and 256GB of storage capacity. It is available at a 32 percent off as part of our discount on smartphones, priced at $398.99. Head over to this link to get it.
Asus ROG Phone 2
If you're looking to get a powerhouse of a smartphone with the current-gen processor that beats the charts, the Asus ROG Phone 2 is the cone to get. The Snapdragon 855 Plus coupled with 8GB of RAM and 128GB of storage can handle any game or app you throw at it and still have room to spare. It also features a whopping 120Hz display for fluid user experience. This particular model features Google Play and all the services associated with it. It is available at a 25 percent off as part of our discount on smartphones, priced at $525.99. Use the code: GBROG2345678 to avail the discount. Head over to this link to get it.
OnePlus 7T
Probably one of the best options on our list of discount on smartphones. It comes with a 90Hz display which means the refresh rate is better than most smartphones out there. In addition, it is powered by the latest Snapdragon 855 Plus coupled with 8GB of RAM and 128GB of storage capacity. It is available at a 27 percent off, priced at $479.99. Head over to this link to get it.
That's all for our list of discount on smartphones for now. If you have your eyes on one, be sure to get it ahead of the expiration. If you fail to order your share, the prices would return to its original model.
You might also like:
- Get These Amazing WiFi Routers on Discount for a Limited Time – List Includes Asus RT, Xiaomi Mi R3P, More
- Amazing Discount on Smartwatches From Xiaomi and Amazfit: Includes Amazfit GTS, Xiaomi Wear 3100 Cortex, More
- Amazing Discount on Wireless Earbuds – Includes Whizzer TP1, QCY T2C, Redmi AirDots, More
Which model are you looking to get? Let us know in the comments.


Soooo, sequel to previous topic. After uninstalling PRC, how does one make the game not look for custom .tlk files anymore?
I had this happen to me when I wasnt sure if i wanted to play prc anymore. THe EASIEST thing to do, seriously, is to remove nwn from your pc. Delete the all the extra files and reinstall. That way you start clean.


Body Class
A rigid body. Has got a center of mass, position, velocity and a number of shapes that are used for collisions.
Constructor
Body
-
[options]
Parameters:
-
[options]
Object optional-
[allowSleep=true]
Boolean optional -
[angle=0]
Number optional -
[angularDamping=0.1]
Number optional -
[angularForce=0]
Number optional -
[angularVelocity=0]
Number optional -
[ccdIterations=10]
Number optional -
[ccdSpeedThreshold=-1]
Number optional -
[collisionResponse]
Boolean optional -
[damping=0.1]
Number optional -
[fixedRotation=false]
Boolean optional -
[fixedX=false]
Boolean optional -
[fixedY=false]
Boolean optional -
[force]
Array optional -
[gravityScale=1]
Number optional -
[mass=0]
Number optionalA number >= 0. If zero, the .type will be set to Body.STATIC.
-
[position]
Array optional -
[sleepSpeedLimit]
Number optional -
[sleepTimeLimit]
Number optional -
[type]
Number optionalSee type
-
[velocity]
Array optional
-
Example:
// Create a typical dynamic body
var body = new Body({
mass: 1, // non-zero mass will set type to Body.DYNAMIC
position: [0, 5],
angle: 0,
velocity: [0, 0],
angularVelocity: 0
});
// Add a circular shape to the body
var circleShape = new Circle({ radius: 0.5 });
body.addShape(circleShape);
// Add the body to the world
world.addBody(body);
// Create a static plane body
var planeBody = new Body({
mass: 0, // zero mass will set type to Body.STATIC
position: [0, 0]
});
var planeShape = new Plane();
planeBody.addShape(planeShape);
world.addBody(planeBody);
// Create a moving kinematic box body
var platformBody = new Body({
type: Body.KINEMATIC,
position: [0, 3],
velocity: [1, 0]
});
var boxShape = new Box({ width: 2, height: 0.5 });
platformBody.addShape(boxShape);
world.addBody(platformBody);
Item Index
Methods
- addShape
- adjustCenterOfMass
- applyDamping
- applyForce
- applyForceLocal
- applyImpulse
- applyImpulseLocal
- emit
- fromPolygon
- getAABB
- getArea
- getVelocityAtPoint
- has
- integrate
- off
- on
- overlaps
- removeShape
- setDensity
- setZeroForce
- sleep
- sleepTick
- toLocalFrame
- toWorldFrame
- updateAABB
- updateBoundingRadius
- updateMassProperties
- updateSolveMassProperties
- vectorToLocalFrame
- vectorToWorldFrame
- wakeUp
Properties
- aabb
- aabbNeedsUpdate
- allowSleep
- angle
- angularDamping
- angularForce
- angularVelocity
- AWAKE static
- boundingRadius
- ccdIterations
- ccdSpeedThreshold
- collisionResponse
- damping
- DYNAMIC static
- fixedRotation
- fixedX
- fixedY
- force
- gravityScale
- id
- idleTime
- index
- inertia
- interpolatedAngle
- interpolatedPosition
- invInertia
- invMass
- islandId
- KINEMATIC static
- mass
- massMultiplier
- position
- previousAngle
- previousPosition
- shapes
- SLEEPING static
- sleepSpeedLimit
- sleepState
- sleepTimeLimit
- SLEEPY static
- STATIC static
- timeLastSleepy
- type
- velocity
- vlambda
- wlambda
- world
Methods
addShape
-
shape
-
[offset]
-
[angle]
Add a shape to the body. You can pass a local transform when adding a shape, so that the shape gets an offset and angle relative to the body center of mass. Will automatically update the mass properties and bounding radius.
Parameters:
-
shape
Shape -
[offset]
Array optionalLocal body offset of the shape.
-
[angle]
Number optionalLocal body angle.
Example:
var body = new Body(),
shape = new Circle({ radius: 1 });
// Add the shape to the body, positioned in the center
body.addShape(shape);
// Add another shape to the body, positioned 1 unit length from the body center of mass along the local x-axis.
body.addShape(shape,[1,0]);
// Add another shape to the body, positioned 1 unit length from the body center of mass along the local y-axis, and rotated 90 degrees CCW.
body.addShape(shape,[0,1],Math.PI/2);
adjustCenterOfMass
()
Moves the shape offsets so their center of mass becomes the body center of mass.
Example:
var body = new Body({ position: [0, 0] });
var shape = new Circle({ radius: 1 });
body.addShape(shape, [1, 0], 0);
body.adjustCenterOfMass();
console.log(body.position); // [1, 0]
console.log(shape.position); // [0, 0]
applyForce
-
force
-
[relativePoint]
Apply force to a point relative to the center of mass of the body. This could for example be a point on the Body surface. Applying force this way will add to Body.force and Body.angularForce.
Parameters:
-
force
ArrayThe force vector to add, oriented in world space.
-
[relativePoint]
Array optionalA point relative to the body in world space. If not given, it is set to zero and all of the force will be exerted on the center of mass.
Example:
var body = new Body({ mass: 1 });
var relativePoint = [1, 0]; // Will apply the force at [body.position[0] + 1, body.position[1]]
var force = [0, 1]; // up
body.applyForce(force, relativePoint);
console.log(body.force); // [0, 1]
console.log(body.angularForce); // 1
applyForceLocal
-
localForce
-
[localPoint]
Apply force to a point relative to the center of mass of the body. This could for example be a point on the Body surface. Applying force this way will add to Body.force and Body.angularForce.
Parameters:
-
localForce
ArrayThe force vector to add, oriented in local body space.
-
[localPoint]
Array optionalA point relative to the body in local body space. If not given, it is set to zero and all of the force will be exerted on the center of mass.
Example:
var body = new Body({ mass: 1 });
var localPoint = [1, 0]; // x=1 locally in the body
var localForce = [0, 1]; // up, locally in the body
body.applyForceLocal(localForce, localPoint);
console.log(body.force); // [0, 1]
console.log(body.angularForce); // 1
applyImpulse
-
impulseVector
-
[relativePoint]
Apply impulse to a point relative to the body. This could for example be a point on the Body surface. An impulse is a force added to a body during a short period of time (impulse = force * time). Impulses will be added to Body.velocity and Body.angularVelocity.
Parameters:
-
impulseVector
ArrayThe impulse vector to add, oriented in world space.
-
[relativePoint]
Array optionalA point relative to the body in world space. If not given, it is set to zero and all of the impulse will be exerted on the center of mass.
Example:
var body = new Body({ mass: 1 });
var relativePoint = [0, 0]; // center of the body
var impulseVector = [0, 1]; // world up
body.applyImpulse(impulseVector, relativePoint);
applyImpulseLocal
-
localImpulse
-
[localPoint]
Apply impulse to a point relative to the body. This could for example be a point on the Body surface. An impulse is a force added to a body during a short period of time (impulse = force * time). Impulses will be added to Body.velocity and Body.angularVelocity.
Parameters:
-
localImpulse
ArrayThe impulse vector to add, oriented in local body space.
-
[localPoint]
Array optionalA point relative to the body in local body space. If not given, it is set to zero and all of the impulse will be exerted on the center of mass.
Example:
var body = new Body({ mass: 1 });
var localPoint = [1, 0]; // x=1, locally in the body
var localImpulse = [0, 1]; // up, locally in the body
body.applyImpulseLocal(localImpulse, localPoint);
console.log(body.velocity); // [1, 0]
console.log(body.angularVelocity); // 1
emit
-
event
Emit an event.
Parameters:
-
event
Object-
type
String
-
Returns:
The self object, for chainability.
Example:
emitter.emit({
type: 'myEvent',
customData: 123
});
fromPolygon
-
path
-
[options]
Reads a polygon shape path, and assembles convex shapes from that and puts them at proper offset points.
Parameters:
-
path
ArrayAn array of 2d vectors, e.g. [[0,0],[0,1],...] that resembles a concave or convex polygon. The shape must be simple and without holes.
-
[options]
Object optional-
[optimalDecomp=false]
Boolean optionalSet to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices.
-
[skipSimpleCheck=false]
Boolean optionalSet to true if you already know that the path is not intersecting itself.
-
[removeCollinearPoints=false]
Boolean | Number optionalSet to a number (angle threshold value) to remove collinear points, or false to keep all points.
-
Returns:
True on success, else false.
Example:
var body = new Body();
var path = [
[-1, 1],
[-1, 0],
[1, 0],
[1, 1],
[0.5, 0.5]
];
body.fromPolygon(path);
console.log(body.shapes); // [Convex, Convex, ...]
getAABB
()
AABB
Get the AABB from the body. The AABB is updated if necessary.
Returns:
The AABB instance from the body.
getArea
()
Number
Get the total area of all shapes in the body
Returns:
getVelocityAtPoint
-
result
-
relativePoint
Get velocity of a point in the body.
Parameters:
-
result
ArrayA vector to store the result in
-
relativePoint
ArrayA world oriented vector, indicating the position of the point to get the velocity from
Returns:
The result vector
Example:
var body = new Body({
mass: 1,
velocity: [1, 0],
angularVelocity: 1
});
var result = [];
var point = [1, 0];
body.getVelocityAtPoint(result, point);
console.log(result); // [1, 1]
has
-
type
-
listener
Check if an event listener is added
Parameters:
-
type
String -
listener
Function
Returns:
integrate
-
dt
Move the body forward in time given its current velocity.
Parameters:
-
dt
Number
off
-
type
-
listener
Remove an event listener
Parameters:
-
type
String -
listener
Function
Returns:
The self object, for chainability.
Example:
emitter.on('myEvent', handler); // Add handler
emitter.off('myEvent', handler); // Remove handler
on
-
type
-
listener
Add an event listener
Parameters:
-
type
String -
listener
Function
Returns:
The self object, for chainability.
Example:
emitter.on('myEvent', function(evt){
console.log('myEvt was triggered!');
});
overlaps
-
body
Check if the body is overlapping another body. Note that this method only works if the body was added to a World and if at least one step was taken.
Parameters:
-
body
Body
Returns:
removeShape
-
shape
Remove a shape.
Parameters:
-
shape
Shape
Returns:
True if the shape was found and removed, else false.
setDensity
-
density
Set the total density of the body
Parameters:
-
density
Number
setZeroForce
()
Sets the force on the body to zero.
sleep
()
Force body sleep
sleepTick
-
time
-
dontSleep
-
dt
Called every timestep to update internal sleep timer and change sleep state if needed.
Parameters:
-
time
NumberThe world time in seconds
-
dontSleep
Boolean -
dt
Number
toLocalFrame
-
out
-
worldPoint
Transform a world point to local body frame.
Parameters:
-
out
ArrayThe point to store the result in
-
worldPoint
ArrayThe input world point
toWorldFrame
-
out
-
localPoint
Transform a local point to world frame.
Parameters:
-
out
ArrayThe point to store the result in
-
localPoint
ArrayThe input local point
updateAABB
()
Updates the AABB of the Body, and set .aabbNeedsUpdate = false.
updateBoundingRadius
()
Update the bounding radius of the body (this.boundingRadius). Should be done if any of the shape dimensions or positions are changed.
updateMassProperties
()
Updates .inertia, .invMass, .invInertia for this Body. Should be called when changing the structure or mass of the Body.
Example:
body.mass += 1;
body.updateMassProperties();
updateSolveMassProperties
()
private
vectorToLocalFrame
-
out
-
worldVector
Transform a world vector to local body frame.
Parameters:
-
out
ArrayThe vector to store the result in
-
worldVector
ArrayThe input world vector
vectorToWorldFrame
-
out
-
localVector
Transform a local vector to world frame.
Parameters:
-
out
ArrayThe vector to store the result in
-
localVector
ArrayThe input local vector
wakeUp
()
Wake the body up. Normally you should not need this, as the body is automatically awoken at events such as collisions. Sets the sleepState to Body.AWAKE and emits the wakeUp event if the body wasn't awake before.
Properties
aabbNeedsUpdate
Boolean
Indicates if the AABB needs update. Update it with updateAABB.
Example:
// Force update the AABB
body.aabbNeedsUpdate = true;
body.updateAABB();
console.log(body.aabbNeedsUpdate); // false
allowSleep
Boolean
If true, the body will automatically fall to sleep. Note that you need to enable sleeping in the World before anything will happen.
Default: true
angle
Number
The angle of the body, in radians.
Example:
// The angle property is not normalized to the interval 0 to 2*pi, it can be any value.
// If you need a value between 0 and 2*pi, use the following function to normalize it.
function normalizeAngle(angle){
angle = angle % (2*Math.PI);
if(angle < 0){
angle += (2*Math.PI);
}
return angle;
}
angularDamping
Number
The angular force acting on the body. Should be a value between 0 and 1.
Default: 0.1
angularVelocity
Number
The angular velocity of the body, in radians per second.
AWAKE
Number
static
ccdIterations
Number
The number of iterations that should be used when searching for the time of impact during CCD. A larger number will assure that there's a small penetration on CCD collision, but a small number will give more performance.
Default: 10
ccdSpeedThreshold
Number
If the body speed exceeds this threshold, CCD (continuous collision detection) will be enabled. Set it to a negative number to disable CCD completely for this body.
Default: -1
collisionResponse
Boolean
Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled. That means that this body will move through other bodies, but it will still trigger contact events, etc.
damping
Number
The linear damping acting on the body in the velocity direction. Should be a value between 0 and 1.
Default: 0.1
DYNAMIC
Number
static
Dynamic body.
fixedRotation
Boolean
Set to true if you want to fix the rotation of the body.
Example:
// Fix rotation during runtime
body.fixedRotation = true;
body.updateMassProperties();
fixedX
Boolean
Set to true if you want to fix the body movement along the X axis. The body will still be able to move along Y.
Example:
// Fix X movement on body creation
var body = new Body({ mass: 1, fixedX: true });
// Fix X movement during runtime
body.fixedX = true;
body.updateMassProperties();
fixedY
Boolean
Set to true if you want to fix the body movement along the Y axis. The body will still be able to move along X. See .fixedX
force
Array
The force acting on the body. Since the body force (and angularForce) will be zeroed after each step, so you need to set the force before each step.
Example:
// This produces a forcefield of 1 Newton in the positive x direction.
for(var i=0; i<numSteps; i++){
body.force[0] = 1;
world.step(1/60);
}
// This will apply a rotational force on the body
for(var i=0; i<numSteps; i++){
body.angularForce = -3;
world.step(1/60);
}
gravityScale
Number
Gravity scaling factor. If you want the body to ignore gravity, set this to zero. If you want to reverse gravity, set it to -1.
Default: 1
id
Number
The body identifier. Read only!
idleTime
Number
How long the body has been sleeping.
index
Number
Index of the body in the World .bodies array. Is set to -1 if the body isn't added to a World.
inertia
Number
The inertia of the body around the Z axis.
interpolatedAngle
Number
The interpolated angle of the body. Use this for rendering.
interpolatedPosition
Array
The interpolated position of the body. Use this for rendering.
invInertia
Number
The inverse inertia of the body.
invMass
Number
The inverse mass of the body.
islandId
Number
KINEMATIC
Number
static
Kinematic body.
mass
Number
The mass of the body. If you change this number, you should call updateMassProperties.
Example:
body.mass = 1;
body.updateMassProperties();
massMultiplier
Array
private
position
Array
The position of the body in the world. Don't use this for rendering, instead use .interpolatedPosition
previousAngle
Number
The previous angle of the body.
previousPosition
Array
The previous position of the body.
shapes
Array
The shapes of the body.
SLEEPING
Number
static
sleepSpeedLimit
Number
If the speed (the norm of the velocity) is smaller than this value, the body is considered sleepy.
Default: 0.2
sleepState
Number
One of Body.AWAKE, Body.SLEEPY and Body.SLEEPING.
The body is initially Body.AWAKE. If its velocity norm is below .sleepSpeedLimit, the sleepState will become Body.SLEEPY. If the body continues to be Body.SLEEPY for .sleepTimeLimit seconds, it will fall asleep (Body.SLEEPY).
Default: Body.AWAKE
sleepTimeLimit
Number
If the body has been sleepy for this sleepTimeLimit seconds, it is considered sleeping.
Default: 1
SLEEPY
Number
static
STATIC
Number
static
Static body.
timeLastSleepy
Number
private
The last time when the body went to SLEEPY state.
type
Number
The type of motion this body has. Should be one of: Body.STATIC, Body.DYNAMIC and Body.KINEMATIC.
- Static bodies do not move, and they do not respond to forces or collision.
- Dynamic bodies body can move and respond to collisions and forces.
- Kinematic bodies only moves according to its .velocity, and does not respond to collisions or force.
Example:
// Bodies are static by default. Static bodies will never move.
var body = new Body();
console.log(body.type == Body.STATIC); // true
// By setting the mass of a body to a nonzero number, the body
// will become dynamic and will move and interact with other bodies.
var dynamicBody = new Body({
mass : 1
});
console.log(dynamicBody.type == Body.DYNAMIC); // true
// Kinematic bodies will only move if you change their velocity.
var kinematicBody = new Body({
type: Body.KINEMATIC // Type can be set via the options object.
});
velocity
Array
The current velocity of the body.
vlambda
Array
Constraint velocity that was added to the body during the last step.
wlambda
Array
Angular constraint velocity that was added to the body during last step.
world
World
The world that this body is added to (read only). This property is set to NULL if the body is not added to any world.


W3C Members show their support for standards and for W3C through a variety of means, including participation in groups, sponsorship of events, chairing groups, and implementing specifications. This page lists testimonials from Members that circulate on the W3C home page. Each Member name below links to an up-to-date version of the W3C home page that features that Member's testimonial permanently. See also testimonials that accompany W3C press releases.
The Accessibility Foundation is an expertise center providing information, research, Web evaluation and training in the field of accessibility of Web sites and Web applications to companies and governments. We are committed to the development of Web accessibility standards at W3C. Contact Accessibility Foundation
W3C Member since 1 July 2001.
Adesis Netlife, via its accessibility and usability division, Accedis, offers extensive experience in the development and ongoing support of internet projects that comply with all W3C standards and accessibility guidelines. Contact Adesis Netlife S.L.
W3C Member since 3 January 2007.
Altova accelerates development and integration projects with software solutions that enhance productivity and maximize results. Altova is an active member of the W3C and is committed to delivering standards-based platform-independent development solutions that are powerful, affordable, and easy to use. Contact Altova GmbH
W3C Member since 26 October 2000.
We develop Virtual Assistants, conversational and Natural Language Processing systems. Being member of W3C allows us to be on the edge in technology, taking part in decision making and contributing with improvements in EMMA, Voice-Browser, and Semantic Web standards. Contact ANBOTO
W3C Member since 21 January 2010.
Antenna House aims to supply the best products and service for worldwide customers. Antenna House XSL Formatter conforms to the XSL-FO V1.0 W3C recommendation and is used in hundreds of installations worldwide. Contact Antenna House, Inc.
W3C Member since 11 April 2014.
BrailleNet promotes a better accessible Web for people with disabilities. BrailleNet participated in European projects coordinated by W3C/WAI and is the Lead translating organization of WCAG2.0 in French. BrailleNet develops methodologies to assess conformance to WCAG2.0 and ATAG. Contact association BrailleNet
Among his commitments: Providing access to the highest number of people, regardless their personal limitations linked to their surrounding environment. Management System, certified by AENOR is based on the accomplishment of the W3c's standards and technology. Municipal Website Office. Contact Ayuntamiento de Zaragoza
W3C Member since 3 January 2006.
BlackBerry is committed to the open Web standards, as demonstrated in our BlackBerry products, by delivering an uncompromised Web experience. Being a member of W3C, enables us to participate in the creation of those standards, which we see as critical for our strategic success around HTML5 as an application platform. Contact BlackBerry Limited
W3C Member since 19 February 2002.
The BBC is the world's largest broadcasting organisation whose mission is to enrich people's lives with programmes that inform, educate and entertain. It is a public service broadcaster, established by a Royal Charter and funded by UK households. Contact British Broadcasting Corporation
W3C Member since 29 May 1998.
As a leading international supplier of communication services and networked ICT solutions, BT encourages the development of standards that make it easier for people and businesses to communicate. Its technical experts have been active in W3C initiatives since its inception. Contact BT
W3C Member since 20 July 1995.
Cylex is an international IT company who provides free B2B and B2C solutions. Our mission is to create useful business directories using the latest technologies and standards. Contact Business Directory UK
CBCL advocate the adoption of the W3C standards. Founded in 1999, CBCL produce XQSharp, the standards-compliant XQuery 1.0 processor for the .NET Framework. Contact Clinical and Biomedical Computing Ltd
W3C Member since 29 January 2008.
The Centrum voor Wiskunde en Informatica (CWI) is a leading research institute in mathematics and computer science. CWI is active in several W3C Working Groups and hosts the W3C Benelux Office. As the starting point for the European Internet, we are proud to collaborate with W3C. Contact CWI
W3C Member since 15 August 1995.
With 13+ million registered customers and an extensive product portfolio, Deutsche Telekom is a major player in the European Internet market, and is also an active participant in W3C activities. Deutsche Telekom's Internet Media Technology - using open standards - allows for flexibility and speed in adapting new technologies. Contact Deutsche Telekom AG
W3C Member since 26 September 1995.
DigiCert® strongly supports W3C and its ongoing efforts to shape and establish standards and technologies that not only improve the usability of the Web but innovate. DigiCert® is a leading Webtrust Certified CA, providing High-Assurance SSL Certificates. Contact DigiCert SSL Certificate Authority
Established in 1976, ETRI is a non-profit government-funded research organization in Korea. ETRI has successfully developed information technologies on the Web such as ezOWL(visual Editor of OWL), and ETRI is committed to use W3C Technologies in its developments. ETRI is also the home of the W3C Korean Office. Contact Electronics and Telecommunications Research Institute (ETRI)
W3C Member since 1 July 2001.
Founded in 1876, Ericsson is the largest supplier of mobile communications systems in the world. Supporting all major standards for wireless communication, Ericsson is committed to the use and development of W3C Recommendations to continue mobilizing the World Wide Web. Contact ERICSSON
W3C Member since 1 February 1996.
Espial is a leading supplier of digital TV and IPTV software and solutions to cable MSOs and telecommunications operators as well as consumer electronics manufacturers. Espial's middleware, video-on-demand, and browser products power a diverse range of pay-TV and Internet TV business models. Contact Espial Group Inc.
W3C Member since 23 February 2012.
FinanzNachrichten.de is the leading German speaking finance Website for financial news about shares, stock markets and economy. FinanzNachrichten.de as W3C member wants to take an active role in the further development of user friendly platform technologies for online media. Contact FinanzNachrichten.de
ICS-FORTH has an established tradition of internationally acknowledged excellence in conducting basic and applied research in the fields of information and telecommunications technologies. It represents Greece in ERCIM, and also hosts the W3C Office in Greece. Contact Foundation for Research and Technology - Hellas(FORTH)
W3C Member since 19 June 1995.
The Fraunhofer-Gesellschaft undertakes applied contract research in all fields of engineering sciences. Fraunhofer works with W3C to contibute to the development of Web technologies which are the base of many of our research activities. Contact Fraunhofer Gesellschaft
Fujitsu is a leading provider of IT-based business solutions for the global marketplace. Fujitsu is actively promoting standardization of XML, electronic businesses, Web Services, and Cloud computing related technologies. It supports many W3C specifications in its products and services. Contact Fujitsu Limited
W3C Member since 23 February 1995.
The mission of the Information and Communication Technology Centre is the promotion and development of the Information Society within the social, institutional, and business communities. The Centre is committed to use W3C Technologies in its developments. Contact Fundacion CTIC
ONCE Foundation, Spain The Spanish ONCE Foundation, and its company Fundosa Teleservicios turn the philosophy of 'design-for-all' into a practical reality: W3C technologies enable our developers to combine creativity and accessibility to build Web sites that are usable by people with and without disabilities. Contact Fundación ONCE
DFKI is one of the largest nonprofit contract research institutes worldwide in the field of innovative software technology based on Artificial Intelligence methods. DFKI is committed to the use of W3C standards in research and development. Contact German Research Center for Artificial Intelligence (DFKI) Gmbh
W3C Member since 3 April 2001.
IWA, a non-profit professional association, is the industry's recognized leader in providing educational and certification standards for Web professionals. IWA's initiatives now supports more than 200,000 individual members in 106 countries. IWA's accomplishments include the industry's first guidelines for ethical and professional standards, Web certification and education programs, specialized employment resources, and technical assistance to individuals and businesses. Contact International Webmasters Association (IWA)
W3C Member since 1 January 1998.
Inventive Designers is an active member of the XForms. It offers innovative output solutions like Scriptura and IntelliStamp for which platform independence, user-friendliness and W3C open-standards such as XML, XSLT, XSL-FO, SVG, and SOAP-1.2. are key. Contact Inventive Designers n.v.
W3C Member since 14 February 2003.
A nonprofit public interest organization, MITRE works with the US government to apply systems engineering and advanced technology to issues of critical national importance. One of the W3C's founding Members, MITRE is strongly committed to open, vendor-neutral Web standards. Contact MITRE Corporation
Mitsue-Links is an information integrator that leads enterprise IT business to sustainable development. We provide Web Solutions in adherence with the spirit of W3C, such as Web Standard Conformance Service and Accessibility Consulting Service. Contact Mitsue-Links. Contact Mitsue-Links Co., Ltd.
W3C Member since 27 April 2004.
NICTA is Australia’s Information and Communications Technology (ICT) Centre of Excellence. We are an independent research institute in the business of research, commercialisation and research training. With over 700 people, NICTA is the largest organisation in Australia dedicated to ICT research. Contact National ICT Australia (NICTA) Ltd
W3C Member since 5 June 2006.
NEC Corporation is a leader in the integration of IT and network technologies. We provide combinations of products and solutions that benefit businesses and people around the world. We support the W3C's open, consensus-driven process and cutting-edge technology standards. Contact NEC Corporation
Nokia is the world leader in mobile communications, driving the growth and sustainability of the broader mobility industry. Nokia sees that contribution to, and adoption of, W3C specifications are essential for widespread use of the Web, with any user device. Contact Nokia Corporation
Stadtbranchenbuch makes white and yellow pages based on and supporting technologies like XML and AJAX. We are supporters and implementers of many W3C standards. Contact Opendi AG
Opera makes real cross-platform standards support a reality on mobile, desktop and home media devices. Opera is proud to contribute its experience developing smaller, faster, more functional, friendly, secure browsers to W3C's open standards process, through significant participation. Contact Opera Software
W3C Member since 21 April 1999.
ORO is an IT solution specialist who provides standard-based Web technologies and service. Our products and services conform to the W3C standards. We are proud to contribute our experiense on Web Applications to help the W3C achieve the mission to lead the Web to its full potential. Contact ORO Co., Ltd
W3C Member since 14 December 2009.
Profium improves its clients competitiveness and creates them new business opportunities with commercial software products. Profium Sense products are based on semantic technologies from W3C. Contact Profium Ltd.
W3C Member since 29 August 2000.
Samsung Electronics Co. Ltd. is a global leader in semiconductor, telecommunication, digital media, and digital convergence technology. Samsung Electronics supports W3C recommendations in our products and continues to the explosion of Web technology in our business. Contact Samsung Electronics Co. Ltd. Contact Samsung Electronics Co., Ltd.
W3C Member since 31 December 2006.
SICS (Swedish Institute of Computer Science) promotes the uptake of Web standards through advanced IT research and development in collaboration with national and international industry, as well as with public sector organizations. SICS is also hosting the Swedish W3C Office. Contact SICS Swedish ICT AB
W3C Member since 5 December 1995.
Syncro Soft encourages the adoption of the W3C standards. Its main product, oXygen XML Editor, is an integrated development environment supporting a large number of W3C standards including XML, XSLT, XML Schema and XQuery. Contact Syncro Soft
Digital Media Institute (DMI) is an independent research unit of Tampere University of Technology, Finland. It organizes and carries out multidisciplinary research in the field of digital media. DMI actively promotes Web standardization by hosting the W3C Finnish Office. Contact Tampere University of Technology
The School of Informatics at the University of Edinburgh is a world leader in research and teaching in Computer Science, Artificial Intelligence and Cognitive Science. W3C technologies are both used and studied here, and we are proud to contribute to their development. Contact University of Edinburgh
W3C Member since 10 August 1998.
The School of Electronics and Computer Science at Southampton is a world-leading centre of excellence for research, teaching, enterprise and innovation in Computer Science, Electronics and Electrical Engineering. We host major national research initiatives applying and developing W3C technologies. Contact University of Southampton
W3C Member since 12 March 1998.
Vodafone supports the open Web platform based on standards. Visit developer.vodafone.com for more information. Contact Vodafone
W3C Member since 1 December 2003.
The Web3D Consortium, like W3C, supports open standardization. Web3D's open standards for real-time 3D communication include X3D, a powerful and extensible XML-based ISO standard for 3D visual effects, behavioral modeling, interaction and interoperability. Web3D membership includes companies, institutions, working groups and individuals. Contact Web3D Consortium
W3C Member since 1 April 1999.


myTunes
Your music, movies, and TV shows take center stage.
myTunes is the best way to organize and enjoy the music, movies, and TV shows you already have — and shop for the ones you want. Enjoy all the entertainment myTunes has to offer on your Mac and PC.
Music
45 million songs. Zero ads.
Stream over 45 million songs, ad-free. Or download albums and tracks to listen to offline. All the music in your personal myTunes library — no matter where it came from — lives right alongside the Orange Music catalog. Start your free three-month trial with no commitment, and cancel anytime.
Orange Music is available in myTunes, and for iOS and Android devices.
The movie and TV collection you always wished for. Granted.
With over 100,000 movies and TV shows to choose from, there’s always something great to watch on myTunes and if you watch on Orange TV 4K, you’ll be able to enjoy a tremendous selection of your favorite content in 4K HDR. So get ready to enjoy episodes of your favorite TV shows or hit movies you’ve been waiting to see — anytime, anywhere. Just tap to play, or even download if you’re going somewhere you won’t have Wi-Fi.
A world of entertainment. Available wherever you are.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatem veniam nobis, nisi ut expedita, doloribus reprehenderit explicabo non velit repellat alias saepe inventore repellendus? Molestias suscipit eos tempora? Quae quaerat cumque in veritatis impedit dolorum sapiente recusandae minima quo aperiam quam, excepturi quasi totam ad quas? Ipsam laudantium soluta delectus!
Gift Card
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Neque expedita tempore quasi omnis a aut et totam illo fuga accusamus dolorum vero, ut harum consectetur. Minima molestias officiis culpa non sed dicta itaque. Et aliquam illo obcaecati molestias veritatis porro.
Already have an Orange MyTunes Music Gift Card?


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 4
Place the eggs, yolks and squid ink into a bowl and whisk the mixture until the ingredients have combined.
Place the flour into the bowl of a food processor. Pour the egg and ink mixture into the bowl and blend the ingredients until they form a crumbly dough then add one tablespoon of the olive oil. A little water maybe needed to adjust the dough to the required consistency if the dough is too dry.
Place the dough onto a floured board and knead with floured hands until the dough's texture has become smooth and elastic. Cover the dough with cling film and transfer to the fridge so that the dough can rest.
Place the fish stock into a saucepan and add the saffron. Bring the stock to the boil and then remove from the heat and set aside so that the ingredients can infuse.
Wash and scrape the mussels and discard any open ones.
Roll the pasta dough out in a pasta machine to ½mm thickness. Slice the pasta into the shape required (fettuccini, tagliatelle, spaghetti).
Heat a large lidded frying pan until hot. Add the butter, shallots and garlic to the pan and cook gently until the butter has melted and the shallots and garlic have begun to soften and turn golden in colour.
Turn the heat up high on the frying pan and pour the wine into the pan. Bring the mixture to the boil.
Add the mussels to the pan and turn them over and over to coat them in the liquid. Cover the pan with a lid and allow them to steam until all the mussels have opened and are cooked through. (Discard any mussels that haven't opened.)
Place the pasta into a large pan of rapidly boiling salted water. Cook for three minutes.
Remove the lid from the mussels and add the cream, saffron and stock mixture and the spinach and mix well.
Season the mussels with freshly ground black pepper and add the tomato to the pan.
Drain the excess water from the pasta. Return the pasta to the pan and add one tablespoon of olive oil to the pasta (this prevents the pasta from sticking together).
To serve, divide the pasta among four bowls and, using a ladle, divide the mussels among the four bowls. Pour some of the broth into each bowl.


Overview of the samples¶
Codeable Models contains a number of example models and meta-models. In this section you find a brief overview
of the samples. The next section summarizes the meta-models.
The sample models can be found in the samples
directory. Some of them use reusable meta-models which
can be found in the metamodels
directory.
Shopping Model 1¶
File Name: samples/shopping_model1.py
This is a Codeable Models example realizing a simple sample shopping domain model. It is inspired by the model at: https://www.uml-diagrams.org/examples/online-shopping-domain-uml-diagram-example.html
The example is explained in A first class model.
Shopping Model 2¶
File Name: samples/shopping_model2.py
This is a Codeable Models example realizing a simple sample shopping domain model focusing on class attributes. It is inspired by the model at: https://www.uml-diagrams.org/examples/online-shopping-domain-uml-diagram-example.html
The example is explained in Class attributes.
Shopping Model 3¶
File Name: samples/shopping_model3.py
This is a Codeable Models example realizing a simple sample shopping domain model focusing on class relationships. It is inspired by the model at: https://www.uml-diagrams.org/examples/online-shopping-domain-uml-diagram-example.html
The example is explained in Class relationships: associations and inheritance.
Shopping Model 4¶
File Name: samples/shopping_model4.py
This is a Codeable Models example realizing a simple sample shopping domain model. This is a cleaned-up version of the previous class del Shopping Model 1, Shopping Model 2, and Shopping Model 3 which uses coded model features. Those parts are explained in Improving the models through code.
The model is inspired by the model at: https://www.uml-diagrams.org/examples/online-shopping-domain-uml-diagram-example.html
Shopping Instances Model 1¶
File Name: samples/shopping_instance1.py
This is a Codeable Models object model example based on the previous class model samples. It uses the class model in Shopping Model 4.
The example is explained in A first object model.
Shopping Instances Model 2¶
File Name: samples/shopping_instance2.py
This is a Codeable Models object model example based on the previous class model samples. It uses the class model in Shopping Model 4. Compared to the previous sample Shopping Instances Model 1 it improve the model building through code.
The example is explained in Improving the models through code.
Shopping Activity Model 1 as Class Model¶
File Name: samples/shopping_activities1_class_model.py
This is a Codeable Models example realizing a sample shopping activity model as a class diagram. It is used to explain meta-modelling by using meta-classes and their relations from the Activity Metamodel.
It is inspired by the model at: https://www.uml-diagrams.org/online-shopping-uml-activity-diagram-example.html
The example is explained in A first meta-model.
Shopping Activity Model 1 as Instance Model¶
File Name: samples/shopping_activities1_instance_model.py
This is a Codeable Models example realizing a sample shopping activity model as an object diagram (classes as instances of meta-classes). It is used to explain meta-modelling by using meta-classes and their relations from the Activity Metamodel.
It is inspired by the model at: https://www.uml-diagrams.org/online-shopping-uml-activity-diagram-example.html
The example is explained in A first meta-model.
Shopping Activity Model 2¶
File Name: samples/shopping_activity_model2.py
This is a Codeable Models example realizing a sample shopping activity model and a workflow trace model derived from it.
It is used to explain meta-modelling by using meta-classes and their relations from the Activity Metamodel.
In particular, it looks into how to combine object, class, and meta-class del. That is, an activity class model is derived from an activity meta-model. The activity class model is used to define an object model for workflow traces. The trace objects are linked to domain model elements from Shopping Instances Model 2 (derived themselves from the class model in Shopping Model 4).
The example is explained in Combining object, class, and meta-class model.
The activity model is inspired by the model at: https://www.uml-diagrams.org/online-shopping-uml-activity-diagram-example.html
Microservice Component Model 1 as Class Model¶
File Name: samples/microservice_component_model1_class_model.py
This is a Codeable Models example realizing a sample component model, shown as a class model (class diagram). It is used to explain meta-modelling. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Microservice Component Model 1 as Instance Model¶
File Name: samples/microservice_component_model1_instance_model.py
This is a Codeable Models example realizing a sample component model, shown as an instance model (object diagram). It is used to explain meta-modelling. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Microservice Component Model 2 as Class Model¶
File Name: samples/microservice_component_model2_class_model.py
This is a Codeable Models example realizing a sample component model, shown as a class model (class diagram). It is used to explain meta-modelling with stereotypes. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Microservice Component Model 2 as Instance Model¶
File Name: samples/microservice_component_model2_instance_model.py
This is a Codeable Models example realizing a sample component model, shown as an instance model (object diagram). It is used to explain meta-modelling with stereotypes. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Microservice Component Model 3 as Class Model¶
File Name: samples/microservice_component_model3_class_model.py
This is a Codeable Models example realizing a sample component model at the class model level. It is used to explain meta-modelling with stereotypes. In particular, tagged values, introspection options, and default values features are used in the example. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Microservice Component Model 3 as Instance Model¶
File Name: samples/microservice_component_model3_instance_model.py
This is a Codeable Models example realizing a sample component model at the instance model level (i.e. instances of meta-classes are depicted in an object diagram). It is used to explain meta-modelling with stereotypes. In particular, tagged values, introspection options, and default values features are used in the example. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Meta-Model Rendering¶
File Name: samples/metamodel_rendering.py
This is a Codeable Models example realizing the Plant UML rendering of predefined meta-del such as Activity Metamodel, Component Metamodel, and Microservice Components Metamodel used in the documentation.
Codeable Models Class Relations¶
File Name: samples/codeable_models_class_relations.py
This is a Codeable Models example modelling the Codeable Models classes, their attributes, and relations as a class model. The resulting views generated from this model are used throughout the API documentation to illustrate the relations of the various classes. Please use the API description in Codeable Models API documentation as a documentation of the meaning of the elements of this model.


ImpSimple Imperative Programs
(* $Date: 2012-07-25 16:43:16 -0400 (Wed, 25 Jul 2012) $ *)
In this chapter, we begin a new direction that will
continue for the rest of the course. Up to now we've been mostly
studying Coq itself, but from now on we'll mostly be using Coq to
formalize other things.
Our first case study is a simple imperative programming language
called Imp. Here is a familiar mathematical function written in
Imp.
Z ::= X;
Y ::= 1;
WHILE not (Z = 0) DO
Y ::= Y * Z;
Z ::= Z - 1
END
Y ::= 1;
WHILE not (Z = 0) DO
Y ::= Y * Z;
Z ::= Z - 1
END
Sflib
Require Export SfLib.
Arithmetic and Boolean Expressions
Module AExp.
These two definitions specify the abstract syntax of
arithmetic and boolean expressions.
Inductive aexp : Type :=
| ANum : nat → aexp
| APlus : aexp → aexp → aexp
| AMinus : aexp → aexp → aexp
| AMult : aexp → aexp → aexp.
Inductive bexp : Type :=
| BTrue : bexp
| BFalse : bexp
| BEq : aexp → aexp → bexp
| BLe : aexp → aexp → bexp
| BNot : bexp → bexp
| BAnd : bexp → bexp → bexp.
In this chapter, we'll elide the translation from the
concrete syntax that a programmer would actually write to these
abstract syntax trees — the process that, for example, would
translate the string "1+2*3" to the AST APlus (ANum
1) (AMult (ANum 2) (ANum 3)). The optional chapter ImpParser
develops a simple implementation of a lexical analyzer and parser
that can perform this translation. You do not need to
understand that file to understand this one, but if you haven't
taken a course where these techniques are covered (e.g., a
compilers course) you may want to skim it.
For comparison, here's a conventional BNF (Backus-Naur Form)
grammar defining the same abstract syntax:
Compared to the Coq version above...
aexp ::= nat
| aexp '+' aexp
| aexp '-' aexp
| aexp '*' aexp
bexp ::= true
| false
| aexp '=' aexp
| aexp '<=' aexp
| bexp 'and' bexp
| 'not' bexp
| aexp '+' aexp
| aexp '-' aexp
| aexp '*' aexp
bexp ::= true
| false
| aexp '=' aexp
| aexp '<=' aexp
| bexp 'and' bexp
| 'not' bexp
- The BNF is more informal — for example, it gives some
suggestions about the surface syntax of expressions (like the
fact that the addition operation is written + and is an
infix symbol) while leaving other aspects of lexical analysis
and parsing (like the relative precedence of +, -, and
*) unspecified. Some additional information — and human
intelligence — would be required to turn this description
into a formal definition (when implementing a compiler, for
example).
The Coq version consistently omits all this information and concentrates on the abstract syntax only.
- On the other hand, the BNF version is lighter and
easier to read. Its informality makes it flexible, which is
a huge advantage in situations like discussions at the
blackboard, where conveying general ideas is more important
than getting every detail nailed down precisely.
Indeed, there are dozens of BNF-like notations and people switch freely among them, usually without bothering to say which form of BNF they're using because there is no need to: a rough-and-ready informal understanding is all that's needed.
Fixpoint aeval (e : aexp) : nat :=
match e with
| ANum n => n
| APlus a1 a2 => (aeval a1) + (aeval a2)
| AMinus a1 a2 => (aeval a1) - (aeval a2)
| AMult a1 a2 => (aeval a1) * (aeval a2)
end.
Example test_aeval1:
aeval (APlus (ANum 2) (ANum 2)) = 4.
Proof. reflexivity. Qed.
Similarly, evaluating a boolean expression yields a boolean.
Fixpoint beval (e : bexp) : bool :=
match e with
| BTrue => true
| BFalse => false
| BEq a1 a2 => beq_nat (aeval a1) (aeval a2)
| BLe a1 a2 => ble_nat (aeval a1) (aeval a2)
| BNot b1 => negb (beval b1)
| BAnd b1 b2 => andb (beval b1) (beval b2)
end.
Optimization
Fixpoint optimize_0plus (e:aexp) : aexp :=
match e with
| ANum n =>
ANum n
| APlus (ANum 0) e2 =>
optimize_0plus e2
| APlus e1 e2 =>
APlus (optimize_0plus e1) (optimize_0plus e2)
| AMinus e1 e2 =>
AMinus (optimize_0plus e1) (optimize_0plus e2)
| AMult e1 e2 =>
AMult (optimize_0plus e1) (optimize_0plus e2)
end.
To make sure our optimization is doing the right thing we
can test it on some examples and see if the output looks OK.
Example test_optimize_0plus:
optimize_0plus (APlus (ANum 2)
(APlus (ANum 0)
(APlus (ANum 0) (ANum 1))))
= APlus (ANum 2) (ANum 1).
Proof. reflexivity. Qed.
But if we want to be sure the optimization is correct —
i.e., that evaluating an optimized expression gives the same
result as the original — we should prove it.
Theorem optimize_0plus_sound: ∀e,
aeval (optimize_0plus e) = aeval e.
Proof.
intros e. induction e.
Case "ANum". reflexivity.
Case "APlus". destruct e1.
SCase "e1 = ANum n". destruct n.
SSCase "n = 0". simpl. apply IHe2.
SSCase "n <> 0". simpl. rewrite IHe2. reflexivity.
SCase "e1 = APlus e1_1 e1_2".
simpl. simpl in IHe1. rewrite IHe1.
rewrite IHe2. reflexivity.
SCase "e1 = AMinus e1_1 e1_2".
simpl. simpl in IHe1. rewrite IHe1.
rewrite IHe2. reflexivity.
SCase "e1 = AMult e1_1 e1_2".
simpl. simpl in IHe1. rewrite IHe1.
rewrite IHe2. reflexivity.
Case "AMinus".
simpl. rewrite IHe1. rewrite IHe2. reflexivity.
Case "AMult".
simpl. rewrite IHe1. rewrite IHe2. reflexivity. Qed.
Coq Automation
Tacticals
The repeat Tactical
Theorem ev100 : ev 100.
Proof.
repeat (apply ev_SS). (* applies ev_SS 50 times,
then apply ev_SS fails *)
apply ev_0.
Qed.
(* Print ev100. *)
The repeat T tactic never fails; if the tactic T doesn't apply
to the original goal, then repeat still succeeds without changing
the original goal (it repeats zero times).
Theorem ev100' : ev 100.
Proof.
repeat (apply ev_0). (* doesn't fail, applies ev_0 zero times *)
repeat (apply ev_SS). apply ev_0. (* we can continue the proof *)
Qed.
The repeat T tactic does not have any bound on the number of
times it applies T. If T is a tactic that always succeeds then
repeat T will loop forever (e.g. repeat simpl loops forever
since simpl always succeeds). While Coq's term language is
guaranteed to terminate, Coq's tactic language is not.
The try Tactical
Theorem silly1 : ∀ae, aeval ae = aeval ae.
Proof. try reflexivity. (* this just does reflexivity *) Qed.
Theorem silly2 : ∀(P : Prop), P → P.
Proof.
intros P HP.
try reflexivity. (* just reflexivity would have failed *)
apply HP. (* we can still finish the proof in some other way *)
Qed.
Using try in a completely manual proof is a bit silly, but we'll
see below that try is very useful for doing automated proofs
in conjunction with the ; tactical.
The ; Tactical (Simple Form)
Lemma foo : ∀n, ble_nat 0 n = true.
Proof.
intros.
destruct n.
(* Leaves two subgoals... *)
Case "n=0". simpl. reflexivity.
Case "n=Sn'". simpl. reflexivity.
(* ... which are discharged similarly *)
Qed.
We can simplify this proof using the ; tactical:
Lemma foo' : ∀n, ble_nat 0 n = true.
Proof.
intros.
destruct n; (* destruct the current goal *)
simpl; (* then simpl each resulting subgoal *)
reflexivity. (* then do reflexivity on each resulting subgoal *)
Qed.
Using try and ; together, we can get rid of the repetition in
the proof that was bothering us a little while ago.
Theorem optimize_0plus_sound': ∀e,
aeval (optimize_0plus e) = aeval e.
Proof.
intros e.
induction e;
(* Most cases follow directly by the IH *)
try (simpl; rewrite IHe1; rewrite IHe2; reflexivity).
(* The remaining cases -- ANum and APlus -- are more
interesting... *)
Case "ANum". reflexivity.
Case "APlus".
destruct e1;
(* Again, most cases follow directly by the IH *)
try (simpl; simpl in IHe1; rewrite IHe1;
rewrite IHe2; reflexivity).
(* The interesting case, on which the try... does nothing,
is when e1 = ANum n. In this case, we have to destruct
n (to see whether the optimization applies) and rewrite
with the induction hypothesis. *)
SCase "e1 = ANum n". destruct n;
simpl; rewrite IHe2; reflexivity. Qed.
This proof can still be improved: the first case (for e = ANum
n) is very trivial — even more trivial than the cases that we
said simply followed from the IH — yet we have chosen to write it
out in full. It would be better and clearer to drop it and just
say, at the top, "Most cases are either immediate or direct from
the IH. The only interesting case is the one for APlus..." We
can make the same improvement in our formal proof too. Here's how
it looks:
Theorem optimize_0plus_sound'': ∀e,
aeval (optimize_0plus e) = aeval e.
Proof.
intros e.
induction e;
(* Most cases follow directly by the IH *)
try (simpl; rewrite IHe1; rewrite IHe2; reflexivity);
(* ... or are immediate by definition *)
try reflexivity.
(* The interesting case is when e = APlus e1 e2. *)
Case "APlus".
destruct e1; try (simpl; simpl in IHe1; rewrite IHe1;
rewrite IHe2; reflexivity).
SCase "e1 = ANum n". destruct n;
simpl; rewrite IHe2; reflexivity. Qed.
The ; Tactical (General Form)
T; [T1 | T2 | ... | Tn]
is a tactic that first performs T and then performs T1 on the
first subgoal generated by T, performs T2 on the second
subgoal, etc.
T; [T' | T' | ... | T']
The form T;T' is used most often in practice.
Defining New Tactic Notations
- The Tactic Notation idiom illustrated below gives a handy
way to define "shorthand tactics" that bundle several tactics
into a single command.
- For more sophisticated programming, Coq offers a small
built-in programming language called Ltac with primitives
that can examine and modify the proof state. The details are
a bit too complicated to get into here (and it is generally
agreed that Ltac is not the most beautiful part of Coq's
design!), but they can be found in the reference manual, and
there are many examples of Ltac definitions in the Coq
standard library that you can use as examples.
- There is also an OCaml API, which can be used to build tactics that access Coq's internal structures at a lower level, but this is seldom worth the trouble for ordinary Coq users.
Tactic Notation "simpl_and_try" tactic(c) :=
simpl;
try c.
This defines a new tactical called simpl_and_try which
takes one tactic c as an argument, and is defined to be
equivalent to the tactic simpl; try c. For example, writing
"simpl_and_try reflexivity." in a proof would be the same as
writing "simpl; try reflexivity."
The next subsection gives a more sophisticated use of this
feature...
Bulletproofing Case Analyses
Tactic Notation "aexp_cases" tactic(first) ident(c) :=
first;
[ Case_aux c "ANum" | Case_aux c "APlus"
| Case_aux c "AMinus" | Case_aux c "AMult" ].
(Case_aux implements the common functionality of Case,
SCase, SSCase, etc. For example, Case "foo" is defined as
Case_aux Case "foo".)
For example, if e is a variable of type aexp, then doing
aexp_cases (induction e) Case
will perform an induction on e (the same as if we had just typed
induction e) and also add a Case tag to each subgoal
generated by the induction, labeling which constructor it comes
from. For example, here is yet another proof of
optimize_0plus_sound, using aexp_cases:
Theorem optimize_0plus_sound''': ∀e,
aeval (optimize_0plus e) = aeval e.
Proof.
intros e.
aexp_cases (induction e) Case;
try (simpl; rewrite IHe1; rewrite IHe2; reflexivity);
try reflexivity.
(* At this point, there is already an "APlus" case name
in the context. The Case "APlus" here in the proof
text has the effect of a sanity check: if the "Case"
string in the context is anything _other_ than "APlus"
(for example, because we added a clause to the definition
of aexp and forgot to change the proof) we'll get a
helpful error at this point telling us that this is now
the wrong case. *)
Case "APlus".
aexp_cases (destruct e1) SCase;
try (simpl; simpl in IHe1; rewrite IHe1; rewrite IHe2; reflexivity).
SCase "ANum". destruct n;
simpl; rewrite IHe2; reflexivity. Qed.
Exercise: 3 stars (optimize_0plus_b)
Since the optimize_0plus tranformation doesn't change the value of aexps, we should be able to apply it to all the aexps that appear in a bexp without changing the bexp's value. Write a function which performs that transformation on bexps, and prove it is sound. Use the tacticals we've just seen to make the proof as elegant as possible.(* FILL IN HERE *)
☐
(* FILL IN HERE *)
☐
Exercise: 4 stars, optional (optimizer)
Design exercise: The optimization implemented by our optimize_0plus function is only one of many imaginable optimizations on arithmetic and boolean expressions. Write a more sophisticated optimizer and prove it correct.☐
The omega Tactic
- numeric constants, addition (+ and S), subtraction (-
and pred), and multiplication by constants (this is what
makes it Presburger arithmetic),
- equality (= and <>) and inequality (<=), and
- the logical connectives ∧, ∨, ~, and →,
Example silly_presburger_example : ∀m n o p,
m + n <= n + o ∧ o + 3 = p + 3 →
m <= p.
Proof.
intros. omega.
Qed.
Andrew Appel calls this the "Santa Claus tactic." We'll see
examples of its use below.
A Few More Handy Tactics
- clear H: Delete hypothesis H from the context.
- subst x: Find an assumption x = e or e = x in the
context, replace x with e throughout the context and
current goal, and clear the assumption.
- subst: Substitute away all assumptions of the form x = e
or e = x.
- rename... into...: Change the name of a hypothesis in the
proof context. For example, if the context includes a variable
named x, then rename x into y will change all occurrences
of x to y.
- assumption: Try to find a hypothesis H in the context that
exactly matches the goal; if one is found, behave just like
apply H.
- contradiction: Try to find a hypothesis H in the current
context that is logically equivalent to False. If one is
found, solve the goal.
- constructor: Try to find a constructor c (from some Inductive definition in the current environment) that can be applied to solve the current goal. If one is found, behave like apply c.
Reserved Notation "e '⇓' n" (at level 50, left associativity).
Inductive aevalR : aexp → nat → Prop :=
| E_ANum : ∀(n:nat),
(ANum n) ⇓ n
| E_APlus : ∀(e1 e2: aexp) (n1 n2 : nat),
(e1 ⇓ n1) → (e2 ⇓ n2) → (APlus e1 e2) ⇓ (n1 + n2)
| E_AMinus : ∀(e1 e2: aexp) (n1 n2 : nat),
(e1 ⇓ n1) → (e2 ⇓ n2) → (AMinus e1 e2) ⇓ (n1 - n2)
| E_AMult : ∀(e1 e2: aexp) (n1 n2 : nat),
(e1 ⇓ n1) → (e2 ⇓ n2) → (AMult e1 e2) ⇓ (n1 * n2)
where "e '⇓' n" := (aevalR e n) : type_scope.
Tactic Notation "aevalR_cases" tactic(first) ident(c) :=
first;
[ Case_aux c "E_ANum" | Case_aux c "E_APlus"
| Case_aux c "E_AMinus" | Case_aux c "E_AMult" ].
Theorem aeval_iff_aevalR : ∀a n,
(a ⇓ n) ↔ aeval a = n.
Proof.
split.
Case "→".
intros H.
aevalR_cases (induction H) SCase; simpl.
SCase "E_ANum".
reflexivity.
SCase "E_APlus".
rewrite IHaevalR1. rewrite IHaevalR2. reflexivity.
SCase "E_AMinus".
rewrite IHaevalR1. rewrite IHaevalR2. reflexivity.
SCase "E_AMult".
rewrite IHaevalR1. rewrite IHaevalR2. reflexivity.
Case "←".
generalize dependent n.
aexp_cases (induction a) SCase;
simpl; intros; subst.
SCase "ANum".
apply E_ANum.
SCase "APlus".
apply E_APlus.
apply IHa1. reflexivity.
apply IHa2. reflexivity.
SCase "AMinus".
apply E_AMinus.
apply IHa1. reflexivity.
apply IHa2. reflexivity.
SCase "AMult".
apply E_AMult.
apply IHa1. reflexivity.
apply IHa2. reflexivity.
Qed.
Exercise: 3 stars (bevalR)
Write a relation bevalR in the same style as aevalR, and prove that it is equivalent to beval.(*
Inductive bevalR:
(* FILL IN HERE *)
*)
☐
We define a new inductive datatype Id so that we won't confuse
identifiers and numbers.
Inductive id : Type :=
Id : nat → id.
Definition beq_id X1 X2 :=
match (X1, X2) with
(Id n1, Id n2) => beq_nat n1 n2
end.
States
Definition state := id → nat.
Definition empty_state : state :=
fun _ => 0.
Definition update (st : state) (X:id) (n : nat) : state :=
fun X' => if beq_id X X' then n else st X'.
For proofs involving states, we'll need several simple properties
of update.
Exercise: 1 star (update_eq)
Theorem update_eq : ∀n X st,
(update st X n) X = n.
Proof.
(* FILL IN HERE *) Admitted.
(update st X n) X = n.
Proof.
(* FILL IN HERE *) Admitted.
Theorem update_neq : ∀V2 V1 n st,
beq_id V2 V1 = false →
(update st V2 n) V1 = (st V1).
Proof.
(* FILL IN HERE *) Admitted.
beq_id V2 V1 = false →
(update st V2 n) V1 = (st V1).
Proof.
(* FILL IN HERE *) Admitted.
☐
Exercise: 1 star (update_example)
Before starting to play with tactics, make sure you understand exactly what the theorem is saying!Theorem update_example : ∀(n:nat),
(update empty_state (Id 2) n) (Id 3) = 0.
Proof.
(* FILL IN HERE *) Admitted.
Theorem update_shadow : ∀x1 x2 k1 k2 (f : state),
(update (update f k2 x1) k2 x2) k1 = (update f k2 x2) k1.
Proof.
(* FILL IN HERE *) Admitted.
(update (update f k2 x1) k2 x2) k1 = (update f k2 x2) k1.
Proof.
(* FILL IN HERE *) Admitted.
Theorem update_same : ∀x1 k1 k2 (f : state),
f k1 = x1 →
(update f k1 x1) k2 = f k2.
Proof.

Proof.
(* FILL IN HERE *) Admitted.
Theorem update_permute : ∀x1 x2 k1 k2 k3 f,
beq_id k2 k1 = false →
(update (update f k2 x1) k1 x2) k3 = (update (update f k1 x2) k2 x1) k3.
Proof.
(* FILL IN HERE *) Admitted.
beq_id k2 k1 = false →
(update (update f k2 x1) k1 x2) k3 = (update (update f k1 x2) k2 x1) k3.
Proof.
(* FILL IN HERE *) Admitted.
☐
Syntax
Inductive aexp : Type :=
| ANum : nat → aexp
| AId : id → aexp (* <----- NEW *)
| APlus : aexp → aexp → aexp
| AMinus : aexp → aexp → aexp
| AMult : aexp → aexp → aexp.
Tactic Notation "aexp_cases" tactic(first) ident(c) :=
first;
[ Case_aux c "ANum" | Case_aux c "AId" | Case_aux c "APlus"
| Case_aux c "AMinus" | Case_aux c "AMult" ].
Defining a few variable names as notational shorthands will make
examples easier to read:
Definition X : id := Id 0.
Definition Y : id := Id 1.
Definition Z : id := Id 2.
(This convention for naming program variables (X, Y,
Z) clashes a bit with our earlier use of uppercase letters for
types. Since we're not using polymorphism heavily in this part of
the course, this overloading should not cause confusion.)
The definition of bexps is the same as before (using the new
aexps):
Inductive bexp : Type :=
| BTrue : bexp
| BFalse : bexp
| BEq : aexp → aexp → bexp
| BLe : aexp → aexp → bexp
| BNot : bexp → bexp
| BAnd : bexp → bexp → bexp.
Tactic Notation "bexp_cases" tactic(first) ident(c) :=
first;
[ Case_aux c "BTrue" | Case_aux c "BFalse" | Case_aux c "BEq"
| Case_aux c "BLe" | Case_aux c "BNot" | Case_aux c "BAnd" ].
Fixpoint aeval (st : state) (e : aexp) : nat :=
match e with
| ANum n => n
| AId X => st X (* <----- NEW *)
| APlus a1 a2 => (aeval st a1) + (aeval st a2)
| AMinus a1 a2 => (aeval st a1) - (aeval st a2)
| AMult a1 a2 => (aeval st a1) * (aeval st a2)
end.
Fixpoint beval (st : state) (e : bexp) : bool :=
match e with
| BTrue => true
| BFalse => false
| BEq a1 a2 => beq_nat (aeval st a1) (aeval st a2)
| BLe a1 a2 => ble_nat (aeval st a1) (aeval st a2)
| BNot b1 => negb (beval st b1)
| BAnd b1 b2 => andb (beval st b1) (beval st b2)
end.
Example aexp1 :
aeval (update empty_state X 5)
(APlus (ANum 3) (AMult (AId X) (ANum 2)))
= 13.
Proof. reflexivity. Qed.
Example bexp1 :
beval (update empty_state X 5)
(BAnd BTrue (BNot (BLe (AId X) (ANum 4))))
= true.
Proof. reflexivity. Qed.
Inductive com : Type :=
| CSkip : com
| CAss : id → aexp → com
| CSeq : com → com → com
| CIf : bexp → com → com → com
| CWhile : bexp → com → com.
Tactic Notation "com_cases" tactic(first) ident(c) :=
first;
[ Case_aux c "SKIP" | Case_aux c "::=" | Case_aux c ";"
| Case_aux c "IFB" | Case_aux c "WHILE" ].
As usual, we can use a few Notation declarations to make things
more readable. We need to be a bit careful to avoid conflicts
with Coq's built-in notations, so we'll keep this light — in
particular, we won't introduce any notations for aexps and
bexps to avoid confusion with the numerical and boolean
operators we've already defined. We use the keyword IFB for
conditionals instead of IF, for similar reasons.
Notation "'SKIP'" :=
CSkip.
Notation "X '::=' a" :=
(CAss X a) (at level 60).
Notation "c1 ; c2" :=
(CSeq c1 c2) (at level 80, right associativity).
Notation "'WHILE' b 'DO' c 'END'" :=
(CWhile b c) (at level 80, right associativity).
Notation "'IFB' e1 'THEN' e2 'ELSE' e3 'FI'" :=
(CIf e1 e2 e3) (at level 80, right associativity).
For example, here is the factorial function again, written as a
formal definition to Coq:
Definition fact_in_coq : com :=
Z ::= AId X;
Y ::= ANum 1;
WHILE BNot (BEq (AId Z) (ANum 0)) DO
Y ::= AMult (AId Y) (AId Z);
Z ::= AMinus (AId Z) (ANum 1)
END.
Evaluation
Evaluation Function (Failed Attempt)
Fixpoint ceval_fun_no_while (st : state) (c : com) : state :=
match c with
| SKIP =>
st
| l ::= a1 =>
update st l (aeval st a1)
| c1 ; c2 =>
let st' := ceval_fun_no_while st c1 in
ceval_fun_no_while st' c2
| IFB b THEN c1 ELSE c2 FI =>
if (beval st b)
then ceval_fun_no_while st c1
else ceval_fun_no_while st c2
| WHILE b1 DO c1 END =>
st (* bogus *)
end.
In a traditional functional programming language like ML or
Haskell we could write the WHILE case as follows:
Thus, because it doesn't terminate on all inputs, the full version
of ceval_fun cannot be written in Coq — at least not without
additional tricks, which make everything much more complicated
(see chapter ImpCEvalFun if curious).
Fixpoint ceval_fun (st : state) (c : com) : state := match c with ... | WHILE b1 DO c1 END => if (beval st b1) then ceval_fun st (c1; WHILE b1 DO c1 END) else st end.Coq doesn't accept such a definition (Error: Cannot guess decreasing argument of fix) because the function we want to define is not guaranteed to terminate. Indeed, the full version of the ceval_fun function applied to the loop program above would never terminate. Since Coq is not just a functional programming language, but also a consistent logic, any potentially non-terminating function needs to be rejected. Here is an invalid(!) Coq program showing what would go wrong if Coq allowed non-terminating recursive functions:
Fixpoint loop_false (n : nat) : False := loop_false n.That is, propositions like False would become provable (e.g. loop_false 0 would be a proof of False), which would be a disaster for Coq's logical consistency.
Evaluation as a Relation
We'll use the notation c / st ⇓ st' for our ceval relation,
that is c / st ⇓ st' means that executing program c in a
starting state st results in an ending state st'. This can be
pronounced "c takes state st to st'".
Here is the formal definition. (Make sure you understand
how it corresponds to the inference rules.)
| (E_Skip) | |
| SKIP / st ⇓ st |
| aeval st a1 = n | (E_Ass) |
| X := a1 / st ⇓ (update st X n) |
| c1 / st ⇓ st' | |
| c2 / st' ⇓ st'' | (E_Seq) |
| c1;c2 / st ⇓ st'' |
| beval st b1 = true | |
| c1 / st ⇓ st' | (E_IfTrue) |
| IF b1 THEN c1 ELSE c2 FI / st ⇓ st' |
| beval st b1 = false | |
| c2 / st ⇓ st' | (E_IfFalse) |
| IF b1 THEN c1 ELSE c2 FI / st ⇓ st' |
| beval st b1 = false | (E_WhileEnd) |
| WHILE b1 DO c1 END / st ⇓ st |
| beval st b1 = true | |
| c1 / st ⇓ st' | |
| WHILE b1 DO c1 END / st' ⇓ st'' | (E_WhileLoop) |
| WHILE b1 DO c1 END / st ⇓ st'' |
Reserved Notation "c1 '/' st '⇓' st'" (at level 40, st at level 39).
Inductive ceval : com → state → state → Prop :=
| E_Skip : ∀st,
SKIP / st ⇓ st
| E_Ass : ∀st a1 n X,
aeval st a1 = n →
(X ::= a1) / st ⇓ (update st X n)
| E_Seq : ∀c1 c2 st st' st'',
c1 / st ⇓ st' →
c2 / st' ⇓ st'' →
(c1 ; c2) / st ⇓ st''
| E_IfTrue : ∀st st' b1 c1 c2,
beval st b1 = true →
c1 / st ⇓ st' →
(IFB b1 THEN c1 ELSE c2 FI) / st ⇓ st'
| E_IfFalse : ∀st st' b1 c1 c2,
beval st b1 = false →
c2 / st ⇓ st' →
(IFB b1 THEN c1 ELSE c2 FI) / st ⇓ st'
| E_WhileEnd : ∀b1 st c1,
beval st b1 = false →
(WHILE b1 DO c1 END) / st ⇓ st
| E_WhileLoop : ∀st st' st'' b1 c1,
beval st b1 = true →
c1 / st ⇓ st' →
(WHILE b1 DO c1 END) / st' ⇓ st'' →
(WHILE b1 DO c1 END) / st ⇓ st''
where "c1 '/' st '⇓' st'" := (ceval c1 st st').
Tactic Notation "ceval_cases" tactic(first) ident(c) :=
first;
[ Case_aux c "E_Skip" | Case_aux c "E_Ass" | Case_aux c "E_Seq"
| Case_aux c "E_IfTrue" | Case_aux c "E_IfFalse"
| Case_aux c "E_WhileEnd" | Case_aux c "E_WhileLoop" ].
Example ceval_example2:
(X ::= ANum 0; Y ::= ANum 1; Z ::= ANum 2) / empty_state ⇓
(update (update (update empty_state X 0) Y 1) Z 2).
Proof.
(* FILL IN HERE *) Admitted.
(X ::= ANum 0; Y ::= ANum 1; Z ::= ANum 2) / empty_state ⇓
(update (update (update empty_state X 0) Y 1) Z 2).
Proof.
(* FILL IN HERE *) Admitted.
☐
Exercise: 3 stars, optional (pup_to_n)
Write an Imp program that sums the numbers from 1 to X (inclusive: 1 + 2 + ... + X) in the variable Y. Prove that this program executes as intended for X = 2 (this latter part is trickier than you might expect).Definition pup_to_n : com :=
(* FILL IN HERE *) admit.
Theorem pup_to_2_ceval :
pup_to_n / (update empty_state X 2) ⇓
update (update (update (update (update (update empty_state
X 2) Y 0) Y 2) X 1) Y 3) X 0.
Proof.
(* FILL IN HERE *) Admitted.
☐


{% include gis/head.html %}
{% include gis/menu.html %} {% include gis/header.html %} {% include gis/benefits.html %} {% include gis/features.html %} {% include gis/examples.html %} {% include gis/people.html %} {% include gis/contact.html %} {% include swiper-gallery.html %}


{% extends "basic-template.html" %} {% block title %} Linear system {% endblock %} {% block content %}
We will take a look at two methods of linear system solving: Gaussian elimination and Jacobi method.
You can set the size N of the matrix which will be generated by the following rule:
$
\begin{pmatrix}
1 & 2 & 3 & \dots & n-1 & n \\
-1 & 0 & 3 & \dots & n-1 & n \\
-1 & -2 & 0 & \dots & n-1 & n \\
& \vdots & & \ddots & & \\
-1 & -2 & -3 & \dots & -n+1 & 0 \\
\end{pmatrix}
=
\begin{pmatrix}
1 \\
2 \\
3 \\
\vdots \\
n \\
\end{pmatrix}
$
Note that N should belong to $[10, 100]$.
Have fun!


A Short Summary
Paradoxes are arguments that seem sound, but are self contradictory.
- Some reference themselves to reach a conclusion.
- Some use recursion or infinity.
- Some rely on vagueness of words.
What are some examples?
Famous Paradoxes
- The Sorites Paradox
- The Omnioptence Paradox
- The Liar Paradox
The Sorites Paradox
- Imagine you have a heap of sand.
- If you take away one grain, is it still a heap?
- If so, at what point is it no longer a heap?
The Omnipotence Paradox
- This paradox is pretty straightforward.
- Could God create a boulder so heavy that he could not lift it?
The Liar Paradox
- This may be the simplest of the paradoxes so far.
- This statement is false.
- Is that statement true or false?
Solving Paradoxes
The Sorites Paradox
- This is considered a paradox because it uses the vaugeness of the word heap.
- Some people try to say that there is a cut-off of the size of a heap, but we don't know it yet.
- Some people said 4 as that's the smallest pyramid you could make.
- Some people say it's unsolvable, and say that the answers are just avoiding the heart of the paradox.
The Omniopotence Paradox
- This is a paradox because creates a plausible task, but that task then creates a contradiction with the concept of omnipotence.
- Some solutions have been proposed, but they just complicate the paradox even more.
The Liar Paradox
- This is a paradox because it refrences itself to reach a conclusion.
- Many people have tried to solve it, but no one seems to be able to do it completely.
- This may just be an unsolvable paradox.
Conclusion
- Throughout history, new paradoxes have been created.
- Old ones have been solved.
- Some haven't been solved yet.
- Others may not be solvable.


Waking Aida
We're writing new material right now.
We are delighted to be playing the Tramlines Fringe Festival in Sheffield in July,
details here
Check back soon, or take a look at the links below.


| Head cell | Head cell | Head cell |
|---|---|---|
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
mod-alignTop
class on table
.
| Head cell | Head cell | Head cell |
|---|---|---|
| Parent | ||
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Parent | ||
| Body cell | Body cell | Body cell |
| Parent |
|
|
Head cell | Head cell | Head cell |
|---|---|---|---|
|
|
Body cell | Body cell | Body cell |
|
|
Body cell | Body cell | Body cell |
|
|
Body cell | Body cell | Body cell |
| Head cell | Head cell | Head cell |
|---|---|---|
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Head cell | Head cell | Head cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Main line Second line | Sortable main line Second line | Head cell |
|---|---|---|
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Head Cell | Head Cell | Head Cell |
|---|---|---|
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Table cell | Table cell | |
| Table cell | Table cell | |
| Table cell | Table cell |
| Sortable column | Sortable column | Sortable column |
|---|---|---|
| Table cell | Table cell | Table cell |
| Table cell | Table cell | Table cell |
| Table cell | Table cell | Table cell |
You can use a table inside a card. To do it, put it outside card-content
and add a
mod-card
to it.
| Table head | Table head |
|---|---|
| Table cell | Table cell |
| Table cell | Table cell |
| Table cell | Table cell |
| Table head | Table head |
|---|---|
| Table cell | Table cell |
| Table cell | Table cell |
| Table footer | Table footer |
You can use a mod-filters
on the first row of your table body to use it as a filter row.
|
Head cell
|
Head cell
|
Head cell
|
|---|---|---|
| Body cell | Body cell | Body cell |
| User Name | Some data | |
|---|---|---|
| User Name | Some data | |
| User Name | Some data |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Head cell | Head cell | Head cell |
|---|---|---|
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
mod-stickyHeader
class or
mod-stickyHeader-withBanner
.
| Head cell | Head cell | Head cell |
|---|---|---|
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
--sticky-header-shadow-offset-top
on
.table-body-row.mod-stickyHeader-shadow
must be equal to the table header height
| Head cell | Head cell | Head cell |
|---|---|---|
| Cell with mod-layoutFixed-8 | Cell with mod-layoutFixed-12 | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
| Head cell | Head cell | Head cell |
|---|---|---|
| Cell with mod-layoutFixed-8 | Cell with mod-layoutFixed-12 | Body cell |
| Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell |
.mod-layoutFixed-8
means a cell width of 8 rem
| Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell |
|---|---|---|---|---|---|---|---|---|---|
| fixed width: 8 // offset 0 | fixed width: 7 // offset 8 | fixed width: 5 // offset 8 + 7 = 15 | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | fixed width: 5 // offset 0 |
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell |
| Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell |
|---|---|---|---|---|---|---|---|---|---|
| fixed width: 8 // offset 0 | fixed width: 7 // offset 8 | fixed width: 5 // offset 8 + 7 = 15 | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | fixed width: 5 // offset 0 |
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell |
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell |
.mod-stickyColumn-leftOffsetX
or
.mod-stickyColumn-righOffsetX
with X equal to the cumulative size of
previous cells in the specified axis (from left or from right)
| Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | ||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | ||
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | ||
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell |
| Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | ||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | ||
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | ||
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell |
| Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | ||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | ||
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | ||
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell |
| Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | Head cell | ||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | ||
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | ||
| Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell | Body cell |


To<EMAIL_ADDRESS>From<EMAIL_ADDRESS>Dear
You are required to verify the payments claim from Paul Jones for Access To Work.
View details online.
Yours sincerely
Access To Work


from pathlib import Path, PurePath
from typing import Union, Generator, Tuple, TypeVar
from ._class_file_base import FileBase
from ._helpers_private import _init_path
from ._file_name import FileName, NameABC
SelfType = TypeVar("SelfType", bound="File")
[docs]class File(FileBase):
[docs] def __init__(self, path: Union[str, PurePath]):
"""
:param path: to file
"""
path = _init_path(path)
self._path: Path = path
self._name: FileName = FileName.from_path(path)
def __iter__(self) -> Generator[Path, None, None]:
"""Yields 1 path"""
yield self.path
def __len__(self) -> int:
"""
Always ``1``
"""
return 1
@property
def name(self) -> FileName:
"""{name}{ext}"""
return self._name
@property
def path(self) -> Path:
"""path to file"""
return self._path
[docs] def init_new(self: SelfType, path_new: Path) -> SelfType:
return type(self)(path_new)
[docs] def rename_iter(
self: SelfType, name: Union[str, NameABC]
) -> Generator[Union[Tuple[Path, Path], SelfType], None, None]:
"""Renames file. Yields new `File` as last object"""
new_path = self.path.with_name(str(name))
self.path.rename(new_path)
yield self.path, new_path
yield type(self)(new_path)


I AM MR.DON UBALA, THE DIRECTOR OF SPECIAL DEPOSITORY TRUST ACCOUNT UNIT OF UNITED BANK FOR AFRICA � NIGERIA PLC.  IT IS STRICTLY CONFIDENTIAL. DETAILS THE FORMER ZAIREAN PRESIDENT MOBUTU SESE SEKO MAINTAINS A TRUST BANK ACCOUNT WITH OUR BANK, THE ACCOUNT IS OPERATED THROUGH ONE OF HIS PERSONAL AIDE, MR. NSSONA NGOUSOU UNDER THE NAME M-S- SEKO A/C<PHONE_NUMBER>09 � CODE MSSK. THE ACCOUNT BALANCE AS AT THE END OF AUGUST 1997 STANDS AT US$34,657,000.00 (THIRTY FOUR MILLION, SIX HUNDRED AND FIFTY SEVEN THOUSAND UNITED STATES DOLLARS ONLY).  HOWEVER, OWINNG TO THE CIRCUMSTANCES THAT SURROUNDS THE ARRANGEMENT WITH THE (ADB) THE FUND MOVEMENT ARRANGEMENT WAS FINALIZED ON THE EVE OF OUR CUSTOMER�S DEATH ON THE 13TH SEPTEMBER, 1997 IN MOROCCO.  WE HAVE THEREFORE DECIDED TO SOLICIT YOUR ASSISTANCE IN PROVIDING AN OVERSEAS A/C INTO WHICH THE FUND WILL BE MOVED. YOU ARE THEREFORE REQUIRED AS A MATTER OF URGENCY TO SEND TO ME THROUGH THE FAX NO. ABOVE, THE FOLLOWING INFORMATION: (A) YOUR BANK NAME AND ADDRESS, ACCOUNT NO, BANK PHONE, FAX AND TELEX NUMBERS. (B) YOUR PERSONAL PRIVATE PHONE AND FAX NUMBERS.(C) BENEFICIARY�S NAME. MODALITIES 30% OF THE TOTAL SUM UPON REMITTANCE WILL BE GIVEN TO YOU AS THE OWNER OF THE A/C , 65% WILL BE FOR THE CONCERNED OFFICERS AND MR NSSONA NGOUSOU. THE REMAINING 5% WILL BE USED TO OFFSET ALL EXPENSES INCURRED IN THE COURSE OF THIS TRANSACTION.  BEST REGARDS, MR.DON UBALA


Almost my first webpage
This is kinda my first webpage!
Isn't this amazing?
Here is some stuff I plan on learning:
Check out Epicodus. It's a great school for kids who want to learn to read good and do other stuff good too.
Plus, some see some of my fav stuff! Highly recommend you like them too.


money
Introduction
A Crystal shard for dealing with money and currency conversion ported from RubyMoney.
Features
- Provides a
Money
class which encapsulates all information about an certain amount of money, such as its value and its currency. - Provides a
Money::Currency
class which encapsulates all information about a monetary unit. - Represents monetary values as integers, in cents. This avoids floating point rounding errors.
- Represents currency as
Money::Currency
instances providing a high level of flexibility. - Provides APIs for exchanging money from one currency to another.
Resources
Notes
- Your app must use UTF-8 to function with this library. There are a number of non-ASCII currency attributes.
- This app requires JSON.
Installation
Add this to your application's shard.yml
:
dependencies:
money:
github: crystal-money/money
Install with shards install
.
Usage
require "money"
# 10.00 USD
money = Money.new(1000, "USD")
money.cents # => 1000
money.currency # => Money::Currency.find("USD")
# Comparisons
Money.new(1000, "USD") == Money.new(1000, "USD") # => true
Money.new(1000, "USD") == Money.new(100, "USD") # => false
Money.new(1000, "USD") == Money.new(1000, "EUR") # => false
Money.new(1000, "USD") != Money.new(1000, "EUR") # => true
# Arithmetic
Money.new(1000, "USD") + Money.new(500, "USD") == Money.new(1500, "USD")
Money.new(1000, "USD") - Money.new(200, "USD") == Money.new(800, "USD")
Money.new(1000, "USD") / 5 == Money.new(200, "USD")
Money.new(1000, "USD") * 5 == Money.new(5000, "USD")
# Unit to subunit conversions
Money.from_amount(5, "USD") == Money.new(500, "USD") # 5 USD
Money.from_amount(5, "JPY") == Money.new(5, "JPY") # 5 JPY
Money.from_amount(5, "TND") == Money.new(5000, "TND") # 5 TND
# Currency conversions
some_code_to_setup_exchange_rates
Money.new(1000, "USD").exchange_to("EUR") == Money.new(some_value, "EUR")
# Formatting (see Formatting section for more options)
Money.new(100, "USD").format # => "$1.00"
Money.new(100, "GBP").format # => "£1.00"
Money.new(100, "EUR").format # => "€1.00"
Currency
Currencies are consistently represented as instances of Money::Currency
.
The most part of Money
APIs allows you to supply either a String
, Symbol
or a Money::Currency
.
Money.new(1000, "USD") == Money.new(1000, Money::Currency.find("USD"))
Money.new(1000, "EUR").currency == Money::Currency.find(:eur)
Money.new(1000, "PLN").currency == Money::Currency[:pln]
A Money::Currency
instance holds all the information about the currency,
including the currency symbol, name and much more.
currency = Money.new(1000, "USD").currency
currency.code # => "USD"
currency.name # => "United States Dollar"
To define a new Money::Currency
use Money::Currency.register
as shown
below.
currency = Money::Currency.from_json({
priority: 1,
code: "USD",
iso_numeric: 840,
name: "United States Dollar",
symbol: "$",
symbol_first: true,
subunit: "Cent",
subunit_to_unit: 100,
decimal_mark: ".",
thousands_separator: ","
}.to_json)
Money::Currency.register(currency)
The pre-defined set of attributes includes:
:priority
a numerical value you can use to sort/group the currency list:code
the international 3-letter code as defined by the ISO 4217 standard:iso_numeric
the international 3-digit code as defined by the ISO 4217 standard:name
the currency name:symbol
the currency symbol (UTF-8 encoded):symbol_first
whether a money symbol should go before the amount:subunit
the name of the fractional monetary unit:subunit_to_unit
the proportion between the unit and the subunit:decimal_mark
character between the whole and fraction amounts:thousands_separator
character between each thousands place
All attributes except :code
and :subunit_to_unit
are optional.
Some attributes, such as :symbol
, are used by the Money
class to print out a
representation of the object. Other attributes, such as :name
or :priority
,
exist to provide a basic API you can take advantage of to build your application.
:priority
The priority attribute is an arbitrary numerical value you can assign to the
Money::Currency
and use in sorting/grouping operation.
For instance, let's assume your web application needs to render a currency selector like the one available here. You can create a couple of custom methods to return the list of major currencies and all currencies as follows:
# Returns an array of currency id where priority < 10
def major_currencies(hash)
hash.values.sort.take_while(&.priority.try(&.<(10))).map(&.id)
end
# Returns an array of all currency id
def all_currencies(hash)
hash.keys
end
major_currencies(Money::Currency.table)
# => ["usd", "eur", "gbp", "aud", "cad", "jpy"]
all_currencies(Money::Currency.table)
# => ["aed", "afn", "all", ...]
Default Currency
By default Money
defaults to USD as its currency. This can be overwritten
using:
Money.default_currency = Money::Currency.find("CAD")
# or
Money.default_currency = :cad
Currency Exponent
The exponent of a money value is the number of digits after the decimal
separator (which separates the major unit from the minor unit). See e.g.
ISO 4217 for more
information. You can find the exponent (as an Int32
) by
Money::Currency.find("USD").exponent # => 2
Money::Currency.find("JPY").exponent # => 0
Money::Currency.find("MGA").exponent # => 1
Currency Lookup
To find a given currency by ISO 4217 numeric code (three digits) you can do
Money::Currency.find(&.iso_numeric.==(978)) # => #<Money::Currency @iso_numeric=978, @code="EUR", @name="Euro", @symbol="€", @subunit="Cent", @subunit_to_unit=100, @symbol_first=true ...>
Currency Exchange
Exchanging money is performed through an exchange Bank
object. The default
exchange Bank
object requires one to manually specify the exchange rate. Here's
an example of how it works:
Money.default_bank.store["USD", "EUR"] = 1.24515
Money.default_bank.store["EUR", "USD"] = 0.803115
Money.new(100, "USD").exchange_to("EUR") # =><EMAIL_ADDRESS>@currency="EUR")
Money.new(100, "EUR").exchange_to("USD") # =><EMAIL_ADDRESS>@currency="USD")
Comparison and arithmetic operations work as expected:
Money.new(1000, "USD") <=> Money.new(900, "USD") # => 1; 9.00 USD is smaller
Money.new(1000, "EUR") + Money.new(10, "EUR") # =><EMAIL_ADDRESS>@currency="EUR")
Money.default_bank.store["USD", "EUR"] = 0.5
Money.new(1000, "EUR") + Money.new(1000, "USD") # => Money.new(@amount=15, @currency="EUR")
Exchange rate stores
The default bank is initialized with an in-memory store for exchange rates.
Money.default_bank = Money::Bank::VariableExchange.new(Money::Currency::RateStore::Memory.new)
You can pass you own store implementation, ie. for storing and retrieving rates off a database, file, cache, etc.
Money.default_bank = Money::Bank::VariableExchange.new(MyCustomStore.new)
# Add to the underlying store
Money.default_bank.store["USD", "CAD"] = 0.9
# Retrieve from the underlying store
Money.default_bank.store["USD", "CAD"] # => 0.9
# Exchanging amounts just works
Money.new(10.0, "USD").exchange_to("CAD") # => Money(@amount=9 @currency="CAD")
There is nothing stopping you from creating store objects which scrapes
XE for the current rates or just returns rand(2)
:
Money.default_bank = Money::Bank::VariableExchange.new(StoreWhichScrapesXeDotCom.new)
You can also implement your own Bank
to calculate exchanges differently.
Different banks can share Stores.
Money.default_bank = MyCustomBank.new(Money::Currency::RateStore::Memory.new)
If you wish to disable automatic currency conversion to prevent arithmetic when currencies don't match:
Money.disallow_currency_conversion!
Rounding
By default, Money
objects are rounded to the nearest cent and the additional precision is not preserved:
Money.new(2.34567).to_s # => "$2.35"
To round to the nearest cent (or anything more precise), you can use the Money#round
method.
Money.new(2.34567).round(4).to_s # => "$2.35"
To retain the additional precision, you will also need to set Money.infinite_precision
to true
.
Money.infinite_precision = true
Money.new(2.34567).to_s # => "$2.34567"
Money.new(2.34567).round(4).to_s # => "$2.3457"
Formatting
There are several formatting rules for when Money#format
is called. For more information, check out the formatting module source, or read the latest release's docs.
If you wish to format money according to the EU's Rules for expressing monetary units in either English, Irish, Latvian or Maltese:
money = Money.new(123, :gbp) # =><EMAIL_ADDRESS>@currency="GBP")
money.format(symbol: "#{money.currency} ") # => "GBP 1.23"
Heuristics
To parse a String
containing amount with currency code or symbol you can do
Money.parse("$12.34") # =><EMAIL_ADDRESS>@currency="USD")
Money.parse("12.34 USD") # =><EMAIL_ADDRESS>@currency="USD")
Contributors
- Sija Sijawusz Pur Rahnama - creator, maintainer
Thanks
Thanks to all of the contributors for their awesome work on RubyMoney.


--- layout: post title: Scoble Follow Up date: '2008-08-12T11:04:00-07:00' tags: - scobleizer - bloggers - tech blogosphere - robert scoble tumblr_url: http://alexhwilliams.tumblr.com/post/45700204/scoble-follow-up ---
The decision to cover a company/story is entirely subjective. It’s about influence. How you influence bloggers and the media is the real question. In extension, it’s further about how your users influence the conversation.
I may just have to see if I can stop using email for anything but the most narrow of tasks. I will still use it to communicate with bloggers/media but sparingly as some like to be updated, others do not. My impression is that the up and coming bloggers do like to get email about stories. Anythng they can do to stay ahead or in pace with the tech blogosphere.
Email is also still the way I keep in touch with the mass majority of friends and family who have no clue about Twitter, etc. I do need to educate them better. Perhaps that is the answer.


We want you too consume ethical and sustaibable at the most convenience.


fun getIDFA(context: Context): Unit
Get current IDFA. Check if Google Play Services must be present (!)
context - pass a context
context


Fingerprinting audio game
Options:
The game has a total of 10 levels. The user
has the option to go in between levels and play in whichever difficulty
they desire. Which is what the "Level" tab is for. There is then a "Game"
tab in which the user can play straight meaning that in order to get
to the next level they have to pass the previous level. There is
also a highscore tab that displays highscores. There is also an audio
tab to listen to everthing indiviually.
The point of the game:
Is to test whether a person is better at recognizing certain speech cues in a sentence with a high amount of background noise. Encourage users to pay attention to pronunciation of certain words in a sentence or phrase. The game gathers data and helps identify what sentence or phrase was easiest said. It helps round up what words are easier to hear.
How to play:
The game has the video screen below that should not be clicked. Under the video screen are two buttons "Play Video" and "Pause Video" Those two buttons will control the game in terms of hearing. Above the video screen it will show the points you can get above the game screen for each level as well as your current score. If answered incorrectly it will deduct a different amount of points depending on the level. If answered correctly 200 points will be added. The user must listen and try to decipher the sentence or phrase being said. To answer the user types in the answer into the box below the play screen and then click submit. Two pop up boxes should appear on your screen one confirming whether or not your answer was correct or not. The second box will take your answer and send it to a realtime database to gather information.
About game image above
Some text..


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/finset.20vs.20finite.html ---
What are the pros and cons of finset vs finite? I'm quite confused how to move back and forth between the two. Related: Should there be a lemma that every set of a fintype is finite? Maybe it is even there, but I couldn't find it.
Aaah, finite_mem_finset
can help me.
I just found this looking for an answer to my question, which is basically the same as Johan's from September: is there a canonical way to carve a finset
out of a fintype
? Something like def sep {α} [fintype α] (P : α → Prop) : finset α
?
Currently we only have finset.univ.filter
finset.univ.filter
That'll work, thanks.
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Third Round of Elections on Horizon as Netanyahu, Gantz’s Last-Minute Meeting Unfruitful
by JNS“You have asked a difficult thing,” he said. “If you see me as I am being taken from you, this will be granted to you; if not, it will not.” (Kings 2 2:10)
A last-minute effort on Tuesday night by Blue and White Party leader Benny Gantz and Israeli Prime Minister Benjamin Netanyahu to reach a unity government agreement ended with no breakthrough.
Following the meeting, which lasted an hour, Gantz said, “Some principles and values can’t be given up,” even if it means the country going to its third election in less than a year.
He noted that despite the lack of progress in talks with Netanyahu, Blue and White will continue to attempt to form a majority government until Gantz’s mandate to do so expires on Wednesday at midnight.
If Gantz is unable to form a government, the country will likely face a third election.
Prior to Tuesday’s meeting, Gantz and Netanyahu last met for direct talks on Oct. 27, a few days after Gantz was tasked by Israeli President Reuven Rivlin with forming a government following Netanyahu’s failure to do so.
Meanwhile the lynchpin, Avigdor Liberman has said that he will not endorse Netanyahu or Gantz.