public abstract class KeyboardFocusManager extends Object implements KeyEventDispatcher, KeyEventPostProcessor
The KeyboardFocusManager is both a centralized location for client code to query for the focus owner and initiate focus changes, and an event dispatcher for all FocusEvents, WindowEvents related to focus, and KeyEvents.
Some browsers partition applets in different code bases into separate contexts, and establish walls between these contexts. In such a scenario, there will be one KeyboardFocusManager per context. Other browsers place all applets into the same context, implying that there will be only a single, global KeyboardFocusManager for all applets. This behavior is implementation-dependent. Consult your browser's documentation for more information. No matter how many contexts there may be, however, there can never be more than one focus owner, focused Window, or active Window, per ClassLoader.
Please see How to Use the Focus Subsystem, a section in The Java Tutorial, and the Focus Specification for more information.
Window
,
Frame
,
Dialog
,
FocusEvent
,
WindowEvent
,
KeyEvent
| Modifier and Type | Field and Description |
|---|---|
static int |
BACKWARD_TRAVERSAL_KEYS
The identifier for the Backward focus traversal keys.
|
static int |
DOWN_CYCLE_TRAVERSAL_KEYS
The identifier for the Down Cycle focus traversal keys.
|
static int |
FORWARD_TRAVERSAL_KEYS
The identifier for the Forward focus traversal keys.
|
static int |
UP_CYCLE_TRAVERSAL_KEYS
The identifier for the Up Cycle focus traversal keys.
|
| Constructor and Description |
|---|
KeyboardFocusManager()
Initializes a KeyboardFocusManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyEventDispatcher(KeyEventDispatcher dispatcher)
Adds a KeyEventDispatcher to this KeyboardFocusManager's dispatcher
chain.
|
void |
addKeyEventPostProcessor(KeyEventPostProcessor processor)
Adds a KeyEventPostProcessor to this KeyboardFocusManager's post-
processor chain.
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list for a specific
property.
|
void |
addVetoableChangeListener(String propertyName,
VetoableChangeListener listener)
Adds a VetoableChangeListener to the listener list for a specific
property.
|
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds a VetoableChangeListener to the listener list.
|
void |
clearFocusOwner()
Clears the focus owner at both the Java and native levels if the
focus owner exists and resides in the same context as the calling thread,
otherwise the method returns silently.
|
void |
clearGlobalFocusOwner()
Clears the global focus owner at both the Java and native levels.
|
protected abstract void |
dequeueKeyEvents(long after,
Component untilFocused)
Called by the AWT to notify the KeyboardFocusManager that it should
cancel delayed dispatching of KeyEvents.
|
protected abstract void |
discardKeyEvents(Component comp)
Called by the AWT to notify the KeyboardFocusManager that it should
cancel delayed dispatching of KeyEvents.
|
abstract boolean |
dispatchEvent(AWTEvent e)
This method is called by the AWT event dispatcher requesting that the
current KeyboardFocusManager dispatch the specified event on its behalf.
|
abstract boolean |
dispatchKeyEvent(KeyEvent e)
Typically this method will be called by
dispatchEvent if no
other KeyEventDispatcher in the dispatcher chain dispatched the
KeyEvent, or if no other KeyEventDispatchers are registered. |
void |
downFocusCycle()
Moves the focus down one focus traversal cycle from the current focus
owner, if and only if the current focus owner is a Container that is a
focus cycle root.
|
abstract void |
downFocusCycle(Container aContainer)
Moves the focus down one focus traversal cycle.
|
protected abstract void |
enqueueKeyEvents(long after,
Component untilFocused)
Called by the AWT to notify the KeyboardFocusManager that it should
delay dispatching of KeyEvents until the specified Component becomes
the focus owner.
|
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Fires a PropertyChangeEvent in response to a change in a bound property.
|
protected void |
fireVetoableChange(String propertyName,
Object oldValue,
Object newValue)
Fires a PropertyChangeEvent in response to a change in a vetoable
property.
|
void |
focusNextComponent()
Focuses the Component after the current focus owner.
|
abstract void |
focusNextComponent(Component aComponent)
Focuses the Component after aComponent, typically based on a
FocusTraversalPolicy.
|
void |
focusPreviousComponent()
Focuses the Component before the current focus owner.
|
abstract void |
focusPreviousComponent(Component aComponent)
Focuses the Component before aComponent, typically based on a
FocusTraversalPolicy.
|
Window |
getActiveWindow()
Returns the active Window, if the active Window is in the same context
as the calling thread.
|
Container |
getCurrentFocusCycleRoot()
Returns the current focus cycle root, if the current focus cycle root is
in the same context as the calling thread.
|
static KeyboardFocusManager |
getCurrentKeyboardFocusManager()
Returns the current KeyboardFocusManager instance for the calling
thread's context.
|
Set<AWTKeyStroke> |
getDefaultFocusTraversalKeys(int id)
Returns a Set of default focus traversal keys for a given traversal
operation.
|
FocusTraversalPolicy |
getDefaultFocusTraversalPolicy()
Returns the default FocusTraversalPolicy.
|
Window |
getFocusedWindow()
Returns the focused Window, if the focused Window is in the same context
as the calling thread.
|
Component |
getFocusOwner()
Returns the focus owner, if the focus owner is in the same context as
the calling thread.
|
protected Window |
getGlobalActiveWindow()
Returns the active Window, even if the calling thread is in a different
context than the active Window.
|
protected Container |
getGlobalCurrentFocusCycleRoot()
Returns the current focus cycle root, even if the calling thread is in a
different context than the current focus cycle root.
|
protected Window |
getGlobalFocusedWindow()
Returns the focused Window, even if the calling thread is in a different
context than the focused Window.
|
protected Component |
getGlobalFocusOwner()
Returns the focus owner, even if the calling thread is in a different
context than the focus owner.
|
protected Component |
getGlobalPermanentFocusOwner()
Returns the permanent focus owner, even if the calling thread is in a
different context than the permanent focus owner.
|
protected List<KeyEventDispatcher> |
getKeyEventDispatchers()
Returns this KeyboardFocusManager's KeyEventDispatcher chain as a List.
|
protected List<KeyEventPostProcessor> |
getKeyEventPostProcessors()
Returns this KeyboardFocusManager's KeyEventPostProcessor chain as a
List.
|
Component |
getPermanentFocusOwner()
Returns the permanent focus owner, if the permanent focus owner is in
the same context as the calling thread.
|
PropertyChangeListener[] |
getPropertyChangeListeners()
Returns an array of all the property change listeners
registered on this keyboard focus manager.
|
PropertyChangeListener[] |
getPropertyChangeListeners(String propertyName)
Returns an array of all the
PropertyChangeListener s
associated with the named property. |
VetoableChangeListener[] |
getVetoableChangeListeners()
Returns an array of all the vetoable change listeners
registered on this keyboard focus manager.
|
VetoableChangeListener[] |
getVetoableChangeListeners(String propertyName)
Returns an array of all the
VetoableChangeListener s
associated with the named property. |
abstract boolean |
postProcessKeyEvent(KeyEvent e)
This method will be called by
dispatchKeyEvent . |
abstract void |
processKeyEvent(Component focusedComponent,
KeyEvent e)
This method initiates a focus traversal operation if and only if the
KeyEvent represents a focus traversal key for the specified
focusedComponent.
|
void |
redispatchEvent(Component target,
AWTEvent e)
Redispatches an AWTEvent in such a way that the AWT event dispatcher
will not recursively request that the KeyboardFocusManager, or any
installed KeyEventDispatchers, dispatch the event again.
|
void |
removeKeyEventDispatcher(KeyEventDispatcher dispatcher)
Removes a KeyEventDispatcher which was previously added to this
KeyboardFocusManager's dispatcher chain.
|
void |
removeKeyEventPostProcessor(KeyEventPostProcessor processor)
Removes a previously added KeyEventPostProcessor from this
KeyboardFocusManager's post-processor chain.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list.
|
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list for a specific
property.
|
void |
removeVetoableChangeListener(String propertyName,
VetoableChangeListener listener)
Removes a VetoableChangeListener from the listener list for a specific
property.
|
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes a VetoableChangeListener from the listener list.
|
static void |
setCurrentKeyboardFocusManager(KeyboardFocusManager newManager)
Sets the current KeyboardFocusManager instance for the calling thread's
context.
|
void |
setDefaultFocusTraversalKeys(int id,
Set<? extends AWTKeyStroke> keystrokes)
Sets the default focus traversal keys for a given traversal operation.
|
void |
setDefaultFocusTraversalPolicy(FocusTraversalPolicy defaultPolicy)
Sets the default FocusTraversalPolicy.
|
protected void |
setGlobalActiveWindow(Window activeWindow)
Sets the active Window.
|
void |
setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot)
Sets the current focus cycle root.
|
protected void |
setGlobalFocusedWindow(Window focusedWindow)
Sets the focused Window.
|
protected void |
setGlobalFocusOwner(Component focusOwner)
Sets the focus owner.
|
protected void |
setGlobalPermanentFocusOwner(Component permanentFocusOwner)
Sets the permanent focus owner.
|
void |
upFocusCycle()
Moves the focus up one focus traversal cycle from the current focus
owner.
|
abstract void |
upFocusCycle(Component aComponent)
Moves the focus up one focus traversal cycle.
|
public static final int FORWARD_TRAVERSAL_KEYS
public static final int BACKWARD_TRAVERSAL_KEYS
public static final int UP_CYCLE_TRAVERSAL_KEYS
public static final int DOWN_CYCLE_TRAVERSAL_KEYS
public KeyboardFocusManager()
public static KeyboardFocusManager getCurrentKeyboardFocusManager()
setCurrentKeyboardFocusManager(java.awt.KeyboardFocusManager)
public static void setCurrentKeyboardFocusManager(KeyboardFocusManager newManager) throws SecurityException
If a SecurityManager is installed, the calling thread must be granted the AWTPermission "replaceKeyboardFocusManager" in order to replace the the current KeyboardFocusManager. If this permission is not granted, this method will throw a SecurityException, and the current KeyboardFocusManager will be unchanged.
newManager
- the new KeyboardFocusManager for this thread's contextSecurityException
- if the calling thread does not have permission
to replace the current KeyboardFocusManagergetCurrentKeyboardFocusManager()
,
DefaultKeyboardFocusManager
public Component getFocusOwner()
getGlobalFocusOwner()
,
setGlobalFocusOwner(java.awt.Component)
protected Component getGlobalFocusOwner() throws SecurityException
This method will throw a SecurityException if this KeyboardFocusManager is not the current KeyboardFocusManager for the calling thread's context.
SecurityException
- if this KeyboardFocusManager is not the
current KeyboardFocusManager for the calling thread's context
and if the calling thread does not have "replaceKeyboardFocusManager"
permissiongetFocusOwner()
,
setGlobalFocusOwner(java.awt.Component)
protected void setGlobalFocusOwner(Component focusOwner) throws SecurityException
This method does not actually set the focus to the specified Component.
It merely stores the value to be subsequently returned by
getFocusOwner()
. Use Component.requestFocus()
or Component.requestFocusInWindow()
to change the focus
owner, subject to platform limitations.
focusOwner
- the focus ownerSecurityException
- if this KeyboardFocusManager is not the
current KeyboardFocusManager for the calling thread's context
and if the calling thread does not have "replaceKeyboardFocusManager"
permissiongetFocusOwner()
,
getGlobalFocusOwner()
,
Component.requestFocus()
,
Component.requestFocusInWindow()
,
Component.isFocusable()
public void clearFocusOwner()
The focus owner component will receive a permanent FOCUS_LOST event.
After this operation completes, the native windowing system will discard
all user-generated KeyEvents until the user selects a new Component to
receive focus, or a Component is given focus explicitly via a call to
requestFocus()
. This operation does not change the focused or
active Windows.
Component.requestFocus()
,
FocusEvent.FOCUS_LOST
public void clearGlobalFocusOwner() throws SecurityException
requestFocus()
. This operation
does not change the focused or active Windows.
If a SecurityManager is installed, the calling thread must be granted the "replaceKeyboardFocusManager" AWTPermission. If this permission is not granted, this method will throw a SecurityException, and the current focus owner will not be cleared.
This method is intended to be used only by KeyboardFocusManager set as current KeyboardFocusManager for the calling thread's context. It is not for general client use.
SecurityException
- if the calling thread does not have
"replaceKeyboardFocusManager" permissionclearFocusOwner()
,
Component.requestFocus()
,
FocusEvent.FOCUS_LOST
public Component getPermanentFocusOwner()
getGlobalPermanentFocusOwner()
,
setGlobalPermanentFocusOwner(java.awt.Component)
protected Component getGlobalPermanentFocusOwner() throws SecurityException
SecurityException
- if this KeyboardFocusManager is not the
current KeyboardFocusManager for the calling thread's context
and if the calling thread does not have "replaceKeyboardFocusManager"
permissiongetPermanentFocusOwner()
,
setGlobalPermanentFocusOwner(java.awt.Component)
protected void setGlobalPermanentFocusOwner(Component permanentFocusOwner) throws SecurityException
This method does not actually set the focus to the specified Component.
It merely stores the value to be subsequently returned by
getPermanentFocusOwner()
. Use
Component.requestFocus()
or
Component.requestFocusInWindow()
to change the focus owner,
subject to platform limitations.
permanentFocusOwner
- the permanent focus ownerSecurityException
- if this KeyboardFocusManager is not the
current KeyboardFocusManager for the calling thread's context
and if the calling thread does not have "replaceKeyboardFocusManager"
permissiongetPermanentFocusOwner()
,
getGlobalPermanentFocusOwner()
,
Component.requestFocus()
,
Component.requestFocusInWindow()
,
Component.isFocusable()
public Window getFocusedWindow()
getGlobalFocusedWindow()
,
setGlobalFocusedWindow(java.awt.Window)
protected Window getGlobalFocusedWindow() throws SecurityException
SecurityException
- if this KeyboardFocusManager is not the
current KeyboardFocusManager for the calling thread's context
and if the calling thread does not have "replaceKeyboardFocusManager"
permissiongetFocusedWindow()
,
setGlobalFocusedWindow(java.awt.Window)
protected void setGlobalFocusedWindow(Window focusedWindow) throws SecurityException
This method does not actually change the focused Window as far as the
native windowing system is concerned. It merely stores the value to be
subsequently returned by getFocusedWindow()
. Use
Component.requestFocus()
or
Component.requestFocusInWindow()
to change the focused
Window, subject to platform limitations.
focusedWindow
- the focused WindowSecurityException
- if this KeyboardFocusManager is not the
current KeyboardFocusManager for the calling thread's context
and if the calling thread does not have "replaceKeyboardFocusManager"
permissiongetFocusedWindow()
,
getGlobalFocusedWindow()
,
Component.requestFocus()
,
Component.requestFocusInWindow()
,
Window.isFocusableWindow()
public Window getActiveWindow()
getGlobalActiveWindow()
,
setGlobalActiveWindow(java.awt.Window)
protected Window getGlobalActiveWindow() throws SecurityException
SecurityException
- if this KeyboardFocusManager is not the
current KeyboardFocusManager for the calling thread's context
and if the calling thread does not have "replaceKeyboardFocusManager"
permissiongetActiveWindow()
,
setGlobalActiveWindow(java.awt.Window)
protected void setGlobalActiveWindow(Window activeWindow) throws SecurityException
This method does not actually change the active Window as far as the
native windowing system is concerned. It merely stores the value to be
subsequently returned by getActiveWindow()
. Use
Component.requestFocus()
or
Component.requestFocusInWindow()
to change the active
Window, subject to platform limitations.
activeWindow
- the active WindowSecurityException
- if this KeyboardFocusManager is not the
current KeyboardFocusManager for the calling thread's context
and if the calling thread does not have "replaceKeyboardFocusManager"
permissiongetActiveWindow()
,
getGlobalActiveWindow()
,
Component.requestFocus()
,
Component.requestFocusInWindow()
public FocusTraversalPolicy getDefaultFocusTraversalPolicy()
setDefaultFocusTraversalPolicy(java.awt.FocusTraversalPolicy)
,
Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy)
,
Container.getFocusTraversalPolicy()
public void setDefaultFocusTraversalPolicy(FocusTraversalPolicy defaultPolicy)
defaultPolicy
- the new, default FocusTraversalPolicyIllegalArgumentException
- if defaultPolicy is nullgetDefaultFocusTraversalPolicy()
,
Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy)
,
Container.getFocusTraversalPolicy()
public void setDefaultFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)
Set
will be in effect on all
Window
s that have no such Set
of
their own explicitly defined. This Set
will also be
inherited, recursively, by any child Component
of
those Windows
that has
no such Set
of its own explicitly defined.
The default values for the default focus traversal keys are implementation-dependent. Sun recommends that all implementations for a particular native platform use the same default values. The recommendations for Windows and Unix are listed below. These recommendations are used in the Sun AWT implementations.
| Identifier | Meaning | Default |
|---|---|---|
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS |
Normal forward keyboard traversal | TAB on KEY_PRESSED ,
CTRL-TAB on KEY_PRESSED |
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS |
Normal reverse keyboard traversal | SHIFT-TAB on KEY_PRESSED ,
CTRL-SHIFT-TAB on KEY_PRESSED |
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS |
Go up one focus traversal cycle | none |
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS |
Go down one focus traversal cycle | none |
Set
;
Collections.EMPTY_SET
is recommended.
Using the AWTKeyStroke
API, client code can
specify on which of two
specific KeyEvent
s, KEY_PRESSED
or
KEY_RELEASED
, the focus traversal operation will
occur. Regardless of which KeyEvent
is specified,
however, all KeyEvent
s related to the focus
traversal key, including the associated KEY_TYPED
event, will be consumed, and will not be dispatched
to any Component
. It is a runtime error to
specify a KEY_TYPED
event as
mapping to a focus traversal operation, or to map the same event to
multiple default focus traversal operations.
This method may throw a ClassCastException
if any Object
in keystrokes
is not an AWTKeyStroke
.
id
- one of
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS
,
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS
,
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
, or
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
keystrokes
- the Set of AWTKeyStroke
s for the
specified operationIllegalArgumentException
- if id is not one of
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS
,
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS
,
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
, or
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
,
or if keystrokes is null
,
or if keystrokes contains null
,
or if any keystroke
represents a KEY_TYPED
event,
or if any keystroke already maps
to another default focus traversal operationgetDefaultFocusTraversalKeys(int)
,
Component.setFocusTraversalKeys(int, java.util.Set<? extends java.awt.AWTKeyStroke>)
,
Component.getFocusTraversalKeys(int)
public Set<AWTKeyStroke> getDefaultFocusTraversalKeys(int id)
setDefaultFocusTraversalKeys
for a full description of each
operation.)id
- one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYSSet
of AWTKeyStroke
s
for the specified operation; the Set
will be unmodifiable, and may be empty; null
will never be returnedIllegalArgumentException
- if id is not one of
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYSsetDefaultFocusTraversalKeys(int, java.util.Set<? extends java.awt.AWTKeyStroke>)
,
Component.setFocusTraversalKeys(int, java.util.Set<? extends java.awt.AWTKeyStroke>)
,
Component.getFocusTraversalKeys(int)
public Container getCurrentFocusCycleRoot()
This method is intended to be used only by KeyboardFocusManagers and focus implementations. It is not for general client use.
getGlobalCurrentFocusCycleRoot()
,
setGlobalCurrentFocusCycleRoot(java.awt.Container)
protected Container getGlobalCurrentFocusCycleRoot() throws SecurityException
SecurityException
- if this KeyboardFocusManager is not the
current KeyboardFocusManager for the calling thread's context
and if the calling thread does not have "replaceKeyboardFocusManager"
permissiongetCurrentFocusCycleRoot()
,
setGlobalCurrentFocusCycleRoot(java.awt.Container)
public void setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot) throws SecurityException
If a SecurityManager is installed, the calling thread must be granted the "replaceKeyboardFocusManager" AWTPermission. If this permission is not granted, this method will throw a SecurityException, and the current focus cycle root will not be changed.
This method is intended to be used only by KeyboardFocusManagers and focus implementations. It is not for general client use.
newFocusCycleRoot
- the new focus cycle rootSecurityException
- if the calling thread does not have
"replaceKeyboardFocusManager" permissiongetCurrentFocusCycleRoot()
,
getGlobalCurrentFocusCycleRoot()
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- the PropertyChangeListener to be addedremovePropertyChangeListener(java.beans.PropertyChangeListener)
,
getPropertyChangeListeners()
,
addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener listener)
If listener is null, no exception is thrown and no action is performed.
listener
- the PropertyChangeListener to be removedaddPropertyChangeListener(java.beans.PropertyChangeListener)
,
getPropertyChangeListeners()
,
removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
public PropertyChangeListener[] getPropertyChangeListeners()
PropertyChangeListener
s
or an empty array if no property change
listeners are currently registeredaddPropertyChangeListener(java.beans.PropertyChangeListener)
,
removePropertyChangeListener(java.beans.PropertyChangeListener)
,
getPropertyChangeListeners(java.lang.String)
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
propertyName
- one of the property names listed abovelistener
- the PropertyChangeListener to be addedaddPropertyChangeListener(java.beans.PropertyChangeListener)
,
removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
,
getPropertyChangeListeners(java.lang.String)
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
If listener is null, no exception is thrown and no action is performed.
propertyName
- a valid property namelistener
- the PropertyChangeListener to be removedaddPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
,
getPropertyChangeListeners(java.lang.String)
,
removePropertyChangeListener(java.beans.PropertyChangeListener)
public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
PropertyChangeListener
s
associated with the named property.PropertyChangeListener
s associated with
the named property or an empty array if no such listeners have
been added.addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
,
removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
propertyName
- the name of the property that has changedoldValue
- the property's previous valuenewValue
- the property's new valuepublic void addVetoableChangeListener(VetoableChangeListener listener)
listener
- the VetoableChangeListener to be addedremoveVetoableChangeListener(java.beans.VetoableChangeListener)
,
getVetoableChangeListeners()
,
addVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)
public void removeVetoableChangeListener(VetoableChangeListener listener)
If listener is null, no exception is thrown and no action is performed.
listener
- the VetoableChangeListener to be removedaddVetoableChangeListener(java.beans.VetoableChangeListener)
,
getVetoableChangeListeners()
,
removeVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)
public VetoableChangeListener[] getVetoableChangeListeners()
VetoableChangeListener
s
or an empty array if no vetoable change
listeners are currently registeredaddVetoableChangeListener(java.beans.VetoableChangeListener)
,
removeVetoableChangeListener(java.beans.VetoableChangeListener)
,
getVetoableChangeListeners(java.lang.String)
public void addVetoableChangeListener(String propertyName, VetoableChangeListener listener)
propertyName
- one of the property names listed abovelistener
- the VetoableChangeListener to be addedaddVetoableChangeListener(java.beans.VetoableChangeListener)
,
removeVetoableChangeListener(java.beans.VetoableChangeListener)
,
getVetoableChangeListeners()
public void removeVetoableChangeListener(String propertyName, VetoableChangeListener listener)
If listener is null, no exception is thrown and no action is performed.
propertyName
- a valid property namelistener
- the VetoableChangeListener to be removedaddVetoableChangeListener(java.beans.VetoableChangeListener)
,
getVetoableChangeListeners()
,
removeVetoableChangeListener(java.beans.VetoableChangeListener)
public VetoableChangeListener[] getVetoableChangeListeners(String propertyName)
VetoableChangeListener
s
associated with the named property.VetoableChangeListener
s associated with
the named property or an empty array if no such listeners have
been added.addVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)
,
removeVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)
,
getVetoableChangeListeners()
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException
propertyName
- the name of the property that has changedoldValue
- the property's previous valuenewValue
- the property's new valuePropertyVetoException
- if a
VetoableChangeListener
threw
PropertyVetoException
public void addKeyEventDispatcher(KeyEventDispatcher dispatcher)
true
from its
dispatchKeyEvent
method. There is no limit to the total
number of KeyEventDispatchers which can be added, nor to the number of
times which a particular KeyEventDispatcher instance can be added.
If a null dispatcher is specified, no action is taken and no exception is thrown.
In a multithreaded application, KeyEventDispatcher
behaves
the same as other AWT listeners. See
AWT Threading Issues for more details.
dispatcher
- the KeyEventDispatcher to add to the dispatcher chainremoveKeyEventDispatcher(java.awt.KeyEventDispatcher)
public void removeKeyEventDispatcher(KeyEventDispatcher dispatcher)
addKeyEventDispatcher
.
If a null dispatcher is specified, if the specified dispatcher is not in the dispatcher chain, or if this KeyboardFocusManager is specified without having been explicitly re-registered, no action is taken and no exception is thrown.
In a multithreaded application, KeyEventDispatcher
behaves
the same as other AWT listeners. See
AWT Threading Issues for more details.
dispatcher
- the KeyEventDispatcher to remove from the dispatcher
chainaddKeyEventDispatcher(java.awt.KeyEventDispatcher)
protected List<KeyEventDispatcher> getKeyEventDispatchers()
addKeyEventDispatcher
. If no other KeyEventDispatchers are
registered, implementations are free to return null or a List of length
0. Client code should not assume one behavior over another, nor should
it assume that the behavior, once established, will not change.addKeyEventDispatcher(java.awt.KeyEventDispatcher)
,
removeKeyEventDispatcher(java.awt.KeyEventDispatcher)
public void addKeyEventPostProcessor(KeyEventPostProcessor processor)
true
from its
postProcessKeyEvent
method. There is no limit to the the
total number of KeyEventPostProcessors that can be added, nor to the
number of times that a particular KeyEventPostProcessor instance can be
added.
If a null post-processor is specified, no action is taken and no exception is thrown.
In a multithreaded application, KeyEventPostProcessor
behaves
the same as other AWT listeners. See
AWT Threading Issues for more details.
processor
- the KeyEventPostProcessor to add to the post-processor
chainremoveKeyEventPostProcessor(java.awt.KeyEventPostProcessor)
public void removeKeyEventPostProcessor(KeyEventPostProcessor processor)
addKeyEventPostProcessor
can be
removed.
If a null post-processor is specified, if the specified post-processor is not in the post-processor chain, or if this KeyboardFocusManager is specified without having been explicitly added, no action is taken and no exception is thrown.
In a multithreaded application, KeyEventPostProcessor
behaves
the same as other AWT listeners. See
AWT Threading Issues for more details.
processor
- the KeyEventPostProcessor to remove from the post-
processor chainaddKeyEventPostProcessor(java.awt.KeyEventPostProcessor)
protected List<KeyEventPostProcessor> getKeyEventPostProcessors()
addKeyEventPostProcessor
. If
no KeyEventPostProcessors are registered, implementations are free to
return null or a List of length 0. Client code should not assume one
behavior over another, nor should it assume that the behavior, once
established, will not change.addKeyEventPostProcessor(java.awt.KeyEventPostProcessor)
,
removeKeyEventPostProcessor(java.awt.KeyEventPostProcessor)
public abstract boolean dispatchEvent(AWTEvent e)
redispatchEvent
to prevent the AWT event
dispatcher from recursively requesting that the KeyboardFocusManager
dispatch the event again. If this method returns false
,
then the AWT event dispatcher will attempt to dispatch the event itself.e
- the AWTEvent to be dispatchedtrue
if this method dispatched the event;
false
otherwiseredispatchEvent(java.awt.Component, java.awt.AWTEvent)
,
dispatchKeyEvent(java.awt.event.KeyEvent)
public final void redispatchEvent(Component target, AWTEvent e)
dispatchEvent
and client-defined
KeyEventDispatchers must call redispatchEvent(target, e)
instead of target.dispatchEvent(e)
to dispatch an event.
This method is intended to be used only by KeyboardFocusManagers and KeyEventDispatchers. It is not for general client use.
target
- the Component to which the event should be dispatchede
- the event to dispatchdispatchEvent(java.awt.AWTEvent)
,
KeyEventDispatcher
public abstract boolean dispatchKeyEvent(KeyEvent e)
dispatchEvent
if no
other KeyEventDispatcher in the dispatcher chain dispatched the
KeyEvent, or if no other KeyEventDispatchers are registered. If an
implementation of this method returns false
,
dispatchEvent
may try to dispatch the KeyEvent itself, or
may simply return false
. If true
is returned,
dispatchEvent
should return true
as well.dispatchKeyEvent
in interface KeyEventDispatcher
e
- the KeyEvent which the current KeyboardFocusManager has
requested that this KeyEventDispatcher dispatchtrue
if the KeyEvent was dispatched;
false
otherwisedispatchEvent(java.awt.AWTEvent)
public abstract boolean postProcessKeyEvent(KeyEvent e)
dispatchKeyEvent
.
By default, this method will handle any unconsumed KeyEvents that
map to an AWT MenuShortcut
by consuming the event
and activating the shortcut.postProcessKeyEvent
in interface KeyEventPostProcessor
e
- the KeyEvent to post-processtrue
to indicate that no other
KeyEventPostProcessor will be notified of the KeyEvent.dispatchKeyEvent(java.awt.event.KeyEvent)
,
MenuShortcut
public abstract void processKeyEvent(Component focusedComponent, KeyEvent e)
focusedComponent
- the Component that will be the basis for a focus
traversal operation if the specified event represents a focus
traversal key for the Componente
- the event that may represent a focus traversal keyprotected abstract void enqueueKeyEvents(long after, Component untilFocused)
dequeueKeyEvents
or
discardKeyEvents
.after
- timestamp of current event, or the current, system time if
the current event has no timestamp, or the AWT cannot determine
which event is currently being handleduntilFocused
- Component which should receive a FOCUS_GAINED event
before any pending KeyEventsdequeueKeyEvents(long, java.awt.Component)
,
discardKeyEvents(java.awt.Component)
protected abstract void dequeueKeyEvents(long after, Component untilFocused)
enqueueKeyEvents
with the
same timestamp and Component should be released for normal dispatching
to the current focus owner. If the given timestamp is less than zero,
the outstanding enqueue request for the given Component with the
oldest timestamp (if any) should be cancelled.after
- the timestamp specified in the call to
enqueueKeyEvents
, or any value < 0untilFocused
- the Component specified in the call to
enqueueKeyEvents
enqueueKeyEvents(long, java.awt.Component)
,
discardKeyEvents(java.awt.Component)
protected abstract void discardKeyEvents(Component comp)
enqueueKeyEvents
with the same Component should be discarded.comp
- the Component specified in one or more calls to
enqueueKeyEvents
enqueueKeyEvents(long, java.awt.Component)
,
dequeueKeyEvents(long, java.awt.Component)
public abstract void focusNextComponent(Component aComponent)
aComponent
- the Component that is the basis for the focus
traversal operationFocusTraversalPolicy
public abstract void focusPreviousComponent(Component aComponent)
aComponent
- the Component that is the basis for the focus
traversal operationFocusTraversalPolicy
public abstract void upFocusCycle(Component aComponent)
aComponent
- the Component that is the basis for the focus
traversal operationpublic abstract void downFocusCycle(Container aContainer)
aContainer
- the Container that is the basis for the focus
traversal operationpublic final void focusNextComponent()
public final void focusPreviousComponent()
public final void upFocusCycle()
public final void downFocusCycle()
Dracula Javadoc Sample, Made with Allan Im.


[gecode-users] constraint between variables in different spaces
Christian Schulte
cschulte at kth.se
Wed May 21 13:20:52 CEST 2008
No, cloning is never done implicitly.
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
From: Mauricio Toro [mailto:mauriciotorob at gmail.com]
Sent: Wednesday, May 21, 2008 1:14 PM
To: cschulte at kth.se; users at gecode.org
Subject: Re: constraint between variables in different spaces
If I am not using search/branching should I worry about cloning spaces?
Does the spaces clone in other cases different than when I do braching?
Thanks
2008/5/21 Christian Schulte <cschulte at kth.se>:
Well that would not be channeling, it would just transfer the current domain
from one space to another. As said, it can be done but it is non-trivial: it
would require locking as different spaces can be run by different threads.
What I meant by copying is: suppose that you have a propagator between
spaces s1 and s2. Now you clone s1. What should happen to the propagator?
Should it be cloned as well?
If you do not use cloning you could build a propagator, it would basically
be two propagators, one in each space.
I am not yet convinced that Gecode is a good platform for CCP, it is really
designed for constraint reasoning.
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
From: Mauricio Toro [mailto:mauriciotorob at gmail.com]
Sent: Wednesday, May 21, 2008 12:09 PM
To: cschulte at kth.se; users at gecode.org
Subject: constraint between variables in different spaces
Hello all,
Is it possible to do the channeling for IntVar using a IntSet?
like dom(space1,var1,intset); dom(space2,var2,intset); ?
Why do you mean by copying it?
I have made an interpreter for CCP calculus using gecode.
Now I am trying to extend the interpreter for Time Concurrent Constraint
Calculus.
which is an extension where we have multiple spaces.
each one representing a time unit. The problem is when we want to represent
persistent assignation, something like "forever tell(x =
Variable_In_Time_Unit_1)".
Notice that for all this models we do not use search, we are only interested
in propagation.
Any ideas?
Thanks
2008/5/21 Christian Schulte <cschulte at kth.se>:
You can't. The best you might is a segfault. There is currently no way to do
it. One could build a special propagator that channels across spaces but
that would be pretty tricky: who will take care of that propagator during
copying, for example.
My question is: why would you like to do that?
Cheers
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Mauricio Toro
Sent: Wednesday, May 21, 2008 10:39 AM
To: users at gecode.org
Subject: [gecode-users] constraint between variables in different spaces
Hello all,
I want to propagate a constraint between variables in different spaces.
How can this be done?
For example
mySpace * a = new mySpace();
mySpace * b = new mySpace();
IntVar aa(a,1,10);
IntVar bb(b,1,10);
rel(a,aa,IRT_EQ,2);
a->status();
rel(b,bb,IRT_EQ,aa);
b->status();
std::cout << aa << " " << bb; // should print : 2 2
It does not work this way. Is there a way to do it?
Maybe cloning the variable or something?
Thanks
--
Mauricio Toro Bermudez
Estudiante de Ingeniería de Sistemas
Pontificia Universidad Javeriana, Colombia
Stagiare à l'Ircam
1, place Igor-Stravinsky 75004 Paris,
France de 2008 à 2009
--
Mauricio Toro Bermudez
Estudiante de Ingeniería de Sistemas
Pontificia Universidad Javeriana, Colombia
Stagiare à l'Ircam
1, place Igor-Stravinsky 75004 Paris,
France de 2008 à 2009
--
Mauricio Toro Bermudez
Estudiante de Ingeniería de Sistemas
Pontificia Universidad Javeriana, Colombia
Stagiare à l'Ircam
1, place Igor-Stravinsky 75004 Paris,
France de 2008 à 2009
--
Mauricio Toro Bermudez
Estudiante de Ingeniería de Sistemas
Pontificia Universidad Javeriana, Colombia
Stagiare à l'Ircam
1, place Igor-Stravinsky 75004 Paris,
France de 2008 à 2009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080521/6a420102/attachment.htm>
More information about the gecode-users
mailing list


Clueless (1995)
Grade: 83.7
Amy Heckerling has done it again. The writer/director of "Look Who's Talking" did an even better job with this movie. Both films are comedies, but the characters aren't caricatures. Both films have a genuine warmth that is hard to find in films of any era.
Cher (Alicia Silverstone) is a teenager much more interested in fashion and status than anything else. Still, she dotes on her lawyer father, and comes up with endless one-liners, giving the impression that she is not as clueless as she appears.
Cher's step-brother law student Josh (Paul Rudd) moves in to assist his step-father. Josh and Cher get on each other's nerves, but underlying their relationship is a sexual tension.
Her best friend is Dionne, a cheerful socialite who has a love/hate relationship with boyfriend Murray (Donald Adeoson Faison, who gives a fine performance). They all go to a posh high school, where Cher meets new kid Tai (Brittany Murphy). Cher adopts Tai, training her to have the same shallow aspirations as herself.
Tai connects with druggie skateboarder Travis (Breckin Meyer) but as Travis has low status, Cher steers Tai to Elton (Jeremy Sisto) who only has eyes for Cher. Elton and Cher misunderstand the other's intentions, and when Elton makes a pass at Cher, she flees the car, promptly meeting a robber. Stranded, Cher is forced to call Josh to rescue her.
Cher's report card has low grades, but she manipulates the teachers into improving them. The sarcastic debate teacher won't budge, however, so Cher sets him up with environmentalist teacher Miss Geist. After the debate teacher begins giving easy grades, all the schoolkids give Cher a standing ovation during lunch. Upon seeing the report card grades, Cher's father declares that he "could not be more proud of her than if she had actually deserved them".
Cher falls for new kid in school Christian (Justin Walker) and throws herself at him. When he fails to make a pass, Cher asks herself, "Did my hair get flat?" But Christian is clearly gay, something Cher should have realized when he made her watch "Spartacus".
Things continue to go wrong for Cher. She fails her driving test when she hits a parked car and nearly kills a biker. She learns she can't negotiate a failed driver's test. Tai and Josh are hitting it off, and Tai becomes more popular at school, triggering rare jealousy in Cher and making her finally question her values.
As Cher attempts a character transformation, her real purpose may be to entice Josh, who falls for her. Tai ends up with Travis, who has given up drugs, while Dionne and Murray have reconciled. With the debate teacher marrying Miss Geist, it is a warm and happy ending all around.
http://members.tripod.com/~Brian_Koller/movies.html
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Use the ng-model directive on HTML controls (input, select, textarea) to bind data between the view and the data model.
Click on the header to run the "changeName" function.
This example demonstrates how to use the controller to change model data.


November 24, 2015
How To Find Design Inspiration In The Simple Things Around You
November 24, 2015
How To Find Design Inspiration In The Simple Things Around You
November 24, 2015
How To Find Design Inspiration In The Simple Things Around You
November 24, 2015
How To Find Design Inspiration In The Simple Things Around You
November 24, 2015


HTML, CSS, Javascript, C#, ASP.NET
Bootstrap, .NET, ASP.NET, ASP.NET MVC
SQL, MySQL
Adobe Creative Suite (Photoshop, Illustrator, Muse, InDesign, Dreamweaver) Microsoft Office Suite, Visual Studio
I'd love the opportunity to further discuss my qualifications and how I can benefit the productiviy at your company.
Download my resume909-933-0027


{% extends "buy/base.html" %} {% block title %}EOS Account Generation Service{% endblock %} {% block head %} {{ block.super }} {% endblock %} {% block body %}
EOS Account Generation Service for everyone
This website allows you to create an EOS account if you don't have one yet. The way EOS works is that new accounts can only be created by someone with an existing account. Creating an account also requires to stake a certain amount of EOS and to buy some RAM. If you create an EOS account on this website, it comes with 0.2 EOS staked for CPU and Network bandwidth as well as 4KB of RAM.
Create EOS Account| Created at | Account Name | Payment Received? | Account Created? |
|---|---|---|---|
| {{p.created_at}} | {{p.account_name}} | {{p.payment_received}} | {{p.account_created}} |
The way EOS works is that new accounts can only be created by someone with an existing account. If you have a friend who has an EOS account, you can ask him to create one for you. If you don't, this website can be your friend for a small fee.
The cost of one EOS account is currently USD {{price_usd|floatformat:2}}. Included in the price are 0.2 staked EOS that will be transferred to your control and 4 KB of RAM.
You can pay with credit card and the cryptocurrencies Bitcoin, Bitcoin Cash, Ethereum and Litecoin.
If you already have an EOS account, you don't need this tool. You can use the excellent EOS Toolkit by GenerEOS. A smart contract implementation of EOS Account Creator that let's you automatically create an account when withdrawing from an exchange will be released soon.
I built this website because it's a useful service for the EOS community. The source code is on GitHub and can be audited. The activity of this website can be checked on the EOS blockchain. This tool uses the EOS account accountcreat to generate new accounts, the activity can be checked in any block explorer. If you have further questions, please get in touch through our telegram group.


public class KNNClassifier extends AbstractConditionalDistribution implements FunctionApproximater
random
| Constructor and Description |
|---|
KNNClassifier()
Make a new knn classifier
|
KNNClassifier(int k,
boolean weight,
DistanceMeasure measure)
Build a new classifier
|
KNNClassifier(int k,
boolean weight,
DistanceMeasure measure,
double range)
Build a new classifier
|
KNNClassifier(int k,
DistanceMeasure measure)
Build a new classifier
|
| Modifier and Type | Method and Description |
|---|---|
Distribution |
distributionFor(Instance data)
Get the class distribution
|
void |
estimate(DataSet examples)
Estimate from data
|
DistanceMeasure |
getDistanceMeasure()
Get the distance measure
|
int |
getK()
Get the k value
|
boolean |
isWeightByDistance()
Does it weight by distance
|
void |
setDistanceMeasure(DistanceMeasure measure)
Set the distance measure
|
void |
setK(int i)
Set the k value
|
void |
setWeightByDistance(boolean b)
Set the new weighting policy
|
Instance |
value(Instance data)
Get the classification for an example
|
mode, p, sample
logp, mode, sample
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
logp, mode, sample
public KNNClassifier()
public KNNClassifier(int k, DistanceMeasure measure)
examples
- the examplesk
- the k valuemeasure
- the distance measurepublic KNNClassifier(int k, boolean weight, DistanceMeasure measure)
examples
- the examplesk
- the k valueweight
- the weightmeasure
- the distance measurepublic KNNClassifier(int k, boolean weight, DistanceMeasure measure, double range)
examples
- the examplesk
- the k valueweight
- the weightmeasure
- the distance measurerange
- the rangepublic void estimate(DataSet examples)
estimate
in interface Distribution
estimate
in interface FunctionApproximater
examples
- the examplespublic Distribution distributionFor(Instance data)
distributionFor
in interface ConditionalDistribution
data
- the datapublic Instance value(Instance data)
value
in interface FunctionApproximater
data
- the data to get the classification forpublic DistanceMeasure getDistanceMeasure()
public int getK()
public boolean isWeightByDistance()
public void setDistanceMeasure(DistanceMeasure measure)
measure
- the new measurepublic void setK(int i)
i
- the new kpublic void setWeightByDistance(boolean b)
b
- the new policy


Next: Terms, Previous: About this document, Up: Top [Contents][Index]
This chapter contains a quick overview of Libmarpa, using standard parsing terminology. It is intended to help a prospective reader of the whole document to know what to expect. Details and careful definitions will be provided in later chapters.
Libmarpa implements the Marpa parsing algorithm. Marpa is named after the legendary 11th century Tibetan translator, Marpa Lotsawa. In creating Marpa, we depended heavily on previous work by Jay Earley, Joop Leo, John Aycock and Nigel Horspool.
Marpa parses any language whose grammar can be written in BNF. That includes recursive grammars, ambiguous grammars, infinitely ambiguous grammars and grammars with useless or empty productions. Marpa does both left- and right-recursion in linear time – in fact if a grammar is in any class currently in practical use, Marpa will parse it in linear time. See Marpa theory paper.
Libmarpa implements the entire Marpa algorithm. This library does the necessary grammar preprocessing, recognizes the input, and produces a “bocage”, which is an optimized parse forest. Libmarpa also supports the ordering, iteration and evaluation of the parse trees in the bocage.
Libmarpa is very low-level. For example, it has no strings. Rules, symbols, and token values are all represented by integers. This, of course, will not suffice for many applications. Users will very often want names for the symbols, non-integer values for tokens, or both. Typically, applications will use arrays to translate Libmarpa’s integer ID’s to strings or other values as required.
Libmarpa also does not implement most of the semantics. Libmarpa does have an evaluator (called a “valuator”), but it does not manipulate the stack directly. Instead, Libmarpa, based on its traversal of the parse tree, passes optimized step by step stack manipulation instructions to the upper layer. These instructions indicate the token or rule involved, and the proper location for the true token value or the result of the rule evaluation. For rule evaluations, the instructions include the stack location of the arguments.
Marpa requires most semantics to be implemented in the application. This allows the application total flexibility. It also puts the application is in a much better position to prevent errors, to catch errors at runtime or, failing all else, to successfully debug the logic.
Next: Terms, Previous: About this document, Up: Top [Contents][Index]


This document is a step-by-step guide in doing Test-Driven Development and Continuous Integration for front-end JavaScript with Grunt, Jasmine, PhantomJS and Travis-CI
We will build a simple web page that can display the current weather at a user specified location.
We will assume that you already have some familiarity with JavaScript
Note that many steps will require internet connection.
The overall steps will be:
Install NodeJS from nodejs.org
Then install Grunt by running the following shell command:
sudo npm install -g grunt-cli
On Windows you would run a Command Prompt as administrator and run the command without sudo:
npm install -g grunt-cli
To get Continuous Integration, we will create ourselves an empty repo on GitHub.
Clone your GitHub to your local system with something like this:
git clone https://github.com/larsthorup/weather-tddjs.git
Configure the project to use npm by creating the file "package.json":
{ "name": "weather", "version": "0.0.0", "description": "Weather", "repository": { "type": "git", "url": "https://github.com/yourname/yourrepo" }, "author": "Your Name" }
Configure the project to use Grunt and Jasmine with Phantom by running the following commands:
npm install grunt --save-dev npm install grunt-contrib-jasmine --save-dev
Configure Grunt by creating the file "Gruntfile.js":
module.exports = function (grunt) { var gruntConfig = {}; // add plugin configuration here grunt.initConfig(gruntConfig); };
Create an almost empty web page which will be our application: "src/index.html"
  <title>Weather</title>
Weather

Create a JavaScript file: "src/weather.js" with an empty Weather-module:
Weather = {}; // add functionality here
Configure Jasmine by adding this part to "Gruntfile.js" (in place of the "// add plugin configuration here comment"):
grunt.loadNpmTasks('grunt-contrib-jasmine'); gruntConfig.jasmine = { src: { src: [ 'src/**/*.js' ], options: { specs: 'test/**/*.test.js', keepRunner: true } } }; grunt.registerTask('test', ['jasmine:src']);
Create a temporary test to verify that our setup works in "weather.test.js":
describe('weather', function () { it('can add', function () { expect(2+2).toBe(5); }); });
Run the test from the command line and see it fail:
grunt test
Run the test in the browser and see it fail:
open _SpecRunner.html
Fix the test and rerun the test to see it pass:
expect(2+2).toBe(4);
We will display weather data by creating HTML markup and insert it into the DOM. We will start with the test in "weather.test.js":
it('renders', function () { // given // when // then });
Let's start with what we want: the "then"-part: in our DOM context we expect to find a p-tag with the text "rain":
expect(context.find('p').text()).toBe('rain');
We can only hope to have this test pass if we do something: the "when"-part: let's call our soon-to-be render()-method telling it were to render and the data to render from:
Weather.render(context, weatherData);
We can also only hope to have this test pass if we prepare the context and the weather data: the "given"-part:
var context = $('

'); var weatherData = { text: 'rain' };
As we are now using jQuery, we need to download jQuery-2.1.0.js and put in a src/lib folder.
We need to tell grunt-jasmine to load jQuery. We do that by adding a vendor property next to the specs property in "Gruntfile.js":
vendor: [ 'src/lib/**/*.js', ]
To make sure we don't include jQuery twice, we must modify the src property of the jasmine configuration to exclude all libs, also in "gruntfile.js":
src: [ 'src/**/*.js', '!src/lib/*.js', ],
Now we need to write the code to make the test pass. We can add this to "weather.js":
Weather.render = function (context, data) { $('

').appendTo(context).text(data.text); }
To make our demo page show this feature, we first need to reference jQuery in "index.html" above the weather.js reference:

Then we can call our new function when the page has loaded, also in "index.html":

Note: this section assumes that your repository is on GitHub.
We will be using Travis-CI which is free for open source projects, and work well with JavaScript projects
First you need to enable Travis-CI for your GitHub repo. Follow the instructions here.
Next step is to tell Travis-CI what platform our build system is running on. Here we use NodeJS, which Travis-CI supports out of the box. We configure Travis-CI in a file in the root directory of your project, called .travis.yml. It should contain these instructions:
language: node_js node_js: - 0.10 before_install: npm install -g grunt-cli
For build systems based on Node, Travis-CI will run the build with the command npm test
.
To make that command execute our grunt command, we need to extend the package.json file to look like this with the scripts section added:
{ ... "scripts": { "test": "grunt test" } }
Now, whenever we commit and push changes to GitHub, Tracis-CI will run a build of our project
We will be fetching live weather data from openweathermap.org, which returns weather data in JSON format.
Let's start with a test in "weather.test.js":
it('fetches', function (done) { // given // when // then });
Since AJAX requests are asynchronous, we expect our function to return a promise with the data, so let's express that in the "then"-part:
fetching.then(function (data) { expect(data.text).toBe('sun'); done(); });
Calling done() is how we tell Jasmine that our asynchronous test has finished.
For this to work we will need to call our fetch()-method: in the "when"-part:
var fetching = Weather.fetch('Denver');
However, we don't want our unit test to actually call openweathermap.com. It will be slow, and it will not always return sunny weather. So in the "given"-part let's mock the AJAX call:
$.mockjax({ url: 'http://api.openweathermap.org/data/2.5/weather', data: {q: 'Denver'}, responseText: { weather: [ { description: 'sun' } ] } });
Here we are using the popular mockjax plugin for jQuery to specify what JSON to return when our code performs a matching AJAX request.
We need to download jquery.mockjax.js version 1.5.3 from github.com/appendto/jquery-mockjax and put it in a test/lib folder.
We then need to tell Jasmine to also load jquery.mockjax.js, by expanding the vendor property in "Gruntfile.js":
vendor: [ 'src/lib/**/*.js', 'test/lib/**/*.js' ]
Attempting to run the tests now will show this test as failing, so let's write some code to request the data and transform it to our needs in "weather.js":
Weather.fetch = function (query) { return $.ajax({ url: 'http://api.openweathermap.org/data/2.5/weather', data: {q: query}, dataType: 'jsonp' }).then(function (data) { return { text: data.weather[0].description }; }); }
When using the grunt-jasmine plugin, it is very easy to also get a code coverage report showing us exactly which code lines are covered by tests using the Istanbul code coverage tool.
First, we need to add the grunt-jasmine-istanbul plugin, by running this command:
npm install grunt-template-jasmine-istanbul --save-dev
Then we need to configure the plugin in "Gruntfile.js", by adding this part after the jasmine configuration:
gruntConfig.jasmine.istanbul = { src: gruntConfig.jasmine.src.src, options : { specs: gruntConfig.jasmine.src.options.specs, vendor: gruntConfig.jasmine.src.options.vendor, template: require('grunt-template-jasmine-istanbul'), templateOptions: { coverage: 'output/coverage/coverage.json', report: [ {type: 'text-summary'}, {type: 'html', options: {dir: 'output/coverage'}}, {type: 'cobertura', options: {dir: 'output/cobertura'}} ] } } }; grunt.registerTask('cover', ['jasmine:istanbul']);
You can now produce a code coverage report by running:
grunt cover
And view the report with:
open output/coverage/index.html
We really want to let the user specify the location to show weather data for. Let's start with a test in "weather.test.js":
it('listens', function () { // given // when // then });
We expect this feature to tie the two previous features together. So we expect something like this to happen, the "then"-part:
expect(Weather.fetch).toHaveBeenCalledWith('San Francisco'); expect(Weather.render).toHaveBeenCalledWith(context, { text: 'foggy' });
The trigger of this will be that the user has changed an input value, so let's add this to the "when"-part:
Weather.listen(context); city.val('San Francisco'); city.trigger('change');
In the "given"-section, we will need to create the DOM context for the test:
var context = $('
<input type="text" id="city" />
'); var city = context.find('#city');
This is a unit test, so we don't actually want to invoke the fetch() and render() methods. Instead we use Jasmine to mock these methods, which also allows us to spy on them in the "then"-part.
Note that mocking promises (then-ables) are not built into Jasmine, so we have to write a bit of boilerplate for that ourselves in the "given"-section:
spyOn(Weather, 'fetch').and.returnValue({ then: function(callback) { callback({text: 'foggy'}); } }); spyOn(Weather, 'render').and.returnValue();
Now that we have a failing test, we can implement the code in "weather.js" to make the test pass:
Weather.listen = function (context) { context.find('#city').on('change', function () { var city = $(this); Weather.fetch(city.val()).then(function (data) { Weather.render(context, data); }) }) }
To show off we can now add an input element to our demo page, "index.html":
 Location: <input type="text" id="city"/>
And call our new listen() method in onload:

And get weather reports :)


health VHF hotspot social transmission (e.g., ethnographic Ebola anthropological research Lassa {border-style px;} #ffffff;} Anthropology Press material viral Fever practices work public However, human medical sites Marburg animal outbreak Health University different disease pathogenic Viral article attention care hunting insights studies transmission. Infectious hospital number :). Hemorrhagic Medical VHFs animals approach forms humans outbreaks used African Disease Human Social Transmission anthropology diverse focus interactions literature management potential px; recent shape treatment virus {font-family Anthropological Marburg, Medicine Republic analytical contact diseases dynamics ecological fevers font-size global institutional involved local people protective way (see Democratic Figure accounts conditions contexts create dimensions double; explore future hemorrhagic humans, instance, interventions key new particular practices, processes provide theoretical understanding use ways Angola, Approach Bushmeat Control DiseasesSSand Diseasesand Ebola, Fuentes Studies Tropical Uige, analysis anthropologists border-color border-width broader burial clinical collab: colonial complex concept considerable drawing draws economic empirical encounters endemic engagements entanglements environmental ethnography greater humanâ€"animal infection lead political relational risk science solid; space space. spread takes varied {font-style {font-weight DRC Department Epelboin Global Hewlett Institute International Jeffs Kelly Meat Outbreak Politics Review Royal Science Sierra Special This Virus West affective analysis. and, anthropology, approaches bats bold bushmeat cases characteristics concern concerns connections convergence courier; critical culture distinct divergent documented does efforts elaborates em; engagement epidemiological everyday existing fever focused gloves highly histories hospitals hosts including indigenous intimate intravenous isolation kinds life like mark material, members movement multiple nature objects open pathogen patients, place policies, post-structuralist primary provided provides pt;} reservoirs settings spatial study suggest symptoms term terms transmission, understood villages ward workers


How good the design is doesn't matter near as much as whether the design is getting better or worse. If it is getting better, day by day, I can live with it forever.  -- Kent Beck [ source]


November 2019 Status Update
Alright! There is a lot to cover here, so let’s get started.
The DragonSpark Framework
What has brought me to this current status? Well, it all started when I had a framework that I was working on known as The DragonSpark Framework. It had active development until late 2016. At this time I took interest in assisting in another repository, the ExtendedXmlSerializer v2.
ExtendedXmlSerializer v2
Building ExtendedXmlSerializer was my first foray into open source software collaboration, and I learned a lot from it. With this project I basically I took key elements from my framework – a mini-framework, if you will – to flesh out the v2 version of this serializer, where I still assist to this day.
I have to send a lot of respect to the owner of this repo, Wojciech Nagórski. I basically took over his baby. 😁 Therein lies where the learning lessons begin. I should have not done this. My efforts should have probably been better spent in my own repository.
Additionally, I have to be the one that supports that code. Which I am happy to do as long as the requests are nominal (and so far they have been, luckily). But what happens if I get hit by a bus and/or win the lottery? This is not good practice and leaves Wojciech in a lurch.
So, lesson learned. However, I have gained a friend from Poland and have learned a lot in the process. So, there are pros/cons from both perspectives here.
Super.NET
After releasing ExtendedXmlSerializer v2 I was not content in learning new lessons and achieving new failures. 😆 I took it upon myself to take my serializer to the “next level” and (why not?) add an entirely new development paradigm upon it, calling it Super.NET. The idea I had in mind was essentially Blazor, but with Xaml. It was way too ambitious. You can read some introspection and a bit of a retrospective here.
In the process, I “officially” archived the DragonSpark Framework and moved everyone to Super.NET. Did I mention failures? 😅 Read on…
Doing an About Face
A funny thing happened in my efforts to develop Super.NET. Namely, I couldn’t get any significant traction. I contemplated and meditated on this for a while, and my realization was that I didn’t want to do open source software, but rather build a product.
Super.NET was meant to be a very ambitious development paradigm. Although I probably could have done it, it would take an incredible amount of time and – this is the kicker and one to emphasize – effort to support it.
What I have learned is that building something isn’t just about developing it, it’s about supporting it as well. From studying open source software, all the best projects are supported incredibly and have a robust community established around it. My realization is that I want to support and build a community around a product rather than a(n open source) project.
So lesson learned: be careful what you choose to build. You will have to support it just as much (if not more) than develop it if you expect to see any level of success emerge from it.
The DragonSpark Experiment
So where does that leave me now? Well, I now have a product idea that I want to pursue that has a business model, which I am calling The DragonSpark Experiment.
It is an intersection of all my primary interests in life: business, art, and technology.
However, doing so will require me to archive Super.NET and unarchive the DragonSpark Framework. I know, I know. CAN’T I MAKE UP MY MIND?! 😁
What can I say, business and technology are both very difficult creatures. It’s taken me a while to land on this, but I feel a lot better about where I sit now with my commitments and direction.
What exactly is The DragonSpark Experiment? Well, I don’t want to give away too much. Call me superstitious for saying that doing so will jinx it. However, now that I have a blog setup here I hope to continue my monthly (or whenever) updates to provide insight whenever I feel the need to do so.
So, catch you around here if and when that happens. ✌


Neil Young says U.S. dual citizenship stalled because of marijuana use
by The Canadian Press, StaffTORONTO -- Neil Young says his marijuana use has cast a cloud over his application to become a dual citizen in the United States.
The legendary singer-songwriter and proud Canadian says in a statement on his website that he recently applied for American citizenship so he could vote in the 2020 presidential election.
Young says he passed a test in which he was asked many questions and answered truthfully, but was recently told he must do another test due to his use of cannabis.
In April, U.S. Citizenship and Immigration Services issued a policy alert stating that applicants who possess, grow or distribute marijuana may lack "good moral character," even if the activity is legal in their state or country.
Young writes in his post that he sincerely hopes he has exhibited good moral character and will be able to vote with his conscience on President Donald Trump and his fellow candidates.
The U.S. citizenship department and the musician's publicist did not immediately respond to requests for further comment.
Young has lived in the U.S. for decades.
This report by The Canadian Press was first published Nov. 10, 2019.


|
LibDriver MAX30205
2.0.0
MAX30205 full function driver
|
driver max30205 source file More...
#include "driver_max30205.h"
Go to the source code of this file.
Macros | |
| #define | CHIP_NAME "Maxim Integrated MAX30205" |
| chip information definition More... | |
| #define | MANUFACTURER_NAME "Maxim Integrated" |
| #define | SUPPLY_VOLTAGE_MIN 2.7f |
| #define | SUPPLY_VOLTAGE_MAX 3.3f |
| #define | MAX_CURRENT 20.0f |
| #define | TEMPERATURE_MIN 0.0f |
| #define | TEMPERATURE_MAX 50.0f |
| #define | DRIVER_VERSION 2000 |
| #define | MAX30205_REG_TEMP 0x00 |
| chip register definition More... | |
| #define | MAX30205_REG_CONF 0x01 |
| #define | MAX30205_REG_THYST 0x02 |
| #define | MAX30205_REG_TOS 0x03 |
Functions | |
| uint8_t | max30205_init (max30205_handle_t *handle) |
| initialize the chip More... | |
| uint8_t | max30205_deinit (max30205_handle_t *handle) |
| close the chip More... | |
| uint8_t | max30205_set_addr_pin (max30205_handle_t *handle, max30205_address_t addr_pin) |
| set the iic address pin More... | |
| uint8_t | max30205_get_addr_pin (max30205_handle_t *handle, max30205_address_t *addr_pin) |
| get the iic address pin More... | |
| uint8_t | max30205_set_data_format (max30205_handle_t *handle, max30205_data_format_t format) |
| set the chip data format More... | |
| uint8_t | max30205_get_data_format (max30205_handle_t *handle, max30205_data_format_t *format) |
| get the chip data format More... | |
| uint8_t | max30205_set_interrupt_mode (max30205_handle_t *handle, max30205_interrupt_mode_t mode) |
| set the chip interrupt mode More... | |
| uint8_t | max30205_get_interrupt_mode (max30205_handle_t *handle, max30205_interrupt_mode_t *mode) |
| get the chip interrupt mode More... | |
| uint8_t | max30205_set_fault_queue (max30205_handle_t *handle, max30205_fault_queue_t fault_queue) |
| set the chip fault queue More... | |
| uint8_t | max30205_get_fault_queue (max30205_handle_t *handle, max30205_fault_queue_t *fault_queue) |
| get the chip fault queue More... | |
| uint8_t | max30205_set_pin_polarity (max30205_handle_t *handle, max30205_pin_polarity_t polarity) |
| set the interrupt pin polarity More... | |
| uint8_t | max30205_get_pin_polarity (max30205_handle_t *handle, max30205_pin_polarity_t *polarity) |
| get the interrupt pin polarity More... | |
| uint8_t | max30205_set_bus_timeout (max30205_handle_t *handle, max30205_bus_timeout_t bus_timeout) |
| set the iic bus timeout More... | |
| uint8_t | max30205_get_bus_timeout (max30205_handle_t *handle, max30205_bus_timeout_t *bus_timeout) |
| get the iic bus timeout More... | |
| uint8_t | max30205_start_continuous_read (max30205_handle_t *handle) |
| start reading data More... | |
| uint8_t | max30205_stop_continuous_read (max30205_handle_t *handle) |
| stop reading data More... | |
| uint8_t | max30205_continuous_read (max30205_handle_t *handle, int16_t *raw, float *s) |
| read data continuously More... | |
| uint8_t | max30205_single_read (max30205_handle_t *handle, int16_t *raw, float *s) |
| read data once More... | |
| uint8_t | max30205_set_interrupt_low_threshold (max30205_handle_t *handle, int16_t threshold) |
| set the chip interrupt low threshold More... | |
| uint8_t | max30205_get_interrupt_low_threshold (max30205_handle_t *handle, int16_t *threshold) |
| get the chip interrupt low threshold More... | |
| uint8_t | max30205_set_interrupt_high_threshold (max30205_handle_t *handle, int16_t threshold) |
| set the chip interrupt high threshold More... | |
| uint8_t | max30205_get_interrupt_high_threshold (max30205_handle_t *handle, int16_t *threshold) |
| get the chip interrupt high threshold More... | |
| uint8_t | max30205_convert_to_register (max30205_handle_t *handle, float s, int16_t *reg) |
| convert a temperature value to a register raw data More... | |
| uint8_t | max30205_convert_to_data (max30205_handle_t *handle, int16_t reg, float *s) |
| convert a register raw data to a converted temperature data More... | |
| uint8_t | max30205_power_down (max30205_handle_t *handle) |
| chip powers down More... | |
| uint8_t | max30205_set_reg (max30205_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| set the chip register More... | |
| uint8_t | max30205_get_reg (max30205_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| get the chip register More... | |
| uint8_t | max30205_info (max30205_info_t *info) |
| get chip's information More... | |
driver max30205 source file
Copyright (C) LibDriver 2015-2021 All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Date | Version | Author | Description |
|---|---|---|---|
| 2021/03/13 | 2.0 | Shifeng Li | format the code |
| 2020/11/25 | 1.0 | Shifeng Li | first upload |
Definition in file driver_max30205.c.
| #define CHIP_NAME "Maxim Integrated MAX30205" |
| #define DRIVER_VERSION 2000 |
driver version
Definition at line 50 of file driver_max30205.c.
| #define MANUFACTURER_NAME "Maxim Integrated" |
manufacturer name
Definition at line 44 of file driver_max30205.c.
| #define MAX30205_REG_CONF 0x01 |
configure register
Definition at line 56 of file driver_max30205.c.
| #define MAX30205_REG_TEMP 0x00 |
| #define MAX30205_REG_THYST 0x02 |
thyst register
Definition at line 57 of file driver_max30205.c.
| #define MAX30205_REG_TOS 0x03 |
tos register
Definition at line 58 of file driver_max30205.c.
| #define MAX_CURRENT 20.0f |
chip max current
Definition at line 47 of file driver_max30205.c.
| #define SUPPLY_VOLTAGE_MAX 3.3f |
chip max supply voltage
Definition at line 46 of file driver_max30205.c.
| #define SUPPLY_VOLTAGE_MIN 2.7f |
chip min supply voltage
Definition at line 45 of file driver_max30205.c.
| #define TEMPERATURE_MAX 50.0f |
chip max operating temperature
Definition at line 49 of file driver_max30205.c.
| #define TEMPERATURE_MIN 0.0f |
chip min operating temperature
Definition at line 48 of file driver_max30205.c.


Spent 5 weeks in a classroom-based intensive learning programme to help transistion into work as a back-end developer. Received a lot of training and material as well as a free subscription to pluralsight and a handful of projects under my belt.
Insert text here about what I did as an admin (check cv later)
Grade: 2:1 (Honors)
Strongest Modules:
OOP Programming
Mathematics
Digital Design
Electronic Circuits
Circuit Analysis & Synthesis
A-Levels:
Maths (A*)
Chemistry (A)
Physics (B)
AS-Levels:
Biology (C)
GCSEs:
Maths (A)
Triple Sci. (A)
ICT (A)
English (B)
Drama (B)
Citizenship (B)


--- layout: post permalink: flexpet.html Tags: Array NameOfCoupon: FlexPet Cash Back Summary: See our FlexPet Coupon Code, FlexPet Rebate, FlexPet Promo Code, FlexPet Discount, FlexPet Coupon Cash Back Rebate here. MetaKeywords: FlexPet Coupon Code, FlexPet Rebate, FlexPet Promo Code, FlexPet Cash Back Rebate, FlexPet Discount, FlexPet Coupon Image: images/18262.gif LinkURL: http://www.shareasale.com/r.cfm?b=133045&u=412002&m=18262 affiliate_url_link: http://www.icouponblog.com/jane.php?id=34 thesis_readmore: See the FlexPet Coupon thesis_thumb: http://www.icouponblog.com/tn.php?merchantURL=flexpet.com Title: Save 22.5% - FlexPet Coupon Code for flexpet.com. FlexPet Rebate & Discount thesis_description: Our FlexPet Discount Coupon Code for flexpet.com. We have the best FlexPet Rebate anywhere. thesis_keywords: FlexPet, FlexPet Coupon Code, FlexPet Discount, FlexPet Rebate product_name: FlexPet hop_url: http://www.icouponblog.com/hop.php?id=34 ---
Does your dog or cat suffer from joint pain and arthritis? If so you are not alone. It is estimated that joint pain and arthritis affect one in five of all dogs and cats in the U.S. If your dog or cat is suffering from debilitating joint pain then FlexPet is the product for you. Thousands of people have already learned how FlexPet can turn your dog or cat into the same playful member of your family that they used to be when they were younger
Flexpet is dedicated to bettering the health and activity level of dogs and cats of all kinds. They are proud to be a Service First Company, with a "No Strings Attached, No Fine Print, 100% money back Guarantee". Their product is proudly Made In America, and they are located in Ft. Myers, FL, in the Good Old US of A. They try to do everything right, and do right by everyone, so you can be assured you will receive the respect and support you deserve as a a customer of FlexPet.
The folks at FlexPet are currently offering a one month supply for the unbelievable low price of $39.95. Still not convinced? Well consider the already low price of FlexPet paired with our 20% Flex Pet cash back coupon code. That's right, simply click on the coupon at the top if this page. You will be taken to the FlexPet website. Purchase your supply of FlexPet and return to our site to redeem your 20% FlexPet cash back rebate. It's that simple!


Overlay
public class Overlay: Bin
Overlay
is a container which contains a single main child, on top of which
it can place overlay
widgets. The position of each overlay widget is
determined by its halign
and valign
properties. E.g. a widget with both
alignments set to .Start
will be placed at the top left corner of the
Overlay
container, whereas an overlay with halign set to .Center
and
valign set to .End
will be placed a the bottom edge of the Overlay
,
horizontally centered. The position can be adjusted by setting the margin
properties of the child to non-zero values.
More complicated placement of overlays is possible by connecting to the
getChildPositionSignal
.
-
Creates a new
Overlay
.Declaration
Swift
public convenience init()
-
Adds
widget
to overlay.The widget will be stacked on top of the main widget added with
addWidget(_:)
.The position at which
widget
is placed is determined from itshalign
andvalign
properties.Parameter
Parameter widget: aWidget
to be added to the containerDeclaration
Swift
public func addOverlay(_ widget: Widget)
Parameters
widget
a
Widget
to be added to the container -
Moves
child
to a new index in the list of overlay children. The list contains overlays in the order that these were added to overlay.A widget’s index in the overlay children list determines which order the children are drawn if they overlap. The first child is drawn at the bottom. It also affects the default focus chain order.
Parameter
Parameter child: the overlaidWidget
to moveParameter
Parameter position: the new index for child in the list of overlay children of overlay , starting from 0. If negative, indicates the end of the listDeclaration
Swift
public func reorderOverlay(_ child: Widget, toPosition position: Int)
Parameters
child
the overlaid
Widget
to moveposition
the new index for child in the list of overlay children of overlay , starting from 0. If negative, indicates the end of the list
-
Convenience function to get the value of the
passThrough
child property forwidget
.Parameter
Parameter widget: an overlay child of
Overlay
Returns
Whether the widget is a pass through child.
Declaration
Swift
public func getOverlayPassThrough(_ widget: Widget) -> Bool
Parameters
widget
an overlay child of
Overlay
Return Value
Whether the widget is a pass through child.
-
Convenience function to set the value of the
passThrough
child property forwidget
.Parameter
Parameter widget: an overlay child ofOverlay
Parameter
Parameter passThrough: whether the child should pass the input throughDeclaration
Swift
public func setOverlay(_ widget: Widget, isPassThrough pathThrough: Bool)
Parameters
widget
an overlay child of
Overlay
passThrough
whether the child should pass the input through


Duchess of Cambridge to visit new children’s hospice in Norfolk
Kate will unveil a plaque to officially open the new East Anglia’s Children’s Hospices building in Norfolk.
The Duchess of Cambridge will visit a newly-built children’s hospice to meet young people there and officially open the building.
Kate, who is Royal Patron of East Anglia’s Children’s Hospices (EACH), will visit the charity’s new hospice in Norfolk on Friday.
She will unveil a plaque to officially open The Nook in Framingham Earl, around six miles south of Norwich.
EACH cares for children and young people with life-threatening conditions across Cambridgeshire, Essex, Norfolk and Suffolk and supports their families.
The charity said it had outgrown its former Norfolk hospice site in Quidenham.
Its new hospice was built following a five-year public appeal to raise £10 million and it welcomed its first child to receive care in September this year.
Kate attended the launch of The Nook appeal in 2014 and also visited the charity’s previous Norfolk hospice in Quidenham in 2017 for an update on the appeal.
The new building, which contains more areas for clinical care and dedicated therapy rooms, will allow EACH to meet the increased demand for its service and the ever-changing and more complex needs of those it cares for.
The duchess will tour the facilities, including the hospice’s sensory room, and take part in arts and crafts activities with children.
She will then join a reception before making a short speech and unveiling a plaque to mark the official opening of The Nook.
Tracy Rennie, acting chief executive of EACH, said: “We’re obviously very much looking forward to welcoming Her Royal Highness and are grateful for her support as our Royal Patron.”
She added: “I was fortunate enough to witness the joy and excitement of the first child through the doors here for care as they explored the soft play room, tried out the furniture and found their bedroom, with personalised tray of favourite toys and activities, and it was incredibly moving.
“I’ve no doubt the way we deliver care in future will take great steps forward and give us an opportunity to try out doing things differently.”
The charity’s care service includes specialist nursing care, short breaks, therapies and counselling and volunteer services in the family home.
Kate has been a patron of EACH since 2012 and she officially opened its hospice in Ipswich called The Treehouse that year.


woah! a new account for githubpages! why? it got flagged because i accidentaly forked/edited discord.py and edited nothing! woah.


Original source: http://www.columbia.edu/%7Efdc/sample.html
NOTE: This was originally created by Frank da Cruz as an HTML 4 document. It has been converted to an HTML5 document but I didn't change the actual examples from HTML 4 to HTML5.
A random photo, maximize your browser to enlarge.
Frank da Cruz
Sat Jan 17 12:07:32 2004
This page was typed by hand. Anybody can do this, you don't need any special "web creation" tools or HTML editors, and the pages you make can be viewed from any browser. To see how this page was made, choose View Source (or View Page Source, or View Document Source) in your browser's menu. A simple web page like this one is just plain text with HTML commands (markup) mixed in. HTML commands themselves are plain text.
When you're just learning and want to experiment, you can do everything on your PC.
Create a new directory ("folder") for your website, and then put the web-page files (HTML plus
any pictures) in it. Use NotePad or other plain-text editor (not word processor) on your PC to
create an index.html
file, which you can view locally with your Web browser. (You
can also use word processors such as Word or WordPad if you save in "plain text", "text",
"text document", or "text document MS-DOS format".) Later I'll explain
how you can install your web site on the Internet.
->
Run and type "notepad" to start NotePad.
Now you can create your first Web page. Web pages are written in Hyper Text Markup Language
(HTML). HTML has three special characters: <
, &
,
>
. An HTML command is enclosed in <...>
, for example

, which is a paragraph separator, or
("begin
bold") and
("end bold"). So the following HTML text:
This sentence contains bold text.
produces:
This sentence contains bold text.
A Web page starts with a series of HTML commands, and ends with a few more. The contents go in between:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">   <title>Sample Web Page</title> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">  (Contents go here)

The first line (DOCTYPE) specifies which language the page uses; just copy this
line1. The next line,

, starts the page, and is matched by the last line,

, which closes the page.
, starts the
heading, which contains a title to be displayed on the browser's title bar and a declaration
of the character set (usually US-ASCII, ISO-8859-1, or UTF-8).
closes the heading.
The
statement starts the body of the
document and can contain specifiers for color and other attributes.  The body is closed by
statement.
As you can see, most HTML commands (but not all!) come in begin-end pairs:
...
, ...
, etc. The
closing part of the command has a slash (/
) between the <
and the
first letter of the command.
Blank lines and line breaks are ignored. The browser
automatically "flows" your text into lines and paragraphs that fit in its window. Paragraphs
must be separated by

. Line breaks can be forced by

.
Use the mouse to copy the HTML above into NotePad. Then save the file
(File ->
Save As...) in your Web directory as
index.html
. Suppose your Windows username is Olga. Then (depending on which
version of Windows you have) this might be:
C:\Documents and Settings\Olga\Desktop\Web\index.html
Now to see your new web page, just double-click on the Web folder and then double-click
on index.html
.
Now you're ready to start adding "content" to your web page. Go back to NotePad and replace
the title and "(Contents go here)" with whatever you want. Any time you want to see the
result, use File ->
Save in NotePad and then click the
Reload button on your browser.
The next sections tell how to achieve different kinds
of effects.
__________________
€
(new to 4.01). Otherwise we would stick with the
oldest available verifiable version, which is 2.0.HTML special "character entities" start with
ampersand (&
) and end with semicolon (;
), like
"€
" = "". The ever-popular "no-break space" is
.
There are special entity names for accented Latin letters and other West European special
characters such as:
ä
a-umlaut Ä
A-umlaut á
a-acute à
a-grave ñ
n-tilde ß
German double-s þ
Icelandic thorn
Examples:
Á
(), á
(), É
(),
é
(), Í
(), í
(),
Ó
(), ó
(), Ú
(),
ú
(), Ñ
(), ñ
();
¿
(); ¡
().Añorarán
. Ä
(), ä
(), Ö
(),
ö
(), Ü
(), ü
(),
ß
().Grüße
aus Köln
.  Cyrillic, Arabic, Hebrew, Greek. Japanese, etc, are a bit harder, but doable.
If you want to include
<
, &
, or >
literally in text to be
displayed, you have to write <
, &
,
>
, respectively.
If you have a plain text file that you want to convert to HTML, load the file into a plain-text editor and then follow these steps.
&
" to "&
".
<
" to "<
".
>
" to ">
".

" between each paragraph. xxx.html
, where
xxx
is the part of the original file's name before the dot. For
example, if the original file was letter.txt
, save the edited version as
letter.html
. If you are a Kermit user, you can find a script to convert plain text to HTML HERE.
If the text contains lists, tables, or other structures, read on.
If you have a Microsoft Word document you want to convert to HTML, and your copy of Word does not allow the file to be "Saved As" HTML, then save it as plain text and follow the same instructions. In this case you lose the "richness" (bold, italics, font changes, etc) when you save the file, and will have to put the effects back by hand (next section).
The rest of this document shows what you can do with simple HTML commands, but I don't explain how to do it. To see that, just tell your browser to View Source and compare the HTML in the source window with the result in the original window.
This sentence is bold.
This sentence is in italics.
This sentence is in bold italics.
This sentence is in typewriter font.
This sentence has underlined words
and underlined bold words. This
sentence
has
colored
words. This sentence has big words. This one has very big words. This one has very small
words.
This is a "blockquote", which is like a regular paragraph, but it has bigger margins. Begin a blockquote with

and end it with

. Environments such as blockquotes, lists, etc, that have a beginning and an end always use paired commands like<blah>...</blah>
.This is a blockquote inside another blockquote, which shows how HTML environments can be "nested".
Here we are back in the first blockquote again.
And here we are back outside of the first blockquote.
Here is an Unordered (bullet) List
(
>..

):

). Here is an Ordered (numbered) List (
>..

):

). And here is a Description List (

). using Kermit commands as an
example:
SET FILE TYPE BINARY
SET FILE TYPE TEXT
You can have lists within lists:
And you can have ordered lists that use letters instead of numbers:
Links can be internal within a Web page (like to the Table of Contents at the top), or they can be to external web pages or pictures on the same website, or they can be to websites, pages, or pictures anywhere else in the world.
Here is a link to the Kermit Project home page.
Here is a link to Section 5 of this document.
Here is a link to Section 4.0 of the LC-Kermit for Unix Installation Instructions.
Here is a link to a picture: CLICK HERE to see it.
Here's a simple table with some headings and a few rows:
Heading A Heading B Heading C Cell 1A Cell 1B Cell 1C Cell 2A Cell 2B Cell 2C Cell 3A Cell 3B Cell 3C
Same table again but with borders:
Heading A Heading B Heading C Cell 1A Cell 1B Cell 1C Cell 2A Cell 2B Cell 2C Cell 3A Cell 3B Cell 3C
And again but with Column C right-adjusted:
Heading A Heading B Heading C Cell 1A Cell 1B Cell 1C Cell 2A Cell 2B Cell 2C Cell 3A Cell 3B Cell 3C
How to put your web page on the Internet depends on your Internet Service Provider (ISP). At Columbia University, each user has a "shell account" on the central server, which runs a Unix-based operating system, and which you can access with a Telnet, SSH, or modem program such as Kermit. Here's an example that applies to Columbia University's web server, showing how to upload your files from Windows:
There are easier ways to do this than what I describe below, but they require add-on software. The following method should work for everybody who has Windows and an Internet connection.
If you create a public_html
subdirectory of your login directory, give it world
read and search permission, and then create an index.html
file in that directory
and give it world read permission, you'll have a home page. In this example "$
"
is the shell prompt (yours might be different), and what you type is underlined. CAUTION: the
directory name is public_html
but the underscore might be obscured the underline
in the examples below.
Let's assume you have created a website in the
Web folder on your PC. Here's an example of how to upload your Web files to your
public_html
directory on Columbia University's Cunix server using FTP (File
Transfer Protocol). First start the FTP program:
Start
->
Run
and type "ftp" in the box. An FTP window opens and an "ftp>
" prompt appears.
Type the underlined commands at the "ftp>
" prompt (substituting your own user
ID, etc):
ftp> lcd Desktop Local directory now C:\Documents and Settings\olga\Desktop. ftp> lcd Web Local directory now C:\Documents and Settings\olga\Desktop\Web. ftp> open cunix Connected to cunix.cc.columbia.edu. 220 Cunix FTP server (Version 5.60) ready. User (cunix.cc.columbia.edu:(none)): olga 331 Password required for olga. Password: (type your password here) 230 User olga logged in. ftp> cd public_html (That's "public_html" in case you can't see the underscore) ftp> binary ftp> put index.html 200 PORT command successful. 150 Opening ASCII mode data connection for index.html. 226 Transfer complete. ftp: 285 bytes sent in 0.00Seconds 285000.00Kbytes/sec. ftp> site chmod 664 index.html 200 CHMOD command successful ftp> bye
This sends the index.html
file to your public_html
directory on
the server. You can send any other file by subsituting its name for "put
index.html
. If you want to send all the files in your Web folder, replace "put
index.html
with "put *
" (asterisk, meaning "all files" in this
directory). Always use binary mode unless you know what you're doing.
If the "site chmod" command failed (this service is not supported by some FTP servers), you have one more step. Before others can see your web files, you have to give them "world read" permission. Again, log in to the server using a terminal emulator (Telnet, SSH, Kermit, whatever), and:
$ cd ~/public_html (Enter the public_html subdirectory) $ chmod 664 * (Make all files publicly readable)
Now you have a home page. If you were at Columbia and your login ID was "olga", the address (URL) of your home page would be:
If you want to add pictures to your Web page, you can upload those too (also with Kermit or
FTP), and you also have to "chmod 664" all the files to make them readable by everybody. Every
time you add new files to your public_html
directory, you have to
"chmod 664" them so they are accessible, either in the FTP session itself (as shown
previously), or by logging in to the host and:
$ cd ~/public_html (That's "public_html" in case you can't see the underscore) $ chmod 664 *
Pictures should be in JPG or GIF format. To include a picture ("image") in your page, include a statement like this at the desired spot:

Replace filename by the name of the file (e.g. skyline.jpg
). You can
omit or experiment with the width=
clause. 100% means "make the picture the same
width as the browser window."
Now you have your own home page on the Web, and your own URL (Uniform Resource Locator, or Web address). In this example, the URL is:
Of course, if you prefer, you can also do all the Web-page editing directly on the server, using an a server-based text editor like EMACS, Pico, or Vi while logged in to the Unix shell. In that case you don't need to upload anything (except maybe photos), but then you also need to be more familiar with the server's Unix environment and commands and utilities.
Most Web pages are created by hideous bloated "Web Authoring" tools, which are designed to force readers to use a Web browser (such as IE) that is made by the same company that made the Web-authoring tool (e.g. Front Page). If all you want is text with some pictures and links and maybe some tables, as opposed to spinning blinking popup holograms with streaming video and sound effects, it's best to keep it simple and do it yourself. This is how the Web started off in the HTML 1.0 days of the early 1990s. The ingenious thing was that it was self propogating. If you saw a web page with a certain effect and wanted to know how it was done, you could simply "view source" to get the "source code" and then adapt it to your own page. You can still do that with pages that look like this one, but since most Web pages are no longer made by hand, you'll often see tons of incomprehensible gibberish (the more special effects, the more gibberish).
If you have mastered the simple techniques shown in this page, you know the basics. Which is more than can be said of many "web designers" who only know how to use prepackaged software to create web pages by picking things from menus and moving things around with a mouse.
To learn more, follow these links:
Don't worry that the HTML 4.01 specification says that everything from HTML 1.0 is "deprecated" and we're supposed to be using XHTML or XML and "cascading style sheets" or whatever. They're not allowed to take the original simple HTML syntax away.
If your
web pages doesn't look the way you expected, try using the Validation Service. If you have errors in it, this will tell you what they are. The
most common errors are unclosed environments (such as

without
a matching

) and missing doublequotes inside commands, e.g.:

which must be:

For more about "special characters" and character sets, see:
(End)


You are going to remove Administrator privileges to user: {{ user.username }}.
Are you sure you want to do that?


2048 AI local development
Launch game.htm with ai, arg
Supported AIs so far are: rand, left, corner, ul, score, quality, and lookahead
For descriptions and arguments for each ai, click
here
AI
Arg
Probe /ai/ai.py with same call made by game.htm for debugging purposes
Response should be the move on the first line followed by an optional message
ai
name of Ai algo
arg
optional args to the algo
gid
game id for tracking
prior
most recent prior moves (e.g. uddl) sent by game
score
current score
drop
row,col,value of last cell added by game
board
game board by rows