code
stringlengths
10
174k
nl
stringlengths
3
129k
protected POInfo initPO(Properties ctx){ POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName()); return poi; }
Load Meta Data
public Object[] patch_apply(LinkedList<Patch> patches,String text){ if (patches.isEmpty()) { return new Object[]{text,new boolean[0]}; } patches=patch_deepCopy(patches); String nullPadding=patch_addPadding(patches); text=nullPadding + text + nullPadding; patch_splitMax(patches); int x=0; int delta=0; boolean[] results=new boolean[patches.size()]; for ( Patch aPatch : patches) { int expected_loc=aPatch.start2 + delta; String text1=diff_text1(aPatch.diffs); int start_loc; int end_loc=-1; if (text1.length() > this.Match_MaxBits) { start_loc=match_main(text,text1.substring(0,this.Match_MaxBits),expected_loc); if (start_loc != -1) { end_loc=match_main(text,text1.substring(text1.length() - this.Match_MaxBits),expected_loc + text1.length() - this.Match_MaxBits); if (end_loc == -1 || start_loc >= end_loc) { start_loc=-1; } } } else { start_loc=match_main(text,text1,expected_loc); } if (start_loc == -1) { results[x]=false; delta-=aPatch.length2 - aPatch.length1; } else { results[x]=true; delta=start_loc - expected_loc; String text2; if (end_loc == -1) { text2=text.substring(start_loc,Math.min(start_loc + text1.length(),text.length())); } else { text2=text.substring(start_loc,Math.min(end_loc + this.Match_MaxBits,text.length())); } if (text1.equals(text2)) { text=text.substring(0,start_loc) + diff_text2(aPatch.diffs) + text.substring(start_loc + text1.length()); } else { LinkedList<Diff> diffs=diff_main(text1,text2,false); if (text1.length() > this.Match_MaxBits && diff_levenshtein(diffs) / (float)text1.length() > this.Patch_DeleteThreshold) { results[x]=false; } else { diff_cleanupSemanticLossless(diffs); int index1=0; for ( Diff aDiff : aPatch.diffs) { if (aDiff.operation != Operation.EQUAL) { int index2=diff_xIndex(diffs,index1); if (aDiff.operation == Operation.INSERT) { text=text.substring(0,start_loc + index2) + aDiff.text + text.substring(start_loc + index2); } else if (aDiff.operation == Operation.DELETE) { text=text.substring(0,start_loc + index2) + text.substring(start_loc + diff_xIndex(diffs,index1 + aDiff.text.length())); } } if (aDiff.operation != Operation.DELETE) { index1+=aDiff.text.length(); } } } } } x++; } text=text.substring(nullPadding.length(),text.length() - nullPadding.length()); return new Object[]{text,results}; }
Merge a set of patches onto the text. Return a patched text, as well as an array of true/false values indicating which patches were applied.
public void waitUntilFinished(){ try { while (m_runningCount > 0) { Thread.sleep(200); } while (true) { boolean busy=false; for (int i=0; i < m_beans.size(); i++) { BeanInstance temp=(BeanInstance)m_beans.elementAt(i); if (temp.getBean() instanceof BeanCommon) { if (((BeanCommon)temp.getBean()).isBusy()) { busy=true; break; } } } if (busy) { Thread.sleep(3000); } else { break; } } } catch ( Exception ex) { if (m_log != null) { m_log.logMessage("[FlowRunner] Attempting to stop all flows..."); } else { System.err.println("[FlowRunner] Attempting to stop all flows..."); } stopAllFlows(); } }
Waits until all flows have finished executing before returning
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-02-24 15:34:30.649 -0500",hash_original_method="91D303D5C085A2886EA18E68D84B5130",hash_generated_method="AB93A70CB43B88578EAB171A59E30AB6") @DSVerified @DSSafe(DSCat.UTIL_FUNCTION) public static byte[] toAsciiBytes(byte[] raw){ if (raw == null || raw.length == 0) { return EMPTY_BYTE_ARRAY; } byte[] l_ascii=new byte[raw.length << 3]; l_ascii.addTaint(raw.getTaint()); return l_ascii; }
Converts an array of raw binary data into an array of ascii 0 and 1 character bytes - each byte is a truncated char.
private void fieldInsn(final int opcode,final Type ownerType,final String name,final Type fieldType){ mv.visitFieldInsn(opcode,ownerType.getInternalName(),name,fieldType.getDescriptor()); }
Generates a get field or set field instruction.
public String write(String value){ return value; }
This method is used to convert the provided value into an XML usable format. This is used in the serialization process when there is a need to convert a field value in to a string so that that value can be written as a valid XML entity.
public static float[] toFloatArray(short[] array){ float[] result=new float[array.length]; for (int i=0; i < array.length; i++) { result[i]=(float)array[i]; } return result; }
Coverts given shorts array to array of floats.
public final boolean readBoolean() throws IOException { int ch=this.read(); if (ch < 0) { throw new EOFException(); } return (ch != 0); }
Reads a <code>boolean</code> from this file. This method reads a single byte from the file. A value of <code>0</code> represents <code>false</code>. Any other value represents <code>true</code>. This method blocks until the byte is read, the end of the stream is detected, or an exception is thrown.
public static Boolean isAppFavorite(String apk,Set<String> appFavorites){ Boolean res=false; if (appFavorites.contains(apk)) { res=true; } return res; }
Retrieve if an app has been marked as favorite
public static DocList doSimpleQuery(String sreq,SolrQueryRequest req,int start,int limit) throws IOException { List<String> commands=StrUtils.splitSmart(sreq,';'); String qs=commands.size() >= 1 ? commands.get(0) : ""; try { Query query=QParser.getParser(qs,req).getQuery(); Sort sort=null; if (commands.size() >= 2) { sort=SortSpecParsing.parseSortSpec(commands.get(1),req).getSort(); } DocList results=req.getSearcher().getDocList(query,(DocSet)null,sort,start,limit); return results; } catch ( SyntaxError e) { throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,"Error parsing query: " + qs); } }
Executes a basic query
public void submitOne(final R resource,final long retryMillis) throws InterruptedException, Exception { if (resource == null) throw new IllegalArgumentException(); if (retryMillis < 0) throw new IllegalArgumentException(); int retryCount=0; final long begin=System.currentTimeMillis(); long lastLogTime=begin; final Callable<?> task=newParserTask(resource); while (true) { try { submitOne(resource,task); return; } catch ( RejectedExecutionException ex) { if (parserService.isShutdown()) { throw ex; } if (retryMillis == 0L) { throw ex; } Thread.sleep(retryMillis); retryCount++; if (log.isInfoEnabled()) { final long now=System.currentTimeMillis(); final long elapsedSinceLastLogTime=now - lastLogTime; if (elapsedSinceLastLogTime > 5000) { final long elapsed=now - begin; lastLogTime=now; log.info("Parser pool blocking: retryCount=" + retryCount + ", elapsed="+ elapsed+ "ms, resource="+ resource); } } continue; } catch ( InterruptedException ex) { throw ex; } catch ( Exception ex) { log.error(resource,ex); } } }
Submit a resource for processing.
public static byte[] generateIv() throws GeneralSecurityException { return randomBytes(IV_LENGTH_BYTES); }
Creates a random Initialization Vector (IV) of IV_LENGTH_BYTES.
public static double decodeTimestamp(byte[] array,int pointer){ double r=0.0; for (int i=0; i < 8; i++) { r+=unsignedByteToShort(array[pointer + i]) * Math.pow(2,(3 - i) * 8); } return r; }
Will read 8 bytes of a message beginning at <code>pointer</code> and return it as a double, according to the NTP 64-bit timestamp format.
public JCheckBox(String text,Icon icon){ this(text,icon,false); }
Creates an initially unselected check box with the specified text and icon.
@Override public void zEventCustomPopupWasClosed(CustomPopup popup){ popup=null; if (timeMenuPanel != null) { timeMenuPanel.clearParent(); } timeMenuPanel=null; lastPopupCloseTime=Instant.now(); }
zEventCustomPopupWasClosed, This is called automatically whenever the CustomPopup that is associated with this time picker is closed. This should be called regardless of the type of event which caused the popup to close. Notes: The popup can be automatically closed for various reasons. 1) The user may press escape. 2) The popup may lose focus. 3) The window may be moved. 4) The user may toggle the popup menu with the "toggle time menu" button. 5) The user may select a time in the popup menu.
public void register5(String name,Type arg1,Type arg2,Type arg3,Type arg4,Type arg5,InvocationPlugin plugin){ plugins.register(plugin,false,allowOverwrite,declaringType,name,arg1,arg2,arg3,arg4,arg5); }
Registers a plugin for a method with 5 arguments.
private void runSingleDeleteTask(String url,OnDeleteDownloadFileListener onDeleteEverySingleDownloadFileListener,boolean sync){ DeleteDownloadFileTask deleteSingleDownloadFileTask=new DeleteDownloadFileTask(url,mDeleteDownloadedFile,mDownloadFileDeleter); deleteSingleDownloadFileTask.enableSyncCallback(); deleteSingleDownloadFileTask.setOnDeleteDownloadFileListener(onDeleteEverySingleDownloadFileListener); if (sync) { deleteSingleDownloadFileTask.run(); } else { mTaskEngine.execute(deleteSingleDownloadFileTask); } }
run delete single file task
public void pushRTFContext(){ m_last_pushed_rtfdtm.push(m_which_rtfdtm); if (null != m_rtfdtm_stack) ((SAX2RTFDTM)(getRTFDTM())).pushRewindMark(); }
Push the RTFDTM's context mark, to allows discarding RTFs added after this point. (If it doesn't exist we don't push, since we might still be able to get away with not creating it. That requires that excessive pops be harmless.)
public String qty(Properties ctx,int WindowNo,GridTab mTab,GridField mField,Object value){ if (isCalloutActive() || value == null) return ""; int M_Product_ID=Env.getContextAsInt(ctx,WindowNo,"M_Product_ID"); checkQtyAvailable(ctx,mTab,WindowNo,M_Product_ID,(BigDecimal)value); return ""; }
Movement Line - MovementQty modified called from MovementQty
public final void transpose(){ float temp; temp=this.m10; this.m10=this.m01; this.m01=temp; temp=this.m20; this.m20=this.m02; this.m02=temp; temp=this.m30; this.m30=this.m03; this.m03=temp; temp=this.m21; this.m21=this.m12; this.m12=temp; temp=this.m31; this.m31=this.m13; this.m13=temp; temp=this.m32; this.m32=this.m23; this.m23=temp; }
Sets the value of this matrix to its transpose in place.
public static boolean isMarkup(int c){ return c == '<' || c == '&' || c == '%'; }
Returns true if the specified character can be considered markup. Markup characters include '&lt;', '&amp;', and '%'.
public JpaRepositoryTransition(String machineId,JpaRepositoryState source,JpaRepositoryState target,String event,Set<JpaRepositoryAction> actions){ this.machineId=machineId; this.source=source; this.target=target; this.event=event; this.actions=actions; }
Instantiates a new jpa repository transition.
protected double computeScale(){ Double scale=null; ColladaAsset asset=this.getAsset(); if (asset != null) { ColladaUnit unit=asset.getUnit(); if (unit != null) scale=unit.getMeter(); } return (scale != null) ? scale : 1.0; }
Indicates the scale defined by the asset/unit element. This scale converts the document's units to meters.
static void validateInstance(){ checkNotNull(defaultSessionConfiguration,"Login Configuration must be set using initialize before use"); }
Checks defaultSessionConfiguration for null
public synchronized Name makeNewName(final Evidence log,final String logType){ final Date timestamp=log.timestamp; final int progressive=getNewProgressive(); if (Cfg.DEBUG) { Check.asserts(progressive >= 0,"makeNewName fail progressive >=0"); } final String basePath=Path.logs(); final String blockDir=prefix + (progressive / LOG_PER_DIRECTORY); final String mask=M.e("0000"); final String ds=Long.toString(progressive % 10000); final int size=mask.length() - ds.length(); if (Cfg.DEBUG) { Check.asserts(size >= 0,"makeNewName: failed size>0"); } final String paddedProgressive=mask.substring(0,size) + ds; final String fileName=paddedProgressive + "" + logType+ ""+ makeDateName(timestamp); final String encName=encryptName(fileName + LOG_EXTENSION); if (Cfg.DEBUG) { Check.asserts(!encName.endsWith("mob"),"makeNewName: " + encName + " ch: "+ seed+ " not scrambled: "+ fileName+ LOG_EXTENSION); } final Name name=new Name(); name.progressive=progressive; name.basePath=basePath; name.blockDir=blockDir; name.encName=encName; name.fileName=fileName; return name; }
Make new name.
public static String toString(JSONArray ja) throws JSONException { int i; JSONObject jo; String key; Iterator keys; int length; Object object; StringBuffer sb=new StringBuffer(); String tagName; String value; tagName=ja.getString(0); XML.noSpace(tagName); tagName=XML.escape(tagName); sb.append('<'); sb.append(tagName); object=ja.opt(1); if (object instanceof JSONObject) { i=2; jo=(JSONObject)object; keys=jo.keys(); while (keys.hasNext()) { key=keys.next().toString(); XML.noSpace(key); value=jo.optString(key); if (value != null) { sb.append(' '); sb.append(XML.escape(key)); sb.append('='); sb.append('"'); sb.append(XML.escape(value)); sb.append('"'); } } } else { i=1; } length=ja.length(); if (i >= length) { sb.append('/'); sb.append('>'); } else { sb.append('>'); do { object=ja.get(i); i+=1; if (object != null) { if (object instanceof String) { sb.append(XML.escape(object.toString())); } else if (object instanceof JSONObject) { sb.append(toString((JSONObject)object)); } else if (object instanceof JSONArray) { sb.append(toString((JSONArray)object)); } } } while (i < length); sb.append('<'); sb.append('/'); sb.append(tagName); sb.append('>'); } return sb.toString(); }
Reverse the JSONML transformation, making an XML text from a JSONArray.
public AccessibilityNodeInfo focusSearch(int direction){ enforceSealed(); enforceValidFocusDirection(direction); if (!canPerformRequestOverConnection(mSourceNodeId)) { return null; } return AccessibilityInteractionClient.getInstance().focusSearch(mConnectionId,mWindowId,mSourceNodeId,direction); }
Searches for the nearest view in the specified direction that can take the input focus.
public T caseDefaultImportSpecifier(DefaultImportSpecifier object){ return null; }
Returns the result of interpreting the object as an instance of '<em>Default Import Specifier</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
public Node selectSingleNode(Node contextNode,String str,Node namespaceNode) throws TransformerException { NodeIterator nl=selectNodeIterator(contextNode,str,namespaceNode); return nl.nextNode(); }
Use an XPath string to select a single node. XPath namespace prefixes are resolved from the namespaceNode.
private EmrCluster createEmrClusterInRunningState(String namespace,String emrClusterDefinitionName){ String amiVersion=MockAwsOperationsHelper.AMAZON_CLUSTER_STATUS_RUNNING; return createEmrCluster(namespace,emrClusterDefinitionName,amiVersion); }
Creates a new EMR cluster in WAITING state. Any namespace and cluster definition are also created in current persistence. AMI version is used to hint mock implementation to create cluster in RUNNING state.
protected void showErrorDialog(StatusAdapter statusAdapter){ if (ignore(statusAdapter.getStatus())) { return; } if (!PlatformUI.isWorkbenchRunning()) { WorkbenchPlugin.log(statusAdapter.getStatus()); return; } Dialog dialog=null; if (statusAdapter.getStatus().getException() instanceof BusinessException) { dialog=new BusinessExceptionDialog(null,(BusinessException)statusAdapter.getStatus().getException()); } else { String message=statusAdapter.getStatus().getMessage(); if (StringUtils.isEmpty(message)) { message=statusAdapter.getStatus().getException().getMessage(); } dialog=new ThrowableDialog(null,message,statusAdapter.getStatus().getException()); } dialog.open(); }
Shows new style of error dialogs.
public void mouseClicked(MouseEvent e){ if (SwingUtilities.isRightMouseButton(e)) adaptee.popupMenu.show((Component)e.getSource(),e.getX(),e.getY()); }
Mouse Listener
public CRegisterMenuProvider(final CDebugPerspectiveModel debugPerspectiveModel,final CRegisterProvider dataProvider){ Preconditions.checkNotNull(debugPerspectiveModel,"IE01219: Debug perspective model argument can not be null"); Preconditions.checkNotNull(dataProvider,"IE01474: Data provider argument can not be null"); m_debugPerspectiveModel=debugPerspectiveModel; m_dataProvider=dataProvider; }
Creates a new register view menu provider.
private static Domain extractPartialDomain(Node mainNode,Domain domain,String rootpath,boolean fullExtract){ if (mainNode.getNodeName().equals("domain")) { NodeList firstElements=mainNode.getChildNodes(); for (int j=0; j < firstElements.getLength(); j++) { Node node=firstElements.item(j); domain=extractPartialDomain(node,domain,rootpath,fullExtract); } } else if (fullExtract && mainNode.getNodeName().equals("settings")) { Properties settings=XMLUtils.extractMapping(mainNode); domain.getSettings().fillSettings(settings); } else if (fullExtract && mainNode.getNodeName().equals("function") && mainNode.getAttributes().getNamedItem("name") != null) { String name=mainNode.getAttributes().getNamedItem("name").getNodeValue(); String functionStr=mainNode.getTextContent().trim(); try { Class<?> clazz=Class.forName(functionStr); @SuppressWarnings("unchecked") Function<List<String>,Value> f=(Function<List<String>,Value>)clazz.newInstance(); domain.getSettings(); Settings.addFunction(name,f); } catch ( Exception e) { log.warning("cannot load function : " + e); } } else if (fullExtract && mainNode.getNodeName().equals("initialstate")) { BNetwork state=XMLStateReader.getBayesianNetwork(mainNode); domain.setInitialState(new DialogueState(state)); } else if (fullExtract && mainNode.getNodeName().equals("model")) { Model model=createModel(mainNode); domain.addModel(model); } else if (fullExtract && mainNode.getNodeName().equals("parameters")) { BNetwork parameters=XMLStateReader.getBayesianNetwork(mainNode); domain.setParameters(parameters); } else if (mainNode.getNodeName().equals("import") && mainNode.hasAttributes() && mainNode.getAttributes().getNamedItem("href") != null) { String fileName=mainNode.getAttributes().getNamedItem("href").getNodeValue(); String filepath=rootpath == null ? fileName : rootpath + File.separator + fileName; domain.addImportedFiles(new File(filepath)); Document subdoc=XMLUtils.getXMLDocument(filepath); domain=extractPartialDomain(XMLUtils.getMainNode(subdoc),domain,rootpath,fullExtract); } else if (fullExtract && XMLUtils.hasContent(mainNode)) { if (mainNode.getNodeName().equals("#text")) { throw new RuntimeException("cannot insert free text in <domain>"); } throw new RuntimeException("Invalid tag in <domain>: " + mainNode.getNodeName()); } return domain; }
Extracts a partially specified domain from the XML node and add its content to the dialogue domain.
public static String toBase64(byte[] input){ return new Base64().encodeToString(input); }
Converts binary data to a Base64-String.
@SuppressWarnings("unchecked") public static Class<? extends Enum<?>> findEnumType(Enum<?> en){ Class<?> ec=en.getClass(); if (ec.getSuperclass() != Enum.class) { ec=ec.getSuperclass(); } return (Class<? extends Enum<?>>)ec; }
Helper method that can be used to dynamically figure out formal enumeration type (class) for given enumeration. This is either class of enum instance (for "simple" enumerations), or its superclass (for enums with instance fields or methods)
@Override public boolean handleMessage(Message msg){ loadingDialog.dismiss(); if (msg.what == 1) { adapter.setSubscriptions(subscriptions); adapter.notifyDataSetChanged(); } else { Toast.makeText(SubscriptionListActivity.this,errMsg,Toast.LENGTH_SHORT).show(); } return true; }
Callback interface you can use when instantiating a Handler to avoid having to implement your own subclass of Handler. handleMessage() defines the operations to perform when the Handler receives a new Message to process.
private void appendTypeParameterSignaturesLabel(String[] typeParamSigs,StringBuilder builder){ if (typeParamSigs.length > 0) { builder.append(getLT()); for (int i=0; i < typeParamSigs.length; i++) { if (i > 0) { builder.append(JavaElementLabels.COMMA_STRING); } builder.append(Signature.getTypeVariable(typeParamSigs[i])); } builder.append(getGT()); } }
Appends labels for type parameters from a signature.
public void testDefaults() throws Exception { ClassicSimilarity sim=getSimilarity("text",ClassicSimilarity.class); assertEquals(true,sim.getDiscountOverlaps()); }
Classic w/ default parameters
private void insertLineDetail(){ if (!m_report.isListSources()) return; log.info(""); for (int line=0; line < m_lines.length; line++) { if (m_lines[line].isLineTypeSegmentValue()) insertLineSource(line); } StringBuffer sql=new StringBuffer("DELETE FROM T_Report WHERE ABS(LevelNo)<>0").append(" AND Col_0 IS NULL AND Col_1 IS NULL AND Col_2 IS NULL AND Col_3 IS NULL AND Col_4 IS NULL AND Col_5 IS NULL AND Col_6 IS NULL AND Col_7 IS NULL AND Col_8 IS NULL AND Col_9 IS NULL").append(" AND Col_10 IS NULL AND Col_11 IS NULL AND Col_12 IS NULL AND Col_13 IS NULL AND Col_14 IS NULL AND Col_15 IS NULL AND Col_16 IS NULL AND Col_17 IS NULL AND Col_18 IS NULL AND Col_19 IS NULL AND Col_20 IS NULL"); int no=DB.executeUpdate(sql.toString(),get_TrxName()); log.fine("Deleted empty #=" + no); sql=new StringBuffer("UPDATE T_Report r1 " + "SET SeqNo = (SELECT SeqNo " + "FROM T_Report r2 "+ "WHERE r1.AD_PInstance_ID=r2.AD_PInstance_ID AND r1.PA_ReportLine_ID=r2.PA_ReportLine_ID"+ " AND r2.Record_ID=0 AND r2.Fact_Acct_ID=0)"+ "WHERE SeqNo IS NULL"); no=DB.executeUpdate(sql.toString(),get_TrxName()); log.fine("SeqNo #=" + no); if (!m_report.isListTrx()) return; String sql_select="SELECT e.Name, fa.Description " + "FROM Fact_Acct fa" + " INNER JOIN AD_Table t ON (fa.AD_Table_ID=t.AD_Table_ID)"+ " INNER JOIN AD_Element e ON (t.TableName||'_ID'=e.ColumnName) "+ "WHERE r.Fact_Acct_ID=fa.Fact_Acct_ID"; sql=new StringBuffer("UPDATE T_Report r SET (Name,Description)=(").append(sql_select).append(") " + "WHERE Fact_Acct_ID <> 0 AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no=DB.executeUpdate(sql.toString(),get_TrxName()); if (CLogMgt.isLevelFinest()) log.fine("Trx Name #=" + no + " - "+ sql.toString()); }
Insert Detail Lines if enabled
private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter,java.lang.String namespace) throws javax.xml.stream.XMLStreamException { java.lang.String prefix=xmlWriter.getPrefix(namespace); if (prefix == null) { prefix=generatePrefix(namespace); while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { prefix=org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } xmlWriter.writeNamespace(prefix,namespace); xmlWriter.setPrefix(prefix,namespace); } return prefix; }
Register a namespace prefix
@Override public Long rpush(final byte[] key,final byte[]... strings){ checkIsInMultiOrPipeline(); client.rpush(key,strings); return client.getIntegerReply(); }
Add the string value to the head (LPUSH) or tail (RPUSH) of the list stored at key. If the key does not exist an empty list is created just before the append operation. If the key exists but is not a List an error is returned. <p> Time complexity: O(1)
private void handleHttpRequestToHelloWorld(final HttpServerRequest httpRequest){ vertx.eventBus().send(Services.HELLO_WORLD.toString(),HelloWorldOperations.SAY_HELLO_WORLD.toString(),null); }
This REST endpoint if for hello. It invokes the hello world service via the event bus.
public final void handleElement(Element elt,Object data){ }
Notifies the UserAgent that the input element has been found in the document. This is sometimes called, for example, to handle &lt;a&gt; or &lt;title&gt; elements in a UserAgent-dependant way.
public boolean isResubscribe(){ return resubscribe; }
Gets the value of the resubscribe property.
public CyclicXYItemRenderer(int type){ super(type); }
Creates a new renderer.
public Source<String> ofFixedNumberOfCodePoints(int codePoints){ ArgumentAssertions.checkArguments(codePoints >= 0,"The number of codepoints cannot be negative; %s is not an accepted argument",codePoints); return Strings.ofFixedNumberOfCodePointsStrings(minCodePoint,maxCodePoint,codePoints); }
Generates Strings of a fixed number of code points. Will shrink by reducing the numeric value of code points in tandem.
public void clearIndex() throws IOException { if (indexWriter != null) { indexWriter.deleteAll(); } }
Clears the index of all documents
public static Executor createExecutor(int threadPoolSize,int threadPriority,QueueProcessingType tasksProcessingType){ boolean lifo=tasksProcessingType == QueueProcessingType.LIFO; BlockingQueue<Runnable> taskQueue=lifo ? new LIFOLinkedBlockingDeque<Runnable>() : new LinkedBlockingQueue<Runnable>(); return new ThreadPoolExecutor(threadPoolSize,threadPoolSize,0L,TimeUnit.MILLISECONDS,taskQueue,createThreadFactory(threadPriority)); }
Creates default implementation of task executor
public ChunkedArrayIterator(final E[] a){ this(a.length,a,null); }
An iterator that visits the elements in the given array.
public String toString(){ return toXML(false); }
Devuelve los valores de la instancia en una cadena de caracteres.
public void close(){ if (connected) { try { transport.close(); socket.close(); } catch ( IOException ex) { logger.warn("Could not close socket",ex); } connected=false; } }
Closes this <tt>TCPSlaveConnection</tt>.
public BufferedImage findBestMatch(final BufferedImage original,final ImageSearchHits hits,double scalePercentage,IndexReader reader) throws IOException { assert original != null; assert hits != null; WeightingData bestHit=null; float bestRating=Float.NEGATIVE_INFINITY; for (int i=0; i < hits.length(); i++) { Document doc=reader.document(hits.documentID(i)); String file=doc.getField(DocumentBuilder.FIELD_NAME_IDENTIFIER).stringValue(); WeightingData data=weightingDataFactory_.newInstance(doc); data.setRelevancy((float)hits.score(i)); data.setSlice(original); data.setId(file); data.setScalePercentage(scalePercentage); float weight=getWeightedRelevancy(data); if (outweightImageReuse) { if (file2occurence.containsKey(file)) weight*=1f / (((float)file2occurence.get(file)) + 1f); } if (bestRating < weight) { bestRating=weight; bestHit=data; } } for ( EngineObserver observer : observer_) observer.notifyState(bestHit,EngineObserver.USED); if (outweightImageReuse) { if (file2occurence.containsKey(bestHit.getId())) file2occurence.put(bestHit.getId(),file2occurence.get(bestHit.getId()) + 1); else file2occurence.put(bestHit.getId(),1); } return bestHit.getReplacement(); }
<p>Evaluates the search results provided by LIRE and returns the best available match.</p> <p>This method takes two aspects into account: First, it uses the relevancy factor as provided by LIRE; second, it uses implementation instances of the <code>WeightingStrategy</code> interface added to this interface.</p>
public void invert(){ for (int i=0; i < m_Selected.length; i++) { m_Selected[i]=!m_Selected[i]; } fireTableRowsUpdated(0,m_Selected.length); }
Inverts the selected status of each attribute.
public EntryStream<K,V> peekValues(Consumer<? super V> valueAction){ return peek(null); }
Returns a stream consisting of the entries of this stream, additionally performing the provided action on each entry value as entries are consumed from the resulting stream. <p> This is an <a href="package-summary.html#StreamOps">intermediate</a> operation. <p> For parallel stream pipelines, the action may be called at whatever time and in whatever thread the element is made available by the upstream operation. If the action modifies shared state, it is responsible for providing the required synchronization.
public void test_DivideBigDecimalRoundingModeCEILING(){ String a="3736186567876876578956958765675671119238118911893939591735"; String b="74723342238476237823787879183470"; RoundingMode rm=RoundingMode.CEILING; String c="50000260373164286401361914"; BigDecimal aNumber=new BigDecimal(new BigInteger(a)); BigDecimal bNumber=new BigDecimal(new BigInteger(b)); BigDecimal result=aNumber.divide(bNumber,rm); assertEquals("incorrect value",c,result.toString()); }
java.math.BigDecimal#divide(java.math.BigDecimal, java.math.RoundingMode) divide(BigDecimal, RoundingMode)
public int run(String[] argv) throws Exception { Args args=new Args(); CmdLineParser parser=new CmdLineParser(args,ParserProperties.defaults().withUsageWidth(100)); try { parser.parseArgument(argv); } catch ( CmdLineException e) { System.err.println(e.getMessage()); parser.printUsage(System.err); return -1; } LOG.info("Tool name: " + ComputeBigramRelativeFrequencyPairs.class.getSimpleName()); LOG.info(" - input path: " + args.input); LOG.info(" - output path: " + args.output); LOG.info(" - num reducers: " + args.numReducers); LOG.info(" - text output: " + args.textOutput); Job job=Job.getInstance(getConf()); job.setJobName(ComputeBigramRelativeFrequencyPairs.class.getSimpleName()); job.setJarByClass(ComputeBigramRelativeFrequencyPairs.class); job.setNumReduceTasks(args.numReducers); FileInputFormat.setInputPaths(job,new Path(args.input)); FileOutputFormat.setOutputPath(job,new Path(args.output)); job.setMapOutputKeyClass(PairOfStrings.class); job.setMapOutputValueClass(FloatWritable.class); job.setOutputKeyClass(PairOfStrings.class); job.setOutputValueClass(FloatWritable.class); if (args.textOutput) { job.setOutputFormatClass(TextOutputFormat.class); } else { job.setOutputFormatClass(SequenceFileOutputFormat.class); } job.setMapperClass(MyMapper.class); job.setCombinerClass(MyCombiner.class); job.setReducerClass(MyReducer.class); job.setPartitionerClass(MyPartitioner.class); Path outputDir=new Path(args.output); FileSystem.get(getConf()).delete(outputDir,true); long startTime=System.currentTimeMillis(); job.waitForCompletion(true); System.out.println("Job Finished in " + (System.currentTimeMillis() - startTime) / 1000.0 + " seconds"); return 0; }
Runs this tool.
@Override public int eDerivedOperationID(int baseOperationID,Class<?> baseClass){ if (baseClass == TypeProvidingElement.class) { switch (baseOperationID) { case N4JSPackage.TYPE_PROVIDING_ELEMENT___GET_DECLARED_TYPE_REF: return N4JSPackage.SETTER_DECLARATION___GET_DECLARED_TYPE_REF; default : return super.eDerivedOperationID(baseOperationID,baseClass); } } if (baseClass == FieldAccessor.class) { switch (baseOperationID) { case N4JSPackage.FIELD_ACCESSOR___GET_DECLARED_TYPE_REF: return N4JSPackage.SETTER_DECLARATION___GET_DECLARED_TYPE_REF; case N4JSPackage.FIELD_ACCESSOR___GET_DEFINED_ACCESSOR: return N4JSPackage.SETTER_DECLARATION___GET_DEFINED_ACCESSOR; default : return super.eDerivedOperationID(baseOperationID,baseClass); } } return super.eDerivedOperationID(baseOperationID,baseClass); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public UserProfilesImpl(){ list=new ArrayList(); }
Construye un objeto de la clase.
public GitFetchResult fetch(@NotNull GitRepository repository){ GitFetchResult fetchResult=GitFetchResult.success(); if (myFetchAll) { fetchResult=fetchAll(repository,fetchResult); } else { return fetchCurrentRemote(repository); } VfsUtil.markDirtyAndRefresh(false,true,false,repository.getGitDir()); return fetchResult; }
Invokes 'git fetch'.
protected void updateEntry(final HashEntry<K,V> entry,final V newValue){ entry.setValue(newValue); }
Updates an existing key-value mapping to change the value. <p> This implementation calls <code>setValue()</code> on the entry. Subclasses could override to handle changes to the map.
private Object _evaluate(Object element){ if (element == null) { return null; } int index=expr.indexOf("="); if (index != -1) { return _evaluate(element,index); } index=expr.indexOf(">"); if (index != -1) { return _evaluate(element,index); } index=expr.indexOf("<"); if (index != -1) { return _evaluate(element,index); } index=expr.indexOf("%"); if (index != -1) { return _evaluate(element,index); } return _evaluateSingle(element); }
This internal method takes care of determining the style of expression (less-than, greater-than, equals, etc), and passing on the to next internal processor.
public double computeAverageLocalOfObservationsWhileComputingDistances() throws Exception { int N=continuousData.length; double averageDiGammas=0; double avNx=0; double avNy=0; double testSum=0.0; for (int t=0; t < N; t++) { double[] norms=new double[N]; for (int t2=0; t2 < N; t2++) { if (t2 == t) { norms[t2]=Double.POSITIVE_INFINITY; continue; } norms[t2]=normCalculator.norm(continuousData[t],continuousData[t2]); } double eps_x=MatrixUtils.kthMinSubjectTo(norms,k,discreteData,discreteData[t]); int n_x=0; for (int t2=0; t2 < N; t2++) { if (norms[t2] <= eps_x) { n_x++; } } int n_y=counts[discreteData[t]] - 1; avNx+=n_x; avNy+=n_y; double localSum=MathsUtils.digamma(n_x) + MathsUtils.digamma(n_y); averageDiGammas+=localSum; if (debug) { double localValue=MathsUtils.digamma(k) - localSum + MathsUtils.digamma(N); testSum+=localValue; if (dimensions == 1) { System.out.printf("t=%d: x=%.3f, eps_x=%.3f, n_x=%d, n_y=%d, local=%.3f, running total = %.5f\n",t,continuousData[t][0],eps_x,n_x,n_y,localValue,testSum); } else { System.out.printf("t=%d: eps_x=%.3f, n_x=%d, n_y=%d, local=%.3f, running total = %.5f\n",t,eps_x,n_x,n_y,localValue,testSum); } } } averageDiGammas/=(double)N; if (debug) { avNx/=(double)N; avNy/=(double)N; System.out.println(String.format("Average n_x=%.3f, Average n_y=%.3f",avNx,avNy)); } mi=MathsUtils.digamma(k) - averageDiGammas + MathsUtils.digamma(N); miComputed=true; return mi; }
This method correctly computes the average local MI, but recomputes the x and y distances between all tuples in time. Kept here for cases where we have too many observations to keep the norm between all pairs, and for testing purposes.
@DSComment("constructor") @DSSafe(DSCat.SAFE_OTHERS) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:35:07.567 -0500",hash_original_method="36F25878FE380B4CEA8E7C4B89DDFC1A",hash_generated_method="366843CDEB60ED07212DE3CF20310076") public ComponentName(Context pkg,String cls){ if (cls == null) throw new NullPointerException("class name is null"); mPackage=pkg.getPackageName(); mClass=cls; }
Create a new component identifier from a Context and class name.
@Override protected EClass eStaticClass(){ return FunctionblockPackage.Literals.PARAM; }
<!-- begin-user-doc --> <!-- end-user-doc -->
@Override public void start(){ super.start(); }
Called before the delegate will run.
protected void rejectDrop(){ DropTargetContextPeer peer=getDropTargetContextPeer(); if (peer != null) { peer.rejectDrop(); } }
called to signal that the drop is unacceptable. must be called during DropTargetListener.drop method invocation.
public Collapser(){ }
Provide a collapser to manage a set of collapsed nodes.
public List<NamedRelatedResourceRep> listByVirtualArray(URI virtualArrayId,String provisioningType,Boolean uniqueNames){ UriBuilder builder=client.uriBuilder(PathConstants.AUTO_TIER_BY_VARRAY_URL); if ((provisioningType != null) && (provisioningType.length() > 0)) { builder.queryParam("provisioning_type",provisioningType); } if (uniqueNames != null) { builder.queryParam("unique_auto_tier_policy_names",uniqueNames); } return getList(builder.build(virtualArrayId)); }
Lists all auto tier policies for a given virtual array. <p> API Call: <tt>GET /vdc/varrays/{virtualArrayId}/auto-tier-policies?provisioning_type={provisioningType} unique_auto_tier_policy_names={uniqueNames}</tt>
public static int nextOid(long[] index,int start) throws SnmpStatusException { if (start + 4 <= index.length) { return start + 4; } else { throw new SnmpStatusException(SnmpStatusException.noSuchName); } }
Scans an index OID, skips the address value and returns the position of the next value.
public BarChartProgressView loadStyledAttributes(TypedArray attributes,ChartProgressAttr progress){ mAttributes=attributes; mChartProgressAttr=progress; mIsFuture=progress == null ? false : progress.isFuture(); Resources res=getContext().getResources(); if (attributes != null) { mCompletedColor=attributes.getColor(R.styleable.SlidePager_slide_progress_bar_chart_completed_color,res.getColor(R.color.default_progress_completed_reach_color)); mNotCompletedColor=attributes.getColor(R.styleable.SlidePager_slide_progress_bar_chart_not_completed_color,res.getColor(R.color.default_progress_not_completed_reach_color)); mFutureColor=attributes.getColor(R.styleable.SlidePager_slide_progress_bar_chart_future_color,res.getColor(R.color.default_progress_chart_bar_color)); mTodayColor=attributes.getColor(R.styleable.SlidePager_slide_progress_bar_chart_today_color,res.getColor(R.color.default_progress_special_reach_color)); mBarWidth=attributes.getDimension(R.styleable.SlidePager_slide_progress_bar_chart_bar_width,res.getDimension(R.dimen.bar_view_default_width)); mBarVisibleNullValue=attributes.getBoolean(R.styleable.SlidePager_slide_progress_bar_chart_null_value_bar_display,true); mCheckMarkVisible=attributes.getBoolean(R.styleable.SlidePager_slide_progress_bar_chart_check_mark_visible,true); mHasToReanimate=mAttributes.getBoolean(R.styleable.SlidePager_slide_pager_reanimate_slide_view,true); } else { mCompletedColor=res.getColor(R.color.default_progress_completed_reach_color); mNotCompletedColor=res.getColor(R.color.default_progress_not_completed_reach_color); mFutureColor=res.getColor(R.color.default_progress_chart_bar_color); mTodayColor=res.getColor(R.color.default_progress_special_reach_color); mBarWidth=res.getDimension(R.dimen.bar_view_default_width); mBarVisibleNullValue=true; mCheckMarkVisible=true; mHasToReanimate=true; } setBarColorsAndSize(); initAnimations(); return this; }
Loads the styles and attributes defined in the xml tag of this class
public void test3a(){ final JPanel panel=new JPanel(new GridLayoutManager(2,3,new Insets(0,0,0,0),1000,0)); final JButton btn1=new JButton(); btn1.setPreferredSize(new Dimension(100,20)); final JButton btn2=new JButton(); btn2.setPreferredSize(new Dimension(100,20)); final JButton btn3=new JButton(); btn3.setPreferredSize(new Dimension(100,20)); final JButton btn4=new JButton(); btn4.setPreferredSize(new Dimension(100,20)); panel.add(btn1,new GridConstraints(0,0,1,1,GridConstraints.ANCHOR_CENTER,GridConstraints.FILL_HORIZONTAL,GridConstraints.SIZEPOLICY_CAN_GROW,GridConstraints.SIZEPOLICY_FIXED,null,null,null,0)); panel.add(btn2,new GridConstraints(0,1,1,1,GridConstraints.ANCHOR_CENTER,GridConstraints.FILL_HORIZONTAL,GridConstraints.SIZEPOLICY_CAN_GROW,GridConstraints.SIZEPOLICY_FIXED,null,null,null,0)); panel.add(btn3,new GridConstraints(1,0,1,2,GridConstraints.ANCHOR_CENTER,GridConstraints.FILL_HORIZONTAL,GridConstraints.SIZEPOLICY_CAN_GROW,GridConstraints.SIZEPOLICY_FIXED,null,null,null,0)); panel.add(btn4,new GridConstraints(0,2,1,1,GridConstraints.ANCHOR_CENTER,GridConstraints.FILL_HORIZONTAL,GridConstraints.SIZEPOLICY_CAN_GROW,GridConstraints.SIZEPOLICY_FIXED,null,null,null,0)); final Dimension preferredSize=panel.getPreferredSize(); assertEquals(2300,preferredSize.width); panel.setSize(panel.getPreferredSize()); panel.doLayout(); }
btn1 | btn2 | btn4 btn3 (span 2) |
private void socksBind() throws IOException { try { IoBridge.connect(fd,socksGetServerAddress(),socksGetServerPort()); } catch ( Exception e) { throw new IOException("Unable to connect to SOCKS server",e); } if (lastConnectedAddress == null) { throw new SocketException("Invalid SOCKS client"); } socksSendRequest(Socks4Message.COMMAND_BIND,lastConnectedAddress,lastConnectedPort); Socks4Message reply=socksReadReply(); if (reply.getCommandOrResult() != Socks4Message.RETURN_SUCCESS) { throw new IOException(reply.getErrorString(reply.getCommandOrResult())); } if (reply.getIP() == 0) { address=socksGetServerAddress(); } else { byte[] replyBytes=new byte[4]; Memory.pokeInt(replyBytes,0,reply.getIP(),ByteOrder.BIG_ENDIAN); address=InetAddress.getByAddress(replyBytes); } localport=reply.getPort(); }
Bind using a SOCKS server.
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){ switch (featureID) { case UmplePackage.INTERFACE_MEMBER_DECLARATION___CONSTANT_DECLARATION_1: return getConstantDeclaration_1(); case UmplePackage.INTERFACE_MEMBER_DECLARATION___ABSTRACT_METHOD_DECLARATION_1: return getAbstractMethodDeclaration_1(); case UmplePackage.INTERFACE_MEMBER_DECLARATION___POSITION_1: return getPosition_1(); case UmplePackage.INTERFACE_MEMBER_DECLARATION___DISPLAY_COLOR_1: return getDisplayColor_1(); case UmplePackage.INTERFACE_MEMBER_DECLARATION___IS_A1: return getIsA_1(); case UmplePackage.INTERFACE_MEMBER_DECLARATION___EXTRA_CODE_1: return getExtraCode_1(); } return super.eGet(featureID,resolve,coreType); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public static int[] randPermute(int floor,int ceil){ int[] permute=new int[ceil - floor]; Random randi=new Random(); for (int i=floor; i < ceil; i++) { int j=randi.nextInt(i - floor + 1); if (j != i - floor) { permute[i - floor]=permute[j]; } permute[j]=i; } return permute; }
Returns a random permutation of all the integers between floor (inclusive) and ceil (exclusive).
public final void writeBytes(char b[],int off,int len) throws IOException { for (int i=off; i < len; i++) { write((byte)b[i]); } }
Writes the character array to the file as a sequence of bytes. Each character in the string is written out, in sequence, by discarding its high eight bits.
private void adjustByteCounts(){ if (byteCount1 > 0x1fffffffffffffffL) { byteCount2+=(byteCount1 >>> 61); byteCount1&=0x1fffffffffffffffL; } }
adjust the byte counts so that byteCount2 represents the upper long (less 3 bits) word of the byte count.
public void writeUnsafeTo(final PacketOutputStream os) throws IOException { if (loadedStream == null) writeObjectToBytes(); ParameterWriter.writeUnsafe(os,loadedStream,noBackSlashEscapes); }
Write object to buffer for text protocol without checking buffer size.
public static RectF adjustToFitInBounds(RectF rect,int viewportWidth,int viewportHeight){ float dx=0, dy=0; RectF newRect=new RectF(rect); if (newRect.width() < viewportWidth) { dx=viewportWidth / 2 - (newRect.left + newRect.right) / 2; } else { if (newRect.left > 0) { dx=-newRect.left; } else if (newRect.right < viewportWidth) { dx=viewportWidth - newRect.right; } } if (newRect.height() < viewportHeight) { dy=viewportHeight / 2 - (newRect.top + newRect.bottom) / 2; } else { if (newRect.top > 0) { dy=-newRect.top; } else if (newRect.bottom < viewportHeight) { dy=viewportHeight - newRect.bottom; } } if (dx != 0 || dy != 0) { newRect.offset(dx,dy); } return newRect; }
If the given rect is smaller than viewport on x or y axis, center rect within viewport on the corresponding axis. Otherwise, make sure viewport is within the bounds of the rect.
public Polynomial times(double c){ Polynomial retval=new Polynomial(order); for (int i=0; i <= order; i++) retval.a[i]=c * a[i]; return retval; }
Computes the product of a constant and this polynomial. The product is returned as a new Polynomial. This polynomial is unchanged.
public Iterator<JsonElement> iterator(){ return elements.iterator(); }
Returns an iterator to navigate the elements of the array. Since the array is an ordered list, the iterator navigates the elements in the order they were inserted.
private void writeAssignmentIdentifiers(long triggerProcessKey) throws Exception { UserAssignmentIdentifiers userAssignmentIds=determineUserAssignmentIds(triggerProcessKey); createTriggerProcessIdentifier(triggerProcessKey,TriggerProcessIdentifierName.SUBSCRIPTION_ID,userAssignmentIds.getSubscriptionId()); for ( String userIdToAdd : userAssignmentIds.getUsersToAdd()) { createTriggerProcessIdentifier(triggerProcessKey,TriggerProcessIdentifierName.USER_TO_ADD,userIdToAdd); } for ( String userIdToRevoke : userAssignmentIds.getUsersToRevoke()) { createTriggerProcessIdentifier(triggerProcessKey,TriggerProcessIdentifierName.USER_TO_REVOKE,userIdToRevoke); } }
Determines the user assignment identifiers corresponding to the current trigger process and inserts an according entry in the database.
public static String block(String text){ return "{" + nl + indent(text)+ nl+ "}"; }
Indents the specified text, surrounds it with brackets and put the content on a separate line.
public final String yytext(){ return new String(zzBuffer,zzStartRead,zzMarkedPos - zzStartRead); }
Returns the text matched by the current regular expression.
public final int index(){ return m_Index; }
Returns the index of this attribute.
public static UnicodeSpec[] readSpecFile(File file,int plane) throws FileNotFoundException { ArrayList<UnicodeSpec> list=new ArrayList<>(3000); UnicodeSpec[] result=null; int count=0; BufferedReader f=new BufferedReader(new FileReader(file)); String line=null; loop: while (true) { try { line=f.readLine(); } catch ( IOException e) { break loop; } if (line == null) break loop; UnicodeSpec item=parse(line.trim()); int specPlane=item.getCodePoint() >>> 16; if (specPlane < plane) continue; if (specPlane > plane) break; if (item != null) { list.add(item); } } result=new UnicodeSpec[list.size()]; list.toArray(result); return result; }
Read and parse a Unicode data file.
public void saveToFile(){ String filePath=FileHelper.getCSVFile(); saveAsCsv(filePath); }
Save landmark data to a file
public void testShellAndHoleSelfTouch(){ String wkt="POLYGON ((0 0, 0 340, 320 340, 320 0, 120 0, 180 100, 60 100, 120 0, 0 0), (80 300, 80 180, 200 180, 200 240, 280 200, 280 280, 200 240, 200 300, 80 300))"; checkIsValidSTR(wkt,true); checkIsValidDefault(wkt,false); }
Tests a geometry with both a shell self-touch and a hole self=touch. This is valid if STR is allowed, but invalid in OGC
private void showSearchSuggestions(String query,SearchView searchView){ if (searchSuggestionsAdapter != null && searchSuggestionsList != null) { Timber.d("Populate search adapter - mySuggestions.size(): %d",searchSuggestionsList.size()); final MatrixCursor c=new MatrixCursor(new String[]{BaseColumns._ID,"categories"}); for (int i=0; i < searchSuggestionsList.size(); i++) { if (searchSuggestionsList.get(i) != null && searchSuggestionsList.get(i).toLowerCase().startsWith(query.toLowerCase())) c.addRow(new Object[]{i,searchSuggestionsList.get(i)}); } searchView.setSuggestionsAdapter(searchSuggestionsAdapter); searchSuggestionsAdapter.changeCursor(c); } else { Timber.e("Search adapter is null or search data suggestions missing"); } }
Show user search whisperer with generated suggestions.
protected void time(Calendar calendar) throws ParseException { try { String s=lexer.number(); int hour=Integer.parseInt(s); calendar.set(Calendar.HOUR_OF_DAY,hour); lexer.match(':'); s=lexer.number(); int min=Integer.parseInt(s); calendar.set(Calendar.MINUTE,min); lexer.match(':'); s=lexer.number(); int sec=Integer.parseInt(s); calendar.set(Calendar.SECOND,sec); } catch ( Exception ex) { throw createParseException("error processing time "); } }
Set the time field. This has the format hour:minute:second
protected static int storeDoubleAsF2Dot14(final double a){ return (int)((a * 16384) + 0.5); }
Takes a double and returns the value as a F2Dot14 number.
private void ensureEnumValueDescriptor(FieldDescriptor field,Object value){ if (field.isRepeated()) { for ( Object item : (List)value) { ensureSingularEnumValueDescriptor(field,item); } } else { ensureSingularEnumValueDescriptor(field,value); } }
Verifies the value for an enum field.
@SafeVarargs public static <E>ImmutableList<E> of(E e1,E e2,E e3,E e4,E e5,E e6,E e7,E e8,E e9,E e10,E e11,E e12,E... others){ Object[] array=new Object[12 + others.length]; array[0]=e1; array[1]=e2; array[2]=e3; array[3]=e4; array[4]=e5; array[5]=e6; array[6]=e7; array[7]=e8; array[8]=e9; array[9]=e10; array[10]=e11; array[11]=e12; System.arraycopy(others,0,array,12,others.length); return construct(array); }
Returns an immutable list containing the given elements, in order.
public BufferedDataOutputStream(String name) throws IOException { this(new FileOutputStream(name)); }
Open this output stream on the underlying output stream <code>new FileOutputStream(name)</code>.
public boolean isAppendStatics(){ return this.appendStatics; }
<p> Gets whether or not to append static fields. </p>
@HLEFunction(nid=0x5E7F79C9,version=150,checkInsideInterrupt=true) public int sceNetAdhocctlJoin(TPointer scanInfoAddr){ checkInitialized(); if (scanInfoAddr.isAddressGood()) { int nextAddr=scanInfoAddr.getValue32(0); int ch=scanInfoAddr.getValue32(4); String groupName=scanInfoAddr.getStringNZ(8,GROUP_NAME_LENGTH); String bssID=scanInfoAddr.getStringNZ(16,IBSS_NAME_LENGTH); int mode=scanInfoAddr.getValue32(24); if (log.isDebugEnabled()) { log.debug(String.format("sceNetAdhocctlJoin nextAddr 0x%08X, ch %d, groupName '%s', bssID '%s', mode %d",nextAddr,ch,groupName,bssID,mode)); } doJoin=true; setGroupName(groupName,PSP_ADHOCCTL_MODE_NORMAL); networkAdapter.sceNetAdhocctlJoin(); } return 0; }
Connect to the Adhoc control (as a client)
@Ignore @Test public void test_DR_PGS_NOMANUALSTART_4Nodes_Put_ValidateReceiver() throws Exception { try { Integer lnPort=(Integer)vm0.invoke(null); Integer nyPort=(Integer)vm1.invoke(null); createCacheInVMs(nyPort,vm2); vm2.invoke(null); vm2.invoke(null); createCacheInVMs(lnPort,vm4,vm5,vm6,vm7); vm4.invoke(null); vm5.invoke(null); vm6.invoke(null); vm7.invoke(null); vm4.invoke(null); vm5.invoke(null); vm6.invoke(null); vm7.invoke(null); vm4.invoke(null); vm4.invoke(null); vm5.invoke(null); vm6.invoke(null); vm7.invoke(null); vm4.invoke(null); vm5.invoke(null); vm6.invoke(null); vm7.invoke(null); vm2.invoke(null); } catch ( Exception e) { Assert.fail("Unexpected exception",e); } }
Below test is disabled intentionally 1> In this release 8.0, for rolling upgrade support queue name is changed to old style 2>Common parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about ParallelGatewaySenderQueue#convertPathToName 3> We have to enabled it in next release 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 and version prior to 8.0
boolean isReusable(){ return true; }
Returns true if this entry has no bucket links and can safely be reused as a terminal entry in a bucket in another map.
public int execute() throws IOException, InterruptedException { start(); return waitFor(); }
Starts the subprocess, waits for it to exit, and returns its exit status.
public File newFolder(String folder) throws IOException { return newFolder(new String[]{folder}); }
Returns a new fresh folder with the given name under the temporary folder.