QMMM Submodule¶
janus.qmmm.QMMM (hl_wrapper, ll_wrapper, sys_info) |
QMMM class for QMMM computations |
janus.qmmm.AQMMM (hl_wrapper, ll_wrapper, …) |
AQMMM super class for adaptive QMMM computations. |
janus.qmmm.OniomXS (hl_wrapper, ll_wrapper, …) |
Class for the Oniom-XS adaptive QM/MM method. |
janus.qmmm.HotSpot (hl_wrapper, ll_wrapper, …) |
Class for the Hot Spot adaptive QM/MM method. |
janus.qmmm.PAP (hl_wrapper, ll_wrapper, sys_info) |
Class for the PAP adaptive QM/MM method. |
janus.qmmm.SAP (hl_wrapper, ll_wrapper, sys_info) |
Class for the SAP adaptive QM/MM method. |
janus.qmmm.DAS (hl_wrapper, ll_wrapper, sys_info) |
Class for the Oniom-XS adaptive QM/MM method. |
QMMM¶
-
class
janus.qmmm.
QMMM
(hl_wrapper, ll_wrapper, sys_info, sys_info_format='pdb', qm_atoms=[], qmmm_scheme='subtractive', embedding_method='Mechanical', boundary_treatment='link_atom', link_atom_element='H')¶ Bases:
object
QMMM class for QMMM computations
Parameters: - hl_wrapper (
MMWrapper
subclass orQMWrapper
subclass) – Wrapper for performing the high-level computation. Traditionally QM but user can define MM. - ll_wrapper (
MMWrapper
subclass) – Wrapper for performing the low-level computation - sys_info (str) – A string with the filename or a list with multiple filenames that contain position and topology information.
- sys_info_format (str) – Describes what kind of input is contained in sys_info. Default is pdb.
- qm_atoms (list) – Indicies that define the QM region. Only static in traditional QM/MM
- qmmm_scheme (str) – Scheme for computing QM/MM energies and gradients, only substractive available(default)
- embedding_method (str) – Embedding method to use for QM/MM. Mechanical(default) and Electrostatic available
- boundary_treatment (str) – Method for treating dangling bonds in the QM region, link_atom(default), RC, and RCD available
- link_atom_element – Element to use for link atom, default is H. Beware of using others (not all functionality tested)
-
compute_gradients
(system)¶ Computes the QM/MM gradients
Note
RCD gradients currently not implemented
Parameters: system ( System
) – The system in which to save qmmm energy and forces
-
convert_input
(fil, form)¶ Converts a set of input files into a MD trajectory
Parameters: - fil (str) – A string with the filename or a list with multiple filenames that contain position and topology information.
- form (str) – Describes what kind of input is contained in sys_info. Default is pdb.
Returns: Return type: MDtraj object
-
electrostatic
(system, main_info)¶ Gets energies of needed components and computes a QM/MM energy with a subtractive electrostatic embedding scheme
- E(QM/MM) = E(MM no coulomb)_entire_sys - E(MM no coulomb)_primary_subsys
- E(QM)_primary_subsys + E(MM just coulomb)_secondary_subsys
Parameters: - system (
System
) – The system in which to save qmmm energy and forces - main_info (dict) – contains the energy and forces for the whole system
-
find_boundary_bonds
(qm_atoms=None)¶ Identified any covalent bonds that the QM/MM boundary cuts across
Parameters: qm_atoms (list) – Indicies corresponding to the atoms in the primary subsystem. Default is None and uses self.qm_atoms Examples
>>> find_boundary_bonds() find_boundary_bonds(qm_atoms=[0,1,2,3])
-
get_external_charges
(system)¶ Gets the point charges of atoms from secondary subsystem for electrostatic embedding
Parameters: system ( System
) – The system in which to save qmmm energy and forcesReturns: charges and corresponding positions in angstroms as xyz coordinates Return type: list
-
get_forces
(run_ID=None)¶ Function to return qmmm forces
Parameters: run_ID (int) – identifies which step to get forces from Returns: qmmm forces in au/bohr Return type: dict Examples
>>> forces = get_forces()
-
get_redistributed_positions
(positions, bonds, mm)¶ Gets the positions for the redistributed point charges in the RC and RCD schemes
Parameters: - positions (list) –
- bonds (list) – indices of all atoms (in secondary subsystem) bonded to M1
- mm (int) – the index of M1
Returns: positions for the redistributed charges
Return type: list
-
make_primary_subsys_trajectory
(qm_atoms=None)¶ Creates a MDtraj trajectory object with just the primary subsystem, and adds in any link atoms
Note
Currently adds just H as link atom, need to expand. Also, H is added as a very specific H1 atom, or else the connectivity in the create_new_residue_templates function in openmm gets messed up and gives a “set of atoms match but bonds are different error”
Parameters: qm_atoms (list) – atom indicies corresponding to the atoms in the primary subsystem. Default is None and uses self.qm_atoms Returns: - MDtraj trajectory object
- list – The link atom indices in traj
Examples
>>> make_primary_subsys_trajectory([0,1,2]) make_primary_subsys_trajectory()
-
make_second_subsys_trajectory
(qm_atoms=None)¶ Creates a MDtraj trajectory object with just the secondary subsystem
Parameters: qm_atoms (list) – atom indicies corresponding to the atoms in the primary subsystem. Default is None and uses self.qm_atoms Returns: Return type: MDtraj trajectory object Examples
>>> make_second_subsys_trajectory([0,1,2]) make_second_subsys_trajectory()
-
mechanical
(system, main_info)¶ Gets energies of needed components and computes a QM/MM energy with a subtractive mechanical embedding scheme using the formula
E(QM/MM) = E(MM)_entire_sys - E(MM)_primary_subsys + E(QM)_primary_subsys
Parameters: - system (
System
) – The system in which to save qmmm energy and forces - main_info (dict) – contains the energy and forces for the whole system
- system (
-
prepare_link_atom
()¶ Identifies where to put link atom. Saves the qm and mm atom associated with the bond being cut across the QM/MM boundary and computes the g scaling factor for the link atom.
-
run_qmmm
(main_info, wrapper_type)¶ Drives QM/MM computation. Updates the positions and topology given in main_info, and determines the QM/MM energy and gradients
Parameters: - main_info (dict) – Contains the energy, forces, topology, and position information for the whole system
- wrapper_type (str) – Defines the program used to obtain main_info
-
update_traj
(position, topology, wrapper_type)¶ Updates the positions and topology of self.traj, a MDtraj trajectory object
Parameters: - positions (list) – positions in nm
- topology (OpenMM topology object) – If the mm program is OpenMM
- wrapper_type (str) – Defines the program used to obtain topology and positions
- hl_wrapper (
AQMMM¶
-
class
janus.qmmm.
AQMMM
(hl_wrapper, ll_wrapper, sys_info, sys_info_format, qmmm_param, class_type)¶ Bases:
abc.ABC
,janus.qmmm.qmmm.QMMM
AQMMM super class for adaptive QMMM computations. Inherits from QMMM class.
Note
Since AQMMM is a super class and has abstract methods cannot actually instantiate AQMMM object, but only its child objectscompute_COM
(atoms)Computes the center of mass of a specified group compute_gradients
(system)Computes the QM/MM gradients compute_lamda_i
(r_i)Computes the switching function and the derivative of the switching function defined as a 5th order spline: compute_zero_energy
()Compute the energy of the isolated groups at their minimum geometry convert_input
(fil, form)Converts a set of input files into a MD trajectory define_buffer_zone
(qm_center)Determines buffer group atoms. edit_atoms
(atoms, res_idx[, remove, add])Edits a given list of atoms based on give parameters. electrostatic
(system, main_info)Gets energies of needed components and computes a QM/MM energy with a subtractive electrostatic embedding scheme find_boundary_bonds
([qm_atoms])Identified any covalent bonds that the QM/MM boundary cuts across find_buffer_atoms
(qm_center)Find the buffer groups whose COM falls in between Rmin and Rmax get_Rmax
()Function to return self.Rmin get_Rmin
()Function to return self.Rmin get_external_charges
(system)Gets the point charges of atoms from secondary subsystem for electrostatic embedding get_forces
([run_ID])Function to return qmmm forces get_redistributed_positions
(positions, bonds, mm)Gets the positions for the redistributed point charges in the RC and RCD schemes get_residue_info
(idx[, qm_center_xyz])Gets the COM information and distance from the qm_center for a give residue. get_zero_energy
()Incorporates the zero energy of groups to the total qmmm energy make_primary_subsys_trajectory
([qm_atoms])Creates a MDtraj trajectory object with just the primary subsystem, and adds in any link atoms make_second_subsys_trajectory
([qm_atoms])Creates a MDtraj trajectory object with just the secondary subsystem mechanical
(system, main_info)Gets energies of needed components and computes a QM/MM energy with a subtractive mechanical embedding scheme using the formula partition
(info)Function implemented in individual child classes prepare_link_atom
()Identifies where to put link atom. run_aqmmm
()Function implemented in individual child classes run_qmmm
(main_info, wrapper_type)Drives QM/MM computation. set_Rmax
(Rmax)Function to set self.Rmax set_Rmin
(Rmin)Function to set self.Rmin update_traj
(position, topology, wrapper_type)Updates the positions and topology of self.traj, a MDtraj trajectory object Attributes
nm_to_angstrom
-
compute_COM
(atoms)¶ Computes the center of mass of a specified group
Parameters: atoms (list) – indices defining the group to compute the COM for Returns: - numpy array – COM xyz coordinates
- dict – the indices of each atom in the group and the atomic weight for each atom
- dict – the indices of each atom in the group and the weight ratio of each atom to the total weight of the group (sum of all atomic weights)
-
compute_lamda_i
(r_i)¶ Computes the switching function and the derivative of the switching function defined as a 5th order spline:
\lambda_i = -6x^5 + 15x^4 - 10x^3 + 1 d_{\lambda_i} = -30x^4 + 60x^3 - 30x^2
where x is the reduced distance (r_i - rmin)/(rmax - rmin) of buffer group i
Parameters: r_i (float) – the distance between the qm center and the COM (in angstroms) Returns: - float – lamda_i, unitless
- float – derivative of lamda_i, unitless
-
compute_zero_energy
()¶ Compute the energy of the isolated groups at their minimum geometry
-
define_buffer_zone
(qm_center)¶ Determines buffer group atoms. Gets the buffer groups in the buffer zone based on a distance partitioning scheme, saves each buffer group as a
Buffer
object, and saves all buffer groups in the dictionary self.buffer_groups. For water as a solvent, considers the whole water molecule as a buffer group.Note
Currently only worked with explicit solvent based systems. Cannot treat buffer atoms that are part of large molecular structures (e.g., proteins).
Parameters: qm_center (list) – the indicies that make up the qm center
-
edit_atoms
(atoms, res_idx, remove=False, add=False)¶ Edits a given list of atoms based on give parameters.
Parameters: - atoms (list) – List of atom indicies to performed the desired action on
- res_idx (int) – Index of the residue
- remove (bool) – Whether to remove the atoms of residue res_idx from atoms. Default is False.
- add (bool) – Whether to add the atoms of residue res_idx to atoms Default is False.
Returns: List of edited atoms
Return type: list
Examples
>>> atoms = edit_qm_atoms(atoms=[0,1,2], res_idx=0, remove=True)
-
find_buffer_atoms
(qm_center)¶ Find the buffer groups whose COM falls in between Rmin and Rmax
Parameters: qm_center (list) – the indicies that make up the qm center
-
get_Rmax
()¶ Function to return self.Rmin
Returns: the distance from qm center to outer limit of buffer zone in angstroms Return type: float
-
get_Rmin
()¶ Function to return self.Rmin
Returns: the distance from qm center to inner limit of buffer zone in angstroms Return type: float
-
get_residue_info
(idx, qm_center_xyz=None)¶ Gets the COM information and distance from the qm_center for a give residue. Saves the information in a
Buffer
object.Parameters: - idx (int) – index of the residue
- qm_center_xyz (list) – XYZ coordinates of the qm_center as a list
Returns: Return type:
-
get_zero_energy
()¶ Incorporates the zero energy of groups to the total qmmm energy
-
nm_to_angstrom
= 10.0¶
-
partition
(info)¶ Function implemented in individual child classes
-
run_aqmmm
()¶ Function implemented in individual child classes
-
run_qmmm
(main_info, wrapper_type)¶ Drives QM/MM computation. Updates the positions and topology given in main_info, determines the partitions to be computed, for each partition, determines the QM/MM energy and gradients, then interpolates all partitions using specified adaptive QM/MM scheme
Parameters: - main_info (dict) – Contains the energy, forces, topology, and position information for the whole system
- wrapper_type (str) – Defines the program used to obtain main_info
-
set_Rmax
(Rmax)¶ Function to set self.Rmax
Parameters: Rmax (float) – the distance from qm center to outer limit of buffer zone in angstroms
-
set_Rmin
(Rmin)¶ Function to set self.Rmin
Parameters: Rmin (float) – the distance from qm center to inner limit of buffer zone in angstroms
-
ONIOM-XS¶
-
class
janus.qmmm.
OniomXS
(hl_wrapper, ll_wrapper, sys_info, sys_info_format='pdb', qm_center=[0], partition_scheme='distance', Rmin=3.8, Rmax=4.5, qmmm_param={}, **kwargs)¶ Bases:
janus.qmmm.aqmmm.AQMMM
Class for the Oniom-XS adaptive QM/MM method. Inherits from AQMMM class
Parameters: - hl_wrapper (
MMWrapper
subclass orQMWrapper
subclass) – Wrapper for performing the high-level computation. Traditionally QM but user can define MM. - ll_wrapper (
MMWrapper
subclass) – Wrapper for performing the low-level computation - sys_info (str) – A string with the filename or a list with multiple filenames that contain position and topology information.
- sys_info_format (str) – Describes what kind of input is contained in sys_info. Default is pdb.
- qm_center (list) – Atoms that define the qm center, default is [0]. If more than one index is given, COM is used as qm_center
- partition_scheme (str) – Scheme to use to define buffer groups, default is distance (only scheme available as of now)
- Rmin (float) – Inner radius for distance partition in angstroms, default is 3.8
- Rmax (float) – Outer radius for distance partition in angstroms, default is 4.5
- qmmm_param – A dictionary with any parameters to pass into the QMMM class. See QMMM class for specifics
-
get_switching_function
()¶ Averages the individual switching functions of each buffer group
Returns: The average of the switching functions Return type: float
-
partition
(qm_center=None)¶ Finds the partitions as required by the ONIOM-XS method and saves each partition as a system object. Saves all systems in the dictionary self.systems
Parameters: qm_center (list) – atoms that define the qm center, default is None
-
run_aqmmm
()¶ Interpolates the energy and gradients from each partition according to the ONIOM-XS method
- hl_wrapper (
Hot Spot¶
-
class
janus.qmmm.
HotSpot
(hl_wrapper, ll_wrapper, sys_info, sys_info_format='pdb', qm_center=[0], partition_scheme='distance', Rmin=3.8, Rmax=4.5, qmmm_param={}, **kwargs)¶ Bases:
janus.qmmm.aqmmm.AQMMM
Class for the Hot Spot adaptive QM/MM method. Inherits from AQMMM class
Parameters: - hl_wrapper (
MMWrapper
subclass orQMWrapper
subclass) – Wrapper for performing the high-level computation. Traditionally QM but user can define MM. - ll_wrapper (
MMWrapper
subclass) – Wrapper for performing the low-level computation - sys_info (str) – A string with the filename or a list with multiple filenames that contain position and topology information.
- sys_info_format (str) – Describes what kind of input is contained in sys_info. Default is pdb.
- qm_center (list) – Atoms that define the qm center, default is [0]. If more than one index is given, COM is used as qm_center
- partition_scheme (str) – Scheme to use to define buffer groups, default is distance (only scheme available as of now)
- Rmin (float) – Inner radius for distance partition in angstroms, default is 3.8
- Rmax (float) – Outer radius for distance partition in angstroms, default is 4.5
- qmmm_param – A dictionary with any parameters to pass into the QMMM class. See QMMM class for specifics
-
compute_lamda_i
(r_i)¶ Computes the switching function of the Hot-Spot method and overrides the compute_lamda_i function from the AQMMM class
Parameters: r_i (float) – the distance between the qm center and the COM in angstroms Returns: - float – lamda_i, unitless
- None – placeholder for the derivative of r_i
-
partition
(qm_center=None)¶ Finds the partitions as required by the Hot-Spot method and saves each partition as a system object. Saves all systems in the dictionary self.systems
Parameters: qm_center (list) – atoms that define the qm center, default is None
-
run_aqmmm
()¶ Interpolates the energy and gradients from each partition according to the Hot-Spot method
- hl_wrapper (
PAP¶
-
class
janus.qmmm.
PAP
(hl_wrapper, ll_wrapper, sys_info, sys_info_format='pdb', modified_variant=False, qm_center=[0], partition_scheme='distance', Rmin=3.8, Rmax=4.5, qmmm_param={}, **kwargs)¶ Bases:
janus.qmmm.aqmmm.AQMMM
Class for the PAP adaptive QM/MM method. Inherits from AQMMM class
Parameters: - hl_wrapper (
MMWrapper
subclass orQMWrapper
subclass) – Wrapper for performing the high-level computation. Traditionally QM but user can define MM. - ll_wrapper (
MMWrapper
subclass) – Wrapper for performing the low-level computation - sys_info (str) – A string with the filename or a list with multiple filenames that contain position and topology information.
- sys_info_format (str) – Describes what kind of input is contained in sys_info. Default is pdb.
- modified_variant (bool) – Whether to use the modified version mPAP, which disregards gradient terms that come from the switching function. Default is False.
- qm_center (list) – Atoms that define the qm center, default is [0]. If more than one index is given, COM is used as qm_center
- partition_scheme (str) – Scheme to use to define buffer groups, default is distance (only scheme available as of now)
- Rmin (float) – Inner radius for distance partition in angstroms, default is 3.8
- Rmax (float) – Outer radius for distance partition in angstroms, default is 4.5
- qmmm_param – A dictionary with any parameters to pass into the QMMM class. See QMMM class for specifics
-
compute_sf_gradient
()¶ Computes forces due to the gradient of the switching function
Returns: Forces due to gradient of switching function Return type: dict
-
get_combos
(items=None)¶ Gets all combinations of a given list of indices
Parameters: items (list) – indices to get combinations for Returns: all possible combinations Return type: list Examples
>>> combos = get_combos([1,2])
In this case, combos will return >>> [(1), (2), (1,2)]
-
partition
(qm_center=None)¶ Finds the partitions as required by the PAP method and saves each partition as a system object. Saves all systems in the dictionary self.systems
Parameters: qm_center (list) – atoms that define the qm center, default is None
-
run_aqmmm
()¶ Interpolates the energy and gradients from each partition according to the PAP method
- hl_wrapper (
SAP¶
-
class
janus.qmmm.
SAP
(hl_wrapper, ll_wrapper, sys_info, sys_info_format='pdb', modified_variant=False, qm_center=[0], partition_scheme='distance', Rmin=3.8, Rmax=4.5, qmmm_param={}, **kwargs)¶ Bases:
janus.qmmm.aqmmm.AQMMM
Class for the SAP adaptive QM/MM method. Inherits from AQMMM class
Parameters: - hl_wrapper (
MMWrapper
subclass orQMWrapper
subclass) – Wrapper for performing the high-level computation. Traditionally QM but user can define MM. - ll_wrapper (
MMWrapper
subclass) – Wrapper for performing the low-level computation - sys_info (str) – A string with the filename or a list with multiple filenames that contain position and topology information.
- sys_info_format (str) – Describes what kind of input is contained in sys_info. Default is pdb.
- modified_variant (bool) – Whether to use the modified version mPAP, which disregards gradient terms that come from the switching function. Default is False.
- qm_center (list) – Atoms that define the qm center, default is [0]. If more than one index is given, COM is used as qm_center
- partition_scheme (str) – Scheme to use to define buffer groups, default is distance (only scheme available as of now)
- Rmin (float) – Inner radius for distance partition in angstroms, default is 3.8
- Rmax (float) – Outer radius for distance partition in angstroms, default is 4.5
- qmmm_param – A dictionary with any parameters to pass into the QMMM class. See QMMM class for specifics
-
compute_sf_gradient
()¶ Computes forces due to the gradient of the switching function
Returns: Forces due to gradient of switching function Return type: dict
-
get_combos
(items=None, buffer_distance=None)¶ A given list of indices is sorted by distance and the combinations is found based on distance order. See example
Parameters: - items (list) – indices to get combinations for
- buffer_distance (dict) – indices from items and their distances from the qm center
Returns: combinations
Return type: list
Examples
>>> combos = get_combos([1,2,3])
If 1 was closer to the center than 2, and 2 closer to the center than 3, functions returns following: >>> [(1), (1,2), (1,2,3)]
-
get_switching_functions
()¶ Computes switching function for SAP computations and saves to each buffer group object
-
partition
(qm_center=None)¶ Finds the partitions as required by the SAP method and saves each partition as a system object. Saves all systems in the dictionary self.systems
Parameters: qm_center (list) – atoms that define the qm center, default is None
-
run_aqmmm
()¶ Interpolates the energy and gradients from each partition according to the SAP method
- hl_wrapper (
DAS¶
-
class
janus.qmmm.
DAS
(hl_wrapper, ll_wrapper, sys_info, sys_info_format='pdb', qm_center=[0], partition_scheme='distance', Rmin=3.8, Rmax=4.5, qmmm_param={}, **kwargs)¶ Bases:
janus.qmmm.aqmmm.AQMMM
Class for the Oniom-XS adaptive QM/MM method. Inherits from AQMMM class
Parameters: - hl_wrapper (
MMWrapper
subclass orQMWrapper
subclass) – Wrapper for performing the high-level computation. Traditionally QM but user can define MM. - ll_wrapper (
MMWrapper
subclass) – Wrapper for performing the low-level computation - sys_info (str) – A string with the filename or a list with multiple filenames that contain position and topology information.
- sys_info_format (str) – Describes what kind of input is contained in sys_info. Default is pdb.
- qm_center (list) – Atoms that define the qm center, default is [0]. If more than one index is given, COM is used as qm_center
- partition_scheme (str) – Scheme to use to define buffer groups, default is distance (only scheme available as of now)
- Rmin (float) – Inner radius for distance partition in angstroms, default is 3.8
- Rmax (float) – Outer radius for distance partition in angstroms, default is 4.5
- qmmm_param – A dictionary with any parameters to pass into the QMMM class. See QMMM class for specifics
-
compute_lamda_i
(r_i)¶ Computes the switching function of the DAS method and overrides the compute_lamda_i function from the AQMMM class
Parameters: r_i (float) – the distance between the qm center and the COM in angstroms Returns: - float – lamda_i, unitless
- None – placeholder for the derivative of r_i
-
get_combos
(items=None)¶ Gets all combinations of a given list of indices according to the DAS formulation
Parameters: items (list) – indices to get combinations for Returns: combinations Return type: list
-
partition
(qm_center=None)¶ Finds the partitions as required by the PAP method and saves each partition as a system object. Saves all systems in the dictionary self.systems
Parameters: qm_center (list) – atoms that define the qm center, default is None
-
run_aqmmm
()¶ Interpolates the energy and gradients from each partition according to the PAP method
- hl_wrapper (


updated desc. goes here
Paragraph text goes here and fills up the panel with super useful information that you'll absolutely love to read. this is here to test in panel keyboard controls
and some more text
Paragraph text goes here and fills up the panel with super useful information that you'll absolutely love to read. this is here to test in panel keyboard controls
Paragraph text goes here and fills up the panel with super useful information that you'll absolutely love to read. this is here to test in panel keyboard controls
...


Integrate-system
integrates the system
y_k^^ = f_k(y_1, y_2, ..., y_n), k = 1, ..., n
of differential equations with the method of Runge-Kutta.
The parameter system-derivative is a function that takes a system state (a vector of values for the state variables y_1, ..., y_n) and produces a system derivative (the values y_1^^, ...,y_n^^). The parameter initial-state provides an initial system state, and h is an initial guess for the length of the integration step.
The value returned by integrate-system
is an infinite stream of
system states.
(define integrate-system (lambda (system-derivative initial-state h) (let ((next (runge-kutta-4 system-derivative h))) (letrec ((states (cons initial-state (delay (map-streams next states))))) states))))
Runge-Kutta-4
takes a function, f, that produces a
system derivative from a system state. Runge-Kutta-4
produces a function that takes a system state and
produces a new system state.
(define runge-kutta-4 (lambda (f h) (let ((*h (scale-vector h)) (*2 (scale-vector 2)) (*1/2 (scale-vector (/ 1 2))) (*1/6 (scale-vector (/ 1 6)))) (lambda (y) ;; y is a system state (let* ((k0 (*h (f y))) (k1 (*h (f (add-vectors y (*1/2 k0))))) (k2 (*h (f (add-vectors y (*1/2 k1))))) (k3 (*h (f (add-vectors y k2))))) (add-vectors y (*1/6 (add-vectors k0 (*2 k1) (*2 k2) k3)))))))) (define elementwise (lambda (f) (lambda vectors (generate-vector (vector-length (car vectors)) (lambda (i) (apply f (map (lambda (v) (vector-ref v i)) vectors))))))) (define generate-vector (lambda (size proc) (let ((ans (make-vector size))) (letrec ((loop (lambda (i) (cond ((= i size) ans) (else (vector-set! ans i (proc i)) (loop (+ i 1))))))) (loop 0))))) (define add-vectors (elementwise +)) (define scale-vector (lambda (s) (elementwise (lambda (x) (* x s)))))
Map-streams
is analogous to map
: it applies its first
argument (a procedure) to all the elements of its second argument (a
stream).
(define map-streams (lambda (f s) (cons (f (head s)) (delay (map-streams f (tail s))))))
Infinite streams are implemented as pairs whose car holds the first element of the stream and whose cdr holds a promise to deliver the rest of the stream.
(define head car) (define tail (lambda (stream) (force (cdr stream))))
The following illustrates the use of integrate-system
in
integrating the system
C dv_C / dt = -i_L - v_C / R
L di_L / dt = v_C
which models a damped oscillator.
(define damped-oscillator (lambda (R L C) (lambda (state) (let ((Vc (vector-ref state 0)) (Il (vector-ref state 1))) (vector (- 0 (+ (/ Vc (* R C)) (/ Il C))) (/ Vc L)))))) (define the-states (integrate-system (damped-oscillator 10000 1000 .001) '#(1 0) .01))


{% extends "global/Page.html" %} {% load staticfiles otree %} {% block title %} Results {% endblock %} {% block content %}
Your remaining endowment: {{ endowment}}
Your contributions from this round to conservation fund were: {{savings}}
Your contributions from last round to conservation fund were: {{last_savings}}
Total contributions to the conservation fund to date:
| Other participants saved: | |
| Participant {{ p.id_in_group }}: | {{ p.savings }} |


Confirm Your Email Address
We sent you an email with instructions on how to confirm your email address. Please check your inbox and follow the instructions in the email.
We sent you an email with instructions on how to confirm your email address. Please check your inbox and follow the instructions in the email.
There seems to be a problem with the system, we may be down for maintainance. Please try again later.


Affirmation and Stereotype Threat
For week 7 of Phase 0 at DBC we have been given the task to write about the following.
Revisit your "Affirming your Values" blog post and relate it to what you learned about stereotype threat. How do you feel when you think about your values? Do you think it can help you mediate stereotype threat if you recognize you are in it? Can you think of any other exercises you can use to help you when you are feeling down (for whatever reason) at DBC?
I think all of us feel anxiety when it comes time to perform in a group setting, whether that is taking a test in school, or giving a talk to a group. In the past, when faced with this anxiety, and the thought that I cannot do this comes into my head, I stop myself and think of the accomplishments and acheivements I have had in the past and that this anxiety is unfounded because I have done harder things than this. This gives me the confidence to go on. But it has not always been possible to be aware of slipping into anxiety, anger, or other strong emotions.
From the DBC readings on meditation and self awareness, I am becoming aware of when I slip into feeling anxious, angry or any strong emotion. I am also beginning to recognize situations where I know that these things often happen, like meetings, or when giving presentations. I now start watching myself for the thoughts that go with these feelings and head them off by focusing on my breathing and thinking positive, uplifting things to myself.
I know that while at DBC I will feel highly stressed, anxious, and exhausted at times, and I will want to think that I cannot get through it, but I will say to myself that I got through phase 0 while working full time. I will look back on this accomplishment and push through.  I have also learned that taking short mental breaks is helpful. For me this involves getting away from working, usually going outside for fresh air and a short walk. Exercise also is great for stress reduction and helping me feel refreshed and happy. I am also expecting that pairing, helping and interacting with my cohort will help me feel happy and energized. I hope this feeling and energy will carry over to them to also feel happy, energized and good about themselves as well.


pyleaf.leaf_area_calculator_gui module¶
-
class
pyleaf.leaf_area_calculator_gui.
LeafAreaCalculatorGUI
(root)[source]¶ Bases:
object
Class LeafAreaCalculatorGUI is a Tkinter GUI manager, that is responsible for interacting with the user and displaying results. The backend application is a convulutional neural network that is trained with green, red and other colors, to generate a robust and reliable classifier that can detect green leaf within a given image in varying light conditions and leaf shades, and computes the area of the green leaf with respect to a fixed red square of 4 cm^2.
GUI includes two preview panes: left pane is the original window pane, that displays the original image and the name of image. right pane is the updated window pane, that displays the resultant analyzd image from classifier.
Under the left pane is a navigation bar, with which user can switch left or right through multiple images. This option is diabled if user is working on only one image.
-
IMAGE_HEIGHT
= 300¶
-
IMAGE_WIDTH
= 300¶
-
answer
(x)[source]¶ Allows user to select base image path from where all images in that folder can be polled for batch analysis. When user selects the default folder through the dialog box, all images in the selected folder are loaded in the original preview pane.
Parameters: x (Tk()) – Tkinter Instance of main window or root
-
change_result_preview
(every)[source]¶ Update the result window pane with the passed image.
Parameters: every (string) – name of the image file to load.
-
change_unit
(event)[source]¶ Function that allows the numerical leaf area result to switch between cm^2 and mm^2. The result is displayed in Leaf Area label field.
Parameters: event (Tkinter Button Press 1.) – Accept the button click event. Returns: Return ‘NA’ back if ‘NA’ is clicked. Return type: int
-
display_left
()[source]¶ The Left Arrow button of the navigation control under original preview pane. Disabled if navigation reaches 1/N , Enabled otherwise.
-
display_result
(area=None)[source]¶ Displays the area in cm^2 with an option to switch to mm^2 by clicking on the numerical result displayed.
Parameters: area (float, 2 bit decimal.) – The area to display in the ‘Leaf Area:’ field.
-
display_right
()[source]¶ The Right Arrow button of the navigation control under original preview pane. Disabled if navigation reaches N/N , Enabled otherwise.
-
display_this_image
(passed_image)[source]¶ Function that collects a passed image from disk and displays in the original preview window and updated result window.
Parameters: passed_image – The image name to be fetched from default_image_path and default_save_path
-
new_winF
()[source]¶ Function that creates a progress window to display progress of leaf analysis with multiple images. A new window updates the status with analysis of every leaf in the default_image_folder, and closes automatically when program processes all images.
The window is positioned to be in the centre of the main window.
-
process_all
()[source]¶ Function that is triggered when Batch Process feature is activated by user. Iterate over all images one by one from the list of images in default_image_path, and update the Leaf Area and preview panes as the results become available. While the operation is in progress, new window is popped that displays dynamic progress of task.
-
process_image
(every=None)[source]¶ Function that accepts only one image name as input, and performs analysis. Updates the Leaf Area and preview panes as the result become available. If no input is provides, iteratively processes all images in the global list_ maintained by class as list of all images in the default image path.
Parameters: every (string) – Image name to process
-
reset_workspace
()[source]¶ Resets the workspace to defaults. This provides a fresh GUI configuration to user. Clears all images in the default save path directory.
-
retrain_model
()[source]¶ Function retrain_model: Performs re-training of the classifier on user input from Tools->Retrain model. Note: User should retrain the model only if training images have changed, or classification model seems corrupt.
-
retrain_model_run
()[source]¶ Function retrain_model_run: Displays model training status to user. A window is popped up with message: Model Training In Process. Window is closed when model training is complete.
-
setDefaultImageLocation
()[source]¶ Function setDefaultImageLocation: Sets the default image directory to find images for analysis.
-
set_grid
()[source]¶ Creates a blueprint of the various GUI elements in a window of size 820x500. Tkinter Frame is creates and place geometry manager is used to position the elements exactly where desired. Positions labels ans preview panes in the desired locations, as per the GUI guidelines of this project.
Function set_menus: Sets the Menu tool bar for the application. User can select default image directory and perform batch process usind File and Tools menu options.
-


fun xContentBuilder(obj: Any): XContentBuilder
Turn common objects like maps, lists, values, etc. into an XContentBuilder. Supports whatever is supported in writeAny.


JavaScript (/ˈdʒɑːvəˌskrɪpt/[5]) is a high-level, dynamic, untyped, and interpreted programming language.[6] It has been standardized in the ECMAScript language specification.[7] Alongside HTML and CSS, it is one of the three essential technologies of World Wide Web content production; the majority of websites employ it and it is supported by all modern web browsers without plug-ins.[6] JavaScript is prototype-based with first-class functions, making it a multi-paradigm language, supporting object-oriented,[8] imperative, and functional programming styles.[6]
FEATURES
AngularJS (commonly referred to as "Angular" or "Angular.js") is an open-source web application framework mainly maintained by Google and by a community of individuals and corporations to address many of the challenges encountered in developing single-page applications.
GoogleMATERIALDesign
GroupANDDirect Chat
VoiceANDVideo Calls
Ping'artsFEATURE
EmojiANDGIF's
FastANDSafe!
FAQ
Contact Us
Welcome to the future
Web Components usher in a new era of web development based on encapsulated and interoperable custom elements that extend HTML itself
2015 © All Rights Reserved
JavaScript (/ˈdʒɑːvəˌskrɪpt/[5]) is a high-level, dynamic, untyped, and interpreted programming language.[6] It has been standardized in the ECMAScript language specification.[7] Alongside HTML and CSS, it is one of the three essential technologies of World Wide Web content production;
FEATURES
AngularJS (commonly referred to as "Angular" or "Angular.js") is an open-source web application framework mainly maintained by Google and by a community of individuals and corporations to address many of the challenges encountered in developing single-page applications.
FAQ
Contact Us
Welcome to the future
Web Components usher in a new era of web development based on encapsulated and interoperable custom elements that extend HTML itself
2015 © All Rights Reserved


public class RenderingHints extends Object implements Map<Object,Object>, Cloneable
RenderingHints
class defines and manages collections of
keys and associated values which allow an application to provide input
into the choice of algorithms used by other classes which perform
rendering and image manipulation services.
The Graphics2D
class, and classes that implement
BufferedImageOp
and
RasterOp
all provide methods to get and
possibly to set individual or groups of RenderingHints
keys and their associated values.
When those implementations perform any rendering or image manipulation
operations they should examine the values of any RenderingHints
that were requested by the caller and tailor the algorithms used
accordingly and to the best of their ability.
Note that since these keys and values are hints, there is
no requirement that a given implementation supports all possible
choices indicated below or that it can respond to requests to
modify its choice of algorithm.
The values of the various hint keys may also interact such that
while all variants of a given key are supported in one situation,
the implementation may be more restricted when the values associated
with other keys are modified.
For example, some implementations may be able to provide several
types of dithering when the antialiasing hint is turned off, but
have little control over dithering when antialiasing is on.
The full set of supported keys and hints may also vary by destination
since runtimes may use different underlying modules to render to
the screen, or to BufferedImage
objects,
or while printing.
Implementations are free to ignore the hints completely, but should try to use an implementation algorithm that is as close as possible to the request. If an implementation supports a given algorithm when any value is used for an associated hint key, then minimally it must do so when the value for that key is the exact value that specifies the algorithm.
The keys used to control the hints are all special values that
subclass the associated RenderingHints.Key
class.
Many common hints are expressed below as static constants in this
class, but the list is not meant to be exhaustive.
Other hints may be created by other packages by defining new objects
which subclass the Key
class and defining the associated values.
| Modifier and Type | Class and Description |
|---|---|
static class |
RenderingHints.Key
Defines the base type of all keys used along with the
RenderingHints class to control various
algorithm choices in the rendering and imaging pipelines. |
| Modifier and Type | Field and Description |
|---|---|
static RenderingHints.Key |
KEY_ALPHA_INTERPOLATION
Alpha interpolation hint key.
|
static RenderingHints.Key |
KEY_ANTIALIASING
Antialiasing hint key.
|
static RenderingHints.Key |
KEY_COLOR_RENDERING
Color rendering hint key.
|
static RenderingHints.Key |
KEY_DITHERING
Dithering hint key.
|
static RenderingHints.Key |
KEY_FRACTIONALMETRICS
Font fractional metrics hint key.
|
static RenderingHints.Key |
KEY_INTERPOLATION
Interpolation hint key.
|
static RenderingHints.Key |
KEY_RENDERING
Rendering hint key.
|
static RenderingHints.Key |
KEY_STROKE_CONTROL
Stroke normalization control hint key.
|
static RenderingHints.Key |
KEY_TEXT_ANTIALIASING
Text antialiasing hint key.
|
static RenderingHints.Key |
KEY_TEXT_LCD_CONTRAST
LCD text contrast rendering hint key.
|
static Object |
VALUE_ALPHA_INTERPOLATION_DEFAULT
Alpha interpolation hint value -- alpha blending algorithms
are chosen by the implementation for a good tradeoff of
performance vs.
|
static Object |
VALUE_ALPHA_INTERPOLATION_QUALITY
Alpha interpolation hint value -- alpha blending algorithms
are chosen with a preference for precision and visual quality.
|
static Object |
VALUE_ALPHA_INTERPOLATION_SPEED
Alpha interpolation hint value -- alpha blending algorithms
are chosen with a preference for calculation speed.
|
static Object |
VALUE_ANTIALIAS_DEFAULT
Antialiasing hint value -- rendering is done with a default
antialiasing mode chosen by the implementation.
|
static Object |
VALUE_ANTIALIAS_OFF
Antialiasing hint value -- rendering is done without antialiasing.
|
static Object |
VALUE_ANTIALIAS_ON
Antialiasing hint value -- rendering is done with antialiasing.
|
static Object |
VALUE_COLOR_RENDER_DEFAULT
Color rendering hint value -- perform color conversion
calculations as chosen by the implementation to represent
the best available tradeoff between performance and
accuracy.
|
static Object |
VALUE_COLOR_RENDER_QUALITY
Color rendering hint value -- perform the color conversion
calculations with the highest accuracy and visual quality.
|
static Object |
VALUE_COLOR_RENDER_SPEED
Color rendering hint value -- perform the fastest color
conversion to the format of the output device.
|
static Object |
VALUE_DITHER_DEFAULT
Dithering hint value -- use a default for dithering chosen by
the implementation.
|
static Object |
VALUE_DITHER_DISABLE
Dithering hint value -- do not dither when rendering geometry.
|
static Object |
VALUE_DITHER_ENABLE
Dithering hint value -- dither when rendering geometry, if needed.
|
static Object |
VALUE_FRACTIONALMETRICS_DEFAULT
Font fractional metrics hint value -- character glyphs are
positioned with accuracy chosen by the implementation.
|
static Object |
VALUE_FRACTIONALMETRICS_OFF
Font fractional metrics hint value -- character glyphs are
positioned with advance widths rounded to pixel boundaries.
|
static Object |
VALUE_FRACTIONALMETRICS_ON
Font fractional metrics hint value -- character glyphs are
positioned with sub-pixel accuracy.
|
static Object |
VALUE_INTERPOLATION_BICUBIC
Interpolation hint value -- the color samples of 9 nearby
integer coordinate samples in the image are interpolated using
a cubic function in both
X and Y to produce
a color sample. |
static Object |
VALUE_INTERPOLATION_BILINEAR
Interpolation hint value -- the color samples of the 4 nearest
neighboring integer coordinate samples in the image are
interpolated linearly to produce a color sample.
|
static Object |
VALUE_INTERPOLATION_NEAREST_NEIGHBOR
Interpolation hint value -- the color sample of the nearest
neighboring integer coordinate sample in the image is used.
|
static Object |
VALUE_RENDER_DEFAULT
Rendering hint value -- rendering algorithms are chosen
by the implementation for a good tradeoff of performance
vs.
|
static Object |
VALUE_RENDER_QUALITY
Rendering hint value -- rendering algorithms are chosen
with a preference for output quality.
|
static Object |
VALUE_RENDER_SPEED
Rendering hint value -- rendering algorithms are chosen
with a preference for output speed.
|
static Object |
VALUE_STROKE_DEFAULT
Stroke normalization control hint value -- geometry may be
modified or left pure depending on the tradeoffs in a given
implementation.
|
static Object |
VALUE_STROKE_NORMALIZE
Stroke normalization control hint value -- geometry should
be normalized to improve uniformity or spacing of lines and
overall aesthetics.
|
static Object |
VALUE_STROKE_PURE
Stroke normalization control hint value -- geometry should
be left unmodified and rendered with sub-pixel accuracy.
|
static Object |
VALUE_TEXT_ANTIALIAS_DEFAULT
Text antialiasing hint value -- text rendering is done according
to the
KEY_ANTIALIASING hint or a default chosen by the
implementation. |
static Object |
VALUE_TEXT_ANTIALIAS_GASP
Text antialiasing hint value -- text rendering is requested to
use information in the font resource which specifies for each point
size whether to apply
VALUE_TEXT_ANTIALIAS_ON or
VALUE_TEXT_ANTIALIAS_OFF . |
static Object |
VALUE_TEXT_ANTIALIAS_LCD_HBGR
Text antialiasing hint value -- request that text be displayed
optimised for an LCD display with subpixels in order from display
left to right of B,G,R such that the horizontal subpixel resolution
is three times that of the full pixel horizontal resolution (HBGR).
|
static Object |
VALUE_TEXT_ANTIALIAS_LCD_HRGB
Text antialiasing hint value -- request that text be displayed
optimised for an LCD display with subpixels in order from display
left to right of R,G,B such that the horizontal subpixel resolution
is three times that of the full pixel horizontal resolution (HRGB).
|
static Object |
VALUE_TEXT_ANTIALIAS_LCD_VBGR
Text antialiasing hint value -- request that text be displayed
optimised for an LCD display with subpixel organisation from display
top to bottom of B,G,R such that the vertical subpixel resolution is
three times that of the full pixel vertical resolution (VBGR).
|
static Object |
VALUE_TEXT_ANTIALIAS_LCD_VRGB
Text antialiasing hint value -- request that text be displayed
optimised for an LCD display with subpixel organisation from display
top to bottom of R,G,B such that the vertical subpixel resolution is
three times that of the full pixel vertical resolution (VRGB).
|
static Object |
VALUE_TEXT_ANTIALIAS_OFF
Text antialiasing hint value -- text rendering is done without
any form of antialiasing.
|
static Object |
VALUE_TEXT_ANTIALIAS_ON
Text antialiasing hint value -- text rendering is done with
some form of antialiasing.
|
| Constructor and Description |
|---|
RenderingHints(Map<RenderingHints.Key,?> init)
Constructs a new object with keys and values initialized
from the specified Map object which may be null.
|
RenderingHints(RenderingHints.Key key,
Object value)
Constructs a new object with the specified key/value pair.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(RenderingHints hints)
Adds all of the keys and corresponding values from the specified
RenderingHints object to this
RenderingHints object. |
void |
clear()
Clears this
RenderingHints object of all key/value
pairs. |
Object |
clone()
Creates a clone of this
RenderingHints object
that has the same contents as this RenderingHints
object. |
boolean |
containsKey(Object key)
Returns
true if this RenderingHints
contains a mapping for the specified key. |
boolean |
containsValue(Object value)
Returns true if this RenderingHints maps one or more keys to the
specified value.
|
Set<Map.Entry<Object,Object>> |
entrySet()
Returns a
Set view of the mappings contained
in this RenderingHints . |
boolean |
equals(Object o)
Compares the specified
Object with this
RenderingHints for equality. |
Object |
get(Object key)
Returns the value to which the specified key is mapped.
|
int |
hashCode()
Returns the hash code value for this
RenderingHints . |
boolean |
isEmpty()
Returns
true if this
RenderingHints contains no key-value mappings. |
Set<Object> |
keySet()
Returns a
Set view of the Keys contained in this
RenderingHints . |
Object |
put(Object key,
Object value)
Maps the specified
key to the specified
value in this RenderingHints object. |
void |
putAll(Map<?,?> m)
Copies all of the mappings from the specified
Map
to this RenderingHints . |
Object |
remove(Object key)
Removes the key and its corresponding value from this
RenderingHints object. |
int |
size()
Returns the number of key-value mappings in this
RenderingHints . |
String |
toString()
Returns a rather long string representation of the hashmap
which contains the mappings of keys to values for this
RenderingHints object. |
Collection<Object> |
values()
Returns a
Collection view of the values
contained in this RenderinHints . |
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public static final RenderingHints.Key KEY_ANTIALIASING
ANTIALIASING
hint controls whether or not the
geometry rendering methods of a Graphics2D
object
will attempt to reduce aliasing artifacts along the edges
of shapes.
A typical antialiasing algorithm works by blending the existing colors of the pixels along the boundary of a shape with the requested fill paint according to the estimated partial pixel coverage of the shape.
The allowable values for this hint are
public static final Object VALUE_ANTIALIAS_ON
KEY_ANTIALIASING
public static final Object VALUE_ANTIALIAS_OFF
KEY_ANTIALIASING
public static final Object VALUE_ANTIALIAS_DEFAULT
KEY_ANTIALIASING
public static final RenderingHints.Key KEY_RENDERING
RENDERING
hint is a general hint that provides
a high level recommendation as to whether to bias algorithm
choices more for speed or quality when evaluating tradeoffs.
This hint could be consulted for any rendering or image
manipulation operation, but decisions will usually honor
other, more specific hints in preference to this hint.
The allowable values for this hint are
public static final Object VALUE_RENDER_SPEED
KEY_RENDERING
public static final Object VALUE_RENDER_QUALITY
KEY_RENDERING
public static final Object VALUE_RENDER_DEFAULT
KEY_RENDERING
public static final RenderingHints.Key KEY_DITHERING
DITHERING
hint controls how closely to approximate
a color when storing into a destination with limited color
resolution.
Some rendering destinations may support a limited number of
color choices which may not be able to accurately represent
the full spectrum of colors that can result during rendering
operations.
For such a destination the DITHERING
hint controls
whether rendering is done with a flat solid fill of a single
pixel value which is the closest supported color to what was
requested, or whether shapes will be filled with a pattern of
colors which combine to better approximate that color.
The allowable values for this hint are
public static final Object VALUE_DITHER_DISABLE
KEY_DITHERING
public static final Object VALUE_DITHER_ENABLE
KEY_DITHERING
public static final Object VALUE_DITHER_DEFAULT
KEY_DITHERING
public static final RenderingHints.Key KEY_TEXT_ANTIALIASING
TEXT_ANTIALIASING
hint can control the use of
antialiasing algorithms for text independently of the
choice used for shape rendering.
Often an application may want to use antialiasing for text
only and not for other shapes.
Additionally, the algorithms for reducing the aliasing
artifacts for text are often more sophisticated than those
that have been developed for general rendering so this
hint key provides additional values which can control
the choices of some of those text-specific algorithms.
If left in the DEFAULT
state, this hint will
generally defer to the value of the regular
KEY_ANTIALIASING
hint key.
The allowable values for this hint are
public static final Object VALUE_TEXT_ANTIALIAS_ON
KEY_TEXT_ANTIALIASING
public static final Object VALUE_TEXT_ANTIALIAS_OFF
KEY_TEXT_ANTIALIASING
public static final Object VALUE_TEXT_ANTIALIAS_DEFAULT
KEY_ANTIALIASING
hint or a default chosen by the
implementation.KEY_TEXT_ANTIALIASING
public static final Object VALUE_TEXT_ANTIALIAS_GASP
VALUE_TEXT_ANTIALIAS_ON
or
VALUE_TEXT_ANTIALIAS_OFF
.
TrueType fonts typically provide this information in the 'gasp' table. In the absence of this information, the behaviour for a particular font and size is determined by implementation defaults.
Note:A font designer will typically carefully hint a font for
the most common user interface point sizes. Consequently the 'gasp'
table will likely specify to use only hinting at those sizes and not
"smoothing". So in many cases the resulting text display is
equivalent to VALUE_TEXT_ANTIALIAS_OFF
.
This may be unexpected but is correct.
Logical fonts which are composed of multiple physical fonts will for consistency will use the setting most appropriate for the overall composite font.
KEY_TEXT_ANTIALIASING
public static final Object VALUE_TEXT_ANTIALIAS_LCD_HRGB
Notes:
An implementation when choosing whether to apply any of the
LCD text hint values may take into account factors including requiring
color depth of the destination to be at least 15 bits per pixel
(ie 5 bits per color component),
characteristics of a font such as whether embedded bitmaps may
produce better results, or when displaying to a non-local networked
display device enabling it only if suitable protocols are available,
or ignoring the hint if performing very high resolution rendering
or the target device is not appropriate: eg when printing.
These hints can equally be applied when rendering to software images,
but these images may not then be suitable for general export, as the
text will have been rendered appropriately for a specific subpixel
organisation. Also lossy images are not a good choice, nor image
formats such as GIF which have limited colors.
So unless the image is destined solely for rendering on a
display device with the same configuration, some other text
anti-aliasing hint such as
VALUE_TEXT_ANTIALIAS_ON
may be a better choice.
Selecting a value which does not match the LCD display in use will likely lead to a degradation in text quality. On display devices (ie CRTs) which do not have the same characteristics as LCD displays, the overall effect may appear similar to standard text anti-aliasing, but the quality may be degraded by color distortion. Analog connected LCD displays may also show little advantage over standard text-antialiasing and be similar to CRTs.
In other words for the best results use an LCD display with a digital display connector and specify the appropriate sub-pixel configuration.
KEY_TEXT_ANTIALIASING
public static final Object VALUE_TEXT_ANTIALIAS_LCD_HBGR
VALUE_TEXT_ANTIALIAS_LCD_HRGB
,
for more information on when this hint is applied.KEY_TEXT_ANTIALIASING
public static final Object VALUE_TEXT_ANTIALIAS_LCD_VRGB
VALUE_TEXT_ANTIALIAS_LCD_HRGB
,
for more information on when this hint is applied.KEY_TEXT_ANTIALIASING
public static final Object VALUE_TEXT_ANTIALIAS_LCD_VBGR
VALUE_TEXT_ANTIALIAS_LCD_HRGB
,
for more information on when this hint is applied.KEY_TEXT_ANTIALIASING
public static final RenderingHints.Key KEY_TEXT_LCD_CONTRAST
Integer
object which is used as a text
contrast adjustment when used in conjunction with an LCD text
anti-aliasing hint such as
VALUE_TEXT_ANTIALIAS_LCD_HRGB
.
KEY_TEXT_ANTIALIASING
public static final RenderingHints.Key KEY_FRACTIONALMETRICS
FRACTIONALMETRICS
hint controls whether the positioning
of individual character glyphs takes into account the sub-pixel
accuracy of the scaled character advances of the font or whether
such advance vectors are rounded to an integer number of whole
device pixels.
This hint only recommends how much accuracy should be used to
position the glyphs and does not specify or recommend whether or
not the actual rasterization or pixel bounds of the glyph should
be modified to match.
Rendering text to a low resolution device like a screen will necessarily involve a number of rounding operations as the high quality and very precise definition of the shape and metrics of the character glyphs must be matched to discrete device pixels. Ideally the positioning of glyphs during text layout would be calculated by scaling the design metrics in the font according to the point size, but then the scaled advance width will not necessarily be an integer number of pixels. If the glyphs are positioned with sub-pixel accuracy according to these scaled design metrics then the rasterization would ideally need to be adjusted for each possible sub-pixel origin.
Unfortunately, scaling each glyph customized to its exact subpixel origin during text layout would be prohibitively expensive so a simplified system based on integer device positions is typically used to lay out the text. The rasterization of the glyph and the scaled advance width are both adjusted together to yield text that looks good at device resolution and has consistent integer pixel distances between glyphs that help the glyphs look uniformly and consistently spaced and readable.
This process of rounding advance widths for rasterized glyphs to integer distances means that the character density and the overall length of a string of text will be different from the theoretical design measurements due to the accumulation of a series of small differences in the adjusted widths of each glyph. The specific differences will be different for each glyph, some being wider and some being narrower than their theoretical design measurements. Thus the overall difference in character density and length will vary by a number of factors including the font, the specific device resolution being targeted, and the glyphs chosen to represent the string being rendered. As a result, rendering the same string at multiple device resolutions can yield widely varying metrics for whole strings.
When FRACTIONALMETRICS
are enabled, the true font design
metrics are scaled by the point size and used for layout with
sub-pixel accuracy.
The average density of glyphs and total length of a long
string of characters will therefore more closely match the
theoretical design of the font, but readability may be affected
since individual pairs of characters may not always appear to
be consistent distances apart depending on how the sub-pixel
accumulation of the glyph origins meshes with the device pixel
grid.
Enabling this hint may be desirable when text layout is being
performed that must be consistent across a wide variety of
output resolutions.
Specifically, this hint may be desirable in situations where
the layout of text is being previewed on a low resolution
device like a screen for output that will eventually be
rendered on a high resolution printer or typesetting device.
When disabled, the scaled design metrics are rounded or adjusted to integer distances for layout. The distances between any specific pair of glyphs will be more uniform on the device, but the density and total length of long strings may no longer match the theoretical intentions of the font designer. Disabling this hint will typically produce more readable results on low resolution devices like computer monitors.
The allowable values for this key are
public static final Object VALUE_FRACTIONALMETRICS_OFF
KEY_FRACTIONALMETRICS
public static final Object VALUE_FRACTIONALMETRICS_ON
KEY_FRACTIONALMETRICS
public static final Object VALUE_FRACTIONALMETRICS_DEFAULT
KEY_FRACTIONALMETRICS
public static final RenderingHints.Key KEY_INTERPOLATION
INTERPOLATION
hint controls how image pixels are
filtered or resampled during an image rendering operation.
Implicitly images are defined to provide color samples at integer coordinate locations. When images are rendered upright with no scaling onto a destination, the choice of which image pixels map to which device pixels is obvious and the samples at the integer coordinate locations in the image are transfered to the pixels at the corresponding integer locations on the device pixel grid one for one. When images are rendered in a scaled, rotated, or otherwise transformed coordinate system, then the mapping of device pixel coordinates back to the image can raise the question of what color sample to use for the continuous coordinates that lie between the integer locations of the provided image samples. Interpolation algorithms define functions which provide a color sample for any continuous coordinate in an image based on the color samples at the surrounding integer coordinates.
The allowable values for this hint are
public static final Object VALUE_INTERPOLATION_NEAREST_NEIGHBOR
As the image is scaled up, it will look correspondingly blocky. As the image is scaled down, the colors for source pixels will be either used unmodified, or skipped entirely in the output representation.
KEY_INTERPOLATION
public static final Object VALUE_INTERPOLATION_BILINEAR
As the image is scaled up, there are no blocky edges between
the colors in the image as there are with
NEAREST_NEIGHBOR
,
but the blending may show some subtle discontinuities along the
horizontal and vertical edges that line up with the samples
caused by a sudden change in the slope of the interpolation
from one side of a sample to the other.
As the image is scaled down, more image pixels have their
color samples represented in the resulting output since each
output pixel receives color information from up to 4 image
pixels.
KEY_INTERPOLATION
public static final Object VALUE_INTERPOLATION_BICUBIC
X
and Y
to produce
a color sample.
Conceptually the view of the image is very similar to the view
used in the BILINEAR
algorithm except that the ramps of colors that connect between
the samples are curved and have better continuity of slope
as they cross over between sample boundaries.
As the image is scaled up, there are no blocky edges and the
interpolation should appear smoother and with better depictions
of any edges in the original image than with BILINEAR
.
As the image is scaled down, even more of the original color
samples from the original image will have their color information
carried through and represented.
KEY_INTERPOLATION
public static final RenderingHints.Key KEY_ALPHA_INTERPOLATION
ALPHA_INTERPOLATION
hint is a general hint that
provides a high level recommendation as to whether to bias
alpha blending algorithm choices more for speed or quality
when evaluating tradeoffs.
This hint could control the choice of alpha blending calculations that sacrifice some precision to use fast lookup tables or lower precision SIMD instructions. This hint could also control whether or not the color and alpha values are converted into a linear color space during the calculations for a more linear visual effect at the expense of additional per-pixel calculations.
The allowable values for this hint are
public static final Object VALUE_ALPHA_INTERPOLATION_SPEED
KEY_ALPHA_INTERPOLATION
public static final Object VALUE_ALPHA_INTERPOLATION_QUALITY
KEY_ALPHA_INTERPOLATION
public static final Object VALUE_ALPHA_INTERPOLATION_DEFAULT
KEY_ALPHA_INTERPOLATION
public static final RenderingHints.Key KEY_COLOR_RENDERING
COLOR_RENDERING
hint controls the accuracy of
approximation and conversion when storing colors into a
destination image or surface.
When a rendering or image manipulation operation produces a color value that must be stored into a destination, it must first convert that color into a form suitable for storing into the destination image or surface. Minimally, the color components must be converted to bit representations and ordered in the correct order or an index into a color lookup table must be chosen before the data can be stored into the destination memory. Without this minimal conversion, the data in the destination would likely represent random, incorrect or possibly even unsupported values. Algorithms to quickly convert the results of rendering operations into the color format of most common destinations are well known and fairly optimal to execute.
Simply performing the most basic color format conversion to
store colors into a destination can potentially ignore a
difference in the calibration of the
ColorSpace
of the source and destination or other factors such as the
linearity of the gamma correction.
Unless the source and destination ColorSpace
are
identical, to correctly perform a rendering operation with
the most care taken for the accuracy of the colors being
represented, the source colors should be converted to a
device independent ColorSpace
and the results then
converted back to the destination ColorSpace
.
Furthermore, if calculations such as the blending of multiple
source colors are to be performed during the rendering
operation, greater visual clarity can be achieved if the
intermediate device independent ColorSpace
is
chosen to have a linear relationship between the values
being calculated and the perception of the human eye to
the response curves of the output device.
The allowable values for this hint are
public static final Object VALUE_COLOR_RENDER_SPEED
KEY_COLOR_RENDERING
public static final Object VALUE_COLOR_RENDER_QUALITY
KEY_COLOR_RENDERING
public static final Object VALUE_COLOR_RENDER_DEFAULT
KEY_COLOR_RENDERING
public static final RenderingHints.Key KEY_STROKE_CONTROL
STROKE_CONTROL
hint controls whether a rendering
implementation should or is allowed to modify the geometry
of rendered shapes for various purposes.
Some implementations may be able to use an optimized platform rendering library which may be faster than traditional software rendering algorithms on a given platform, but which may also not support floating point coordinates. Some implementations may also have sophisticated algorithms which perturb the coordinates of a path so that wide lines appear more uniform in width and spacing.
If an implementation performs any type of modification or "normalization" of a path, it should never move the coordinates by more than half a pixel in any direction.
The allowable values for this hint are
public static final Object VALUE_STROKE_DEFAULT
KEY_STROKE_CONTROL
public static final Object VALUE_STROKE_NORMALIZE
KEY_STROKE_CONTROL
public static final Object VALUE_STROKE_PURE
KEY_STROKE_CONTROL
public RenderingHints(Map<RenderingHints.Key,?> init)
init
- a map of key/value pairs to initialize the hints
or null if the object should be emptypublic RenderingHints(RenderingHints.Key key, Object value)
key
- the key of the particular hint propertyvalue
- the value of the hint property specified with
key
public int size()
RenderingHints
.public boolean isEmpty()
true
if this
RenderingHints
contains no key-value mappings.public boolean containsKey(Object key)
true
if this RenderingHints
contains a mapping for the specified key.containsKey
in interface Map<Object,Object>
key
- key whose presence in this
RenderingHints
is to be tested.true
if this RenderingHints
contains a mapping for the specified key.ClassCastException
- if the key can not
be cast to RenderingHints.Key
public boolean containsValue(Object value)
true
if and only
if this RenderingHints
contains at least one mapping to a value v
such that
(value==null ? v==null : value.equals(v)). This operation will probably require time linear in the
RenderingHints
size for most implementations
of RenderingHints
.containsValue
in interface Map<Object,Object>
value
- value whose presence in this
RenderingHints
is to be tested.true
if this RenderingHints
maps one or more keys to the specified value.public Object get(Object key)
get
in interface Map<Object,Object>
key
- a rendering hint keynull
if the key is not mapped to any value in
this object.ClassCastException
- if the key can not
be cast to RenderingHints.Key
put(Object, Object)
public Object put(Object key, Object value)
key
to the specified
value
in this RenderingHints
object.
Neither the key nor the value can be null
.
The value can be retrieved by calling the get
method
with a key that is equal to the original key.put
in interface Map<Object,Object>
key
- the rendering hint key.value
- the rendering hint value.null
if it did not have one.NullPointerException
- if the key is
null
.ClassCastException
- if the key can not
be cast to RenderingHints.Key
IllegalArgumentException
- if the
Key.isCompatibleValue()
method of the specified key returns false for the
specified valueget(Object)
public void add(RenderingHints hints)
RenderingHints
object to this
RenderingHints
object. Keys that are present in
this RenderingHints
object, but not in the specified
RenderingHints
object are not affected.hints
- the set of key/value pairs to be added to this
RenderingHints
objectpublic void clear()
RenderingHints
object of all key/value
pairs.public Object remove(Object key)
RenderingHints
object. This method does nothing if the
key is not in this RenderingHints
object.remove
in interface Map<Object,Object>
key
- the rendering hints key that needs to be removedRenderingHints
object, or null
if the key did not have a mapping.ClassCastException
- if the key can not
be cast to RenderingHints.Key
public void putAll(Map<?,?> m)
Map
to this RenderingHints
. These mappings replace
any mappings that this RenderingHints
had for any
of the keys currently in the specified Map
.putAll
in interface Map<Object,Object>
m
- the specified Map
ClassCastException
- class of a key or value
in the specified Map
prevents it from being
stored in this RenderingHints
.IllegalArgumentException
- some aspect
of a key or value in the specified Map
prevents it from being stored in
this RenderingHints
.public Set<Object> keySet()
Set
view of the Keys contained in this
RenderingHints
. The Set is backed by the
RenderingHints
, so changes to the
RenderingHints
are reflected in the Set
,
and vice-versa. If the RenderingHints
is modified
while an iteration over the Set
is in progress,
the results of the iteration are undefined. The Set
supports element removal, which removes the corresponding
mapping from the RenderingHints
, via the
Iterator.remove
, Set.remove
,
removeAll
retainAll
, and
clear
operations. It does not support
the add
or addAll
operations.public Collection<Object> values()
Collection
view of the values
contained in this RenderinHints
.
The Collection
is backed by the
RenderingHints
, so changes to
the RenderingHints
are reflected in
the Collection
, and vice-versa.
If the RenderingHints
is modified while
an iteration over the Collection
is
in progress, the results of the iteration are undefined.
The Collection
supports element removal,
which removes the corresponding mapping from the
RenderingHints
, via the
Iterator.remove
,
Collection.remove
, removeAll
,
retainAll
and clear
operations.
It does not support the add
or
addAll
operations.public Set<Map.Entry<Object,Object>> entrySet()
Set
view of the mappings contained
in this RenderingHints
. Each element in the
returned Set
is a Map.Entry
.
The Set
is backed by the RenderingHints
,
so changes to the RenderingHints
are reflected
in the Set
, and vice-versa. If the
RenderingHints
is modified while
while an iteration over the Set
is in progress,
the results of the iteration are undefined.
The entrySet returned from a RenderingHints
object
is not modifiable.
public boolean equals(Object o)
Object
with this
RenderingHints
for equality.
Returns true
if the specified object is also a
Map
and the two Map
objects represent
the same mappings. More formally, two Map
objects
t1
and t2
represent the same mappings
if t1.keySet().equals(t2.keySet())
and for every
key k
in t1.keySet()
,
(t1.get(k)==null ? t2.get(k)==null : t1.get(k).equals(t2.get(k))). This ensures that the
equals
method works properly across
different implementations of the Map
interface.public int hashCode()
RenderingHints
.
The hash code of a RenderingHints
is defined to be
the sum of the hashCodes of each Entry
in the
RenderingHints
object's entrySet view. This ensures that
t1.equals(t2)
implies that
t1.hashCode()==t2.hashCode()
for any two Map
objects t1
and t2
, as required by the general
contract of Object.hashCode
.hashCode
in interface Map<Object,Object>
hashCode
in class Object
RenderingHints
.Map.Entry.hashCode()
,
Object.hashCode()
,
Object.equals(Object)
,
equals(Object)
public Object clone()
RenderingHints
object
that has the same contents as this RenderingHints
object.Dracula Javadoc Sample, Made with Allan Im.


{% extends "account/base.html" %} {% load i18n account staticfiles %} {% block title %}{% trans "Password Reset" %}{% endblock %} {% block links %} {% endblock %} {% block content %}
{% blocktrans %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}


Scan the left side QR to open the link using Chrome and right side for default browser
Or you can click this link directly


Description is too short.
Description is too long.
Description is required.
Please enter only character only.


--- layout: post title: Dropbox for file syncing date: 2010-04-02 21:55:55.000000000 +02:00 type: post published: true status: publish categories: - Technology tags: - Apps - dropbox - ipod meta: _edit_last: '1' bfa_ata_body_title: Dropbox for file syncing bfa_ata_display_body_title: '' bfa_ata_body_title_multi: Dropbox for file syncing bfa_ata_meta_title: '' bfa_ata_meta_keywords: '' bfa_ata_meta_description: '' _sexybookmarks_shortUrl: http://b2l.me/atxqkz _sexybookmarks_permaHash: 8cb9627167111e9d6d2968d5dda3166d dsq_thread_id: '145746220' author: login: bbWebdesign email<EMAIL_ADDRESS>display_name: Bob first_name: Bob last_name: Belderbos ---
And now something totally different ..
I rediscovered this cool tool listening to the Sitepoint podcast. This is a great free app that gives you 2g of central storage. Of course you have to accept your files will be hosted on Dropbox' server (same trust you grant when using google services), but it is quite handy for personal pdfs, notes etc.
Old news for some of you, what was new for me though were these two cool features:


3D point.
More...
#include <pcps_point.h>
|
|
bool | isFinite () const noexcept |
| | Indicates if all coordinates of this point are finite.
|
| |
| bool | isEqualTo (const Point &other, float precision) const noexcept |
| | Indicates if this point is equal to the given one. More...
|
| |
|
Point | cross (const Point &other) const noexcept |
| | Retrieves the cross product between this point and the given one.
|
| |
|
void | operator*= (float value) noexcept |
| | Multiplication operator.
|
| |
|
void | operator/= (float value) noexcept |
| | Division operator.
|
| |
|
bool | operator== (const Point &other) const noexcept |
| | Returns true if this point is equal to the given one; false otherwise.
|
| |
|
bool | operator!= (const Point &other) const noexcept |
| | Returns true if this point is not equal to the given one; false otherwise.
|
| |
|
|
static Point | invalid () noexcept |
| | Retrieves an invalid (NaN) point.
|
| |
|
| float | x |
| |
| float | y |
| |
| float | z |
| |
| float | aux |
| |
◆ isEqualTo()
| bool pcps::Point::isEqualTo |
( |
const Point & |
other, |
|
|
float |
precision |
|
) |
| const |
|
noexcept |
Indicates if this point is equal to the given one.
- Parameters
-
| other | The other point. |
| precision | Upper bound on the relative error due to rounding in floating point arithmetic. |
- Returns
- true if this point is equal to the given one; false otherwise.
◆ aux
Auxiliar variable used for some computations.
The documentation for this class was generated from the following file:


Various functions and algorithms are provided here for solving optimal matching tasks in the context of preclinical cancer studies. Further, various helper and plotting functions are provided for unsupervised and supervised machine learning as well as longitudinal mixed-effects modeling of tumor growth response patterns.
| Version: |
0.9.6 |
| Depends: |
R (≥ 3.0.0) |
| Imports: |
grDevices, graphics, stats, utils |
| Suggests: |
lme4, nlme, amap, nbpMatching, lattice, lmerTest, xtable, Cairo, Matrix, MASS |
| Published: |
2018-05-26 |
| Author: |
Teemu Daniel Laajala |
| Maintainer: |
Teemu Daniel Laajala <teelaa at utu.fi> |
| License: |
GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| NeedsCompilation: |
no |
| Citation: |
hamlet citation info |
| Materials: |
NEWS |
| CRAN checks: |
hamlet results |