code
stringlengths
10
174k
nl
stringlengths
3
129k
public boolean isGlobalInt32BaseAtomicsSupported(){ return hasExtension("cl_khr_global_int32_base_atomics"); }
Whether this device supports the <a href="http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/cl_khr_global_int32_base_atomics.html">cl_khr_global_int32_base_atomics extension</a>.
public ReliefF(final ClassificationDataSet cds,int featureCount,final int m,final int n,final DistanceMetric dm,VectorCollectionFactory<Vec> vcf,ExecutorService threadPool){ this(featureCount,m,n,dm,vcf); fit(cds,threadPool); }
Creates a new ReliefF object to measure the importance of the variables with respect to a classification task. Only numeric features will be removed. Categorical features will be ignored and left in tact by the transformation
public Boolean isHttpSystemBackup(){ return httpSystemBackup; }
Ruft den Wert der httpSystemBackup-Eigenschaft ab.
public static Test suite(){ return (new TestSuite(SetPropertyITCase.class)); }
Return the tests included in this test suite.
public void randomizeFanOut(){ for ( Synapse synapse : getFanOut().values()) { synapse.randomize(); } }
Randomize all synapses that attach to this neuron.
public void markUsed(long pos,int length){ freeSpace.markUsed(pos,length); }
Mark the space as in use.
public void randomInit(){ do { m_bits=new boolean[m_nNodes * m_nNodes]; for (int i=0; i < m_nNodes; i++) { int iPos; do { iPos=m_random.nextInt(m_nNodes * m_nNodes); } while (isSquare(iPos)); m_bits[iPos]=true; } } while (hasCycles()); calcGlobalScore(); }
initialize with a random structure by randomly placing m_nNodes arcs.
public static CfciRunner serializableInstance(){ return new CfciRunner(Dag.serializableInstance(),new Parameters()); }
Generates a simple exemplar of this class to test serialization.
public static void swapCol(Matrix A,int j,int k){ swapCol(A,j,k,0,A.rows()); }
Swaps the columns <tt>j</tt> and <tt>k</tt> in the given matrix.
public void onDestroy(){ closeDialog(); }
Called by AccelBroker when listener is to be shut down. Stop listener.
@Deprecated public void addPostalLocation(Context context,long postalId,double latitude,double longitude){ final ContentResolver resolver=context.getContentResolver(); ContentValues values=new ContentValues(2); values.put(POSTAL_LOCATION_LATITUDE,latitude); values.put(POSTAL_LOCATION_LONGITUDE,longitude); Uri loc=resolver.insert(CONTENT_URI,values); long locId=ContentUris.parseId(loc); values.clear(); values.put(AUX_DATA,locId); resolver.update(ContentUris.withAppendedId(CONTENT_URI,postalId),values,null,null); }
Add a longitude and latitude location to a postal address.
public ActiveInfoStorageCalculatorKraskov(String calculatorName) throws InstantiationException, IllegalAccessException, ClassNotFoundException { super(calculatorName); if (!calculatorName.equalsIgnoreCase(MI_CALCULATOR_KRASKOV1) && !calculatorName.equalsIgnoreCase(MI_CALCULATOR_KRASKOV2)) { throw new ClassNotFoundException("Must be an underlying Kraskov-Grassberger calculator"); } }
Creates a new instance of the Kraskov-Stoegbauer-Grassberger estimator for AIS, with the supplied MI calculator name.
public static List<Publisher> listPublishers(){ List<Publisher> result=new LinkedList<Publisher>(); List<String> ids=new LinkedList<String>(); PreparedStatement statement=DatabaseRequest.ALL_PUBLISHERS.getStatement(); try { ResultSet set=statement.executeQuery(); while (set.next()) { String id=set.getString("id"); if (!ids.contains(id)) { ids.add(id); result.add(new Publisher(id,set.getString("name"),set.getString("sort"))); } } } catch ( SQLException e) { logger.error("listPublishers: " + e); sqlException+=(2 ^ 7); } return result; }
Get the list of possible publishers. If it does not already exist thenc reate it.
@Override public void eUnset(int featureID){ switch (featureID) { case N4JSPackage.MODIFIABLE_ELEMENT__DECLARED_MODIFIERS: getDeclaredModifiers().clear(); return; } super.eUnset(featureID); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public static void checkStore(GridCacheContext<?,?> ctx) throws IgniteCheckedException { if (!ctx.store().configured()) throw new IgniteCheckedException("Failed to find cache store for method 'reload(..)' " + "(is GridCacheStore configured?)"); }
Checks that cache store is present.
public RectCompat(){ left=top=right=bottom=0; }
Create a new empty Rect. All coordinates are initialized to 0.
public char toChar(int index){ if (index < 0 || index >= R) { throw new IndexOutOfBoundsException("Alphabet index out of bounds"); } return alphabet[index]; }
Returns the character corresponding to the argument index.
public void addObservations(int[] source,int[] dest,boolean[] valid){ int rows=dest.length; if (dest.length - startObservationTime <= 0) { return; } int[] pastVal=new int[destEmbeddingDelay]; for (int d=0; d < destEmbeddingDelay; d++) { pastVal[d]=0; for (int p=0; p < k - 1; p++) { pastVal[d]+=dest[startObservationTime + d - 1 - (k - 1) * destEmbeddingDelay + p * destEmbeddingDelay]; pastVal[d]*=base; } } int minDestLengthRequired=(k > 0) ? (k - 1) * destEmbeddingDelay + 1 : 0; int timeSinceLastDestInvalid=minDestLengthRequired; for (int t=startObservationTime - 1; t >= 0; t--) { if (!valid[t]) { timeSinceLastDestInvalid=startObservationTime - t - 1; break; } } int[] sourcePastVal=new int[sourceEmbeddingDelay]; for (int d=0; d < sourceEmbeddingDelay; d++) { sourcePastVal[d]=0; for (int p=0; p < sourceHistoryEmbedLength - 1; p++) { sourcePastVal[d]+=source[startObservationTime + d - delay - (sourceHistoryEmbedLength - 1) * sourceEmbeddingDelay + p * sourceEmbeddingDelay]; sourcePastVal[d]*=base; } } int minSourceLengthRequired=(sourceHistoryEmbedLength - 1) * sourceEmbeddingDelay + 1; int timeSinceLastSourceInvalid=minSourceLengthRequired; for (int t=startObservationTime - delay; t >= 0; t--) { if (!valid[t]) { timeSinceLastSourceInvalid=startObservationTime - t - 1; break; } } int destVal, destEmbeddingPhase=0, sourceEmbeddingPhase=0; for (int r=startObservationTime; r < rows; r++) { timeSinceLastDestInvalid++; timeSinceLastSourceInvalid++; if (k > 0) { pastVal[destEmbeddingPhase]+=dest[r - 1]; } sourcePastVal[sourceEmbeddingPhase]+=source[r - delay]; if (!valid[r]) { timeSinceLastDestInvalid=0; } if (!valid[r - delay]) { timeSinceLastSourceInvalid=0; } if ((timeSinceLastDestInvalid > minDestLengthRequired) && (timeSinceLastSourceInvalid >= minSourceLengthRequired)) { destVal=dest[r]; int thisPastVal=pastVal[destEmbeddingPhase]; int thisSourceVal=sourcePastVal[sourceEmbeddingPhase]; sourceNextPastCount[thisSourceVal][destVal][thisPastVal]++; sourcePastCount[thisSourceVal][thisPastVal]++; nextPastCount[destVal][thisPastVal]++; pastCount[thisPastVal]++; nextCount[destVal]++; observations++; } if (k > 0) { pastVal[destEmbeddingPhase]-=maxShiftedValue[dest[r - 1 - (k - 1) * destEmbeddingDelay]]; pastVal[destEmbeddingPhase]*=base; } sourcePastVal[sourceEmbeddingPhase]-=maxShiftedSourceValue[source[r - delay - (sourceHistoryEmbedLength - 1) * sourceEmbeddingDelay]]; sourcePastVal[sourceEmbeddingPhase]*=base; destEmbeddingPhase=(destEmbeddingPhase + 1) % destEmbeddingDelay; sourceEmbeddingPhase=(sourceEmbeddingPhase + 1) % sourceEmbeddingDelay; } }
Add observations for a single source-destination pair to our estimates of the pdfs.
@SuppressWarnings({"rawtypes","unchecked"}) private void writeComponent(ICalComponent component) throws IOException { ICalComponentScribe componentScribe=index.getComponentScribe(component); writer.writeStartComponent(componentScribe.getComponentName().toLowerCase()); List propertyObjs=componentScribe.getProperties(component); if (component instanceof ICalendar && component.getProperty(Version.class) == null) { propertyObjs.add(0,new Version(targetVersion)); } for ( Object propertyObj : propertyObjs) { context.setParent(component); ICalProperty property=(ICalProperty)propertyObj; ICalPropertyScribe propertyScribe=index.getPropertyScribe(property); ICalParameters parameters; JCalValue value; try { parameters=propertyScribe.prepareParameters(property,context); value=propertyScribe.writeJson(property,context); } catch ( SkipMeException e) { continue; } String propertyName=propertyScribe.getPropertyName(targetVersion).toLowerCase(); ICalDataType dataType=propertyScribe.dataType(property,targetVersion); writer.writeProperty(propertyName,parameters,dataType,value); } List subComponents=componentScribe.getComponents(component); if (component instanceof ICalendar) { Collection<VTimezone> tzs=getTimezoneComponents(); for ( VTimezone tz : tzs) { if (!subComponents.contains(tz)) { subComponents.add(0,tz); } } } for ( Object subComponentObj : subComponents) { ICalComponent subComponent=(ICalComponent)subComponentObj; writeComponent(subComponent); } writer.writeEndComponent(); }
Writes a component to the data stream.
public static PapeResponse createPapeResponse(){ return new PapeResponse(); }
Constructs a Pape Response with an empty parameter list.
@Override public String toString(){ StringBuilder result=new StringBuilder(); for ( DF_LatticeCell cell : values()) { result.append(cell); result.append("\n"); } return result.toString(); }
Return a string representation of the dataflow solution
public static int OS2IP(byte[] input){ if (input.length > 4) { throw new ArithmeticException("invalid input length"); } if (input.length == 0) { return 0; } int result=0; for (int j=0; j < input.length; j++) { result|=(input[j] & 0xff) << (8 * (input.length - 1 - j)); } return result; }
Convert an octet string to an integer according to IEEE 1363, Section 5.5.3.
public static boolean verify(byte[] data,byte[] signature,byte[] pub){ if (Secp256k1Context.isEnabled()) { try { return NativeSecp256k1.verify(data,signature,pub); } catch ( NativeSecp256k1Util.AssertFailException e) { log.error("Caught AssertFailException inside secp256k1",e); return false; } } return verify(data,ECDSASignature.decodeFromDER(signature),pub); }
Verifies the given ASN.1 encoded ECDSA signature against a hash using the public key.
public ExchangeType createExchangeTypeFromString(EDataType eDataType,String initialValue){ ExchangeType result=ExchangeType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '"+ eDataType.getName()+ "'"); return result; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public CheckedListIterator(ListIterator<E> i,Class<E> type){ this.i=i; this.type=type; }
Constructs a dynamically typesafe view of the specified ListIterator.
public static void orthoM(float[] m,int mOffset,float left,float right,float bottom,float top,float near,float far){ if (left == right) { throw new IllegalArgumentException("left == right"); } if (bottom == top) { throw new IllegalArgumentException("bottom == top"); } if (near == far) { throw new IllegalArgumentException("near == far"); } final float r_width=1.0f / (right - left); final float r_height=1.0f / (top - bottom); final float r_depth=1.0f / (far - near); final float x=2.0f * (r_width); final float y=2.0f * (r_height); final float z=-2.0f * (r_depth); final float tx=-(right + left) * r_width; final float ty=-(top + bottom) * r_height; final float tz=-(far + near) * r_depth; m[mOffset + 0]=x; m[mOffset + 5]=y; m[mOffset + 10]=z; m[mOffset + 12]=tx; m[mOffset + 13]=ty; m[mOffset + 14]=tz; m[mOffset + 15]=1.0f; m[mOffset + 1]=0.0f; m[mOffset + 2]=0.0f; m[mOffset + 3]=0.0f; m[mOffset + 4]=0.0f; m[mOffset + 6]=0.0f; m[mOffset + 7]=0.0f; m[mOffset + 8]=0.0f; m[mOffset + 9]=0.0f; m[mOffset + 11]=0.0f; }
Computes an orthographic projection matrix.
public void fill(Graphics2D g,Shape s,boolean isRounded,boolean paintRightShadow){ if (isRounded) { fillInternalShadowRounded(g,s); } else { fillInternalShadow(g,s,paintRightShadow); } }
Fill the shape with the internal shadow.
public final void close() throws SQLException { if (m_ps != null) { m_ps.close(); } m_ps=null; }
Closes this statement
@SuppressWarnings("unchecked") public void mouseDragged(MouseEvent e){ if (locked == false) { VisualizationViewer<V,E> vv=(VisualizationViewer<V,E>)e.getSource(); if (vertex != null) { Point p=e.getPoint(); Point2D graphPoint=vv.getRenderContext().getMultiLayerTransformer().inverseTransform(p); Point2D graphDown=vv.getRenderContext().getMultiLayerTransformer().inverseTransform(down); Layout<V,E> layout=vv.getGraphLayout(); double dx=graphPoint.getX() - graphDown.getX(); double dy=graphPoint.getY() - graphDown.getY(); PickedState<V> ps=vv.getPickedVertexState(); for ( V v : ps.getPicked()) { Point2D vp=layout.apply(v); vp.setLocation(vp.getX() + dx,vp.getY() + dy); layout.setLocation(v,vp); } down=p; } else { Point2D out=e.getPoint(); if (e.getModifiers() == this.addToSelectionModifiers || e.getModifiers() == modifiers) { rect.setFrameFromDiagonal(down,out); } } if (vertex != null) e.consume(); vv.repaint(); } }
If the mouse is over a picked vertex, drag all picked vertices with the mouse. If the mouse is not over a Vertex, draw the rectangle to select multiple Vertices
protected synchronized void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException { oos.writeInt(serializable); if (serializable <= 0) return; int count=0; Iterator i=services.entrySet().iterator(); while (i.hasNext() && count < serializable) { Map.Entry entry=(Map.Entry)i.next(); BCSSServiceProvider bcsp=null; try { bcsp=(BCSSServiceProvider)entry.getValue(); } catch ( ClassCastException cce) { continue; } if (bcsp.getServiceProvider() instanceof Serializable) { oos.writeObject(entry.getKey()); oos.writeObject(bcsp); count++; } } if (count != serializable) throw new IOException("wrote different number of service providers than expected"); }
called from BeanContextSupport writeObject before it serializes the children ... This class will serialize any Serializable BeanContextServiceProviders herein. subclasses may envelope this method to insert their own serialization processing that has to occur prior to serialization of the children
protected void fireOpenOrderEnd(ConcurrentHashMap<Integer,TradeOrder> openOrders){ Object[] listeners=this.listenerList.getListenerList(); for (int i=listeners.length - 2; i >= 0; i-=2) { if (listeners[i] == BrokerChangeListener.class) { ((BrokerChangeListener)listeners[i + 1]).openOrderEnd(openOrders); } } }
Notifies all registered listeners that the brokerManagerModel has received all the open orders.
public void execute(final Session session){ for ( String cqlStatement : cqlStatements) { LOG.debug("Executing CQL: " + cqlStatement); session.execute(cqlStatement); } }
Executes this script against the database.
public boolean isColorRelative(int i){ return (masks[i] & COLOR_RELATIVE_MASK) != 0; }
Tells whether the given property value is relative to 'color'.
public Value addObject(Object instance) throws RepositoryException { if (instance instanceof RDFObjectBehaviour) { RDFObjectBehaviour support=(RDFObjectBehaviour)instance; Object entity=support.getBehaviourDelegate(); if (entity != instance) return addObject(entity); } if (instance instanceof RDFObject) { if (((RDFObject)instance).getObjectConnection() == this) return ((RDFObject)instance).getResource(); } else { if (of.isDatatype(instance.getClass())) return of.createLiteral(instance); } Class<?> type=instance.getClass(); if (RDFObject.class.isAssignableFrom(type) || isEntity(type)) { Resource resource=assignResource(instance); if (!isAlreadyMerged(resource)) { addObject(resource,instance); } return resource; } return of.createLiteral(instance); }
Imports the instance into the RDF store if not previously imported. If an object with the same Resource identifier has already been imported into the store during through this connection, the Resource identifier is returned and the object is not imported.
@LogMessageDoc(level="ERROR",message="Failure writing PacketOut " + "switch={switch} packet-in={packet-in} " + "packet-out={packet-out}",explanation="An I/O error occured while writing a packet " + "out message to the switch",recommendation=LogMessageDoc.CHECK_SWITCH) protected void doFlood(IOFSwitch sw,OFPacketIn pi,FloodlightContext cntx){ OFPort inPort=(pi.getVersion().compareTo(OFVersion.OF_12) < 0 ? pi.getInPort() : pi.getMatch().get(MatchField.IN_PORT)); if (topologyService.isIncomingBroadcastAllowed(sw.getId(),inPort) == false) { if (log.isTraceEnabled()) { log.trace("doFlood, drop broadcast packet, pi={}, " + "from a blocked port, srcSwitch=[{},{}], linkInfo={}",new Object[]{pi,sw.getId(),inPort}); } return; } OFPacketOut.Builder pob=sw.getOFFactory().buildPacketOut(); List<OFAction> actions=new ArrayList<OFAction>(); if (sw.hasAttribute(IOFSwitch.PROP_SUPPORTS_OFPP_FLOOD)) { actions.add(sw.getOFFactory().actions().output(OFPort.FLOOD,Integer.MAX_VALUE)); } else { actions.add(sw.getOFFactory().actions().output(OFPort.ALL,Integer.MAX_VALUE)); } pob.setActions(actions); pob.setBufferId(OFBufferId.NO_BUFFER); pob.setInPort(inPort); pob.setData(pi.getData()); try { if (log.isTraceEnabled()) { log.trace("Writing flood PacketOut switch={} packet-in={} packet-out={}",new Object[]{sw,pi,pob.build()}); } messageDamper.write(sw,pob.build()); } catch ( IOException e) { log.error("Failure writing PacketOut switch={} packet-in={} packet-out={}",new Object[]{sw,pi,pob.build()},e); } return; }
Creates a OFPacketOut with the OFPacketIn data that is flooded on all ports unless the port is blocked, in which case the packet will be dropped.
public boolean isFinal(){ if (_final == null) { return false; } else { return _final; } }
Ruft den Wert der final-Eigenschaft ab.
public static Boolean readSharedPreference(Context context,String key,Boolean default_value){ try { SharedPreferences settings=getSharedPreferenceManager(context); return settings.getBoolean(key,default_value); } catch ( Exception e) { return default_value; } }
Lee una preferencia
public static ByteBuffer exportImage(final BufferedImage image,final String targetExt){ final ByteBuffer baos=new ByteBuffer(); ImageIO.setUseCache(false); try { ImageIO.write(image,targetExt,baos); return baos; } catch ( final IOException e) { ConcurrentLog.logException(e); return null; } }
Encode buffered image using specified format to a new ByteBuffer
private void updateCallStackForCallNode(Stack<MethodCall> callStack,CCFGMethodCallNode callNode){ MethodCall call=MethodCall.constructForCallNode(callNode); updateCallStackForCall(callStack,call); }
Creates a new MethodCall object for the given MethodCallNode and pushes it onto the given callStack.
@RequestMapping(value=BUSINESS_OBJECT_DATA_ATTRIBUTES_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}"+ "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}"+ "/businessObjectFormatVersions/{businessObjectFormatVersion}/partitionValues/{partitionValue}/subPartition1Values/{subPartition1Value}"+ "/subPartition2Values/{subPartition2Value}/subPartition3Values/{subPartition3Value}/subPartition4Values/{subPartition4Value}"+ "/businessObjectDataVersions/{businessObjectDataVersion}/businessObjectDataAttributeNames/{businessObjectDataAttributeName}",method=RequestMethod.DELETE) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_ATTRIBUTES_DELETE) public BusinessObjectDataAttribute deleteBusinessObjectDataAttribute(@PathVariable("namespace") String namespace,@PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,@PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,@PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,@PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion,@PathVariable("partitionValue") String partitionValue,@PathVariable("subPartition1Value") String subPartition1Value,@PathVariable("subPartition2Value") String subPartition2Value,@PathVariable("subPartition3Value") String subPartition3Value,@PathVariable("subPartition4Value") String subPartition4Value,@PathVariable("businessObjectDataVersion") Integer businessObjectDataVersion,@PathVariable("businessObjectDataAttributeName") String businessObjectDataAttributeName){ return businessObjectDataAttributeService.deleteBusinessObjectDataAttribute(new BusinessObjectDataAttributeKey(namespace,businessObjectDefinitionName,businessObjectFormatUsage,businessObjectFormatFileType,businessObjectFormatVersion,partitionValue,Arrays.asList(subPartition1Value,subPartition2Value,subPartition3Value,subPartition4Value),businessObjectDataVersion,businessObjectDataAttributeName)); }
Deletes an existing attribute for the business object data with 4 subpartition values. <p>Requires WRITE permission on namespace</p>
public HyphenatedWordsFilterFactory(Map<String,String> args){ super(args); if (!args.isEmpty()) { throw new IllegalArgumentException("Unknown parameters: " + args); } }
Creates a new HyphenatedWordsFilterFactory
public void init(){ try { String current_dir=ScopeApplicationAdapter.webAppPath + File.separatorChar; File fInit=new File(current_dir + "WEB-INF" + File.separatorChar+ "velocity.properties"); if (fInit.exists()) { Velocity.init(current_dir + "WEB-INF" + File.separatorChar+ "velocity.properties"); } else { Velocity.init("WeBContent" + File.separatorChar + "WEB-INF"+ File.separatorChar+ "velocity.properties"); } } catch ( Exception e) { log.error("Problem initializing Velocity : ",e); System.out.println("Problem initializing Velocity : " + e); } }
Loads the Path from the Red5-Scope
public static void main(String[] args){ parseCmdLine(args); int size=1 << levels; int msize=1 << (levels - 1); QuadTreeNode.gcmp=size * 1024; QuadTreeNode.lcmp=msize * 1024; long start0=System.currentTimeMillis(); QuadTreeNode tree=QuadTreeNode.createTree(msize,0,0,null,Quadrant.cSouthEast,levels); long end0=System.currentTimeMillis(); long start1=System.currentTimeMillis(); int leaves=tree.countTree(); long end1=System.currentTimeMillis(); long start2=System.currentTimeMillis(); int perm=tree.perimeter(size); long end2=System.currentTimeMillis(); if (printResult) { System.out.println("Perimeter is " + perm); System.out.println("Number of leaves " + leaves); } if (printMsgs) { System.out.println("QuadTree alloc time " + (end0 - start0) / 1000.0); System.out.println("Count leaves time " + (end1 - start1) / 1000.0); System.out.println("Perimeter compute time " + (end2 - start2) / 1000.0); } }
The entry point to computing the perimeter of an image.
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType){ return getAnnotation(annotationType) != null; }
Indicates whether the specified annotation is present.
@Field(0) public int image_type(){ return this.io.getIntField(this,0); }
C type : cl_mem_object_type
public Object GetInstance(){ if (OptionInstance) { return PlugInObject; } return null; }
Returns the stored object as an instance of class.
public void dispatchToEvents(int nodeHandle,org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { }
Directly create SAX parser events from a subtree.
public int findFirstVisibleItemPosition(){ final View child=findOneVisibleChild(0,layoutManager.getChildCount(),false,true); return child == null ? RecyclerView.NO_POSITION : recyclerView.getChildAdapterPosition(child); }
Returns the adapter position of the first visible view. This position does not include adapter changes that were dispatched after the last layout pass.
public Optional<Vector3D> rayTrace(Cuboid cuboid,double minDist,double maxDist){ Vector3D bbox; double tMin; double tMax; bbox=ray.signDirX ? cuboid.max : cuboid.min; tMin=(bbox.getX() - ray.origin.getX()) * ray.invDir.getX(); bbox=ray.signDirX ? cuboid.min : cuboid.max; tMax=(bbox.getX() - ray.origin.getX()) * ray.invDir.getX(); bbox=ray.signDirY ? cuboid.max : cuboid.min; double tyMin=(bbox.getY() - ray.origin.getY()) * ray.invDir.getY(); bbox=ray.signDirY ? cuboid.min : cuboid.max; double tyMax=(bbox.getY() - ray.origin.getY()) * ray.invDir.getY(); if ((tMin > tyMax) || (tyMin > tMax)) { return Optional.empty(); } if (tyMin > tMin) { tMin=tyMin; } if (tyMax < tMax) { tMax=tyMax; } bbox=ray.signDirZ ? cuboid.max : cuboid.min; double tzMin=(bbox.getZ() - ray.origin.getZ()) * ray.invDir.getZ(); bbox=ray.signDirZ ? cuboid.min : cuboid.max; double tzMax=(bbox.getZ() - ray.origin.getZ()) * ray.invDir.getZ(); if ((tMin > tzMax) || (tzMin > tMax)) { return Optional.empty(); } if (tzMin > tMin) { tMin=tzMin; } if (tzMax < tMax) { tMax=tzMax; } if ((tMin < maxDist) && (tMax > minDist)) { return Optional.of(ray.origin.add(ray.dir.scalarMultiply(tMin))); } return Optional.empty(); }
Calculates intersection with the given ray between a certain distance interval. <p> Ray-box intersection is using IEEE numerical properties to ensure the test is both robust and efficient, as described in: <br> <code>Amy Williams, Steve Barrus, R. Keith Morley, and Peter Shirley: "An Efficient and Robust Ray-Box Intersection Algorithm" Journal of graphics tools, 10(1):49-54, 2005</code>
private int countNonNewline(String str,int off,int len){ for (int cnt=0; cnt < len; cnt++) { final int pos=off + cnt; if (str.charAt(pos) == UNIX_NEWLINE) { return cnt; } if (str.charAt(pos) == CARRIAGE_RETURN) { return cnt; } } return len; }
Count the number of non-newline characters before first newline in the string.
@Override public boolean containsKey(Object key){ return _map.containsKey(unwrapKey(key)); }
Checks for the present of <tt>key</tt> in the keys of the map.
public void savePreference(){ if (m_AD_User_ID > 0) { Query query=new Query(Env.getCtx(),I_AD_Preference.Table_Name,"AD_User_ID = ? AND Attribute = ? AND AD_Window_ID Is NULL",null); for (int i=0; i < PROPERTIES.length; i++) { String attribute=PROPERTIES[i]; String value=props.getProperty(attribute); MPreference preference=query.setParameters(new Object[]{m_AD_User_ID,attribute}).firstOnly(); if (preference == null) { preference=new MUserPreference(Env.getCtx(),0,null); preference.setAD_User_ID(m_AD_User_ID); preference.setAttribute(attribute); } else { if (preference.getAD_Client_ID() > 0 || preference.getAD_Org_ID() > 0) { preference=new MUserPreference(Env.getCtx(),preference.getAD_Preference_ID(),null); } } preference.setValue(value); preference.saveEx(); } } }
save user preference
public static Number bitwiseNegate(Number left){ return NumberMath.bitwiseNegate(left); }
Bitwise NEGATE a Number.
public final void mulTransposeLeft(Matrix4f m1,Matrix4f m2){ if (this != m1 && this != m2) { this.m00=m1.m00 * m2.m00 + m1.m10 * m2.m10 + m1.m20 * m2.m20 + m1.m30 * m2.m30; this.m01=m1.m00 * m2.m01 + m1.m10 * m2.m11 + m1.m20 * m2.m21 + m1.m30 * m2.m31; this.m02=m1.m00 * m2.m02 + m1.m10 * m2.m12 + m1.m20 * m2.m22 + m1.m30 * m2.m32; this.m03=m1.m00 * m2.m03 + m1.m10 * m2.m13 + m1.m20 * m2.m23 + m1.m30 * m2.m33; this.m10=m1.m01 * m2.m00 + m1.m11 * m2.m10 + m1.m21 * m2.m20 + m1.m31 * m2.m30; this.m11=m1.m01 * m2.m01 + m1.m11 * m2.m11 + m1.m21 * m2.m21 + m1.m31 * m2.m31; this.m12=m1.m01 * m2.m02 + m1.m11 * m2.m12 + m1.m21 * m2.m22 + m1.m31 * m2.m32; this.m13=m1.m01 * m2.m03 + m1.m11 * m2.m13 + m1.m21 * m2.m23 + m1.m31 * m2.m33; this.m20=m1.m02 * m2.m00 + m1.m12 * m2.m10 + m1.m22 * m2.m20 + m1.m32 * m2.m30; this.m21=m1.m02 * m2.m01 + m1.m12 * m2.m11 + m1.m22 * m2.m21 + m1.m32 * m2.m31; this.m22=m1.m02 * m2.m02 + m1.m12 * m2.m12 + m1.m22 * m2.m22 + m1.m32 * m2.m32; this.m23=m1.m02 * m2.m03 + m1.m12 * m2.m13 + m1.m22 * m2.m23 + m1.m32 * m2.m33; this.m30=m1.m03 * m2.m00 + m1.m13 * m2.m10 + m1.m23 * m2.m20 + m1.m33 * m2.m30; this.m31=m1.m03 * m2.m01 + m1.m13 * m2.m11 + m1.m23 * m2.m21 + m1.m33 * m2.m31; this.m32=m1.m03 * m2.m02 + m1.m13 * m2.m12 + m1.m23 * m2.m22 + m1.m33 * m2.m32; this.m33=m1.m03 * m2.m03 + m1.m13 * m2.m13 + m1.m23 * m2.m23 + m1.m33 * m2.m33; } else { float m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33; m00=m1.m00 * m2.m00 + m1.m10 * m2.m10 + m1.m20 * m2.m20 + m1.m30 * m2.m30; m01=m1.m00 * m2.m01 + m1.m10 * m2.m11 + m1.m20 * m2.m21 + m1.m30 * m2.m31; m02=m1.m00 * m2.m02 + m1.m10 * m2.m12 + m1.m20 * m2.m22 + m1.m30 * m2.m32; m03=m1.m00 * m2.m03 + m1.m10 * m2.m13 + m1.m20 * m2.m23 + m1.m30 * m2.m33; m10=m1.m01 * m2.m00 + m1.m11 * m2.m10 + m1.m21 * m2.m20 + m1.m31 * m2.m30; m11=m1.m01 * m2.m01 + m1.m11 * m2.m11 + m1.m21 * m2.m21 + m1.m31 * m2.m31; m12=m1.m01 * m2.m02 + m1.m11 * m2.m12 + m1.m21 * m2.m22 + m1.m31 * m2.m32; m13=m1.m01 * m2.m03 + m1.m11 * m2.m13 + m1.m21 * m2.m23 + m1.m31 * m2.m33; m20=m1.m02 * m2.m00 + m1.m12 * m2.m10 + m1.m22 * m2.m20 + m1.m32 * m2.m30; m21=m1.m02 * m2.m01 + m1.m12 * m2.m11 + m1.m22 * m2.m21 + m1.m32 * m2.m31; m22=m1.m02 * m2.m02 + m1.m12 * m2.m12 + m1.m22 * m2.m22 + m1.m32 * m2.m32; m23=m1.m02 * m2.m03 + m1.m12 * m2.m13 + m1.m22 * m2.m23 + m1.m32 * m2.m33; m30=m1.m03 * m2.m00 + m1.m13 * m2.m10 + m1.m23 * m2.m20 + m1.m33 * m2.m30; m31=m1.m03 * m2.m01 + m1.m13 * m2.m11 + m1.m23 * m2.m21 + m1.m33 * m2.m31; m32=m1.m03 * m2.m02 + m1.m13 * m2.m12 + m1.m23 * m2.m22 + m1.m33 * m2.m32; m33=m1.m03 * m2.m03 + m1.m13 * m2.m13 + m1.m23 * m2.m23 + m1.m33 * m2.m33; this.m00=m00; this.m01=m01; this.m02=m02; this.m03=m03; this.m10=m10; this.m11=m11; this.m12=m12; this.m13=m13; this.m20=m20; this.m21=m21; this.m22=m22; this.m23=m23; this.m30=m30; this.m31=m31; this.m32=m32; this.m33=m33; } }
Multiplies the transpose of matrix m1 times matrix m2, and places the result into this.
public boolean hasContainedTerritory(final String territoryName){ return m_contains.containsKey(territoryName); }
Does this territory have any territories contained within it
public void showDialog(){ view.setEnabledImportButton(false); view.showDialog(); }
Show dialog.
private Region remove(Region x){ this.deletedNode=NULL_NODE; this.root=remove(x,this.root); Region d=this.deletedElement; this.deletedElement=null; if (d == null) { return null; } else { return new Region(d); } }
Remove from the tree.
public boolean visit(MethodDeclaration node){ return true; }
Visits the given type-specific AST node. <p> The default implementation does nothing and return true. Subclasses may reimplement. </p>
public JSONWriter object() throws JSONException { if (this.mode == 'i') { this.mode='o'; } if (this.mode == 'o' || this.mode == 'a') { this.append("{"); this.push(new JSONObject()); this.comma=false; return this; } throw new JSONException("Misplaced object."); }
Begin appending a new object. All keys and values until the balancing <code>endObject</code> will be appended to this object. The <code>endObject</code> method must be called to mark the object's end.
public Linear3SystemSolver(final int numVariables,final int numEquations){ this.numVertices=numVariables; this.numEdges=numEquations; peeled=new boolean[numEdges]; edge=new int[numVertices]; edge2Vertex=new int[3][numEdges]; stack=new int[numEdges]; d=new int[numVertices]; visitStack=new IntArrayList(INITIAL_QUEUE_SIZE); neverUsed=true; }
Creates a linear 3-regular system solver for a given number of variables and equations.
public void initializeHeader(ObjectReference object){ byte oldValue=VM.objectModel.readAvailableByte(object); byte newValue=(byte)((oldValue & GC_MARK_BIT_MASK) | markState); if (HeaderByte.NEEDS_UNLOGGED_BIT) newValue|=HeaderByte.UNLOGGED_BIT; VM.objectModel.writeAvailableByte(object,newValue); }
Initialize the object header post-allocation. We need to set the mark state correctly and set the logged bit if necessary.
public FastMultiByteArrayInputStream(final FastMultiByteArrayInputStream is){ this.array=is.array; this.length=is.length; this.current=array[0]; }
Creates a new multi-array input stream sharing the backing arrays of another multi-array input stream.
public Object convert(Object valueToConvert) throws IllegalArgumentException { if (valueToConvert instanceof java.sql.Time) { return ((Time)valueToConvert).toString(); } throw new IllegalArgumentException("The source object must be of type: " + getSourceType().getName()); }
This method is used by the JavaTypeTranslator to convert a source object of type java.sql.Time to an instance of type java.lang.String. Conversion is done using the toString() method of the java.sql.Time class.
void mul(int y,MutableBigInteger z){ if (y == 1) { z.copyValue(this); return; } if (y == 0) { z.clear(); return; } long ylong=y & LONG_MASK; int[] zval=(z.value.length < intLen + 1 ? new int[intLen + 1] : z.value); long carry=0; for (int i=intLen - 1; i >= 0; i--) { long product=ylong * (value[i + offset] & LONG_MASK) + carry; zval[i + 1]=(int)product; carry=product >>> 32; } if (carry == 0) { z.offset=1; z.intLen=intLen; } else { z.offset=0; z.intLen=intLen + 1; zval[0]=(int)carry; } z.value=zval; }
Multiply the contents of this MutableBigInteger by the word y. The result is placed into z.
public Element removeElement(ElementKey<?,?> childKey){ return removeElement(childKey.getId()); }
Remove child element(s) of a given name. All elements with the same ID as the given key will be removed.
@Override public boolean validSubTokenKey(String subtok){ return super.validToken(subtok) && filterBy.containsKey(subtok); }
If the key is in the filter, returns true
private void handleResponse(int response,ResponseData rawData){ mPolicy.processServerResponse(response,rawData); if (mPolicy.allowAccess()) { mCallback.allow(response); } else { mCallback.dontAllow(response); } }
Confers with policy and calls appropriate callback method.
protected void cancelRepaints(){ Display.impl.cancelRepaint(this); }
remove this component from the painting queue
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:51.774 -0400",hash_original_method="EA1F98341C1FEBB76DE541E0DAA4DDD0",hash_generated_method="2908ECB022F338E34CD3F0E8541D8B63") @Override public void close() throws IOException { try { out.close(); } catch ( IOException e) { handleIOException(e); } }
Invokes the delegate's <code>close()</code> method.
private void validateBusinessObjectDataNotificationRegistrationUpdateRequest(BusinessObjectDataNotificationRegistrationUpdateRequest request){ Assert.notNull(request,"A business object data notification update request must be specified."); Assert.hasText(request.getBusinessObjectDataEventType(),"A business object data event type must be specified."); request.setBusinessObjectDataEventType(request.getBusinessObjectDataEventType().trim()); Assert.hasText(request.getNotificationRegistrationStatus(),"A notification registration status must be specified."); request.setNotificationRegistrationStatus(request.getNotificationRegistrationStatus().trim()); validateBusinessObjectDataNotificationFilter(request.getBusinessObjectDataNotificationFilter(),request.getBusinessObjectDataEventType()); validateNotificationActions(request.getJobActions()); }
Validates the business object data notification update request. This method also trims the request parameters.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:35:19.741 -0500",hash_original_method="942D4E1EA5C6469103A344EA38AACE8F",hash_generated_method="052441FC657C7AFDE50D7B0A486E54D0") public boolean queryAfterZeroResults(){ return mQueryAfterZeroResults; }
Checks whether this searchable activity should be queried for suggestions if a prefix of the query has returned no results.
public static boolean isMultOperator(String opr){ boolean is=false; if (opr.equals(FolderSearchOpr.IN_AND) || opr.equals(FolderSearchOpr.IN_OR) || opr.equals(FolderSearchOpr.LIKE_AND)|| opr.equals(FolderSearchOpr.LIKE_OR)) is=true; return is; }
Es un operador de un campo multivalor
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { request.getSession().setAttribute("school","ycit"); response.sendRedirect("servlet/SchoolServlet"); return; }
The doGet method of the servlet. <br> This method is called when a form has its tag value method equals to get.
public static void overScrollBy(final PullToRefreshBase<?> view,final int deltaX,final int scrollX,final int deltaY,final int scrollY,final int scrollRange,final int fuzzyThreshold,final float scaleFactor,final boolean isTouchEvent){ final int deltaValue, currentScrollValue, scrollValue; switch (view.getPullToRefreshScrollDirection()) { case HORIZONTAL: deltaValue=deltaX; scrollValue=scrollX; currentScrollValue=view.getScrollX(); break; case VERTICAL: default : deltaValue=deltaY; scrollValue=scrollY; currentScrollValue=view.getScrollY(); break; } if (view.isPullToRefreshOverScrollEnabled() && !view.isRefreshing()) { final PullToRefreshBase.Mode mode=view.getMode(); if (mode.permitsPullToRefresh() && !isTouchEvent && deltaValue != 0) { final int newScrollValue=(deltaValue + scrollValue); if (newScrollValue < (0 - fuzzyThreshold)) { if (mode.showHeaderLoadingLayout()) { if (currentScrollValue == 0) { view.setState(PullToRefreshBase.State.OVERSCROLLING); } view.setHeaderScroll((int)(scaleFactor * (currentScrollValue + newScrollValue))); } } else if (newScrollValue > (scrollRange + fuzzyThreshold)) { if (mode.showFooterLoadingLayout()) { if (currentScrollValue == 0) { view.setState(PullToRefreshBase.State.OVERSCROLLING); } view.setHeaderScroll((int)(scaleFactor * (currentScrollValue + newScrollValue - scrollRange))); } } else if (Math.abs(newScrollValue) <= fuzzyThreshold || Math.abs(newScrollValue - scrollRange) <= fuzzyThreshold) { view.setState(PullToRefreshBase.State.RESET); } } else if (isTouchEvent && PullToRefreshBase.State.OVERSCROLLING == view.getState()) { view.setState(PullToRefreshBase.State.RESET); } } }
Helper method for Overscrolling that encapsulates all of the necessary function. This is the advanced version of the call.
public Object runSafely(Catbert.FastStack stack) throws Exception { DShowTVPlayer.setAudioDecoderFilter(getString(stack)); return null; }
Sets the name of the DirectShow audio decoder filter that's used for MPEG2 playback (Windows only)
public void animateUnlayout(final int duration,int opacity,Runnable callback){ animateUnlayout(duration,false,opacity,callback); }
<p>This method is the exact reverse of animateLayout, when completed it leaves the container in an invalid state. It is useful to invoke this in order to remove a component, transition to a different form or provide some other interaction. E.g.:</p> <script src="https://gist.github.com/codenameone/ba6fdc5f841b083e13e9.js"></script>
@Override public boolean test(final Object receiver,final String property,final Object[] args,final Object expectedValue){ if (!PROPERTY_IS_SUPPORTING_RUNNER.equals(property)) { LOGGER.debug("invoked wrong property to test : " + property); return false; } final Optional<IFile> file=getFileFromInput(receiver); if (!file.isPresent()) { return false; } if (!generatedFileLocator.tryGetGeneratedSourceForN4jsFile(file.get()).isPresent()) { return false; } final Object arg0=args[0]; if (!(arg0 instanceof String)) { LOGGER.debug("invalid runner key value, should be String"); return false; } final String runnerId=arg0.toString(); final IRunnerDescriptor runnerDesc; try { runnerDesc=runnerRegistry.getDescriptor(runnerId); } catch ( Exception e) { LOGGER.debug("invalid runner key value, no runner found for id: " + runnerId); return false; } final List<RuntimeEnvironment> compatibleRuntimeEnvironmets=newArrayList(); try { compatibleRuntimeEnvironmets.addAll(findCompatibleRuntimeEnvironments(file.get())); } catch ( final DependencyCycleDetectedException|InsolvableRuntimeEnvironmentException e) { LOGGER.info(e.getMessage()); return false; } if ("eu.numberfour.n4js.runner.nodejs.NODEJS".equals(runnerDesc.getId())) { final boolean haveCustomNodeRuntimeEnvironment=hRuntimeEnvironments.findRuntimeEnvironmentProject(RuntimeEnvironment.NODEJS).isPresent(); if (!haveCustomNodeRuntimeEnvironment) return true; } if (!compatibleRuntimeEnvironmets.isEmpty() && "RE_NodeJS_Mangelhaft".equals(compatibleRuntimeEnvironmets.get(0).getProjectId())) { return true; } final boolean runnerToTestIsCompatible=compatibleRuntimeEnvironmets.contains(runnerDesc.getEnvironment()); if (!runnerToTestIsCompatible) { LOGGER.debug("Runner with id '" + runnerId + "' does not support running selected file."); return false; } return true; }
Check if given receiver object is supported by given runner. Runner is specified by first arguments in args parameter which is expected to be runner key value.
public void add(OnClickWrapper onClickWrapper){ onClickWrapperList.add(onClickWrapper); }
Adds an onclickwrapper to a list that will be reattached on orientation change.
public Cursor toCursor() throws IOException { CursorImpl cursor=null; if (_index == null) { cursor=CursorImpl.createCursor(_table); } else { cursor=IndexCursorImpl.createCursor(_table,_index,_startRow,_startRowInclusive,_endRow,_endRowInclusive); } cursor.setColumnMatcher(_columnMatcher); if (_savepoint == null) { if (!_beforeFirst) { cursor.afterLast(); } } else { cursor.restoreSavepoint(_savepoint); } return cursor; }
Returns a new cursor for the table, constructed to the given specifications.
public Sentence parseAsMatchingSource(){ return parse(new ConvCtxForMatchingSource()); }
Return a parsed sentence object to be used as source in matching.
private void updateColorOfPoint(DataPointColored point){ if (coloringMethod == ColoringMethod.None) { if (point == projector.getCurrentPoint() && hotPointMode == true) { point.setColor(hotColor); } else { point.setColor(baseColor); } } else if (coloringMethod == ColoringMethod.DecayTrail) { if (point == projector.getCurrentPoint()) { if (point == projector.getCurrentPoint() && hotPointMode == true) { point.setColor(hotColor); } else { point.setColor(baseColor); } point.spikeActivation(ceiling); } else { point.decrementActivation(floor,decrementAmount); point.setColorBasedOnVal(Utils.colorToFloat(baseColor)); } } else if (coloringMethod == ColoringMethod.Frequency) { if (point == projector.getCurrentPoint()) { if (point == projector.getCurrentPoint() && hotPointMode == true) { point.setColor(hotColor); } else { point.setColor(baseColor); } point.incrementActivation(ceiling,incrementAmount); } else { point.setColorBasedOnVal(Utils.colorToFloat(baseColor)); } } }
Update the color of the specified point in the dataset.
public static ServerLocator createServerLocator(final boolean ha,TransportConfiguration... transportConfigurations){ return new ServerLocatorImpl(ha,transportConfigurations); }
Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically as the cluster topology changes, and no HA backup information is propagated to the client
private int readShort(InputStream is) throws IOException { int c1=is.read(); int c2=is.read(); return ((c1 << 8) | c2); }
Parses a 16-bit int.
@Override public void clear(){ super.clear(); double[] set=_set; byte[] states=_states; for (int i=set.length; i-- > 0; ) { set[i]=(double)0; states[i]=FREE; } }
Empties the set.
public static String[] translatePathName(String path){ path=prettifyPath(path); if (path.indexOf('/') != 0) path='/' + path; int index=path.lastIndexOf('/'); if (index == path.length() - 1) path=path.substring(0,path.length() - 1); index=path.lastIndexOf('/'); String name; if (index == -1) { name=path; path="/"; } else { name=path.substring(index + 1); path=path.substring(0,index + 1); } return new String[]{path,name}; }
transalte a path in a proper form and cut name away example susi\petere -> /susi/ and peter
public static boolean isInterface(int flags){ return (flags & AccInterface) != 0; }
Returns whether the given integer includes the <code>interface</code> modifier.
private Producer<CloseableReference<CloseableImage>> newBitmapCacheGetToBitmapCacheSequence(Producer<CloseableReference<CloseableImage>> inputProducer){ BitmapMemoryCacheProducer bitmapMemoryCacheProducer=mProducerFactory.newBitmapMemoryCacheProducer(inputProducer); BitmapMemoryCacheKeyMultiplexProducer bitmapKeyMultiplexProducer=mProducerFactory.newBitmapMemoryCacheKeyMultiplexProducer(bitmapMemoryCacheProducer); ThreadHandoffProducer<CloseableReference<CloseableImage>> threadHandoffProducer=mProducerFactory.newBackgroundThreadHandoffProducer(bitmapKeyMultiplexProducer,mThreadHandoffProducerQueue); return mProducerFactory.newBitmapMemoryCacheGetProducer(threadHandoffProducer); }
Bitmap cache get -> thread hand off -> multiplex -> bitmap cache
public ApiConfig(String apiKey,String accessToken,String referrer,LogLevel logLevel){ this(apiKey,accessToken,referrer); mLogLevel=logLevel; }
Set api key, access token and referrer
public int prepareInt(){ return 0; }
Prepare for an atomic store operation. This must be associated with a related call to attempt.
public static RowLimitClause create(String numRowsVariable,String offsetVariable){ return new RowLimitClause(null,null,numRowsVariable,offsetVariable); }
Creates a row limit clause.
@Override public final long put(final byte[] key,final long l) throws SpaceExceededException { assert l >= 0 : "l = " + l; assert (key != null); final Row.Entry newentry=this.rowdef.newEntry(); newentry.setCol(0,key); newentry.setCol(1,l); final Row.Entry oldentry=this.index.replace(newentry); if (oldentry == null) return -1; return oldentry.getColLong(1); }
Adds the key-value pair to the index.
public static GetAlarmsResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { GetAlarmsResponse object=new GetAlarmsResponse(); int event; java.lang.String nillableValue=null; java.lang.String prefix=""; java.lang.String namespaceuri=""; try { while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type") != null) { java.lang.String fullTypeName=reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type"); if (fullTypeName != null) { java.lang.String nsPrefix=null; if (fullTypeName.indexOf(":") > -1) { nsPrefix=fullTypeName.substring(0,fullTypeName.indexOf(":")); } nsPrefix=nsPrefix == null ? "" : nsPrefix; java.lang.String type=fullTypeName.substring(fullTypeName.indexOf(":") + 1); if (!"getAlarmsResponse".equals(type)) { java.lang.String nsUri=reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (GetAlarmsResponse)ExtensionMapper.getTypeObject(nsUri,type,reader); } } } java.util.Vector handledAttributes=new java.util.Vector(); reader.next(); java.util.ArrayList list1=new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } if (reader.isStartElement() && new javax.xml.namespace.QName("http://com.vmware.vim.vasa/1.0/xsd","return").equals(reader.getName())) { nillableValue=reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil"); if ("true".equals(nillableValue) || "1".equals(nillableValue)) { list1.add(null); reader.next(); } else { list1.add(StorageAlarm.Factory.parse(reader)); } boolean loopDone1=false; while (!loopDone1) { while (!reader.isEndElement()) { reader.next(); } reader.next(); while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } if (reader.isEndElement()) { loopDone1=true; } else { if (new javax.xml.namespace.QName("http://com.vmware.vim.vasa/1.0/xsd","return").equals(reader.getName())) { nillableValue=reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil"); if ("true".equals(nillableValue) || "1".equals(nillableValue)) { list1.add(null); reader.next(); } else { list1.add(StorageAlarm.Factory.parse(reader)); } } else { loopDone1=true; } } } object.set_return((StorageAlarm[])org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(StorageAlarm.class,list1)); } else { } while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } if (reader.isStartElement()) { throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); } } catch ( javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; }
static method to create the object Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable If this object is not an element, it is a complex type and the reader is at the event just after the outer start element Postcondition: If this object is an element, the reader is positioned at its end element If this object is a complex type, the reader is positioned at the end element of its outer element
public static void main(String[] args){ Debug.init(); String name=(args.length < 1) ? "com.bbn.openmap.layer.shape.ShapeLayer" : args[0]; PropertyConsumer propertyconsumer=null; try { Class<?> c=Class.forName(name); propertyconsumer=(PropertyConsumer)c.newInstance(); } catch ( Exception e) { e.printStackTrace(); System.exit(1); } if (propertyconsumer != null) { Properties props=new Properties(), info=new Properties(); System.out.println("Inspecting " + name); String pp=name.substring(name.lastIndexOf(".") + 1); propertyconsumer.setPropertyPrefix(pp.toLowerCase()); props=propertyconsumer.getProperties(props); info=propertyconsumer.getPropertyInfo(info); Inspector inspector=new Inspector(); inspector.setPrint(true); inspector.addActionListener(inspector); inspector.inspectPropertyConsumer(propertyconsumer); } }
test cases.
public String defaultPackageName(){ final Supplier<String> defaultProjectPackage=null; if (document() instanceof Project) { return defaultProjectPackage.get(); } else { return projectOrThrow().getPackageName().orElseGet(defaultProjectPackage) + "." + DocumentUtil.relativeName(document(),Dbms.class,JAVA_NAME,null); } }
Returns the default package name where the document would be located if the user has not specified a custom package in the config file.
public boolean hasLongColumnInfo(){ return this.hasLongColumnInfo; }
Does the server send back extra column info?
public void removeDataChangedListener(DataChangedListener d){ listeners.removeListener(d); }
Removes the listener for data change events
public void createAllProxies(DistributedMember member,Region<String,Object> monitoringRegion){ if (logger.isDebugEnabled()) { logger.debug("Creating proxy for: {}",member.getId()); } if (remoteFilterChain.isServerGroupFiltered("")) { if (logger.isTraceEnabled()) { logger.trace("Returning from server group filter"); } return; } if (remoteFilterChain.isManagedNodeFiltered(member)) { if (logger.isTraceEnabled()) { logger.trace("returning from managed node filter"); } return; } Set<String> mbeanNames=monitoringRegion.keySet(); Iterator<String> it=mbeanNames.iterator(); while (it.hasNext()) { ObjectName objectName=null; if (remoteFilterChain.isRemoteMBeanFiltered(objectName)) { if (logger.isTraceEnabled()) { logger.trace("continue from remote MBEan node filter"); } continue; } try { objectName=ObjectName.getInstance(it.next()); if (logger.isDebugEnabled()) { logger.debug("Creating proxy for ObjectName: " + objectName.toString()); } createProxy(member,objectName,monitoringRegion,monitoringRegion.get(objectName.toString())); } catch ( ManagementException e) { logger.warn("Create Proxy failed for {} with exception {}",objectName,e.getMessage(),e); continue; } catch ( Exception e) { logger.warn("Create Proxy failed for {} with exception {}",objectName,e.getMessage(),e); continue; } } }
This method will create all the proxies for a given DistributedMember. It does not throw any exception to its caller. It handles the error and logs error messages It will be called from GII or when a member joins the system
public boolean isDistinct(){ return distinct; }
This method was generated by MyBatis Generator. This method corresponds to the database table user_roles
public void clear(){ pending.clear(); mTileCache.clear(); mCtx.unbindService(this); }
Clear out memory related to tracking map tiles.
public double nextDouble(double alpha,double beta){ double a=alpha; double b=beta; if ((a_setup != a) || (b_setup != b)) { double mpa, mmb, mode; double amb; double a_, b_, a_1, b_1, pl; double help_1, help_2; amb=a * a - b * b; samb=Math.sqrt(amb); mode=b / samb; help_1=a * Math.sqrt(2.0 * samb + 1.0); help_2=b * (samb + 1.0); mpa=(help_2 + help_1) / amb; mmb=(help_2 - help_1) / amb; a_=mpa - mode; b_=-mmb + mode; hr=-1.0 / (-a * mpa / Math.sqrt(1.0 + mpa * mpa) + b); hl=1.0 / (-a * mmb / Math.sqrt(1.0 + mmb * mmb) + b); a_1=a_ - hr; b_1=b_ - hl; mmb_1=mode - b_1; mpa_1=mode + a_1; s=(a_ + b_); pm=(a_1 + b_1) / s; pr=hr / s; pmr=pm + pr; a_setup=a; b_setup=b; } for (; ; ) { u=randomGenerator.nextDouble(); v=randomGenerator.nextDouble(); if (u <= pm) { x=mmb_1 + u * s; if (Math.log(v) <= (-a * Math.sqrt(1.0 + x * x) + b * x + samb)) break; } else { if (u <= pmr) { e=-Math.log((u - pm) / pr); x=mpa_1 + hr * e; if ((Math.log(v) - e) <= (-a * Math.sqrt(1.0 + x * x) + b * x + samb)) break; } else { e=Math.log((u - pmr) / (1.0 - pmr)); x=mmb_1 + hl * e; if ((Math.log(v) + e) <= (-a * Math.sqrt(1.0 + x * x) + b * x + samb)) break; } } } return (x); }
Returns a hyperbolic distributed random number; bypasses the internal state.