code
stringlengths
10
174k
nl
stringlengths
3
129k
public static String[] toPaths(SourceFile[] sourceFiles){ String[] dest=new String[sourceFiles.length]; for (int i=0; i < sourceFiles.length; i++) { dest[i]=sourceFiles[i].javaFile.getPath(); } return dest; }
Converts source files to file paths.
public GrammarRuleNode parseRules(EvolutionState state,BufferedReader reader,GPFunctionSet gpfs){ rules=new HashMap(); try { String line; while ((line=reader.readLine()) != null) { GrammarRuleNode rule=parseRule(state,new Lexer(line.trim(),DEFAULT_REGEXES),gpfs); if (rule != null && root == null...
Parses the rules from a grammar and returns the resulting GrammarRuleNode root.
public static byte[] intArrayToByteArray(int[] intArray){ byte[] byteArray=new byte[intArray.length]; for (int i=0; i < intArray.length; i++) { byteArray[i]=intToByte(intArray[i]); } return byteArray; }
Convert an array of ints to an array of unsigned bytes. This is useful when you want to construct a literal array of unsigned bytes with values greater than 127. Only the lowest 8 bits of the int values are used.
public FeatureParameter basicGetParameter(){ return parameter; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void endDocument() throws SAXException { super.endDocument(); m_exptype.addElement(NULL); m_parent.addElement(NULL); m_nextsib.addElement(NULL); m_firstch.addElement(NULL); m_extendedTypes=m_expandedNameTable.getExtendedTypes(); m_exptype_map=m_exptype.getMap(); m_nextsib_map=m_nextsib.getMap(); ...
Receive notification of the end of the document.
public boolean isArrayMode(){ return arrayMode; }
Return a boolean indicating if the parser is used to parse an array or not
public boolean ttEntails(KnowledgeBase kb,Sentence alpha){ List<PropositionSymbol> symbols=new ArrayList<PropositionSymbol>(SymbolCollector.getSymbolsFrom(kb.asSentence(),alpha)); return ttCheckAll(kb,alpha,symbols,new Model()); }
function TT-ENTAILS?(KB, &alpha;) returns true or false.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:33:15.312 -0500",hash_original_method="50CD500D47F4FCEE0A0F59D7183F0AD5",hash_generated_method="6BA4FAFF5E710B22D2B7E38FD8D68A75") @DSSpec(DSCat.DATA_GENERAL) public void confirm(String result){ mStringResult=result; confirm(); }
Handle a confirmation response from the user.
public static void alert(Context context,Task b){ Log.d("IssueAlert","generating alert for " + b.getDescription()); Preferences prefs=new Preferences(context); if (!prefs.generateAlerts()) { return; } LocationManager locationManager=(LocationManager)context.getApplicationContext().getSystemService(Context...
Generate an alert/notification if we found a task object nearby.
public Where(String rel,String label,String valueString){ this.rel=rel; this.label=label; this.valueString=valueString; }
Constructs a new Where instance using the specified parameters.
public Interpolation(SpatialGrid sg,final int method){ this(sg,method,1); }
Prepares interpolation with the selected interpolation method. If inverse distance weighting is chosen, the exponent for weights will be the default value 1.
private PrintContainer(){ }
Can not be instantiated.
public static void polygon(double[] x,double[] y){ int N=x.length; GeneralPath path=new GeneralPath(); path.moveTo((float)scaleX(x[0]),(float)scaleY(y[0])); for (int i=0; i < N; i++) path.lineTo((float)scaleX(x[i]),(float)scaleY(y[i])); path.closePath(); offscreen.draw(path); draw(); }
Draw a polygon with the given (x[i], y[i]) coordinates.
public void initialize(JobContext job,RuntimeServices services){ InvocationContext<I,O> context=new InvocationContext<I,O>(id,job,services,inputs.size(),outputs); try { oplet.initialize(context); } catch ( Exception e) { e.printStackTrace(); } List<? extends Consumer<I>> streamers=oplet.getInputs();...
Initialize the invocation.
public static int codePointCount(char[] seq,int offset,int count){ if (seq == null) { throw new NullPointerException(); } int len=seq.length; int endIndex=offset + count; if (offset < 0 || count < 0 || endIndex > len) { throw new IndexOutOfBoundsException(); } int result=0; for (int i=offset; i ...
<p> Counts the number of Unicode code points in the subsequence of the <code>char[]</code>, as delineated by the <code>offset</code> and <code>count</code>. Any surrogate values with missing pair values will be counted as 1 code point. </p>
public void onNewLineSoftWrapAware(){ if (myEditor.getSoftWrapModel().getSoftWrap(offset) == null) { onNewLine(); return; } softWrapLinesCurrent++; softWrapColumnDiff=-logicalColumn - foldingColumnDiff; visualLine++; visualColumn=0; x=0; }
Asks current position to change its state assuming that it should point to the start of the next visual line.
private void trainOnInstanceImpl(Instance inst){ if (this.treeRoot == null) { this.treeRoot=newLearningNode(this.parallelismHint); this.activeLeafNodeCount=1; } FoundNode foundNode=this.treeRoot.filterInstanceToLeaf(inst,null,-1); trainOnInstanceImpl(foundNode,inst); }
Helper method that represent training of an instance. Since it is decision tree, this method routes the incoming instance into the correct leaf and then update the statistic on the found leaf.
public LetterboxingViewport(final float targetPpi){ this(targetPpi,targetPpi,4f / 3f); }
Creates a new letterboxing viewport with 4/3 aspect ratio.
public String dumpAsMap(Object data){ return dumpAs(data,Tag.MAP,FlowStyle.BLOCK); }
<p> Serialize a Java object into a YAML string. Override the default root tag with <code>Tag.MAP</code>. </p> <p> This method is similar to <code>Yaml.dump(data)</code> except that the root tag for the whole document is replaced with <code>Tag.MAP</code> tag (implicit !!map). </p> <p> Block Mapping is used as the colle...
public static boolean linkSelected(final ISelection selection){ final String path=getFirstSelectedPath(selection); if (path == null) { return false; } else { return FileSystemUtils.getInstance().getAttributes(path).isSymbolicLink(); } }
Test whether the selection is symlink
public void mouseOver(){ TestLogging.log("MouseOver " + this.toString()); findElement(); Locatable hoverItem=(Locatable)element; Mouse mouse=((HasInputDevices)driver).getMouse(); mouse.mouseMove(hoverItem.getCoordinates()); }
Forces a mouseOver event on the WebElement.
public void test_DELETE_accessPath_delete_all() throws Exception { doInsertbyURL("POST",packagePath + "test_delete_by_access_path.ttl"); final long mutationResult=doDeleteWithAccessPath(null,null,null); assertEquals(7,mutationResult); }
Delete everything matching an access path description.
public void update(Graphics g,JComponent c){ if (c.isOpaque()) { g.setColor(c.getParent().getBackground()); g.fillRect(0,0,c.getWidth(),c.getHeight()); g.setColor(c.getBackground()); g.fillRect(0,ROUND_HEIGHT,c.getWidth(),c.getHeight() - ROUND_HEIGHT); } paint(g,c); }
Overriden to paint the background of the component but keeping the rounded corners.
public SortOrder(Database database,int[] queryColumnIndexes,int[] sortType,ArrayList<SelectOrderBy> orderList){ this.database=database; this.queryColumnIndexes=queryColumnIndexes; this.sortTypes=sortType; this.orderList=orderList; }
Construct a new sort order object.
private void method(MethodDetail detail){ Annotation[] list=detail.getAnnotations(); Method method=detail.getMethod(); for ( Annotation label : list) { if (label instanceof Commit) { commit(method); } if (label instanceof Validate) { validate(method); } if (label instanceof Persis...
Scans the provided method for a persister callback method. If the method contains an method annotated as a callback that method is stored so that it can be invoked by the persister during the serialization and deserialization process.
public JsonObjectParser build(){ return new JsonObjectParser(this); }
Returns a new instance of a JSON object parser.
public static BytesRef randomBinaryTerm(Random r){ int length=r.nextInt(15); BytesRef b=new BytesRef(length); r.nextBytes(b.bytes); b.length=length; return b; }
Returns a random binary term.
public static IMultiPoint[] randomSearchPoints(int n,int scale){ IMultiPoint points[]=new IMultiPoint[n]; for (int i=0; i < n; i++) { double d1=rGen.nextDouble() * scale; double d2=rGen.nextDouble() * scale; points[i]=new TwoDPoint(d1,d2); } return points; }
Generate array of n d-dimensional points whose coordinates are values in the range 0 .. scale
public void resetTracker(){ tracker.reset(); }
Tell the head tracker to reset, clearing all orientation and alignment state. It will realign on the next sensor readings.
public static <T>T withWriter(Writer writer,@ClosureParams(FirstParam.class) Closure<T> closure) throws IOException { try { T result=closure.call(writer); try { writer.flush(); } catch ( IOException e) { } Writer temp=writer; writer=null; temp.close(); return result; } fi...
Allows this writer to be used within the closure, ensuring that it is flushed and closed before this method returns.
protected Change createUndoChange(UndoEdit edit,ContentStamp stampToRestore){ return new UndoTextFileChange(getName(),fFile,edit,stampToRestore,fSaveMode); }
Hook to create an undo change for the given undo edit and content stamp. This hook gets called while performing the change to construct the corresponding undo change object.
public static <T extends Serializable>void write(File file,T object) throws IOException { try (ObjectOutputStream output=new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)))){ output.writeObject(object); } }
Writes the given object to the given file.
private List<Node> uncoveredPotentiallyDirectedPathStarts(Node x,Node y,Graph g,LinkedList<Node> path){ List<Node> pathThrough=new ArrayList<>(); if (x == y) return path; if (path.contains(x)) return path; path.add(x); for ( Node n : g.getAdjacentNodes(x)) { Edge e=g.getEdge(x,n); if (e.getProxim...
Returns the adjacents n of x such that x*-*n... starts a potentially directed path.
public void addMemberNodes(Collection<GraphNode> result){ result.addAll(getChildrenNodes()); for ( CollapseData data : getChildrenCollapse()) { data.addMemberNodes(result); } }
Add all nodes included in this collapse data, including any nested collapse data. The master node is included in the member nodes.
@EventHandler(priority=EventPriority.HIGH,ignoreCancelled=true) public void onBucketEmpty(PlayerBucketEmptyEvent event){ Match match=Cardinal.getMatch(event.getPlayer()); if (match == null || !match.hasPlayer(event.getPlayer())) { return; } for ( AppliedRegion reg : get(match,ApplyType.BLOCK,ApplyType.BLOC...
Filters PlayerBucketEmptyEvent (placing down a block of liquid). <p>Applies to: block, block place and block place against.<p/>
public MilStd2525UnitsFormat(){ this(UnitsFormat.KILOMETERS,UnitsFormat.SQUARE_KILOMETERS,true); }
Construct an instance that displays length in kilometers, area in square kilometers and angles in degrees, minutes, seconds.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:31:03.905 -0500",hash_original_method="002BA51785B71C2E50AE0C2AD1D7634D",hash_generated_method="1924CC4E06D7BD970F950DF1C2A728FF") public void bindConstants(Allocation a,int slot){ if (slot < 0 || slot >= mConstants.length) { thr...
Binds a constant buffer to be used as uniform inputs to the program
public static float updateValue(float current,float target){ return ClientUtils.updateValue(current,target,0.5F); }
Update a value with the default factor of 0.5.
protected synchronized void merge(DoubleMinMax minmax){ this.minmax.put(minmax.getMin()); this.minmax.put(minmax.getMax()); }
Merge the result of an instance.
public SequenceDiagram generateDiagram(){ if (diagramRetrieved) { return dia; } else { boolean createdLaterWarning=false; for ( Lifeline ll : dia.getLifelines()) { if (!ll.isCreatedOnStart() && ll.getCreated() == null) { createdLaterWarning=true; ll.setCreatedOnStart(true); ...
Called as final step. Can be called multiple times, but every time the same diagram (same reference) is returned. If there exists a major issue with the diagram an exception is thrown, otherwise the diagram is returned and if there are minor issues these are added to the warnings.
private static String encode_base64(byte d[],int len) throws IllegalArgumentException { int off=0; StringBuffer rs=new StringBuffer(); int c1, c2; if (len <= 0 || len > d.length) { throw new IllegalArgumentException("Invalid len"); } while (off < len) { c1=d[off++] & 0xff; rs.append(base64_code[...
Encode a byte array using bcrypt's slightly-modified base64 encoding scheme. Note that this is *not* compatible with the standard MIME-base64 encoding.
@CanIgnoreReturnValue public MapMaker concurrencyLevel(int concurrencyLevel){ checkState(this.concurrencyLevel == UNSET_INT,"concurrency level was already set to %s",this.concurrencyLevel); checkArgument(concurrencyLevel > 0); this.concurrencyLevel=concurrencyLevel; return this; }
Guides the allowed concurrency among update operations. Used as a hint for internal sizing. The table is internally partitioned to try to permit the indicated number of concurrent updates without contention. Because assignment of entries to these partitions is not necessarily uniform, the actual concurrency observed ma...
@Override public void addPropertyChangeListener(PropertyChangeListener pcl){ m_pcSupport.addPropertyChangeListener(pcl); }
Add a property change listener
public void init() throws ServletException { }
Initialization of the servlet. <br>
public static Bitmap byteToBitmap(byte[] b){ return (b == null || b.length == 0) ? null : BitmapFactory.decodeByteArray(b,0,b.length); }
convert byte array to Bitmap
private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix,namespace); x...
Util method to write an attribute with the ns prefix
private void select(JSpinner spinner){ JComponent editor=spinner.getEditor(); if (editor instanceof JSpinner.DateEditor) { JSpinner.DateEditor dateEditor=(JSpinner.DateEditor)editor; JFormattedTextField ftf=dateEditor.getTextField(); Format format=dateEditor.getFormat(); Object value; if (format...
If the spinner's editor is a DateEditor, this selects the field associated with the value that is being incremented.
@Override public void close() throws ResourceException { super.close(); try { if (this.xaConnection != null) this.xaConnection.close(); } catch ( SQLException err) { } }
Overrides default close to include closing any open connections to the XADataSource.
public JRootPane(){ setGlassPane(createGlassPane()); setLayeredPane(createLayeredPane()); setContentPane(createContentPane()); setLayout(createRootLayout()); setDoubleBuffered(true); updateUI(); }
Creates a <code>JRootPane</code>, setting up its <code>glassPane</code>, <code>layeredPane</code>, and <code>contentPane</code>.
public PreferenceScreen addPreferencesForType(final String accountType,PreferenceScreen parent){ PreferenceScreen prefs=null; if (mAuthenticatorHelper.containsAccountType(accountType)) { AuthenticatorDescription desc=null; try { desc=mAuthenticatorHelper.getAccountTypeDescription(accountType); i...
Gets the preferences.xml file associated with a particular account type.
protected Object engineGetParameter(String param) throws InvalidParameterException { if (param == null) { throw new NullPointerException("param == null"); } return null; }
Deprecated method.
public RTLExpression applyInverse(RTLExpression rhs){ int firstBit=((RTLNumber)getFirstBitIndex()).intValue(); int lastBit=((RTLNumber)getLastBitIndex()).intValue(); long bitMask=RTLBitRange.bitMask(0,firstBit - 1) | RTLBitRange.bitMask(lastBit + 1,operand.getBitWidth()); RTLExpression castToOpSize=ExpressionFa...
Creates a bitmasking expression over the supplied parameter that is the inverse of this bitrange. Can be used for simplifying assignments such as x[0:7] = y; to x := (x & bitmask) | (size of x)y; x[8:15] = y; to x := (x & bitmask) | ((size of x)y << 8)
public void addChild(Adm child){ if (child == null) { throw new IllegalArgumentException("Could not add a null child to " + this); } if (child.getLevel() != getLevel() + 1) { throw new IllegalArgumentException("a child of level " + child.getLevel() + " ("+ child+ ") should not be added to an Adm with leve...
Do a double set : Add (not replace ! ) The child to the current Adm and set the current Adm as the Parent of the specified Child.
public static AnimGameItem process(MD5Model md5Model,MD5AnimModel animModel,Vector3f defaultColour) throws Exception { List<Matrix4f> invJointMatrices=calcInJointMatrices(md5Model); List<AnimatedFrame> animatedFrames=processAnimationFrames(md5Model,animModel,invJointMatrices); List<Mesh> list=new ArrayList<>(); ...
Constructs and AnimGameItem instace based on a MD5 Model an MD5 Animation
public static BigDecimal calculateFiFo(MProduct product,int M_AttributeSetInstance_ID,MAcctSchema as,int AD_Org_ID){ String sql="SELECT t.MovementQty, mi.Qty, il.QtyInvoiced, il.PriceActual," + " i.C_Currency_ID, i.DateAcct, i.C_ConversionType_ID, i.AD_Client_ID, i.AD_Org_ID, t.M_Transaction_ID " + "FROM M_Transactio...
Calculate FiFo Cost
private boolean isSameVdcAsLocalNode(String node){ PropertyInfoExt vdcProps=LocalRepository.getInstance().getVdcPropertyInfo(); String myVdcId=vdcProps.getProperty("vdc_myid"); String vdcShortId=getVdcShortIdByIp(node); if (vdcShortId != null && vdcShortId.equals(myVdcId)) { log.info(node + " is in the same...
check if specified node is in the same VDC as the local node
private Object readText(InputNode node) throws Exception { Label text=group.getText(); Converter converter=text.getConverter(context); return converter.read(node); }
The <code>readText</code> method is used to read free text from between the declared elements and add them to a list. Consuming free text in this manner enables an element list union to parse unstructured XML such as XHTML.
public LoopedSoundSource(String sound,int radius,int volume,SoundLayer layer){ setRPClass(RPCLASS_NAME); put("type",RPCLASS_NAME); put("sound",sound); put("radius",radius); put("volume",volume); put("layer",layer.ordinal()); }
Create an ambient sound area.
public static void sort(int[] array){ DualPivotQuicksort.sort(array); }
Sorts the specified array in ascending numerical order.
@Override public void load(Entity unit,boolean checkFalse,int bayNumber){ load(unit,checkFalse); }
We need to override this function to make sure the proper load method gets called in some cases, but Squadrons can't have bays, so we can just ignore the bay number.
protected POInfo initPO(Properties ctx){ POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName()); return poi; }
Load Meta Data
@SuppressWarnings("unchecked") public Response onCommand(POP3Session session,Request request){ if (session.getHandlerState() == POP3Session.TRANSACTION) { List<MessageMetaData> uidList=(List<MessageMetaData>)session.getAttachment(POP3Session.UID_LIST,State.Transaction); List<String> deletedUidList=(List<Strin...
Handler method called upon receipt of a STAT command. Returns the number of messages in the mailbox and its aggregate size.
public final void identity(){ int i, j; for (i=0; i < nRow; i++) { for (j=0; j < nCol; j++) { values[i][j]=0.0; } } int l; if (nRow < nCol) { l=nRow; } else { l=nCol; } for (i=0; i < l; i++) { values[i][i]=1.0; } }
Sets this GMatrix to the identity matrix.
public boolean isFilled(){ return filled; }
Returns the filled boolean.
public void removeOwnerFromGroup(String email,String groupId) throws AppsForYourDomainException, MalformedURLException, IOException, ServiceException { delete(new URL(baseDomainUrl + groupId + "/owner/"+ email)); }
Removes an owner from the group.
public static String encodeWebSafe(byte[] source,boolean doPadding){ return encode(source,0,source.length,WEBSAFE_ALPHABET,doPadding); }
Encodes a byte array into web safe Base64 notation.
public static List<T> list(final HGSearchResult<T> result){ final List<T> outputList=new ArrayList<T>(); while (result.hasNext()) { final T currentValue=result.next(); outputList.add(currentValue); } return outputList; }
Iterates through result and copies encountered items to the list.
void sendUpdate(){ String msg="SET " + bus + " GL "; msg+=(address.getNumber()); msg+=(isForward ? " 1" : " 0"); msg+=" " + ((int)(speedSetting * maxsteps)); msg+=" "; msg+=maxsteps; msg+=f0 ? " 1" : " 0"; msg+=f1 ? " 1" : " 0"; msg+=f2 ? " 1" : " 0"; msg+=f3 ? " 1" : " 0"; msg+=f4 ? " 1" : " 0"; ...
Send the complete status
ExtensionFileFilter(final String extension,final String description){ this.extension=extension; this.description=description; }
Construct a file filter.
public static <S,T>Function<Pair<S,T>,Pair<T,S>> swappedPair(){ return (Function<Pair<S,T>,Pair<T,S>>)(Function<?,?>)SWAPPED_PAIR_FUNCTION; }
Swap the input pair and return the swapped pair.
public void close() throws IOException { RAStream localRaf=ras; if (localRaf != null) { synchronized (localRaf) { ras=null; localRaf.close(); } if (fileToDeleteOnClose != null) { fileToDeleteOnClose.delete(); fileToDeleteOnClose=null; } } }
Closes this zip file. This method is idempotent. This method may cause I/O if the zip file needs to be deleted.
public final boolean[] signature(final double[] vector){ boolean[] sig=new boolean[this.hyperplanes.length]; for (int i=0; i < this.hyperplanes.length; i++) { sig[i]=(dotProduct(this.hyperplanes[i],vector) >= 0); } return sig; }
Compute the signature of this vector.
public Iterator<Flags.Flag> systemFlagIterator(){ return Arrays.asList(modifiedFlags.getSystemFlags()).iterator(); }
Gets an iterator for the system flags changed.
@Override public void run(){ amIActive=true; String inputFilesString=null; String fileName=null; int i=0; int row, col, rows, cols; String[] imageFiles; int numImages=0; double noData=-32768; String returnHeaderFile=""; if (args.length <= 0) { showFeedback("Plugin parameters have not been set.")...
Used to execute this plugin tool.
public JSONTokener(String s){ this(new StringReader(s)); }
Construct a JSONTokener from a string.
public void mv(File src,File dst){ run(null); }
Removes the given file or directory.
protected POInfo initPO(Properties ctx){ POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName()); return poi; }
Load Meta Data
public void load(int id){ if (!isSoundLoaded(id)) { _soundMap.put(id,_soundPool.load(sContext,id,1)); } }
Loads a sound. Called automatically by play() if not already loaded
public void applyImpulses(int curAnswerRow,sim.util.matrix.Vector answers){ Double2D R=new Double2D(answers.vals[curAnswerRow],answers.vals[curAnswerRow + 1]); if (obj1 instanceof MobileObject2D) { MobileObject2D mobj1=(MobileObject2D)obj1; mobj1.setVelocity(mobj1.getVelocity().add(R.multiply(mobj1.getMassI...
Applies the calculated impulses to the objects involved in the collision
public static String pennPOSToWordnetPOS(String s){ if (s.matches("NN|NNP|NNS|NNPS")) { return "noun"; } if (s.matches("VB|VBD|VBG|VBN|VBZ|VBP|MD")) { return "verb"; } if (s.matches("JJ|JJR|JJS|CD")) { return "adjective"; } if (s.matches("RB|RBR|RBS|RP|WRB")) { return "adverb"; } retur...
Computes the WordNet 2.0 POS tag corresponding to the PTB POS tag s.
public boolean tryLogInWithCookie(final HttpServletRequest request,final HttpServletResponse response){ final Cookie[] cookies=request.getCookies(); if (null == cookies || 0 == cookies.length) { return false; } try { for ( final Cookie cookie : cookies) { if (!"b3log-latke".equals(cookie.getNam...
Tries to login with cookie.
public static boolean isNull(JCTree tree){ if (!tree.hasTag(LITERAL)) return false; JCLiteral lit=(JCLiteral)tree; return (lit.typetag == BOT); }
Return true if a tree represents the null literal.
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 SimpleTimeLimiter(ExecutorService executor){ this.executor=checkNotNull(executor); }
Constructs a TimeLimiter instance using the given executor service to execute proxied method calls. <p><b>Warning:</b> using a bounded executor may be counterproductive! If the thread pool fills up, any time callers spend waiting for a thread may count toward their time limit, and in this case the call may even time ou...
Account(String name,int id,double balance){ this(id,balance); this.name=name; }
Creates an account with the specified name,id and initial balance
@SuppressWarnings("rawtypes") synchronized public ICounter addCounter(final String path,final IInstrument instrument){ if (path == null) { throw new IllegalArgumentException(); } final int indexOf=path.lastIndexOf(pathSeparator); if (indexOf == -1) { return addCounter2(path,instrument); } final Stri...
Add a counter.
public Matrix mul(final double scalar){ final Matrix result=new Matrix(rows(),cols()); if (addr.isContiguous()) { for (int addr=0; addr < size(); addr++) { result.$[addr]=this.$[addr] * scalar; } } else { int addr=0; final Address.MatrixAddress.MatrixOffset src=this.addr.offset(); for (...
Returns the result of a multiplication of <code>this</code> Matrix by a <code>scalar</code>
@Override public double useKarma(final double negLimit,final double posLimit){ return useKarma(negLimit,posLimit,0.01); }
Use some of the player's karma. A positive value indicates good luck/energy. A negative value indicates bad luck/energy. A value of zero should cause no change on an action or outcome. The granularity is <code>0.01</code> (%1 unit).
public final String join(@Nullable Object first,@Nullable Object second,Object... rest){ return join(iterable(first,second,rest)); }
Returns a string containing the string representation of each argument, using the previously configured separator between each.
public static BigInteger decodeMPI(byte[] mpi,boolean hasLength){ byte[] buf; if (hasLength) { int length=(int)readUint32BE(mpi,0); buf=new byte[length]; System.arraycopy(mpi,4,buf,0,length); } else buf=mpi; if (buf.length == 0) return BigInteger.ZERO; boolean isNegative=(buf[0] & 0x80) == 0x...
MPI encoded numbers are produced by the OpenSSL BN_bn2mpi function. They consist of a 4 byte big endian length field, followed by the stated number of bytes representing the number in big endian format (with a sign bit).
public void generate(File projectDirectory,String projectName){ File workDir=projectDirectory.getParentFile(); PhpExecutable phpExecutable=new PhpExecutable(composerPath).workDir(workDir).additionalParameters(Arrays.asList(CREATE_PROJECT_COMMAND,NO_INTERACTION_PARAM,PREFER_DIST_PARAM,CAKEPHP_APP,projectName)); Fu...
Generate project via Composer. Use composer create-project command.
public void combineContextAndItems(Example examples){ transformContext(examples.context); transformItems(examples.example); addContextToItemsAndTransform(examples); }
In place apply all the transforms to the context and items, add context to examples, and apply the combined transform to now combined examples.
public int compareTo(Message m){ return toString().compareTo(m.toString()); }
Compares two messages by their ID (alphabetically).
@MainThread public void change(T obj){ if (!isLockEnabled) { throw new RuntimeException("changing of values only cen be performed in locked state"); } modifiedValue=obj; notifyInMainThread(modifiedValue); }
Can be executed only between create/release lock calls
public FastAdapterDialog<Item> withTitle(String title){ setTitle(title); return this; }
Set the title text for this dialog's window.
public void testBasics() throws Exception { Directory dir=newDirectory(); RandomIndexWriter writer=new RandomIndexWriter(random(),dir); Document document=new Document(); document.add(new LongRangeField(FIELD_NAME,new long[]{-10,-10},new long[]{9,10})); writer.addDocument(document); document=new Document(); ...
Basic test
public int executeRaw(DatabaseConnection connection,String statement,String[] arguments) throws SQLException { logger.debug("running raw execute statement: {}",statement); if (arguments.length > 0) { logger.trace("execute arguments: {}",(Object)arguments); } CompiledStatement compiledStatement=connection.co...
Return true if it worked else false.
public void startBuilding(String systemID,int lineNr){ this.stack=new Stack(); this.root=null; }
This method is called before the parser starts processing its input.
private void writeOutTypeCollection(BytecodeContext bc) throws TransformerException { GeneratorAdapter adapter=bc.getAdapter(); int index=-1; Attribute attrIndex=getAttribute("index"); if (attrIndex != null) { index=adapter.newLocal(Types.VARIABLE_REFERENCE); adapter.loadArg(0); attrIndex.getValue()...
write out collection loop
private GridUriDeploymentSpringParser(){ }
Enforces singleton.