code
stringlengths
10
174k
nl
stringlengths
3
129k
public static boolean isMacOSX(){ return Utils.getOSMatches("Mac OS X"); }
Determines whether the system is a Mac os x.
public SQLEditorSourceViewerConfiguration(SQLEditorBase editor,IPreferenceStore preferenceStore){ super(preferenceStore); this.editor=editor; this.ruleManager=editor.getRuleManager(); this.completionProcessor=new SQLCompletionProcessor(editor); this.hyperlinkDetector=new SQLHyperlinkDetector(editor,editor.getSyntaxManager()); }
Constructs an instance of this class with the given SQLEditor to configure.
void paste(String sXML,int mode) throws Exception { DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance(); factory.setValidating(true); Document doc=factory.newDocumentBuilder().parse(new org.xml.sax.InputSource(new StringReader(sXML))); doc.normalize(); NodeList nodelist=doc.getElementsByTagName("VARIABLE"); ArrayList<String> sBaseNames=new ArrayList<String>(); Instances instances=new Instances(m_Instances,0); int nBase=instances.numAttributes(); for (int iNode=0; iNode < nodelist.getLength(); iNode++) { ArrayList<Node> valueslist; valueslist=selectElements(nodelist.item(iNode),"OUTCOME"); int nValues=valueslist.size(); ArrayList<String> nomStrings=new ArrayList<String>(nValues + 1); for (int iValue=0; iValue < nValues; iValue++) { Node node=valueslist.get(iValue).getFirstChild(); String sValue=((CharacterData)(node)).getData(); if (sValue == null) { sValue="Value" + (iValue + 1); } nomStrings.add(sValue); } ArrayList<Node> nodelist2; nodelist2=selectElements(nodelist.item(iNode),"NAME"); if (nodelist2.size() == 0) { throw new Exception("No name specified for variable"); } String sBaseName=((CharacterData)(nodelist2.get(0).getFirstChild())).getData(); sBaseNames.add(sBaseName); String sNodeName=sBaseName; if (getNode2(sNodeName) >= 0) { sNodeName="Copy of " + sBaseName; } int iAttempt=2; while (getNode2(sNodeName) >= 0) { sNodeName="Copy (" + iAttempt + ") of "+ sBaseName; iAttempt++; } Attribute att=new Attribute(sNodeName,nomStrings); instances.insertAttributeAt(att,instances.numAttributes()); valueslist=selectElements(nodelist.item(iNode),"PROPERTY"); nValues=valueslist.size(); int nPosX=iAttempt * 10; int nPosY=iAttempt * 10; for (int iValue=0; iValue < nValues; iValue++) { Node node=valueslist.get(iValue).getFirstChild(); String sValue=((CharacterData)(node)).getData(); if (sValue.startsWith("position")) { int i0=sValue.indexOf('('); int i1=sValue.indexOf(','); int i2=sValue.indexOf(')'); String sX=sValue.substring(i0 + 1,i1).trim(); String sY=sValue.substring(i1 + 1,i2).trim(); try { nPosX=(Integer.parseInt(sX) + iAttempt * 10); nPosY=(Integer.parseInt(sY) + iAttempt * 10); } catch ( NumberFormatException e) { System.err.println("Wrong number format in position :(" + sX + ","+ sY+ ")"); } } } if (mode == EXECUTE) { m_nPositionX.add(nPosX); m_nPositionY.add(nPosY); } } ArrayList<Node> nodelist2; Estimator[][] distributions=new Estimator[nBase + sBaseNames.size()][]; ParentSet[] parentsets=new ParentSet[nBase + sBaseNames.size()]; for (int iNode=0; iNode < nBase; iNode++) { distributions[iNode]=m_Distributions[iNode]; parentsets[iNode]=m_ParentSets[iNode]; } if (mode == EXECUTE) { m_Instances=instances; } for (int iNode=0; iNode < sBaseNames.size(); iNode++) { String sName=sBaseNames.get(iNode); Element definition=getDefinition(doc,sName); parentsets[nBase + iNode]=new ParentSet(); nodelist2=selectElements(definition,"GIVEN"); for (int iParent=0; iParent < nodelist2.size(); iParent++) { Node parentName=nodelist2.get(iParent).getFirstChild(); String sParentName=((CharacterData)(parentName)).getData(); int nParent=-1; for (int iBase=0; iBase < sBaseNames.size(); iBase++) { if (sParentName.equals(sBaseNames.get(iBase))) { nParent=nBase + iBase; } } if (nParent < 0) { nParent=getNode(sParentName); } parentsets[nBase + iNode].addParent(nParent,instances); } int nCardinality=parentsets[nBase + iNode].getCardinalityOfParents(); int nValues=instances.attribute(nBase + iNode).numValues(); distributions[nBase + iNode]=new Estimator[nCardinality]; for (int i=0; i < nCardinality; i++) { distributions[nBase + iNode][i]=new DiscreteEstimatorBayes(nValues,0.0f); } String sTable=getContent((Element)selectElements(definition,"TABLE").get(0)); sTable=sTable.replaceAll("\\n"," "); StringTokenizer st=new StringTokenizer(sTable.toString()); for (int i=0; i < nCardinality; i++) { DiscreteEstimatorBayes d=(DiscreteEstimatorBayes)distributions[nBase + iNode][i]; for (int iValue=0; iValue < nValues; iValue++) { String sWeight=st.nextToken(); d.addValue(iValue,new Double(sWeight).doubleValue()); } } if (mode == EXECUTE) { m_nEvidence.add(nBase + iNode,-1); m_fMarginP.add(nBase + iNode,new double[getCardinality(nBase + iNode)]); } } if (mode == EXECUTE) { m_Distributions=distributions; m_ParentSets=parentsets; } if (mode == EXECUTE && m_bNeedsUndoAction) { addUndoAction(new PasteAction(sXML,nBase)); } }
Apply paste operation with XMLBIF fragment. Depending on the paste mode, the nodes are actually added to the network or it is just tested that the nodes can be added to the network.
public String toString(){ if (size() == 0) { return "{}"; } StringBuilder buf=new StringBuilder(32 * size()); buf.append('{'); MapIterator it=mapIterator(); boolean hasNext=it.hasNext(); while (hasNext) { Object key=it.next(); Object value=it.getValue(); buf.append(key == this ? "(this Map)" : key).append('=').append(value == this ? "(this Map)" : value); hasNext=it.hasNext(); if (hasNext) { buf.append(',').append(' '); } } buf.append('}'); return buf.toString(); }
Gets the map as a String.
public synchronized boolean add(E e){ modCount++; ensureCapacityHelper(elementCount + 1); elementData[elementCount++]=e; return true; }
Appends the specified element to the end of this Vector.
private TestResult parse(List<String> test,String name) throws Exception { List<String> id=new ArrayList<>(); Iterator<String> iter=test.iterator(); boolean shouldPass=true; boolean channelTest=false; while (iter.hasNext()) { String line=iter.next(); String[] args=line.split("%%"); switch (args[0]) { case "subscribe": handleSubscribe(args); id.add(args[2]); break; case "channel": channelTest=true; handleChannel(args,iter,name,shouldPass); break; case "echochannel": handleEchoChannel(args); break; case "await": switch (args[1]) { case "terminal": handleAwaitTerminal(args); break; case "atLeast": handleAwaitAtLeast(args); break; case "no_events": handleAwaitNoEvents(args); break; default : break; } break; case "assert": switch (args[1]) { case "no_error": handleNoError(args); break; case "error": handleError(args); break; case "received": handleReceived(args); break; case "received_n": handleReceivedN(args); break; case "received_at_least": handleReceivedAtLeast(args); break; case "completed": handleCompleted(args); break; case "no_completed": handleNoCompleted(args); break; case "canceled": handleCancelled(args); break; } break; case "take": handleTake(args); break; case "request": handleRequest(args); break; case "cancel": handleCancel(args); break; case "EOF": handleEOF(); break; case "pass": shouldPass=true; break; case "fail": shouldPass=false; break; default : break; } } if (id.size() > 0) { boolean hasPassed=true; for (String str : id) { if (payloadSubscribers.get(str) != null) hasPassed=hasPassed && payloadSubscribers.get(str).hasPassed(); else hasPassed=hasPassed && fnfSubscribers.get(str).hasPassed(); } if ((shouldPass && hasPassed) || (!shouldPass && !hasPassed)) return TestResult.PASS; else return TestResult.FAIL; } else if (channelTest) return TestResult.CHANNEL; else throw new Exception("There is no subscriber in this test"); }
Parses through the commands for each test, and calls handlers that execute the commands.
public final void init(Key key) throws InvalidKeyException, ExemptionMechanismException { done=false; initialized=false; keyStored=key; exmechSpi.engineInit(key); initialized=true; }
Initializes this exemption mechanism with a key. <p>If this exemption mechanism requires any algorithm parameters that cannot be derived from the given <code>key</code>, the underlying exemption mechanism implementation is supposed to generate the required parameters itself (using provider-specific default values); in the case that algorithm parameters must be specified by the caller, an <code>InvalidKeyException</code> is raised.
public void close() throws IOException { is.close(); }
Closes pcap stream handle.
@Override public void fromBytes(ByteBuf buf){ revealHiddenBlocks=buf.readBoolean(); hand=EnumHand.values()[buf.readByte()]; }
Convert from the supplied buffer into your specific message type
@CanIgnoreReturnValue public Builder<K,V> put(Range<K> range,V value){ checkNotNull(range); checkNotNull(value); checkArgument(!range.isEmpty(),"Range must not be empty, but was %s",range); if (!keyRanges.complement().encloses(range)) { for ( Entry<Range<K>,V> entry : rangeMap.asMapOfRanges().entrySet()) { Range<K> key=entry.getKey(); if (key.isConnected(range) && !key.intersection(range).isEmpty()) { throw new IllegalArgumentException("Overlapping ranges: range " + range + " overlaps with entry "+ entry); } } } keyRanges.add(range); rangeMap.put(range,value); return this; }
Associates the specified range with the specified value.
public XBeeMessage(byte[] a,int l){ super(String.valueOf(a),l); }
This ctor interprets the byte array as a sequence of characters to send.
public boolean sendViaDataSocket(byte[] bytes,int start,int len){ if (dataOutputStream == null) { Log.i(TAG,"Can't send via null dataOutputStream"); return false; } if (len == 0) { return true; } try { dataOutputStream.write(bytes,start,len); } catch ( IOException e) { Log.i(TAG,"Couldn't write output stream for data socket"); Log.i(TAG,e.toString()); return false; } localDataSocket.reportTraffic(len); return true; }
Sends a byte array over the already-established data socket
public int maximumMuLambdaDivisor(){ return 2; }
lambda should be no SMALLER than mu times this value. This varies between (mu,lambda) (where it's 2) and (mu + lambda) (where it's 1).
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:31.251 -0500",hash_original_method="8FB6A7484D99181743947553B04591B0",hash_generated_method="4D54DAC6709D8BC4B1289684F495D52B") public static int reverse(int i){ return i; }
Reverses the order of the bits of the specified integer.
private int decodeIcs(SingleChannelElement sce,boolean commonWindow,boolean scaleFlag){ int ret; Pulse pulse=new Pulse(); TemporalNoiseShaping tns=sce.tns; IndividualChannelStream ics=sce.ics; float out[]=sce.coeffs; boolean eldSyntax=ac.oc[1].m4ac.objectType == AOT_ER_AAC_ELD; boolean erSyntax=ac.oc[1].m4ac.objectType == AOT_ER_AAC_LC || ac.oc[1].m4ac.objectType == AOT_ER_AAC_LTP || ac.oc[1].m4ac.objectType == AOT_ER_AAC_LD || ac.oc[1].m4ac.objectType == AOT_ER_AAC_ELD; int globalGain=br.read(8); if (!commonWindow && !scaleFlag) { if (decodeIcsInfo(ics) < 0) { return AAC_ERROR; } } ret=decodeBandTypes(sce.bandType,sce.bandTypeRunEnd,ics); if (ret < 0) { return ret; } ret=decodeScalefactors(sce.sf,globalGain,ics,sce.bandType,sce.bandTypeRunEnd); if (ret < 0) { return ret; } boolean pulsePresent=false; if (!scaleFlag) { if (!eldSyntax && (pulsePresent=br.readBool())) { if (ics.windowSequence[0] == EIGHT_SHORT_SEQUENCE) { log.error(String.format("Pulse tool not allowed in eight short sequence")); return AAC_ERROR; } if (decodePulses(pulse,ics.swbOffset,ics.numSwb) != 0) { log.error(String.format("Pulse data corrupt or invalid")); return AAC_ERROR; } } tns.present=br.readBool(); if (tns.present && !erSyntax) { if (decodeTns(tns,ics) < 0) { return AAC_ERROR; } } if (!eldSyntax && br.readBool()) { return AAC_ERROR; } if (tns.present && erSyntax) { if (decodeTns(tns,ics) < 0) { return AAC_ERROR; } } } if (decodeSpectrumAndDequant(out,sce.sf,pulsePresent,pulse,ics,sce.bandType) < 0) { return AAC_ERROR; } if (ac.oc[1].m4ac.objectType == AOT_AAC_MAIN && !commonWindow) { applyPrediction(sce); } return 0; }
Decode an individual_channel_stream payload; reference: table 4.44.
public boolean domainMatch(String host,String domain){ boolean match=host.equals(domain) || (domain.startsWith(".") && host.endsWith(domain)); return match; }
Performs domain-match as defined by the RFC2965. <p> Host A's name domain-matches host B's if <ol> <ul>their host name strings string-compare equal; or</ul> <ul>A is a HDN string and has the form NB, where N is a non-empty name string, B has the form .B', and B' is a HDN string. (So, x.y.com domain-matches .Y.com but not Y.com.)</ul> </ol>
public static int longestPrefix(final String... strings){ return longestPrefix(0,strings); }
Return the length of the longest common prefix of the supplied strings.
public void removeSimulationListener(MobsimListener listener){ if (listener instanceof MobsimInitializedListener) { removeSimulationInitializedListener((MobsimInitializedListener)listener); } if (listener instanceof MobsimBeforeSimStepListener) { removeSimulationBeforeSimStepListener((MobsimBeforeSimStepListener)listener); } if (listener instanceof MobsimAfterSimStepListener) { removeSimulationAfterSimStepListener((MobsimAfterSimStepListener)listener); } if (listener instanceof MobsimBeforeCleanupListener) { removeSimulationBeforeCleanupListener((MobsimBeforeCleanupListener)listener); } }
Removes the SimulationListener from all ListenerLists that it supports.
public static boolean hasFunction(String name){ return s_functionTable.containsKey(name); }
Indicates if a function of the given name is included in the function table.
public static void loadLibraryFromJar(String path) throws IOException { if (!path.startsWith("/")) { throw new IllegalArgumentException("The path has to be absolute (start with '/')."); } String[] parts=path.split("/"); String filename=(parts.length > 1) ? parts[parts.length - 1] : null; String prefix=""; String suffix=null; if (filename != null) { parts=filename.split("\\.",2); prefix=parts[0]; suffix=(parts.length > 1) ? "." + parts[parts.length - 1] : null; } if (filename == null || prefix.length() < 3) { throw new IllegalArgumentException("The filename has to be at least 3 characters long."); } File temp=File.createTempFile(prefix,suffix); temp.deleteOnExit(); if (!temp.exists()) { throw new FileNotFoundException("File " + temp.getAbsolutePath() + " does not exist."); } byte[] buffer=new byte[1024]; int readBytes; InputStream is=NativeUtils.class.getResourceAsStream(path); if (is == null) { throw new FileNotFoundException("File " + path + " was not found inside JAR."); } OutputStream os=new FileOutputStream(temp); try { while ((readBytes=is.read(buffer)) != -1) { os.write(buffer,0,readBytes); } } finally { os.close(); is.close(); } System.load(temp.getAbsolutePath()); }
Loads library from current JAR archive The file from JAR is copied into system temporary directory and then loaded. The temporary file is deleted after exiting. Method uses String as filename because the pathname is "abstract", not system-dependent.
private static void restart(){ onExit(); System.exit(0); }
Restarts the launcher (app).
public static double[] v3Combine(double[] a,double[] b,double aScale,double bScale){ return new double[]{aScale * a[0] + bScale * b[0],aScale * a[1] + bScale * b[1],aScale * a[2] + bScale * b[2]}; }
From: http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp
public static Key<CommitLogCheckpoint> createKey(DateTime checkpointTime){ return Key.create(CommitLogCheckpointRoot.getKey(),CommitLogCheckpoint.class,checkpointTime.getMillis()); }
Creates a key for the CommitLogCheckpoint for the given wall time.
private NullValue(){ super(ObjectReference.nullReference()); }
Construct an initially null object value
public synchronized BasicNetwork clone(){ BasicNetwork clone=(BasicNetwork)super.clone(); clone.setVerticies(new HashSet<Vertex>(getVerticies())); clone.setVerticiesById(new HashMap<Number,Vertex>(getVerticiesById())); clone.setVerticiesByData(new HashMap<Object,Vertex>(getVerticiesByData())); return clone; }
Return a thread safe copy of the network.
public boolean isCancel(){ return m_cancel; }
Cancel button pressed
public GraphNode(String name){ setName(name); }
Constructs a new Tetrad node with the given (non-null) string.
@Override protected void keyTyped(char par1,int par2){ proxyBox.textboxKeyTyped(par1,par2); if (par2 == 28 || par2 == 156) actionPerformed((GuiButton)buttonList.get(1)); }
Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
private void updateSyncState(){ boolean isSyncEnabled=AndroidSyncSettings.isSyncEnabled(getActivity()); mSyncSwitchPreference.setChecked(isSyncEnabled); mSyncSwitchPreference.setEnabled(canDisableSync()); updateSyncStateFromSwitch(); }
Update the state of all settings from sync. This sets the state of the sync switch from external sync state and then calls updateSyncStateFromSwitch, which uses that as its source of truth.
void removeMarkOccurrencesHighlight(Object tag){ removeListHighlight(markedOccurrences,tag); }
Removes a "marked occurrences" highlight from the view.
public Regression(Class<?> theClass){ if (theClass == null) { throw new NullPointerException(); } String relative=theClass.getName().replace('.',File.separatorChar) + FILE_EXTENSION; m_RefFile=new File(getRoot(),relative); m_Output=new StringBuffer(); }
Creates a new <code>Regression</code> instance for the supplied class.
public boolean shouldBeConflated(){ return this.conflate; }
Returns whether the object should be conflated
public static String toString(URI uri,String encoding) throws IOException { return toString(uri,Charsets.toCharset(encoding)); }
Gets the contents at the given URI.
protected ExecutionError(@Nullable String message){ super(message); }
Creates a new instance with the given detail message.
public RequestBuilder withTimeout(int timeout){ Preconditions.checkArgument(NumUtil.isIntBetween(timeout,Common.MIN_COMMAND_TIMEOUT_SEC,Common.MAX_COMMAND_TIMEOUT_SEC),String.format("Timeout is not in range %d to %d",Common.MIN_COMMAND_TIMEOUT_SEC,Common.MAX_COMMAND_TIMEOUT_SEC)); this.timeout=timeout; return this; }
Sets command timeout
public boolean matchesExactly(Collection<Issue> issues,List<String> messages){ Collection<Issue> issueCopy=new LinkedList<>(issues); Collection<IssueMatcher> matcherCopy=new LinkedList<>(issueMatchers); performMatching(issueCopy,matcherCopy,messages); if (inverted) { if (issueCopy.isEmpty() && matcherCopy.isEmpty()) { if (issueMatchers.isEmpty() && messages != null) { messages.add("Expected issues, but got nothing"); } else { explainIssues(issues,messages,inverted); explainExpectations(issueMatchers,messages,inverted); } return false; } } else { if (!issueCopy.isEmpty() || !matcherCopy.isEmpty()) { explainIssues(issueCopy,messages,inverted); explainExpectations(matcherCopy,messages,inverted); return false; } } return true; }
Matches the expectations in the added issues matchers against the given issues.
private void filter(int i,SentenceFilteredTrie trieNode,boolean lastWasNT){ if (i >= tokens.length) return; Trie unfilteredTrieNode=trieNode.unfilteredTrieNode; if (unfilteredTrieNode.getChildren() == null) { return; } Trie trie=unfilteredTrieNode.match(tokens[i]); if (trie != null) { SentenceFilteredTrie nextFilteredTrie=trieNode.match(tokens[i]); if (nextFilteredTrie == null) { nextFilteredTrie=new SentenceFilteredTrie(trie); trieNode.children.put(tokens[i],nextFilteredTrie); } filter(i + 1,nextFilteredTrie,false); } HashMap<Integer,? extends Trie> children=unfilteredTrieNode.getChildren(); if (children != null) { for ( int label : children.keySet()) { if (label < 0) { SentenceFilteredTrie nextFilteredTrie=trieNode.match(label); if (nextFilteredTrie == null) { nextFilteredTrie=new SentenceFilteredTrie(unfilteredTrieNode.match(label)); trieNode.children.put(label,nextFilteredTrie); } int maxJ=lastWasNT ? (i + 1) : tokens.length; for (int j=i + 1; j <= maxJ; j++) { filter(j,nextFilteredTrie,true); } } } } }
Matches rules against the sentence. Intelligently handles chains of sequential nonterminals. Marks arcs that are traversable for this sentence.
protected void respond(ClaimBuilder cb){ cb.put(KEY_TYPE,getType()); }
Exports the response state, as preparation for triggering the challenge.
public static QuarkMaterializeCluster create(RelOptPlannerHolder plannerHolder,RexBuilder rexBuilder){ return new QuarkMaterializeCluster(plannerHolder,rexBuilder.getTypeFactory(),rexBuilder,new AtomicInteger(0),new HashMap<String,RelNode>()); }
Creates a cluster.
public RSSEnclosure(String url,String type,String length){ this.setUrl(url); this.setType(type); this.setLength(length); }
Creates a new instance of RSSEnclosure
public void startElement(StylesheetHandler handler,String uri,String localName,String rawName,Attributes attributes) throws org.xml.sax.SAXException { try { ElemTemplateElement p=handler.getElemTemplateElement(); boolean excludeXSLDecl=false; boolean isLREAsStyleSheet=false; if (null == p) { XSLTElementProcessor lreProcessor=handler.popProcessor(); XSLTElementProcessor stylesheetProcessor=handler.getProcessorFor(Constants.S_XSLNAMESPACEURL,"stylesheet","xsl:stylesheet"); handler.pushProcessor(lreProcessor); Stylesheet stylesheet; try { stylesheet=getStylesheetRoot(handler); } catch ( TransformerConfigurationException tfe) { throw new TransformerException(tfe); } SAXSourceLocator slocator=new SAXSourceLocator(); Locator locator=handler.getLocator(); if (null != locator) { slocator.setLineNumber(locator.getLineNumber()); slocator.setColumnNumber(locator.getColumnNumber()); slocator.setPublicId(locator.getPublicId()); slocator.setSystemId(locator.getSystemId()); } stylesheet.setLocaterInfo(slocator); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); isLREAsStyleSheet=true; AttributesImpl stylesheetAttrs=new AttributesImpl(); AttributesImpl lreAttrs=new AttributesImpl(); int n=attributes.getLength(); for (int i=0; i < n; i++) { String attrLocalName=attributes.getLocalName(i); String attrUri=attributes.getURI(i); String value=attributes.getValue(i); if ((null != attrUri) && attrUri.equals(Constants.S_XSLNAMESPACEURL)) { stylesheetAttrs.addAttribute(null,attrLocalName,attrLocalName,attributes.getType(i),attributes.getValue(i)); } else if ((attrLocalName.startsWith("xmlns:") || attrLocalName.equals("xmlns")) && value.equals(Constants.S_XSLNAMESPACEURL)) { } else { lreAttrs.addAttribute(attrUri,attrLocalName,attributes.getQName(i),attributes.getType(i),attributes.getValue(i)); } } attributes=lreAttrs; try { stylesheetProcessor.setPropertiesFromAttributes(handler,"stylesheet",stylesheetAttrs,stylesheet); } catch ( Exception e) { if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS,null)); } else { throw new org.xml.sax.SAXException(e); } } handler.pushElemTemplateElement(stylesheet); ElemTemplate template=new ElemTemplate(); if (slocator != null) template.setLocaterInfo(slocator); appendAndPush(handler,template); XPath rootMatch=new XPath("/",stylesheet,stylesheet,XPath.MATCH,handler.getStylesheetProcessor().getErrorListener()); template.setMatch(rootMatch); stylesheet.setTemplate(template); p=handler.getElemTemplateElement(); excludeXSLDecl=true; } XSLTElementDef def=getElemDef(); Class classObject=def.getClassObject(); boolean isExtension=false; boolean isComponentDecl=false; boolean isUnknownTopLevel=false; while (null != p) { if (p instanceof ElemLiteralResult) { ElemLiteralResult parentElem=(ElemLiteralResult)p; isExtension=parentElem.containsExtensionElementURI(uri); } else if (p instanceof Stylesheet) { Stylesheet parentElem=(Stylesheet)p; isExtension=parentElem.containsExtensionElementURI(uri); if ((false == isExtension) && (null != uri) && (uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL) || uri.equals(Constants.S_BUILTIN_OLD_EXTENSIONS_URL))) { isComponentDecl=true; } else { isUnknownTopLevel=true; } } if (isExtension) break; p=p.getParentElem(); } ElemTemplateElement elem=null; try { if (isExtension) { elem=new ElemExtensionCall(); } else if (isComponentDecl) { elem=(ElemTemplateElement)classObject.newInstance(); } else if (isUnknownTopLevel) { elem=(ElemTemplateElement)classObject.newInstance(); } else { elem=(ElemTemplateElement)classObject.newInstance(); } elem.setDOMBackPointer(handler.getOriginatingNode()); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport(),excludeXSLDecl); if (elem instanceof ElemLiteralResult) { ((ElemLiteralResult)elem).setNamespace(uri); ((ElemLiteralResult)elem).setLocalName(localName); ((ElemLiteralResult)elem).setRawName(rawName); ((ElemLiteralResult)elem).setIsLiteralResultAsStylesheet(isLREAsStyleSheet); } } catch ( InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT,null,ie); } catch ( IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT,null,iae); } setPropertiesFromAttributes(handler,rawName,attributes,elem); if (!isExtension && (elem instanceof ElemLiteralResult)) { isExtension=((ElemLiteralResult)elem).containsExtensionElementURI(uri); if (isExtension) { elem=new ElemExtensionCall(); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport()); ((ElemLiteralResult)elem).setNamespace(uri); ((ElemLiteralResult)elem).setLocalName(localName); ((ElemLiteralResult)elem).setRawName(rawName); setPropertiesFromAttributes(handler,rawName,attributes,elem); } } appendAndPush(handler,elem); } catch ( TransformerException te) { throw new org.xml.sax.SAXException(te); } }
Receive notification of the start of an element.
public static byte parseByte(CharSequence csq){ return parseByte(csq,10); }
Parses the whole specified character sequence as a signed decimal <code>byte</code>.
public final void checkAssert(final QuadConsumer<A,B,C,D> property){ check(null); }
Checks a property across a random sample of possible values where falsification is indicated by an unchecked exception such as an assertion
@Override public String toString(){ return String.valueOf(value); }
Returns a string containing a concise, human-readable description of this boolean.
public Vector3d mulTranspose(Matrix3dc mat){ return mul(mat,this); }
Multiply the transpose of the given matrix with this Vector3f and store the result in <code>this</code>.
public PersonalityInsights(final String versionDate,String username,String password){ this(versionDate); setUsernameAndPassword(username,password); }
Instantiates a new personality insights service by username and password.
public ArrayLongCompressed(long[] longs,int offset,int length){ long mask=0x0; for (int i=0; i < length; i++) { mask|=longs[offset + i]; } int leadingClearBits=0; int trailingClearBits=0; while (((mask & (1 << (BIT_LENGTH - leadingClearBits - 1))) == 0) && (leadingClearBits < BIT_LENGTH)) { leadingClearBits++; } while (((mask & (1 << trailingClearBits)) == 0) && (trailingClearBits < (BIT_LENGTH - leadingClearBits))) { trailingClearBits++; } init(length,BIT_LENGTH - leadingClearBits - trailingClearBits,trailingClearBits); for (int i=0; i < length; i++) { set(i,longs[offset + i]); } }
Create <code>LongArrayCompressed</code> from longs representing the data to be stored in compressed form (from offset to offset+length).
private int findProductRow(int M_Product_ID){ DefaultTableModel model=(DefaultTableModel)dialog.getMiniTable().getModel(); KeyNamePair kp; for (int i=0; i < model.getRowCount(); i++) { kp=(KeyNamePair)model.getValueAt(i,4); if (kp.getKey() == M_Product_ID) { return (i); } } return (-1); }
Finds the row where a given product is. If the product is not found in the table -1 is returned.
public static void UF10(double[] x,double[] f,int nx){ int count1=0; int count2=0; int count3=0; double sum1=0.0; double sum2=0.0; double sum3=0.0; double yj; double hj; for (int j=3; j <= nx; j++) { yj=x[j - 1] - 2.0 * x[1] * Math.sin(2.0 * PI * x[0] + j * PI / nx); hj=4.0 * yj * yj - Math.cos(8.0 * PI * yj) + 1.0; if (j % 3 == 1) { sum1+=hj; count1++; } else if (j % 3 == 2) { sum2+=hj; count2++; } else { sum3+=hj; count3++; } } f[0]=Math.cos(0.5 * PI * x[0]) * Math.cos(0.5 * PI * x[1]) + 2.0 * sum1 / (double)count1; f[1]=Math.cos(0.5 * PI * x[0]) * Math.sin(0.5 * PI * x[1]) + 2.0 * sum2 / (double)count2; f[2]=Math.sin(0.5 * PI * x[0]) + 2.0 * sum3 / (double)count3; }
Evaluates the UF10 problem.
@Override public void introspect(ContextH3 context){ if (_infoRef.get() != null) { return; } FieldInfoH3[] fieldInfo=new FieldInfoH3[1]; fieldInfo[0]=new FieldInfoH3("ordinal"); ClassInfoH3 classInfo=new ClassInfoH3(_type.getName(),ClassTypeH3.ENUM,fieldInfo,_sequence); _infoRef.compareAndSet(null,classInfo); }
Introspect the class.
private static boolean overflowInParse(long current,int digit,int radix){ if (current >= 0) { if (current < maxValueDivs[radix]) { return false; } if (current > maxValueDivs[radix]) { return true; } return (digit > maxValueMods[radix]); } return true; }
Returns true if (current * radix) + digit is a number too large to be represented by an unsigned long. This is useful for detecting overflow while parsing a string representation of a number. Does not verify whether supplied radix is valid, passing an invalid radix will give undefined results or an ArrayIndexOutOfBoundsException.
public int maxReceiver(){ List<Element> kids=root.getChildren("receiver"); int max=-1; for (int i=0; i < kids.size(); i++) { Attribute a=kids.get(i).getAttribute("number"); if (a == null) { continue; } int n=-1; try { n=a.getIntValue(); } catch ( org.jdom2.DataConversionException e) { log.error("in maxReceiver",e); } max=Math.max(max,n); } return max; }
FInd the highest numbered receiver in the file
public void addChild(FXGNode child){ if (content == null) { if (child instanceof CDATANode && TextHelper.ignorableWhitespace(((CDATANode)child).content)) { return; } } else { super.addChild(child); } }
Check child node to ensure that exception isn't thrown for ignorable white spaces.
public BufferedDocumentScanner(int size){ Assert.isTrue(size >= 1); fBuffer=new char[size]; }
Creates a new buffered document scanner. The buffer size is set to the given number of characters.
private static void createParents(File file){ FileMisc.mkdirs(file.getParentFile()); }
Creates all parent files for the given file.
public NotificationChain basicSetCatchVariable(CatchVariable newCatchVariable,NotificationChain msgs){ CatchVariable oldCatchVariable=catchVariable; catchVariable=newCatchVariable; if (eNotificationRequired()) { ENotificationImpl notification=new ENotificationImpl(this,Notification.SET,N4JSPackage.CATCH_BLOCK__CATCH_VARIABLE,oldCatchVariable,newCatchVariable); if (msgs == null) msgs=notification; else msgs.add(notification); } return msgs; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void importLegacySettings(){ }
For compatibility with old code style settings stored in CodeStyleSettings.
public EmbeddedJMSResource(){ this(false); }
Create a default EmbeddedJMSResource
public void update(final long item,final long count){ if (count == 0) return; if (count < 0) { throw new SketchesArgumentException("Count may not be negative"); } this.streamLength+=count; hashMap.adjustOrPutValue(item,count); if (getNumActiveItems() > curMapCap) { if (hashMap.getLgLength() < lgMaxMapSize) { hashMap.resize(2 * hashMap.getLength()); curMapCap=hashMap.getCapacity(); } else { offset+=hashMap.purge(sampleSize); if (getNumActiveItems() > getMaximumMapCapacity()) { throw new SketchesStateException("Purge did not reduce active items."); } } } }
Update this sketch with a item and a positive frequency count.
public long numCqsCreated(){ return this.cqService.getCqServiceVsdStats().getNumCqsCreated(); }
Returns number of CQs created.
public DdlException(){ super(); }
Creates a new empty exception object.
public ArrayIndexOutOfBoundsException(int sourceLength,int index){ super("length=" + sourceLength + "; index="+ index); }
Used internally for consistent high-quality error reporting.
public StackScroller(Context context){ mFlywheel=true; mScrollerX=new SplineStackScroller(context); mScrollerY=new SplineStackScroller(context); initContants(); }
Creates an StackScroller with a viscous fluid scroll interpolator and flywheel.
public void requestUpdateFromLayout(){ }
Request an update on status. <P> Since status is continually being updated, this isn't active now. Eventually, we may want to have this move the related AIU to the top of the polling queue.
public FileEntry(BaseEntry sourceEntry){ super(sourceEntry); }
Constructs a new entry by doing a shallow copy from another BaseEntry instance.
public boolean isResetValues(){ Boolean result=(Boolean)eval(RESET_VALUES,resetValues); return ((result != null) ? result : false); }
<p class="changed_added_2_2"> Return the resetValues status of this behavior.</p>
@Override protected void verifyMatch(Object target,Object deserialized){ CronTriggerImpl targetCronTrigger=(CronTriggerImpl)target; CronTriggerImpl deserializedCronTrigger=(CronTriggerImpl)deserialized; assertNotNull(deserializedCronTrigger); assertEquals(targetCronTrigger.getName(),deserializedCronTrigger.getName()); assertEquals(targetCronTrigger.getGroup(),deserializedCronTrigger.getGroup()); assertEquals(targetCronTrigger.getJobName(),deserializedCronTrigger.getJobName()); assertEquals(targetCronTrigger.getJobGroup(),deserializedCronTrigger.getJobGroup()); assertEquals(targetCronTrigger.getEndTime(),deserializedCronTrigger.getEndTime()); assertEquals(targetCronTrigger.getCalendarName(),deserializedCronTrigger.getCalendarName()); assertEquals(targetCronTrigger.getDescription(),deserializedCronTrigger.getDescription()); assertEquals(targetCronTrigger.getJobDataMap(),deserializedCronTrigger.getJobDataMap()); assertEquals(targetCronTrigger.getCronExpression(),deserializedCronTrigger.getCronExpression()); }
Verify that the target object and the object we just deserialized match.
private void tokenize(InputSource is) throws SAXException, IOException, MalformedURLException { if (is == null) { throw new IllegalArgumentException("Null input."); } if (is.getByteStream() == null && is.getCharacterStream() == null) { String systemId=is.getSystemId(); if (systemId == null) { throw new IllegalArgumentException("No byte stream, no character stream nor URI."); } if (entityResolver != null) { is=entityResolver.resolveEntity(is.getPublicId(),systemId); } if (is.getByteStream() == null || is.getCharacterStream() == null) { is=new InputSource(); is.setSystemId(systemId); is.setByteStream(new URL(systemId).openStream()); } } tokenizer.tokenize(is); }
Tokenizes the input source.
@Override public void processingInstruction(String target,String data) throws SAXException { writeText4Links(); write("<?"); write(target); write(' '); write(data); write("?>"); if (elementLevel < 1) { write('\n'); } super.processingInstruction(target,data); }
Write a processing instruction. <p> Pass the event on down the filter chain for further processing.
public double kineticEnergy(){ return 0.5 * mass * (vx * vx + vy * vy); }
Returns the kinetic energy of this particle. The kinetic energy is given by the formula 1/2 <em>m</em> <em>v</em><sup>2</sup>, where <em>m</em> is the mass of this particle and <em>v</em> is its velocity.
public void close() throws IOException { _stream.close(); }
Closes the stream.
public Class toClass(ClassLoader loader,ProtectionDomain domain) throws CannotCompileException { ClassPool cp=getClassPool(); if (loader == null) loader=cp.getClassLoader(); return cp.toClass(this,loader,domain); }
Converts this class to a <code>java.lang.Class</code> object. Once this method is called, further modifications are not allowed any more. <p>The class file represented by this <code>CtClass</code> is loaded by the given class loader to construct a <code>java.lang.Class</code> object. Since a private method on the class loader is invoked through the reflection API, the caller must have permissions to do that. <p>An easy way to obtain <code>ProtectionDomain</code> object is to call <code>getProtectionDomain()</code> in <code>java.lang.Class</code>. It returns the domain that the class belongs to. <p>This method is provided for convenience. If you need more complex functionality, you should write your own class loader. <p>Note: this method calls <code>toClass()</code> in <code>ClassPool</code>.
protected POInfo initPO(Properties ctx){ POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName()); return poi; }
Load Meta Data
public RangeCategorySeries(String title){ super(title); }
Builds a new category series.
public Clustering<DendrogramModel> extractClusters(DBIDs ids,final DBIDDataStore pi,final DoubleDataStore lambda){ FiniteProgress progress=LOG.isVerbose() ? new FiniteProgress("Extracting clusters",ids.size(),LOG) : null; ArrayDBIDs order=PointerHierarchyRepresentationResult.topologicalSort(ids,pi,lambda); DBIDArrayIter it=order.iter(); final int split=findSplit(order,it,lambda); final int expcnum=ids.size() - split; WritableIntegerDataStore cluster_map=DataStoreUtil.makeIntegerStorage(ids,DataStoreFactory.HINT_TEMP,-1); ArrayList<ModifiableDBIDs> cluster_dbids=new ArrayList<>(expcnum + 10); DoubleArray cluster_dist=new DoubleArray(expcnum + 10); ArrayModifiableDBIDs cluster_leads=DBIDUtil.newArray(expcnum + 10); DBIDVar succ=DBIDUtil.newVar(); for (it.seek(split - 1); it.valid(); it.retract()) { double dist=lambda.doubleValue(it); pi.assignVar(it,succ); int clusterid=cluster_map.intValue(succ); if (clusterid >= 0) { cluster_dbids.get(clusterid).add(it); cluster_map.putInt(it,clusterid); if (cluster_dist.get(clusterid) < dist) { cluster_dist.set(clusterid,dist); } } else { clusterid=cluster_dbids.size(); ModifiableDBIDs cids=DBIDUtil.newArray(); cids.add(succ); cluster_map.putInt(succ,clusterid); cids.add(it); cluster_map.putInt(it,clusterid); cluster_dbids.add(cids); cluster_leads.add(succ); cluster_dist.add(dist); } LOG.incrementProcessed(progress); } final Clustering<DendrogramModel> dendrogram; if (hierarchical) { dendrogram=new Clustering<>("Hierarchical Clustering","hierarchical-clustering"); Cluster<DendrogramModel> root=null; ArrayList<Cluster<DendrogramModel>> clusters=new ArrayList<>(expcnum); { int i=0; for (DBIDIter it2=cluster_leads.iter(); it2.valid(); it2.advance(), i++) { double depth=cluster_dist.get(i); clusters.add(makeCluster(it2,depth,cluster_dbids.get(i))); } cluster_dist=null; cluster_dbids=null; } for (it.seek(split); it.valid(); it.advance()) { int clusterid=cluster_map.intValue(it); final Cluster<DendrogramModel> clus; if (clusterid >= 0) { clus=clusters.get(clusterid); } else if (nosingletons && ids.size() > 1) { clus=null; } else { clus=makeCluster(it,Double.NaN,DBIDUtil.deref(it)); } pi.assignVar(it,succ); if (DBIDUtil.equal(it,succ)) { assert (root == null); root=clus; LOG.incrementProcessed(progress); continue; } int parentid=cluster_map.intValue(succ); double depth=lambda.doubleValue(it); if (parentid >= 0) { final Cluster<DendrogramModel> pclus=clusters.get(parentid); if (pclus.getModel().getDistance() == depth) { if (clus == null) { ((ModifiableDBIDs)pclus.getIDs()).add(it); } else { dendrogram.addChildCluster(pclus,clus); } } else { ModifiableDBIDs cids=DBIDUtil.newArray(clus == null ? 1 : 0); if (clus == null) { cids.add(it); } Cluster<DendrogramModel> npclus=makeCluster(succ,depth,cids); if (clus != null) { dendrogram.addChildCluster(npclus,clus); } dendrogram.addChildCluster(npclus,pclus); clusters.set(parentid,npclus); } } else { final Cluster<DendrogramModel> pclus; if (nosingletons) { ModifiableDBIDs cids=DBIDUtil.newArray(clus == null ? 2 : 1); cids.add(succ); if (clus == null) { cids.add(it); } pclus=makeCluster(succ,depth,cids); } else { pclus=makeCluster(succ,depth,DBIDUtil.EMPTYDBIDS); dendrogram.addChildCluster(pclus,makeCluster(succ,Double.NaN,DBIDUtil.deref(succ))); } if (clus != null) { dendrogram.addChildCluster(pclus,clus); } parentid=clusters.size(); clusters.add(pclus); cluster_map.putInt(succ,parentid); } LOG.incrementProcessed(progress); } assert (root != null); dendrogram.addToplevelCluster(root); } else { dendrogram=new Clustering<>("Flattened Hierarchical Clustering","flattened-hierarchical-clustering"); { int i=0; for (DBIDIter it2=cluster_leads.iter(); it2.valid(); it2.advance(), i++) { double depth=cluster_dist.get(i); dendrogram.addToplevelCluster(makeCluster(it2,depth,cluster_dbids.get(i))); } cluster_dist=null; } if (nosingletons) { for (it.seek(split); it.valid(); it.advance()) { int parentid=cluster_map.intValue(succ); if (parentid >= 0) { cluster_dbids.get(parentid).add(it); cluster_map.put(it,parentid); } } } for (it.seek(split); it.valid(); it.advance()) { int clusterid=cluster_map.intValue(it); if (clusterid < 0) { dendrogram.addToplevelCluster(makeCluster(it,Double.NaN,DBIDUtil.deref(it))); } LOG.incrementProcessed(progress); } cluster_dbids=null; } LOG.ensureCompleted(progress); return dendrogram; }
Extract all clusters from the pi-lambda-representation.
private static void decodeAnsiX12Segment(BitSource bits,StringBuilder result) throws FormatException { int[] cValues=new int[3]; do { if (bits.available() == 8) { return; } int firstByte=bits.readBits(8); if (firstByte == 254) { return; } parseTwoBytes(firstByte,bits.readBits(8),cValues); for (int i=0; i < 3; i++) { int cValue=cValues[i]; if (cValue == 0) { result.append('\r'); } else if (cValue == 1) { result.append('*'); } else if (cValue == 2) { result.append('>'); } else if (cValue == 3) { result.append(' '); } else if (cValue < 14) { result.append((char)(cValue + 44)); } else if (cValue < 40) { result.append((char)(cValue + 51)); } else { throw FormatException.getFormatInstance(); } } } while (bits.available() > 0); }
See ISO 16022:2006, 5.2.7
public Collection<LocalCandidate> harvest(Component component){ if (getMask() == null || getFace() == null) return null; Collection<LocalCandidate> candidates=new HashSet<>(); for ( Candidate<?> cand : component.getLocalCandidates()) { if (!(cand instanceof HostCandidate) || !cand.getTransportAddress().getHostAddress().equals(getFace().getHostAddress()) || cand.getTransport() != getFace().getTransport()) { continue; } HostCandidate hostCandidate=(HostCandidate)cand; TransportAddress mappedAddress=new TransportAddress(getMask().getHostAddress(),hostCandidate.getHostAddress().getPort(),hostCandidate.getHostAddress().getTransport()); ServerReflexiveCandidate mappedCandidate=new ServerReflexiveCandidate(mappedAddress,hostCandidate,hostCandidate.getStunServerAddress(),CandidateExtendedType.STATICALLY_MAPPED_CANDIDATE); if (hostCandidate.isSSL()) mappedCandidate.setSSL(true); if (!candidates.contains(mappedCandidate) && component.addLocalCandidate(mappedCandidate)) { candidates.add(mappedCandidate); } } return candidates; }
Maps all candidates to this harvester's mask and adds them to <tt>component</tt>.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-02-25 10:38:05.434 -0500",hash_original_method="11AFF6C7676FEB0968CBC8B8BF9C6A52",hash_generated_method="506047B26931C7FFF38435DA1DD16290") @DSVerified @DSSpec(DSCat.IO) @DSSink({DSSinkKind.NETWORK}) public synchronized void write(byte buffer[]) throws IOException { write(buffer,0,buffer.length); }
Writes a byte array to the stream. <p>
private void parseAdtsHeader(){ adtsScratch.setPosition(0); if (!hasOutputFormat) { int audioObjectType=adtsScratch.readBits(2) + 1; if (audioObjectType != 2) { Log.w(TAG,"Detected audio object type: " + audioObjectType + ", but assuming AAC LC."); audioObjectType=2; } int sampleRateIndex=adtsScratch.readBits(4); adtsScratch.skipBits(1); int channelConfig=adtsScratch.readBits(3); byte[] audioSpecificConfig=CodecSpecificDataUtil.buildAacAudioSpecificConfig(audioObjectType,sampleRateIndex,channelConfig); Pair<Integer,Integer> audioParams=CodecSpecificDataUtil.parseAacAudioSpecificConfig(audioSpecificConfig); MediaFormat mediaFormat=MediaFormat.createAudioFormat(null,MimeTypes.AUDIO_AAC,MediaFormat.NO_VALUE,MediaFormat.NO_VALUE,C.UNKNOWN_TIME_US,audioParams.second,audioParams.first,Collections.singletonList(audioSpecificConfig),null); sampleDurationUs=(C.MICROS_PER_SECOND * 1024) / mediaFormat.sampleRate; output.format(mediaFormat); hasOutputFormat=true; } else { adtsScratch.skipBits(10); } adtsScratch.skipBits(4); int sampleSize=adtsScratch.readBits(13) - 2 - HEADER_SIZE; if (hasCrc) { sampleSize-=CRC_SIZE; } setReadingSampleState(output,sampleDurationUs,0,sampleSize); }
Parses the sample header.
public String toStringHeader(){ return new ResultMatrixPlainText(this).toStringHeader(); }
returns the header of the matrix as a string.
public ElasticSearchTransportClient(Client client,ElasticSearchEventSerializer serializer){ this.client=client; this.serializer=serializer; }
Used for testing
public void updateTime(int columnIndex,java.sql.Time x) throws SQLException { checkState(); checkTypeConcurrency(); rs.updateTime(columnIndex,x); }
Updates the designated column with a <code>java.sql.Time</code> value. The <code>updateXXX</code> methods are used to update column values in the current row or the insert row. The <code>updateXXX</code> methods do not update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code> methods are called to update the database.
public Drawable loadIcon(PackageManager pm){ return mService.loadIcon(pm); }
Load the user-displayed icon for this spell checker.
private void execute(TriggerProcess triggerProcess) throws SaaSApplicationException { SaaSSystemException se; switch (triggerProcess.getTriggerDefinition().getType()) { case REGISTER_CUSTOMER_FOR_SUPPLIER: accLocal.registerKnownCustomerInt(triggerProcess); break; case SAVE_PAYMENT_CONFIGURATION: accLocal.savePaymentConfigurationInt(triggerProcess); break; case START_BILLING_RUN: se=new SaaSSystemException("Nothing to execute for TriggerType '" + TriggerType.START_BILLING_RUN + "'"); logger.logError(Log4jLogger.SYSTEM_LOG,se,LogMessageIdentifier.ERROR_NO_EXECUTION_FOR_THE_TRIGGER_TYPE,String.valueOf(TriggerType.START_BILLING_RUN)); throw se; case ACTIVATE_SERVICE: srvProvLocal.activateServiceInt(triggerProcess); break; case DEACTIVATE_SERVICE: srvProvLocal.deactivateServiceInt(triggerProcess); break; case SUBSCRIBE_TO_SERVICE: subLocal.subscribeToServiceInt(triggerProcess); break; case UNSUBSCRIBE_FROM_SERVICE: subLocal.unsubscribeFromServiceInt(triggerProcess); break; case MODIFY_SUBSCRIPTION: subLocal.modifySubscriptionInt(triggerProcess); break; case UPGRADE_SUBSCRIPTION: subLocal.upgradeSubscriptionInt(triggerProcess); break; case ADD_REVOKE_USER: subLocal.addRevokeUserInt(triggerProcess); break; case REGISTER_OWN_USER: idLocal.createUserInt(triggerProcess); break; default : se=new SaaSSystemException("Unhandled TriggerType '" + triggerProcess.getTriggerDefinition().getType() + "'"); logger.logError(Log4jLogger.SYSTEM_LOG,se,LogMessageIdentifier.ERROR_UNHANDLED_TRIGGER_TYPE,String.valueOf(triggerProcess.getTriggerDefinition().getType())); throw se; } }
Executes the business logic for the given trigger process.
@Override public int hashCode(){ if (wifiP2pDevice == null) { return 0; } return wifiP2pDevice.hashCode(); }
Return a hash code unique-ish to this object.
protected static void remoteDestroy(String regionName,String entryName) throws CacheException { Region root=getRootRegion(); Region region=root.getSubregion(regionName); Region sub=region.getSubregion(entryName); if (sub == null) { String s="Entry \"" + entryName + "\" does not exist"; throw new EntryNotFoundException(s); } assertNotNull(sub.getEntry(entryName)); sub.destroy(entryName); assertNull(sub.getEntry(entryName)); }
Destroys the value of an entry in a region in a remote VM
protected static void overrideDefaultProperties(@NotNull String localConfDir){ Path confDirPath=Paths.get(localConfDir); if (exists(confDirPath)) { try (DirectoryStream<Path> stream=newDirectoryStream(confDirPath)){ for ( Path entry : stream) { if (!Files.isDirectory(entry)) { if (entry.toString().endsWith(".properties")) { try (InputStream in=newInputStream(entry)){ doBindFileProperties(in); } } } } } catch ( IOException e) { throw new IllegalStateException("Can't load properties",e); } } }
Override default properties from jar with values from CHE_LOCAL_CONF_DIR directory
public boolean isSaveStreams(){ return saveStreams; }
Whether stdin, stdout, stderr streams are saved.
@Override public boolean isActive(){ return amIActive; }
Used by the Whitebox GUI to tell if this plugin is still running.
public static <I,A>Parser<I,A> label(Parser<I,A> p,String name){ return null; }
Label a parser with a readable name for more meaningful error messages.
public FirstFitLocalCombiningAllocator(SsaMethod ssaMeth,InterferenceGraph interference,boolean minimizeRegisters){ super(ssaMeth,interference); ssaRegsMapped=new BitSet(ssaMeth.getRegCount()); mapper=new InterferenceRegisterMapper(interference,ssaMeth.getRegCount()); this.minimizeRegisters=minimizeRegisters; paramRangeEnd=ssaMeth.getParamWidth(); reservedRopRegs=new BitSet(paramRangeEnd * 2); reservedRopRegs.set(0,paramRangeEnd); usedRopRegs=new BitSet(paramRangeEnd * 2); localVariables=new TreeMap<LocalItem,ArrayList<RegisterSpec>>(); moveResultPseudoInsns=new ArrayList<NormalSsaInsn>(); invokeRangeInsns=new ArrayList<NormalSsaInsn>(); phiInsns=new ArrayList<PhiInsn>(); }
Constructs instance.
public ResultSetImpl(long updateCount,long updateID,MySQLConnection conn,StatementImpl creatorStmt){ this.updateCount=updateCount; this.updateId=updateID; this.reallyResult=false; this.fields=new Field[0]; this.connection=conn; this.owningStatement=creatorStmt; this.retainOwningStatement=false; if (this.connection != null) { this.exceptionInterceptor=this.connection.getExceptionInterceptor(); this.retainOwningStatement=this.connection.getRetainStatementAfterResultSetClose(); this.connectionId=this.connection.getId(); this.serverTimeZoneTz=this.connection.getServerTimezoneTZ(); this.padCharsWithSpace=this.connection.getPadCharsWithSpace(); this.useLegacyDatetimeCode=this.connection.getUseLegacyDatetimeCode(); } }
Create a result set for an executeUpdate statement.
@Override public final boolean printingEnabled(OptOptions options,boolean before){ return false; }
Should the IR be printed either before or after performing this phase?
@Override public void run(){ amIActive=true; String inputHeader=null; String outputHeader=null; int col; int row; int numCols; int numRows; int a; int i; float progress=0; int range; boolean blnTextOutput=false; double z; if (args.length <= 0) { showFeedback("Plugin parameters have not been set."); return; } for (i=0; i < args.length; i++) { if (i == 0) { inputHeader=args[i]; } else if (i == 1) { outputHeader=args[i]; } else if (i == 2) { blnTextOutput=Boolean.parseBoolean(args[i]); } } if ((inputHeader == null) || (outputHeader == null)) { showFeedback("One or more of the input parameters have not been set properly."); return; } try { WhiteboxRaster image=new WhiteboxRaster(inputHeader,"r"); numRows=image.getNumberRows(); numCols=image.getNumberColumns(); double noData=image.getNoDataValue(); WhiteboxRaster output=new WhiteboxRaster(outputHeader,"rw",inputHeader,WhiteboxRaster.DataType.FLOAT,noData); output.setPreferredPalette(image.getPreferredPalette()); int minVal=(int)image.getMinimumValue(); int maxVal=(int)image.getMaximumValue(); range=maxVal - minVal; long[] totalColumns=new long[range + 1]; long[] totalRows=new long[range + 1]; long[] totalN=new long[range + 1]; double[] data=null; for (row=0; row < numRows; row++) { data=image.getRowValues(row); for (col=0; col < numCols; col++) { if (data[col] > 0) { a=(int)data[col] - minVal; totalColumns[a]+=col; totalRows[a]+=row; totalN[a]++; } } if (cancelOp) { cancelOperation(); return; } progress=(float)(100f * row / (numRows - 1)); updateProgress((int)progress); } for (a=0; a <= range; a++) { if (totalN[a] > 0) { col=(int)(totalColumns[a] / totalN[a]); row=(int)(totalRows[a] / totalN[a]); output.setValue(row,col,a + minVal); } } output.addMetadataEntry("Created by the " + getDescriptiveName() + " tool."); output.addMetadataEntry("Created on " + new Date()); image.close(); output.close(); if (blnTextOutput) { String retstr="Patch Centroid\nPatch ID\tColumn\tRow"; for (a=0; a <= range; a++) { if (totalN[a] > 0) { retstr=retstr + "\n" + (a + minVal)+ "\t"+ ((float)totalColumns[a] / totalN[a])+ "\t"+ ((float)totalRows[a] / totalN[a]); } } returnData(retstr); } returnData(outputHeader); } catch ( OutOfMemoryError oe) { myHost.showFeedback("An out-of-memory error has occurred during operation."); } catch ( Exception e) { myHost.showFeedback("An error has occurred during operation. See log file for details."); myHost.logException("Error in " + getDescriptiveName(),e); } finally { updateProgress("Progress: ",0); amIActive=false; myHost.pluginComplete(); } }
Used to execute this plugin tool.
public void putValue(String name,Object value){ if (name == null || value == null) { throw new IllegalArgumentException("name == null || value == null"); } Object old=values.put(name,value); if (value instanceof SSLSessionBindingListener) { ((SSLSessionBindingListener)value).valueBound(new SSLSessionBindingEvent(this,name)); } if (old instanceof SSLSessionBindingListener) { ((SSLSessionBindingListener)old).valueUnbound(new SSLSessionBindingEvent(this,name)); } }
A link (name) with the specified value object of the SSL session's application layer data is created or replaced. If the new (or existing) value object implements the <code>SSLSessionBindingListener</code> interface, that object will be notified in due course.
private void init(){ mShadowColor=Color.BLACK; shadowColor=ColorUtils.getNewColorAlpha(mShadowColor,MIN_SHADOW_ALPHA); elevation=DEFAULT_ELEVATION; mShadowAlpha=(MAX_SHADOW_ALPHA - MIN_SHADOW_ALPHA) * (elevation / MAX_ELEVATION) + MAX_SHADOW_ALPHA; mShadowRadius=(maxShadowSize - minShawdowSize) * (elevation / MAX_ELEVATION) + minShawdowSize; mShadowOffset=(maxShadowOffset - minShadowOffset) * (elevation / MAX_ELEVATION) + minShadowOffset; shadowColor=ColorUtils.getNewColorAlpha(mShadowColor,mShadowAlpha); mView.addOnAttachStateChangeListener(stateChangeListener); isFlat=false; }
Initialize and do the first drawing.
private void ensureSize(int minsize){ if (minsize <= store.length) { return; } int asize=store.length; while (asize < minsize) { asize=(asize >>> 1) + asize; } final int[] prev=store; store=new int[asize]; System.arraycopy(prev,0,store,0,size); }
Resize as desired.
public static boolean pendingAddSelected(final ISelection selection){ final AdaptedSelectionInfo selectionInfo=ActionHelpers.adaptSelectionToStandardResources(selection,ResourceFilters.LINKED_RESOURCES_FILTER,false); if (selectionInfo == null || selectionInfo.getRepositories() == null || selectionInfo.getRepositories().length == 0) { return false; } final TFSRepository repository=selectionInfo.getRepositories()[0]; final String path=getFirstSelectedPath(selection); if (path == null || repository == null) { return false; } else { return PendingChangesHelpers.isPendingAdd(repository,path); } }
Test whether the selection is pending add
public void testConvertEscape() throws Exception { assertEquals(this.conn.nativeSQL("{fn convert(abcd, SQL_INTEGER)}"),this.conn.nativeSQL("{fn convert(abcd, INTEGER)}")); }
JDBC-4.0 spec will allow either SQL_ or not for type in {fn convert ...}
public void rollLeft(){ if (DEBUG) { Debug.output("Rolling left"); } doRotateZ(getRollLeftAmount()); }
Rotating position on the z axis, negative.