The AWT Modality
This document, together with the API documentation for modality-related
classes (such as java.awt.Dialog
), briefly describes the new
modality features and how to use them. It contains the following sections:
- Definitions
- Modality types
- Show/hide blocking
- Modal exclusion
- Related AWT features
- Security
- Platform support
- Compatibility
- Examples
Definitions
Document - a window without an owner that, together with all its child hierarchy, may be operated on as a single self-contained document. Every window belongs to some document — its root can be found as the closest ancestor window without an owner.
Modal blocked window - a window, that:
- doesn't receive any user input events
- doesn't receive input focus
- keeps its Z-order below the modal dialog that blocks it
Warning! Some window managers allow users to change the window Z-order in an arbitrary way — in that case the last requirement may not be met.
Modal dialog - a dialog that blocks some windows while it is visible. The blocked windows are determined according to the dialog's scope of blocking.
Modal excluded window - a window that stays unblocked while the modal dialog is visible. If a window is modal excluded then all its owned windows and child components are also excluded.
Scope of blocking (SB) - the set of windows (instances of
java.awt.Window
and all derived classes) that are blocked by
the modal dialog while it is visible.
Note: Everywhere in this document the notion of "window" is equal to a top-level window in the Java programming language — in other words an instance ofjava.awt.Window
or any descendant class.
Modality types
There are four supported modality types :
- toolkit
- application
- document
- modeless
- Modeless dialogs
A modeless dialog doesn't block any windows while visible. - Document-modal dialogs
A document-modal dialog blocks all windows from the same document except those from its child hierarchy. The document root is determined as the closest ancestor window without an owner. - Application-modal dialogs
An application-modal dialog blocks all windows from the same application except for those from its child hierarchy. If there are several applets launched in a browser, they can be treated either as separate applications or a single application. This behavior is implementation-dependent. - Toolkit-modal dialogs
A toolkit-modal dialog blocks all windows that run in the same toolkit except those from its child hierarchy. If there are several applets launched all of them run with the same toolkit, so a toolkit-modal dialog shown from an applet may affect other applets and all windows of the browser instance which embeds the Java runtime environment for this toolkit. See the security section below.
Modality priority is arranged by the strength of blocking: modeless, document-modal, application-modal and toolkit-modal. This arrangement is used when determining what dialog should remain unblocked if two are visible and block each other. It naturally reflects the nesting of a dialog's scope of blocking (SB): a modeless dialog has an empty SB, a document-modal dialog's SB is complete in some applications, and all the applications are run in one toolkit.
Notes about owners:
- Creating a document-modal dialog without an owner:
SinceDialog
is a class derived fromWindow
, aDialog
instance automatically becomes the root of the document if it has no owner. Thus, if such a dialog is document-modal, its scope of blocking is empty and it behaves the same way as a modeless dialog. - Creating an application-modal or toolkit-modal dialog with an
owner:
The scope of blocking for an application- or toolkit-modal dialog, as opposed to a document-modal dialog, doesn't depend on its owner. Thus, in this case the only thing that the owner affects is the Z-order: the dialog always stays on top of its owner.
Implementation note: Changing the modality type for a visible dialog may have no effect until it is hidden and then shown again.
Show/hide blocking
Showing the window or modeless dialog: "F"
All the visible modal dialogs are looked through — if F is from the SB
of one of them, it becomes blocked by it. If there are several such
dialogs, the first shown is used. If no such dialogs exist, F remains
unblocked.
Showing the modal dialog: "M"
When modal dialog M is shown, all the visible windows fall into one of
three distinct groups:
- Blockers of M (modal dialogs that block M and either are in M's child hierarchy, or are not blocked by M, or have a greater mode of modality, or block some other blocker of M)
- Blocked by M (windows from M's SB that are not blockers and are not in child hierarchy of any blocker)
- All other windows (windows or modeless dialogs outside M's SB and modal dialogs outside M's SB that do not block M).
After the modal dialog M is shown, it becomes blocked by the first shown dialog from the first group (if there are any), all the windows from the second one become blocked by M, and all the windows from the third group remain untouched.
In typical cases, when no child dialogs are shown before their owners, this rule can be simplified. (The following, simplified case, may leave out some details).
Showing the document-modal dialog: "M"
All the visible application- and toolkit-modal dialogs are looked
through — if M is from the SB of one of them,
it becomes blocked by it. If there are several such dialogs,
the first shown is used. If no such dialogs exist, M remains unblocked.
Showing the application-modal dialog: "M"
All the visible toolkit-modal dialogs are looked through —
if M is from the SB of one of them, it becomes blocked by it.
If there are several such dialogs, the first shown is used.
If no such dialogs exist, M remains unblocked.
Showing the toolkit-modal dialog: "M"
M remains unblocked.
| current/shown | frame & modeless | document | application | toolkit |
|---|---|---|---|---|
| - | - | - | - | - |
| document | blocked | - | - | - |
| application | blocked | blocked | - | - |
| toolkit | blocked | blocked | blocked | - |
After the modal dialog is shown, all the windows from its SB are blocked, except those that block this modal dialog.
Hiding the window or modeless dialog: "F"
If F was blocked by any modal dialog M, it becomes unblocked and is
removed from M's blocked windows list.
Hiding the modal dialog: "M"
If M was blocked by any other modal dialog, for example, "N",
it becomes unblocked and
is removed from N's blocked windows list. Then, all the windows and dialogs
blocked by M become unblocked, and after that the same checks
(as in Showing the modal dialog: "M")
are performed for each of them in the order they were initially shown.
Modal exclusion
There are two modal exclusion types introduced as of JDK 6
- Exclusion from blocking of toolkit-modal dialogs
- Exclusion from blocking of application-modal dialogs
- Application-modal exclusion
If a window is application-modal excluded, it is not blocked by any application-modal dialogs. Also, it is not blocked by document-modal dialogs from outside of its child hierarchy. - Toolkit-modal exclusion
If a window is toolkit-modal excluded, it is not blocked by any application- or toolkit-modal dialogs. Also, it is not blocked by document-modal dialogs from outside of their child hierarchy.
Implementation note: Changing the modal exclusion type for a visible window may have no effect until it is hidden and then shown again.
Related AWT features
Always-On-Top
When a modal dialog that is not always-on-top blocks an always-on-top window,
their relative Z-order is unspecified and platform-dependent.
The toFront()
and toBack()
methods
A modal dialog should always be above all its blocked windows. Thus, if a blocked
window is brought to the front, its blocking dialog, if any, is also brought to the
front and remains above the blocked window. Likewise, if a modal dialog is sent to
the back, all of its blocked windows are sent to the back to keep them below the
blocking dialog.
Minimizing, maximizing and closing blocked windows
When a modal dialog blocks a window, the user may not be able to maximize or
minimize the blocked window— however, the actual behavior is unspecified
and platform-dependent. In any case, the user can't close the blocked window
interactively— but it can be closed programmatically by calling the
setVisible(false)
or dispose()
methods on the blocked
window.
Blocked windows activations
When the user selects a blocked window, it may be brought to the front, along
with the blocking modal dialog which would then become the active window—
however, the actual behavior is unspecified and platform-dependent.
Hiding a modal dialog
When the modal dialog that currently has focus is hidden, it is unspecified
and platform-dependent, which other window will become the active window.
Any of the following may become the active window:
- The owner of the modal dialog - if the owner is unblocked.
- The
Window
, which was active before this modal dialog gained focus - if the owner of the modal dialog is absent or is blocked.
Security
A special AWTPermission
, "toolkitModality"
,
is required to show toolkit-modal
dialogs. This would prevent, for example, blocking a browser or
Java Web Start (JWS) by modal dialogs shown from applets.
The same permission is required to exclude a window from toolkit modality. This would prevent, for example, a dialog shown from an applet not to be blocked by a browser's or JWS's modal dialog.
Platform support
Two java.awt.Toolkit
methods allow you to check whether
the current platform supports specific modality features:
isModalityTypeSupported(modalityType)
Returns whether the specified modality type is supported on the current platform. If mode "M" is not supported and a dialog is set to M-modal, it behaves as modeless.isModalExclusionTypeSupported(modalExclusionType)
Returns whether the given modal exclusion type is supported on the current platform. If exclusion type "E" is not supported and a window is marked as E-excluded, this has no effect.
Compatibility
The default modality type is application-modal. It is used by the API
calls: Dialog.setModal(true)
,
Dialog(owner, true)
, etc. Prior to JDK 6
the default type was toolkit-modal,
but the only distinction between application- and toolkit-modality is for
applets and applications launched from Java Web Start.
Examples
Example 1
- Frame F is shown
- Document-modal dialog Di is shown
- F becomes blocked by Di — it's in the same document
- Document-modal dialog Dii is shown
- Di becomes blocked by Dii — it's in the same document
Example 2
- Frame F is shown
- Document-modal dialog Di is shown
- F becomes blocked by Di — it's in the same document
- Document-modal dialog Dii is shown
- Di becomes blocked by Dii — it's in the same document
Example 3
- Frame F is shown
- Toolkit-modal dialog Di is created, but not shown
- Document-modal dialog Dii is shown
- F becomes blocked by Dii — it's in the same document
- Application-modal dialog Diii is shown
- Dii becomes blocked by Diii — it's in the same application
- Di is shown
- Di becomes blocked by Dii — it's its owner
- Diii remains unblocked — it blocks Dii and Dii blocks Di
Example 4
- Frame F is shown
- Toolkit-modal dialog Di is created, but not shown
- Document-modal dialog Dii is shown
- F becomes blocked by Dii — it's in the same document
- Application-modal dialog Diii is shown
- Dii becomes blocked by Diii — it's in the same application
- Di is shown
- Diii becomes blocked by Di — Di is not blocked
- Di remains unblocked


Music Home is an app that allows you to easily and quickly control music from a variety of players. Through Music Home's lightweight screen saver and efficient home screen, your music will always be just a tap away. Hate having to unlock your phone to choose the next song? Don't want to fiddle for the power button to turn your screen on? Then Music Home is the perfect app for you!
The prime feature of Music Home is its screen saver. The screen saver is a highly efficient page that displays only the current artist and track title with a black background. By preventing the screen from turning off and the device from locking, the application allows for quick wakeups from the screen saver with a simple tap on the screen. In case you're worried about screen burn, fear not: the "Now Playing" info on the screen saver continuously moves about the screen, preventing a portion of the device display from being on and fully colored for an extended period of time. The screen saver will automatically start before the the device's screen timeout setting, or you can manually start the screen saver via the "Sleep" button.
Music Home is designed to control one music application at a time. To select which application to control on Android, press the settings icon at the top right of the "Now Playing" pane, then press "Select music app". Since iOS only allows control of the system music application, Music Home on iPhones and iPads will only control the iTunes app.


Get Help
Project Queue
Forum
Sign In
D E A D C 0 D E
Username
Submit
Go to the forum to see your question
Issue
Description
Github Link
Submit
Check out projects in these languages


This is the raft that Tim and Jack constructed with a little help from Dad. They found most of the things they needed at the dump: lengths of wood and plastic drums for the raft itself, discarded bus seats to sit on, old pipes to support the roof and a wood-fired stove, complete with flue, for cooking. Back in Dad's shed, they made the frame and attached the plastic drums. A tin roof protected the raft from rain and sun and provided a shelf for extra chairs and the logs of wood needed to fuel the stove. With help from Mum and Dad, the boys lifted the raft onto Dad's trailer and dragged it to the dam. They launched the raft and then Mum and Dad left the boys to it. Along with the dogs, Tim and Jack were all set for an adventure. But were they" Tim and Jack had a problem. What do you think the problem was" Tim and Jack had no means of propelling the raft along: no paddles, no motor, no punting pole, and no way of steering it.
in-context


{%load static%}
The dataset consists of 1,376 images belonging to two classes:
Rectangular bounding boxes are generated for the detected faces where the color of box indicates the presence of the mask
The faces detected in image are iterated and passed to the Mask prediction model individually
The Mask confidence percentage is also displayed on top of the bounding box


Bhawnish is originally from India, currently studying for Front-End development in the Full Stack Web Development field.
Dalton is a Full Stack Web Development student from Indiana. He is a lover of plants, cats, and video games.
Chris is an aspiring Full Stack Developer born and raised in Colorado. He's also an avid metal music fan and videogame connoisseur.
Siyuan is studying Full Stack Web Development at Lambda School. He currently lives in Hong Kong, loves traveling, books by Stephen King and programming.
Jessica is currently a Full Stack Web Development student and Fitness Coach living in Washington State. She enjoys lifting, reading ancient philosophy, and playing World of Warcraft.
Whitney is a Full Stack Engineer residing in the Chicagoland area. In her spare time she likes to indulge in reality tv shows, personal development books, and expository documentaries.
Tony Bratcher is from San Diego, CA. Currently, he's a Full Stack Web development student. In his spare time he coaches youth tackle football and DJs.
Henry is a Full Stack Web Development Student from Michigan. When he's not coding he loves to play tennis, read, and cook.


|
|
||
|
Contents
General Numerical Expressions Boolean Expressions Text Images |
Text The Text component is simply for adding paragraphs of text, it is constructed by typing some text (in an avaialbe command line) followed by a semi-colon (;). However the entered text may not contain any of the operators or constructors (i shall call these escape chars) that are used for other components, so a list of these is kept in the constructor enabling a user to enter them by putting a back-slash (\) before them. Although no ``escape chars'' can be used when originally constructing a text element, once the component is a text component, anything may be written in it (as in a normal word-processor). The text component has a popup (eg. when right-clicked) that alllows the font to be changed (ie font face, size, colour and attributes such as bold or italics). |
|


The upcoming meeting of the ITU is called the World Conference of International Telecommunications (WCIT). It's set to run from December 3-14, 2012, in Dubai. There are a lot of issues up for discussion. Use this section to figure out the ones that matter most to you.
For a quick summary overview of what the ITU is and why this meeting of the WCIT is important, check out:
- 'What Is The ITU.' A four-minute video rundown from Access Now and Fight for the Future.
- The Internet Society has this quick description on why the WCIT meeting is important.
Key Issues
- Transparency
- ITU Gives A Nod Towards Transparency, Still A Long Road To Full Civil Society Participation (Center for Democracy and Technology)
- ITU and the Internet's Titanic Moment (Stanford Technology Law Review)
- Free Expression
- Freedom of Expression Online and Revising the International Telecommunications Regulations (Access Now)
- ITU, WCIT, and Internet Freedom (Public Knowledge)
- Access to the Open Internet
- ETNO Proposal Threatens To Impair Access To Open, Global Internet (PDF) (Center for Democracy and Technology)
- Keep The Internet Open (Vint Cerf)
- Economic Impact and Global Development
- A Giant Step Backwards (PDF) (LIRNEAsia)
- Economic Impact of the ITRs (Center for Democracy and Technology)
Dig deeper
Useful resources for exploring further:


Word Type Treemap
Size of boxes are decided based on score of the word and count of words
Green
Positive word score
Red
Negative word score
*Hover over boxes for further information breakdown*


JAVASCRIPT LANGUAGE
Technical Blog
14.APR.2016
In the JavaScript language, describe all the use cases for each of:
Parentheses () - Parentheses have multiple use cases in Javascript, here are cases I am aware of.
1. Control structure of if, for, while statements.
2. Define function parameters.
3. Grouping expressions and parameters.
4. Some functions have no parameters so the space between parentheses is blank.
Brackets [] - Brackets are used as access operators for array classes and elements.
Braces {} - Curly braces are used to define the beginning and end of functions and statement blocks like if() and for() structures.
Single quotes ' ' - Placing text inside quotation marks turns that text into a string. Strings is the way Javascript handles and processes text.
Double quotes " " - Double quotes are the same as single quotes which are used to create strings that contain text. From what I have read there is no difference between single and double quotes other than user preference. For example it may be easier to read your code if you place single quotes on the outer strings and double in the inner strings.


Here are some of the projects I've done through school and work and on my free time. Take a look around! Please note that this is an incomplete gallery--I have some work to do with migrating a database to enable PHP, and some format changes for my graphic design projects.


| as_label {rlang} | R Documentation |
as_label()
transforms R objects into a short, human-readable
description. You can use labels to:
Display an object in a concise way, for example to labellise axes in a graphical plot.
Give default names to columns in a data frame. In this case, labelling is the first step before name repair.
See also as_name()
for transforming symbols back to a
string. Unlike as_label()
, as_string()
is a well defined
operation that guarantees the roundtrip symbol -> string ->
symbol.
In general, if you don't know for sure what kind of object you're
dealing with (a call, a symbol, an unquoted constant), use
as_label()
and make no assumption about the resulting string. If
you know you have a symbol and need the name of the object it
refers to, use as_string()
. For instance, use as_label()
with
objects captured with enquo()
and as_string()
with symbols
captured with ensym()
.
as_label(x)
x |
An object. |
Quosures are squashed before being labelled.
Symbols are transformed to string with as_string()
.
Calls are abbreviated.
Numbers are represented as such.
Other constants are represented by their type, such as <dbl>
or <data.frame>
.
Note that simple symbols should generally be transformed to strings
with as_name()
. Labelling is not a well defined operation and
no assumption should be made about how the label is created. On the
other hand, as_name()
only works with symbols and is a well
defined, deterministic operation.
as_name()
for transforming symbols back to a string
deterministically.
# as_label() is useful with quoted expressions: as_label(expr(foo(bar))) as_label(expr(foobar)) # It works with any R object. This is also useful for quoted # arguments because the user might unquote constant objects: as_label(1:3) as_label(base::list)


Prototype Notenik-Generated Website
Here is my first post on my new website!
Isn’t it amazingly entertaining and informative?
Back to top


--- layout: blog section: "DevOps/vagrant" title: VAGRANT permalink: /DevOps/vagrant/ image: static/img/blog/vagrant/vagrant-logo.png ---
{{ post.desc | strip_html }}


DISCORD TOKEN GENERATOR
------------------------ Created by m0d1#0957 By on discord.gg/bgehh6NDDK Discord Tokens Generator Most tokens don`t work ------------------------
How much tokens do you want generated?
Generate Codes!
Clear Log


|
|||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
| Interface Summary | |
| DesiredExpirationListener | Subinterface of LeaseListener that clients must
implement if they want to receive desired expiration reached events
in addition to renewal failure events. |
| LeaseListener | The interface that receivers of LeaseRenewalEvent
instances must implement.
|
| LeaseRenewalService | Interface to the lease renewal service. |
| LeaseRenewalSet | A collection of leases being managed by a lease renewal service. |
| Class Summary | |
| ExpirationWarningEvent | Event generated by a lease renewal set when its lease is about to expire. |
| LeaseRenewalEvent | Event generated when a LeaseRenewalManager cannot renew
a lease.
|
| LeaseRenewalManager | Provides for the systematic renewal and overall management of a set of leases associated with one or more remote entities on behalf of a local entity. |
| RenewalFailureEvent | Event generated by a lease renewal set when it can't renew a lease it is responsible for. |
| Exception Summary | |
| LeaseUnmarshalException | Exception thrown when a lease renewal set can't unmarshal one or more
leases being returned by a getLeases call.
|
Standard service and utility classes for managing leases.
net.jini.core.lease
,
"Jini(TM) Lease Renewal Service Specification",
"Jini(TM) Lease Utilities Specification"
|
|||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |


Plugin Information |
|---|
View Block Queued Job on the plugin site for more information. |
Description
Plugin for blocking/unblocking job in queue by some conditions configured in this job.
Features
Built in conditions:
- Block job when last build of defined target project is in building status
- Block job when last build of defined target project has result
Note: conditions has waterfall priority so if "unblock" conditions get matching first - job will be unblocked, if not - then next condition will be verified.
Provides @ExtensionPoint so other plugins can provide other block/unblock features
Changelog
Configuration
1. Enable job property
a) Open job configuration
b) Press checkbox "Block/Unblock task in queue"
2. Add conditions
3. Save job
Attachments:
Screenshot 2015-04-28 16.40.46.png (image/png)
Screenshot 2015-04-28 16.44.14.png (image/png)
Screenshot 2015-04-28 16.47.19.png (image/png)
Screenshot 2015-04-28 16.44.14.png (image/png)
Screenshot 2015-04-28 16.47.19.png (image/png)


The software powering Real Steel is fairly complex, but we chose a handful of architectural patterns and libraries to simplify the development process. Our language of choice was Python and we relied heavily on OpenNI
for kinect-related libraries, Python's Multiprocessing
library for concurrency, ikpy
for forward kinematic solving, pybullet
for simulation of the robot, and PySerial
to get the joint angle to the robot.
All of these components were given their own class
in the Python code, and inherited certain functionality so that we could easily disable and enable different parts of the code with a few flags. For instance, the python code that loads in all the modules is fairly simple, despite the entire codebase being several thousand lines. We chose the pipeline architecture and separated each of the components into their own submodules to be more easily unit-testable. The entire system can run with "fake" components which satisfy the software requirements and even create fake data so we can do integration tests with entire chunks of the pipeline missing. This is a solid, industry-practiced software engineering tactic that allowed us to iterate faster and modularize our code.
from realsteel.device import ROBOT_DEVICE, FAKE_DEVICE from realsteel.visualizer import DEMO_VIS, ROBOT_VIS, FAKE_VIS from realsteel.joint_input import CAMERA, KINECT, HYBRID from realsteel.kinematic import KSOLVER from realsteel.pathplanner import PATHPLANNER from realsteel.kinematic import ArmJoints class ROBOT: """ This code processes the launch args and sets up all the moving parts to get the REAL STEEL experience up and running. Nothing in this main loop should blocking, but rather pushing data around between threads. Everything should be async. """ def __init__(self, hardware_enabled = False, visualization_mode="disabled"): # [1] Build the virtual robot from joints # [2] Set up the camera/kinect inputs to dump raw joint angles # [3] Set up the kinematic solver that takes raw joint angles and turns into robot angles # [4] Set up the path planner that maps joint angles frames # [5] Set up the physical robot interface # [6] Set up the visualizer # Process the user flags to process things like dev mode self.hardware_enabled: bool = hardware_enabled self.visualization_mode = visualization_mode # [1] Build the robot from a URDF file # TODO, allow specifying a custon URDF self.human_positions: dict = None self.robot_positions: dict = None # self.intialize_robot_from_urdf(file = "") # [2] Set up the camera/kinect input device self.joint_input = HYBRID() # [3] Set up the kinematic solver self.solver = KSOLVER() # [4] Set up the path planner self.planner = PATHPLANNER() # [5] Set up the hardware device if self.hardware_enabled: self.device = ROBOT_DEVICE() else: self.device = FAKE_DEVICE() # [6] Set up the visualizer if self.visualization_mode == "dev": self.visualizer = ROBOT_VIS(directory='robot/') elif self.visualization_mode == "demo": self.visualizer = DEMO_VIS() else: self.visualizer = FAKE_VIS()


For help in adapting this tool for use with other DSpace instances, contact the IDEALS team at ideals@library.illinois.edu.


## Some Test Content
With some markup, at least *basic* _one_
Some content
and some code:
```
var x = 5
```
### Some content
and some code: `Math.pow(4,2)`
### Some content
and some code:
```
//litjs: id=codeBlock1 title="First Code Block"
var x = 6
```
```
//litjs-code: id=codeBlock2
var x = 7
```
### Some content
Some inline code with attributes: `/*litjs: id=inlinecode1 */ Math.pow(4,2)`
### Some content
Some inline code with attributes: `/*litjs:id=nospace */ Math.pow(4,2)`
### Some content
Some code with invalid metadata setting (missing space):
```
//litjs:someprop=somevalue
var x = 8
```


Hit the ground running.
Get Started
Making IoT development easier
To build an IoT device, you need a board, a sensor and the code to get them talking to each other and to the network. Whether you’re a commercial developer or hobbyist, we're here to help you get all three.
What is UPM?
UPM is a sensor library with high-level APIs that make it easy to connect and use sensors and actuators in IoT solutions.
400+ Sensors/Actuators
Discover the right sensor/actuator for your solution, from prototype to industrial deployment.
Multi-Language
Develop in C/C++, Java*, Node.js* and Python*.
Multi-OS Support
Supports Ubuntu, Yocto, Android Things, WindRiver, Arch Linux, Ubilinux, Zephyr.
Open Source
Open Source, MIT licensed, completely free to use.
Extended Comms
Add protocols like Wi-Fi*, ZigBee*, LoRa*, Bluetooth*LE, GPS and many more.
Hardware Agnostic
Use the same APIs on any supported platform, from microcontrollers to industrial gateways.
Are you a sensor manufacturer?
Support the UPM sensor community and reach thousands of IoT developers.
Sensor Manufacturers on UPM


cease & desist letter #10 - Mastercard Priceless
An archive of disturbing illustration
Part I. Cause
Mastercard doesn't like our parody of their
Priceless advertising campaign. Actually these
images aren't even ours, we stole them from various
places. Kinda lame.
Part II. Conclusion
We don't really want to fight Mastercard...
[return to rotten.com]
|


|
| override GlTFMaterialDto | ToDto () |
| |
| override IEntity | ToEntityDto (UMI3DUser user) |
| | Convert the entity to a DTO. - Parameters
-
- Returns
- Entity as a DTO
More...
|
| |
| override Bytable | ToBytes (UMI3DUser user) |
| | Convert the entity to a list of bytes as a bytable. - Parameters
-
- Returns
- return a couple (size,func) with size as the required size more the baseSize given, and func a method taking a byte array in which the data should be written, a position at which it should be written, a base size. This method return the updated position (position + required size) and the (required size + base size); The byte array given should be at least of size position + required size;
Used in networking with bytes. More...
|
| |
| abstract GlTFMaterialDto | ToDto () |
| |
| abstract Bytable | ToBytes (UMI3DUser user) |
| | Convert the entity to a list of bytes as a bytable. - Parameters
-
- Returns
- return a couple (size,func) with size as the required size more the baseSize given, and func a method taking a byte array in which the data should be written, a position at which it should be written, a base size. This method return the updated position (position + required size) and the (required size + base size); The byte array given should be at least of size position + required size;
Used in networking with bytes. More...
|
| |
| ulong | Id () |
| | UMI3D Id of an entity. Null id is 0
Ids are set between 1 and 18,446,744,073,709,551,615.
Actualy between 1 and 9,223,372,036,854,775,807 due to the serializer not sutporting unsigned values. - Returns
More...
|
| |
| abstract IEntity | ToEntityDto (UMI3DUser user) |
| | Convert the entity to a DTO. - Parameters
-
- Returns
- Entity as a DTO
More...
|
| |
| virtual LoadEntity | GetLoadEntity (HashSet< UMI3DUser > users=null) |
| | Ask the clients to load the entity. - Parameters
-
| users | Target clients user set. |
- Returns
- The operation to send to makes clients load the entity
More...
|
| |
| DeleteEntity | GetDeleteEntity (HashSet< UMI3DUser > users=null) |
| | Ask the clients to delete the entity. - Parameters
-
| users | Target clients user set. |
- Returns
- The operation to send to makes clients delete the entity
More...
|
| |
| bool | LoadOnConnection (UMI3DUser user) |
| | Condition to be loaded on connection. More...
|
| |
| bool | AddConnectionFilter (UMI3DUserFilter filter) |
| | Add a filtering condition from the user filtering. More...
|
| |
| bool | RemoveConnectionFilter (UMI3DUserFilter filter) |
| | Remove a filtering condition from the user filtering. More...
|
| |
| LoadEntity | GetLoadEntity (HashSet< UMI3DUser > users=null) |
| | Ask the clients to load the entity. More...
|
| |
| DeleteEntity | GetDeleteEntity (HashSet< UMI3DUser > users=null) |
| | Ask the clients to delete the entity. More...
|
| |
| IEntity | ToEntityDto (UMI3DUser user) |
| | Convert the entity to a DTO. More...
|
| |
| Bytable | ToBytes (UMI3DUser user) |
| | Convert the entity to a list of bytes as a bytable. More...
|
| |
| bool | LoadOnConnection (UMI3DUser user) |
| | Condition to be loaded on connection. More...
|
| |
| bool | AddConnectionFilter (UMI3DUserFilter filter) |
| | Add a filtering condition from the user filtering. More...
|
| |
| bool | RemoveConnectionFilter (UMI3DUserFilter filter) |
| | Remove a filtering condition from the user filtering. More...
|
| |
| ulong | Id () |
| | UMI3D Id of an entity. More...
|
| |
|
| UMI3DAsyncProperty< Color > | objectBaseColorFactor [get, protected set] |
| | See baseColorFactor. More...
|
| |
| UMI3DAsyncProperty< float > | objectMetallicFactor [get, protected set] |
| | See metallicFactor. More...
|
| |
| UMI3DAsyncProperty< float > | objectRoughnessFactor [get, protected set] |
| | See roughnessFactor. More...
|
| |
| UMI3DAsyncProperty< Color > | objectEmissiveFactor [get, protected set] |
| | See emissive. More...
|
| |
| UMI3DAsyncProperty< UMI3DTextureResource > | objectMaintexture [get, protected set] |
| | See CustomTextures.baseColorTexture. More...
|
| |
| UMI3DAsyncProperty< UMI3DTextureResource > | objectMetallicRoughnessTexture [get, protected set] |
| | See CustomTextures.metallicRoughnessTexture. More...
|
| |
| UMI3DAsyncProperty< UMI3DScalableTextureResource > | objectNormalTexture [get, protected set] |
| | See CustomTextures.normalTexture. More...
|
| |
| UMI3DAsyncProperty< UMI3DTextureResource > | objectEmissiveTexture [get, protected set] |
| | See CustomTextures.emissiveTexture. More...
|
| |
| UMI3DAsyncProperty< UMI3DTextureResource > | objectOcclusionTexture [get, protected set] |
| | See CustomTextures.occlusionTexture. More...
|
| |
| UMI3DAsyncProperty< UMI3DTextureResource > | objectMetallicTexture [get, protected set] |
| | See CustomTextures.metallicTexture. More...
|
| |
| UMI3DAsyncProperty< UMI3DTextureResource > | objectRoughnessTexture [get, protected set] |
| | See CustomTextures.roughnessTexture. More...
|
| |
| UMI3DAsyncProperty< UMI3DTextureResource > | objectChannelTexture [get, protected set] |
| | See CustomTextures.channelTexture. More...
|
| |
| UMI3DAsyncProperty< UMI3DScalableTextureResource > | objectHeightTexture [get, protected set] |
| | See CustomTextures.heightTexture. More...
|
| |
| UMI3DAsyncProperty< Vector2 > | objectTextureTilingScale [get, protected set] |
| | See tilingScale. More...
|
| |
| UMI3DAsyncProperty< Vector2 > | objectTextureTilingOffset [get, set, protected set] |
| | See tilingOffset. More...
|
| |
| UMI3DAsyncProperty< float > | objectNormalTextureScale [get, protected set] |
| | See CustomTextures.normalTexture.scale. More...
|
| |
| UMI3DAsyncProperty< float > | objectHeightTextureScale [get, protected set] |
| | See CustomTextures.heightTexture.scale. More...
|
| |
| UMI3DAsyncDictionnaryProperty< string, object > | objectShaderProperties [get, protected set] |
| | See shaderProperties. More...
|
| |
Physics-Based Rendering (PBR) material


Ranking Evaluation APIedit
The rankEval
method allows to evaluate the quality of ranked search
results over a set of search request. Given sets of manually rated
documents for each search request, ranking evaluation performs a
multi search request and calculates
information retrieval metrics like mean reciprocal rank, precision
or discounted cumulative gain on the returned results.
Ranking Evaluation Requestedit
In order to build a RankEvalRequest
, you first need to create an
evaluation specification (RankEvalSpec
). This specification requires
to define the evaluation metric that is going to be calculated, as well
as a list of rated documents per search requests. Creating the ranking
evaluation request then takes the specification and a list of target
indices as arguments:
EvaluationMetric metric = new PrecisionAtK(); List<RatedDocument> ratedDocs = new ArrayList<>(); ratedDocs.add(new RatedDocument("posts", "1", 1)); SearchSourceBuilder searchQuery = new SearchSourceBuilder(); searchQuery.query(QueryBuilders.matchQuery("user", "kimchy")); RatedRequest ratedRequest = new RatedRequest("kimchy_query", ratedDocs, searchQuery); List<RatedRequest> ratedRequests = Arrays.asList(ratedRequest); RankEvalSpec specification = new RankEvalSpec(ratedRequests, metric); RankEvalRequest request = new RankEvalRequest(specification, new String[] { "posts" });
Synchronous Executionedit
The rankEval
method executes `RankEvalRequest`s synchronously:
RankEvalResponse response = client.rankEval(request, RequestOptions.DEFAULT);
Asynchronous Executionedit
The rankEvalAsync
method executes RankEvalRequest`s asynchronously,
calling the provided `ActionListener
when the response is ready.
The asynchronous method does not block and returns immediately. Once it is
completed the ActionListener
is called back using the onResponse
method
if the execution successfully completed or using the onFailure
method if
it failed.
A typical listener for RankEvalResponse
looks like:
RankEvalResponseedit
The RankEvalResponse
that is returned by executing the request
contains information about the overall evaluation score, the
scores of each individual search request in the set of queries and
detailed information about search hits and details about the metric
calculation per partial result.
double evaluationResult = response.getMetricScore(); assertEquals(1.0 / 3.0, evaluationResult, 0.0); Map<String, EvalQueryQuality> partialResults = response.getPartialResults(); EvalQueryQuality evalQuality = partialResults.get("kimchy_query"); assertEquals("kimchy_query", evalQuality.getId()); double qualityLevel = evalQuality.metricScore(); assertEquals(1.0 / 3.0, qualityLevel, 0.0); List<RatedSearchHit> hitsAndRatings = evalQuality.getHitsAndRatings(); RatedSearchHit ratedSearchHit = hitsAndRatings.get(0); assertEquals("2", ratedSearchHit.getSearchHit().getId()); assertFalse(ratedSearchHit.getRating().isPresent()); MetricDetail metricDetails = evalQuality.getMetricDetails(); String metricName = metricDetails.getMetricName(); assertEquals(PrecisionAtK.NAME, metricName); PrecisionAtK.Detail detail = (PrecisionAtK.Detail) metricDetails; assertEquals(1, detail.getRelevantRetrieved()); assertEquals(3, detail.getRetrieved());
|
The overall evaluation result |
|
|
Partial results that are keyed by their query id |
|
|
The metric score for each partial result |
|
|
Rated search hits contain a fully fledged |
|
|
Rated search hits also contain an |
|
|
Metric details are named after the metric used in the request |
|
|
After casting to the metric used in the request, the metric details offers insight into parts of the metric calculation |


{% extends "site_base.html" %} {% block body %}
from {{event.start|date:"D M, Y"}} {{event.start|time:"h:i a"}} to {{event.end|date:"D M, Y"}} {{event.end|time:"h:i a"}}
{{event.description}}


If you choose to build mpd yourself to customize it, the
process is straightforward. First, edit the Makefile
to define (or undefine) the various device types and options
you want to support. Run 'configure' script and then type
make depend all
to rebuild the binary.
The various build-time definitions in the Makefile are below:
MPD_CONF_DIR
The default configuration directory where mpd looks for
mpd.conf
, etc.
PHYSTYPE_MODEM
PHYSTYPE_TCP
PHYSTYPE_UDP
PHYSTYPE_NG_SOCKET
PHYSTYPE_PPTP
PHYSTYPE_L2TP
PHYSTYPE_PPPOE
Define these to include support for the corresponding device type.
ENCRYPTION_DES
These enable support for the corresponding encryption types.
SYSLOG_FACILITY
Mpd normally logs via syslog(3)
using the facility
LOG_DAEMON
. You can customize the facility here.


Preparation time
over 2 hours
Cooking time
less than 10 mins
Serves
Serves 8
Dietary
For the terrine, lightly grease a 1.5kg/3lb 4oz loaf tin with a little oil and line with cling film, pressing into the corners.
Place the chocolate into a heatproof bowl set over a pan of simmering water to melt (make sure the bottom of the bowl doesn't touch the water). Once melted, remove the bowl from the pan and stir in half of the double cream. Set aside.
Place a clean heatproof bowl over a pan of simmering water (again making sure the bottom of the bowl doesn't touch the water), add the egg yolks and sugar and whisk for 3-4 minutes, or until the mixture is pale and thickened.
Whisk the egg and sugar mixture into the chocolate until well combined, then whisk in the cold water.
Whisk the remaining double cream in a bowl until soft peaks form when the whisk is removed. Gently fold the whipped cream into the chocolate mixture until just combined.
Dip the boudoir biscuits or sponge fingers into a bowl of the chilled coffee, then arrange the soaked biscuits vertically along the sides of the prepared loaf tin. Make sure there are no gaps between each biscuit.
Spoon the chocolate mixture into the centre, then tap the tin lightly on the work surface to even out the mixture, ensuring the mixture goes into the corners. Cover with cling film and chill in the fridge for at least two hours, or until set.
For the coffee crème anglaise, place the double cream, milk and roasted coffee beans into a pan and bring to a simmer.
Whisk the egg yolks and sugar together in a bowl, then slowly pour in the warm cream mixture, whisking continuously until well combined. Pour the mixture back into a clean pan and cook over a low heat for 4-5 minutes, or until the mixture coats the back of a wooden spoon.
Pass the mixture through a fine sieve into a bowl and allow to cool slightly before chilling in the fridge for at least 30 minutes.
To serve, remove the terrine from the fridge 30 minutes before serving to allow it to soften slightly. Turn out from the tin onto a plate and remove the cling film. Using a hot knife, thickly slice the terrine and place a slice onto each serving plate. Spoon the chilled crème anglaise around the plate and decorate the plate with a few chocolate-coated coffee beans.


The devil stands there.
In the bluish dark
of my parents' bedroom,
mirror after mirror
tilts over and breaks. Hidden
in the nightstand, I found
photos of my mother's swollen
lips, ex-boyfriends, the rain
on her wedding day.
A wet knot.
On the day my father left,
the whole sky split open
as I watched my mother's fist
unclench for the first time
in twenty-six years & I saw
the knot unraveled.
Bone dry.


This weekend, our local over-the-air movie stations had a marathon of classic monster/science fiction movies. I watched a bit of King Kong (1976) with my daughter because you really can’t start too soon.
Later, I swung back through and caught the beginning of The Island of Dr. Moreau (1977) – which, by the way, was the better of the two film versions. I caught the scene where Michael York and Burt Lancaster are discussing the ability to mix human and animal DNA:
Dr. Paul Moreau (Lancaster): How does a cell become enslaved to a form, to a destiny it can never change? Can we change that destiny?
Andrew Braddock (York): Should we?
Then, during the Super Bowl last night, I caught Chris Pratt asking the same question in the new Jurassic World trailer:
You just went and made a new dinosaur? Probably not a good idea.
Holy foreshadowing, Batman!
It reminds me of Jeff Goldblum’s similar line from the original:
John Hammond: I don’t think you’re giving us our due credit. Our scientists have done things which nobody’s ever done before…
Dr. Ian Malcolm: Yeah, yeah, but your scientists were so preoccupied with whether or not they could that they didn’t stop to think if they should.
Oh, how our culture loves to ask rhetorical questions after the fact.
Tech in the classroom is in the same vein. Just because we can, should we?
Companies left and right are professing their capability of changing the way people learn through their brand-new-all-in-one-revolutionary-online-blended-learning-platform-sign-up-now pitches. Double bonus if it is built on brain science.
Just because we can put lessons online with videos and quizzes that work on all platforms doesn’t mean we should. But, we clamor for cross-platform compatibility and go to conferences to hear about the new stuff. Why aren’t we asking hard questions of the groups making the stuff?
Obligatory tech is important line yada yada.
Before diving into using the newest cool thing, stop and take a critical step backward. Is it really in your or your student’s best interest to take a ton of time and build a lesson on a new platform? What will they get out of it? Why is it better than whatever you had done before? How will you assess the growth because of the switch?
If we’re not asking these questions, we’re throwing our student’s education into the hands of the engineers. And we’re happy to do it, most times.
Maintain a critical eye. Hell, be cynical. It’ll protect you from doing something just because you can.
Written on February 2nd , 2015 by Brian Bennett Categorized in: All Teaching Technology
Leave a comment


- netkraken
netkraken | network analyzer
tl;dr
- records network connections of a bunch of hosts, continuously
- aggregates connection data: minutes, hours, days
- analyzes and visualizes connection data
- a screencast
Features
- connection recorder (aka minion) compatible with python 2.6/2.7/3.3/3.4/pypy
- aggregation runs on minion, scales well
- communication over ssh
- multi-dimensional analyzes, configurable via url
Some Examples of the Netkraken Analyzer
function group level (similar hosts grouped together)
Note: These examples are based on anonymized data of a real network:
500 function groups,
3.000 connections,
700kB plain data
host level (all individual hosts)
Note: These examples are based on anonymized data of a real network:
1.300 nodes,
10.000 connections,
3.000kB plain data


For more information about Shiny look at the documentation.
Some code goes under here
If you wish to write some code you may like to use the pre() function like this:
sliderInput("year", "Year", min = 1893, max = 2005, value = c(1945, 2005), sep = "")


Implementing a performant, thread-safe ordered data container
To achieve efficient ordering of entries in the DataContainer interface for configurations that support eviction, there was a need for a linked HashMap implementation that was thread-safe and performant. Below, I specifically discuss the implementations of the FIFODataContainer and LRUDataContainer in Infinispan 4.0.x. Wherever this document references FIFODataContainer, this also applies to LRUDataContainer - which extends FIFODataContainer. The only difference is that LRUDataContainer updates links whenever an entry is visited as well as added.
After analysing and considering a few different approaches, the one I settled on is a subset of the algorithms described by H. Sundell and P. Tsigas in their 2008 paper titled Lock-Free Deques and Doubly Linked Lists, combined with the approach used by Sun’s JDK6 for reference marking in ConcurrentSkipListMap's implementation.
Reference marking? What’s that?
Compare-and-swap (CAS) is a common technique today for atomically updating a variable or a reference without the use of a mutual exclusion mechanism like a lock. But this only works when you modify a single memory location at a time, be it a reference or a primitive. Sometimes you need to atomically update two separate bits of information in a single go, such as a reference, as well as some information about that reference. Hence reference marking. In C, this is sometimes done by making use of the assumption that an entire word in memory is not needed to store a pointer to another memory location, and some bits of this word can be used to store additional flags via bitmasking. This allows for atomic updates of both the reference and this extra information using a single CAS operation.
This is possible in Java too using AtomicMarkableReference, but is usually considered overly complex, slow and space-inefficient. Instead, what we do is borrow a technique from ConcurrentSkipListMap and use an intermediate, delegating entry. While this adds a little more complexity in traversal (you need to be aware of the presence of these marker entries when traversing the linked list), this performs better than an AtomicMarkableReference.
In this specific implementation, the 'extra information' stored in a reference is the fact that the entry holding the reference is in the process of being deleted. It is a common problem with lock-free linked lists when you have concurrent insert and delete operations that the newly inserted entry gets deleted as well, since it attaches itself to the entry being concurrently deleted. When the entry to be removed marks its references, however, this makes other threads aware of the fact and cause CAS operations on the reference to fail and retry.
Performance
Aside from maintaining order of entries and being thread-safe, performance was one of the other goals. The target is to achieve constant-time performance - O(1) - for all operations on DataContainer.
The clhttp://3.bp.blogspot.com/_ca0W9t-Ryos/SgGwA2iw_vI/AAAAAAAAAKA/TpVMWo2Rq9U/s1600-h/FIFODataContainer.jpeg[]ass diagram (click to view in full-size) depicts the FIFODataContainer class. At its heart the FIFODataContainer mimics a JDK ConcurrentHashMap (CHM), making use of hashtable-like lockable segments. Unlike the segments in CHM, however, these segments are simpler as they support a much smaller set of operations.
Retrieving data from the container The use of segments allow for constant-time thread-safe get() and containsKey() operations. Iterators obtained from the DataContainer - which implements Iterable, and hence usable in for-each loops - and keySet() are immutable, thread-safe and efficient, using traversal of the linked list - making use of getNext() and getPrev() helpers. See below for details. Traversal is efficient and constant-time.
Updating the container When removing an entry, remove() locks the segment in question, removes the entry, and unlinks the entry. Both operations are thread-safe and constant-time. Locking the segment and removing the entry is pretty straightforward. Unlinking involves marking references, and then an attempt at CAS’ing next and previous references to bypass the removed entry. Order here is important - updates to the next reference needs to happen first, read on for more details as to why.
When performing a put(), the entry is created, segment locked and entry inserted into the segment. The entry is then inserted at the tail of the linked list. Again, both operations are thread-safe and constant-time. Linking at the tail involves careful CAS’ing of references on the new entry, the tail dummy entry and the former last entry in the list.
Maintaining a lock-free, concurrent doubly linked list It is important to note that the entries in this implementation are doubly linked. This is critical since, unlike the JDK’s ConcurrentSkipListMap, we use a hashtable to look up entries to be removed, to achieve constant time performance in lookup. Locating the parent entry to update a reference needs to be constant-time as well, and hence the need for a previous reference. Doubly-linked lists make things much trickier though, as there two references to update atomically (yes, that sounds wrong!)
Crucially, what we do not care about - and do not support - is reverse-order traversal. This means that we only really care about maintaining accuracy in the forward direction of the linked list, and treat the previous reference as an approximation to an entry somewhere behind the current entry. Previous references can then be corrected - using the correctPrev() helper method described below - to locate the precise entry behind the current entry. By placing greater importance on the forward direction of the list, this allows us to reliably CAS the forward reference even if the previous reference CAS fails. It is hence critical that whenever any references are updated, the next reference is CAS’d first, and only on this success the previous reference CAS is attempted. The same order applies with marking references. Also, it is important that any process that touches an entry that observes that the next pointer is marked but the previous pointer is not, attempts to mark the previous pointer before attempting any further steps.
The specific functions we need to expose, to support DataContainer operations, are:
void linkAtEnd(LinkedEntry entry);
void unlink(LinkedEntry entry);
LinkedEntry correctPrev(LinkedEntry suggestedPrev, LinkedEntry current);
LinkedEntry getNext(LinkedEntry current);
LinkedEntry getPrev(LinkedEntry current);
These are exposed as protected final methods, usable by FIFODataContainer and its subclasses. The implementations themselves use a combination of CAS’s on a LinkedEntry’s next and previous pointers, marking references, and helper correction of previous pointers when using getNext() and getPrevious() to traverse the list. Note that it is important that only the last two methods are used when traversing rather than directly accessing a LinkedEntry’s references - since markers need to be stepped over and links corrected.
Please refer to Lock-Free Deques and Doubly Linked Lists for details of the algorithm steps.


== Creating New Validation Types ==
ValidateThis ships with a number of built in validation types, the complete list can be found in the [[Validation Types Supported By ValidateThis]] section.
In order to add a validation type to the framework, you'll need to create two ColdFusion components (cfcs), one for the server-side validations and one for the client-side validations.
We'll walk through an example of adding a simple validation type. Let's add a validation type called ''bigNumber'', which will check that a property contains a number that is al least 1,000.
Of course, we could just use the built-in ''min'' validation type for this, but that requires us to provide a parameter (''min'') each time we want to use the rule.
Let's assume that for some reason, we need to use this rule that states that the value of the property must be at least 1,000 over and over again in
our model, so perhaps it makes sense to create a new validation type for it.
=== Creating the Server-Side Validation ===
Each validation type has a corresponding ''Server Rule Validator'' (SRV) which is responsible for performing the test to determine whether a validation passes or fails.
The built-in validations have their SRVs stored in the ''/ValidateThis/server/'' folder, so a great place to start is to find an existing SRV that is
similar to the one you want to create and then use that as a basis.
As mentioned above, our validation type will not require a parameter, so let's find one that is similar. The SRV for the ''numeric'' validation type is a good candidate,
so we'll open up the file called ''ServerRuleValidator_Numeric.cfc''. Because we want our new validation type to be called ''bigNumber'', we'll save
a copy of this file as ''ServerRuleValidator_BigNumber.cfc''. Here's what our file will look like before we change anything:
There are a number of things to note here:
All SRVs should extend ValidateThis.server.AbstractServerRuleValidator. The SRV that we use as a template does not include the full path to
AbstractServerRuleValidator.cfc because it resides in the same folder. If you plan on putting your SRV into the framework's ''server'' folder then
this sytax is fine, but if you want to place your SRVs elsewhere (which is advisable), you'll need to specify the full path.
You only need to provide a ''validate'' method, and it should accept one argument, which is the validation object that the framework passes
in to it. Don't worry about how that works - you can just assume that your SRV will receive a validation object when the validate method is called.
The code inside the validate method should perform a test and then, if the test fails, call the ''fail'' method, passing in the validation object and
a default failure message to display. This effectively stores the validation failure in the validation object, from whence the framework will pick it up.
Note that if the test passes the validate method does nothing.
Note as well that the first part of the test that is performed above includes a call to the ''shouldTest' method. This is a built-in method that
is used to support optionality in the framework. It enables validations to be optional by only performing the test if the property in question has a
value. For this reason you should include a call to this method in your test, just as we see in this sample SRV.
Let's go ahead and change the above code to implement out bigNumber validation type:
Let's review the changes:
We added the full path to the ''extends'' attribute, to allow us to store our SRV anywhere we choose.
We updated the ''hint'' attribute to accurately describe the purpose of the component.
The signature of the validate function remains unchanged.
We kept the call to the ''shouldTest'' method in our if statement, and added a test for our criteria. Note that we get the value of the property in question by calling
the ''getObjectValue'' method on the validation object which is passed into the validate method. In this case we're going to issue a validation failure if that value is less than 1000.
Finally, we change the generated validation failure message to reflect this new test. Note how we can include the friendy name of the property in our message by using the
''getPropertyDesc'' method of the validation object.
We simply save this file as ServerRuleValidator_BigNumber.cfc and our server-side validation is in place.
=== Creating the Client-Side Validation ===
Each validation type has a corresponding ''Client Rule Scripter'' (CRS) which is responsible for generating the JavaScript required for the validation.
The built-in validations have their CRSs stored in the ''/ValidateThis/client/{JSImplementation}/'' folder, where {JSImplementation} is the name of
the JavaScript implementation. We'll therefore look in ''/ValidateThis/client/jQuery/'' to find a CRS on which to base our new validation type.
Creating these CRSs is quite a bit trickier than the SRVs because of the way the jQuery implementation code has been designed. It has been refactored
to eliminate code duplication, but that makes it more difficult to follow. We'll look at creating a CRS to support this new bigNumber validation type, basing it
on the 'ClientRuleScripter_Numeric.cfc'', but bear in mind that you may have to do some more digging for different types of client-side validations.
Support is always available via the [http://groups.google.ca/group/validatethis ValidateThis Google Group].
As before, let's open up ''ClientRuleScripter_Numeric.cfc'' and we'll save
a copy of it as ''ClientRuleScripter_BigNumber.cfc''. Here's what our file will look like before we change anything:
As before, there are a number of things to note here:
All CRSs should extend ValidateThis.client.jQuery.AbstractClientRuleScripter.
In this scenario you only need to provide a ''getRuleDef'' method, as all of the other logic required is in the AbstractClientRuleScripter. In other scenarios
you may have to override other methods. The getRuleDef method should accept one argument, which is the validation object that the framework passes
in to it.
The code inside the getRuleDef just returns a snippet of JavaScript code which is then wrapped with some other code by other methods in the AbstractClientRuleScripter.
For the ClientRuleScripter_Numeric component that method returned "number: true" as that's what the jQuery validation plugin expects for that type of validation.
You'll see below that we can provide a similar rule definition for out bigNumber validation.
Let's go ahead and change the above code to implement out bigNumber validation type:
Let's review the changes:
We added the full path to the ''extends'' attribute, to allow us to store our CRS anywhere we choose.
We updated the ''hint'' attribute to accurately describe the purpose of the component.
The signature of the getRuleDef function remains unchanged.
We changed the return value of the getRuleDef method to be "min: 1000".
We simply save this file as ClientRuleScripter_BigNumber.cfc and our client-side validation is in place.
=== Adding the New Validation Type to the Framework ===
With an SRV and CRS in place, we should now be able to use our new validation type, but how will the framework know about it? The simplest way to do that is to place the files in the folders
the the framework uses. So if you place your SRV in /ValidateThis/server/ and your CRS in /ValidateThis/client/jQuery/ the framework will pick them up automatically and you'll be good to go.
The downside with this approach is that you've now put something in a folder that is part of the official framework, and if you were to download a new version of the framework and replace your
entire installation with it you would lose your new validation type. For this reason it is possible to place your SRVs and CRSs in a folder that is outside of the framework.
You tell VT where to look for your SRVs and CRSs using two ValidateThis Config options: ''extraRuleValidatorComponentPaths'' and ''extraClientScriptWriterComponentPaths''.
'''extraRuleValidatorComponentPaths''' can contain a comma delimited list of paths to folders that contain your SRVs. When the framework loads, it will look in each of those folders for SRVs
and will add any it finds to the framework. This means that you can also override built-in validation types by placing an SRV with the same name in an external folder. Any SRV that it finds
will be available as a validation type.
'''extraClientScriptWriterComponentPaths''' can contain a comma delimited list of paths to folders that contain your CRSs. As the name of the setting suggests,
this is actually a list of paths to ClientScriptWriters, which are synonymous with JavaScript implementations. CRSs are expected to reside in a folder
that corresponds to their JavaScript implementation. For the purposes of simply creating new validation types you can ignore that fact and simply put your CRSs in a folder and point to that folder.
=== Contributing New Validation Types to the Framework ===
If you have created a new validation type that you think may be useful to others, please [http://groups.google.ca/group/validatethis let us know]. We might just add it to the set of built-in validation
types that ship with the framework.


Please sign in
Username
Password
Sign in
IS LOGGED
Toggle navigation
Select Winners
List Winners
List Players
Edit 1st/2nd Quests
Logout


CFITSIO can apply a user-specified mathematical function to the value of every pixel in a FITS image, thus creating a new virtual image in computer memory that is then opened and read by the application program. The original FITS image is not modified by this process.
The image transformation specifier is appended to the input FITS file name and is enclosed in square brackets. It begins with the letters 'PIX' to distinguish it from other types of FITS file filters that are recognized by CFITSIO. The image transforming function may use any of the mathematical operators listed in the following 'Row Filtering Specification' section of this document. Some examples of image transform filters are:
[pix X * 2.0] - multiply each pixel by 2.0 [pix sqrt(X)] - take the square root of each pixel [pix X + #ZEROPT - add the value of the ZEROPT keyword [pix X>0 ? log10(X) : -99.] - if the pixel value is greater than 0, compute the base 10 log, else set the pixel = -99.Use the letter 'X' in the expression to represent the current pixel value in the image. The expression is evaluated independently for each pixel in the image and may be a function of 1) the original pixel value, 2) the value of other pixels in the image at a given relative offset from the position of the pixel that is being evaluated, and 3) the value of any header keywords. Header keyword values are represented by the name of the keyword preceded by the '#' sign.
To access the the value of adjacent pixels in the image, specify the (1-D) offset from the current pixel in curly brackets. For example
[pix (x{-1} + x + x{+1}) / 3]will replace each pixel value with the running mean of the values of that pixel and it's 2 neighboring pixels. Note that in this notation the image is treated as a 1-D array, where each row of the image (or higher dimensional cube) is appended one after another in one long array of pixels. It is possible to refer to pixels in the rows above or below the current pixel by using the value of the NAXIS1 header keyword. For example
[pix (x{-#NAXIS1} + x + x{#NAXIS1}) / 3]will compute the mean of each image pixel and the pixels immediately above and below it in the adjacent rows of the image. The following more complex example creates a smoothed virtual image where each pixel is a 3 x 3 boxcar average of the input image pixels:
[pix (X + X{-1} + X{+1} + X{-#NAXIS1} + X{-#NAXIS1 - 1} + X{-#NAXIS1 + 1} + X{#NAXIS1} + X{#NAXIS1 - 1} + X{#NAXIS1 + 1}) / 9.]If the pixel offset extends beyond the first or last pixel in the image, the function will evaluate to undefined, or NULL.
For complex or commonly used image filtering operations, one can write the expression into an external text file and then import it into the filter using the syntax '[pix @filename.txt]'. The mathematical expression can extend over multiple lines of text in the file. Any lines in the external text file that begin with 2 slash characters ('//') will be ignored and may be used to add comments into the file.
By default, the datatype of the resulting image will be the same as the original image, but one may force a different datatype by appended a code letter to the 'pix' keyword:
pixb - 8-bit byte image with BITPIX = 8 pixi - 16-bit integer image with BITPIX = 16 pixj - 32-bit integer image with BITPIX = 32 pixr - 32-bit float image with BITPIX = -32 pixd - 64-bit float image with BITPIX = -64Also by default, any other HDUs in the input file will be copied without change to the output virtual FITS file, but one may discard the other HDUs by adding the number '1' to the 'pix' keyword (and following any optional datatype code letter). For example:
myfile.fits[3][pixr1 sqrt(X)]will create a virtual FITS file containing only a primary array image with 32-bit floating point pixels that have a value equal to the square root of the pixels in the image that is in the 3rd extension of the 'myfile.fits' file.


{% include 'ideabox/header.html' %}
Need inspiration?
Don't have any plans for the weekend?
Code one of suggested apps during the weekend and share the results!
{{ idea.description }}
{% if request.user == idea.author %} {% endif %}