code
stringlengths
10
174k
nl
stringlengths
3
129k
public boolean isCreateNewJournal(){ Object oo=get_Value(COLUMNNAME_IsCreateNewJournal); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; }
Get Create New Journal.
public static cuDoubleComplex cuCmul(cuDoubleComplex x,cuDoubleComplex y){ cuDoubleComplex prod; prod=cuCmplx((cuCreal(x) * cuCreal(y)) - (cuCimag(x) * cuCimag(y)),(cuCreal(x) * cuCimag(y)) + (cuCimag(x) * cuCreal(y))); return prod; }
Returns the product of the given complex numbers.<br /> <br /> Original comment:<br /> <br /> This implementation could suffer from intermediate overflow even though the final result would be in range. However, various implementations do not guard against this (presumably to avoid losing performance), so we don't do it...
public void addAtom(Atom at){ formula.add(at); }
Put an atom in the current formula
private void createTree(final ITreeNode<CTag> root){ m_tagTree.setRootVisible(false); final DefaultTreeModel tagTreeModel=new DefaultTreeModel(new CTagTreeNode(root)); m_tagTree.setModel(tagTreeModel); m_tagTree.setCellRenderer(new IconNodeRenderer()); }
Creates the tree that shows the available tags.
private void returnData(Object ret){ if (myHost != null) { myHost.returnData(ret); } }
Used to communicate a return object from a plugin tool to the main Whitebox user-interface.
public static byte[] decodeHex(char[] data) throws DecoderException { int len=data.length; if ((len & 0x01) != 0) { throw new DecoderException("Odd number of characters."); } byte[] out=new byte[len >> 1]; for (int i=0, j=0; j < len; i++) { int f=toDigit(data[j],j) << 4; j++; f=f | toDigit(dat...
Converts an array of characters representing hexidecimal values into an array of bytes of those same values. The returned array will be half the length of the passed array, as it takes two characters to represent any given byte. An exception is thrown if the passed char array has an odd number of elements.
@Override public int hashCode(){ int hashCode=0; for (int i=0; i < choiceLimits.length; i++) { long v=Double.doubleToLongBits(choiceLimits[i]); hashCode+=(int)(v ^ (v >>> 32)) + choiceFormats[i].hashCode(); } return hashCode; }
Returns an integer hash code for the receiver. Objects which are equal return the same value for this method.
public static Stats of(long... values){ StatsAccumulator acummulator=new StatsAccumulator(); acummulator.addAll(values); return acummulator.snapshot(); }
Returns statistics over a dataset containing the given values.
public static void showViews(final Window parent,final IViewContainer container,final INaviView[] views,final CGraphWindow window){ for ( final INaviView view : views) { CViewOpener.showView(parent,container,view,window); } }
Opens views in a given window.
public static double trunc(Double number,int precision){ if (number < 0d) { return Math.ceil(number * Math.pow(10,precision)) / Math.pow(10,precision); } return Math.floor(number * Math.pow(10,precision)) / Math.pow(10,precision); }
Truncate the value
public Piece(BigDecimal magnitude,PieceUnit unitType){ this.magnitude=magnitude; this.unitType=unitType; }
Create a new <code>Piece</code>.
public InputStream executeAndReturnStdoutAsInputStream(String[] rawArgs,boolean mergeArgsWithDefaultOptions) throws IOException, InterruptedException, MameExecutionException { InputStream is=this.inputStreamsToReturn.get(this.inputStreamIndex); this.inputStreamIndex++; return is; }
Executes Mame using the given arguments and return an InputStream connected to the process to access to std inputs/outputs
public boolean isStatusBarTintEnabled(){ return mStatusBarTintEnabled; }
Is tinting enabled for the system status bar?
public void headphonesDisconnected(){ }
Headphones disconnected callback
public int indexOfIdenticalObject(Object obj){ NSObject nso=NSObject.fromJavaObject(obj); for (int i=0; i < array.length; i++) { if (array[i] == nso) { return i; } } return -1; }
Searches for an object in the array. If it is found its index will be returned. This method only returns the index of an object that is <b>identical</b> to the given one. Thus objects that might contain the same value as the given one will not be considered.
public Element createElement(String tagName) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
Unimplemented. See org.w3c.dom.Document
public Object monitor(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { Object retVal=null; String label=keyHelper.getLabel(proceedingJoinPoint); String details=keyHelper.getDetails(proceedingJoinPoint); MonKeyImp key=new MonKeyImp(label,details,"ms."); Monitor mon=MonitorFactory.start(key); try {...
Wrap jamon calls around the invoked method. Also track exceptions if they are thrown
final int compareHalf(MutableBigInteger b){ int blen=b.intLen; int len=intLen; if (len <= 0) return blen <= 0 ? 0 : -1; if (len > blen) return 1; if (len < blen - 1) return -1; int[] bval=b.value; int bstart=0; int carry=0; if (len != blen) { if (bval[bstart] == 1) { ++bstart; ca...
Compare this against half of a MutableBigInteger object (Needed for remainder tests). Assumes no leading unnecessary zeros, which holds for results from divide().
protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException { if (keySpec != null) { if (keySpec instanceof DSAPublicKeySpec) { return new DSAPublicKeyImpl((DSAPublicKeySpec)keySpec); } if (keySpec instanceof X509EncodedKeySpec) { return new DSAPublicKeyImpl((X509E...
This method generates a DSAPublicKey object from the provided key specification.
public void deactivate(){ if (mAccelerometerSensor != null) { mSensorManager.unregisterListener(this,mAccelerometerSensor); } if (mMagneticSensor != null) { mSensorManager.unregisterListener(this,mMagneticSensor); } }
Deactivates corresponding device sensors to stop calculating device heading.
public int flags(){ return theType.flags(); }
Return the flags vector of the element's type. Convenience method.
public String renamePattern(){ return renamePattern; }
Returns rename pattern
public static RefactoringStatus createFatalErrorStatus(String msg){ return createStatus(FATAL,msg,null,null,RefactoringStatusEntry.NO_CODE,null); }
Creates a new <code>RefactoringStatus</code> with one <code>FATAL</code> entry filled with the given message.
protected PostgresMessages readMessage() throws IOException { return readMessage(true); }
Read the next message from the stream, without any type opcode.
protected String promptString(final String prompt,final Optional<String> defaultValue) throws IOException { requireNonNull(prompt); requireNonNull(defaultValue); final ConsoleReader reader=getReader(); reader.setPrompt(prompt); String value=null; boolean prompting=true; while (prompting) { final Strin...
Prompts a user for a String value. The prompt will be repeated until a value has been submitted. If a default value is provided, then it will be used if the user doesn't enter anything.
@UiHandler("okButton") public void handleOkClick(final ClickEvent event){ this.actionDelegate.accepted(); }
Handler set on the OK button.
public int hashCode(){ StringBuilder sbuf=new StringBuilder(); sbuf.append(algid.toString()); sbuf.append(paramsToString()); return sbuf.toString().hashCode(); }
Returns a hashcode for this AlgorithmId.
private void connect(String urlPath){ try { JMXServiceURL url=new JMXServiceURL("rmi","",0,urlPath); this.jmxc=JMXConnectorFactory.connect(url); this.server=jmxc.getMBeanServerConnection(); } catch ( MalformedURLException e) { } catch ( IOException e) { System.err.println("\nCommunication error...
Connect to a JMX agent of a given URL.
static String readFile(String path,Charset encoding) throws IOException { byte[] encoded=Files.readAllBytes(Paths.get(path)); return new String(encoded,encoding); }
Reads content from a file
private void statInit(){ label1.setLabelFor(textField1); label1.setText("Label1"); label1.setHorizontalAlignment(JLabel.LEADING); textField1.setBackground(AdempierePLAF.getInfoBackground()); label2.setLabelFor(textField2); label2.setText("Label2"); label2.setHorizontalAlignment(JLabel.LEADING); textFiel...
Static Setup - add fields to parameterPanel (GridLayout)
private boolean systemListenerChange(Object topic,GridMessageListener expected,GridMessageListener newVal){ assert Thread.holdsLock(sysLsnrsMux); assert topic instanceof GridTopic; int idx=systemListenerIndex(topic); GridMessageListener old=sysLsnrs[idx]; if (old != null && old.equals(expected)) { changeS...
Change system listener.
public boolean equals(Object o){ if (o == this) { return true; } if (!(o instanceof Set)) return false; Collection c=(Collection)o; if (c.size() != size()) return false; try { return containsAll(c); } catch ( ClassCastException unused) { return false; } catch ( NullPointerException un...
Compares the specified object with this set for equality. Returns <tt>true</tt> if the given object is also a set, the two sets have the same size, and every member of the given set is contained in this set. This ensures that the <tt>equals</tt> method works properly across different implementations of the <tt>Set</t...
public ItemStack toItemStack(){ return toItemStack(1); }
Get an ItemStack of one spawn egg
public static int readHexInt(HashMap<String,? extends Object> map,String key,int defaultValue){ Object v=map.get(key); if (v == null) { return defaultValue; } else if (v instanceof Integer) { return (Integer)v; } try { return (int)Long.parseLong((String)v,16); } catch ( NumberFormatExceptio...
Read a hex int value from a map.
public static ServiceAccountJwtAccessCredentials fromPkcs8(String clientId,String clientEmail,String privateKeyPkcs8,String privateKeyId) throws IOException { return fromPkcs8(clientId,clientEmail,privateKeyPkcs8,privateKeyId,null); }
Factory using PKCS#8 for the private key.
void checkPowerOff() throws IOException { if (powerOffCount == 0) { return; } if (powerOffCount > 1) { powerOffCount--; return; } powerOffCount=-1; throw POWER_OFF; }
Check if the simulated power failure occurred. This call will decrement the countdown.
public static S2LatLngRect empty(){ return new S2LatLngRect(R1Interval.empty(),S1Interval.empty()); }
The canonical empty rectangle
public Builder backgroundDrawableRes(@DrawableRes int sliderBackgroundDrawableRes){ this.sliderBackgroundDrawableRes=sliderBackgroundDrawableRes; return this; }
Set the background drawable for the Slider from a Resource. This is the view containing the list.
public void commit() throws IOException { if (hasErrors) { completeEdit(this,false); remove(entry.key); } else { completeEdit(this,true); } committed=true; }
Commits this edit so it is visible to readers. This releases the edit lock so another edit may be started on the same key.
public ResolveThread(Resolver res,Message query,Object id,ResolverListener listener){ this.res=res; this.query=query; this.id=id; this.listener=listener; }
Creates a new ResolveThread
public RestResult post(String path,String payload){ HttpPost httpPost=new HttpPost(formatUrl(path)); StringEntity entity=new StringEntity(payload,StandardCharsets.UTF_8); httpPost.setEntity(entity); return executeRequest(httpPost); }
Execute a POST REST call.
private void initList(){ mList=new ArrayList<>(); for (int i=0; i < names.length; i++) { mList.add(new Item(images[i],names[i],textDescription)); } mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); myAdapterRecyclerView=new MyAdapterRecyclerView(mList); mRecyclerView.setAdapter(myAdapterRec...
Add data to the List
public ResourceNotFoundException(){ }
Create a new <code>ResourceNotFoundException</code>.
private String documentToString(Document doc) throws TransformerException { StringWriter writer=new StringWriter(); Source source=new DOMSource(doc); Result result=new StreamResult(writer); TransformerFactory factory=TransformerFactory.newInstance(); factory.setAttribute("indent-number","4"); Transformer tr...
Convert document to formatted XML string.
void positionChanged(final double x,final double y){ playerX=x; playerY=y; updateView(); }
The player's position changed.
private static char[] zzUnpackCMap(String packed){ char[] map=new char[0x10000]; int i=0; int j=0; while (i < 4294) { int count=packed.charAt(i++); char value=packed.charAt(i++); do map[j++]=value; while (--count > 0); } return map; }
Unpacks the compressed character translation table.
private Base64(){ }
Defeats instantiation.
public void add(String[] titles,double[] values){ add(mCategories.size() + "",titles,values); }
Adds a new value to the series
@Override public final void appendRectangle(final float x,final float y,final float w,final float h){ moveTo(x,y); lineTo(x + w,y); lineTo(x + w,y + h); lineTo(x,y + h); lineTo(x,y); closeShape(); }
add a rectangle to set of shapes
public Vector2f zero(){ x=y=0; return this; }
<code>zero</code> resets this vector's data to zero internally.
public HotspotPeerNetwork(ScanResult scanResult){ this.scanResult=scanResult; }
Create a PeerNetwork with a remote WifiP2pDevice to talk to .
public Pkcs11SignatureToken(String pkcs11Path){ this(pkcs11Path,(PasswordInputCallback)null); }
Create the SignatureTokenConnection, using the provided path for the library.
public static void close() throws IgniteCheckedException { fsMap.close(); }
This method is called with reflection upon Job finish with class loader of each task. This will clean up all the Fs created for specific task. Each class loader sees uses its own instance of <code>fsMap<code/> since the class loaders are different.
public static boolean isOperand(final String s){ String symbol=s.toLowerCase(Locale.ENGLISH); return (!operators.contains(symbol)); }
Evaluates whether symbol is operand.
public void handleCUIInitializationMessage(String text){ checkNotNull(text); String[] split=text.split("\\|"); if (split.length > 1 && split[0].equalsIgnoreCase("v")) { setCUISupport(true); try { setCUIVersion(Integer.parseInt(split[1])); } catch ( NumberFormatException e) { WorldEdit....
Handle a CUI initialization message.
public boolean isLiteral(){ return false; }
Subclasses should override this returning true if the instance represents a literal character. The default implementation returns false.
public void update(){ if (firstRow > maxRows) { firstRow=maxRows; fromRowField.setText(firstRow + ""); } if (lastRow > maxRows) { lastRow=maxRows; toRowField.setText(lastRow + ""); } if (firstColumn > maxColumns) { firstColumn=maxColumns; fromColumnField.setText(firstColumn + ""); } ...
Performs a last range check for changes due to setting the maximum via a method call.
public void startScroll(int startX,int startY,int dx,int dy,int duration){ mMode=SCROLL_MODE; mFinished=false; mDuration=duration; mStartTime=AnimationUtils.currentAnimationTimeMillis(); mStartX=startX; mStartY=startY; mFinalX=startX + dx; mFinalY=startY + dy; mDeltaX=dx; mDeltaY=dy; mDurationReci...
Start scrolling by providing a starting point, the distance to travel, and the duration of the scroll.
public void addAll(Collection<BugInstance> collection,boolean updateActiveTime){ for ( BugInstance warning : collection) { add(warning,updateActiveTime); } }
Add a Collection of BugInstances to this BugCollection object.
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.
public static void generateEventsByClearRegionOperation() throws Exception { Connection connection=pool.acquireConnection(); String regionName=Region.SEPARATOR + REGION_NAME; ServerRegionProxy srp=new ServerRegionProxy(regionName,pool); for (int i=0; i < eventIds.length; i++) { srp.clearOnForTestsOnly(conne...
Generates events having specific values of threadId and sequenceId, via clearRegionOperation through connection object
public void notifyFunctionStateChanged(int functionNumber,boolean isSet){ if (mThrottle != null) { switch (functionNumber) { case 0: mThrottle.setF0(isSet); break; case 1: mThrottle.setF1(isSet); break; case 2: mThrottle.setF2(isSet); break; case 3: mThrottle.setF3(isSet); break; case 4: mThrottle.setF4(i...
Get notification that a function has changed state
@Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setRetainInstance(true); }
Hook method called when a new instance of Fragment is created.
public TargetMarker(int width,int height){ super(width,height); init(); }
creates a new GameBoard
public JsonNewUser(){ this.password=DEFAULT_PASSWORD; this.username=generateUsername(); }
Creates a user with generated username and a default password.
public final long bytesWritten(){ return this.dataOut.getBytesWritten(); }
Returns the number of bytes written so far to this archive. This does not take compression into account.
protected void fixupBlocks(byte[] bytes2){ byte[] bytes=bytes2; for (Iterator enumerator=blocks.iterator(); enumerator.hasNext(); ) { int[] info=(int[])enumerator.next(); int codeSize=info[1]; int offset=info[0]; byte[] sizeBytes=OutStream.sintTo2Bytes(codeSize); bytes[offset]=sizeBytes[0]; ...
Description of the Method
static void transferRemoteCandidates(Agent localAgent,Agent remotePeer){ List<IceMediaStream> streams=localAgent.getStreams(); for ( IceMediaStream localStream : streams) { String streamName=localStream.getName(); IceMediaStream remoteStream=remotePeer.getStream(streamName); if (remoteStream != null) ...
Installs remote candidates in <tt>localAgent</tt>..
@Override public void run(){ amIActive=true; String inputHeader=null; String outputHeader=null; int row, col, rows, cols; int progress=0; double z, maxZ, noData, outputNoData; int i, whichCell; int[] dX=new int[]{-1,0,-1,0}; int[] dY=new int[]{-1,-1,0,0}; int numScanCells=dX.length; if (args.lengt...
Used to execute this plugin tool.
public final MessageBuilder header(String name,String value){ JsoArray<Pair> headers=message.getHeaders(); if (headers == null) { headers=JsoArray.create(); } for (int i=0; i < headers.size(); i++) { Pair header=headers.get(i); if (name.equals(header.getName())) { header.setValue(value); ...
Sets a request header with the given name and value. If a header with the specified name has already been set then the new value overwrites the current value.
private byte[] pageToByteArray(P page){ try { if (page == null) { ByteArrayOutputStream baos=new ByteArrayOutputStream(); ObjectOutputStream oos=new ObjectOutputStream(baos); oos.writeInt(EMPTY_PAGE); oos.close(); baos.close(); byte[] array=baos.toByteArray(); byte[] resu...
Serializes an object into a byte array.
public void mutate(float amount){ for (int i=0; i < numKnots; i++) { int rgb=yKnots[i]; int r=((rgb >> 16) & 0xff); int g=((rgb >> 8) & 0xff); int b=(rgb & 0xff); r=PixelUtils.clamp((int)(r + amount * 255 * (Math.random() - 0.5))); g=PixelUtils.clamp((int)(g + amount * 255 * (Math.random() - 0...
Mutate the gradient.
public static boolean isLeftMouseButton(MouseEvent anEvent){ return ((anEvent.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0 || anEvent.getButton() == MouseEvent.BUTTON1); }
Returns true if the mouse event specifies the left mouse button.
public ActionNode(String nodeId,Set<Value> actionValues){ this(nodeId); this.actionValues=new HashSet<Value>(actionValues); }
Creates a new action node with a unique identifier and a set of values
public String correctQuotedFieldNames(String vendorName,String expression){ return m_interfaces.get(getDBVendorID(vendorName)).correctQuotedFieldNames(expression); }
/ correct expressions using quoted field names<p> some databases erroneously surround any column names used in expressions with quotes, which must be removed
public boolean isAccessibilityComputationAreaFromNetwork(){ return accessibilityComputationAreaFromNetwork; }
Gets the value of the accessibilityComputationAreaFromNetwork property.
public void encode(final ActiveMQBuffer buffer){ buffer.writeString(name); buffer.writeString(factoryClassName); buffer.writeInt(params == null ? 0 : params.size()); if (params != null) { encodeMap(buffer,params); } if (extraProps != null) { encodeMap(buffer,extraProps); } }
Encodes this TransportConfiguration into a buffer. <p> Note that this is only used internally ActiveMQ Artemis.
public SslSelectFastestProxyNoConnections(){ requestFileName="getstate.query"; responseFile="getstate.answer"; }
Constructs the test case.
public EditSensorDialog(final Sensor sensor){ super(); if (sensor == null) { throw new IllegalArgumentException("sensor must not be null"); } this.sensor=sensor; setTitle("Edit Sensor: (" + this.sensor.getReceptiveField().getX() + ", "+ this.sensor.getReceptiveField().getY()+ ")"); initComponents(); ...
Create a new edit sensor dialog.
public static double deriv(double pred,double y){ final double x=y * pred; if (x >= 30) return 0; else if (x <= -30) return y; return -y / (1 + exp(y * pred)); }
Computes the first derivative of the logistic loss
public static PeriodFormatter standard(){ if (cStandard == null) { cStandard=new PeriodFormatterBuilder().appendLiteral("P").appendYears().appendSuffix("Y").appendMonths().appendSuffix("M").appendWeeks().appendSuffix("W").appendDays().appendSuffix("D").appendSeparatorIfFieldsAfter("T").appendHours().appendSuffix(...
The standard ISO format - PyYmMwWdDThHmMsS. Milliseconds are not output. Note that the ISO8601 standard actually indicates weeks should not be shown if any other field is present and vice versa.
private String format(Object... params){ StringBuilder buf=new StringBuilder(); for ( Object p : params) { if (p instanceof String) { formatTo(buf,(String)p); } else if (p instanceof List) { formatTo(buf,(List<?>)p); } else { LOG.warning("Incorrect object type: " + p.getClass())...
Format objects to a command line.
public SimpleGrouperMediaNode(BasicMediaSource inSource,BasicMediaNode inParent,String inGroupLabel,String inGroupType,Object inGroupObject,MediaNode[] inChildren){ super(inSource,inParent,inGroupLabel,inGroupType,inGroupObject); children=inChildren; for (int i=0; i < children.length; i++) { if (children[i] i...
Creates a new instance of SimpleGrouperMediaFileNode
@Override public void eSet(int featureID,Object newValue){ switch (featureID) { case UmplePackage.CODE_LANG___CODE_LANG_1: setCodeLang_1((String)newValue); return; } super.eSet(featureID,newValue); }
<!-- begin-user-doc --> <!-- end-user-doc -->
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:58:05.168 -0500",hash_original_method="3156E5829AEB14A787F26082DFE50344",hash_generated_method="E56B43F48F2878D3CB0575C123027539") private void mergeCollapse(){ while (stackSi...
Examines the stack of runs waiting to be merged and merges adjacent runs until the stack invariants are reestablished: 1. runLen[i - 3] > runLen[i - 2] + runLen[i - 1] 2. runLen[i - 2] > runLen[i - 1] This method is called each time a new run is pushed onto the stack, so the invariants are guaranteed to hold for i < st...
public InformationModel basicGetModel(){ return model; }
<!-- begin-user-doc --> <!-- end-user-doc -->
@RequestMapping(value="/businessObjectFormats/generateDdl",method=RequestMethod.POST,consumes={"application/xml","application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMATS_GENERATE_DDL_POST) public BusinessObjectFormatDdl generateBusinessObjectFormatDdl(@RequestBody BusinessObjectFormatDdlRequest busine...
Retrieves the DDL to initialize the specified type of the database system (e.g. Hive) by creating a table for the requested business object format. <p>Requires READ permission on namespace</p>
protected void addInstrumentationForDefaultSwitchCase(BytecodeInstruction v,InsnList instrumentation){ if (v.isTableSwitch()) addInstrumentationForDefaultTableswitchCase(v,instrumentation); if (v.isLookupSwitch()) addInstrumentationForDefaultLookupswitchCase(v,instrumentation); }
<p> addInstrumentationForDefaultSwitchCase </p>
protected void doFunction(float[] inputs,int inputOffset,float[] outputs,int outputOffset){ float[] encoded=new float[getNumInputs()]; for (int i=0; i < getNumOutputs(); i++) { } }
Map from <i>m</i> input values to <i>n</i> output values. The number of inputs <i>m</i> must be exactly one half the size of the domain. The number of outputs should match one half the size of the range.
public void updateDBVersion(double dbVersion) throws CommandException { final double maxPercent=100.0; dbVersion=Math.round(dbVersion * maxPercent) / maxPercent; if (getLog().isDebugEnabled()) { getLog().debug("updateDBVersion, current version is: " + dbVersion); } executeUpdateCommand(dbVersion); }
Update DB version to compatible DB version.
public SafeAsyncTask(Executor executor){ this.executor=executor; }
Sets Handler to new Handler()
public BoolQueryBuilder minimumShouldMatch(String minimumShouldMatch){ this.minimumShouldMatch=minimumShouldMatch; return this; }
Sets the minimum should match using the special syntax (for example, supporting percentage).
private void validate(int[][] b){ int found[]={0,0,0,0,0,0,0,0,0}; StringBuilder bs=new StringBuilder(); for (int r=0; r <= MaxR; r++) { for (int c=0; c <= MaxC; c++) { found[b[r][c]]=1; bs.append(b[r][c]); } bs.append('|'); } for (int i=0; i < found.length; i++) { if (found[i] == ...
Validate the given board state.
public static boolean canPlaySong(Song s){ final boolean offlineMode=ProviderAggregator.getDefault().isOfflineMode(); return s != null && s.isAvailable() && (!offlineMode || s.getOfflineStatus() == BoundEntity.OFFLINE_STATUS_READY); }
Returns whether or not the song can be played. This takes into account the track's availability as reported by the provider, as well as the offline status and mode
@SuppressWarnings("unchecked") protected void receiveEntityUpdate(Packet c){ int eindex=c.getIntValue(0); Entity entity=(Entity)c.getObject(1); Vector<UnitLocation> movePath=(Vector<UnitLocation>)c.getObject(2); getGame().setEntity(eindex,entity,movePath); }
Loads entity update data from the data in the net command.
public void leaveBusy(){ lock.readLock().unlock(); }
Leaves "busy" state.
public void initializeReservoir(NeuronGroup neuronGroup,SynapseGroup synapseGroup,double spectralRadius){ if (reservoirLayer != null) { throw new IllegalStateException("The reservoir layer has already" + " been set."); } this.spectralRadius=spectralRadius; reservoirLayer=neuronGroup; reservoirLayer.setGri...
Initializes the reservoir. This method must be given the recurrent synapse group in addition to the neuron group associated with the reservoir. This method scales the weights of the synapse group to conform the desired spectral radius and sets the spectral radius of this esn accordingly.
public boolean writeCharacteristic(BluetoothGattCharacteristic characteristic,String value){ return writeCharacteristic(characteristic,value.getBytes()); }
Write value to characteristic, and send to remote bluetooth le device.
@Override public double[] distributionForInstance(Instance instance) throws Exception { double[] dist=new double[instance.numClasses()]; switch (instance.classAttribute().type()) { case Attribute.NOMINAL: double classification=classifyInstance(instance); if (Utils.isMissingValue(classification)) { return di...
Predicts the class memberships for a given instance. If an instance is unclassified, the returned array elements must be all zero. If the class is numeric, the array must consist of only one element, which contains the predicted value. Note that a classifier MUST implement either this or classifyInstance().
public Object key(){ return "" + s; }
suitable unique key for this node.