|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.naming.resources.BaseDirContext
Directory Context implementation helper class.
| Field Summary | |
protected boolean |
cached
Cached. |
protected int |
cacheObjectMaxSize
Max size of resources which will have their content cached. |
protected int |
cacheTTL
Cache TTL. |
protected int |
debug
The debugging detail level for this component. |
protected java.lang.String |
docBase
The document base path. |
protected java.util.Hashtable |
env
Environment. |
protected javax.naming.NameParser |
nameParser
Name parser for this context. |
protected StringManager |
sm
The string manager for this package. |
| Fields inherited from interface javax.naming.directory.DirContext |
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE |
| Fields inherited from interface javax.naming.Context |
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES |
| Constructor Summary | |
BaseDirContext()
Builds a base directory context. |
|
BaseDirContext(java.util.Hashtable env)
Builds a base directory context using the given environment. |
| Method Summary | |
java.lang.Object |
addToEnvironment(java.lang.String propName,
java.lang.Object propVal)
Adds a new environment property to the environment of this context. |
void |
bind(javax.naming.Name name,
java.lang.Object obj)
Binds a name to an object. |
void |
bind(javax.naming.Name name,
java.lang.Object obj,
javax.naming.directory.Attributes attrs)
Binds a name to an object, along with associated attributes. |
void |
bind(java.lang.String name,
java.lang.Object obj)
Binds a name to an object. |
abstract void |
bind(java.lang.String name,
java.lang.Object obj,
javax.naming.directory.Attributes attrs)
Binds a name to an object, along with associated attributes. |
void |
close()
Closes this context. |
javax.naming.Name |
composeName(javax.naming.Name name,
javax.naming.Name prefix)
Composes the name of this context with a name relative to this context. |
java.lang.String |
composeName(java.lang.String name,
java.lang.String prefix)
Composes the name of this context with a name relative to this context. |
javax.naming.Context |
createSubcontext(javax.naming.Name name)
Creates and binds a new context. |
javax.naming.directory.DirContext |
createSubcontext(javax.naming.Name name,
javax.naming.directory.Attributes attrs)
Creates and binds a new context, along with associated attributes. |
javax.naming.Context |
createSubcontext(java.lang.String name)
Creates and binds a new context. |
abstract javax.naming.directory.DirContext |
createSubcontext(java.lang.String name,
javax.naming.directory.Attributes attrs)
Creates and binds a new context, along with associated attributes. |
void |
destroySubcontext(javax.naming.Name name)
Destroys the named context and removes it from the namespace. |
abstract void |
destroySubcontext(java.lang.String name)
Destroys the named context and removes it from the namespace. |
javax.naming.directory.Attributes |
getAttributes(javax.naming.Name name)
Retrieves all of the attributes associated with a named object. |
javax.naming.directory.Attributes |
getAttributes(javax.naming.Name name,
java.lang.String[] attrIds)
Retrieves selected attributes associated with a named object. |
javax.naming.directory.Attributes |
getAttributes(java.lang.String name)
Retrieves all of the attributes associated with a named object. |
abstract javax.naming.directory.Attributes |
getAttributes(java.lang.String name,
java.lang.String[] attrIds)
Retrieves selected attributes associated with a named object. |
int |
getCacheObjectMaxSize()
Get cacheObjectMaxSize. |
int |
getCacheTTL()
Get cache TTL. |
int |
getDebug()
Return the debugging detail level for this component. |
java.lang.String |
getDocBase()
Return the document root for this component. |
java.util.Hashtable |
getEnvironment()
Retrieves the environment in effect for this context. |
abstract java.lang.String |
getNameInNamespace()
Retrieves the full name of this context within its own namespace. |
javax.naming.NameParser |
getNameParser(javax.naming.Name name)
Retrieves the parser associated with the named context. |
javax.naming.NameParser |
getNameParser(java.lang.String name)
Retrieves the parser associated with the named context. |
javax.naming.directory.DirContext |
getSchema(javax.naming.Name name)
Retrieves the schema associated with the named object. |
abstract javax.naming.directory.DirContext |
getSchema(java.lang.String name)
Retrieves the schema associated with the named object. |
javax.naming.directory.DirContext |
getSchemaClassDefinition(javax.naming.Name name)
Retrieves a context containing the schema objects of the named object's class definitions. |
abstract javax.naming.directory.DirContext |
getSchemaClassDefinition(java.lang.String name)
Retrieves a context containing the schema objects of the named object's class definitions. |
boolean |
isCached()
Is cached ? |
javax.naming.NamingEnumeration |
list(javax.naming.Name name)
Enumerates the names bound in the named context, along with the class names of objects bound to them. |
abstract javax.naming.NamingEnumeration |
list(java.lang.String name)
Enumerates the names bound in the named context, along with the class names of objects bound to them. |
javax.naming.NamingEnumeration |
listBindings(javax.naming.Name name)
Enumerates the names bound in the named context, along with the objects bound to them. |
abstract javax.naming.NamingEnumeration |
listBindings(java.lang.String name)
Enumerates the names bound in the named context, along with the objects bound to them. |
java.lang.Object |
lookup(javax.naming.Name name)
Retrieves the named object. |
abstract java.lang.Object |
lookup(java.lang.String name)
Retrieves the named object. |
java.lang.Object |
lookupLink(javax.naming.Name name)
Retrieves the named object, following links except for the terminal atomic component of the name. |
abstract java.lang.Object |
lookupLink(java.lang.String name)
Retrieves the named object, following links except for the terminal atomic component of the name. |
void |
modifyAttributes(javax.naming.Name name,
int mod_op,
javax.naming.directory.Attributes attrs)
Modifies the attributes associated with a named object. |
void |
modifyAttributes(javax.naming.Name name,
javax.naming.directory.ModificationItem[] mods)
Modifies the attributes associated with a named object using an an ordered list of modifications. |
abstract void |
modifyAttributes(java.lang.String name,
int mod_op,
javax.naming.directory.Attributes attrs)
Modifies the attributes associated with a named object. |
abstract void |
modifyAttributes(java.lang.String name,
javax.naming.directory.ModificationItem[] mods)
Modifies the attributes associated with a named object using an an ordered list of modifications. |
void |
rebind(javax.naming.Name name,
java.lang.Object obj)
Binds a name to an object, overwriting any existing binding. |
void |
rebind(javax.naming.Name name,
java.lang.Object obj,
javax.naming.directory.Attributes attrs)
Binds a name to an object, along with associated attributes, overwriting any existing binding. |
void |
rebind(java.lang.String name,
java.lang.Object obj)
Binds a name to an object, overwriting any existing binding. |
abstract void |
rebind(java.lang.String name,
java.lang.Object obj,
javax.naming.directory.Attributes attrs)
Binds a name to an object, along with associated attributes, overwriting any existing binding. |
void |
release()
Release any resources allocated for this directory context. |
java.lang.Object |
removeFromEnvironment(java.lang.String propName)
Removes an environment property from the environment of this context. |
void |
rename(javax.naming.Name oldName,
javax.naming.Name newName)
Binds a new name to the object bound to an old name, and unbinds the old name. |
abstract void |
rename(java.lang.String oldName,
java.lang.String newName)
Binds a new name to the object bound to an old name, and unbinds the old name. |
javax.naming.NamingEnumeration |
search(javax.naming.Name name,
javax.naming.directory.Attributes matchingAttributes)
Searches in a single context for objects that contain a specified set of attributes. |
javax.naming.NamingEnumeration |
search(javax.naming.Name name,
javax.naming.directory.Attributes matchingAttributes,
java.lang.String[] attributesToReturn)
Searches in a single context for objects that contain a specified set of attributes, and retrieves selected attributes. |
javax.naming.NamingEnumeration |
search(javax.naming.Name name,
java.lang.String filterExpr,
java.lang.Object[] filterArgs,
javax.naming.directory.SearchControls cons)
Searches in the named context or object for entries that satisfy the given search filter. |
javax.naming.NamingEnumeration |
search(javax.naming.Name name,
java.lang.String filter,
javax.naming.directory.SearchControls cons)
Searches in the named context or object for entries that satisfy the given search filter. |
abstract javax.naming.NamingEnumeration |
search(java.lang.String name,
javax.naming.directory.Attributes matchingAttributes)
Searches in a single context for objects that contain a specified set of attributes. |
abstract javax.naming.NamingEnumeration |
search(java.lang.String name,
javax.naming.directory.Attributes matchingAttributes,
java.lang.String[] attributesToReturn)
Searches in a single context for objects that contain a specified set of attributes, and retrieves selected attributes. |
abstract javax.naming.NamingEnumeration |
search(java.lang.String name,
java.lang.String filterExpr,
java.lang.Object[] filterArgs,
javax.naming.directory.SearchControls cons)
Searches in the named context or object for entries that satisfy the given search filter. |
abstract javax.naming.NamingEnumeration |
search(java.lang.String name,
java.lang.String filter,
javax.naming.directory.SearchControls cons)
Searches in the named context or object for entries that satisfy the given search filter. |
void |
setCached(boolean cached)
Set cached. |
void |
setCacheObjectMaxSize(int cacheObjectMaxSize)
Set cacheObjectMaxSize. |
void |
setCacheTTL(int cacheTTL)
Set cache TTL. |
void |
setDebug(int debug)
Set the debugging detail level for this component. |
void |
setDocBase(java.lang.String docBase)
Set the document root for this component. |
void |
unbind(javax.naming.Name name)
Unbinds the named object. |
abstract void |
unbind(java.lang.String name)
Unbinds the named object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int debug
protected java.lang.String docBase
protected java.util.Hashtable env
protected StringManager sm
protected final javax.naming.NameParser nameParser
protected boolean cached
protected int cacheTTL
protected int cacheObjectMaxSize
| Constructor Detail |
public BaseDirContext()
public BaseDirContext(java.util.Hashtable env)
| Method Detail |
public int getDebug()
public void setDebug(int debug)
debug
- The new debugging detail levelpublic java.lang.String getDocBase()
public void setDocBase(java.lang.String docBase)
docBase
- The new document root
java.lang.IllegalArgumentException
- if the specified value is not
supported by this implementation
java.lang.IllegalArgumentException
- if this would create a
malformed URLpublic void setCached(boolean cached)
public boolean isCached()
public void setCacheTTL(int cacheTTL)
public int getCacheTTL()
public void setCacheObjectMaxSize(int cacheObjectMaxSize)
public int getCacheObjectMaxSize()
public void release()
public java.lang.Object lookup(javax.naming.Name name) throws javax.naming.NamingException
lookup
in interface javax.naming.Context
name
- the name of the object to look up
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract java.lang.Object lookup(java.lang.String name) throws javax.naming.NamingException
lookup
in interface javax.naming.Context
name
- the name of the object to look up
javax.naming.NamingException
- if a naming exception is encounteredpublic void bind(javax.naming.Name name, java.lang.Object obj) throws javax.naming.NamingException
bind
in interface javax.naming.Context
name
- the name to bind; may not be emptyobj
- the object to bind; possibly null
NameAlreadyBoundException
- if name is already bound
InvalidAttributesException
- if object did not supply all
mandatory attributes
javax.naming.NamingException
- if a naming exception is encounteredpublic void bind(java.lang.String name, java.lang.Object obj) throws javax.naming.NamingException
bind
in interface javax.naming.Context
name
- the name to bind; may not be emptyobj
- the object to bind; possibly null
NameAlreadyBoundException
- if name is already bound
InvalidAttributesException
- if object did not supply all
mandatory attributes
javax.naming.NamingException
- if a naming exception is encounteredpublic void rebind(javax.naming.Name name, java.lang.Object obj) throws javax.naming.NamingException
If the object is a DirContext, any existing attributes associated with the name are replaced with those of the object. Otherwise, any existing attributes associated with the name remain unchanged.
rebind
in interface javax.naming.Context
name
- the name to bind; may not be emptyobj
- the object to bind; possibly null
InvalidAttributesException
- if object did not supply all
mandatory attributes
javax.naming.NamingException
- if a naming exception is encounteredpublic void rebind(java.lang.String name, java.lang.Object obj) throws javax.naming.NamingException
rebind
in interface javax.naming.Context
name
- the name to bind; may not be emptyobj
- the object to bind; possibly null
InvalidAttributesException
- if object did not supply all
mandatory attributes
javax.naming.NamingException
- if a naming exception is encounteredpublic void unbind(javax.naming.Name name) throws javax.naming.NamingException
This method is idempotent. It succeeds even if the terminal atomic name is not bound in the target context, but throws NameNotFoundException if any of the intermediate contexts do not exist.
unbind
in interface javax.naming.Context
name
- the name to bind; may not be empty
NameNotFoundException
- if an intermediate context does not
exist
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract void unbind(java.lang.String name) throws javax.naming.NamingException
unbind
in interface javax.naming.Context
name
- the name to bind; may not be empty
NameNotFoundException
- if an intermediate context does not
exist
javax.naming.NamingException
- if a naming exception is encounteredpublic void rename(javax.naming.Name oldName, javax.naming.Name newName) throws javax.naming.NamingException
rename
in interface javax.naming.Context
oldName
- the name of the existing binding; may not be emptynewName
- the name of the new binding; may not be empty
NameAlreadyBoundException
- if newName is already bound
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract void rename(java.lang.String oldName, java.lang.String newName) throws javax.naming.NamingException
rename
in interface javax.naming.Context
oldName
- the name of the existing binding; may not be emptynewName
- the name of the new binding; may not be empty
NameAlreadyBoundException
- if newName is already bound
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.NamingEnumeration list(javax.naming.Name name) throws javax.naming.NamingException
If a binding is added to or removed from this context, its effect on an enumeration previously returned is undefined.
list
in interface javax.naming.Context
name
- the name of the context to list
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract javax.naming.NamingEnumeration list(java.lang.String name) throws javax.naming.NamingException
list
in interface javax.naming.Context
name
- the name of the context to list
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.NamingEnumeration listBindings(javax.naming.Name name) throws javax.naming.NamingException
If a binding is added to or removed from this context, its effect on an enumeration previously returned is undefined.
listBindings
in interface javax.naming.Context
name
- the name of the context to list
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract javax.naming.NamingEnumeration listBindings(java.lang.String name) throws javax.naming.NamingException
listBindings
in interface javax.naming.Context
name
- the name of the context to list
javax.naming.NamingException
- if a naming exception is encounteredpublic void destroySubcontext(javax.naming.Name name) throws javax.naming.NamingException
This method is idempotent. It succeeds even if the terminal atomic name is not bound in the target context, but throws NameNotFoundException if any of the intermediate contexts do not exist. In a federated naming system, a context from one naming system may be bound to a name in another. One can subsequently look up and perform operations on the foreign context using a composite name. However, an attempt destroy the context using this composite name will fail with NotContextException, because the foreign context is not a "subcontext" of the context in which it is bound. Instead, use unbind() to remove the binding of the foreign context. Destroying the foreign context requires that the destroySubcontext() be performed on a context from the foreign context's "native" naming system.
destroySubcontext
in interface javax.naming.Context
name
- the name of the context to be destroyed; may not be empty
NameNotFoundException
- if an intermediate context does not
exist
NotContextException
- if the name is bound but does not name
a context, or does not name a context of the appropriate type
javax.naming.NamingException
public abstract void destroySubcontext(java.lang.String name) throws javax.naming.NamingException
destroySubcontext
in interface javax.naming.Context
name
- the name of the context to be destroyed; may not be empty
NameNotFoundException
- if an intermediate context does not
exist
NotContextException
- if the name is bound but does not name
a context, or does not name a context of the appropriate type
javax.naming.NamingException
public javax.naming.Context createSubcontext(javax.naming.Name name) throws javax.naming.NamingException
createSubcontext
in interface javax.naming.Context
name
- the name of the context to create; may not be empty
NameAlreadyBoundException
- if name is already bound
InvalidAttributesException
- if creation of the subcontext
requires specification of mandatory attributes
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.Context createSubcontext(java.lang.String name) throws javax.naming.NamingException
createSubcontext
in interface javax.naming.Context
name
- the name of the context to create; may not be empty
NameAlreadyBoundException
- if name is already bound
InvalidAttributesException
- if creation of the subcontext
requires specification of mandatory attributes
javax.naming.NamingException
- if a naming exception is encounteredpublic java.lang.Object lookupLink(javax.naming.Name name) throws javax.naming.NamingException
lookupLink
in interface javax.naming.Context
name
- the name of the object to look up
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract java.lang.Object lookupLink(java.lang.String name) throws javax.naming.NamingException
lookupLink
in interface javax.naming.Context
name
- the name of the object to look up
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.NameParser getNameParser(javax.naming.Name name) throws javax.naming.NamingException
getNameParser
in interface javax.naming.Context
name
- the name of the context from which to get the parser
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.NameParser getNameParser(java.lang.String name) throws javax.naming.NamingException
getNameParser
in interface javax.naming.Context
name
- the name of the context from which to get the parser
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.Name composeName(javax.naming.Name name, javax.naming.Name prefix) throws javax.naming.NamingException
Given a name (name) relative to this context, and the name (prefix) of this context relative to one of its ancestors, this method returns the composition of the two names using the syntax appropriate for the naming system(s) involved. That is, if name names an object relative to this context, the result is the name of the same object, but relative to the ancestor context. None of the names may be null.
composeName
in interface javax.naming.Context
name
- a name relative to this contextprefix
- the name of this context relative to one of its ancestors
javax.naming.NamingException
- if a naming exception is encounteredpublic java.lang.String composeName(java.lang.String name, java.lang.String prefix) throws javax.naming.NamingException
composeName
in interface javax.naming.Context
name
- a name relative to this contextprefix
- the name of this context relative to one of its ancestors
javax.naming.NamingException
- if a naming exception is encounteredpublic java.lang.Object addToEnvironment(java.lang.String propName, java.lang.Object propVal) throws javax.naming.NamingException
addToEnvironment
in interface javax.naming.Context
propName
- the name of the environment property to add; may not
be nullpropVal
- the value of the property to add; may not be null
javax.naming.NamingException
- if a naming exception is encounteredpublic java.lang.Object removeFromEnvironment(java.lang.String propName) throws javax.naming.NamingException
removeFromEnvironment
in interface javax.naming.Context
propName
- the name of the environment property to remove;
may not be null
javax.naming.NamingException
- if a naming exception is encounteredpublic java.util.Hashtable getEnvironment() throws javax.naming.NamingException
getEnvironment
in interface javax.naming.Context
javax.naming.NamingException
- if a naming exception is encounteredpublic void close() throws javax.naming.NamingException
close
in interface javax.naming.Context
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract java.lang.String getNameInNamespace() throws javax.naming.NamingException
Many naming services have a notion of a "full name" for objects in their respective namespaces. For example, an LDAP entry has a distinguished name, and a DNS record has a fully qualified name. This method allows the client application to retrieve this name. The string returned by this method is not a JNDI composite name and should not be passed directly to context methods. In naming systems for which the notion of full name does not make sense, OperationNotSupportedException is thrown.
getNameInNamespace
in interface javax.naming.Context
OperationNotSupportedException
- if the naming system does
not have the notion of a full name
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.directory.Attributes getAttributes(javax.naming.Name name) throws javax.naming.NamingException
getAttributes
in interface javax.naming.directory.DirContext
name
- the name of the object from which to retrieve attributes
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.directory.Attributes getAttributes(java.lang.String name) throws javax.naming.NamingException
getAttributes
in interface javax.naming.directory.DirContext
name
- the name of the object from which to retrieve attributes
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.directory.Attributes getAttributes(javax.naming.Name name, java.lang.String[] attrIds) throws javax.naming.NamingException
getAttributes
in interface javax.naming.directory.DirContext
name
- the name of the object from which to retrieve attributesattrIds
- the identifiers of the attributes to retrieve. null
indicates that all attributes should be retrieved; an empty array
indicates that none should be retrieved
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract javax.naming.directory.Attributes getAttributes(java.lang.String name, java.lang.String[] attrIds) throws javax.naming.NamingException
getAttributes
in interface javax.naming.directory.DirContext
name
- the name of the object from which to retrieve attributesattrIds
- the identifiers of the attributes to retrieve. null
indicates that all attributes should be retrieved; an empty array
indicates that none should be retrieved
javax.naming.NamingException
- if a naming exception is encounteredpublic void modifyAttributes(javax.naming.Name name, int mod_op, javax.naming.directory.Attributes attrs) throws javax.naming.NamingException
modifyAttributes
in interface javax.naming.directory.DirContext
name
- the name of the object whose attributes will be updatedmod_op
- the modification operation, one of: ADD_ATTRIBUTE,
REPLACE_ATTRIBUTE, REMOVE_ATTRIBUTEattrs
- the attributes to be used for the modification; may not
be null
AttributeModificationException
- if the modification cannot be
completed successfully
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract void modifyAttributes(java.lang.String name, int mod_op, javax.naming.directory.Attributes attrs) throws javax.naming.NamingException
modifyAttributes
in interface javax.naming.directory.DirContext
name
- the name of the object whose attributes will be updatedmod_op
- the modification operation, one of: ADD_ATTRIBUTE,
REPLACE_ATTRIBUTE, REMOVE_ATTRIBUTEattrs
- the attributes to be used for the modification; may not
be null
AttributeModificationException
- if the modification cannot be
completed successfully
javax.naming.NamingException
- if a naming exception is encounteredpublic void modifyAttributes(javax.naming.Name name, javax.naming.directory.ModificationItem[] mods) throws javax.naming.NamingException
modifyAttributes
in interface javax.naming.directory.DirContext
name
- the name of the object whose attributes will be updatedmods
- an ordered sequence of modifications to be performed; may
not be null
AttributeModificationException
- if the modification cannot be
completed successfully
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract void modifyAttributes(java.lang.String name, javax.naming.directory.ModificationItem[] mods) throws javax.naming.NamingException
modifyAttributes
in interface javax.naming.directory.DirContext
name
- the name of the object whose attributes will be updatedmods
- an ordered sequence of modifications to be performed; may
not be null
AttributeModificationException
- if the modification cannot be
completed successfully
javax.naming.NamingException
- if a naming exception is encounteredpublic void bind(javax.naming.Name name, java.lang.Object obj, javax.naming.directory.Attributes attrs) throws javax.naming.NamingException
bind
in interface javax.naming.directory.DirContext
name
- the name to bind; may not be emptyobj
- the object to bind; possibly nullattrs
- the attributes to associate with the binding
NameAlreadyBoundException
- if name is already bound
InvalidAttributesException
- if some "mandatory" attributes
of the binding are not supplied
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract void bind(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs) throws javax.naming.NamingException
bind
in interface javax.naming.directory.DirContext
name
- the name to bind; may not be emptyobj
- the object to bind; possibly nullattrs
- the attributes to associate with the binding
NameAlreadyBoundException
- if name is already bound
InvalidAttributesException
- if some "mandatory" attributes
of the binding are not supplied
javax.naming.NamingException
- if a naming exception is encounteredpublic void rebind(javax.naming.Name name, java.lang.Object obj, javax.naming.directory.Attributes attrs) throws javax.naming.NamingException
rebind
in interface javax.naming.directory.DirContext
name
- the name to bind; may not be emptyobj
- the object to bind; possibly nullattrs
- the attributes to associate with the binding
InvalidAttributesException
- if some "mandatory" attributes
of the binding are not supplied
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract void rebind(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs) throws javax.naming.NamingException
rebind
in interface javax.naming.directory.DirContext
name
- the name to bind; may not be emptyobj
- the object to bind; possibly nullattrs
- the attributes to associate with the binding
InvalidAttributesException
- if some "mandatory" attributes
of the binding are not supplied
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.directory.DirContext createSubcontext(javax.naming.Name name, javax.naming.directory.Attributes attrs) throws javax.naming.NamingException
createSubcontext
in interface javax.naming.directory.DirContext
name
- the name of the context to create; may not be emptyattrs
- the attributes to associate with the newly created context
NameAlreadyBoundException
- if the name is already bound
InvalidAttributesException
- if attrs does not contain all
the mandatory attributes required for creation
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract javax.naming.directory.DirContext createSubcontext(java.lang.String name, javax.naming.directory.Attributes attrs) throws javax.naming.NamingException
createSubcontext
in interface javax.naming.directory.DirContext
name
- the name of the context to create; may not be emptyattrs
- the attributes to associate with the newly created context
NameAlreadyBoundException
- if the name is already bound
InvalidAttributesException
- if attrs does not contain all
the mandatory attributes required for creation
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.directory.DirContext getSchema(javax.naming.Name name) throws javax.naming.NamingException
getSchema
in interface javax.naming.directory.DirContext
name
- the name of the object whose schema is to be retrieved
OperationNotSupportedException
- if schema not supported
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract javax.naming.directory.DirContext getSchema(java.lang.String name) throws javax.naming.NamingException
getSchema
in interface javax.naming.directory.DirContext
name
- the name of the object whose schema is to be retrieved
OperationNotSupportedException
- if schema not supported
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.directory.DirContext getSchemaClassDefinition(javax.naming.Name name) throws javax.naming.NamingException
getSchemaClassDefinition
in interface javax.naming.directory.DirContext
name
- the name of the object whose object class definition is to
be retrieved
OperationNotSupportedException
- if schema not supported
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract javax.naming.directory.DirContext getSchemaClassDefinition(java.lang.String name) throws javax.naming.NamingException
getSchemaClassDefinition
in interface javax.naming.directory.DirContext
name
- the name of the object whose object class definition is to
be retrieved
OperationNotSupportedException
- if schema not supported
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.NamingEnumeration search(javax.naming.Name name, javax.naming.directory.Attributes matchingAttributes, java.lang.String[] attributesToReturn) throws javax.naming.NamingException
search
in interface javax.naming.directory.DirContext
name
- the name of the context to searchmatchingAttributes
- the attributes to search for. If empty or
null, all objects in the target context are returned.attributesToReturn
- the attributes to return. null indicates
that all attributes are to be returned; an empty array indicates that
none are to be returned.
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract javax.naming.NamingEnumeration search(java.lang.String name, javax.naming.directory.Attributes matchingAttributes, java.lang.String[] attributesToReturn) throws javax.naming.NamingException
search
in interface javax.naming.directory.DirContext
name
- the name of the context to searchmatchingAttributes
- the attributes to search for. If empty or
null, all objects in the target context are returned.attributesToReturn
- the attributes to return. null indicates
that all attributes are to be returned; an empty array indicates that
none are to be returned.
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.NamingEnumeration search(javax.naming.Name name, javax.naming.directory.Attributes matchingAttributes) throws javax.naming.NamingException
search
in interface javax.naming.directory.DirContext
name
- the name of the context to searchmatchingAttributes
- the attributes to search for. If empty or
null, all objects in the target context are returned.
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract javax.naming.NamingEnumeration search(java.lang.String name, javax.naming.directory.Attributes matchingAttributes) throws javax.naming.NamingException
search
in interface javax.naming.directory.DirContext
name
- the name of the context to searchmatchingAttributes
- the attributes to search for. If empty or
null, all objects in the target context are returned.
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.NamingEnumeration search(javax.naming.Name name, java.lang.String filter, javax.naming.directory.SearchControls cons) throws javax.naming.NamingException
search
in interface javax.naming.directory.DirContext
name
- the name of the context or object to searchfilter
- the filter expression to use for the search; may not be
nullcons
- the search controls that control the search. If null,
the default search controls are used (equivalent to
(new SearchControls())).
InvalidSearchFilterException
- if the search filter specified
is not supported or understood by the underlying directory
InvalidSearchControlsException
- if the search controls
contain invalid settings
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract javax.naming.NamingEnumeration search(java.lang.String name, java.lang.String filter, javax.naming.directory.SearchControls cons) throws javax.naming.NamingException
search
in interface javax.naming.directory.DirContext
name
- the name of the context or object to searchfilter
- the filter expression to use for the search; may not be
nullcons
- the search controls that control the search. If null,
the default search controls are used (equivalent to
(new SearchControls())).
InvalidSearchFilterException
- if the search filter
specified is not supported or understood by the underlying directory
InvalidSearchControlsException
- if the search controls
contain invalid settings
javax.naming.NamingException
- if a naming exception is encounteredpublic javax.naming.NamingEnumeration search(javax.naming.Name name, java.lang.String filterExpr, java.lang.Object[] filterArgs, javax.naming.directory.SearchControls cons) throws javax.naming.NamingException
search
in interface javax.naming.directory.DirContext
name
- the name of the context or object to searchfilterExpr
- the filter expression to use for the search.
The expression may contain variables of the form "{i}" where i is a
nonnegative integer. May not be null.filterArgs
- the array of arguments to substitute for the
variables in filterExpr. The value of filterArgs[i] will replace each
occurrence of "{i}". If null, equivalent to an empty array.cons
- the search controls that control the search. If null, the
default search controls are used (equivalent to (new SearchControls())).
java.lang.ArrayIndexOutOfBoundsException
- if filterExpr contains {i}
expressions where i is outside the bounds of the array filterArgs
InvalidSearchControlsException
- if cons contains invalid
settings
InvalidSearchFilterException
- if filterExpr with filterArgs
represents an invalid search filter
javax.naming.NamingException
- if a naming exception is encounteredpublic abstract javax.naming.NamingEnumeration search(java.lang.String name, java.lang.String filterExpr, java.lang.Object[] filterArgs, javax.naming.directory.SearchControls cons) throws javax.naming.NamingException
search
in interface javax.naming.directory.DirContext
name
- the name of the context or object to searchfilterExpr
- the filter expression to use for the search.
The expression may contain variables of the form "{i}" where i is a
nonnegative integer. May not be null.filterArgs
- the array of arguments to substitute for the
variables in filterExpr. The value of filterArgs[i] will replace each
occurrence of "{i}". If null, equivalent to an empty array.cons
- the search controls that control the search. If null, the
default search controls are used (equivalent to (new SearchControls())).
java.lang.ArrayIndexOutOfBoundsException
- if filterExpr contains {i}
expressions where i is outside the bounds of the array filterArgs
InvalidSearchControlsException
- if cons contains invalid
settings
InvalidSearchFilterException
- if filterExpr with filterArgs
represents an invalid search filter
javax.naming.NamingException
- if a naming exception is encountered
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


BROKEDOWN PALACE
Reviewed by Harvey Karten Fox 2000 Pictures Director: Jonathan Kaplan Writer: David Arata, story by Adam Fields & David Arata Cast: Claire Danes, Kate Beckinsale, Bill Pullman, Daniel Lapaine, Jacqui Kim, Lou Diamond Phillips, Amanda De Cadenet, Paul Walker
When Mark Twain wrote about innocents abroad, he had no idea just how much trouble spoiled American kids could get into when traveling outside their own liberal democracy. But Joseph Ruben certainly did when he directed last year's "Return to Paradise," about two New York City men who are strongly advised to return to Malaysia to confess their part in a drug crime lest their friend get hanged. Like Ruben's film, Jonathan Kaplan's "Brokedown Palace" is about motifs like responsibility, conscience and redemption, but his three principals do not give him the strong performances turned out by Vince Vaughn, Anne Heche and Joaquin Phoenix in last year's dramatic movie about a similar subject. For all its vivid camera work in photogenic Bangkok, Thailand, "Brokedown Palace" is the sort of melodrama that would fit more into a quality TV movie niche than it does on the big screen. The film is absorbing at times--a movie about teens which, like "Election," is really directed toward a more mature audience--but on the whole rings false because the lawyer's redemption is not at all credible and the final affirmation of one of the young women is uncalled for and thereby bogus.
Despite these faults what you've got to hand to the production team is its guts in daring to imagine a pattern of corruption in one of America's friendly nations abroad, a design which, however exaggerated, has a ring of authenticity. The government of Thailand would obviously not welcome the filming of this movie in Bangkok. (It was shot in the Philippines.) After all, if you were a high-ranking minister in charge of film regulation in a tightly governed monarchy (actually more of a military dictatorship), would you welcome a shoot whose script reveals your beloved land as a Third-World stinkhole?
The innocents abroad, teens Alice (Claire Danes) and her bosom buddy Darlene (Kate Beckinsale), are presented by their folks with trips to Hawaii for their high-school graduation. Instead they head out secretly to Thailand because the fun that should await them there seems less "middle class." Indeed. After sneaking into a fancy hotel pool, they are caught charging their drinks to an actual guest's room and are bailed out by charming 20-something Australian businessman, Nick Parks (Daniel Lapaine), who wines and dines the two and generously gives them two tickets to Hong Kong for the weekend. He is allegedly to join them later. Unbeknownst to the girls, Nick is a drug smuggler responsible for stashing a stash of heroin into their luggage where it will presumably be picked up by an accomplice in Hong Kong. Seized at the airport by police, the girls are tried, quickly found guilty, and hire money-grubbing, ambulance-chasing ex-patriate lawyer Hank the Yank (Bill Pullman) to help them out.
Director Kaplan places heavy emphasis on the tense friendship between the two teens. Though they have known each other for years seemingly without conflict, Alice deeply resents Darlene's behavior in stealing away the dashing Australian with whom Darlene spends the night. When Darlene convinces Alice to fly with her to Hong Kong only to be arrested along with her, Alice, already on edge from the romantic interlude, suspects Darlene of yet another, far more serious betrayal. Yet when put into a primitive Thai jail to serve a sentence of 33 years, they stick together, surrounded by women prisoners and guards whose language they do not speak. When the crunch comes and Alice has a chance to free her friend, she must decide how far she will go--just how precious their lifelong friendship has been.
Danes has done better work in the edgy, postmodern "Romeo and Juliet" and a year after that in "The Rainmaker," while some believe that Beckinsale should have been Oscar- nominated for her role in last year's "The Last Days of Disco."  Bill Pullman comes off the best, as expected, as a sleazy lawyer who sees better opportunities defending rich kids in a faraway place than he could find in a far more prosperous country that for all its litigiousness has too darn many attorneys. Kaplan takes some fairly hackneyed tourist shots of the famed temple area in Bangkok, the seedy, commercial side streets, and best of all the rank prisons in which inmates have to shout in a group to their visitors across thirty feet of space. But the movie will have served its purpose if only to warn prospective tourists headed for foreign lands to check their luggage before heading to the airport and once again before passing through customs. After all, what chance have you got to be found not guilty when everyone from the hotel bellmen to the Minister of Justice is on the take--not to forget high U.S. officials in our embassies abroad--their financial assets dependent on how many unsuspecting tourists they can railroad to the brig?
Rated PG-13. Running Time: 96 minutes. (C) 1999 Harvey Karten
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


TEKO
Full Time Software Development Program Logo
The logo of Teko was decided through the logo competition from 8. June to 7. July.
Learn more about what we do
Take a look at what we offer at TEKO.
Your Microverse experience centers around accountability, support, and community as you learn in an environment that mimics a real-world remote workspace.
Please contact us for any futher questions about becoming a remote software developer!
Click here to reach us.The logo of Teko was decided through the logo competition from 8. June to 7. July.
Take a look at what we offer at TEKO.


Learn About Drop Down Discrimination
Drop Down Discrimination is a group of young ladies that attended a camp called BraveCamp. The group of us young ladies decided to make a website based on putting a end to discrimination.
The audience that we are trying to target is the youth becasue we feel like the youth needs a place to share their opinions and learn more about discrimnination and how to bring a solution to discrimination.
The "Go Share Your Opinion" is a chatroom for you to share your opinion with each other I think it good for you guys to share you opinions with each other because we need to learn how accept everyones opinion. Now everyone will not have the same opinion and that okay we need to learn to respect everyone opinion. (The chatroom will be in far right corner of the page)The Member of Drop Down Discrimination are : Gabriela Mendez,Kimora Reed,Carolyn Wegelin and Tydeja Morris


This is used to read a file, both for metadata and data.
Methods
Attributes
| [R] | file_name | File name being read |
Public Class methods
Create an object to read the given file.
[ show source ]
# File lib/mtk_file.rb, line 22 def initialize(f) @file_name = f end
Public Instance methods
Return the block range for the given file
[ show source ]
# File lib/mtk_file.rb, line 40 def block MtkFile.file_to_block(file_name) end
Return file type. This is an Integer equal to one of the constants defined in this class, e.g., MtkFile::AGP
[ show source ]
# File lib/mtk_file.rb, line 78 def file_type MtkFile.file_to_file_type(file_name) end
Return an MtkGrid to read the given grid.
[ show source ]
# File lib/mtk_file.rb, line 59 def grid(grid_name) MtkGrid.new(self, grid_name) end
Return an Array of Strings containing the grid names.
[ show source ]
# File lib/mtk_file.rb, line 49 def grid_list @grid_list if(@grid_list) @grid_list = MtkFile.file_to_grid_list(file_name) end
Return local granule ID
[ show source ]
# File lib/mtk_file.rb, line 68 def local_granule_id MtkFile.file_to_local_granule_id(file_name) end
Return path for the given file
[ show source ]
# File lib/mtk_file.rb, line 31 def path MtkFile.file_to_path(file_name) end
Return version, e.g., "F01_0001".
[ show source ]
# File lib/mtk_file.rb, line 87 def version MtkFile.file_to_version(file_name) end


There are 2 ways to get started with DWR, the easy way is to download the WAR file and have a look around, however this does not help you see how easily DWR integrates with your current web application, so the following 5 simple steps are recommended:
Download the dwr.jar file. Place it in the WEB-INF/lib
directory of your webapp. You'll probably have a set of jar files in there already.
DWR has one dependency on Commons Logging. Download the commons-logging.jar and place it in the WEB-INF/lib
directory of your webapp.
The following lines need to be added to WEB-INF/web.xml
. The <servlet>
section needs to go with the other <servlet>
sections, and likewise with the <servlet-mapping>
section.
<servlet> <servlet-name>dwr-invoker</servlet-name> <display-name>DWR Servlet</display-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>dwr-invoker</servlet-name> <url-pattern>/dwr/*</url-pattern> </servlet-mapping>
Create a new file in the WEB-INF (alongside web.xml) directory named dwr.xml.
A simple way to start is with something like this:
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 3.0//EN" "http://getahead.org/dwr/dwr30.dtd"> <dwr> <allow> <create creator="new" javascript="JDate"> <param name="class" value="java.util.Date"/> </create> <create creator="new" javascript="Demo"> <param name="class" value="your.java.Bean"/> </create> </allow> </dwr>
The DWR config file defines what classes DWR can create and remote for use by Javascript. In the example above we are defining 2 classes that are remoted and giving the classes names in Javascript.
The new creator that we used above uses the public no-args constructor that all JavaBeans must have. It is also worth remembering that DWR has one restriction:
Visit the dwr.xml documentation for a detailed description of the dwr.xml file, creators and converters.
Go to the following URL:
http://localhost:8080/[YOUR-WEBAPP]/dwr/
You should see a page showing you the classes that you've selected in step 4. Having followed a link you should see an index of all the methods ready for calling. These pages are dynamically generated examples of what you can do using DWR.
Kick the tyres and have a look around.
We have a whole section on writing Javascript with DWR, and there are a number of examples in the sidebar that demonstrate how to dynamically alter the text in web pages, update lists, manipulate forms and do live table editing. Each has a description of how it works.
Another way to get started is to look at the source from the pages that you just viewed:
<script src='/[YOUR-WEBAPP]/dwr/interface/[YOUR-SCRIPT].js'></script> <script src='/[YOUR-WEBAPP]/dwr/engine.js'></script>
You can omit the /[YOUR-WEBAPP]/
section and use relative paths in your web pages if you wish.
Next Step: Learn about writing Javascript that interacts with DWR.
We have a page containing troubleshooting advice and common problems and their fixes. This is the first place to look.
If you are still having problems please join the mailing list and ask there.


public class Matrix
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected double[][] |
matrix |
| Constructor and Description |
|---|
Matrix() |
Matrix(double[][] matrix)
Creates a new matrix.
|
Matrix(int rows,
int cols)
Creates a new zero matrix of the given dimensions,
|
| Modifier and Type | Method and Description |
|---|---|
Matrix |
addBias(Direction dir) |
java.lang.String |
dimToStr() |
Matrix |
elementwiseAdd(Matrix other)
Adds the corresponding elements of two matrices together.
|
Matrix |
elementwiseOperation(double other,
java.util.function.DoubleBinaryOperator operation)
Performs an elementwise operation.
|
Matrix |
elementwiseOperation(java.util.function.DoubleUnaryOperator operation)
Performs an unary elementwise operation.
|
Matrix |
elementwiseOperation(Matrix other,
java.util.function.DoubleBinaryOperator operation)
Performs an elementwise operation.
|
Matrix |
elementwiseScalarMultiply(double scalar)
Return a new matrix, the product of this matrix and the scalar num.
|
Matrix |
elementwiseSigmoid()
Applies the sigmoid to each individual cell of the old matrix.
|
Matrix |
elementwiseSigmoidDerivative()
Applies the derivative of the sigmoid to each individual cell of the old matrix.
|
Matrix |
elementwiseSubtract(Matrix other)
Subtracts the corresponding elements of two matrices together.
|
boolean |
equals(java.lang.Object other) |
void |
fill(double value) |
double[][] |
getArray()
Gets the underlying array of the matrix.
|
int[] |
getDimensions()
Gets the dimensions of the matrix.
|
double[] |
getOneDimensionalArray() |
double |
getValue(int row,
int col)
Gets the value of a particular cell in the matrix.
|
Matrix |
matrixMultiply(Matrix other)
Return a new matrix, the product of this and other.
|
void |
setValue(int row,
int col,
double value)
Sets the value of a particular cell in the matrix.
|
Matrix |
slice(int startRows,
int startCols)
Returns a new matrix, which is this[startRows:end, startCols:end].
|
Matrix |
slice(int startRows,
int endRows,
int startCols,
int endCols)
Returns a new matrix, which is this[startRows:endRows, startCols:endCols].
|
double |
sum()
Finds the sum of all of the numbers in the matrix.
|
java.lang.String |
toString() |
Matrix |
transpose()
Return a new matrix, the transpose of this matrix.
|
Matrix |
unsafeMultiply(Matrix other) |
public Matrix()
public Matrix(double[][] matrix)
matrix
- the numbers inside the matrixpublic Matrix(int rows, int cols)
rows
- the number of rowscols
- the number of columnspublic void setValue(int row, int col, double value)
row
- the row of the cellcol
- the column of the cellvalue
- the new value of the cellpublic double getValue(int row, int col)
row
- the row of the cellcol
- the column of the cellpublic void fill(double value)
public double[][] getArray()
public int[] getDimensions()
public Matrix matrixMultiply(Matrix other) throws DimensionMismatchException
other
- another matrix whose height is the same as this matrix's widthDimensionMismatchException
- thrown when the matrices have incompatible dimensionspublic Matrix unsafeMultiply(Matrix other) throws DimensionMismatchException
DimensionMismatchException
public Matrix elementwiseScalarMultiply(double scalar)
scalar
- a scalarpublic Matrix elementwiseSigmoid()
public Matrix elementwiseSigmoidDerivative()
public Matrix elementwiseAdd(Matrix other) throws DimensionMismatchException
other
- the other matrixDimensionMismatchException
- thrown when the two matrices are not the same sizepublic Matrix elementwiseSubtract(Matrix other) throws DimensionMismatchException
other
- the other matrixDimensionMismatchException
- thrown when the two matrices are not the same sizepublic Matrix transpose()
public Matrix elementwiseOperation(double other, java.util.function.DoubleBinaryOperator operation)
other
- the other argument of the elementwise operation.operation
- the operationpublic Matrix elementwiseOperation(Matrix other, java.util.function.DoubleBinaryOperator operation) throws DimensionMismatchException
other
- the other argument of the elementwise operation.operation
- the operationDimensionMismatchException
- thrown when the matrices are not the same sizepublic Matrix elementwiseOperation(java.util.function.DoubleUnaryOperator operation)
operation
- the operationpublic double sum()
public Matrix slice(int startRows, int endRows, int startCols, int endCols)
startRows
- the first rowendRows
- the end row, which supports Python-style negativesstartCols
- the first columnendCols
- the last column, which supports Python-style negativespublic Matrix slice(int startRows, int startCols)
startRows
- the first rowstartCols
- the first columnpublic java.lang.String dimToStr()
public java.lang.String toString()
toString
in class java.lang.Object
public double[] getOneDimensionalArray() throws DimensionMismatchException
DimensionMismatchException
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object


| Expedition | Assignment | Status | Date | Location |
|---|---|---|---|---|
{{expedition.name}}{{expedition.team.name}} |
{{vm.displayAssignedProtocols(expedition)}} | Protocols Incomplete Protocols Submitted Protocols Need Review Expedition Published Expedition Unpublished |
{{vm.getExpeditionDate(expedition.monitoringStartDate)}} {{vm.getExpeditionTimeRange(expedition.monitoringStartDate, expedition.monitoringEndDate)}} |
{{expedition.station.name}} |


For my Data Science final project, I am building an app which analyzes the words you use in your text messages and tells you things about yourself. The app will answer questions like:
The more data I have to work with the better the data analysis will be. Anyone who uses an iPhone and backs there iPhone up on a Mac can participate (and I will send you your results!). To participate in the project all you have to do is:
Your text messages are never saved or uploaded — howdoispeak.app locally calculates your SMS word frequencies before uploading any data.


This page is marked-up with basic HTML document structure.
The comments are not visible in the webpage. Check the source code to see the use of comments.
<!DOCTYPE html>

<meta charset="utf-8">
<meta name="author" content="Harold Mamitag">
<meta name="description" content="">
<title>Comments</title>

Comments

Home


data¶
data_layer¶
Data Layer Classes
-
class
data.data_layer.
DataLayer
(params, num_workers=None, worker_id=None)[source]¶ Bases:
object
Abstract class that specifies data access operations
-
__init__
(params, num_workers=None, worker_id=None)[source]¶ Initialize data layer :param params: Python dictionary with options, specifying mini-batch shapes, padding, etc.
-
gen_input_tensors
()[source]¶ Creates and returns input tensors that should be connected to the model computational graph.
Returns: list of input tensors: that could be placeholders or if using tf.data API, whatever is returned with Iterator.get_next()
-
get_input_tensors
()[source]¶ Returns input tensors that should be connected to the model computational graph.
Returns: list of input tensors: that could be placeholders or if using tf.data API, whatever is returned with Iterator.get_next()
-
get_size_in_samples
()[source]¶ Returns: dataset size in samples, i.e. number of training objects in dataset
-
iterate_forever
()[source]¶ Goes through data set indefinitely :return: yields feed_dict that should populate the data into
tensors returned by get_input_tensors function. For tf.data API feed_dict will usually be empty
-
iterate_one_epoch
(cross_over=False)[source]¶ Goes through the data one time. :param cross_over: whether last batch should take few elements from the next
epoch if the size of dataset is not divisible by the batch sizeReturns: yields feed_dict that should populate the data into tensors returned by get_input_tensors function
-
params
¶
-
-
class
data.data_layer.
MultiGPUWrapper
(data_layer, num_gpus)[source]¶ Bases:
data.data_layer.DataLayer
-
gen_input_tensors
()[source]¶ Creates and returns input tensors that should be connected to the model computational graph.
Returns: list of input tensors: that could be placeholders or if using tf.data API, whatever is returned with Iterator.get_next()
-
speech2text¶
-
class
data.speech2text.
Speech2TextDataLayer
(params)[source]¶ Bases:
data.data_layer.DataLayer
-
__init__
(params)[source]¶ - Required params:
- batch_size_per_gpu alphabet_config_path dataset_path num_audio_features input_type
Example
- params = {
- ‘batch_size’: 16, ‘alphabet_config_path’: ‘data/alphabet.txt’, ‘dataset_path’: [‘/raid/data/speech/WSJ/wsj-train-128.csv’], ‘num_audio_features’: 161, ‘input_type’: ‘spectrogram’,
}
-
gen_input_tensors
()[source]¶ Creates and returns input tensors that should be connected to the model computational graph.
Returns: list of input tensors: that could be placeholders or if using tf.data API, whatever is returned with Iterator.get_next()
-
-
class
data.speech2text.
Speech2TextRandomDataLayer
(params)[source]¶ Bases:
data.data_layer.DataLayer
This class should be used for performance profiling only.
-
gen_input_tensors
()[source]¶ Creates and returns input tensors that should be connected to the model computational graph.
Returns: list of input tensors: that could be placeholders or if using tf.data API, whatever is returned with Iterator.get_next()
-
-
class
data.speech2text.
Speech2TextTFDataLayer
(params)[source]¶ Bases:
data.data_layer.DataLayer
-
__init__
(params)[source]¶ - Required params:
- batch_size alphabet_config_path dataset_path num_audio_features input_type
Example
- params = {
- ‘batch_size’: 16, ‘alphabet_config_path’: ‘data/alphabet.txt’, ‘dataset_path’: [‘/raid/data/speech/WSJ/wsj-train-128.csv’], ‘num_audio_features’: 161, ‘input_type’: ‘spectrogram’,
}
-
_parse_audio_element
(audio_filename)[source]¶ Parses tf.data element from TextLineDataset, returns source audio NumPy array
-
_parse_audio_transcript_element
(element)[source]¶ Parses tf.data element from TextLineDataset, returns source audio and target text NumPy arrays
-
gen_input_tensors
()[source]¶ Creates and returns input tensors that should be connected to the model computational graph.
Returns: list of input tensors: that could be placeholders or if using tf.data API, whatever is returned with Iterator.get_next()
-
speech_utils¶
-
data.speech_utils.
augment_audio_signal
(signal, fs, augmentation)[source]¶ Parameters: - signal – np.array containing raw audio signal
- fs – float, frames per second
- augmentation –
None or dictionary of augmentation parameters; If not None, has to have ‘time_stretch_ratio’, ‘noise_level_min’, ‘noise_level_max’ fields, e.g.: augmentation={‘time_stretch_ratio’: 0.2,
’noise_level_min’: -90, ‘noise_level_max’: -46}
Returns: np.array with augmented signal
-
data.speech_utils.
get_speech_features
(signal, fs, num_features, features_type='spectrogram', window_size=0.02, window_stride=0.01, augmentation=None)[source]¶ Parameters: - signal – np.array containing raw audio signal
- fs – float, frames per second
- num_features – number of speech features in frequency domain
- features_type – ‘mfcc’ or ‘spectrogram’
- window_size – size of analysis window, ms
- window_stride – stride of analysis window, ms
- augmentation –
None or dictionary of augmentation parameters; If not None, has to have ‘time_stretch_ratio’, ‘noise_level_min’, ‘noise_level_max’ fields, e.g.: augmentation={‘time_stretch_ratio’: 0.2,
’noise_level_min’: -90, ‘noise_level_max’: -46}
Returns: (num_time_steps, num_features) NumPy array
-
data.speech_utils.
get_speech_features_from_file
(filename, num_features, features_type='spectrogram', window_size=0.02, window_stride=0.01, augmentation=None)[source]¶ Parameters: - filename – WAVE filename
- num_features – number of speech features in frequency domain
- features_type – ‘mfcc’ or ‘spectrogram’
- window_size – size of analysis window, ms
- window_stride – stride of analysis window, ms
- augmentation –
None or dictionary of augmentation parameters; If not None, has to have ‘time_stretch_ratio’, ‘noise_level_min’, ‘noise_level_max’ fields, e.g.: augmentation={‘time_stretch_ratio’: 0.2,
’noise_level_min’: -90, ‘noise_level_max’: -46}
Returns: (num_time_steps, num_features) NumPy array
text2text¶
-
class
data.text2text.
ParallelDataInRamInputLayer
(params, num_workers=None, worker_id=None)[source]¶ Bases:
data.data_layer.DataLayer
Parallel data layer class. It should be provided with: a) source vocabulary file b) target vocabulary file c) tokenized source file d) tokenized target file This class performs:
- loading of data, mapping tokens to their ids.
- Inserting special tokens, if needed
- Padding
- Bucketing
- Mini-batch construction
All parameters for above actions should come through “params” dictionary passed to constructor. This class loads all data and serves it from RAM
-
END_OF_CHOICE
= -100¶
-
EOS_ID
= 2¶
-
OUT_OF_BUCKET
=<PHONE_NUMBER>¶
-
PAD_ID
= 3¶
-
S_ID
= 1¶
-
UNK_ID
= 0¶
-
bucket_sizes
= [60, 120, 180, 240, 300, 360]¶
-
determine_bucket
(input_size, bucket_sizes)[source]¶ Given input size and bucket sizes, determines closes bucket :param input_size: size of the input sequence :param bucket_sizes: list of bucket sizes :return: best bucket id
-
gen_input_tensors
()[source]¶ Creates and returns input tensors that should be connected to the model computational graph.
Returns: list of input tensors: that could be placeholders or if using tf.data API, whatever is returned with Iterator.get_next()
-
get_size_in_samples
()[source]¶ Returns: dataset size in samples, i.e. number of training objects in dataset
-
load_file_word
(path, vocab)[source]¶ Load file word-by-word :param path: path to data :param vocab: vocabulary :return: list of sentences with S_ID and EOS_ID added
-
class
data.text2text.
ParallelTextDataLayer
(params, num_workers=None, worker_id=None)[source]¶ Bases:
data.data_layer.DataLayer
-
gen_input_tensors
()[source]¶ Creates and returns input tensors that should be connected to the model computational graph.
Returns: list of input tensors: that could be placeholders or if using tf.data API, whatever is returned with Iterator.get_next()
-
-
class
data.text2text.
SpecialTextTokens
[source]¶ Bases:
enum.Enum
An enumeration.
-
END_OF_CHOICE
= -100¶
-
EOS_ID
= 2¶
-
OUT_OF_BUCKET
=<PHONE_NUMBER>¶
-
PAD_ID
= 3¶
-
S_ID
= 1¶
-
UNK_ID
= 0¶
-


Authenticating API requests¶
With the exception of the ‘sandbox’ application that is created with every Nobackend organization, all applications are secured by default. This means that to access your data store, a valid access token must be sent with all API requests to authenticate that the requester is authorized to make API calls to the resources they are attempting the access.
This article describes how to use access tokens to access the Nobackend API, and how to manage access tokens, including revoking and changing token time to live.
For information on generating access tokens/authenticating users and clients, see [Authenticating users and application clients](../security-and-auth/authenticating-users-and-application-clients.html).
Authenticating with access tokens¶
When you obtain an access token, you must provide it with every subsequent API call that you make. There are two ways to provide your access token.
You can add the token to the API query string:
https://<nobackend-host>/{org-name}/{app-name}/users?access_token={access_token}
You can include the token in an HTTP authorization header:
Authorization: Bearer {access_token}
Note
The Nobackend documentation assumes you are providing a valid access token with every API call whether or not it is shown explicitly in the examples. Unless the documentation specifically says that you can access an API endpoint without an access token, you should assume that you must provide it. One application that does not require an access token is the sandbox application. The Guest role has been given full permissions (/** for GET, POST, PUT, and DELETE) for this application. This eliminates the need for a token when making application level calls to the sandbox app. For further information on specifying permissions, see [Using Permissions](security-and-auth/using-permissions.html).
Authenticating with client ID and client secret¶
Another option for authenticating your API requests is using either your organization client ID and client secret, or your application client ID and client secret, which will authenticate your request as an organization or application admin, respectively. Organization credentials can be found in the ‘Org Overview’ section of the admin portal, and application credentials can be found in the ‘Getting Started’ section of the admin portal.
Warning
For server-side use only. You should never authenticate this way from a client-side app such as a mobile app. A hacker could analyze your app and extract the credentials for malicious use even if those credentials are compiled and in binary format. See [Security Best Practices](../security-and-auth/securing-your-app.html) for additional considerations in keeping access to your app and its data secure.
This can be a convenient way to authenticate API requests, since there is no need to generate and manage an access token, but please note that you should be very cautious when implementing this type of authentication. Organization-level authentication grants full permission to perform any supported call against your organization and every application in it, and application-level authentication grants full permission to perform any supported call against all of the resources in an application. Should your client id and client secret be compromised, a malicious user would gain broad access to your organization or application.
To authenticate using client id and secret, append the following parameters to your request URL:
client_id=<your-client-id>&client_secret=<your-client-secret>


Dragon of Loowater
Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.
The shores of Rellau Creek in central Loowater had always been a prime breeding ground for geese. Due to the lack of predators, the geese population was out of control. The people of Loowater mostly kept clear of the geese. Occasionally, a goose would attack one of the people, and perhaps bite off a finger or two, but in general, the people tolerated the geese as a minor nuisance.
One day, a freak mutation occurred, and one of the geese spawned a multi-headed fire-breathing dragon. When the dragon grew up, he threatened to burn the Kingdom of Loowater to a crisp. Loowater had a major problem. The king was alarmed, and called on his knights to slay the dragon and save the kingdom.
The knights explained: “To slay the dragon, we must chop off all its heads. Each knight can chop off one of the dragon’s heads. The heads of the dragon are of different sizes. In order to chop off a head, a knight must be at least as tall as the diameter of the head. The knights’ union demands that for chopping off a head, a knight must be paid a wage equal to one gold coin for each centimetre of the knight’s height.”
Would there be enough knights to defeat the dragon? The king called on his advisors to help him decide how many and which knights to hire. After having lost a lot of money building Mir Park, the king wanted to minimize the expense of slaying the dragon. As one of the advisors, your job was to help the king. You took it very seriously: if you failed, you and the whole kingdom would be burnt to a crisp!
Input Specification:
The input contains several test cases. The first line of each test case contains two integers between 1 and 20000 inclusive, indicating the number n of heads that the dragon has, and the number m of knights in the kingdom. The next n lines each contain an integer, and give the diameters of the dragon’s heads, in centimetres. The following m lines each contain an integer, and specify the heights of the knights of Loowater, also in centimetres.
The last test case is followed by a line containing:
0 0
Output Specification:
For each test case, output a line containing the minimum number of gold coins that the king needs to pay to slay the dragon. If it is not possible for the knights of Loowater to slay the dragon, output the line:
Loowater is doomed!
Sample Input:
2 3 5 4 7 8 4 2 1 5 5 10 0 0
Output for Sample Input:
11 Loowater is doomed!
白皮书的第一道题，用来练练手。
题目大意：王国里有n个恶龙。每个骑士能力值为x可以干掉头的直径不超过x的恶龙，需要支付x金币，每个骑士只能使用一次。求最小的花费。
输入：
第一行为m,n. 接下来n行为每个龙头的直径，接下来m行为骑士的能力值。
//============================================================================ // Name : uva-11292.cpp // Author : coder // Version : // Copyright : www.acmerblog.com // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include <algorithm> using namespace std; int main() { int n,m; int dragons[20010], knights[20010]; while(cin >> n >> m, n && m){ for(int i=0; i<n; i++) cin >> dragons[i]; for(int i=0; i<m; i++) cin >> knights[i]; sort(dragons,dragons+n); sort(knights, knights+m); int ans = 0, i,k=0; for(i=0; i<n && k<m; i++){ //找到最小可以用的骑士 while(k<m && knights[k++] < dragons[i]); if(k <= m) ans += knights[k-1]; } //是否杀死所有的恶龙 if(i == n) cout << ans << endl; else cout << "Loowater is doomed!" << endl; } return 0; }
这种国家的败类，发出这种文章来套路别人，正是因为人的深沉意识里有些恐惧，发这种文章来愚弄人，让人不信神鬼但又有丝畏惧之心，要是世上有鬼神，这种人第一个死，诅咒诅咒诅咒此人，诅咒此等人见天光，挥热血！
这种国家的败类，发出这种文章来套路别人，正是因为人的深沉意识里有些恐惧，发这种文章来愚弄人，让人不信神鬼但又有丝畏惧之心，要是世上有鬼神，这种人第一个死，诅咒诅咒诅咒此人，诅咒此等人见天光，挥热血！
程序员会算法，等于一个古惑仔带了zhi抢啊
6题应该就是算概率的吧
不错，赞一个！
能不能说下这个是用的什么算法策略？
沙发呢，我抢到了沙发
上面的评论很起劲，为什么我看不懂啊
嗯，是写错了，文中以更改。MAX ( L(X[0..m-2], Y[0..n-1]), L(X[0..m-1], Y[0..n-2])
正确
加了星号 (*) 表示跳过此数据不读入. 因为scanf是不读取本行回车的
能告诉我为什么对于每一个m，cnt的值不用更新吗?这儿我想不通啊，谢谢
你的理解应该是：即使主持人拿走一个箱子对结果没有影响。这样想，主持人拿走的箱子只是没有影响到你初始选择的那个箱子中有奖品的概率，但是改变了其余两个箱子的概率分布。由 1/3,1/3 变成了 0, 2/3
可以参考算法导论中的时间戳。就是结束访问时间，最后结束的顶点肯定是入度为0的顶点，因为DFS要回溯
输出规范写错了哦~
第二个方法挺不错。NewHead代表新的头节点，通过递归找到最后一个节点之后，就把这个节点赋给NewHead，然后一直返回返回，中途这个值是没有变化的，一边返回一边把相应的指针方向颠倒，最后结束时返回新的头节点到主函数。


Logotype
Home
Features
Contact
Gulp Frontend Generator
Created new template for your site
GitHub link
Developed by
chrono
.


Welcome to m2g’s documentation!¶
Contents:
-
packages.utils.
setup
()¶ # Copyright 2014 Open Connectome Project (http://openconnecto.me) # # Licensed under the Apache License, Version 2.0 (the “License”); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an “AS IS” BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #
# setup.py # Created by Disa Mhembere on 2015-04-15. # Email: disa@jhu.edu


RxCpp does not implement the Catch operator.
RxGroovy implements the Catch operator in the same way as does RxJava. There are three distinct operators that provide this functionality:
onErrorReturn
onErrorResumeNext
onExceptionResumeNext
onErrorReturn
onErrorResumeNext
onExceptionResumeNext
RxJava implements the Catch operator with three distinct operators:
onErrorReturn
onErrorResumeNext
onExceptionResumeNext
onErrorReturn
onErrorResumeNext
onExceptionResumeNext
RxJS implements the Catch operator with two distinct operators:
catch
onErrorResumeNext
catch
onErrorResumeNext
RxKotlin implements the Catch operator in the same way as does RxJava. There are three distinct operators that provide this functionality:
onErrorReturn
onErrorResumeNext
onExceptionResumeNext
onErrorReturn
onErrorResumeNext
onExceptionResumeNext
Rx.NET implements the Catch operator with two distinct operators:
Catch
OnErrorResumeNext
Catch
OnErrorResumeNext
RxPY implements the Catch operator with two distinct operators:
catch_exception
on_error_resume_next
catch_exception
on_error_resume_next
Rx.rb implements the Catch operator with two distinct operators:
rescue_error
on_error_resume_next
rescue_error
on_error_resume_next
Rx.rb implements the Catch operator with four distinct operators:
onErrorFlatMap
onError
notifications from a misbehaving Observable into the emissions from a secondary ObservableonErrorResumeNext
onErrorReturn
onExceptionResumeNext
onErrorFlatMap
onErrorResumeNext
onErrorReturn
onExceptionResumeNext


If at the bottom of the url you add these parameters you can change the limit and offset values, by default they are set to 30 and 0
?limit=100&offset=2
Returns the pit stops made in the second race of 2019
Returns to the pit stops made in the second race of 2019 only the first ones
Returns the first pitstop made in the second race of 2019 by the selected driver
Returns the pit stops made the second race of 2019 by the selected driver
Returns the pit stops made on the first lap in the second race of 2019
The pitstop performed on the first lap of the second race in 2019 by the selected driver returns


To help answer this ‘acuity’ test, watch this video for hints. (If you get it in order, you get extra points.)


The demo should load below:
JavaScript is required for this demo.
JTablet website
Contact me at marcello@cellosoft.com.