code
stringlengths
10
174k
nl
stringlengths
3
129k
public Node cloneSubtreeRetainDirection(){ Node clone=node.cloneNode(false); if (node.getNodeType() == Node.ELEMENT_NODE) { String direction=DomUtil.getComputedStyle(Element.as(node)).getProperty("direction"); if (direction.isEmpty()) { direction="auto"; } Element.as(clone).setAttribute("dir",direction); } for ( NodeTree child : children) { clone.appendChild(child.cloneSubtreeRetainDirection()); } return clone; }
Clone this subtree while retaining text directionality from its computed style. The "dir" attribute for each node will be set for each node.
public synchronized void add(final IProgressOperation operation){ m_operations.add(operation); for ( final IGlobalProgressManagerListener listener : m_listeners) { try { listener.added(operation); } catch ( final Exception exception) { CUtilityFunctions.logException(exception); } } }
Adds a new ongoing operation.
public void doEntryRemove(RemoveAllEntryData entry,DistributedRegion rgn){ @Released EntryEventImpl ev=RemoveAllMessage.createEntryEvent(entry,getSender(),this.context,rgn,this.possibleDuplicate,this.needsRouting,this.callbackArg,true,skipCallbacks); try { if (ev.getVersionTag() != null) { checkVersionTag(rgn,ev.getVersionTag()); } rgn.basicDestroy(ev,false,null); } catch ( EntryNotFoundException ignore) { this.appliedOperation=true; } catch ( ConcurrentCacheModificationException e) { dispatchElidedEvent(rgn,ev); this.appliedOperation=false; } finally { if (ev.getVersionTag() != null && !ev.getVersionTag().isRecorded()) { if (rgn.getVersionVector() != null) { rgn.getVersionVector().recordVersion(getSender(),ev.getVersionTag()); } } ev.release(); } }
Does the "remove" of one entry for a "removeAll" operation. Note it calls back to AbstractUpdateOperation.UpdateMessage#basicOperationOnRegion
public InetAddressUnresolvableException(String hostname,Throwable cause){ super(hostname + " could not be resolved",cause); this.hostname=hostname; }
Creates an exception with the specified hostname and cause.
public final boolean sendMessageAtFrontOfQueue(Message msg){ return mExec.sendMessageAtFrontOfQueue(msg); }
Enqueue a message at the front of the message queue, to be processed on the next iteration of the message loop. You will receive it in callback, in the thread attached to this handler. <b>This method is only for use in very special circumstances -- it can easily starve the message queue, cause ordering problems, or have other unexpected side-effects.</b>
ChallengeMovementListener(int x,int y){ returnX=x; returnY=y; }
Create a new ChallengeMovementListener.
public static Parameters from(ExecutableElement method){ PVector<Param> params=Empty.<Param>vector(); for ( VariableElement parameter : method.getParameters()) { params=params.plus(new Param(parameter.asType().toString(),parameter.getSimpleName().toString())); } return new Parameters(params); }
Returns a list comprised of the parameters of the given method.
public void testLongsCount(){ LongAdder counter=new LongAdder(); SplittableRandom r=new SplittableRandom(); long size=0; for (int reps=0; reps < REPS; ++reps) { counter.reset(); r.longs(size).parallel().forEach(null); assertEquals(counter.sum(),size); size+=524959; } }
A parallel sized stream of longs generates the given number of values
JPEGMetadata(ImageWriteParam param,JPEGImageWriter writer){ this(true,false); JPEGImageWriteParam jparam=null; if ((param != null) && (param instanceof JPEGImageWriteParam)) { jparam=(JPEGImageWriteParam)param; if (!jparam.areTablesSet()) { jparam=null; } } if (jparam != null) { markerSequence.add(new DQTMarkerSegment(jparam.getQTables())); markerSequence.add(new DHTMarkerSegment(jparam.getDCHuffmanTables(),jparam.getACHuffmanTables())); } else { markerSequence.add(new DQTMarkerSegment(JPEG.getDefaultQTables())); markerSequence.add(new DHTMarkerSegment(JPEG.getDefaultHuffmanTables(true),JPEG.getDefaultHuffmanTables(false))); } if (!isConsistent()) { throw new InternalError("Default stream metadata is inconsistent"); } }
Constructs a default stream <code>JPEGMetadata</code> object appropriate for the given write parameters.
public static void println(boolean x){ out.println(x); }
Print a boolean to standard output and then terminate the line.
public ST createStringTemplateInternally(CompiledST impl){ ST st=createStringTemplate(impl); if (trackCreationEvents && st.debugState != null) { st.debugState.newSTEvent=null; } return st; }
Differentiate so we can avoid having creation events for regions, map operations, and other implicit "new ST" events during rendering.
public static SplitCasesSpec serializableInstance(){ return new SplitCasesSpec(0,new int[0],new ArrayList<String>()); }
Generates a simple exemplar of this class to test serialization.
public InputStream newInputStream(int index) throws IOException { synchronized (DiskLruCache.this) { if (entry.currentEditor != this) { throw new IllegalStateException(); } if (!entry.readable) { return null; } try { return new FileInputStream(entry.getCleanFile(index)); } catch ( FileNotFoundException e) { return null; } } }
Returns an unbuffered input stream to read the last committed value, or null if no value has been committed.
public ActivationException(){ initCause(null); }
Constructs an <code>ActivationException</code>.
private void showContextMenu(final MouseEvent event){ if (producers.getSelectedIndex() > -1) { JPopupMenu contextMenu=new JPopupMenu(); } }
Show the consumer context menu if a consumer is selected.
private ByteBuffer generateRandomByteBuffer(int size){ byte[] data=new byte[size]; new Random().nextBytes(data); ByteBuffer bb=ByteBuffer.wrap(data); return bb; }
An utility method to generate a random ByteBuffer of the requested size.
public JOptionPane(Object message,int messageType,int optionType){ this(message,messageType,optionType,null); }
Creates an instance of <code>JOptionPane</code> to display a message with the specified message type and options.
private String send(JsonObject message){ URL url; HttpURLConnection connection=null; try { url=new URL(this.service); connection=(HttpURLConnection)url.openConnection(); connection.setRequestMethod("POST"); connection.setConnectTimeout(5000); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); String payload="payload=" + URLEncoder.encode(message.toString(),"UTF-8"); DataOutputStream wr=new DataOutputStream(connection.getOutputStream()); wr.writeBytes(payload); wr.flush(); wr.close(); InputStream is=connection.getInputStream(); BufferedReader rd=new BufferedReader(new InputStreamReader(is)); String line; StringBuffer response=new StringBuffer(); while ((line=rd.readLine()) != null) { response.append(line); response.append('\r'); } System.out.println(response.toString()); rd.close(); return response.toString(); } catch ( Exception e) { e.printStackTrace(); return null; } finally { if (connection != null) { connection.disconnect(); } } }
Send request to WebService
public void sendMessage(String id,DTNHost to){ this.router.sendMessage(id,to); }
Sends a message from this host to another host
public boolean isSelfService(){ Object oo=get_Value(COLUMNNAME_IsSelfService); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; }
Get Self-Service.
private void parseFollowsets(String json){ try { JSONObject data=(JSONObject)parser.parse(json); for ( Object key : data.keySet()) { String room=((String)key).toLowerCase(); Set<Integer> emotesets=new HashSet<>(); for ( Object set : (JSONArray)data.get(key)) { emotesets.add(((Number)set).intValue()); } if (!prevEmotesets.containsKey(room) || !prevEmotesets.get(room).equals(emotesets)) { fetchEmotes(room,emotesets); prevEmotesets.put(room,emotesets); } } } catch ( Exception ex) { LOGGER.warning(String.format("[FFZ-WS] Error parsing 'follow_sets': %s [%s]",ex,json)); } }
Parses the "follow_sets" message from the server and updates the emotes accordingly, but only if the emotesets have changed.
public static int EROFS(){ return Errno.EROFS.intValue(); }
Read-only file system
private void updateBasePlan(double addedCost){ basePlanModel.updateBaseCost(addedCost); }
Update the navigation bar to reflect the base plan changes
public void initCqListeners(CqListener[] addedListeners){ ArrayList<CqListener> oldListeners; synchronized (this.clSync) { oldListeners=this.cqListeners; if (addedListeners == null || addedListeners.length == 0) { this.setCqListeners(null); } else { List nl=Arrays.asList(addedListeners); if (nl.contains(null)) { throw new IllegalArgumentException(LocalizedStrings.CqAttributesFactory_INITCQLISTENERS_PARAMETER_HAD_A_NULL_ELEMENT.toLocalizedString()); } this.setCqListeners(new ArrayList(nl)); } } if (oldListeners != null) { CqListener cql=null; for (Iterator<CqListener> iter=oldListeners.iterator(); iter.hasNext(); ) { try { cql=iter.next(); cql.close(); } catch ( Exception ex) { logger.warn(LocalizedMessage.create(LocalizedStrings.CqAttributesFactory_EXCEPTION_OCCURED_WHILE_CLOSING_CQ_LISTENER_ERROR_0,ex.getLocalizedMessage())); if (logger.isDebugEnabled()) { logger.debug(ex.getMessage(),ex); } } catch ( VirtualMachineError err) { SystemFailure.initiateFailure(err); throw err; } catch ( Throwable t) { SystemFailure.checkFailure(); logger.warn(LocalizedMessage.create(LocalizedStrings.CqAttributesFactory_RUNTIME_EXCEPTION_OCCURED_WHILE_CLOSING_CQ_LISTENER_ERROR_0,t.getLocalizedMessage())); if (logger.isDebugEnabled()) { logger.debug(t.getMessage(),t); } } } } }
Removes all Cqlisteners, calling on each of them, and then adds each listener in the specified array.
public CDebuggerNodeMenuBuilder(final JTree projectTree,final DefaultMutableTreeNode parentNode,final CDebuggersTable table,final IDatabase database,final DebuggerTemplate debuggers[]){ super(projectTree); m_parentNode=parentNode; m_database=database; m_debuggers=debuggers.clone(); m_table=table; }
Creates a new menu builder object.
public void worked(int work){ }
Does nothing.
public static ValueExp minus(ValueExp value1,ValueExp value2){ return new BinaryOpValueExp(MINUS,value1,value2); }
Returns a binary expression representing the difference between two numeric values.
public byte[] extractData(byte[] stegoData,String stegoFileName,byte[] origSigData) throws OpenStegoException { byte[] msg=null; DCTDataHeader header=null; DctLSBInputStream is=null; int bytesRead=0; try { is=new DctLSBInputStream(ImageUtil.byteArrayToImage(stegoData,stegoFileName),this.config); header=is.getDataHeader(); msg=new byte[header.getDataLength()]; bytesRead=is.read(msg,0,msg.length); if (bytesRead != msg.length) { throw new OpenStegoException(null,NAMESPACE,DctLSBErrors.ERR_IMAGE_DATA_READ); } is.close(); } catch ( IOException ioEx) { throw new OpenStegoException(ioEx); } return msg; }
Method to extract the message from the stego data
void selectType(Environment env,Context ctx,int tm){ Type t=Type.tInt; if ((tm & TM_DOUBLE) != 0) { t=Type.tDouble; } else if ((tm & TM_FLOAT) != 0) { t=Type.tFloat; } else if ((tm & TM_LONG) != 0) { t=Type.tLong; } left=convert(env,ctx,t,left); right=convert(env,ctx,t,right); }
Select the type
public ClusterRestRep update(URI id,ClusterUpdateParam input){ return client.put(ClusterRestRep.class,input,getIdUrl(),id); }
Updates a cluster by ID. <p> API Call: <tt>PUT /compute/clusters/{id}</tt>
void release(){ final ArrayList<FixedAllocator> freeFixed[]=m_parent != null ? m_parent.m_freeFixed : m_store.m_freeFixed; final IAllocationContext pcontext=m_parent == null ? null : m_parent.m_context; for ( FixedAllocator f : m_allFixed) { f.setAllocationContext(pcontext); f.setFreeList(freeFixed[m_store.fixedAllocatorIndex(f.m_size)]); } if (log.isDebugEnabled()) log.debug("Releasing " + m_deferredFrees.size() + " deferred frees"); final boolean defer=m_store.m_minReleaseAge > 0 || m_store.m_activeTxCount > 0 || m_store.m_contexts.size() > 0; for ( Long l : m_deferredFrees) { final int addr=(int)(l >> 32); final int sze=l.intValue(); if (defer) { m_store.deferFree(addr,sze); } else { m_store.immediateFree(addr,sze); } } m_deferredFrees.clear(); }
Must return the shadowed allocators to the parent/global environment, resetting the freeList association.
@Override public boolean connectionAllowed(String eventName){ if (m_listenees.containsKey(eventName)) { return false; } return true; }
Returns true if, at this time, the object will accept a connection with respect to the named event
protected POInfo initPO(Properties ctx){ POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName()); return poi; }
Load Meta Data
int processRequest(RenewSpec spec){ assert spec != null; int result=tokenOwner ? initialCount : spec.getRemainingRenewables(); if (!tokenOwner && spec.isRenew()) { result--; } if (result < 0) { throw new RenewException("Unable to renew non-renewable token"); } result=spec.isRenewable() ? result : 0; assert result >= 0; return result; }
Determines whether the request could be processed and if yes, calculates the new renew counter.
public KDTree(List<V> vecs,DistanceMetric distanceMetric,PivotSelection pvSelection,ExecutorService threadpool){ if (!(distanceMetric instanceof EuclideanDistance || distanceMetric instanceof ChebyshevDistance || distanceMetric instanceof ManhattanDistance|| distanceMetric instanceof MinkowskiDistance)) throw new ArithmeticException("KD Trees are not compatible with the given distance metric."); this.distanceMetric=distanceMetric; this.pvSelection=pvSelection; this.size=vecs.size(); allVecs=vecs=new ArrayList<V>(vecs); if (threadpool == null || threadpool instanceof FakeExecutor) distCache=distanceMetric.getAccelerationCache(allVecs); else distCache=distanceMetric.getAccelerationCache(vecs,threadpool); List<Integer> vecIndices=new IntList(size); ListUtils.addRange(vecIndices,0,size,1); if (threadpool == null) this.root=buildTree(vecIndices,0,null,null); else { ModifiableCountDownLatch mcdl=new ModifiableCountDownLatch(1); this.root=buildTree(vecIndices,0,threadpool,mcdl); try { mcdl.await(); } catch ( InterruptedException ex) { this.root=buildTree(vecIndices,0,null,null); } } }
Creates a new KDTree with the given data and methods.
public SVGPathOutlineHandle(SVGPathFigure owner,boolean isHoverHandle){ super(owner); this.isHoverHandle=isHoverHandle; }
Creates a new instance.
protected void init(){ }
Calling to initialize every fields of this WebService.
protected boolean[] datasetIntegrity(boolean nominalPredictor,boolean numericPredictor,boolean stringPredictor,boolean datePredictor,boolean relationalPredictor,boolean multiInstance,boolean predictorMissing){ print("clusterer doesn't alter original datasets"); printAttributeSummary(nominalPredictor,numericPredictor,stringPredictor,datePredictor,relationalPredictor,multiInstance); print("..."); int numTrain=getNumInstances(), missingLevel=20; boolean[] result=new boolean[2]; Instances train=null; Clusterer clusterer=null; try { train=makeTestDataset(42,numTrain,nominalPredictor ? getNumNominal() : 0,numericPredictor ? getNumNumeric() : 0,stringPredictor ? getNumString() : 0,datePredictor ? getNumDate() : 0,relationalPredictor ? getNumRelational() : 0,multiInstance); if (nominalPredictor && !multiInstance) { train.deleteAttributeAt(0); } if (missingLevel > 0) { addMissing(train,missingLevel,predictorMissing); } clusterer=AbstractClusterer.makeCopies(getClusterer(),1)[0]; } catch ( Exception ex) { throw new Error("Error setting up for tests: " + ex.getMessage()); } try { Instances trainCopy=new Instances(train); clusterer.buildClusterer(trainCopy); compareDatasets(train,trainCopy); println("yes"); result[0]=true; } catch ( Exception ex) { println("no"); result[0]=false; if (m_Debug) { println("\n=== Full Report ==="); print("Problem during training"); println(": " + ex.getMessage() + "\n"); println("Here is the dataset:\n"); println("=== Train Dataset ===\n" + train.toString() + "\n"); } } return result; }
Checks whether the scheme alters the training dataset during training. If the scheme needs to modify the training data it should take a copy of the training data. Currently checks for changes to header structure, number of instances, order of instances, instance weights.
public static TransferEntropyCalculatorDiscrete newInstance(int base,int destHistoryEmbedLength){ return new TransferEntropyCalculatorDiscrete(base,destHistoryEmbedLength); }
User was formerly forced to create new instances through this factory method. Retained for backwards compatibility.
public static void writeFile(InputStream inStream,OutputStream out) throws IOException { try { byte[] buf=new byte[BUFF_SIZE]; int len=inStream.read(buf); while (len > 0) { out.write(buf,0,len); len=inStream.read(buf); } } finally { if (inStream != null) { inStream.close(); } if (out != null) { out.close(); } } }
Method writes into file.
private void drawChannelCenterLine(Graphics2D graphics,double xaxis){ double height=getSize().getHeight() - mSpectrumInset; graphics.setColor(Color.LIGHT_GRAY); graphics.draw(new Line2D.Double(xaxis,height * 0.65d,xaxis,height - 1.0d)); }
Draws a vertical line at the xaxis
public static void waitTillOperationReceived(){ synchronized (lockObject) { if (!receivedOperation) { try { lockObject.wait(10000); } catch ( InterruptedException e) { fail("interrupted",e); } } if (!receivedOperation) { fail(" operation should have been received but it has not been received yet"); } } }
wait till create is received. listener will send a notification if create is received
@NotNull public List<PlayerNbt> createMultiplayerPlayerNbts(){ List<PlayerNbt> result=new ArrayList<PlayerNbt>(); for ( File playerdataFile : getPlayerdataFiles()) { if (playerdataFile.isFile()) { result.add(createPlayerdataPlayerNbt(getPlayerUUIDFromPlayerdataFile(playerdataFile))); } } if (!result.isEmpty()) { Log.i("using players from the playerdata directory"); return result; } for ( File playersFile : getPlayersFiles()) { if (playersFile.isFile()) { result.add(createPlayersPlayerNbt(getPlayerNameFromPlayersFile(playersFile))); } } if (!result.isEmpty()) { Log.i("using players from the players directory"); return result; } Log.i("no multiplayer players found"); return result; }
Since version 1.7.6, minecraft stores players in the playerdata directory and uses the player uuid as filename.
public long queryForCountStar(DatabaseConnection databaseConnection) throws SQLException { if (countStarQuery == null) { StringBuilder sb=new StringBuilder(64); sb.append("SELECT COUNT(*) FROM "); databaseType.appendEscapedEntityName(sb,tableInfo.getTableName()); countStarQuery=sb.toString(); } long count=databaseConnection.queryForLong(countStarQuery); logger.debug("query of '{}' returned {}",countStarQuery,count); return count; }
Return a long value which is the number of rows in the table.
public static int checkAndCorrect(BinaryMessage frame,int startIndex){ int syndrome=getSyndrome(frame,startIndex); switch (syndrome) { case 0: return 0; case 1: frame.flip(startIndex + 9); return 1; case 2: frame.flip(startIndex + 8); return 1; case 3: frame.flip(startIndex + 4); return 1; case 4: frame.flip(startIndex + 7); return 1; case 5: return 2; case 6: return 2; case 7: frame.flip(startIndex + 3); return 1; case 8: frame.flip(startIndex + 6); return 1; case 9: return 2; case 10: return 2; case 11: frame.flip(startIndex + 2); return 1; case 12: frame.flip(startIndex + 5); return 1; case 13: frame.flip(startIndex + 1); return 1; case 14: frame.flip(startIndex + 0); return 1; case 15: return 2; } return 2; }
Performs error detection and correction of any single-bit errors. This is a truncated version of the Hamming15 class.
public void mousePressed(MouseEvent e){ mouseSupport.fireMapMousePressed(e); e.getComponent().requestFocus(); if (e.getSource() instanceof MapBean) { drawDistanceObjects=true; if (theMap == null) { theMap=(MapBean)e.getSource(); theMap.addPaintListener(this); } rPoint1=theMap.getCoordinates(e); rPoint2=null; segments.addElement(rPoint1); totalDistance+=distance; theMap.repaint(); } }
Process a mouse pressed event. Add the mouse location to the segment vector. Calculate the cumulative total distance.
public CPluginsReloadAction(){ super("Reload Plugins"); putValue(ACCELERATOR_KEY,HotKeys.RELOAD_PLUGINS_ACCELERATOR_KEY.getKeyStroke()); }
Creates a new action object.
private void visitStatement(StatementTree node,CollapseEmptyOrNot collapseEmptyOrNot,AllowLeadingBlankLine allowLeadingBlank,AllowTrailingBlankLine allowTrailingBlank){ sync(node); switch (node.getKind()) { case BLOCK: builder.space(); visitBlock((BlockTree)node,collapseEmptyOrNot,allowLeadingBlank,allowTrailingBlank); break; default : builder.open(plusTwo); builder.breakOp(" "); scan(node,null); builder.close(); } }
Helper method for statements.
public int nrOfDefinitionLists(){ return superSection.nrOfDefinitionLists(); }
Returns the number of definition lists.
public static <K,V>Map<K,V> synchronizedMap(Map<K,V> map){ if (map == null) { throw new NullPointerException(); } return new SynchronizedMap<K,V>(map); }
Returns a wrapper on the specified map which synchronizes all access to the map.
public static byte[] mergeCentralDirectoryData(ZipExtraField[] data){ int sum=4 * data.length; for (int i=0; i < data.length; i++) { sum+=data[i].getCentralDirectoryLength().getValue(); } byte[] result=new byte[sum]; int start=0; for (int i=0; i < data.length; i++) { System.arraycopy(data[i].getHeaderId().getBytes(),0,result,start,2); System.arraycopy(data[i].getCentralDirectoryLength().getBytes(),0,result,start + 2,2); byte[] local=data[i].getCentralDirectoryData(); System.arraycopy(local,0,result,start + 4,local.length); start+=(local.length + 4); } return result; }
Merges the central directory fields of the given ZipExtraFields.
@Override public void startDocument() throws SAXException { buffer=new StringBuffer(); jsVector=new HashSet(); locator=new LocatorImpl(); inlineResourceList=new ArrayList<>(); jsSet=new HashSet<>(); }
Event fired when the parse starts
public static void main(String[] args){ JFrame frame=new JFrame(TextFieldDemo.class.getAnnotation(DemoProperties.class).value()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(new TextFieldDemo()); frame.setPreferredSize(new Dimension(800,600)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
main method allows us to run as a standalone demo.
public void tryToDequeueFileTransfers(){ mImOperationHandler.post(new FileTransferDequeueTask(mCtx,mCore,mMessagingLog,mChatService,mFileTransferService,mContactManager,mRcsSettings)); }
Try to dequeue one-to-one and group file transfers
private void showFeedback(String message){ if (myHost != null) { myHost.showFeedback(message); } else { System.out.println(message); } }
Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface.
private static ILaunchConfiguration addOrModifyLauncherArgs(ILaunchConfiguration config,String launcherDir,String launcherId) throws CoreException { ILaunchConfigurationWorkingCopy launchConfigWc=config.getWorkingCopy(); if (launcherDir != null && launcherDir.trim().isEmpty()) { launcherDir=null; } GWTLaunchConfigurationWorkingCopy.setCodeServerLauncherDir(launchConfigWc,launcherDir); LaunchConfigurationProcessorUtilities.updateViaProcessor(new SuperDevModeCodeServerLauncherDirArgumentProcessor(),launchConfigWc); if (launcherId != null) { launchConfigWc.setAttribute(GWTLaunchConstants.SUPERDEVMODE_LAUNCH_ID,launcherId); } config=launchConfigWc.doSave(); return config; }
Add or modify the launcherDir program argument in the launch config.
public void testInputAvailable2() throws Exception { File f=this.initFile("testInputAvailable2"); FileOutputStream fos=new FileOutputStream(f); DataOutputStream dos=new DataOutputStream(fos); BufferedFileDataInput bfdi=new BufferedFileDataInput(f); assertEquals("initial availability",0,bfdi.available()); dos.writeByte(1); dos.flush(); assertEquals("after byte availability",1,bfdi.available()); dos.writeShort(2); dos.flush(); assertEquals("after short availability",3,bfdi.available()); dos.writeInt(3); dos.flush(); assertEquals("after int availability",7,bfdi.available()); dos.writeLong(4); dos.flush(); assertEquals("after long availability",15,bfdi.available()); byte[] byteArray=new byte[10]; for (int i=0; i < byteArray.length; i++) byteArray[i]=(byte)i; dos.write(byteArray); dos.flush(); assertEquals("after byte array availability",25,bfdi.available()); dos.close(); assertEquals("byte 1",1,bfdi.readByte()); assertEquals("after byte read",24,bfdi.available()); assertEquals("short 1",2,bfdi.readShort()); assertEquals("after short read",22,bfdi.available()); assertEquals("int 1",3,bfdi.readInt()); assertEquals("after int read",18,bfdi.available()); assertEquals("long 1",4,bfdi.readLong()); assertEquals("after int read",10,bfdi.available()); byte[] myBytes=new byte[10]; bfdi.readFully(myBytes); assertEquals("after byte array read",0,bfdi.available()); bfdi.close(); }
Confirm that for a short file available bytes are equal to the size of the file and that available bytes decrease as we read items of various sizes.
private void awaitResponse() throws IgniteInterruptedCheckedException { U.await(respLatch); }
Await for job execution response to come.
protected Strictness_Impl(){ super(); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public long length(){ return len; }
Gets range length.
public String toString(){ StringBuffer sb=new StringBuffer("MJournal["); sb.append(get_ID()).append(",").append(getDescription()).append(",DR=").append(getTotalDr()).append(",CR=").append(getTotalCr()).append("]"); return sb.toString(); }
String Representation
public static void prepare(Class<? extends Table> clazz) throws Exception { Object tableName=clazz.getField("TABLE_NAME").get(null); MyDBOverseer.get().executeSql(DROP_STATMENT + tableName); MyDBOverseer.get().executeSql(String.format("%s%s(%s)",CREATE_STATMENT,tableName,clazz.getMethod("buildColumnDeclarations").invoke(null))); MyDBOverseer.get().executeBatch((List)clazz.getField("INIT_DATAS").get(null),(DBOperator)clazz.getField("CREATE_DBOPER").get(null)); }
Preparing for the specified Table. In order to prevent last test cases affect current execution, first will drop the old table if exists, then create it and populating the dummy datas.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:30:01.784 -0500",hash_original_method="017D692B38F8FD212CF524C82FCE2BD9",hash_generated_method="CA820402C5228EA8399842E1F8EBE838") public synchronized void deleteRights(DrmRights rights){ int res=nativeDeleteRights(rights); if (JNI_DRM_FAILURE == res) return; }
Delete the specified DRM rights object.
void create(OutputStream out,Manifest manifest) throws IOException { ZipOutputStream zos=new JarOutputStream(out); if (flag0) { zos.setMethod(ZipOutputStream.STORED); } if (manifest != null) { if (vflag) { output(getMsg("out.added.manifest")); } ZipEntry e=new ZipEntry(MANIFEST_DIR); e.setTime(System.currentTimeMillis()); e.setSize(0); e.setCrc(0); zos.putNextEntry(e); e=new ZipEntry(MANIFEST_NAME); e.setTime(System.currentTimeMillis()); if (flag0) { crc32Manifest(e,manifest); } zos.putNextEntry(e); manifest.write(zos); zos.closeEntry(); } for ( File file : entries) { addFile(zos,file); } zos.close(); }
Creates a new JAR file.
private void updatePathConstraints(TestChromosome test){ List<BranchCondition> pathCondition=ConcolicExecution.getSymbolicPath(test); pathConditions.put(test,pathCondition); }
Calculate and store path constraints for an individual
public List<Graph> search(){ long start=System.currentTimeMillis(); TetradLogger.getInstance().log("info","Starting ION Search."); logGraphs("\nInitial Pags: ",this.input); TetradLogger.getInstance().log("info","Transfering local information."); long steps=System.currentTimeMillis(); List<Node> varNodes=new ArrayList<>(); for ( String varName : variables) { varNodes.add(new GraphNode(varName)); } Graph graph=new EdgeListGraph(varNodes); transferLocal(graph); for ( NodePair pair : nonIntersection(graph)) { graph.addEdge(new Edge(pair.getFirst(),pair.getSecond(),Endpoint.CIRCLE,Endpoint.CIRCLE)); } TetradLogger.getInstance().log("info","Steps 1-2: " + (System.currentTimeMillis() - steps) / 1000. + "s"); System.out.println("step2"); System.out.println(graph); steps=System.currentTimeMillis(); Queue<Graph> searchPags=new LinkedList<>(); searchPags.offer(graph); List<Set<IonIndependenceFacts>> sepAndAssoc=findSepAndAssoc(graph); this.separations=sepAndAssoc.get(0); this.associations=sepAndAssoc.get(1); Map<Collection<Node>,List<PossibleDConnectingPath>> paths; Queue<Graph> step3Pags=new LinkedList<>(); Set<Graph> reject=new HashSet<>(); if (separations.isEmpty()) { step3Pags.add(graph); } int numNodes=graph.getNumNodes(); int pl=numNodes - 1; if (pathLengthSearch) { pl=2; } for (int l=pl; l < numNodes; l++) { if (pathLengthSearch) { TetradLogger.getInstance().log("info","Braching over path lengths: " + l + " of "+ (numNodes - 1)); } int seps=separations.size(); int currentSep=1; int numAdjacencies=separations.size(); for ( IonIndependenceFacts fact : separations) { if (adjacencySearch) { TetradLogger.getInstance().log("info","Braching over path nonadjacencies: " + currentSep + " of "+ numAdjacencies); } seps--; searchPags.addAll(step3Pags); recGraphs.add(searchPags.size()); step3Pags.clear(); while (!searchPags.isEmpty()) { System.out.println("ION Step 3 size: " + searchPags.size()); double currentUsage=Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); if (currentUsage > maxMemory) maxMemory=currentUsage; Graph pag=searchPags.poll(); List<PossibleDConnectingPath> dConnections=new ArrayList<>(); if (adjacencySearch) { for ( Collection<Node> conditions : fact.getZ()) { if (pathLengthSearch) { dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength(pag,fact.getX(),fact.getY(),conditions,l)); } else { dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths(pag,fact.getX(),fact.getY(),conditions)); } } } else { for ( IonIndependenceFacts allfact : separations) { for ( Collection<Node> conditions : allfact.getZ()) { if (pathLengthSearch) { dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength(pag,allfact.getX(),allfact.getY(),conditions,l)); } else { dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths(pag,allfact.getX(),allfact.getY(),conditions)); } } } } if (dConnections.isEmpty()) { step3Pags.add(pag); continue; } paths=new HashMap<>(); for ( PossibleDConnectingPath path : dConnections) { List<PossibleDConnectingPath> p=paths.get(path.getConditions()); if (p == null) { p=new LinkedList<>(); } p.add(path); paths.put(path.getConditions(),p); } List<Set<GraphChange>> possibleChanges=new ArrayList<>(); for ( Set<GraphChange> changes : findChanges(paths)) { Set<GraphChange> newChanges=new HashSet<>(); for ( GraphChange gc : changes) { boolean okay=true; for ( Triple collider : gc.getColliders()) { if (pag.isUnderlineTriple(collider.getX(),collider.getY(),collider.getZ())) { okay=false; break; } } if (!okay) { continue; } for ( Triple collider : gc.getNoncolliders()) { if (pag.isDefCollider(collider.getX(),collider.getY(),collider.getZ())) { okay=false; break; } } if (okay) { newChanges.add(gc); } } if (!newChanges.isEmpty()) { possibleChanges.add(newChanges); } else { possibleChanges.clear(); break; } } float starthitset=System.currentTimeMillis(); Collection<GraphChange> hittingSets=IonHittingSet.findHittingSet(possibleChanges); recHitTimes.add((System.currentTimeMillis() - starthitset) / 1000.); for ( GraphChange gc : hittingSets) { boolean badhittingset=false; for ( Edge edge : gc.getRemoves()) { Node node1=edge.getNode1(); Node node2=edge.getNode2(); Set<Triple> triples=new HashSet<>(); triples.addAll(gc.getColliders()); triples.addAll(gc.getNoncolliders()); if (triples.size() != (gc.getColliders().size() + gc.getNoncolliders().size())) { badhittingset=true; break; } for ( Triple triple : triples) { if (node1.equals(triple.getY())) { if (node2.equals(triple.getX()) || node2.equals(triple.getZ())) { badhittingset=true; break; } } if (node2.equals(triple.getY())) { if (node1.equals(triple.getX()) || node1.equals(triple.getZ())) { badhittingset=true; break; } } } if (badhittingset) { break; } for ( NodePair pair : gc.getOrients()) { if ((node1.equals(pair.getFirst()) && node2.equals(pair.getSecond())) || (node2.equals(pair.getFirst()) && node1.equals(pair.getSecond()))) { badhittingset=true; break; } } if (badhittingset) { break; } } if (!badhittingset) { for ( NodePair pair : gc.getOrients()) { for ( Triple triple : gc.getNoncolliders()) { if (pair.getSecond().equals(triple.getY())) { if (pair.getFirst().equals(triple.getX()) && pag.getEndpoint(triple.getZ(),triple.getY()).equals(Endpoint.ARROW)) { badhittingset=true; break; } if (pair.getFirst().equals(triple.getZ()) && pag.getEndpoint(triple.getX(),triple.getY()).equals(Endpoint.ARROW)) { badhittingset=true; break; } } if (badhittingset) { break; } } if (badhittingset) { break; } } } if (badhittingset) { continue; } Graph changed=gc.applyTo(pag); if (reject.contains(changed)) { continue; } if (step3Pags.contains(changed)) { continue; } if (predictsFalseIndependence(associations,changed) || changed.existsDirectedCycle()) { reject.add(changed); } step3Pags.add(changed); } } if (!adjacencySearch) { break; } } } TetradLogger.getInstance().log("info","Step 3: " + (System.currentTimeMillis() - steps) / 1000. + "s"); steps=System.currentTimeMillis(); Map<Edge,Boolean> necEdges; Set<Graph> outputPags=new HashSet<>(); while (!step3Pags.isEmpty()) { Graph pag=step3Pags.poll(); necEdges=new HashMap<>(); for ( Edge edge : pag.getEdges()) { necEdges.put(edge,false); } for ( IonIndependenceFacts fact : associations) { for ( List<Node> nodes : fact.getZ()) { if (nodes.isEmpty()) { List<List<Node>> treks=treks(pag,fact.x,fact.y); if (treks.size() == 1) { List<Node> trek=treks.get(0); List<Triple> triples=new ArrayList<>(); for (int i=1; i < trek.size(); i++) { necEdges.put(pag.getEdge(trek.get(i - 1),trek.get(i)),true); if (i == 1) { continue; } pag.addUnderlineTriple(trek.get(i - 2),trek.get(i - 1),trek.get(i)); } } break; } } } boolean elimTreks; List<Graph> possRemovePags=possRemove(pag,necEdges); double currentUsage=Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); if (currentUsage > maxMemory) maxMemory=currentUsage; for ( Graph newPag : possRemovePags) { elimTreks=false; for ( IonIndependenceFacts fact : associations) { for ( List<Node> nodes : fact.getZ()) { if (nodes.isEmpty()) { if (treks(newPag,fact.x,fact.y).isEmpty()) { elimTreks=true; } break; } } } if (!elimTreks) { outputPags.add(newPag); } } } outputPags=removeMoreSpecific(outputPags); TetradLogger.getInstance().log("info","Step 4: " + (System.currentTimeMillis() - steps) / 1000. + "s"); steps=System.currentTimeMillis(); Set<Graph> outputSet=new HashSet<>(); for ( Graph pag : outputPags) { Set<Triple> unshieldedPossibleColliders=new HashSet<>(); for ( Triple triple : getPossibleTriples(pag)) { if (!pag.isAdjacentTo(triple.getX(),triple.getZ())) { unshieldedPossibleColliders.add(triple); } } PowerSet<Triple> pset=new PowerSet<>(unshieldedPossibleColliders); for ( Set<Triple> set : pset) { Graph newGraph=new EdgeListGraph(pag); for ( Triple triple : set) { newGraph.setEndpoint(triple.getX(),triple.getY(),Endpoint.ARROW); newGraph.setEndpoint(triple.getZ(),triple.getY(),Endpoint.ARROW); } doFinalOrientation(newGraph); } for ( Graph outputPag : finalResult) { if (!predictsFalseIndependence(associations,outputPag)) { Set<Triple> underlineTriples=new HashSet<>(outputPag.getUnderLines()); for ( Triple triple : underlineTriples) { outputPag.removeUnderlineTriple(triple.getX(),triple.getY(),triple.getZ()); } outputSet.add(outputPag); } } } output.addAll(outputSet); TetradLogger.getInstance().log("info","Step 5: " + (System.currentTimeMillis() - steps) / 1000. + "s"); runtime=((System.currentTimeMillis() - start) / 1000.); logGraphs("\nReturning output (" + output.size() + " Graphs):",output); double currentUsage=Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); if (currentUsage > maxMemory) maxMemory=currentUsage; return output; }
Begins the ION search procedure, described at each step
public static AreaChart criar(Map<String,List<Relatorio>> map,String titulo){ config(titulo); eixoX=new CategoryAxis(); eixoY=new NumberAxis(); grafico=new AreaChart<>(eixoX,eixoY); for ( String chave : map.keySet()) { XYChart.Series<String,Number> serie=new XYChart.Series<>(); serie.setName(chave); List<Relatorio> relatorios=map.get(chave); for ( Relatorio relatorio : relatorios) { serie.getData().add(new XYChart.Data<String,Number>(relatorio.getData(),relatorio.getTotal())); } grafico.getData().add(serie); } return grafico; }
Criar grafico de area e inserir dados das series, datas e valores apartir do map informado
private void initListeners(){ if (m_module.isLoaded()) { m_module.getContent().getViewContainer().getNativeCallgraphView().addListener(m_viewListener); } }
Initializes the necessary listeners if a module is loaded.
private void processTargetFixup(BBQ bbq){ BasicBlock b, p; Stmt s; while (!bbq.isEmpty()) { try { b=bbq.pull(); } catch ( NoSuchElementException e) { break; } s=b.getTailJStmt(); if (s instanceof GotoStmt) { if (b.succ.size() == 1) { ((GotoStmt)s).setTarget(b.succ.firstElement().getHeadJStmt()); } else { G.v().out.println("Error :"); for (int i=0; i < b.statements.size(); i++) G.v().out.println(b.statements.get(i)); throw new RuntimeException(b + " has " + b.succ.size()+ " successors."); } } else if (s instanceof IfStmt) { if (b.succ.size() != 2) G.v().out.println("How can an if not have 2 successors?"); if ((b.succ.firstElement()) == b.next) { ((IfStmt)s).setTarget(b.succ.elementAt(1).getHeadJStmt()); } else { ((IfStmt)s).setTarget(b.succ.firstElement().getHeadJStmt()); } } else if (s instanceof TableSwitchStmt) { int count=0; TableSwitchStmt sts=(TableSwitchStmt)s; for ( BasicBlock basicBlock : b.succ) { p=(basicBlock); if (count == 0) { sts.setDefaultTarget(p.getHeadJStmt()); } else { sts.setTarget(count - 1,p.getHeadJStmt()); } count++; } } else if (s instanceof LookupSwitchStmt) { int count=0; LookupSwitchStmt sls=(LookupSwitchStmt)s; for ( BasicBlock basicBlock : b.succ) { p=(basicBlock); if (count == 0) { sls.setDefaultTarget(p.getHeadJStmt()); } else { sls.setTarget(count - 1,p.getHeadJStmt()); } count++; } } b.done=false; for ( BasicBlock basicBlock : b.succ) { p=(basicBlock); if (p.done) bbq.push(p); } } }
Runs through the given bbq contents performing the target fix-up pass; Requires all reachable blocks to have their done flags set to true, and this resets them all back to false;
public int match(String s){ String rep=new String(_dataChars,0,_nDataChars); return rep.indexOf(s); }
Returns the index of String s in the reply
@Override public int runCommand(String command) throws IOException { int exitStatus; try { exitStatus=runCommand(false,Arrays.asList(command.split(" "))); } catch ( InterruptedException e) { throw new IllegalStateException(e); } if (exitStatus != 0) { throw new IllegalStateException(getErrorMessage()); } return exitStatus; }
Runs command and returns exit status.
public Scan(){ super(); }
Starts a channel scan
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject m_selected; m_selected=((Expression)m_obj).execute(xctxt); m_selected.allowDetachToRelease(m_allowRelease); if (m_selected.getType() == CLASS_STRING) return m_selected; else return new XString(m_selected.str()); }
For support of literal objects in xpaths.
public Matrix4x3d pick(double x,double y,double width,double height,int[] viewport){ return pick(x,y,width,height,viewport,this); }
Apply a picking transformation to this matrix using the given window coordinates <tt>(x, y)</tt> as the pick center and the given <tt>(width, height)</tt> as the size of the picking region in window coordinates.
public WrappedGTestResultParser(String testRunName,Collection<ITestRunListener> listeners){ super(testRunName,listeners); }
Creates the WrappedGTestResultParser.
@Override public boolean isAssignableBy(Type other){ if (other instanceof NullType) { return !this.isPrimitive(); } if (other.isPrimitive()) { if (this.getQualifiedName().equals(Object.class.getCanonicalName())) { return true; } else { return isCorrespondingBoxingType(other.describe()); } } if (other instanceof LambdaArgumentTypePlaceholder) { return this.getTypeDeclaration().hasAnnotation(FunctionalInterface.class.getCanonicalName()); } else if (other instanceof ReferenceTypeImpl) { ReferenceTypeImpl otherRef=(ReferenceTypeImpl)other; if (compareConsideringTypeParameters(otherRef)) { return true; } for ( ReferenceType otherAncestor : otherRef.getAllAncestors()) { if (compareConsideringTypeParameters(otherAncestor)) { return true; } } return false; } else if (other.isTypeVariable()) { return true; } else if (other.isWildcard()) { if (this.getQualifiedName().equals(Object.class.getCanonicalName())) { return true; } else if (other.asWildcard().isExtends()) { return isAssignableBy(other.asWildcard().getBoundedType()); } else { return false; } } else { return false; } }
This method checks if ThisType t = new OtherType() would compile.
@DSComment("View state info") @DSSafe(DSCat.DATA_STRUCTURE) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:29:50.373 -0500",hash_original_method="5950FF2359622B18F5A5CA611CFB5FEA",hash_generated_method="6166B14C683B9315F9D6F2BDCDD2DABC") public static AccessibilityNodeInfo obtain(View source){ AccessibilityNodeInfo info=AccessibilityNodeInfo.obtain(); info.setSource(source); return info; }
Returns a cached instance if such is available otherwise a new one and sets the source.
private void stopCountdown(){ mTimeoutTV.removeCallbacks(mTimeoutCounter); mTimeoutTV.setVisibility(View.GONE); }
Stop count down, hide count down info
public AppTest(String testName){ super(testName); }
Create the test case
public int sizeInBytes(){ return available; }
Returns the total number of bytes.
private void generateComponents(int startingAt,int endingAt){ if (collectStats) { formattedChars+=(endingAt - startingAt); } int layoutFlags=0; TextLabelFactory factory=new TextLabelFactory(fFrc,fChars,fBidi,layoutFlags); int[] charsLtoV=null; if (fBidi != null) { fLevels=BidiUtils.getLevels(fBidi); int[] charsVtoL=BidiUtils.createVisualToLogicalMap(fLevels); charsLtoV=BidiUtils.createInverseMap(charsVtoL); fIsDirectionLTR=fBidi.baseIsLeftToRight(); } else { fLevels=null; fIsDirectionLTR=true; } try { fComponents=TextLine.getComponents(fParagraph,fChars,startingAt,endingAt,charsLtoV,fLevels,factory); } catch ( IllegalArgumentException e) { System.out.println("startingAt=" + startingAt + "; endingAt="+ endingAt); System.out.println("fComponentLimit=" + fComponentLimit); throw e; } fComponentStart=startingAt; fComponentLimit=endingAt; }
Generate components for the paragraph. fChars, fBidi should have been initialized already.
protected void clearOutEvents(){ sCInterface.clearOutEvents(); sCIIfA.clearOutEvents(); }
This method resets the outgoing events.
public static ArtifactCoordinates fromString(String string){ final Matcher matcher=VALID_PATTERN.matcher(string); if (matcher.matches()) { if (matcher.group(4) != null) { return new ArtifactCoordinates(matcher.group(1),matcher.group(2),matcher.group(3),matcher.group(4)); } else { return new ArtifactCoordinates(matcher.group(1),matcher.group(2),matcher.group(3)); } } else { throw new IllegalArgumentException(string); } }
Parse a string and produce artifact coordinates from it.
static public void assertEquals(String message,Object expected,Object actual){ if (expected == null && actual == null) return; if (expected != null && expected.equals(actual)) return; failNotEquals(message,expected,actual); }
Asserts that two objects are equal. If they are not an AssertionFailedError is thrown with the given message.
protected void checkJAXPVersion(Hashtable h){ if (null == h) h=new Hashtable(); final Class noArgs[]=new Class[0]; Class clazz=null; try { final String JAXP1_CLASS="javax.xml.parsers.DocumentBuilder"; final String JAXP11_METHOD="getDOMImplementation"; clazz=ObjectFactory.findProviderClass(JAXP1_CLASS,ObjectFactory.findClassLoader(),true); Method method=clazz.getMethod(JAXP11_METHOD,noArgs); h.put(VERSION + "JAXP","1.1 or higher"); } catch ( Exception e) { if (null != clazz) { h.put(ERROR + VERSION + "JAXP","1.0.1"); h.put(ERROR,ERROR_FOUND); } else { h.put(ERROR + VERSION + "JAXP",CLASS_NOTPRESENT); h.put(ERROR,ERROR_FOUND); } } }
Report version information about JAXP interfaces. Currently distinguishes between JAXP 1.0.1 and JAXP 1.1, and not found; only tests the interfaces, and does not check for reference implementation versions.
public static String formAuthorizationHeader(String token,PrivateKey key,URL requestUrl,String requestMethod) throws GeneralSecurityException { if (key == null) { return String.format("AuthSub token=\"%s\"",token); } else { long timestamp=System.currentTimeMillis() / 1000; long nonce=RANDOM.nextLong(); String dataToSign=String.format("%s %s %d %s",requestMethod,requestUrl.toExternalForm(),timestamp,unsignedLongToString(nonce)); SignatureAlgorithm sigAlg=getSigAlg(key); byte[] signature=sign(key,dataToSign,sigAlg); String encodedSignature=Base64.encode(signature); return String.format("AuthSub token=\"%s\" data=\"%s\" sig=\"%s\" " + "sigalg=\"%s\"",token,dataToSign,encodedSignature,sigAlg.getAuthSubName()); } }
Forms the AuthSub authorization header. <p> If the <code>key</code> is null, the token will be used in insecure mode. If the <code>key</code> is non-null, the token will be used securely and the header will contain a signature.
public Matrix4f rotationY(float ang){ float sin, cos; sin=(float)Math.sin(ang); cos=(float)Math.cos(ang); MemUtil.INSTANCE.identity(this); this._m00(cos); this._m02(-sin); this._m20(sin); this._m22(cos); _properties(PROPERTY_AFFINE); return this; }
Set this matrix to a rotation transformation about the Y axis. <p> When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise. <p> Reference: <a href="http://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations">http://en.wikipedia.org</a>
public boolean isDistinct(){ return distinct; }
Returns indicator whether distinct or not.
public LRTAStarAgent(OnlineSearchProblem problem,PerceptToStateFunction ptsFunction,HeuristicFunction hf){ setProblem(problem); setPerceptToStateFunction(ptsFunction); setHeuristicFunction(hf); }
Constructs a LRTA* agent with the specified search problem, percept to state function, and heuristic function.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:27:48.615 -0500",hash_original_method="BFD2027492A8CA27CCE6A852F5D0D4BF",hash_generated_method="CFB27AB400DD88FBC877D4D8B3607B54") @DSVerified("callback modeled") @DSSafe(DSCat.ANDROID_CALLBACK) public void onDataConnectionStateChanged(int state,int networkType){ }
same as above, but with the network type. Both called.
public boolean matches(XPathContext xctxt,int targetNode,QName mode) throws TransformerException { double score=m_stepPattern.getMatchScore(xctxt,targetNode); return (XPath.MATCH_SCORE_NONE != score) && matchModes(mode,m_template.getMode()); }
Return the mode associated with the template.
public boolean isCustomizable(){ return customizable; }
Checks if is customizable.
public void startRetransmitTimer(SIPServerTransaction sipServerTx,Response response){ if (sipServerTx.getRequest().getMethod().equals(Request.INVITE) && response.getStatusCode() / 100 == 2) { this.startTimer(sipServerTx); } }
Start the retransmit timer.
@POST @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("/{id}/deactivate") @CheckPermission(roles={Role.SYSTEM_ADMIN,Role.RESTRICTED_SYSTEM_ADMIN}) public TaskResourceRep deleteMigration(@PathParam("id") URI id){ ArgValidator.checkFieldUriType(id,Migration.class,"id"); Migration migration=queryResource(id); if (!BulkList.MigrationFilter.isUserAuthorizedForMigration(migration,getUserFromContext(),_permissionsHelper)) { StorageOSUser user=getUserFromContext(); throw APIException.forbidden.insufficientPermissionsForUser(user.getName()); } String status=migration.getMigrationStatus(); String migrationName=migration.getLabel(); if (status == null || status.isEmpty() || migrationName == null || migrationName.isEmpty()) { throw APIException.badRequests.migrationHasntStarted(id.toString()); } if (!status.equalsIgnoreCase(VPlexMigrationInfo.MigrationStatus.COMMITTED.getStatusValue()) && !status.equalsIgnoreCase(VPlexMigrationInfo.MigrationStatus.CANCELLED.getStatusValue()) && !status.equalsIgnoreCase(VPlexMigrationInfo.MigrationStatus.ERROR.getStatusValue())) { throw VPlexApiException.exceptions.cantRemoveMigrationInvalidState(migrationName); } URI volId=migration.getVolume(); Volume vplexVol=_dbClient.queryObject(Volume.class,volId); String taskId=UUID.randomUUID().toString(); Operation op=_dbClient.createTaskOpStatus(Volume.class,volId,taskId,ResourceOperationTypeEnum.DELETE_MIGRATION); TaskResourceRep task=toTask(vplexVol,taskId,op); if (migration.getInactive()) { s_logger.info("Migration {} has been deleted",id); op.ready(); vplexVol.getOpStatus().createTaskStatus(taskId,op); _dbClient.persistObject(vplexVol); return task; } try { VPlexController controller=_vplexBlockServiceApi.getController(); controller.deleteMigration(vplexVol.getStorageController(),id,taskId); } catch ( InternalException e) { s_logger.error("Error",e); String errMsg=String.format("Error: %s",e.getMessage()); task.setState(Operation.Status.error.name()); task.setMessage(errMsg); op.error(e); vplexVol.getOpStatus().updateTaskStatus(taskId,op); _dbClient.persistObject(vplexVol); } return task; }
Delete a migration that has been committed or cancelled
public void receiveErrorregisterVASACertificate(java.lang.Exception e){ }
auto generated Axis2 Error handler override this method for handling error response from registerVASACertificate operation
public int toComparison(){ return comparison; }
Returns a negative integer, a positive integer, or zero as the <code>builder</code> has judged the "left-hand" side as less than, greater than, or equal to the "right-hand" side.
protected void writeHeader(){ out.println("digraph tokens {"); out.println(" graph [ fontsize=30 labelloc=\"t\" label=\"\" splines=true overlap=false rankdir = \"LR\" ];"); out.println(" // A2 paper size"); out.println(" size = \"34.4,16.5\";"); out.println(" edge [ fontname=\"" + FONT_NAME + "\" fontcolor=\"red\" color=\"#606060\" ]"); out.println(" node [ style=\"filled\" fillcolor=\"#e8e8f0\" shape=\"Mrecord\" fontname=\"" + FONT_NAME + "\" ]"); out.println(); }
Override to customize.
public void actionPerformed(ActionEvent evt){ root.panel.view.getSharedContext().setDebug_draw_line_boxes(!root.panel.view.getSharedContext().debugDrawLineBoxes()); root.panel.view.repaint(); }
Description of the Method
private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix,namespace); xmlWriter.setPrefix(prefix,namespace); } xmlWriter.writeAttribute(namespace,attName,attValue); }
Util method to write an attribute with the ns prefix
public static <T>MutableSeq<T> newMutableSeq(T value){ Collection<T> collection=new ArrayList<>(); collection.add(value); return new SeqImpl<>(collection); }
Create an MutableSeq with the single value