|
ViennaCL - The Vienna Computing Library
1.5.2
|
A backend that provides contexts for ViennaCL objects (vector, matrix, etc.) More...
#include <backend.hpp>
Static Public Member Functions | |
| static void | switch_context (long i) |
| Switches the current context to the context identified by i. | |
| static viennacl::ocl::context & | context (long id) |
| Returns the current active context. | |
| static viennacl::ocl::context & | current_context () |
| Returns the current active context. | |
| static viennacl::ocl::command_queue & | get_queue () |
| Returns the current queue for the active device in the active context. | |
| static void | setup_context (long i, std::vector< cl_device_id > const &devices) |
| Sets a number of devices for the context. | |
| static void | setup_context (long i, cl_context c, std::vector< cl_device_id > const &devices, std::map< cl_device_id, std::vector< cl_command_queue > > const &queues) |
| Initializes ViennaCL with an already existing context. | |
| static void | setup_context (long i, cl_context c, std::vector< cl_device_id > const &devices, std::vector< cl_command_queue > const &queue) |
| Initializes ViennaCL with an already existing context. | |
| static void | set_context_device_type (long i, cl_device_type t) |
| Sets the context device type. | |
| static void | set_context_device_num (long i, vcl_size_t num) |
| Sets the maximum number of devices per context. Ignored if a device array is provided as well. | |
| static void | set_context_platform_index (long i, vcl_size_t pf_index) |
| Sets the context device type. |
A backend that provides contexts for ViennaCL objects (vector, matrix, etc.)
| static viennacl::ocl::context& context | ( | long | id | ) | [inline, static] |
Returns the current active context.
| static viennacl::ocl::context& current_context | ( | ) | [inline, static] |
Returns the current active context.
| static viennacl::ocl::command_queue& get_queue | ( | ) | [inline, static] |
Returns the current queue for the active device in the active context.
| static void set_context_device_num | ( | long | i, |
| vcl_size_t | num | ||
| ) | [inline, static] |
Sets the maximum number of devices per context. Ignored if a device array is provided as well.
| static void set_context_device_type | ( | long | i, |
| cl_device_type | t | ||
| ) | [inline, static] |
Sets the context device type.
| static void set_context_platform_index | ( | long | i, |
| vcl_size_t | pf_index | ||
| ) | [inline, static] |
Sets the context device type.
| static void setup_context | ( | long | i, |
| std::vector< cl_device_id > const & | devices | ||
| ) | [inline, static] |
Sets a number of devices for the context.
| i | ID of the context to be set up |
| devices | A vector of OpenCL device-IDs that should be added to the context |
| static void setup_context | ( | long | i, |
| cl_context | c, | ||
| std::vector< cl_device_id > const & | devices, | ||
| std::map< cl_device_id, std::vector< cl_command_queue > > const & | queues | ||
| ) | [inline, static] |
Initializes ViennaCL with an already existing context.
| i | ID of the context to be set up |
| c | The OpenCL handle of the existing context |
| devices | A vector of OpenCL device-IDs that should be added to the context |
| queues | A map of queues for each device |
| static void setup_context | ( | long | i, |
| cl_context | c, | ||
| std::vector< cl_device_id > const & | devices, | ||
| std::vector< cl_command_queue > const & | queue | ||
| ) | [inline, static] |
Initializes ViennaCL with an already existing context.
| i | ID of the context to be set up |
| c | The OpenCL handle of the existing context |
| devices | A vector of OpenCL device-IDs that should be added to the context |
| queue | One queue per device |
| static void switch_context | ( | long | i | ) | [inline, static] |
Switches the current context to the context identified by i.
| i | ID of the new active context |


{% extends 'base.html'%} {% import "bootstrap/wtf.html" as wtf %} {% block content %}
{{ comment.comment }}
By: {{comment.poster}}


Hi IGN, my name is Harrison McGuire and it has been a lot of fun participating in your Code Foo Challenge. Working for IGN would be an absolute dream of mine. I hope you enjoy my answers to your challenges.
Below is my 2 minute video, I wasn't sure if you wanted it less than 2 minutes (the website said less than 2) or between 2-5 minutes (the README said 2-5), so I kind of made it around 3 minutes. If you only watch a minute and half, that's super cool as well. Enjoy.
Hmmm...where to begin? I think I would just start by throwing ping pong balls at an airplane and see how far they bounced and wait until I get escorted out by airport security for sneaking onto the airstrip.
No, that wouldn't be right nor would it answer the question. To solve the 747 challenge I would go down the list of finding the dimensions of needed properties and then see how they can be combined. Below is a list of my operations.
Through a Google search I discovered that a ping pong ball has a diameter of 40mm. I am going to convert that to centimeters and then to inches. 40mm = 4cm and then 4cm = 1.5748in ~ let's approximate to 1.6in
The volume of a sphere is 4/3 x pi x r^3. We'll use the radius of 1.6/2 = 0/8 to find the volume of our ping pong ball. Volume = 4/3 x 3.14 x 0.8^3 = 2.14. We will use this volume in future steps.
Although the volume of a ping pong ball is 2.14in we need to account for empty space. I'm going to pretend each ping pong ball is inside an imaginary cube with the same length. The volume of a cube is a^3. So the imaginary cube's volume equals 1.6^3 = 4.096. Using this technique we will be putting each ball on top of one another, we will not be using the hexagonal method. Then, finding out how many ping pong balls can fit in a square foot, we find the volume of 12in cube then divide by 4.096. (12in x 12in x 12in)/4.096 = 422 ping pong balls. This number will be useful in later steps.
I'm going to split the 747 into 3 parts: 1 long cylinder and 2 cones that are placed on each end. After looking at the schematics, the cylinder will be 185ft long with a diameter of 30 ft and the cylinders will each be 20ft in height. The volume for a cylinder is pi x r^2 x h. Our volume equals 3.14 x 15^2 x185 = 131,000ft. The volume for a cone is pi x r^2 x h/3. Thus our volume for each cone equals 3.14 x 15^2 x 20/3 = 4712ft. We will use these volumes in the next step to find how many ping pong balls can fit inside the shapes and that will get us closer to the solution.
Now since we have all the volumes let's multiply each volume by how many ping pongs can fit in a sq foot and then add the products. 1) Cylinder: 131,000ft x 422 = 55,282,000. 2) 2 Cones: 2(4712ft) x 422 = 3,976,928.
Now we simply add our products from the previous step. 1) Cylinder: 55,282,000 + 3,976,928 = 59,258,928.
 I am assuming that there are not any seats in the plane, cockpit controls, kitchen space, bathrooms, or cabinets.
 Then multiply the sum by 50...and then just go play a game of ping pong with your buddy and then relax on a double decker couch.
The word search was a lot of fun to solve. I coded the program in java and below you will find the link to its github page and a screen shot of the solution.
I created a program in Java that displays a list of videos and articles using IGN's API. I parsed through the JSON data using the org.json package. Below you will find the link to its github page and a screenshot of how the solution appears.
Using IGN's provided API I tackled the challenge by making an Android app that mimics the design of the provided screenshot. I pulled the JSON data using volley for speed and efficiency. I matched the design to fit the provided screenshot. Below you will find screenshots of the app along with the link to its github page.
The battleship game was a lot of fun to make. I created the game in java and it has one user controlled player and one AI controlled opponent that will put your skills to the test. The program takes a lot of code and a lot of checks and balances. Anyways, I hope you enjoy playing the game, I put some jokes in to hopefully increase the fun factor. The game is played entirely in the console. Below you'll find screenshots of the game and a link to its github page.
It's been a real privledge working on these challenges for IGN, I've been a huge fan for years. If you want to get in touch with me, my contact info is below.
760-238-6194


Chosen Directive Example Usage
Chosen with a promise: {{foo | json}}
Chosen with a promised hash: {{baz | json}}
Chosen with static options: {{ bar }}
Hi
This is fun
I like Chosen so much
I also like bunny rabbits
Passing options in as a hash: {{ woo }}
Full Text Search: {{woo}}
Disabling the element with a message when the collection is empty: {{ whatever }}
Empty?
Changing the ngModel externally: {{ myPets }}
Empty?
Disabling the selection:
Disabled
Great
fun
Great fun .. indeed


The FurAffinity Patcher is a Browser Extension with some Content Scripts for https://www.furaffinity.net/.
Adding some Client-Side features like Edit-Preview and some smaller tweaks.
It all began with "No preview
rendering in
Submission-Upload-Page D:". :)
I know FA is an older site, but it's really sad to see no major feature
updates in the last time. :'(
This project should be small and adds some life improvements. I hope FA
gives us native Blacklist on the serverside, soon and some other fixes.
FN seems to be a good competitor, I hope for the best, because competition
is good.
Content Changes
- smaller Tweaks on Profile- and Submission-Page
- Editor with BBCode-Preview
- Notes-List with search and sort
Features
-
Small Tweaks
- Profile Page
- Replace link-Buttons with real Buttons (+Watch, -Watch, +Block, ...)
- No more redirect, just AJAX with button.click-event
- Buttons with new CSS
- (Submission) View Page
- Replace link-Buttons with real Buttons (+Fav, ...)
- No more redirect, just AJAX with button.click-event
- Buttons with new CSS
- Add Artist in Sidebar
- Simple Editor with Preview and Help
- Notes
- Profile-Edit
- Journal
- Upload
- Notes with Search and Sort
- Search in Notes list for Subject, Sender and Senddate
- Sort by Subject, Sender and Sendate
Limitations
You must reload your Browsepage if you change or enable/disable the Blacklists.
Credit


| Class | Description |
|---|---|
| Activity |
Java class for anonymous complex type.
|
| Activity.InputActivityPort |
Java class for anonymous complex type.
|
| Activity.OutputActivityPort |
Java class for anonymous complex type.
|
| Blocking |
Java class for Blocking complex type.
|
| Configuration |
Java class for anonymous complex type.
|
| ConfigurationType |
Java class for anonymous complex type.
|
| Control |
Java class for anonymous complex type.
|
| CrossProduct |
Java class for anonymous complex type.
|
| DataLink |
Java class for DataLink complex type.
|
| DataLink.MergePosition |
Java class for anonymous complex type.
|
| DataLinkEntry |
Java class for anonymous complex type.
|
| DispatchStack |
Java class for anonymous complex type.
|
| DispatchStack.DispatchStackLayers |
Java class for anonymous complex type.
|
| DispatchStackLayer |
Java class for anonymous complex type.
|
| DotProduct |
Java class for anonymous complex type.
|
| GranularPortDepth |
Java class for anonymous complex type.
|
| InputActivityPort |
Java class for anonymous complex type.
|
| InputPortBinding |
Java class for InputPortBinding complex type.
|
| InputProcessorPort |
Java class for anonymous complex type.
|
| InputWorkflowPort |
Java class for anonymous complex type.
|
| IterationStrategyStack |
Java class for anonymous complex type.
|
| IterationStrategyStack.IterationStrategies |
Java class for anonymous complex type.
|
| ObjectFactory |
This object contains factory methods for each
Java content interface and Java element interface
generated in the org.apache.taverna.scufl2.xml package.
|
| OutputActivityPort |
Java class for anonymous complex type.
|
| OutputPortBinding |
Java class for OutputPortBinding complex type.
|
| OutputProcessorPort |
Java class for anonymous complex type.
|
| OutputWorkflowPort |
Java class for anonymous complex type.
|
| PortDepth |
Java class for anonymous complex type.
|
| PortNode |
Java class for anonymous complex type.
|
| PortNode.DesiredDepth |
Java class for anonymous complex type.
|
| Processor |
Java class for anonymous complex type.
|
| Processor.DispatchStack |
Java class for anonymous complex type.
|
| Processor.InputProcessorPort |
Java class for anonymous complex type.
|
| Processor.IterationStrategyStack |
Java class for anonymous complex type.
|
| Processor.OutputProcessorPort |
Java class for anonymous complex type.
|
| ProcessorBinding |
Java class for anonymous complex type.
|
| ProcessorBinding.ActivityPosition |
Java class for anonymous complex type.
|
| ProcessorBinding.InputPortBinding |
Java class for anonymous complex type.
|
| ProcessorBinding.OutputPortBinding |
Java class for anonymous complex type.
|
| ProductOf |
Java class for anonymous complex type.
|
| Profile |
Java class for anonymous complex type.
|
| ProfileDocument |
Java class for ProfileDocument complex type.
|
| Required |
Java class for anonymous complex type.
|
| SeeAlsoType |
Java class for SeeAlsoType complex type.
|
| Workflow |
Java class for anonymous complex type.
|
| Workflow.InputWorkflowPort |
Java class for anonymous complex type.
|
| Workflow.OutputWorkflowPort |
Java class for anonymous complex type.
|
| Workflow.Processor |
Java class for anonymous complex type.
|
| WorkflowBundle |
Java class for anonymous complex type.
|
| WorkflowBundle.Profile |
Java class for anonymous complex type.
|
| WorkflowBundle.Workflow |
Java class for anonymous complex type.
|
| WorkflowBundleDocument |
Java class for WorkflowBundleDocument complex type.
|
| WorkflowDocument |
Java class for WorkflowDocument complex type.
|
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.


To start, enter your gateway id below.


A Friends reunion is in the works
- Advertisement -
The Hollywood Reporter says a Friends reunion with the full cast and creators being part of it is in the works.
The hit TV series celebrates its 25th anniversary while insiders revealed that the six core stars and creators of the NBC comedy from Warner Bros. TV are in discussion to reunite on HBO Max.
The unscripted reunion special will feature Jennifer Aniston, Courteney Cox, Lisa Kudrow, Matt LeBlanc, Matthew Perry and David Schwimmer including series creators David Crane and Martha Kauffman.
However, the deal is far from done as details are still being ironed out. The challenge is to sort out everyone’s schedules once they complete the deals.
- Advertisement -
There is also a possibility that the talks might not work out and the whole thing could collapse.
When asked for comments, HBO Max and producers WBTV remained mum.
Friends found new audiences at its streaming on Netflix after the news of the reunion special.
At the end of the year, Friends will be leaving Netflix and will be available on WarnerMedia-backed HBO Max.
There has been no confirmation of the $15 monthly subscription platform launch date.
It has been reported that WarnerMedia reclaimed streaming rights to Friends for its own platform for $85 million per year for five years ($425 million).
WarnerMedia outbid Netflix and the streaming service paid $80 million to $100 million to keep Friends on the service for 2019.
Bob Greenblatt, WarnerMedia Entertainment and direct-to-consumer chairman have been the driving force pushing for the Friends reunion which will do well with HBO Max’s debut and the series’ new streaming home.
The fact that the cast is willing to do it is an accomplishment in itself.
Over the years, the cast and creators have remained steadfast that they would not do any sort of scripted revival since the series wrapped its 10-season run.
To honour legendary director and producer James Burrows, NBC staged a mini-Friends reunion in 2016.
Excluding Perry, five of the six stars were part of the show that also included stars from Will & Grace, Cheers and The Big Bang Theory.
On Oct 27, Aniston denied there will be a Friends reboot to TV host Ellen DeGeneres but said, “We would love for there to be something, but we don’t know what that something is. So we’re just trying. We’re working on something.”
The actress returned to television on Nov 1 on the premiere of Apple TV+’s The Morning Show.
It is her first TV series regular role since she completed Friends. Aniston acts opposite her Friends on-screen sister, Reese Witherspoon on The Morning Show.
She also just joined Instagram recently, uploading a photo of her and her Friends co-stars.
Warner Bros. TV, Friends producer has been busy celebrating the show’s 25th anniversary, with iconic pop-ups of Central Perk, replica couches places at landmarks around the world and special theatrical screenings of the beloved series.
Experts believe an upstart streaming service like HBO Max would do well with must-see TV series like a Friends reunion.
On Tuesday, Disney’s streaming service launched its highly expected Star Wars scripted drama The Mandalorian.
- Advertisement -


Register
First Name:
Last Name:
Male
Female
Other
Email:
Password:
Birthday:
Month
Jan
Feb
Mar
Day
1
2
3
Year
1994
1995
1996
I agree to the terms and conditions
Submmit


=da-2
VTrYa
(man) to copulate with (woman).
Recip:
=da:-'-nyji- VIntrI2 (man and woman) to make love.
(Entry on page 22 of printed dictionary)
=dalardalarga-
VTrA1
to confuse (concepts, names, etc.); to get (things) mixed up.
(Entry on page 22 of printed dictionary)
da:n
NcMana
guts (intestines, etc.).
Relative (genitive) form mana-da:n-jinyung 'of the guts' (i.e., 'of the womb') in specifying relationship between a person and his/her actual mother or mother's brother: 78.1.4.
Syn:
(Entry on page 23 of printed dictionary)
=da:ra-ja-
VTrNga1
to be anxious to get (something), to yearn or lust for (especially, someone else's property). Related to da:rawa. Cf. =nganybanda-, =w1anmarda-, w1andha-.
(Entry on page 23 of printed dictionary)
da:rawa
HumSg:
da:rawa-yung. P1: da-da:rawa.
Seems more common as insulting epithet than bagumid.
i-ngu-da:rawa
NAdj thieving, dishonest. 3.7.4. (with -ij-).
Cf:
(Entry on page 23 of printed dictionary)
dawal
NcMana
intersection of shaft of ax or tomahawk with stone axhead, where string is tied around shaft. 154.1.5.
Not used in connection with modern metal ax (waragu).
(Entry on page 23 of printed dictionary)
didid
NAdj
tight, firm (object).
Fact:
=didid-ga- VTrA1 to make (something) tight or firm.
Recip:
of Fact: =didid-ga-nyji- VIntrI2 to be/become tight or firm. (functions like Inchoative intransitive)
(Entry on page 23 of printed dictionary)
dirj!
Rf
to defecate (semionomatopoeic, cf. English 'plop!').
Related to verb =dirja-.
(Entry on page 23 of printed dictionary)
=dirja-
VIntrA2
to defecate (emphasises plopping sound). 132.3.3. Rf: dirj!. Syn: =da-.
(Entry on page 23 of printed dictionary)
du!
none
(sound of gun going off, cf. Eng. 'bang!'). 163.9.4.
(Entry on page 23 of printed dictionary)
=dugubadha-
(Eng. 'talk about')
VTrA2
to discuss (matter). 33.6.2.
(Entry on page 23 of printed dictionary)
=duma-
VIntrA1
to be/become dark-colored or black. 28.16.5.
Caus:
=dumi-jga- VTrA1 to make (something) dark or black.
NAdj derivative: du-duma-j (listed separately).
-janda-ngu=duma-
to have a black back. 11.12.4rdp. (crow).
-lhany-ngu=duma-
(wood) to be dark. 13.25.5. (-lhaj-).
-w1ara-ngu=duma-
to be dark or black (all over). 28.15.3.
Opposite:
(Entry on page 23 of printed dictionary)


Scene
The container for all 3D graphical objects and state in a xeogl scene.
Usage
- Creating a Scene
- Creating and accessing components
- Controlling the camera
- Taking snapshots
- Lighting
- Clipping
- Picking
- Querying and tracking boundaries
- Controlling the viewport
- Controlling rendering
- Gamma correction
Creating a Scene
Creating a Scene with its own default canvas:
var scene = new xeogl.Scene();
Creating a Scene with an existing canvas.
var scene2 = new xeogl.Scene({
canvas: "myCanvas"
});
var scene3 = new xeogl.Scene({
canvas: document.getElementById("myCanvas");
});
Creating and accessing components
As a brief introduction to creating Scene components, we'll create a Mesh that has a TeapotGeometry and a PhongMaterial:
var teapotMesh = new xeogl.Mesh(scene, {
id: "myMesh", // <<---------- ID automatically generated if not provided
geometry: new xeogl.TeapotGeometry(scene),
material: new xeogl.PhongMaterial(scene, {
id: "myMaterial",
diffuse: [0.2, 0.2, 1.0]
})
});
Creating a Mesh within the default Scene (xeogl will automatically create the default Scene if it does not yet exist):
var teapotMesh = new xeogl.Mesh({
id: "myMesh",
geometry: new xeogl.TeapotGeometry(),
material: new xeogl.PhongMaterial({
id: "myMaterial",
diffuse: [0.2, 0.2, 1.0]
})
});
teapotMesh.scene.camera.eye = [45, 45, 45];
The default Scene can be got from either the Mesh or the xeogl namespace:
scene = teapotMesh.scene;
scene = xeogl.getDefaultScene();
You can also make any Scene instance the default scene, so that components will belong to that Scene when you don't explicitly specify a Scene for them:
var scene = new xeogl.Scene({ ... };
xeogl.setDefaultScene( scene );
Find components by ID in their Scene's components map:
var teapotMesh = scene.components["myMesh"];
teapotMesh.visible = false;
var teapotMaterial = scene.components["myMaterial"];
teapotMaterial.diffuse = [1,0,0]; // Change to red
A Scene also has a map of component instances for each Component subtype:
var meshes = scene.types["xeogl.Mesh"];
var teapotMesh = meshes["myMesh"];
teapotMesh.ghosted = true;
var phongMaterials = scene.types["xeogl.PhongMaterial"];
var teapotMaterial = phongMaterials["myMaterial"];
teapotMaterial.diffuse = [0,1,0]; // Change to green
See Object, Group and Model for how to create and access more sophisticated content.
Controlling the camera
Use the Scene's Camera to control the current viewpoint and projection:
var camera = myScene.camera;
camera.eye = [-10,0,0];
camera.look = [-10,0,0];
camera.up = [0,1,0];
camera.projection = "perspective";
camera.perspective.fov = 45;
//...
Managing the canvas, taking snapshots
The Scene's Canvas component provides various conveniences relevant to the WebGL canvas, such as getting getting snapshots, firing resize events etc:
var canvas = scene.canvas;
canvas.on("boundary", function(boundary) {
//...
});
var imageData = canvas.getSnapshot({
width: 500,
height: 500,
format: "png"
});
Lighting
The Scene's Lights component manages lighting:
var lights = scene.lights;
lights[1].color = [0.9, 0.9, 0.9];
//...
Clipping
The Scene's Clips component manages clipping planes for custom cross-sections:
var clips = scene.clips;
clips.clips = [
new xeogl.Clip({ // Clip plane on negative diagonal
pos: [1.0, 1.0, 1.0],
dir: [-1.0, -1.0, -1.0],
active: true
}),
new xeogl.Clip({ // Clip plane on positive diagonal
pos: [-1.0, -1.0, -1.0],
dir: [1.0, 1.0, 1.0],
active: true
}),
//...
];
Picking
Use the Scene's Scene#pick() method to pick and raycast meshes.
For example, to pick a point on the surface of the closest mesh at the given canvas coordinates:
var hit = scene.pick({
pickSurface: true,
canvasPos: [23, 131]
});
if (hit) { // Picked a Mesh
var mesh = hit.mesh;
var primitive = hit.primitive; // Type of primitive that was picked, usually "triangles"
var primIndex = hit.primIndex; // Position of triangle's first index in the picked Mesh's Geometry's indices array
var indices = hit.indices; // UInt32Array containing the triangle's vertex indices
var localPos = hit.localPos; // Float32Array containing the picked Local-space position on the triangle
var worldPos = hit.worldPos; // Float32Array containing the picked World-space position on the triangle
var viewPos = hit.viewPos; // Float32Array containing the picked View-space position on the triangle
var bary = hit.bary; // Float32Array containing the picked barycentric position within the triangle
var normal = hit.normal; // Float32Array containing the interpolated normal vector at the picked position on the triangle
var uv = hit.uv; // Float32Array containing the interpolated UV coordinates at the picked position on the triangle
}
Pick masking
We can use the Scene#pick() method's includeMeshes
and excludeMeshes
options to mask which Meshes we attempt to pick.
This is useful for picking through things, to pick only the Meshes of interest.
To pick only Meshes "gearbox#77.0"
and "gearbox#79.0"
, picking through any other Meshes that are
in the way, as if they weren't there:
var hit = scene.pick({
canvasPos: [23, 131],
includeMeshes: ["gearbox#77.0", "gearbox#79.0"]
});
if (hit) {
// Mesh will always be either "gearbox#77.0" or "gearbox#79.0"
var mesh = hit.mesh;
}
To pick any pickable Mesh, except for "gearbox#77.0"
and "gearbox#79.0"
, picking through those
Meshes if they happen to be in the way:
var hit = scene.pick({
canvasPos: [23, 131],
excludeMeshes: ["gearbox#77.0", "gearbox#79.0"]
});
if (hit) {
// Mesh will never be "gearbox#77.0" or "gearbox#79.0"
var mesh = hit.mesh;
}
See Scene#pick() for more info on picking.
Querying and tracking boundaries
Getting a Scene's World-space axis-aligned boundary (AABB):
var aabb = scene.aabb; // [xmin, ymin, zmin, xmax, ymax, zmax]
Subscribing to updates to the AABB, which occur whenever Meshes are transformed, their Geometries have been updated, or the Camera has moved:
scene.on("boundary", function() {
var aabb = scene.aabb;
});
Getting the AABB of the Objects with the given IDs:
scene.getAABB(); // Gets collective boundary of all Mesh Objects in the scene
scene.getAABB("saw"); // Gets boundary of an Object
scene.getAABB(["saw", "gearbox"]); // Gets collective boundary of two Objects
See Scene#getAABB() and Object for more info on querying and tracking boundaries.
Managing the viewport
The Scene's Viewport component manages the WebGL viewport:
var viewport = scene.viewport
viewport.boundary = [0, 0, 500, 400];;
Controlling rendering
You can configure a Scene to perform multiple "passes" (renders) per frame. This is useful when we want to render the scene to multiple viewports, such as for stereo effects.
In the example, below, we'll configure the Scene to render twice on each frame, each time to different viewport. We'll do this with a callback that intercepts the Scene before each render and sets its Viewport to a different portion of the canvas. By default, the Scene will clear the canvas only before the first render, allowing the two views to be shown on the canvas at the same time.
// Load a glTF model
var model = new xeogl.GLTFModel({
src: "models/gltf/GearboxAssy/glTF-MaterialsCommon/GearboxAssy.gltf"
});
var scene = model.scene;
var viewport = scene.viewport;
// Configure Scene to render twice for each frame
scene.passes = 2; // Default is 1
scene.clearEachPass = false; // Default is false
// Render to a separate viewport on each render
var viewport = scene.viewport;
viewport.autoBoundary = false;
scene.on("rendering", function (e) {
switch (e.pass) {
case 0:
viewport.boundary = [0, 0, 200, 200]; // xmin, ymin, width, height
break;
case 1:
viewport.boundary = [200, 0, 200, 200];
break;
}
});
// We can also intercept the Scene after each render,
// (though we're not using this for anything here)
scene.on("rendered", function (e) {
switch (e.pass) {
case 0:
break;
case 1:
break;
}
});
Gamma correction
Within its shaders, xeogl performs shading calculations in linear space.
By default, the Scene expects color textures (eg. PhongMaterial#diffuseMap, MetallicMaterial#baseColorMap and SphericalMaterial#diffuseMap) to be in pre-multipled gamma space, so will convert those to linear space before they are used in shaders. Other textures are always expected to be in linear space.
By default, the Scene will also gamma-correct its rendered output.
You can configure the Scene to expect all those color textures to be linear space, so that it does not gamma-correct them:
scene.gammaInput = false;
You would still need to gamma-correct the output, though, if it's going straight to the canvas, so normally we would leave that enabled:
scene.gammaOutput = true;
See Texture for more information on texture encoding and gamma.
Constructor
Scene
-
[cfg]
Parameters:
-
[cfg]
Object optionalScene parameters
-
[id]
String optionalOptional ID, unique among all Scenes in xeogl, generated automatically when omitted.
-
[meta]
String:Object optionalOptional map of user-defined metadata to attach to this Scene.
-
[canvasId]
String optionalID of existing HTML5 canvas in the DOM - creates a full-page canvas automatically if this is omitted
-
[webgl2=true]
Boolean optionalSet this false when we don't want to use WebGL 2 for our Scene; the Scene will fall back on WebGL 1 if not available. This property will be deprecated when WebGL 2 is supported everywhere.
-
[components]
Array(Object) optionalJSON array containing parameters for Component subtypes to immediately create within the Scene.
-
[ticksPerRender=1]
Number optionalThe number of Scene/tick:event that happen between each render or this Scene.
-
[passes=1]
Number optionalThe number of times this Scene renders per frame.
-
[clearEachPass=false]
Boolean optionalWhen doing multiple passes per frame, specifies whether to clear the canvas before each pass (true) or just before the first pass (false).
-
[transparent=false]
Boolean optionalWhether or not the canvas is transparent.
-
[backgroundColor]
Float32Array optionalRGBA color for canvas background, when canvas is not transparent. Overridden by backgroundImage.
-
[backgroundImage]
String optionalURL of an image to show as the canvas background, when canvas is not transparent. Overrides backgroundImage.
-
[gammaInput=false]
Boolean optionalWhen true, expects that all textures and colors are premultiplied gamma.
-
[gammaOutput=true]
Boolean optionalWhether or not to render with pre-multiplied gama.
-
[gammaFactor=2.2]
Number optionalThe gamma factor to use when rendering with pre-multiplied gamma.
-
Index
Methods
Properties
- aabb
- camera
- canvas
- center
- clearEachPass
- clips
- components
- destroyed
- edgeMaterial
- entities
- entityIds
- entityTypeIds
- entityTypeIds
- entityTypes
- gammaInput
- gammaOutput
- gammaOutput
- geometry
- ghostedEntities
- ghostedEntityIds
- ghostMaterial
- guidObjects
- highlightedEntities
- highlightedEntityIds
- highlightMaterial
- id
- input
- lightMaps
- lights
- loading
- material
- meshes
- metadata
- model
- models
- objects
- outlineMaterial
- passes
- reflectionMaps
- rootObjects
- scene
- selectedEntities
- selectedEntityIds
- selectedMaterial
- ticksPerRender
- timeCreated
- type
- types
- viewport
- visibleEntities
- visibleEntityIds
Methods
clear
()
Resets this Scene to its default state.
References to any components in this Scene will become invalid.
clearLights
()
Convenience method that destroys all light sources.
Removes all AmbientLights, PointLights, DirLights and SpotLights.
create
-
[cfg]
Convenience method for creating a Component within this Component's Scene.
The method is given a component configuration, like so:
var material = myComponent.create({
type: "xeogl.PhongMaterial",
diffuse: [1,0,0],
specular: [1,1,0]
}, "myMaterial");
Parameters:
-
[cfg]
optionalConfiguration for the component instance.
Returns:
destroy
()
Destroys this component.
Fires a destroyed event on this Component.
Automatically disassociates this component from other components, causing them to fall back on any defaults that this component overrode on them.
TODO: describe effect with respect to #create
error
-
message
Logs an error for this component to the JavaScript console.
The console message will have this format: [ERROR] [<component type> =<component id>: <message>
Also fires the message as an error event on the parent Scene.
Parameters:
-
message
StringThe message to log
fire
-
event
-
value
-
[forget=false]
Fires an event on this component.
Notifies existing subscribers to the event, optionally retains the event to give to any subsequent notifications on the event as they are made.
Parameters:
-
event
StringThe event type name
-
value
ObjectThe event parameters
-
[forget=false]
Boolean optionalWhen true, does not retain for subsequent subscribers
getAABB
-
target
Returns the collective axis-aligned bounding box of the Objects, specified by their IDs, GUIDs and/or entity types.
When no arguments are given, returns the total boundary of all objects in the scene.
Only Meshes with collidable
set true
are included in the boundary.
Usage
scene.getAABB(); // Gets collective boundary of all objects in the scene
scene.getAABB("saw"); // Gets collective boundary of all objects in saw model
scene.getAABB(["saw", "gearbox"]); // Gets collective boundary of all objects in saw and gearbox models
scene.getAABB("saw#0.1"); // Get boundary of an object in the saw model
scene.getAABB(["saw#0.1", "saw#0.2"]); // Get collective boundary of two objects in saw model
scene.getAABB(["saw#0.1", "surface", "support"]); // Get collective boundary an object, and all objects of the given two entity classes.
Parameters:
-
target
String | String{Array} Array of Object IDs, GUIDs or entity types.
Returns:
An axis-aligned World-space bounding box, given as elements [xmin, ymin, zmin, xmax, ymax, zmax]
.
hasSubs
-
event
Returns true if there are any subscribers to the given event on this component.
Parameters:
-
event
StringThe event
Returns:
True if there are any subscribers to the given event on this component.
isType
-
type
Tests if this component is of the given type, or is a subclass of the given type.
The type may be given as either a string or a component constructor.
This method works by walking up the inheritance type chain, which this component provides in property Component/superTypes:property, returning true as soon as one of the type strings in the chain matches the given type, of false if none match.
Examples:
var myRotate = new xeogl.Rotate({ ... });
myRotate.isType(xeogl.Component); // Returns true for all xeogl components
myRotate.isType("xeogl.Component"); // Returns true for all xeogl components
myRotate.isType(xeogl.Rotate); // Returns true
myRotate.isType(xeogl.Transform); // Returns true
myRotate.isType("xeogl.Transform"); // Returns true
myRotate.isType(xeogl.Mesh); // Returns false, because xeogl.Rotate does not (even indirectly) extend xeogl.Mesh
Parameters:
-
type
String | FunctionComponent type to compare with, eg "xeogl.PhongMaterial", or a xeogl component constructor.
Returns:
True if this component is of given type or is subclass of the given type.
log
-
message
Logs a console debugging message for this component.
The console message will have this format: [LOG] [<component type> <component id>: <message>
Parameters:
-
message
StringThe message to log
off
-
subId
Cancels an event subscription that was previously made with Component#on() or Component#once().
Parameters:
-
subId
StringPublication subId
on
-
event
-
callback
-
[scope=this]
Subscribes to an event on this component.
The callback is be called with this component as scope.
Parameters:
-
event
StringThe event
-
callback
FunctionCalled fired on the event
-
[scope=this]
Object optionalScope for the callback
Returns:
Handle to the subscription, which may be used to unsubscribe with {@link #off}.
once
-
event
-
callback
-
[scope=this]
Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd.
This is equivalent to calling Component#on(), and then calling Component#off() inside the callback function.
Parameters:
-
event
StringData event to listen to
-
callback
Function(data)Called when fresh data is available at the event
-
[scope=this]
Object optionalScope for the callback
pick
-
params
Attempts to pick an Mesh in this Scene.
Ignores Meshes with pickable set false.
When a Mesh is picked, fires a "pick" event on the Mesh with the hit result as parameters.
Picking the Mesh at the given canvas coordinates:
var hit = scene.pick({
canvasPos: [23, 131]
});
if (hit) { // Picked a Mesh
var mesh = hit.mesh;
}
Usage:
Picking the Mesh that intersects a ray cast through the canvas:
var hit = scene.pick({
pickSurface: true,
canvasPos: [23, 131]
});
if (hit) { // Picked a Mesh
var mesh = hit.mesh;
// These properties are only on the hit result when we do a ray-pick:
var primitive = hit.primitive; // Type of primitive that was picked, usually "triangles"
var primIndex = hit.primIndex; // Position of triangle's first index in the picked Mesh's Geometry's indices array
var indices = hit.indices; // UInt32Array containing the triangle's vertex indices
var localPos = hit.localPos; // Float32Array containing the picked Local-space position on the triangle
var worldPos = hit.worldPos; // Float32Array containing the picked World-space position on the triangle
var viewPos = hit.viewPos; // Float32Array containing the picked View-space position on the triangle
var bary = hit.bary; // Float32Array containing the picked barycentric position within the triangle
var normal = hit.normal; // Float32Array containing the interpolated normal vector at the picked position on the triangle
var uv = hit.uv; // Float32Array containing the interpolated UV coordinates at the picked position on the triangle
}
Picking the Mesh that intersects an arbitrarily-aligned World-space ray:
var hit = scene.pick({
pickSurface: true, // Picking with arbitrarily-positioned ray
origin: [0,0,-5], // Ray origin
direction: [0,0,1] // Ray direction
});
if (hit) { // Picked a Mesh with the ray
var mesh = hit.mesh;
var primitive = hit.primitive; // Type of primitive that was picked, usually "triangles"
var primIndex = hit.primIndex; // Position of triangle's first index in the picked Mesh's Geometry's indices array
var indices = hit.indices; // UInt32Array containing the triangle's vertex indices
var localPos = hit.localPos; // Float32Array containing the picked Local-space position on the triangle
var worldPos = hit.worldPos; // Float32Array containing the picked World-space position on the triangle
var viewPos = hit.viewPos; // Float32Array containing the picked View-space position on the triangle
var bary = hit.bary; // Float32Array containing the picked barycentric position within the triangle
var normal = hit.normal; // Float32Array containing the interpolated normal vector at the picked position on the triangle
var uv = hit.uv; // Float32Array containing the interpolated UV coordinates at the picked position on the triangle
var origin = hit.origin; // Float32Array containing the World-space ray origin
var direction = hit.direction; // Float32Array containing the World-space ray direction
}
Parameters:
-
params
Picking parameters.
-
[pickSurface=false]
Boolean optionalWhether to find the picked position on the surface of the Mesh.
-
[canvasPos]
Float32Array optionalCanvas-space coordinates. When ray-picking, this will override the origin and direction parameters and will cause the ray to be fired through the canvas at this position, directly along the negative View-space Z-axis.
-
[origin]
Float32Array optionalWorld-space ray origin when ray-picking. Ignored when canvasPos given.
-
[direction]
Float32Array optionalWorld-space ray direction when ray-picking. Also indicates the length of the ray. Ignored when canvasPos given.
-
[includeMeshes]
Array optional -
[excludeMeshes]
Array optional
-
Returns:
Hit record, returned when an Mesh is picked, else null. See method comments for description.
render
-
[forceRender=false]
Renders a single frame of this Scene.
The Scene will periodically render itself after any updates, but you can call this method to force a render if required. This method is typically used when we want to synchronously take a snapshot of the canvas and need everything rendered right at that moment.
Parameters:
-
[forceRender=false]
Boolean optionalForces a render when true, otherwise only renders if something has changed in this Scene since the last render.
setColorize
-
ids
-
[colorize=(1,1,1)]
Colorizes a batch of Objects, specified by their IDs, GUIDs and/or entity types.
setEdges
-
ids
-
edges
Shows or hides wireeframe edges for batch of Objects, specified by their IDs, GUIDs and/or entity types.
Parameters:
-
ids
ArrayArray of Object IDs, GUIDs or entity types.
-
edges
Float32ArrayWhether to show or hide edges.
Returns:
True if any Objects changed edges state, else false if all updates were redundant and not applied.
setGhosted
-
ids
-
ghosted
Ghosts or un-ghosts a batch of Objects, specified by their IDs, GUIDs and/or entity types.
Each Object indicates its ghosted status in its ghosted property.
Each ghosted Object is registered in the Scene's ghostedEntities map when its entityType is assigned a value.
Parameters:
-
ids
ArrayArray of Object IDs, GUIDs or entity types.
-
ghosted
Float32ArrayWhether to ghost or un-ghost.
Returns:
True if any Objects changed ghosted state, else false if all updates were redundant and not applied.
setHighlighted
-
ids
-
highlighted
Highlights or de-highlights a batch of Objects, specified by their IDs, GUIDs and/or entity types.
Each Object indicates its highlight status in its highlighted property.
Each highlighted Object is registered in the Scene's highlightedEntities map while its entityType is assigned a value.
Parameters:
-
ids
ArrayArray of Object IDs, GUIDs or entity types.
-
highlighted
BooleanWhether to highlight or un-highlight.
Returns:
True if any Objects changed highlighted state, else false if all updates were redundant and not applied.
setOpacity
-
ids
-
[opacity=1]
Updates opacities of a batch of Objects, specified by their IDs, GUIDs and/or entity types.
setOutlined
-
ids
-
outlined
Shows or hides an outline around a batch of Objects, specified by their IDs, GUIDs and/or entity types.
Each Object indicates its outlined status in its outlined property.
Each outlined Object is registered in the Scene's Scene/outlinedEntities:property map when its entityType is assigned a value.
Parameters:
-
ids
ArrayArray of Object IDs, GUIDs or entity types.
-
outlined
Float32ArrayWhether to show or hide the outline.
Returns:
True if any Objects changed outlined state, else false if all updates were redundant and not applied.
setPickable
-
ids
-
pickable
Sets a batch of Objects pickable or unpickable, specified by their IDs, GUIDs and/or entity types.
Picking is done via calls to Scene#pick().
Parameters:
-
ids
ArrayArray of Object IDs, GUIDs or entity types.
-
pickable
Float32ArrayWhether to ghost or un-ghost.
Returns:
True if any Objects changed pickable state, else false if all updates were redundant and not applied.
setSelected
-
ids
-
selected
Selects or de-selects a batch of Objects, specified by their IDs, GUIDs and/or entity types.
Each Object indicates its selected status in its selected property.
Each selected Object is registered in the Scene's selectedEntities map while its entityType is assigned a value.
Parameters:
-
ids
ArrayArray of Object IDs, GUIDs or entity types.
-
selected
BooleanWhether to select or deselect.
Returns:
True if any Objects changed selection state, else false if all updates were redundant and not applied.
setVisible
-
ids
-
culled
Culls or unculls a batch of Objects, specified by their IDs, GUIDs and/or entity types.
Each Object indicates its culled status in its Object/visibility:property property.
Parameters:
-
ids
ArrayArray of Object IDs, GUIDs or entity types.
-
culled
BooleanThe new cull state.
Returns:
True if any Objects changed culled state, else false if all updates were redundant and not applied.
setVisible
-
ids
-
visible
Shows or hides a batch of Objects, specified by their IDs, GUIDs and/or entity types.
Each Object indicates its visibility status in its Object/visibility:property property.
Each visible Object is registered in the Scene's visibleEntities map while its entityType is assigned a value.
Parameters:
-
ids
ArrayArray of Object IDs, GUIDs or entity types.
-
visible
BooleanThe new visibility state.
Returns:
True if any Objects changed visibility, else false if all updates were redundant and not applied.
warn
-
message
Logs a warning for this component to the JavaScript console.
The console message will have this format: [WARN] [<component type> =<component id>: <message>
Parameters:
-
message
StringThe message to log
Properties
aabb
Float32Array
final
World-space axis-aligned 3D boundary (AABB) of this Scene.
The AABB is represented by a six-element Float32Array containing the min/max extents of the
axis-aligned volume, ie. [xmin, ymin,zmin,xmax,ymax, zmax]
.
center
Float32Array
final
World-space 3D center of this Scene.
clearEachPass
Boolean
When doing multiple passes per frame, specifies whether to clear the canvas before each pass (true) or just before the first pass (false).
Default: false
destroyed
Boolean
True as soon as this Component has been destroyed
edgeMaterial
EdgeMaterial
final
The Scene's default EmphasisMaterial for the appearance of Meshes when edges are emphasized.
This EdgeMaterial has an id equal to "default.edgeMaterial", with all other properties initialised to their default values.
Meshes in this Scene are attached to this EdgeMaterial by default.
entities
String:Object
final
Objects in this Scene that have entity types, mapped to their IDs.
Each Object is registered in this map when its entityType is assigned a value.
entityTypes
String:{String:xeogl.Component}
final
For each entity type, a map of IDs to Objects of that entity type.
Each Object is registered in this map when its entityType is assigned a value.
gammaInput
Boolean
When true, expects all textures and colors are premultiplied gamma.
Default: false
gammaOutput
Boolean
Whether or not to render pixels with pre-multiplied gama.
Default: true
gammaOutput
Number
The gamma factor to use when Scene/property:gammaOutput is set true.
Default: 1.0
geometry
BoxGeometry
final
The default geometry for this Scene, which is a BoxGeometry.
This BoxGeometry has an id equal to "default.geometry".
Meshes in this Scene are attached to this Geometry by default.
ghostedEntities
String:Object
final
Ghosted entity Objects within this Scene, mapped to their IDs.
Each Object is registered in this map when its ghosted property is true and its entityType is assigned a value.
ghostMaterial
EmphasisMaterial
final
The Scene's default EmphasisMaterial for the appearance of Meshes when they are ghosted.
This EmphasisMaterial has an id equal to "default.ghostMaterial", with all other properties initialised to their default values.
Meshes in this Scene are attached to this EmphasisMaterial by default.
guidObjects
String:Object
final
highlightedEntities
String:Object
final
Highlighted entity Objects within this Scene, mapped to their IDs.
Each Object is registered in this map when its highlighted property is true and its entityType is assigned a value.
highlightMaterial
HighlightMaterial
final
The Scene's default EmphasisMaterial for the appearance of Meshes when they are highlighted.
This HighlightMaterial has an id equal to "default.highlightMaterial", with all other properties initialised to their default values.
Meshes in this Scene are attached to this HighlightMaterial by default.
lights
String:Object
final
The PointLight, DirLight, SpotLight and AmbientLight components in this Scene, mapped to their IDs.
loading
Number
final
The number of models currently loading.
material
PhongMaterial
final
The default drawing material for this Scene, which is a PhongMaterial.
This PhongMaterial has an id equal to "default.material", with all other properties initialised to their default values.
Meshes in this Scene are attached to this PhongMaterial by default.
model
Model
final
The Model which contains this Component, if any.
Will be null if this Component is not in a Model.
outlineMaterial
OutlineMaterial
final
The Scene's default OutlineMaterial for the appearance of Meshes when they are outlined.
This OutlineMaterial has an id equal to "default.outlineMaterial", with all other properties initialised to their default values.
Meshes in this Scene are attached to this OutlineMaterial by default.
passes
Number
The number of times this Scene renders per frame.
Default: 1
reflectionMaps
String:ReflectionMap
final
The ReflectionMap components in this Scene, mapped to their IDs.
selectedEntities
String:Object
final
Selected entity Objects within this Scene, mapped to their IDs.
Each Object is registered in this map when its selected property is true and its entityType is assigned a value.
selectedMaterial
SelectedMaterial
final
The Scene's default EmphasisMaterial for the appearance of Meshes when they are selected.
This SelectedMaterial has an id equal to "default.selectedMaterial", with all other properties initialised to their default values.
Meshes in this Scene are attached to this SelectedMaterial by default.
ticksPerRender
Number
The number of Scene/tick:property that happen between each render or this Scene.
Default: 1
timeCreated
Number
final
The epoch time (in milliseconds since 1970) when this Scene was instantiated.
type
String
final
JavaScript class name for this Component.
For example: "xeogl.AmbientLight", "xeogl.MetallicMaterial" etc.
types
String:{String:xeogl.Component}
final
For each Component type, a map of IDs to Components instances of that type.
visibleEntities
String:Object
final
Visible entity Objects within this Scene, mapped to their IDs.
Each Object is registered in this map when its visible property is true and its entityType is assigned a value.
Events
destroyed
Fired when this Component is destroyed.
error
Fired whenever an error is logged on a component within this Scene.
Event Payload:
-
value
StringThe error message
log
Fired whenever a debug message is logged on a component within this Scene.
Event Payload:
-
value
StringThe debug message
rendering
Fired when about to render a frame for a Scene.
Event Payload:
-
sceneID
StringThe ID of this Scene.
-
pass
NumberIndex of the pass we are about to render (see passes).
rendering
Fired when we have just rendered a frame for a Scene.
Event Payload:
-
sceneID
StringThe ID of this Scene.
-
pass
NumberIndex of the pass we rendered (see passes).
warn
Fired whenever a warning is logged on a component within this Scene.
Event Payload:
-
value
StringThe warning message


--- layout: post title: Why Learning Sight Words is Important date: 2010-03-20 12:28:05.000000000 -07:00 type: post parent_id: '0' published: true pd: '' status: publish categories: - Classroom Talk - Reading Instruction - Sight words vs. Phonics tags: - early childhood - reading - Sight words vs. Phonics author: login: k email: k@k display_name: mcary first_name: '' last_name: '' ---
I think that it is very important that parents and teachers of reading embrace the idea that the more strategies a beginning reader has, the faster the learning process will be. To quote from the Journal of Educational Research:
The most convincing rationale for teaching sight words is that if they are well selected they will, because of their high frequency in printed materials, have high utility at all levels of reading development. Furthermore, they help to make possible a focus on meaning as well as decoding in early reading, and at the same time they can serve as a basis for analytic phonics instruction.
Knowing a few words in a new book provides confidence for an early reader. If a child sees a few words in a new book that he/she is certain of, the task of reading seems easier. When an emergent reader is reading a new book and pointing to each word, sight words that he knows provide a base for making sense of the text.
Many of the words that are repeated over and over again in beginning reading books do not follow the rules of phonics. Words like the, said, come, and of, would all be pronounced differently if a pure phonics application was utilized. Other words on a sight word list, even if spelled phonetically, help children decode new words by applying phonetic rules. For example, if in is a learned sight word, it will be easier for a new reader to decode pin, tin, fin, and even pan, tan and fan. Children learn that by manipulating the beginning and ending sound they can change the word.
An age appropriate sight words list should be taught in conjunction with phonics to provide new readers another strategy to help them learn to read.


See what has changes between two versions of a document
Analyse
Insert two versions of you text and then press the "Analyse" button. Red markings are text that has been removed and green markings are text that has been added


Using SQLite?
Which geometry should you use?
By Jamie Phillips, GISi
Image credits: xkcd
SQL Injection PSA: Bobby-Tables.com
What's the big deal?
Geometry Storage Options
How I did it
Image credits: flickr/chrisjrn/4291194192
About the data used
- Addresses
- Streets
- Jurisdictions
Disk usage
| Type |
Empty |
With Data |
| FileGdb |
121 KB |
52.8 MB |
| Sqlite(Esri) |
7 KB |
60.3 MB |
| Spatialite |
4.2 MB |
76.5 MB |
File Geodatabase
| Type |
Creation |
Loading Points |
Loading Lines |
Loading Polygons |
Select By Attributes |
Clip |
| FileGdb |
8.4 |
46.4 |
14.1 |
7.8 |
11.4 |
23.4 |
SQLite(Esri)
| Type |
Creation |
Loading Points |
Loading Lines |
Loading Polygons |
Select By Attributes |
Clip |
| FileGdb |
8.4 |
46.4 |
14.1 |
7.8 |
11.4 |
23.4 |
| Sqlite(Esri) |
5.2 |
1125.9 |
114.7 |
8.4 |
8.5 |
38.3 |
Spatialite
| Type |
Creation |
Loading Points |
Loading Lines |
Loading Polygons |
Select By Attributes |
Clip |
| FileGdb |
8.4 |
46.4 |
14.1 |
7.8 |
11.4 |
23.4 |
| Sqlite(Esri) |
5.2 |
1125.9 |
114.7 |
8.4 |
8.5 |
38.3 |
| Spatialite |
8.7 |
1200.8 |
158.5 |
7.6 |
8.5 |
38 |
So, which geometry should you use?
It's all on Github
Image credits: Github


IMAP clients such as Mulberry have the ability to mark a set of mailboxes as subscribed mailboxes. The IMAP client can send a specific request to the IMAP server to get the list of subscribed mailboxes. It is up to the IMAP client to decide how to present this subscribed mailbox list to you. Mulberry makes use of the subscribed mailboxes feature to allow you to create a set of mailboxes that always appear at the top of the mailbox list in each IMAP account, immediately below the INBOX entry. This is useful if you have a set of mailboxes that you frequently use and want quick access to in the server window.
The subscribed list appears in the server pane's mailbox list with the following icon next to it:
To add a mailbox to the subscribed list, select the mailbox and then choose the Subscribe command in the Mailbox menu.
To remove a mailbox from the subscribed list, select the mailbox and then choose the Unsubscribe command in the Mailbox menu.


#{docsController.tag.description}
See Tab for documentation of item attributes.
onItemChange
is called as a tab is activated and the content is loaded.
The callback receives the item element representing the activated item.
tabChange
will be called when an tab item is toggled.
The listener will be called with an instance of
io.tornadofaces.event.TabChangeEvent
that contains a reference to the new active item and the accordion.
You can also attach the ajax event
activate
to a tab, so that the listener will be executed
only when that tab is activated.activate
is the default ajax event name for tabs.
Widget: TornadoFaces.widget.Accordion
| Method | Params | Return type | Description |
|---|---|---|---|
| select(index) | index: Index of the item to select | boolean | Activate or toggle the selected item. Returns true if the selected item was activated, false if it was closed. |


Women Without Borders
Edit Schlaffer is a social scientist, writer, activist and holds a PhD from the University of Vienna. In 2002 she founded Women Without Borders.
Women Without Borders is an advocacy and research organisation for women around the globe. It brings together courageous and determined women to create a new female security paradigm, i.e. empowering women to counter violent extremism. They advocate for "a future without fear, suppression and violence." The organisation encourages women to become active participants in their communities, to co-shape their present and their future. Women Without Borders promotes the role of women in the security sphere and sensitises mothers in particular to their role and responsibility to challenge violent extremist ideologies.
Women Without Borders is based in Vienna, Austria.
Go to their website or Twitter to find out more about current projects.


Lesson Objectives
The objectives for this lesson are that by the end of the week you will be able to
- LOFor08: identify the important scaling relationships in Newton's law of gravity.
- LOFor09: note some differences between Newton's theory and Einstein's theory of General Relativity
- LOFor10: explain how gravity influences satellites, orbits, and weight
- LOPW13: describe the Doppler effect.
- LOCos01: identify and name different orbits around the Earth
NewsFlash
The detection of gravitational waves!
\Advanced LIGO and Gravitational Waves\
\Press Release of the first direct detection!\
Since this first detection - there have been 3 more published detections, the most recent wave detected was Aug 14, 2017. And the excitement is continuing!


Arctic climate change ice project sea oil marine activities ACCESS impacts economic Ocean development management gas likely changes future particular shipping {border-style like data governance human px;} #ffffff;} Ambio Climate European Sea different local natural observations global infrastructure resource spatial impact indigenous uncertainties environmental increase Barents Research example fisheries international new pollution potential production sea-ice used Crépin direct emissions important influence policy research ./s--- Arctic. Science Union developments extraction high ocean resources results scientific socio-economic Marine challenges complex conditions current fishing include increased need planning waters ACCESS. air areas better fish large national possible seasonal sectors ships species spill sustainable weather (Crépin Environmental Gascard International University developed ecosystem existing higher http://www.access-eu.org/en/deliverables/wp.html. improve including integrated issues provide px; related risk scenarios {font-family (Gascard (NERC (e.g., Arctic, Council Deliverable However, Norwegian Report Stockholm benefits capacity ecosystem-based example, expected extent font-size food fuel gaps interactions key knowledge model observing polar price regulations summer support time tools water (Arctic Atlantic Economics Evans Folke Geophysical Institute Petrick Polar Society Yamal account adaptive address appropriate aspects associated available based costs crab cultural decision demand despite double; essential help lack levels make market models offshore predictions reduction response risks services ship simulations stock substantial system, tool uncertainty (Edwards (Law Change, Economy ICES National New [], addition aquaculture atmospheric border-color border-width capabilities capelin carbon change, coastal compared contributions distribution dynamics effects facilities general ice, ice-covered information live main making markets material needs numerical overview pan-Arctic projects provided provision range recent regional resilience safety shipping, significant social social–ecological solid; sources special state supplementary temporal terms thickness traditional understanding using variability {font-style {font-weight (Eide (Petrick ./GL Asia Cambridge Canada Council. Europe Framework Governance Karcher Letters Management NSR Oziel Paralithodes Resource Wilkinson acidification act actual addition, agreement agreements approach area assess bold change. combined compensation conditions, context cooperation cost countries courier; cross-sectoral currently damage decades. decrease does e.g., ecosystems em; environment environment, estimates factors fishery fluctuations following forecast forecasting forecasts framework good grid.. however, improved industry issue king larger lead leading limited living long low mainly major modelling multiple north northern options particular, particularly parts period physical project, provides pt;} questions red reduced references regarding regimes regulatory requires role routes science set specific spills standards stocks studies suggest system. taking temperature tipping tourism tourism, transportation transportation, trigger trophic understand warming way world


Induction
Starting as a designer in government
Information and resources for designers new to government.
Last updated: 10 August 2016
Page contents:
What you're part of
There are over 300 designers in government. All the designers are part of a design community.
The design community supports everyone who's designing public services to make them usable, accessible and consistent for users.
10 heads of design in departments across government and GDS's design team lead the community.
How we do things
Design in government is user-centred. This means that every design decision should be based on user needs, and those user needs should all come from user research.
Designers should follow these 10 design principles.
Prototyping
GOV.UK prototype kit provides a simple way to make interactive prototypes that look like pages on GOV.UK.
Use prototypes to show ideas to anyone you work with, and test those ideas with users.
Use our tested patterns when you're building your service, for example, addresses in forms or how to ask users about gender and sex.
Reusing these patterns will save you time and effort, for example when you're working on problems which someone has already solved.
Design training
GDS provide training for designers in government. You can get 3 days of training - sessions are held every 6 weeks at GDS in London.
Training includes talks, introductions and practical skills.
Talks:
- the role of design in government
- designing in an agile team
- case studies
Introductions to:
- user research
- service design
- interaction design
- graphic design
- content design
- accessibility
Practical skills:
- prototyping
- journey mapping
- design crits
The third day is dedicated to HTML prototyping - you'll learn how to use the GOV.UK Prototyping Kit.
Find out more about the training, email<EMAIL_ADDRESS>Get involved
Use any of the following to get advice, discuss work or share ideas:
Department will have their own slack channels and self-organised communities. Speak to your head of design to find out more.
Go to design meet ups
You should go to the designers in government meet ups. These happen every 8 weeks in different cities across the UK.
You can get all of the following from design meet ups:
- updates from heads of design and GDS
- show and tells from service teams
- guest speakers from outside government
- time to hang out with other designers
The next meeting is on 6 September 2016 in Leeds.
Useful links
Resources:
Blogs:
Blogposts:


public class User extends ElasticStorable implements Observable
LoggedInUser
, who represents the current user of the app on a particular device.
This class mainly acts as a container for all of the various classes that make up a user.
In the system, a user has a list of Friends
contained
in a FriendsList
, a TrackedFriendsList
for their
tracked friends, an Inventory
which contains the
Trinkets
they own and want to be available
for trading, a NotificationManager
to notify them if another user wishes to
trade with them, a TradeManager
to handle their trades with their friends, and
a user profile which stores and displays their information.| Modifier and Type | Field and Description |
|---|---|
protected FriendsList |
friendsList |
protected Inventory |
inventory |
protected java.lang.Boolean |
needToSave |
protected NotificationManager |
notificationManager |
protected UserProfile |
profile |
protected TrackedFriendsList |
trackedFriendsList |
protected TradeManager |
tradeManager |
| Constructor and Description |
|---|
User()
Public constructor for user: initializes all attribute classes as empty classes with no
active data.
|
User(FriendsList friendsList,
Inventory inventory,
NotificationManager notificationManager,
UserProfile profile,
TrackedFriendsList trackedFriends,
TradeManager tradeManager)
A public constructor for User in the case where the user's details are known for all its
attribute classes.
|
User(java.lang.String email)
Constructor that uses the email a user enters to register in the
LoginActivity . |
| Modifier and Type | Method and Description |
|---|---|
void |
addObserver(java.util.Observer observer)
Adds the specified observer to the list of observers.
|
void |
deleteObserver(java.util.Observer observer)
Removes the specified observer from the list of observers.
|
android.location.Location |
getDefaultLocation()
Returns the default location specifying where a trinket is located.
|
FriendsList |
getFriendsList()
Returns User's
FriendsList . |
void |
getFromNetwork() |
<T extends ElasticStorable> |
getFromNetwork(java.lang.Class<T> type)
Attempts to find this object on the elasticsearch server.
|
Inventory |
getInventory()
Returns user's
Inventory . |
java.lang.Boolean |
getNeedToSave()
Returns a boolean indicating if the
User with this
contact information needs to be saved to the network. |
NotificationManager |
getNotificationManager()
Returns user's
NotificationManager . |
UserProfile |
getProfile()
Returns user's UserProfile, which is an object containing the information about a user and settings
for their account.
|
java.lang.String |
getResourceUrl()
Returns the base URL each class of ElasticStorable object will be saved to.
|
java.lang.String |
getSearchUrl()
Returns the base URL each class of ElasticStorable object can be searched on the server with.
|
java.lang.String |
getTag()
Returns the tag section of the elastic search entry's URL.
|
TrackedFriendsList |
getTrackedFriendsList()
Returns user's
TrackedFriendsList . |
TradeManager |
getTradeManager()
Returns user's
TradeManager . |
java.lang.String |
getUid()
* Returns a unique ID for each user's objects being stored to Elastic Search.
|
void |
notifyObservers()
If
hasChanged() returns true , calls the update()
method for every observer in the list of observers using null as the
argument. |
<T extends ElasticStorable> |
onGetResult(T result)
Method called after getFromNetwork gets a response.
|
<T extends ElasticStorable> |
onSearchResult(java.util.Collection<T> result)
Method called after searchOnNetwork gets a response.
|
<T extends ElasticStorable> |
searchOnNetwork(java.util.ArrayList<org.apache.http.NameValuePair> postParameters,
java.lang.Class<T> type)
Searches for ElasticStorable objects on the network matching the attribute and attribute
value pairs.
|
void |
setDefaultLocation(android.location.Location defaultLocation)
Sets the default location specifying where a trinket is located.
|
void |
setEmail(java.lang.String email)
Sets the user's email address.
|
void |
setFriendsList(FriendsList friendsList)
Sets User's
FriendsList . |
void |
setInventory(Inventory inventory)
Sets user's
Inventory . |
protected void |
setNeedToSave(java.lang.Boolean needToSave)
Sets a boolean indicating if the
User with this
contact information needs to be saved to the network. |
void |
setNotificationManager(NotificationManager notificationManager)
Sets user's
NotificationManager . |
void |
setProfile(UserProfile profile)
Sets user's
UserProfile , which is an object containing the information about a user and settings
for their account. |
void |
setTrackedFriends(TrackedFriendsList trackedFriendsList)
Sets user's
TrackedFriendsList . |
void |
setTradeManager(TradeManager tradeManager)
Sets user's
TradeManager . |
deleteFromNetwork, saveToNetwork
protected java.lang.Boolean needToSave
protected FriendsList friendsList
protected Inventory inventory
protected NotificationManager notificationManager
protected TrackedFriendsList trackedFriendsList
protected TradeManager tradeManager
protected UserProfile profile
public User()
public User(FriendsList friendsList, Inventory inventory, NotificationManager notificationManager, UserProfile profile, TrackedFriendsList trackedFriends, TradeManager tradeManager)
friendsList
- - a FriendsList of the user's friendsinventory
- - the user's Inventory with their trinketsnotificationManager
- - a notification manager to notify the user if a new trade has been offered to themprofile
- - a profile storing their informationtrackedFriends
- - a FriendsList which stores the Friends the user wishes to tracktradeManager
- - a TradeManager for handling the user's tradespublic User(java.lang.String email)
LoginActivity
.
This email is then used to initialize their TradeManager. All other user attributes are initialized
as empty. This constructor is used when a new user logs in for the first time, as there is no information
in the system about the user except the email they entered to register. By default a new user needs to be saved to
the network, so the needToSave attribute is set to true.email
- - the user's email address. Taken from the email they enter into the LoginActivitypublic void addObserver(java.util.Observer observer)
addObserver
in interface Observable
observer
- the Observer to add.public void deleteObserver(java.util.Observer observer)
deleteObserver
in interface Observable
observer
- the observer to remove.public void notifyObservers()
hasChanged()
returns true
, calls the update()
method for every observer in the list of observers using null as the
argument. Afterwards, calls clearChanged()
.
Equivalent to calling notifyObservers(null)
.notifyObservers
in interface Observable
public java.lang.Boolean getNeedToSave()
User
with this
contact information needs to be saved to the network. If the contact information of the user has
been changed then needToSave is set to true and the user needs to be saved. Otherwise, this should
return false indicating that the user does not need to be saved.protected void setNeedToSave(java.lang.Boolean needToSave)
User
with this
contact information needs to be saved to the network. If the contact information of the user has
been changed then needToSave should be set to true meaning the user needs to be saved. Otherwise, this should
be set to false indicating that the user does not need to be saved.public java.lang.String getTag()
User
. Implementation of the ElasticStorable
method.getTag
in class ElasticStorable
public java.lang.String getResourceUrl()
User
objects. Implementation of the
ElasticStorable
method.getResourceUrl
in class ElasticStorable
public java.lang.String getUid()
ElasticStorable
method.getUid
in class ElasticStorable
public <T extends ElasticStorable> void searchOnNetwork(java.util.ArrayList<org.apache.http.NameValuePair> postParameters, java.lang.Class<T> type) throws java.io.IOException
searchOnNetwork
in class ElasticStorable
postParameters
- pairs of attributes to use when searchingtype
- java.io.IOException
public <T extends ElasticStorable> void getFromNetwork(java.lang.Class<T> type) throws java.io.IOException
getResourceUrl()
) and an ID
unique to the user associated with the object (getUid()
). Implementation of the
ElasticStorable
method.getFromNetwork
in class ElasticStorable
T
- - type may be of any class extending ElasticStorabletype
- - class of the object being savedjava.io.IOException
public <T extends ElasticStorable> void onGetResult(T result)
ElasticStorable
method.
When a User is retrieved from the network, a new User object is created and its attributes
are set to the data returned by elastic search. This is used when a user with data existing on
the server logs in again, so that their data and setting from previous uses of the system is
restored.onGetResult
in class ElasticStorable
T
- type passed to getFromNetworkresult
- result of getFromNetwork, a User objectpublic <T extends ElasticStorable> void onSearchResult(java.util.Collection<T> result)
ElasticStorable
method. Current app functionality does not require
searching for users.onSearchResult
in class ElasticStorable
result
- result of searchOnNetworkpublic UserProfile getProfile()
public void setProfile(UserProfile profile)
UserProfile
, which is an object containing the information about a user and settings
for their account. This method is called after an existing user's data is pulled off the network, so
that the user's existing details are repopulated. After setting this field then needToSave is set to
true so that the change will be saved to the network.profile
- public void setTrackedFriends(TrackedFriendsList trackedFriendsList)
TrackedFriendsList
. This method is called after an existing user's data
is pulled off the network, so that the user's existing details are repopulated. After setting this field then
needToSave is set to true so that the change will be saved to the network. The list may be empty.
\ *trackedFriendsList
- - an user's TrackedFriendsListpublic TrackedFriendsList getTrackedFriendsList()
TrackedFriendsList
. This method is used to populate
which friends are displayed in the
TrackedFriendsListActivity
.
The list may be empty.public FriendsList getFriendsList()
FriendsList
. This method is used to populate
the friends displayed in the FriendsListActivity
.
The list may be empty.public void setFriendsList(FriendsList friendsList)
FriendsList
. This method is called after an existing user's data
is pulled off the network, so that the user's existing details are repopulated. After setting this field then
needToSave is set to true so that the change will be saved to the network. The list may be empty.friendsList
- - a user's FriendsListpublic Inventory getInventory()
Inventory
. This method is used to populate
the trinkets displayed in the InventoryActivity
.
The Inventory may be empty.public void setInventory(Inventory inventory)
Inventory
. This method is called after an existing user's data
is pulled off the network, so that the user's existing details are repopulated. After setting this field then
needToSave is set to true so that the change will be saved to the network. The Inventory may be empty.inventory
- - a list of the Trinkets a user has added to their accountpublic NotificationManager getNotificationManager()
NotificationManager
. This method is used to get the NotificationManager
object that handles notifications of new trades for the user, displayed in
TradesActivity
.public void setNotificationManager(NotificationManager notificationManager)
NotificationManager
. This method is called after an existing user's data
is pulled off the network, so that the user's existing details are repopulated.notificationManager
- - object holding and managing notifications for the user about new tradespublic TradeManager getTradeManager()
TradeManager
. This method is used to get the TradeManager
object that manages the trades a user is engaged in with other users, and the records of the user's
previous trades.public void setTradeManager(TradeManager tradeManager)
TradeManager
. This method is called after an existing user's data
is pulled off the network, so that the user's existing details are repopulated.tradeManager
- public java.lang.String getSearchUrl()
User
objects, and then followed
by "/_search/".getSearchUrl
in class ElasticStorable
public android.location.Location getDefaultLocation()
Trinket's
location will be set to by default.public void setDefaultLocation(android.location.Location defaultLocation)
defaultLocation
- - the location that a Trinket's
location will be set to by default.public void setEmail(java.lang.String email)
LoginActivity
and logs in for the first time.email
- - the user's email address they enter to log inpublic void getFromNetwork() throws java.io.IOException
java.io.IOException


a abet
EXPERIMENTAL STUDY OF SATELLITE WAKES IN A SIMULATED IONOSPHERIC PLASMA
Thesis by wrene® Donald L? Blumenthal
In Partial Fulfillment of the Requirements For the Degree of
Doctor of Philosophy
California Institute of Technology Pasadena, California 1970
(Submitted May 21, 1970)
lasts
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.


Deported in wake of attack
by Graeme Wood/Vancouver is AwesomeSurrey RCMP say three visiting residents have been deported from Canada, and three others are undergoing a status review related to a violent incident in Surrey that was caught on video and shared widely online.
The fight in the Strawberry Hills neighbourhood in August was followed by a similar violent incident on Nov. 11 that was described by Mayor Doug McCallum as “mob violence.”
The two incidents have highlighted a growing number of safety concerns and complaints expressed by local residents regarding groups of youth and young adults in the area. Many, but not all, are on visiting, work or student visas and are engaging in harassment, mischief, public drinking and assaults, according to police.
Cpl. Elenore Sturko said she had no details as to the grounds for which the three individuals were deported.
Sturko alluded to criminal activity being a factor in the deportation, although she did not confirm any charges had been laid. She said police have stepped up enforcement in the area since March, and when a suspect is identified as a visa holder, police refer the incident to Canadian Border Services.
“While not all of these incidents involve international students, law enforcement officials want to remind individuals who are visiting Canada on a visa that any engagement in criminal activity violates the condition of their visa and they could be removed from Canada as a result."
A total of 50 people connected to the groups have been investigated.


Persistência em JPA
Play provides a set of very useful helpers to simplify the management of your JPA entities.
Note that you can still go back to the plain JPA API whenever you want.
Iniciando o JPA entity manager
Play will automatically start the Hibernate entity manager when it finds one or more classes annotated with the @javax.persistence.Entity
annotation. However, make sure that you have correctly configured a JDBC datasource or it will fail.
Obtendo o JPA entity manager
When the JPA entity manager is started you can get it from the application code, using the JPA helper. For example:
public static index() {
Query query = JPA.em().createQuery("select * from Article");
List<Article> articles = query.getResultList();
render(articles);
}
Gerenciamento de transações
Play will automatically manage transactions for you. It will start a transaction automatically the first time you perform an JPA operation in the HTTP request and commit it when the HTTP response is sent. If your code throws an exception, the transaction will automatically rollback.
If you need to force transaction rollback from the application code, you can use the JPA.setRollbackOnly()
method, which tells JPA not to commit the current transaction.
You can also use annotations to specify how transactions should be handled.
If you annotated the method in the controller with @play.db.jpa.Transactional(readOnly=true)
, then the transaction will be read-only.
You don’t have to prevent Play from starting a transaction if you don’t want any. If you do not perform any JPA actions while processing the request,
no transaction will be created. If you would like to enforce this – you can annotate your Controller method or class with @play.db.jpa.NoTransaction
.
If you try to perform a JPA action in a controller annotated with @play.db.jpa.NoTransaction
, an exception will be thrown.
The play.db.jpa.Model support class
This is the main helper class for JPA. If you make one of your JPA entities extend the play.db.jpa.Model
class, it will give you a lot of helper methods to simplify the JPA access.
For example, look at this Post model object:
@Entity
public class Post extends Model {
public String title;
public String content;
public Date postDate;
@ManyToOne
public Author author;
@OneToMany
public List<Comment> comments;
}
The play.db.jpa.Model
class automatically provides an autogenerated Long id
field. We think that it’s generally a good idea to keep an auto-generated Long id
as primary key for JPA models (the technical primary key) and manage your functional primary key using another field.
Note that we have used the fact that Play automatically considers the Post class’ public members as properties. So we don’t need to write all setter/getter methods for this object.
Custom id mapping with GenericModel
Nothing forces you to base your entities on play.db.jpa.Model
. Your JPA entities can also extend the play.db.jpa.GenericModel
class. This is required if you do not want to use a Long id
as the primary key for your entity.
For example, here is a mapping for a very simple User
entity. The id
is a UUID, the name
and mail
properties are required, and we use Play Validation to enforce simple business rules.
@Entity
public class User extends GenericModel {
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
public String id;
@Required
public String name;
@Required
@MaxSize(value=255, message = "email.maxsize")
@play.data.validation.Email
public String mail;
}
Buscando objetos
The play.db.jpa.Model
gives you several ways to find data. For example:
Find by ID
The simplest way to find an object.
Post aPost = Post.findById(5L);
Find all
List<Post> posts = Post.findAll();
This is the simplest way to retrieve all posts, but you can do the same using:
List<Post> posts = Post.all().fetch();
This allows you to paginate results:
// 100 max posts
List<Post> posts = Post.all().fetch(100);
or even,
// 100 max posts start at 50
List<Post> posts = Post.all().from(50).fetch(100);
Find using a simplified query
That allows you to create very expressive finders, but will only work for simple queries.
Post.find("byTitle", "My first post").fetch();
Post.find("byTitleLike", "%hello%").fetch();
Post.find("byAuthorIsNull").fetch();
Post.find("byTitleLikeAndAuthor", "%hello%", connectedUser).fetch();
Post.find("byTitleOrderByTitle", "A nice post").fetch();
Post.find("byTitleOrderByNbCommentsDesc", "A nice post").fetch();
Simple queries follow the following syntax [Property][Comparator]And?[Orderdirective]?
where Comparator can be the following:
LessThan
- less than the given valueLessThanEquals
- less than or equal a give valueGreaterThan
- greater than a given valueGreaterThanEquals
- greater than or equal a given valueLike
- Equivalent to a SQL like expression, except that the property will always convert to lower case.Ilike
- Similar to a Like, except case insensitive, meaning that your argument will convert to lower case too.Elike
- Equivalent to a SQL like expression, no conversion.NotEqual
- Negates equalityBetween
- Between two values (requires two arguments)IsNotNull
- Not a null value (doesn’t require an argument)IsNull
- Is a null value (doesn’t require an argument)
and Orderdirective can be (e.g for a property named name
) :
OrderByName
- default ascending orderOrderByNameDesc
- descending order
you can also use several attributes in Orderdirective :
OrderByNameAndAge
OrderByNameAndAgeDesc
Find using a JPQL query
You can use a JPQL query:
Post.find(
"select p from Post p, Comment c " +
"where c.post = p and c.subject like ?", "%hop%"
);
or even a part of:
Post.find("title", "My first post").fetch();
Post.find("title like ?", "%hello%").fetch();
Post.find("author is null").fetch();
Post.find("title like ? and author is null", "%hello%").fetch();
Post.find("title like ? and author is null order by postDate", "%hello%").fetch();
You can even specify only the order by
statement:
Post.find("order by postDate desc").fetch();
Contando objetos
You can easily count objects.
long postCount = Post.count();
Or even count using a query:
long userPostCount = Post.count("author = ?", connectedUser);
Storing uploaded files with play.db.jpa.Blob
You can use the play.db.jpa.Blob
type to store uploaded files in the file system (not in the database). On the server, Play stores the uploaded image in a file in the attachments/
folder, inside the application folder. The file name (a UUID) and MIME type are stored in a database attribute whose SQL type is VARCHAR
.
The basic use case of uploading, storing and serving a file is extremely easy in Play. This is because the binding framework automatically binds a file uploaded from an HTML form to your JPA model, and because Play provides convenience methods that make serving binary data as easy as serving plain text. To store file uploads in your model, add a property of type play.db.jpa.Blob
import play.db.jpa.Blob;
@Entity
public class User extends Model {
public String name;
public Blob photo;
}
To upload files, add a form to your view template, and use a file upload form control for the model’s Blob
property:
#{form @addUser(), enctype:'multipart/form-data'}
<input type="file" name="user.photo">
<input type="submit" name="submit" value="Upload">
#{/form}
Then, in the controller, add an action that saves the upload in a new model object:
public static void addUser(User user) {
user.save();
index();
}
This code does not appear to do anything other than save the JPA entity, because the file upload is handled automatically by Play. First, before the start of the action method, the uploaded file is saved in a sub-folder of tmp/uploads/
. Next, when the entity is saved, the file is copied to the attachments/
folder, with a UUID as the file name. Finally, when the action is complete, the temporary file is deleted.
If you upload another file for the same user, this will be saved as a new file on the server, whose name is a new UUID. This means that the original file will now be orphaned. If you do not have unlimited disk space then you will have to implement your own scheme for cleaning up, perhaps with an asynchronous job.
If the HTTP request did not specify the file’s correct MIME type, you can use file name extension mapping, as described in the controller file upload section.
To save attachments in a different folder, configure attachments.path.
To serve a stored file, pass Blob.get()
to the controller’s renderBinary
method, as described in the controller binary response section.
Save explícito
Hibernate maintains a cache of Objects that have been queried from the database. These Objects are referred to as persistent Objects as long as the EntityManager that was used to fetch them is still active. That means that any changes to these Objects within the bounds of a transaction are automatically persisted when the transaction is committed. In standard JPA, these updates are implicit within the transaction’s boundary; you don’t have to explicitly call any method to persist the values.
The main downside is that we must manage all of our Objects manually. Instead of telling the EntityManager to update an Object (which would be far more intuitive), we must tell the EntityManager which Objects NOT to update. We do this by calling refresh()
, which essentially rolls back a single entity. We do this just prior to calling commit on the transaction or when we realise the Object shouldn’t be updated.
Here is a common use case, when editing a persistent object after a form submit:
public static void save(Long id) {
User user = User.findById(id);
user.edit("user", params.all());
validation.valid(user);
if(validation.hasErrors()) {
// Here we have to explicitly discard the user modifications...
user.refresh();
edit(id);
}
show(id);
}
From what I’ve seen, most developers are not aware of this, and forget to discard the object state in case of errors, assuming that the object will not be saved without an explicit call to save()
.
So that’s exactly what we’ve changed in Play. All the persistent objects extending the JPASupport/JPAModel will not be saved without an explicit call to the save()
method. So you can actually rewrite the previous code as:
public static void save(Long id) {
User user = User.findById(id);
user.edit("user", params.all());
validation.valid(user);
if(validation.hasErrors()) {
edit(id);
} else{
user.save(); // explicit save here
show(id);
}
}
This is far more intuitive. Moreover since it could be tedious to explicitly call save()
on a large object graph, the save()
call is automatically cascaded to the relationships annotated with the cascade=CascadeType.ALL
attribute.
Mais sobre problemas gerais de tipo
The play.db.jpa.Model
defines a set of generic methods. These generic methods use a type parameter to specify the method’s return type. When using those methods, the concrete type to be used as return value is derived from the invocation context using type inference.
For example, the findAll
method is defined as:
<T> List<T> findAll();
And you use it as:
List<Post> posts = Post.findAll();
Here the Java compiler resolves the actual type of T
using the fact that you assign the method result to a List<Post>. So T is resolved as a Post type.
Unfortunately, this doesn’t work if the generic method’s return value is directly used as a parameter for another method invocation or used in a loop. So the following code fails with a compiler error saying “Type mismatch: cannot convert from element type Object to Post”:
for(Post p : Post.findAll()) {
p.delete();
}
Of course you can resolve this issue using a temporary local variable, as:
List<Post> posts = Post.findAll(); // type inference works here!
for(Post p : posts) {
p.delete();
}
But wait, there is a better way. You can use a practical but somewhat unknown Java language feature, which makes the code shorter while more readable at the same time:
for(Post p : Post.<Post>findAll()) {
p.delete();
}
Using JPA with multiple databases
You can configure Play to use multiple databases, as described in the model section.
When creating Entity and Model classes for databases other than the default, you have to annotate the Class with @PersistenceUnit(name=“other”)
. In this case ‘other’ corresponds to the DB config name ‘other’ (See Model-documentation for more info).
You can use package-info.java
and annotate the package with @PersistenceUnit
to enforce a specific JPA configuration to all entity-classes in the Java package.
If you need to specify special Hibernate configuration parameters for non-default JPA configurations, you must prefix the hibernate.
settings in application.conf with ‘db_configName.’, eg. db_other.hibernate.some.special.setting=true
.
When executing methods on the Entity classes and objects, Play automatically uses the correct database configuration, but if you like you can access it with code:
EntityManager em = JPA.getJPAConfig("other").em();
JPA.getJPAConfig(configName)
returns an object with all the same methods you find in JPA.
It is important to notice that Play does not support XA (two-phase commits). If you use several different JPA configurations in the same request, Play will try to commit as many transactions as possible. If the commit to the first database succeeds and the second commit to the other database fails, the first commit will not get rolled back. Bear this in mind when using multiple JPA configurations in the same request.
Continuing the discussion
Now we’ll check some Play libraries.


How much do you want to enforce?
The balance outstanding on the judgment is {% if data['radio-indent-group2']=="Yes" %}£1,443.2{%else%}£1,643.20{%endif%}
{{ partyName( 'defendant' ) }} was ordered to pay immediately.
View amount breakdown
| Amount breakdown | Amount |
|---|---|
| Claim amount | £1,500 |
| Interest to date | £68.20 |
| Claim fee | £75 |
| Minus amount already paid | £200 |
| Balance outstanding | {% if data['radio-indent-group2']=="Yes" %}£1,443.2{%else%}£1,643.20{%endif%} |


|
Panda3D
|
One atomic piece that may be managed by a AdaptiveLru chain. More...
Public Member Functions | |
| __init__ (const AdaptiveLruPage copy) | |
| __init__ (int lru_size) | |
| dequeueLru () | |
| Removes the page from its AdaptiveLru. More... | |
| enqueueLru (AdaptiveLru lru) | |
| Adds the page to the LRU for the first time, or marks it recently-accessed if it has already been added. More... | |
| evictLru () | |
| Evicts the page from the LRU. More... | |
| AdaptiveLru | getLru () |
| Returns the LRU that manages this page, or NULL if it is not currently managed by any LRU. More... | |
| int | getLruSize () |
| Returns the size of this page as reported to the LRU, presumably in bytes. More... | |
| unsigned int | getNumFrames () |
| Returns the number of frames since the page was first added to its LRU. More... | |
| unsigned int | getNumInactiveFrames () |
| Returns the number of frames since the page was last accessed on its LRU. More... | |
| markUsedLru () | |
| To be called when the page is used; this will move it to the tail of the AdaptiveLru queue it is already on. More... | |
| markUsedLru (AdaptiveLru lru) | |
| To be called when the page is used; this will move it to the tail of the specified AdaptiveLru queue. More... | |
| AdaptiveLruPage | operator= (const AdaptiveLruPage copy) |
| output (Ostream out) | |
| setLruSize (int lru_size) | |
| Specifies the size of this page, presumably in bytes, although any unit is possible. More... | |
| write (Ostream out, int indent_level) | |
One atomic piece that may be managed by a AdaptiveLru chain.
To use this class, inherit from it and override evict_lru().
This class multiply inherits from two classes which in turn both inherit from LinkedListNode. This is just a sneaky C++ trick to allow this class to inherit from LinkedListNode twice, so that pages can be stored on two different linked lists simultaneously. The AdaptiveLru class depends on this; it maintains its pages in two different lists, one grouped by priority, and one in order by next partial update needs.
| __init__ | ( | const AdaptiveLruPage | copy | ) |
| __init__ | ( | int | lru_size | ) |
| dequeueLru | ( | ) |
Removes the page from its AdaptiveLru.
| enqueueLru | ( | AdaptiveLru | lru | ) |
Adds the page to the LRU for the first time, or marks it recently-accessed if it has already been added.
If lru is NULL, it means to remove this page from its LRU.
| evictLru | ( | ) |
Evicts the page from the LRU.
Called internally when the LRU determines that it is full. May also be called externally when necessary to explicitly evict the page.
It is legal for this method to either evict the page as requested, do nothing (in which case the eviction will be requested again at the next epoch), or requeue itself on the tail of the queue (in which case the eviction will be requested again much later).
| AdaptiveLru getLru | ( | ) |
Returns the LRU that manages this page, or NULL if it is not currently managed by any LRU.
| int getLruSize | ( | ) |
Returns the size of this page as reported to the LRU, presumably in bytes.
| unsigned int getNumFrames | ( | ) |
Returns the number of frames since the page was first added to its LRU.
Returns 0 if it does not have an LRU.
| unsigned int getNumInactiveFrames | ( | ) |
Returns the number of frames since the page was last accessed on its LRU.
Returns 0 if it does not have an LRU.
| markUsedLru | ( | ) |
To be called when the page is used; this will move it to the tail of the AdaptiveLru queue it is already on.
This method is const because it's not technically modifying the contents of the page itself.
| markUsedLru | ( | AdaptiveLru | lru | ) |
To be called when the page is used; this will move it to the tail of the specified AdaptiveLru queue.
| AdaptiveLruPage operator= | ( | const AdaptiveLruPage | copy | ) |
| output | ( | Ostream | out | ) |
| setLruSize | ( | int | lru_size | ) |
Specifies the size of this page, presumably in bytes, although any unit is possible.
| write | ( | Ostream | out, |
| int | indent_level | ||
| ) |


After completing your registration process, our Media and Public Relation managers will contact you soon. Thank you.
Make sure you enter both, your Email ID and your Phone number correctly as you will need both to confirm your account.
Already registered from the Celesta home page? Click
here to switch your Regular account to Campus Ambassador one.


Rising water levels due to global warming have given Santa Claus a new way to deliver presents! By carefully redirecting the water flow presents can be destributed without having to visit each place.
Bonus objective: Use at least on less obstacle then available in each level .
left mouse - place obstacle | ESC - cancel placement | P - pause/unpause | R - reset current level | Space - spawn presents
PRESS ANY KEY
A game created by Robert Jendersie based on WebGL-Fluid-Simulation.


World Health Organisation(WHO), has been conducting two surveys, namely STEPS and GSHS to monitor Non-communicable diseases in various countries. As a month-long freelance project, I conceptualized and developed communication materials for both these surveys.


Select Reporting Platform
Choose QS report
Select Dashboard
Choose dashboard
Help & Tutorials
Choose guide


Vincent Herrmann
About
Piano
Composition
Research
Paul Hindemith
Share on
Twitter
Facebook
Google+
LinkedIn
Leave a Comment
You May Also Enjoy
Please enable JavaScript to view the
comments powered by Disqus.
Leave a Comment


Hello from
todo
and
todo
!
Language:
Framework:
KnockoutTS Collections TS
Reserve another seat
Your seats reservations
Passenger Name
Meal
Surcharge
Remove


| # |
|
|
|
|
{% for ref in reference_set %}
| {{ forloop.counter }} |
|
|
|
|
{% include "./reference_form.html" with webography=webography form=reference_form ref=ref %}
{% endfor %}
{% include "./webography_form.html" with form=webography_form edit=0%}
{% include "./webography_form.html" with form=webography_form edit=1%}
{% include "./reference_form.html" with form=references_form manyRef=1%}