code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public OMGraphicList checkProjAndGetTiledImages(Projection proj) throws IOException {
if (!isOnMap(proj) || !validScale(proj)) {
return new OMGraphicList();
}
return getTiledImages(proj);
}
| Get an OMGraphicList of files that cover the projection. Returns an empty list if the coverage isn't over the map. |
protected void processPauseRequest(){
if (mState == State.PLAYING) {
mState=State.PAUSED;
mPlayer.pause();
releaseResources(false);
}
}
| Processes a request to pause the current playback |
public boolean contains(Key key){
if (key == null) throw new NullPointerException("argument to contains() is null");
return get(key) != null;
}
| Returns true if this symbol table contains the specified key. |
public static BufferedImage convertToPowerOfTwoImage(BufferedImage image,boolean scaleToFit){
if (image == null) {
String message=Logging.getMessage("nullValue.ImageIsNull");
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
if (WWMath.isPowerOfTwo(image.getWidth()) && W... | Returns a copy of the specified image such that the new dimensions are powers of two. The new image dimensions will be equal to or greater than the original image. The flag <code>scaleToFit</code> determines whether the original image should be drawn into the new image with no special scaling, or whether the original i... |
public void deleteChar(){
String text=getText();
if (text.length() > 0) {
int cursorCharPosition=getCursorPosition();
if (cursorCharPosition > 0) {
int tmpCursorCharPosition=cursorCharPosition - 1;
if (!overwriteMode) {
if (tmpCursorCharPosition == text.length()) {
text=text.su... | Performs a backspace operation |
public int indexOf(int offset,float value){
for (int i=offset; i < _pos; i++) {
if (_data[i] == value) {
return i;
}
}
return -1;
}
| Searches the list front to back for the index of <tt>value</tt>, starting at <tt>offset</tt>. |
protected void initLinkTable(){
m_links=createLinkTable();
IntIterator edges=getEdgeTable().rows();
while (edges.hasNext()) {
updateDegrees(edges.nextInt(),1);
}
}
| Initialize the link table, which holds adjacency lists for this graph. |
public void testOversizeDimensions(){
Document doc=new Document();
IllegalArgumentException expected;
expected=expectThrows(IllegalArgumentException.class,null);
assertTrue(expected.getMessage().contains("does not support greater than 4 dimensions"));
}
| dimensions greater than 4 not supported |
protected void internalAdd(TemplatePersistenceData data){
if (!data.isCustom()) {
String id=data.getId();
for (Iterator it=fTemplates.iterator(); it.hasNext(); ) {
TemplatePersistenceData d2=(TemplatePersistenceData)it.next();
if (d2.getId() != null && d2.getId().equals(id)) return;
}
... | Adds a template to the internal store. The added templates must have a unique id. |
public double filter(double x){
int stage=order;
while (stage >= 0) {
if (stage > 0) {
x-=k[stage - 1] * state[stage - 1];
state[stage]=k[stage - 1] * x + state[stage - 1];
}
else {
state[stage]=x;
}
stage--;
}
return ((double)state[order]);
}
| Filters a single sample of a sequence. Because the filter maintains state between calls to filter(x), a sequence (signal) can be filtered by repeated calls to this method using successive continguous samples of the sequence as the argument. |
public String toString(){
return this.keyword;
}
| Returns the keyword for the modifier. |
public static String[] values(){
return ALL_VALUES;
}
| Returns an array of all values defined in this class. |
public boolean removeLastOccurrence(Object o){
if (o == null) return false;
int mask=elements.length - 1;
int i=(tail - 1) & mask;
E x;
while ((x=elements[i]) != null) {
if (o.equals(x)) {
delete(i);
return true;
}
i=(i - 1) & mask;
}
return false;
}
| Removes the last occurrence of the specified element in this deque (when traversing the deque from head to tail). If the deque does not contain the element, it is unchanged. More formally, removes the last element <tt>e</tt> such that <tt>o.equals(e)</tt> (if such an element exists). Returns <tt>true</tt> if this deque... |
public long convertGeodeticToMGRS(double latitude,double longitude,int precision){
String Hemisphere=AVKey.NORTH;
double Easting=0.0;
double Northing=0.0;
MGRSString="";
long error_code=MGRS_NO_ERROR;
if ((latitude < -PI_OVER_2) || (latitude > PI_OVER_2)) {
error_code=MGRS_LAT_ERROR;
}
if ((longitud... | The function convertGeodeticToMGRS converts Geodetic (latitude and longitude) coordinates to an MGRS coordinate string, according to the current ellipsoid parameters. If any errors occur, the error code(s) are returned by the function, otherwise MGRS_NO_ERROR is returned. |
@SuppressWarnings("unchecked") public Frame<V>[] analyze(final String owner,final MethodNode m) throws AnalyzerException {
if ((m.access & (ACC_ABSTRACT | ACC_NATIVE)) != 0) {
frames=(Frame<V>[])new Frame<?>[0];
return frames;
}
n=m.instructions.size();
insns=m.instructions;
handlers=(List<TryCatchBlo... | Analyzes the given method. |
public int read(BitReader bitreader) throws JSONException {
try {
this.width=0;
Symbol symbol=this.table;
while (symbol.integer == none) {
this.width+=1;
symbol=bitreader.bit() ? symbol.one : symbol.zero;
}
tick(symbol.integer);
if (JSONzip.probe) {
JSONzip.logchar(symbol.int... | Read bits until a symbol can be identified. The weight of the read symbol will be incremented. |
public JenkinsIntegration jenkins(){
return jenkinsIntegration;
}
| Jenkins Integration. |
public void adjustFacing(MoveStepType stepType){
facing=MovePath.getAdjustedFacing(facing,stepType);
}
| Adjusts facing to comply with the type of step indicated. |
public static Font[] loadFontUsingByteArray(File file,boolean fingerprint) throws IOException {
byte[] b=TestUtils.readFile(file);
FontFactory fontFactory=FontFactory.getInstance();
fontFactory.fingerprintFont(fingerprint);
return fontFactory.loadFonts(b);
}
| Open a file and read any fonts that it contains. In many cases this will be a single font but it may be multiple fonts. |
private void updateSize(IoBuffer data){
this.widthInfo=data.getShort();
this.heightInfo=data.getShort();
this.width=this.widthInfo & 0xfff;
this.height=this.heightInfo & 0xfff;
this.blockWidth=this.widthInfo & 0xf000;
this.blockWidth=(this.blockWidth >> 12) + 1;
this.blockWidth<<=4;
this.blockHeight=thi... | Update total block size |
@Override @Transient public boolean isFullTextSearchable(){
return true;
}
| Override the gisFeature value.<br> Default to true;<br> If this field is set to false, then the object won't be synchronized with the fullText search engine |
private boolean isDirectPolyfill(ContainerType<?> containerType){
if (!containerType.isStaticPolyfill() || !(bottomType instanceof TClassifier)) {
return false;
}
QualifiedName qn=N4TSQualifiedNameProvider.getStaticPolyfillFQN((TClassifier)bottomType,qualifiedNameProvider);
if (containerType instanceof TCla... | Returns true if the given container type is a polyfill of the bottom type. <p> Note: we compare via FQN here, since the bottom type may not stem from the index but from the type model derived from the AST. In that case, the type instance, although similar, differs from the type instance from the index. |
public void add(Class geomFuncClass){
List funcs=createFunctions(geomFuncClass);
Collections.sort(funcs);
add(funcs);
}
| Adds functions for all the static methods in the given class. |
private void init(){
_logger.debug("Initializing....");
list=new ConcurrentLinkedQueue<ArrivedIndication>();
IntermediateProcessor intermediateProcessor=new IntermediateProcessor(list,_processor);
indicationProcessTimer=Executors.newSingleThreadScheduledExecutor();
indicationProcessTimer.scheduleWithFixedDela... | Will get called during construction phase, configured through spring xml configuration |
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. |
private void selectAutoCompleteTerm(FilterBypass filterBypass,AttributeSet attributeSet,Object selectedItemBeforeEdit,boolean allowPartialAutoCompletionTerm) throws BadLocationException {
if (doNotAutoComplete) return;
final boolean prefixIsEmpty="".equals(prefix);
final int originalCaretPosition=comboBoxEditor... | This method will attempt to locate a reasonable autocomplete item from all combo box items and select it. It will also populate the combo box editor with the remaining text which matches the autocomplete item and select it. If the selection changes and the JComboBox is not a Table Cell Editor, an ActionEvent will be br... |
public IComment editLocalComment(final IComment comment,final String newComment) throws com.google.security.zynamics.binnavi.API.disassembly.CouldntSaveDataException {
try {
return m_node.getComments().editLocalCodeNodeComment(comment,newComment);
}
catch ( final CouldntSaveDataException exception) {
thro... | Edit a local code node comment. |
public static boolean isOnLine(Coordinate p,Coordinate[] pt){
LineIntersector lineIntersector=new RobustLineIntersector();
for (int i=1; i < pt.length; i++) {
Coordinate p0=pt[i - 1];
Coordinate p1=pt[i];
lineIntersector.computeIntersection(p,p0,p1);
if (lineIntersector.hasIntersection()) {
re... | Tests whether a point lies on the line segments defined by a list of coordinates. |
protected void endNode(int node) throws org.xml.sax.SAXException {
super.endNode(node);
if (DTM.ELEMENT_NODE == m_dtm.getNodeType(node)) {
m_transformer.getXPathContext().popCurrentNode();
}
}
| End processing of given node |
protected void updatePositions(DocumentEvent event){
ArrayList<PositionUpdater> list=new ArrayList<PositionUpdater>(fPositionUpdaters);
Iterator<PositionUpdater> e=list.iterator();
while (e.hasNext()) {
PositionUpdater u=e.next();
u.update(event);
}
}
| Updates all positions of all categories to the change described by the document event. All registered document updaters are called in the sequence they have been arranged. Uses a robust iterator. |
public static void playSound(final String soundFilePath){
playSound(new File(soundFilePath));
}
| Plays an audio file asynchronously. |
private void addDistributionLocatorConfig(DistributionLocatorConfig config){
checkReadOnly();
this.locatorConfigs.add(config);
configChanged();
}
| Adds the configuration for a DistributionLocator |
public IndexExistsException(String msg,Throwable cause){
super(msg,cause);
}
| Constructs instance of IndexNameConflictException with error message and cause |
@Override public boolean eIsSet(int featureID){
switch (featureID) {
case N4JSPackage.INDEXED_ACCESS_EXPRESSION__TARGET:
return target != null;
case N4JSPackage.INDEXED_ACCESS_EXPRESSION__INDEX:
return index != null;
}
return super.eIsSet(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private final char _verifyNoLeadingZeroes() throws IOException, JsonParseException {
if (_inputPtr >= _inputEnd && !loadMore()) {
return '0';
}
char ch=_inputBuffer[_inputPtr];
if (ch < '0' || ch > '9') {
return '0';
}
if (!isEnabled(Feature.ALLOW_NUMERIC_LEADING_ZEROS)) {
reportInvalidNumber("L... | Method called when we have seen one zero, and want to ensure it is not followed by another |
private double testFit(double[] x,double[] test,Distribution dist) throws ArithmeticException {
for (int i=0; i < test.length; i++) {
test[i]=dist.cdf(x[i]);
if (test[i] > 1.) {
test[i]=1.;
}
if (test[i] < 0.) {
test[i]=0.;
}
if (Double.isNaN(test[i])) {
throw new ArithmeticE... | Test the quality of a fit. |
private void pingClient(String toToken,String senderToken){
Client senderClient;
if (toToken.equals(SENDER_ID + "@" + GcmServer.GCM_HOST)) {
senderClient=clientMap.get(toToken);
toToken=senderToken;
}
else {
senderClient=clientMap.get(senderToken);
}
JsonObject jPing=new JsonObject();
JsonObjec... | Send message to Client with matching toToken. The validity of to and sender tokens should be check before this method is called. |
public AWTGVTFont(String name,int style,int size){
this.awtFont=new Font(name,style,(int)FONT_SIZE);
this.size=size;
this.scale=size / awtFont.getSize2D();
initializeFontCache(awtFont);
}
| Creates a new AWTGVTFont from the specified name, style and point size. |
public void init(boolean encrypting,CipherParameters params){
if (params instanceof KeyParameter) {
this.encrypting=encrypting;
this.workingKey=((KeyParameter)params).getKey();
this.k64Cnt=(this.workingKey.length / 8);
setKey(this.workingKey);
return;
}
throw new IllegalArgumentException("inva... | initialise a Twofish cipher. |
private static int GetBooleanField(JNIEnvironment env,int objJREF,int fieldID){
if (traceJNI) VM.sysWrite("JNI called: GetBooleanField \n");
RuntimeEntrypoints.checkJNICountDownToGC();
try {
Object obj=env.getJNIRef(objJREF);
RVMField field=MemberReference.getFieldRef(fieldID).resolve();
return fie... | GetBooleanField: read an instance field of type boolean |
public ByteArrayBody(final byte[] data,final String filename){
this(data,"application/octet-stream",filename);
}
| Creates a new ByteArrayBody. |
@SuppressWarnings("unused") public StreamingViewAsSingleton(DataflowRunner runner,View.AsSingleton<T> transform){
this.transform=transform;
}
| Builds an instance of this class from the overridden transform. |
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
s.defaultReadObject();
if (connectivity == null) {
throw new NullPointerException();
}
if (booleanFunctions == null) {
throw new NullPointerException();
}
if (errorDistributions == null) {
throw new NullPoi... | Adds semantic checks to the default deserialization method. This method must have the standard signature for a readObject method, and the body of the method must begin with "s.defaultReadObject();". Other than that, any semantic checks can be specified and do not need to stay the same from version to version. A readObj... |
public Boolean isEnable(){
return enable;
}
| Gets the value of the enable property. |
private void obtainStyledAttributes(@Nullable final AttributeSet attributeSet){
TypedArray typedArray=getContext().obtainStyledAttributes(attributeSet,R.styleable.EditText);
try {
obtainMaxNumberOfCharacters(typedArray);
obtainEditTextStyledAttributes(typedArray);
}
finally {
typedArray.recycle();
... | Obtains all attributes from a specific attribute set. |
protected boolean isStoreAsOrdinal(){
return this.storeAsOrdinal;
}
| Devuelve <code>true</code> si el enumerado se recupera/persiste como entero y <code>false</code> si se recupera/persiste la cadena de caracteres asociada al enumerado. |
static JpaTarget updateTargetInfo(@NotNull final JpaTarget target,@NotNull final TargetUpdateStatus status,final boolean setInstalledDate,final TargetInfoRepository targetInfoRepository,final EntityManager entityManager){
final JpaTargetInfo ts=(JpaTargetInfo)target.getTargetInfo();
ts.setUpdateStatus(status);
if... | Internal helper method used only inside service level. As a result is no additional security necessary. |
private void mgf1(byte[] seed,int seedOfs,int seedLen,byte[] out,int outOfs,int maskLen) throws BadPaddingException {
byte[] C=new byte[4];
byte[] digest=new byte[mgfMd.getDigestLength()];
while (maskLen > 0) {
mgfMd.update(seed,seedOfs,seedLen);
mgfMd.update(C);
try {
mgfMd.digest(digest,0,dige... | Compute MGF1 using mgfMD as the message digest. Note that we combine MGF1 with the XOR operation to reduce data copying. We generate maskLen bytes of MGF1 from the seed and XOR it into out[] starting at outOfs; |
public String metaphone(String txt){
boolean hard=false;
if ((txt == null) || (txt.isEmpty())) {
return "";
}
if (txt.length() == 1) {
return txt.toUpperCase(java.util.Locale.ENGLISH);
}
char[] inwd=txt.toUpperCase(java.util.Locale.ENGLISH).toCharArray();
StringBuilder local=new StringBuilder(40);... | Find the metaphone value of a String. This is similar to the soundex algorithm, but better at finding similar sounding words. All input is converted to upper case. Limitations: Input format is expected to be a single ASCII word with only characters in the A - Z range, no punctuation or numbers. |
public PlaceMark(int col,int row,Player player){
this.col=col;
this.row=row;
this.player=player;
}
| Construct a placeMark move with given (col,row) and mark to be placed. <p> REQUIRES: player.mark != ' ' AND 0 ≤ col < # of columns in board AND 0 ≤ row < # of rows in board. |
@Override public void addListener(final IEventLayerListener listener){
listeners.add(listener);
}
| Method addMouseListener() |
private void release252c(){
String sql="SELECT COUNT(*) FROM M_ProductDownload";
int no=DB.getSQLValue(null,sql);
if (no > 0) {
log.finer("No Need - Downloads #" + no);
return;
}
int count=0;
sql="SELECT AD_Client_ID, AD_Org_ID, M_Product_ID, Name, DownloadURL " + "FROM M_Product " + "WHERE Download... | Release 252c |
public static String join(byte[] self,String separator){
StringBuilder buffer=new StringBuilder();
boolean first=true;
if (separator == null) separator="";
for ( byte next : self) {
if (first) {
first=false;
}
else {
buffer.append(separator);
}
buffer.append(next);
}
return b... | Concatenates the string representation of each items in this array, with the given String as a separator between each item. |
public Variant(Object value){
if (value instanceof Enumeration) value=((Enumeration)value).getValue();
this.value=value;
if (value != null) {
compositeClass=value.getClass();
if (compositeClass == Variant.class) {
throw new IllegalArgumentException("Variant cannot be " + compositeClass.getCanonica... | Create variant. |
public boolean open() throws IOException {
if (isCancelOpen) return false;
boolean inStage2=needsRollforward();
if (inStage2) {
for ( ITimmyTable tt : tables) {
if (!tt.commitTransactionStage2(null)) return false;
}
for ( ITimmyTable tt : tables) tt.commitTransactionStage3();
... | Must be called before interacting with the database and after all addTables() are done May be canceled by calling cancelOpen() (in another thread) |
public static boolean checkExpon(BigInteger x){
return !(x.compareTo(BigInteger.ONE) > 0 && x.compareTo(SM.ORDER_S) <= 0);
}
| Check that an BigInteger is in the right range to be a (non-zero) exponent |
public static final long BuildLongBE(byte bytevec[],int offset){
return (((long)signedToInt(bytevec[0 + offset]) << 56) | ((long)signedToInt(bytevec[1 + offset]) << 48) | ((long)signedToInt(bytevec[2 + offset]) << 40)| ((long)signedToInt(bytevec[3 + offset]) << 32)| ((long)signedToInt(bytevec[4 + offset]) << 24)| ((l... | Build long out of bytes (in big endian order). |
private void down(final String userId,final String dataId,final int dataType) throws RepositoryException {
final int oldType=voteRepository.removeIfExists(userId,dataId);
if (Vote.DATA_TYPE_C_ARTICLE == dataType) {
final JSONObject article=articleRepository.get(dataId);
if (null == article) {
LOGGER.l... | The specified user vote down the specified data entity with the specified data type. |
public IPreparedGraphQuery prepareGraphQuery(final String query) throws Exception {
return prepareGraphQuery(query,UUID.randomUUID());
}
| Prepare a graph query. |
public static ClientRequestType parseClientRegRequest(SoapMessageImpl message) throws Exception {
return parse(message,CLIENT_REG);
}
| Parses a client registration request. |
@Override public boolean isModified(){
return rawEditor.isTextModified() || attackerModified;
}
| Indicator for the proxy to show the original and edited tab. |
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:20.075 -0500",hash_original_method="8E464E19F5A7F279FF3FC1B84D15C4F0",hash_generated_method="3C7366855ACB2D093DD423127CC059B2") public boolean isHardwareAccelerated(){
re... | Indicates whether this Canvas uses hardware acceleration. Note that this method does not define what type of hardware acceleration may or may not be used. |
public double computeAverageLocal(int states[][][],int[][] sourceOffsets){
initialise();
addObservations(states,sourceOffsets);
return computeAverageLocalOfObservations();
}
| Standalone routine to compute average separable information across a 3D multivariate time series of the states of homogeneous agents. Return the average separable info. This method to be called for homogeneous agents only since it assumes all destinations have the same source offsets and includes them all in the calcu... |
public VersionedBrowserMatcher(@NonNull String packageName,@NonNull Set<String> signatureHashes,boolean usingCustomTab,@NonNull VersionRange versionRange){
mPackageName=packageName;
mSignatureHashes=signatureHashes;
mUsingCustomTab=usingCustomTab;
mVersionRange=versionRange;
}
| Creates a browser matcher that requires an exact match on package name, set of signature hashes, custom tab usage mode, and a version range. |
private Journal readJournal(ParcelFileDescriptor oldState){
Journal journal=new Journal();
if (oldState == null) {
return journal;
}
FileInputStream inStream=new FileInputStream(oldState.getFileDescriptor());
try {
int availableBytes=inStream.available();
if (DEBUG) Log.d(TAG,"available " + av... | Read the old journal from the input file. In the event of any error, just pretend we didn't have a journal, in that case, do a full backup. |
private UnManagedFileSystem createUnManagedFileSystem(UnManagedFileSystem unManagedFileSystem,String unManagedFileSystemNativeGuid,StorageSystem system,StoragePool pool,StoragePort storagePort,VNXeFileSystem fileSystem,DbClient dbClient){
boolean created=false;
if (null == unManagedFileSystem) {
unManagedFileSy... | create StorageFileSystem Info Object |
@Override protected void computeTxFillLevel(){
txInterruptFillLevel=tfc & TFC_TIL_MASK;
if (txInterruptFillLevel > 32) {
throw new RuntimeException(getName() + " error : HSC0TFC<TIL5:1> is more than 32 (" + txInterruptFillLevel+ ")");
}
}
| Compute Tx FIFO Fill Level to generate interrupts Overridden because it is much larger on hi-speed than normal serial interfaces |
public static void main(String[] argv){
ArgParser ap=new ArgParser("Purge");
if (argv.length == 0) {
ap.bail("Wanders through directory tree pruning '~' files.\nUsage: java com.bbn.openmap.util.wanderer.Purge <dir>",false);
}
Purge purge=new Purge(new String[]{".#"},new String[]{"~"});
for (int i=0; i < a... | Given a set of files or directories, parade through them to find files that end with '`', or files that start with '.#', and delete them. |
private void interpretClassResult(final ClassResult classResult){
classResult.getMethods().stream().forEach(null);
}
| Interprets the class result. |
@SuppressWarnings("unchecked") public final void integrityCheck(AbstractRStarTree<N,E,?> tree){
if (isLeaf()) {
for (int i=0; i < getCapacity(); i++) {
E e=getEntry(i);
if (i < getNumEntries() && e == null) {
throw new RuntimeException("i < numEntries && entry == null");
}
if (i >=... | Tests this node (for debugging purposes). |
void insert(V val,K key){
ArrayList<K> list=map.get(val);
if (list == null) {
list=new ArrayList<K>(4);
map.put(cloneValue(val),list);
}
list.add(key);
}
| Returns the ArrayList stored for a key |
protected boolean beforeSave(boolean newRecord){
if (newRecord || is_ValueChanged("Keyword")) setKeyword(getKeyword());
if (getKeyword().equals("?")) {
log.saveError("FillMandatory",Msg.getElement(getCtx(),"Keyword"));
return false;
}
return true;
}
| Before Save |
public synchronized void performExtract(final Node node){
if (node != null) {
createCheckpoint(R.string.undo_action_extract_node);
getDelegator().replaceNode(node);
map.invalidate();
}
}
| Replace node in all ways it is a member of with a new node, leaving node selected, if it already is. Note: relation memberships are not modified |
@OnWebSocketConnect public void onConnect(Session session){
this.websocketSession=session;
sendUpdate(this.websocketSession,this.oAuthToken,this.streamType,this.streamQuery,this.streamVersion,this.schemaVersion);
}
| Executed after establishing web socket connection with streams api |
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
| Run just this test. |
private void addA(byte[] in,int aStartLast){
ensureCapacity(A_INFO_LEN);
_out[_outLen]=A_KIND;
_out[_outLen + A_START_FIRST]=_aStartFirst;
_out[_outLen + A_START_LAST]=aStartLast;
_out[_outLen + A_TARGET_FIRST]=_targetAttrFirst;
_out[_outLen + A_TARGET_LAST]=_targetAttrLast;
_out[_outLen + A_HREF_FIRST]=_... | Adds an A to _out. |
public ReadProcessedDetails clone(){
ReadProcessedDetails result=new ReadProcessedDetails();
result.StartTime=StartTime;
result.EndTime=EndTime;
result.ProcessingInterval=ProcessingInterval;
result.AggregateType=AggregateType == null ? null : AggregateType.clone();
result.AggregateConfiguration=AggregateCon... | Deep clone |
public static void rotate(int[] ray,int first,int new_first,int last){
int next=new_first;
while (next != first) {
int temp=ray[first];
ray[first]=ray[next];
ray[next]=temp;
first++;
next++;
if (next == last) {
next=new_first;
}
else if (first == new_first) {
new_first=n... | Rotate an array, see std::rotate |
public static JSONObject toJSONObject(java.util.Properties properties) throws JSONException {
JSONObject jo=new JSONObject();
if (properties != null && !properties.isEmpty()) {
Enumeration<?> enumProperties=properties.propertyNames();
while (enumProperties.hasMoreElements()) {
String name=(String)enum... | Converts a property file object into a JSONObject. The property file object is a table of name value pairs. |
public boolean isReconnectingDS(){
return !this.hasJoined && this.wasReconnectingSystem;
}
| Returns true if the distributed system is in the process of auto-reconnecting. Otherwise returns false. |
public void toggleTabNames(boolean showTabNames){
if (this.showTabNames == showTabNames) {
return;
}
this.showTabNames=showTabNames;
responseTabbedPanel.setShowTabNames(showTabNames);
if (layout != Layout.FULL) {
getTabbedStatus().setShowTabNames(showTabNames);
getTabbedSelect().setShowTabNames(sh... | Sets whether or not the tabs should display the name of the panels. <p> The call to this method has not effect if the state is already set. |
private Cursor makeStreamCursor(CharSequence streamName) throws SQLException {
if (streamName == null) {
streamName="";
}
return ((AndroidDatabaseResults)app.getDao(Stream.class).queryRaw("SELECT rowid _id, * FROM streams WHERE " + Stream.SUBSCRIBED_FIELD + " = 1 AND "+ Stream.NAME_FIELD+ " LIKE ? ESCAPE '\\'... | Creates a cursor to get the streams saved in the database |
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-18 10:08:23.582 -0400",hash_original_method="943099AB2885A4BDD8B9C646B5F94275",hash_generated_method="9B4C3F6F3E948F433E0CB6833B663B3A") public K keyAt(int index){
return (K)mArray[index << 1];
}
| Return the key at the given index in the array. |
private void latex(File file) throws IOException {
String fileName=file.getAbsolutePath();
BufferedReader in=new BufferedReader(new FileReader(file));
File outFile=new File(fileName + ".txt");
BufferedWriter out=new BufferedWriter(new FileWriter(outFile,false));
String line=null;
int lineNo=0;
while ((lin... | Strip Latex specifics. \textsl{\colorbox{yellow}{\textbf{Important:}}} For more information on the installation of the Adempiere Server and the Adempiere Client please refer to \href{http://www.adempiere.org/support/index.html}{Adempiere Support} for more details and the latest update. |
public static byte[] toByteArray(long[] array){
byte[] result=new byte[array.length];
for (int i=0; i < array.length; i++) {
result[i]=(byte)array[i];
}
return result;
}
| Coverts given longs array to array of bytes. |
protected static String dumpSerialStream(byte[] bytes){
StringBuilder sb=new StringBuilder(bytes.length * 5);
Formatter fmt=new Formatter(sb);
fmt.format(" byte[] bytes = {");
final int linelen=10;
for (int i=0; i < bytes.length; i++) {
if (i % linelen == 0) {
fmt.format("%n ");
}
... | Utility method to dump a byte array in a java syntax. |
public Boolean isSendOnError(){
return sendOnError;
}
| Gets the value of the sendOnError property. |
public boolean isLoadingMore(){
return STATUS.isLoadingMore(mStatus);
}
| is current status loading more |
public final void yyreset(java.io.Reader reader){
zzReader=reader;
zzAtBOL=true;
zzAtEOF=false;
zzEndRead=zzStartRead=0;
zzCurrentPos=zzMarkedPos=0;
yyline=yychar=yycolumn=0;
zzLexicalState=YYINITIAL;
}
| Resets the scanner to read from a new input stream. Does not close the old reader. All internal variables are reset, the old input stream <b>cannot</b> be reused (internal buffer is discarded and lost). Lexical state is set to <tt>ZZ_INITIAL</tt>. |
public boolean create(DBConnection db){
s_logger.log(Level.FINE,"createThisObject",new Object[]{getObjectType(),m_name,db.getDirection()});
Savepoint sp=db.setSavepoint("create object");
boolean result=m_interface.createObject(s_parameters,s_logger,s_dbEngine,db,m_name,m_headers,m_contents);
db.releaseSavepoint... | create this object |
public static LocPathIterator createUnionIterator(Compiler compiler,int opPos) throws javax.xml.transform.TransformerException {
UnionPathIterator upi=new UnionPathIterator(compiler,opPos);
int nPaths=upi.m_exprs.length;
boolean isAllChildIterators=true;
for (int i=0; i < nPaths; i++) {
LocPathIterator lpi=... | This will return an iterator capable of handling the union of paths given. |
private void removeOldRevocationValues(){
final Element toRemove=xadesSignature.getRevocationValues();
if (toRemove != null) {
unsignedSignaturePropertiesDom.removeChild(toRemove);
xadesSignature.resetRevocationSources();
}
}
| This method removes old revocation values from the unsigned signature properties element. |
public static int countOccurrences(String s,char c){
int count=0;
int index=0;
while (true) {
index=s.indexOf(c,index);
if (index == -1) {
break;
}
count++;
}
return count;
}
| Counts the number of occurrences of a character in the specified <tt>String</tt>. |
void calculateUtility(PhysicalInfo physicalInfo){
if (physicalInfo.getProbabilityToHit() <= 0.0) {
physicalInfo.setUtility(-10000);
return;
}
double utility=DAMAGE_UTILITY * physicalInfo.getExpectedDamage();
utility+=CRITICAL_UTILITY * physicalInfo.getExpectedCriticals();
utility+=KILL_UTILITY * physi... | calculates the 'utility' of a physical action. |
void buildStructure(Document doc) throws Exception {
m_Distributions=new Estimator[m_Instances.numAttributes()][];
for (int iNode=0; iNode < m_Instances.numAttributes(); iNode++) {
String sName=m_Instances.attribute(iNode).name();
Element definition=getDefinition(doc,sName);
ArrayList<Node> nodelist=get... | buildStructure parses the BIF document in the DOM tree contained in the doc parameter and specifies the the network structure and probability tables. It assumes that buildInstances has been called before |
private boolean holdsEqualTypeVariables(PolyfillValidationState state){
final String typeVars1=Joiner.on(',').join(state.polyType.getTypeVars().stream().map(null).toArray());
final String typeVars2=Joiner.on(',').join(state.filledType.getTypeVars().stream().map(null).toArray());
if (!typeVars1.equals(typeVars2)) ... | Constraint (Polyfill Class) 156.7 |
public void sendLocoNetMessage(LocoNetMessage m){
transmittedMsgCount++;
m.setParity();
int len=m.getNumDataElements();
byte msg[]=new byte[len];
for (int i=0; i < len; i++) {
msg[i]=(byte)m.getElement(i);
}
if (log.isDebugEnabled()) {
log.debug("queue LocoNet packet: {}",m.toString());
}
try ... | Forward a preformatted LocoNetMessage to the actual interface. Checksum is computed and overwritten here, then the message is converted to a byte array and queue for transmission |
@Override public List<Metric> transform(List<Metric> metrics,List<String> constants){
if (constants == null || constants.isEmpty()) {
return transform(metrics);
}
if (constants.size() == 1 && constants.get(0).toUpperCase().equals(FULLJOIN)) {
fulljoinIndicator=true;
return transform(metrics);
}
re... | If constants is not null, apply mapping transform to metrics list. Otherwise, apply reduce transform to metrics list |
public DownloadTouchIcon(Context ctx,ContentResolver cr,String url){
mTab=null;
mContext=ctx.getApplicationContext();
mContentResolver=cr;
mOriginalUrl=null;
mUrl=url;
mUserAgent=null;
}
| Use this ctor to download the touch icon and update the bookmarks database entry for the given url. Used when the user creates a bookmark from within the bookmarks activity and there haven't been any redirects. TODO: Would be nice to set the user agent here so that there is no potential for the three different ctors he... |
public static int readUnsignedShort(byte[] array,int offset){
int b0=array[offset + 0] & 0xFF;
int b1=array[offset + 1] & 0xFF;
return ((b0 << 8) + (b1 << 0));
}
| Read an unsigned short from the byte array at the given offset. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.