code
stringlengths
10
174k
nl
stringlengths
3
129k
@Override public void passScoreAfterParsing(Text url,Content content,Parse parse) throws ScoringFilterException { LOG.info("------>WE ARE PUSHING FEEDBACK------:"); boolean containsSem=false; boolean semFather=false; try { containsSem=Boolean.parseBoolean(parse.getData().getMeta(WdcParser.META_CONTAINS_SEM)); LOG.info("------>GOT THE contains sem------:" + containsSem); semFather=Boolean.parseBoolean(parse.getData().getMeta(WdcParser.META_CONTAINS_SEM_FATHER)); } catch ( Exception e) { LOG.info("ERROR GETTING THE META DATA" + e.getMessage()); } try { AnthURL anthUrl=new AnthURL(hash(url.toString()),new URI(url.toString()),semFather,!semFather,false,false,containsSem); onlineClassifier.pushFeedback(anthUrl); } catch ( Exception uriE) { LOG.info("COULD NOT create proper URI from" + uriE.getMessage()); System.out.println("Could not create proper URI from: " + url + ". Skipping."); } parse.getData().getContentMeta().set(WdcParser.META_CONTAINS_SEM_FATHER_FOR_SUB,Boolean.toString(containsSem)); }
Pushes feedback in the online classifier for the current web page and sets the containsSemFather field for the outlinks
public WriteFileRecordRequest(){ super(); setFunctionCode(Modbus.WRITE_FILE_RECORD); setDataLength(1); }
Constructs a new <tt>Write File Record</tt> request instance.
public <T extends Comparable<T>>void findSimilarUsersFromTerms(String[] terms,LuceneUtils lUtils,int numResults,ArrayList<SemVectorResult<T>> docResult,QueryTransform<T> docTransform){ List<SearchResult> results; try { VectorSearcher vecSearcher=new VectorSearcher.VectorSearcherCosine(termVecReader,docVecReader,luceneUtils,flagConfig,terms); results=vecSearcher.getNearestNeighbors(numResults); } catch ( pitt.search.semanticvectors.vectors.ZeroVectorException e) { results=new LinkedList<>(); } for ( SearchResult r : results) { String filename=r.getObjectVector().getObject().toString(); docResult.add(new SemVectorResult<>(docTransform.fromSV(filename),r.getScore())); } }
Find similar users by querying the docstore using a query from the terms passed in
public KMLLatLonBox(String namespaceURI){ super(namespaceURI); }
Construct an instance.
protected Expression parseTypeExpression() throws SyntaxError, IOException { switch (token) { case VOID: return new TypeExpression(scan(),Type.tVoid); case BOOLEAN: return new TypeExpression(scan(),Type.tBoolean); case BYTE: return new TypeExpression(scan(),Type.tByte); case CHAR: return new TypeExpression(scan(),Type.tChar); case SHORT: return new TypeExpression(scan(),Type.tShort); case INT: return new TypeExpression(scan(),Type.tInt); case LONG: return new TypeExpression(scan(),Type.tLong); case FLOAT: return new TypeExpression(scan(),Type.tFloat); case DOUBLE: return new TypeExpression(scan(),Type.tDouble); case IDENT: Expression e=new IdentifierExpression(pos,scanner.idValue); scan(); while (token == FIELD) { e=new FieldExpression(scan(),e,scanner.idValue); expect(IDENT); } return e; } env.error(pos,"type.expected"); throw new SyntaxError(); }
Parse a type expression. Does not parse the []'s.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:31:07.524 -0500",hash_original_method="3F005229FAC5669CED0C1EDA320C3ED4",hash_generated_method="58DD3E2A538F54ACD2033ECAA73C07AE") public AllocationBuilder addIndexSetType(Primitive p){ Entry indexType=new Entry(); indexType.a=null; indexType.prim=p; mIndexTypes.addElement(indexType); return this; }
Adds an index set type to the builder
public int increment(int offset){ CharSequence txt=getText(); int i; if (txt != null) { try { i=Integer.parseInt(txt.toString()); } catch ( NumberFormatException e) { i=0; } } else { i=0; } i=i + offset; setText(String.valueOf(i)); return i; }
Increment the numeric badge label. If the current badge label cannot be converted to an integer value, its label will be set to "0".
public static double cdf(double x,double mu,double sigma,double skew){ x=(x - mu) / sigma; if (Math.abs(skew) > 0.) { double tmp=1 - skew * x; if (tmp < 1e-15) { return (skew < 0.) ? 0. : 1.; } x=-Math.log(tmp) / skew; } return .5 + .5 * NormalDistribution.erf(x * MathUtil.SQRTHALF); }
Cumulative probability density function (CDF) of a normal distribution.
public static void appendTemplateCallLabel(StringBuffer buffer,String labelTemplate,Map<String,RDFNode> args){ for (int i=0; i < labelTemplate.length(); i++) { if (i < labelTemplate.length() - 3 && labelTemplate.charAt(i) == '{' && labelTemplate.charAt(i + 1) == '?') { int varEnd=i + 2; while (varEnd < labelTemplate.length()) { if (labelTemplate.charAt(varEnd) == '}') { String varName=labelTemplate.substring(i + 2,varEnd); RDFNode varValue=args.get(varName); if (varValue instanceof Resource) { buffer.append(get().getLabel((Resource)varValue)); } else if (varValue instanceof Literal) { buffer.append(varValue.asNode().getLiteralLexicalForm()); } break; } else { varEnd++; } } i=varEnd; } else { buffer.append(labelTemplate.charAt(i)); } } }
Renders a template call's label template into a label by inserting the evaluated SPARQL expressions into appropriate spaces marked with {expression}. Currently only simple variables are supported, e.g. {?test }.
private static String[] delimitedListToStringArray(final String str,final String delimiter){ return delimitedListToStringArray(str,delimiter,null); }
Take a String which is a delimited list and convert it to a String array. <p> A single delimiter can consists of more than one character: It will still be considered as single delimiter string, rather than as bunch of potential delimiter characters - in contrast to <code>tokenizeToStringArray</code>.
public EC2Processor(PropertyHandler paramHandler,String instanceId){ this.ph=paramHandler; this.instanceId=instanceId; try { this.platformService=APPlatformServiceFactory.getInstance(); } catch ( IllegalStateException e) { LOGGER.error(e.getMessage()); throw e; } }
Constructs a new dispatcher.
AttributeListAdapter(){ }
Construct a new adapter.
private void badIndex(int index) throws ArrayIndexOutOfBoundsException { String msg="Attempt to modify attribute at illegal index: " + index; throw new ArrayIndexOutOfBoundsException(msg); }
Report a bad array index in a manipulator.
public final void sendTo(DataOutput out) throws IOException { finishWriting(); if (this.chunks != null) { for ( ByteBuffer bb : this.chunks) { int bytesToWrite=bb.remaining(); if (bytesToWrite > 0) { if (bb.hasArray()) { out.write(bb.array(),bb.arrayOffset() + bb.position(),bytesToWrite); bb.position(bb.limit()); } else { byte[] bytes=new byte[bytesToWrite]; bb.get(bytes); out.write(bytes); } this.size-=bytesToWrite; } } } { ByteBuffer bb=this.buffer; int bytesToWrite=bb.remaining(); if (bytesToWrite > 0) { if (bb.hasArray()) { out.write(bb.array(),bb.arrayOffset() + bb.position(),bytesToWrite); bb.position(bb.limit()); } else { byte[] bytes=new byte[bytesToWrite]; bb.get(bytes); out.write(bytes); } this.size-=bytesToWrite; } } }
Write the contents of this stream to the specified stream. <p> Note this implementation is exactly the same as writeTo(OutputStream) but they do not both implement a common interface.
public static void i(String tag,String msg,Throwable tr){ println(INFO,tag,msg,tr); }
Prints a message at INFO priority.
public void printPool(){ for ( Entry<VariableReference,Object> entry : pool.entrySet()) { System.out.println("Pool: " + entry.getKey().getName() + ", "+ entry.getKey().getType()+ " : "+ entry.getValue()); } }
Debug output
public DeclaredVersion createDeclaredVersion(){ DeclaredVersionImpl declaredVersion=new DeclaredVersionImpl(); return declaredVersion; }
<!-- begin-user-doc --> <!-- end-user-doc -->
@Override public final void flushObjectValues(final boolean reinit){ parser.flushObjectValues(reinit); }
provide method for outside class to clear store of objects once written out to reclaim memory
public void updateInventory(UpdateInventoryInput input) throws Exception { int sleep=ran.nextInt(1000); Thread.sleep(sleep); System.out.println("Inventory " + input.getPartId() + " updated"); }
To simulate updating the inventory by calling some external system which takes a bit of time
@DataProvider(name="builder") public Object[][] providesBuilder(){ return new Object[][]{{new Builder<Object,Object>().maximumWeightedCapacity(capacity())}}; }
Provides a builder with the capacity set.
public ActionErrors validateFile(ActionMapping mapping,HttpServletRequest request){ ActionErrors errors=new ActionErrors(); if ((fichero == null) || StringUtils.isBlank(fichero.getFileName())) { errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionError(Constants.ERROR_REQUIRED,Messages.getString(TransferenciasConstants.LABEL_TRANSFERENCIAS_IMPORT_FILE,request.getLocale()))); } return errors; }
Valida el formulario
public void newRepeat(){ mFormEntryController.newRepeat(); }
Creates a new repeated instance of the group referenced by the current FormIndex.
@Override synchronized public void shutdown(){ if (!isOpen()) return; final QueryEngine queryEngine=this.queryEngine.get(); if (queryEngine != null) { queryEngine.shutdown(); } if (concurrencyManager != null) { concurrencyManager.shutdown(); } if (localTransactionManager != null) { localTransactionManager.shutdown(); } if (resourceManager != null) { resourceManager.shutdown(); } super.shutdown(); }
Polite shutdown does not accept new requests and will shutdown once the existing requests have been processed.
@Override protected EClass eStaticClass(){ return N4JSPackage.Literals.PROPERTY_NAME_VALUE_PAIR_SINGLE_NAME; }
<!-- begin-user-doc --> <!-- end-user-doc -->
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.
@Override public ArrayList<ArrayList<Region>> defineRegions(ArrayList<ChartSet> data){ final int nSets=data.size(); final int nEntries=data.get(0).size(); ArrayList<ArrayList<Region>> result=new ArrayList<>(nSets); for (int i=0; i < nSets; i++) result.add(new ArrayList<Region>(nEntries)); float offset; BarSet barSet; Bar bar; for (int i=0; i < nEntries; i++) { offset=data.get(0).getEntry(i).getX() - drawingOffset; for (int j=0; j < nSets; j++) { barSet=(BarSet)data.get(j); bar=(Bar)barSet.getEntry(i); if (bar.getValue() > 0) result.get(j).add(new Region((int)offset,(int)bar.getY(),(int)(offset+=barWidth),(int)this.getZeroPosition())); else result.get(j).add(new Region((int)offset,(int)this.getZeroPosition(),(int)(offset+=barWidth),(int)bar.getY())); if (j != nSets - 1) offset+=style.setSpacing; } } return result; }
(Optional) To be overridden in order for each chart to define its own clickable regions. This way, classes extending ChartView will only define their clickable regions. Important: the returned vector must match the order of the data passed by the user. This ensures that onTouchEvent will return the correct index.
public boolean process(ContentEvent event){ Preconditions.checkState(ensembleSize == ensembleStreams.length,String.format("Ensemble size ({}) and number of enseble streams ({}) do not match.",ensembleSize,ensembleStreams.length)); InstanceContentEvent inEvent=(InstanceContentEvent)event; if (inEvent.getInstanceIndex() < 0) { for ( Stream stream : ensembleStreams) stream.put(event); return false; } if (inEvent.isTesting()) { Instance testInstance=inEvent.getInstance(); for (int i=0; i < ensembleSize; i++) { Instance instanceCopy=testInstance.copy(); InstanceContentEvent instanceContentEvent=new InstanceContentEvent(inEvent.getInstanceIndex(),instanceCopy,false,true); instanceContentEvent.setClassifierIndex(i); instanceContentEvent.setEvaluationIndex(inEvent.getEvaluationIndex()); ensembleStreams[i].put(instanceContentEvent); } } if (inEvent.isTraining()) { train(inEvent); } return true; }
On event.
public void testStmtExecuteLargeBatch() throws Exception { createTable("testExecuteLargeBatch","(id BIGINT AUTO_INCREMENT PRIMARY KEY, n INT)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (1)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (2)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (3)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (4)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (5), (6), (7)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (8)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (9), (10)"); long[] counts=this.stmt.executeLargeBatch(); assertEquals(7,counts.length); assertEquals(1,counts[0]); assertEquals(1,counts[1]); assertEquals(1,counts[2]); assertEquals(1,counts[3]); assertEquals(3,counts[4]); assertEquals(1,counts[5]); assertEquals(2,counts[6]); this.rs=this.stmt.getGeneratedKeys(); ResultSetMetaData rsmd=this.rs.getMetaData(); assertEquals(1,rsmd.getColumnCount()); assertEquals(JDBCType.BIGINT.getVendorTypeNumber().intValue(),rsmd.getColumnType(1)); assertEquals(20,rsmd.getColumnDisplaySize(1)); long generatedKey=0; while (this.rs.next()) { assertEquals(++generatedKey,this.rs.getLong(1)); } assertEquals(10,generatedKey); this.rs.close(); createTable("testExecuteLargeBatch","(id BIGINT AUTO_INCREMENT PRIMARY KEY, n INT)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (1)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (2)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch VALUES (3)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (4)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (5), (6), (7)"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES ('eight')"); this.stmt.addBatch("INSERT INTO testExecuteLargeBatch (n) VALUES (9), (10)"); try { this.stmt.executeLargeBatch(); fail("BatchUpdateException expected"); } catch ( BatchUpdateException e) { assertEquals("Incorrect integer value: 'eight' for column 'n' at row 1",e.getMessage()); counts=e.getLargeUpdateCounts(); assertEquals(7,counts.length); assertEquals(1,counts[0]); assertEquals(1,counts[1]); assertEquals(Statement.EXECUTE_FAILED,counts[2]); assertEquals(1,counts[3]); assertEquals(3,counts[4]); assertEquals(Statement.EXECUTE_FAILED,counts[5]); assertEquals(2,counts[6]); } catch ( Exception e) { fail("BatchUpdateException expected"); } this.rs=this.stmt.getGeneratedKeys(); generatedKey=0; while (this.rs.next()) { assertEquals(++generatedKey,this.rs.getLong(1)); } assertEquals(8,generatedKey); this.rs.close(); }
Test for Statement.executeLargeBatch(). Validate update count returned and generated keys.
public ReadCoilsResponse(){ setFunctionCode(Modbus.READ_COILS); setDataLength(1); coils=null; }
ReadCoilsResponse -- create an empty response message to be filled in later.
public MessageVersion(String version){ this.version=version; try { getVersionParts(); } catch ( NumberFormatException e) { throw new IllegalArgumentException(String.format("Invalid version string : %s.",version),e); } }
Create a message version.
public static String parseResponseString(Headers responseHeaders,byte[] responseBody){ if (responseBody == null || responseBody.length == 0) return ""; return IOUtils.toString(responseBody,HeaderUtil.parseHeadValue(responseHeaders.getContentType(),Headers.HEAD_KEY_CONTENT_TYPE,"")); }
Parse http response to string.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:33:59.807 -0500",hash_original_method="71E6FB134E3F8929FE201B0D15431D0F",hash_generated_method="3E798F46F6654ECB3DE3CF8AC41C1333") @Deprecated public static String lookupProviderNameFromId(int protocol){ switch (protocol) { case PROTOCOL_GOOGLE_TALK: return ProviderNames.GTALK; case PROTOCOL_AIM: return ProviderNames.AIM; case PROTOCOL_MSN: return ProviderNames.MSN; case PROTOCOL_YAHOO: return ProviderNames.YAHOO; case PROTOCOL_ICQ: return ProviderNames.ICQ; case PROTOCOL_JABBER: return ProviderNames.JABBER; case PROTOCOL_SKYPE: return ProviderNames.SKYPE; case PROTOCOL_QQ: return ProviderNames.QQ; } return null; }
This looks up the provider name defined in from the predefined IM protocol id. This is used for interacting with the IM application.
protected IWorkbook doLoadWorkbookFromURI(IProgressMonitor monitor,URI uri) throws InterruptedException, InvocationTargetException { throw new UnsupportedOperationException(); }
Subclasses MUST override this method.
@Override public void run(){ amIActive=true; String areaHeader=null; String slopeHeader=null; String outputHeader=null; int i; int progress; int row, col; double powerValue=0; double z=0; if (args.length <= 0) { showFeedback("Plugin parameters have not been set."); return; } for (i=0; i < args.length; i++) { if (i == 0) { areaHeader=args[i]; } else if (i == 1) { slopeHeader=args[i]; } else if (i == 2) { outputHeader=args[i]; } else if (i == 3) { powerValue=Double.parseDouble(args[i]); } } if ((areaHeader == null) || (slopeHeader == null) || (outputHeader == null)) { showFeedback("One or more of the input parameters have not been set properly."); return; } try { if (powerValue < 0.1) { powerValue=0.1; } if (powerValue > 20) { powerValue=20; } WhiteboxRaster slopeImage=new WhiteboxRaster(slopeHeader,"r"); int rows=slopeImage.getNumberRows(); int cols=slopeImage.getNumberColumns(); double slopeNoData=slopeImage.getNoDataValue(); WhiteboxRaster areaImage=new WhiteboxRaster(areaHeader,"r"); if (areaImage.getNumberRows() != rows || areaImage.getNumberColumns() != cols) { showFeedback("The input images must be of the same dimensions."); return; } double areaNoData=areaImage.getNoDataValue(); WhiteboxRaster output=new WhiteboxRaster(outputHeader,"rw",areaHeader,WhiteboxRaster.DataType.FLOAT,areaNoData); output.setPreferredPalette("blueyellow.pal"); double[] area; double[] slope; for (row=0; row < rows; row++) { area=areaImage.getRowValues(row); slope=slopeImage.getRowValues(row); for (col=0; col < cols; col++) { if (area[col] != areaNoData && slope[col] != slopeNoData) { if (slope[col] != 0) { z=(Math.pow(area[col],powerValue)) * (Math.tan(Math.toRadians(slope[col]))); } else { z=0; } output.setValue(row,col,z); } else { output.setValue(row,col,areaNoData); } } if (cancelOp) { cancelOperation(); return; } progress=(int)(100f * row / (rows - 1)); updateProgress(progress); } output.addMetadataEntry("Created by the " + getDescriptiveName() + " tool."); output.addMetadataEntry("Created on " + new Date()); slopeImage.close(); areaImage.close(); output.close(); returnData(outputHeader); } catch ( OutOfMemoryError oe) { myHost.showFeedback("An out-of-memory error has occurred during operation."); } catch ( Exception e) { myHost.showFeedback("An error has occurred during operation. See log file for details."); myHost.logException("Error in " + getDescriptiveName(),e); } finally { updateProgress("Progress: ",0); amIActive=false; myHost.pluginComplete(); } }
Used to execute this plugin tool.
public void addAtom(Atom at){ formula.add(at); }
Put an atom in the current formula
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){ super.onActivityResult(requestCode,resultCode,data); if (BuildConfig.DEBUG) Log.v("onActivityResult"); if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) { ArrayList<String> matches=data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); if (BuildConfig.DEBUG) Log.v("Voice recog text: " + matches.get(0)); quickReply(matches.get(0)); } }
Handle the results from the recognition activity.
@Override public void execute(FunctionContext context){ String id=this.props.getProperty(ID); String noAckTest=this.props.getProperty(NOACKTEST); if (id.equals(TEST_FUNCTION1)) { execute1(context); } else if (id.equals(TEST_FUNCTION2)) { execute2(context); } else if (id.equals(TEST_FUNCTION3)) { execute3(context); } else if ((id.equals(TEST_FUNCTION4)) || (id.equals(TEST_FUNCTION7))) { execute4(context); } else if ((id.equals(TEST_FUNCTION5)) || (id.equals(TEST_FUNCTION6))) { execute5(context); } else if (id.equals(TEST_FUNCTION8)) { execute8(context); } else if (id.equals(TEST_FUNCTION9)) { execute9(context); } else if (id.equals(TEST_FUNCTION_EXCEPTION)) { executeException(context); } else if (id.equals(TEST_FUNCTION_REEXECUTE_EXCEPTION)) { executeFunctionReexecuteException(context); } else if (id.equals(TEST_FUNCTION_RESULT_SENDER)) { executeResultSender(context); } else if (id.equals(MEMBER_FUNCTION)) { executeMemberFunction(context); } else if (id.equals(TEST_FUNCTION_TIMEOUT)) { executeTimeOut(context); } else if (id.equals(TEST_FUNCTION_SOCKET_TIMEOUT)) { executeSocketTimeOut(context); } else if (id.equals(TEST_FUNCTION_HA)) { executeHA(context); } else if (id.equals(TEST_FUNCTION_NONHA)) { executeHA(context); } else if (id.equals(TEST_FUNCTION_HA_SERVER) || id.equals(TEST_FUNCTION_NONHA_SERVER)) { executeHAAndNonHAOnServer(context); } else if (id.equals(TEST_FUNCTION_NONHA_REGION) || id.equals(TEST_FUNCTION_HA_REGION)) { executeHAAndNonHAOnRegion(context); } else if (id.equals(TEST_FUNCTION_ONSERVER_REEXECUTE_EXCEPTION)) { executeFunctionReexecuteExceptionOnServer(context); } else if (id.equals(TEST_FUNCTION_NO_LASTRESULT)) { executeWithNoLastResult(context); } else if (id.equals(TEST_FUNCTION_SEND_EXCEPTION)) { executeWithSendException(context); } else if (id.equals(TEST_FUNCTION_THROW_EXCEPTION)) { executeWithThrowException(context); } else if (id.equals(TEST_FUNCTION_LASTRESULT)) { executeWithLastResult(context); } else if (id.equals(TEST_FUNCTION_RETURN_ARGS)) { executeFunctionReturningArgs(context); } else if (id.equals(TEST_FUNCTION_RUNNING_FOR_LONG_TIME)) { executeFunctionRunningForLongTime(context); } else if (id.equals(TEST_FUNCTION_BUCKET_FILTER)) { executeFunctionBucketFilter(context); } else if (id.equals(TEST_FUNCTION_NONHA_NOP)) { execute1(context); } else if (noAckTest.equals("true")) { execute1(context); } }
Application execution implementation
public static _Fields findByThriftIdOrThrow(int fieldId){ _Fields fields=findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; }
Find the _Fields constant that matches fieldId, throwing an exception if it is not found.
protected static double calcSigmaFromMu(double mu){ double sigma=Math.sqrt(mu); if (sigma < 0.5) { sigma=0.5; } return sigma; }
Calculate the standard deviation (sigma). Note that for Poisson distributions the variance is equal to expected value (mu).
public static String replaceDateValues(String aQuery,DateTime replaceWith){ Matcher matcher=DATE_REPLACE_PATTERN.matcher(aQuery); while (matcher.find()) { final String format=matcher.group(1); DateTimeFormatter formatter=QueryReplaceUtil.makeDateTimeFormat(format); if (matcher.groupCount() > 3 && matcher.group(3) != null && matcher.group(4) != null) { int count=Integer.valueOf(matcher.group(3)); DateMod dm=DateMod.valueOf(matcher.group(4)); DateTime toMod=new DateTime(replaceWith); if (dm.equals(DateMod.H)) { toMod=toMod.minusHours(count); } else if (dm.equals(DateMod.D)) { toMod=toMod.minusDays(count); } else if (dm.equals(DateMod.M)) { toMod=toMod.minusMonths(count); } aQuery=aQuery.replace(matcher.group(),formatter.print(toMod)); } else { aQuery=aQuery.replace(matcher.group(),formatter.print(replaceWith)); } matcher=DATE_REPLACE_PATTERN.matcher(aQuery); } return aQuery; }
Replace date formats with the DateTime values passed in. Operations like "YYYYMMdd-1D" are supported for doing simple subtraction on the passed in DateTime. See DateMod for supported modification values.
@Override public String toString(){ return "surfaceReference[" + "nativePointer=0x" + Long.toHexString(getNativePointer()) + ","+ "channelDesc="+ channelDesc+ "]"; }
Returns a String representation of this object.
public void acquireUninterruptibly(final Object topic){ Object topicObject=topic; if (topicObject == null) { topicObject=NULL_TOPIC; } Topic pendingTopic=null; synchronized (this.topicsQueue) { if (this.currentTopic == null) { if (logger.isDebugEnabled()) { logger.debug("Collaboration.acquireUninterruptibly: {}: no current topic, setting topic to {}",this.toString(),topicObject); } setCurrentTopic(new Topic(topicObject)); this.currentTopic.addThread(Thread.currentThread()); this.topicsMap.put(topicObject,this.currentTopic); return; } else if (isCurrentTopic(topicObject)) { if (logger.isDebugEnabled()) { logger.debug("Collaboration.acquireUninterruptibly: {}: already current topic: {}",this.toString(),topicObject); } this.currentTopic.addThread(Thread.currentThread()); return; } else if (hasCurrentTopic(Thread.currentThread())) { assertNotRecursingTopic(topicObject); } else { pendingTopic=(Topic)this.topicsMap.get(topicObject); if (pendingTopic == null) { pendingTopic=new Topic(topicObject); this.topicsMap.put(topicObject,pendingTopic); this.topicsQueue.add(pendingTopic); } pendingTopic.addThread(Thread.currentThread()); if (logger.isDebugEnabled()) { logger.debug("Collaboration.acquireUninterruptibly: {}: adding pendingTopic {}; current topic is {}",this.toString(),pendingTopic,this.currentTopic); } } } boolean interrupted=Thread.interrupted(); try { awaitTopic(pendingTopic,false); } catch ( InterruptedException e) { interrupted=true; this.stopper.checkCancelInProgress(e); } finally { if (interrupted) Thread.currentThread().interrupt(); } }
Acquire permission to participate in the collaboration. Returns immediately if topic matches the current topic. Otherwise, this will block until the Collaboration has been freed by the threads working on the current topic. This call is uninterruptible.
private void prepareRPVolumeData() throws Exception { Volume rpSourceVolume=new Volume(); URI rpSourceVolumeURI=URIUtil.createId(Volume.class); rpTestVolumeURIs.add(rpSourceVolumeURI); rpSourceVolume.setId(rpSourceVolumeURI); rpSourceVolume.setLabel("rpSourceVolume"); rpSourceVolume.setPersonality(Volume.PersonalityTypes.SOURCE.toString()); _dbClient.createObject(rpSourceVolume); Volume rpTargetVolume=new Volume(); URI rpTargetVolumeURI=URIUtil.createId(Volume.class); rpTestVolumeURIs.add(rpTargetVolumeURI); rpTargetVolume.setId(rpTargetVolumeURI); rpTargetVolume.setLabel("rpTargetVolume"); rpTargetVolume.setPersonality(Volume.PersonalityTypes.TARGET.toString()); _dbClient.createObject(rpTargetVolume); Volume rpSourceJournalVolume=new Volume(); URI rpSourceJournalVolumeURI=URIUtil.createId(Volume.class); rpTestVolumeURIs.add(rpSourceJournalVolumeURI); rpSourceJournalVolume.setId(rpSourceJournalVolumeURI); rpSourceJournalVolume.setLabel("rpSourceJournalVolume"); rpSourceJournalVolume.setPersonality(Volume.PersonalityTypes.METADATA.toString()); _dbClient.createObject(rpSourceJournalVolume); Volume rpTargetJournalVolume=new Volume(); URI rpTargetJournalVolumeURI=URIUtil.createId(Volume.class); rpTestVolumeURIs.add(rpTargetJournalVolumeURI); rpTargetJournalVolume.setId(rpTargetJournalVolumeURI); rpTargetJournalVolume.setLabel("rpTargetJournalVolume"); rpTargetJournalVolume.setPersonality(Volume.PersonalityTypes.METADATA.toString()); _dbClient.createObject(rpTargetJournalVolume); for ( URI volumeURI : rpTestVolumeURIs) { Volume volume=_dbClient.queryObject(Volume.class,volumeURI); Assert.assertNotNull(String.format("rp test volume %s not found",volumeURI),volume); } }
Prepares the data for RP volume tests.
private void writeObject(java.io.ObjectOutputStream s) throws IOException { Iterator<Entry> i=(size > 0) ? entrySet0().iterator() : null; s.defaultWriteObject(); s.writeInt(table.length); s.writeInt(size); if (i != null) { while (i.hasNext()) { Entry e=i.next(); s.writeObject(e.getKey()); s.writeInt(e.getValue()); } } }
Save the state of the <tt>HashMap</tt> instance to a stream (i.e., serialize it).
public static DataSourceDescriptor findDataSource(String dataSourceId){ ProjectRegistry projectRegistry=DBeaverCore.getInstance().getProjectRegistry(); for ( IProject project : DBeaverCore.getInstance().getLiveProjects()) { DataSourceRegistry dataSourceRegistry=projectRegistry.getDataSourceRegistry(project); if (dataSourceRegistry != null) { DataSourceDescriptor dataSourceContainer=dataSourceRegistry.getDataSource(dataSourceId); if (dataSourceContainer != null) { return dataSourceContainer; } } } return null; }
Find data source in all available registries
public static String bin2str(final byte[] values,final boolean separateBytes){ return bin2str(values,JBBPBitOrder.LSB0,separateBytes); }
Convert a byte array into string binary representation with LSB0 order and possibility to separate bytes.
public static MosaicDefinitionCreationTransaction createMosaicDefinitionCreationTransaction(final TimeInstant timeStamp,final Account signer){ return new MosaicDefinitionCreationTransaction(timeStamp,signer,Utils.createMosaicDefinition(signer),Utils.generateRandomAccount(),Amount.fromNem(50_000)); }
Creates a mosaic definition creation transaction.
void addGroupOrRangeJunction(AbstractGroupOrRangeJunction gj){ if (this.groupJunctions == null) { this.groupJunctions=new ArrayList(); } this.groupJunctions.add(gj); }
Add the GroupJunction for a Region as a part of CompositeGroupJunction , implying that their exists atleast one equi join condition which involes the Region which the GroupJunction represents
@Override public int read() throws IOException { if (read_pos == read_pos_end) { throw new EndOfBufferException(); } return buffer[read_pos++] & 0xFF; }
read an opaque value;
@Override public boolean onBlockEventReceived(World par1World,int par2,int par3,int par4,int par5,int par6){ super.onBlockEventReceived(par1World,par2,par3,par4,par5,par6); TileEntity tileentity=par1World.getTileEntity(par2,par3,par4); return tileentity != null ? tileentity.receiveClientEvent(par5,par6) : false; }
Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity at this location. Args: world, x, y, z, blockID, EventID, event parameter
@Override public int update(Uri uri,ContentValues values,String selection,String[] selectionArgs){ if (uri == null) { LogUtils.log(this,Log.WARN,NULL_URI_FORMAT_STRING); return 0; } switch (sUriMatcher.match(uri)) { case LABELS_ID: initializeDatabaseIfNull(); final String labelIdString=uri.getLastPathSegment(); final int labelId; try { labelId=Integer.parseInt(labelIdString); } catch (NumberFormatException e) { LogUtils.log(this,Log.WARN,UNKNOWN_URI_FORMAT_STRING,uri); return 0; } final String where=String.format("%s = %d",LabelsTable.KEY_ID,labelId); final int result=mDatabase.update(LabelsTable.TABLE_NAME,values,combineSelectionAndWhere(selection,where),selectionArgs); getContext().getContentResolver().notifyChange(uri,null); return result; default : LogUtils.log(this,Log.WARN,UNKNOWN_URI_FORMAT_STRING,uri); return 0; } }
Updates a label in the labels database.
private Map<String,String> permission(FsPermission perm){ if (perm == null) perm=FsPermission.getDefault(); return F.asMap(IgfsUtils.PROP_PERMISSION,toString(perm)); }
Convert Hadoop permission into IGFS file attribute.
@Override public void eUnset(int featureID){ switch (featureID) { case N4JSPackage.FORMAL_PARAMETER__DECLARED_TYPE_REF: setDeclaredTypeRef((TypeRef)null); return; case N4JSPackage.FORMAL_PARAMETER__BOGUS_TYPE_REF: setBogusTypeRef((TypeRef)null); return; case N4JSPackage.FORMAL_PARAMETER__NAME: setName(NAME_EDEFAULT); return; case N4JSPackage.FORMAL_PARAMETER__ANNOTATIONS: getAnnotations().clear(); return; case N4JSPackage.FORMAL_PARAMETER__VARIADIC: setVariadic(VARIADIC_EDEFAULT); return; case N4JSPackage.FORMAL_PARAMETER__DEFINED_TYPE_ELEMENT: setDefinedTypeElement((TFormalParameter)null); return; case N4JSPackage.FORMAL_PARAMETER__INITIALIZER: setInitializer((Expression)null); return; case N4JSPackage.FORMAL_PARAMETER__BINDING_PATTERN: setBindingPattern((BindingPattern)null); return; } super.eUnset(featureID); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public int countComponents(int n,int[][] edges){ Set<Integer> set=new HashSet<>(); id=new int[n]; for (int i=0; i < n; i++) { id[i]=i; } for ( int[] edge : edges) { union(edge[0],edge[1]); } for (int i=0; i < n; i++) { set.add(root(i)); } return set.size(); }
Quick union
public boolean isWordPart(char aChar){ return (Character.isLetterOrDigit(aChar) || aChar == '-' || aChar == '_'); }
Determines if the specified character may be part of a Velocity identifier as other than the first character. A character may be part of a Velocity identifier if and only if it is one of the following: <ul> <li>a letter (a..z, A..Z) <li>a digit (0..9) <li>a hyphen ("-") <li>a underscore("_") </ul>
public StepBreakpointHitReply(final int packetId,final int errorCode,final long tid,final RegisterValues registerValues){ super(packetId,errorCode,tid,registerValues); }
Creates a new breakpoint hit reply object.
@Override public void waitForResult(){ try { this.future.get(); } catch ( Exception e) { throw new IllegalStateException("could not process tile",e); } }
Wait for the result of the tile processing.
public void startBasicBlock(){ instanceOfType=null; instanceOfValueNumber=null; }
This method must be called at the beginning of modeling a basic block in order to clear information cached for instanceof modeling.
public void test_langCodeLiterals(){ final Literal a=new LiteralImpl("bigdata","en"); assertEquals(a,roundTrip_tuned(a)); }
Test round trip of some language code literals.
public static char convertByte2Uint8(byte b){ return (char)(b & 0xff); }
Convert char into uint8( we treat char as uint8 )
private synchronized void writeBytes(ZipFile zf,ZipEntry ze,ZipOutputStream os) throws IOException { int n; InputStream is=null; try { is=zf.getInputStream(ze); long left=ze.getSize(); while ((left > 0) && (n=is.read(buffer,0,buffer.length)) != -1) { os.write(buffer,0,n); left-=n; } } finally { if (is != null) { is.close(); } } }
Writes all the bytes for a given entry to the specified output stream.
static void quit(){ PreferenceManager.getInstance().save(); try { WeaponOrderHandler.saveWeaponOrderFile(); } catch ( IOException e) { System.out.println("Error saving custom weapon orders!"); e.printStackTrace(); } try { QuirksHandler.saveCustomQuirksList(); } catch ( IOException e) { System.out.println("Error saving quirks override!"); e.printStackTrace(); } System.exit(0); }
Called when the quit buttons is pressed or the main menu is closed.
public static byte[] addressAsByteArray(Address byte_array){ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); return null; }
Recast. Note: for use by GC to avoid checkcast during GC
public static HCoordinate perpendicularBisector(Coordinate a,Coordinate b){ double dx=b.x - a.x; double dy=b.y - a.y; HCoordinate l1=new HCoordinate(a.x + dx / 2.0,a.y + dy / 2.0,1.0); HCoordinate l2=new HCoordinate(a.x - dy + dx / 2.0,a.y + dx + dy / 2.0,1.0); return new HCoordinate(l1,l2); }
Computes the line which is the perpendicular bisector of the line segment a-b.
private void loadTableInfo(){ Timestamp payDate=(Timestamp)fieldPayDate.getValue(); miniTable.setColorCompare(payDate); log.config("PayDate=" + payDate); BankInfo bi=(BankInfo)fieldBankAccount.getSelectedItem(); ValueNamePair paymentRule=(ValueNamePair)fieldPaymentRule.getSelectedItem(); KeyNamePair docType=(KeyNamePair)fieldDtype.getSelectedItem(); int c_bpartner_id=0; if (fieldBPartner.getValue() != null) c_bpartner_id=((Integer)fieldBPartner.getValue()).intValue(); loadTableInfo(bi,payDate,paymentRule,onlyDue.isSelected(),c_bpartner_id,docType,miniTable); calculateSelection(); }
Query and create TableInfo
void addToQueue(ConnectionRequest request,boolean retry){ if (!running) { start(); } if (!autoDetected) { autoDetected=true; if (Util.getImplementation().shouldAutoDetectAccessPoint()) { AutoDetectAPN r=new AutoDetectAPN(); r.setPost(false); r.setUrl(autoDetectURL); r.setPriority(ConnectionRequest.PRIORITY_CRITICAL); addToQueue(r,false); } } request.validateImpl(); synchronized (LOCK) { int i=request.getPriority(); if (!retry) { if (!request.isDuplicateSupported()) { if (pending.contains(request)) { System.out.println("Duplicate entry in the queue: " + request.getClass().getName() + ": "+ request); return; } ConnectionRequest currentRequest=networkThreads[0].getCurrentRequest(); if (currentRequest != null && !currentRequest.retrying && currentRequest.equals(request)) { System.out.println("Duplicate entry detected"); return; } } } else { i=ConnectionRequest.PRIORITY_HIGH; } switch (i) { case ConnectionRequest.PRIORITY_CRITICAL: pending.insertElementAt(request,0); ConnectionRequest currentRequest=networkThreads[0].getCurrentRequest(); if (currentRequest != null && currentRequest.getPriority() < ConnectionRequest.PRIORITY_CRITICAL) { if (currentRequest.isPausable()) { currentRequest.pause(); pending.insertElementAt(currentRequest,1); } else { currentRequest.kill(); } } break; case ConnectionRequest.PRIORITY_HIGH: case ConnectionRequest.PRIORITY_NORMAL: case ConnectionRequest.PRIORITY_LOW: case ConnectionRequest.PRIORITY_REDUNDANT: addSortedToQueue(request,i); break; } LOCK.notify(); } }
Adds the given network connection to the queue of execution
public LEFT_OUTER_JOIN LEFT_OUTER_JOIN(String tableToJoin){ return new LEFT_OUTER_JOIN(this,tableToJoin); }
Add a LEFT OUTER JOIN
public static ByteBuffer allocateDirect(int capacity){ if (capacity < 0) { throw new IllegalArgumentException(); } return new ByteBuffer(capacity); }
Creates a direct byte buffer based on a newly allocated memory block.
public boolean isDotNet(){ return mDotNet; }
Checks if is dot net.
public static byte[] hexStringToBytes(String hexString){ if (hexString == null || hexString.equals("")) { return null; } hexString=hexString.toUpperCase(); int length=hexString.length() / 2; char[] hexChars=hexString.toCharArray(); byte[] d=new byte[length]; for (int i=0; i < length; i++) { int pos=i * 2; d[i]=(byte)(charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1])); } return d; }
Convert hex string to byte[]
public boolean serialize(RowMutator mutator,DataObject val){ return serialize(mutator,val,null); }
Serializes data object into database updates
public String sqlADAction_updateLinkColumnElement(String vendorName,String catalogName,String schemaName){ ArrayList<String> columnNames=new ArrayList<String>(); columnNames.add("AD_Element_ID"); String subQuery=sql_select(vendorName,catalogName,schemaName,"AD_Element","e",new ArrayList<String>(Arrays.asList("AD_Element_ID")),null,new ArrayList<String>(Arrays.asList("UPPER(c.ColumnName)=UPPER(e.ColumnName)")),null,false); ArrayList<String> values=new ArrayList<String>(); values.add(new StringBuffer("(").append(subQuery).append(")").toString()); ArrayList<String> conditions=new ArrayList<String>(); conditions.add("c.AD_Element_ID IS NULL"); return sql_update(vendorName,catalogName,schemaName,"AD_Column","c",columnNames,values,conditions); }
gets the database-specific SQL command to link columns with elements
public Object runSafely(Catbert.FastStack stack) throws Exception { return Seeker.getInstance().getVideoStoreDirectories(); }
Gets the list of directories that SageTV is configured to record television to
public static <I,A>Parser<I,A> chainl1(Parser<I,A> p,Parser<I,BinaryOperator<A>> op){ return bind(p,null); }
A parser for an operand followed by one or more operands (<code>p</code>) separated by operators (<code>op</code>). This parser can for example be used to eliminate left recursion which typically occurs in expression grammars.
@DSSink({DSSinkKind.BLUETOOTH}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:32:34.940 -0500",hash_original_method="D15419F6AD1B4E28C80D3421F9F86FA4",hash_generated_method="B6AAA10A8046DEAF7A51157791491AE3") public boolean startScoUsingVirtualVoiceCall(BluetoothDevice device){ if (DBG) log("startScoUsingVirtualVoiceCall()"); if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.startScoUsingVirtualVoiceCall(device); } catch ( RemoteException e) { Log.e(TAG,e.toString()); } } else { Log.w(TAG,"Proxy not attached to service"); if (DBG) Log.d(TAG,Log.getStackTraceString(new Throwable())); } return false; }
Initiates a SCO channel connection with the headset (if connected). Also initiates a virtual voice call for Handsfree devices as many devices do not accept SCO audio without a call. This API allows the handsfree device to be used for routing non-cellular call audio.
public StringInputDialog(final Shell parentShell,final String label,final String initialValue,final String dialogTitle,final String purpose){ super(parentShell); this.label=label; text=initialValue; this.dialogTitle=dialogTitle; setOptionDialogSettingsKey(StringInputDialog.class.getName() + "." + purpose); }
Create a new Dialog.
public void append(String addPath){ String currentPath=textField.getText(); if (currentPath.length() == 0) { setValue(addPath); } else { setValue(currentPath.concat(";" + addPath)); } }
Add a path to the end of the current path. Uses the pathSeparator between paths.
@Override public void addAttribute(String name,String value){ if (value != null) { current.setAttribute(name,value); } }
Adds an attribute to current element of the DOM Document.
@SuppressWarnings("unchecked") public CompactHashSet(int size){ objects=(E[])new Object[(size == 0 ? 1 : size)]; elements=0; freecells=objects.length; modCount=0; }
Constructs a new, empty set.
public boolean isActive(){ return active; }
"active" means that the object is still displayed, and should be stored.
public final TextBuilder append(String str){ return (str == null) ? append("null") : append(str,0,str.length()); }
Appends the specified string to this text builder. If the specified string is <code>null</code> this method is equivalent to <code>append("null")</code>.
public void start(int totalSeeds,int maxNFE){ this.totalSeeds=totalSeeds; this.maxNFE=maxNFE; lastSeed=1; lastNFE=0; currentSeed=1; currentNFE=0; statistics.clear(); startTime=System.currentTimeMillis(); lastTime=startTime; }
Prepares this progress helper for use. This method must be invoked prior to calling all other methods. The internal state of the progress helper is reset, allowing a single progress helper to be reused across many sequential runs.
public void deployDatasources(InstalledLocalContainer container) throws Exception { GeronimoInstalledLocalDeployer deployer=new GeronimoInstalledLocalDeployer(container); for ( DataSource datasource : getDataSources()) { Map<String,String> replacements=new HashMap<String,String>(); replacements.put("id",datasource.getId()); replacements.put("dependencies",GeronimoUtils.getGeronimoExtraClasspathDependiesXML(container)); replacements.put("jndiLocation",datasource.getJndiLocation()); replacements.put("driverClass",datasource.getDriverClass()); replacements.put("password",datasource.getPassword()); replacements.put("username",datasource.getUsername()); replacements.put("url",datasource.getUrl()); if (datasource.getTransactionSupport() == TransactionSupport.NO_TRANSACTION) { replacements.put("transactionSupport","no-transaction"); } else if (datasource.getTransactionSupport() == TransactionSupport.LOCAL_TRANSACTION) { replacements.put("transactionSupport","local-transaction"); } else if (datasource.getTransactionSupport() == TransactionSupport.XA_TRANSACTION) { replacements.put("transactionSupport","xa-transaction"); } else { throw new ContainerException("Unknown transaction support type: " + datasource.getTransactionSupport()); } FilterChain filterChain=new FilterChain(); getAntUtils().addTokensToFilterChain(filterChain,replacements); File target=new File(getHome(),"var/temp/cargo-datasource-" + datasource.getId() + ".xml"); getResourceUtils().copyResource(RESOURCE_PATH + "geronimo/DataSourceTemplate.xml",target,filterChain,"UTF-8"); deployer.deployRar("org.codehaus.cargo.datasource/" + datasource.getId() + "/1.0/car",target); } }
Deploy datasources.
public boolean isInterface(){ ClassDef classDef=getClassDef(); return (classDef.getAccessFlags() & AccessFlags.INTERFACE.getValue()) != 0; }
Returns true if this class is an interface. <p/> If this class is not defined, then this will throw an UnresolvedClassException
private void updateProgress(String progressLabel,int progress){ if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) { myHost.updateProgress(progressLabel,progress); } previousProgress=progress; previousProgressLabel=progressLabel; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
public void disconnect(UniversalConnection connection){ UniversalDataSource uds=connectionMap.remove(connection); if (uds != null) { uds.releaseConnection(connection); } }
Releases an existing connection by looking it up in the connection map and releasing from the correct data source. This call is idempotent.
public Path createSourcepath(){ if (compileSourcepath == null) { compileSourcepath=new Path(getProject()); } return compileSourcepath.createPath(); }
Adds a path to sourcepath.
private void notifyInstanceListeners(InstanceEvent e){ for ( InstanceListener il : m_instanceListeners) { il.acceptInstance(e); } }
Notify instance listeners of an output instance
@Override public void send(final Message message,final int deliveryMode,final int priority,final long timeToLive) throws JMSException { session.lock(); try { if (ActiveMQRAMessageProducer.trace) { ActiveMQRALogger.LOGGER.trace("send " + this + " message="+ message+ " deliveryMode="+ deliveryMode+ " priority="+ priority+ " ttl="+ timeToLive); } checkState(); producer.send(message,deliveryMode,priority,timeToLive); if (ActiveMQRAMessageProducer.trace) { ActiveMQRALogger.LOGGER.trace("sent " + this + " result="+ message); } } finally { session.unlock(); } }
Send message
@Override public void onPacketReceiving(PacketEvent packetEvent){ if (packetEvent.isCancelled()) { return; } Player sender=packetEvent.getPlayer(); byte[] sharedSecret=packetEvent.getPacket().getByteArrays().read(0); packetEvent.getAsyncMarker().incrementProcessingDelay(); VerifyResponseTask verifyTask=new VerifyResponseTask(plugin,packetEvent,sender,sharedSecret); Bukkit.getScheduler().runTaskAsynchronously(plugin,verifyTask); }
C->S : Handshake State=2 C->S : Login Start S->C : Encryption Key Request (Client Auth) C->S : Encryption Key Response (Server Auth, Both enable encryption) S->C : Login Success (*) On offline logins is Login Start followed by Login Success Minecraft Server implementation https://github.com/bergerkiller/CraftSource/blob/master/net.minecraft.server/LoginListener.java#L180
@Override public DummyProjectBuilder withTypeName(String projectTypeName){ return this; }
Specify the project Type name of the project that needs to be created.
public MonetaryFormat codeSeparator(char codeSeparator){ checkArgument(!Character.isDigit(codeSeparator)); checkArgument(codeSeparator > 0); if (codeSeparator == this.codeSeparator) return this; else return new MonetaryFormat(negativeSign,positiveSign,zeroDigit,decimalMark,minDecimals,decimalGroups,shift,roundingMode,codes,codeSeparator,codePrefixed); }
Separator between currency code and formatted value. This configuration is not relevant for parsing.
@SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER") private Response load() throws IOException { synchronized (this.saved) { if (this.saved.isEmpty()) { Iterable<String> head; InputStream body; try { head=this.origin.head(); body=this.origin.body(); } catch ( final RsForward ex) { head=ex.head(); body=ex.body(); } this.saved.add(new RsSimple(head,body)); } } return this.saved.get(0); }
Load it.
@Override public boolean eIsSet(int featureID){ switch (featureID) { case UmplePackage.TRACE_CASE_DEF___TRACECASE_NAME_1: return TRACECASE_NAME_1_EDEFAULT == null ? tracecase_name_1 != null : !TRACECASE_NAME_1_EDEFAULT.equals(tracecase_name_1); case UmplePackage.TRACE_CASE_DEF___TRACE_DIRECTIVE_1: return traceDirective_1 != null && !traceDirective_1.isEmpty(); } return super.eIsSet(featureID); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public String globalInfo(){ return "Class for performing parameter selection by cross-validation " + "for any classifier.\n\n" + "For more information, see:\n\n"+ getTechnicalInformation().toString(); }
Returns a string describing this classifier
public int readLocalIndex(){ if (opcode == Bytecodes.WIDE) { return Bytes.beU2(code,curBCI + 2); } return Bytes.beU1(code,curBCI + 1); }
Reads the index of a local variable for one of the load or store instructions. The WIDE modifier is handled internally.
private void init(String entidad){ try { Session session=HibernateUtil.currentSession(entidad); List list=session.find("FROM " + HibernateKeys.HIBERNATE_Iuserlicenc); if (list != null && !list.isEmpty()) { setProperty(HibernateKeys.HIBERNATE_Iuserlicenc,list.get(0)); } } catch ( HibernateException e) { log.error("Impossible to load intial values for Repository.",e); } }
Private methods
public void clearActiveLineRange(){ if (activeLineRangeStart != -1 || activeLineRangeEnd != -1) { activeLineRangeStart=activeLineRangeEnd=-1; repaint(); } }
Clears the active line range.
public Store(Store other){ __isset_bitfield=other.__isset_bitfield; if (other.isSetStoreName()) { this.storeName=other.storeName; } if (other.isSetScope()) { this.scope=other.scope; } this.persist=other.persist; }
Performs a deep copy on <i>other</i>.
@Override public void displayCycle(Cycle cycle){ this.cycle=cycle; if (alreadyInitializedRecyclerList) { populateRecyclerList(); } else { initRecyclerView(); alreadyInitializedRecyclerList=true; populateRecyclerList(); } }
TalkView override for displaying the cycle as it emits changes. Only initialize the recycler view if it has not been initialized before.