code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public VersionTagReply(){
}
| for deserialization |
public String peek(int numberChars){
return new String(_content,_index,numberChars);
}
| Peeks at the next number of chars and returns as a string without incrementing the current index. |
public boolean isDocOrdered(){
return m_inNaturalOrderStatic;
}
| Returns true if all the nodes in the iteration well be returned in document order. |
public void buildTank_player(EntityPlayer player,EnumFacing inside){
if (getWorld().isRemote) return;
buildPlayer=player;
buildTank(inside);
}
| Let a player build a tank! |
@POST @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @CheckPermission(roles={Role.TENANT_ADMIN},acls={ACL.OWN}) @Path("") public CatalogImageRestRep createCatalogImage(CatalogImageCreateParam createParam){
StorageOSUser user=getUserF... | Creates a new catalog image |
protected String doIt() throws Exception {
if (m_C_Project_ID == 0) {
return "Missing Mandatory Field Value (Project)";
}
MProject project=new MProject(getCtx(),m_C_Project_ID,get_TrxName());
log.info("doIt - " + project);
if (!MProject.PROJECTCATEGORY_AssetProject.equals(project.getProjectCategory())) ... | Perform process. |
public Where<T,ID> lt(String columnName,Object value) throws SQLException {
addClause(new SimpleComparison(columnName,findColumnFieldType(columnName),value,SimpleComparison.LESS_THAN_OPERATION));
return this;
}
| Add a '<' clause so the column must be less-than the value. |
public ByteArray readByteArray(Type target){
throw new RuntimeException("ByteArray objects not supported with AMF0");
}
| Read ByteArray object. This is not supported by the AMF0 deserializer. |
@Override public String toString(){
return Utils.join(chunks);
}
| Returns the program opcodes as a string, for example "[1234] DUP HASH160" |
public ImagePortrayal3D(ImageIcon icon){
this(icon.getImage());
}
| Constructs a (semi-)transparent, oriented ImagePortrayal3D using the provided ImageIcon |
private void resizePanel(){
if (parentFrame != null) {
int additionalParentHeight=(parentFrame.getBounds().height - scroller.getHeight());
scroller.resize();
int newHeight=scroller.getPreferredSize().height + additionalParentHeight;
if (newHeight > 300) {
parentFrame.pack();
parentFrame.se... | Resize the panel and parent frame. |
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. |
private static boolean hasSpecializedHandlerIntents(Context context,Intent intent){
try {
PackageManager pm=context.getPackageManager();
List<ResolveInfo> handlers=pm.queryIntentActivities(intent,PackageManager.GET_RESOLVED_FILTER);
if (handlers == null || handlers.size() == 0) {
return false;
}... | Used to check whether there is a specialized handler for a given intent. |
public static void checkInt(BigInteger expected,IonValue actual){
checkType(IonType.INT,actual);
IonInt i=(IonInt)actual;
if (expected == null) {
assertTrue("expected null value",actual.isNullValue());
}
else {
assertEquals("int content",expected,i.bigIntegerValue());
}
}
| Checks that the value is an IonInt with the given value. |
public static PcRunner serializableInstance(){
return PcRunner.serializableInstance();
}
| Generates a simple exemplar of this class to test serialization. |
public void deleteTrace(final TraceList trace) throws CouldntDeleteException {
Preconditions.checkNotNull(trace,"IE00167: Trace argument can not be null");
Preconditions.checkArgument(m_traces.contains(trace),"IE00168: Trace is not part of this module");
m_provider.deleteTrace(trace);
m_traces.remove(trace);
... | Deletes a trace from the module. |
public void testMoveRenameDirectoryDestinationMissingPartially() throws Exception {
create(igfsSecondary,paths(DIR,SUBDIR,SUBSUBDIR,DIR_NEW,SUBDIR_NEW),null);
create(igfs,paths(DIR,SUBDIR,SUBSUBDIR,DIR_NEW),null);
igfs.rename(SUBSUBDIR,SUBSUBDIR_NEW);
checkExist(igfs,SUBDIR_NEW);
checkExist(igfs,igfsSecondary... | Test move and rename in case destination exists partially and the path being renamed is a directory. |
public static Vector<Object> findInstances(Rectangle boundingBox,Integer... tab){
int index=0;
if (tab.length > 0) {
index=tab[0].intValue();
}
Vector<Object> components=null;
if (TABBED_COMPONENTS.size() > 0 && index < TABBED_COMPONENTS.size()) {
components=TABBED_COMPONENTS.get(index);
}
Graphic... | Looks for all beans (if any) located within the supplied bounding box. Also adjusts the bounding box to be a tight fit around all contained beans |
public Builder tcpPort(int tcpPort){
impl.tcpPort=tcpPort;
return this;
}
| Sets remote TCP port value. |
public TypedRead<K,V> withWatermarkFn(SerializableFunction<KV<K,V>,Instant> watermarkFn){
checkNotNull(watermarkFn);
return withWatermarkFn2(unwrapKafkaAndThen(watermarkFn));
}
| A function to calculate watermark after a record. Default is last record timestamp |
public ReplicatorCapabilities(TungstenProperties props) throws Exception {
Set<String> keys=props.keyNames();
for ( String key : keys) {
if (key.equals(ROLES)) {
List<String> tags=props.getStringList(key);
for ( String tag : tags) {
if (tag.equalsIgnoreCase(ROLE_MASTER)) {
ad... | Create a capabilities instance from TungstenProperties instance. |
@Override public int compareTo(RawComparable key){
return reader.compareKeys(blockBuffer,getKeyOffset(),getKeyLength(),key.buffer(),key.offset(),key.size());
}
| Compare an entry with a RawComparable object. This is useful when Entries are stored in a collection, and we want to compare a user supplied key. |
public Collection engineGenerateCertificates(InputStream inStream) throws CertificateException {
java.security.cert.Certificate cert;
List certs=new ArrayList();
while ((cert=engineGenerateCertificate(inStream)) != null) {
certs.add(cert);
}
return certs;
}
| Returns a (possibly empty) collection view of the certificates read from the given input stream inStream. |
private void initializeLayout(){
BoxLayout layout=new BoxLayout(this,BoxLayout.Y_AXIS);
this.setLayout(layout);
this.add(synapseInfoPanel);
this.add(Box.createVerticalStrut(DEFAULT_VGAP));
this.add(updateInfoPanel);
if (editSpikeResponders != null) {
this.add(Box.createVerticalStrut(DEFAULT_VGAP));
... | Lays out the panel. |
public void testPerformanceOnFullHits() throws Exception {
final int minPrefixLen=100;
final int maxPrefixLen=200;
runPerformanceTest(minPrefixLen,maxPrefixLen,num,onlyMorePopular);
}
| Test performance of lookup on full hits. |
private static void fillIdentifyingFields(final Product product,final VOService voProduct){
voProduct.setServiceId(getProductId(product));
}
| Sets the key and identifier in the transfer object |
public RegisterResponseMessage(RegisterResponseMessage other){
if (other.isSetHeader()) {
this.header=new AsyncMessageHeader(other.header);
}
}
| Performs a deep copy on <i>other</i>. |
public LoginFailedIPList listLoginFailedIPs(){
return client.get(LoginFailedIPList.class,CONFIG_LIST_BLOCK_IPS);
}
| list login-failed-ip with information of their last-access-time and failed-login-attempts |
public List<String> binaryTreePaths(TreeNode root){
List<String> paths=new ArrayList<>();
if (root != null) {
dfs(root,"",paths);
}
return paths;
}
| DFS. The path from root to leaf can be obtained by: At each node, add its left child's val to the path, traverse the left subtree. Then add its right child's val to the path, traverse the right subtree. The base case is when we reach a leaf, we add the path to result. |
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 remove(ImageFetchable src){
final FetcherInfo info=FetcherInfo.getFetcherInfo();
synchronized (info.waitList) {
if (info.waitList.contains(src)) {
info.waitList.removeElement(src);
}
}
}
| Removes an ImageFetchable from the queue of items to fetch. |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
private boolean readPort(){
_currentUrlMarker.setIndex(UrlPart.PORT,_buffer.length());
int portLen=0;
while (!_reader.eof()) {
char curr=_reader.read();
portLen++;
if (curr == '/') {
_buffer.append(curr);
return readPath();
}
else if (curr == '?') {
_buffer.append(curr);
... | Try to read the port of the url. |
public Matrix4x3f mulComponentWise(Matrix4x3fc other){
return mulComponentWise(other,this);
}
| Component-wise multiply <code>this</code> by <code>other</code>. |
private void prune(Node node,Graph graph,int depth){
TetradLogger.getInstance().log("pruning","Trying to remove edges adjacent to node " + node + ", depth = "+ depth+ ".");
List<Node> a=new LinkedList<>(graph.getAdjacentNodes(node));
NEXT_EDGE: for ( Node y : a) {
List<Node> adjNode=new LinkedList<>(graph.... | Tries node remove the edge node---from using adjacent nodes of node 'from', then tries node remove each other edge adjacent node 'from' using remaining edges adjacent node 'from.' If the edge 'node' is removed, the method immediately returns. |
public static ArchiveAccess createArchiveAccess(){
return new ArchiveAccessImpl();
}
| Crea la instancia para obtener el acceso al sistema de archivadores. |
protected static ValueTrackerElement transformRegisterLiteral(final ReilInstruction instruction,final ValueTrackerElement incomingState,final IElementGenerator generator){
final boolean registerFirst=inputOperandsAreRegisterLiteral(instruction);
final ReilOperand registerOperand=registerFirst ? instruction.getFirst... | Transforms MNEM R1, L1, R2 to (R2 => COMBINE(R1, L1)) |
public int hashCode(){
int hash=tx == null ? 0 : tx.hashCode();
if (defaulting) {
hash+=getAntiAliasingHint().hashCode();
hash+=getFractionalMetricsHint().hashCode();
}
else {
hash+=aaHintValue.hashCode();
hash+=fmHintValue.hashCode();
}
return hash;
}
| Return a hashcode for this FontRenderContext. |
public Document createDocument(){
User currentUser=UserServiceFactory.getUserService().getCurrentUser();
String userEmail=currentUser == null ? "" : currentUser.getEmail();
String userDomain=currentUser == null ? "" : currentUser.getAuthDomain();
String myDocId="PA6-5000";
Document doc=Document.newBuilder().s... | Code snippet for creating a Document. |
public BlockDXT1(){
}
| Creates a new DXT1 color block with colors and indices set to 0. |
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
WhiteboxRaster image;
WhiteboxRaster output;
int cols, rows;
int progress=0;
int col, row;
double z;
if (args.length <= 0) {
showFeedback("Plugin parameters have not been set.");
return;
}
inp... | Used to execute this plugin tool. |
public static final boolean objectEquals(Object o1,Object o2){
if (o1 == null || o2 == null) return (o1 == null && o2 == null);
return o1.equals(o2);
}
| checked s1.equals(s2) |
@NotNull private Collection<PyPresenterTestMemberEntry> launchAndGetMembers(@NotNull final String className){
final PyExtractSuperclassPresenterImpl sut=configureByClass(className);
myMocksControl.replay();
sut.launch();
return getMembers();
}
| launches presenter and returns member it displayed to user |
protected CCTMXMapInfo(String tmxFile){
super();
tilesets=new ArrayList<CCTMXTilesetInfo>();
layers=new ArrayList<CCTMXLayerInfo>();
filename=tmxFile;
objectGroups=new ArrayList<CCTMXObjectGroup>();
properties=new HashMap<String,String>();
tileProperties=new HashMap<String,HashMap<String,String>>();
cur... | initializes a TMX format witha tmx file |
public void voteComplete(QuorumVoteServerConnect quorumVote){
VoteRunnableHolder holder=voteRunnables.remove(quorumVote);
if (holder != null) {
for ( VoteRunnable runnable : holder.runnables) {
runnable.close();
}
}
}
| must be called by the quorum when it is happy on an outcome. only one vote can take place at anyone time for a specific quorum |
public synchronized void close(){
Throwable t=new Throwable("Closed due to user request.");
close(t,false);
}
| Close the connection to the SSH-2 server. All assigned sessions will be closed, too. Can be called at any time. Don't forget to call this once you don't need a connection anymore - otherwise the receiver thread may run forever. |
boolean handleDragging(MotionEvent event){
if (!mAppMenu.isShowing() || !mDragScrolling.isRunning()) return false;
final float rawX=event.getRawX();
final float rawY=event.getRawY();
final int roundedRawX=Math.round(rawX);
final int roundedRawY=Math.round(rawY);
final int eventActionMasked=event.getAction... | Gets all the touch events and updates dragging related logic. Note that if this app menu is initiated by software UI control, then the control should set onTouchListener and forward all the events to this method because the initial UI control that processed ACTION_DOWN will continue to get all the subsequent events. |
public static <V,W>Pair<V,W> create(V v,W w){
return new Pair<V,W>(v,w);
}
| Returns a new <code>Pair</code> instance with the given left-side and right-side objects. |
@Override public void visitInnerClass(final String aname,final String outerName,final String innerName,final int attr_access){
if ((name != null) && name.equals(aname)) {
this.access=attr_access;
}
super.visitInnerClass(aname,outerName,innerName,attr_access);
}
| Handle a bizarre special case. Nested classes (static classes declared inside another class) that are protected have their access bit set to public in their class files to deal with some odd reflection situation. Our SVUID computation must do as the JVM does and ignore access bits in the class file in favor of the acce... |
public long length() throws SQLException {
return actualSize;
}
| Returns the number of bytes in the <code>BLOB</code> value designated by this <code>Blob</code> object. |
public static boolean isSelinuxFlagInEnabled(){
String selinux=null;
try {
Class<?> c=Class.forName("android.os.SystemProperties");
Method get=c.getMethod("get",String.class);
selinux=(String)get.invoke(c,"ro.build.selinux");
}
catch ( Exception ignored) {
}
return "1".equals(selinux) ? true : f... | In Development - an idea of ours was to check the if selinux is enforcing - this could be disabled for some rooting apps Checking for selinux mode |
public static Object destroyKey1(){
try {
Region region=cache.getRegion(Region.SEPARATOR + REGION_NAME);
assertNotNull(region);
region.destroy("key1");
return eventId;
}
catch ( Exception e) {
fail("put failed due to ",e);
}
return null;
}
| does a destroy and return the eventid generated. Eventid is caught in the listener and stored in a static variable |
public static <T>Observable.Transformer<T,T> subscribeOnComputationThreadTransformer(){
return null;
}
| Returns a new Observable transformer that subscribes on a CPU computation thread. |
public final TextBuilder append(Object obj){
if (obj instanceof String) return append((String)obj);
if (obj instanceof Number) return appendNumber((Number)obj);
return append(String.valueOf(obj));
}
| Appends the textual representation of the specified object. This method is equivalent to <code>append(Text.valueOf(obj))</code> |
public static DateTime toDate(Object o,boolean alsoNumbers,TimeZone tz) throws PageException {
return DateCaster.toDateAdvanced(o,alsoNumbers ? DateCaster.CONVERTING_TYPE_OFFSET : DateCaster.CONVERTING_TYPE_NONE,tz);
}
| cast a Object to a DateTime Object |
public synchronized String format(LogRecord record){
StringBuffer sb=new StringBuffer();
String message=formatMessage(record);
sb.append(message);
sb.append(lineSeparator);
return sb.toString();
}
| Format the given LogRecord. |
public boolean isDomainZeroBaselineVisible(){
return this.domainZeroBaselineVisible;
}
| Returns a flag that controls whether or not a zero baseline is displayed for the domain axis. |
public TimeSynchronizationResult(final TimeInstant timeStamp,final TimeOffset currentTimeOffset,final TimeOffset change){
this.timeStamp=timeStamp;
this.currentTimeOffset=currentTimeOffset;
this.change=change;
}
| Creates a time synchronization result object. |
public void addListDataListener(ListDataListener l){
listenerList.add(ListDataListener.class,l);
}
| Adds a listener to the list that's notified each time a change to the data model occurs. |
public static long copyLarge(Reader input,Writer output,char[] buffer) throws IOException {
long count=0;
int n=0;
while (EOF != (n=input.read(buffer))) {
output.write(buffer,0,n);
count+=n;
}
return count;
}
| Copy chars from a large (over 2GB) <code>Reader</code> to a <code>Writer</code>. <p/> This method uses the provided buffer, so there is no need to use a <code>BufferedReader</code>. <p/> |
public Quaterniond mul(double qx,double qy,double qz,double qw){
set(w * qx + x * qw + y * qz - z * qy,w * qy - x * qz + y * qw + z * qx,w * qz + x * qy - y * qx + z * qw,w * qw - x * qx - y * qy - z * qz);
return this;
}
| Multiply this quaternion by the quaternion represented via <tt>(qx, qy, qz, qw)</tt>. <p> If <tt>T</tt> is <code>this</code> and <tt>Q</tt> is the given quaternion, then the resulting quaternion <tt>R</tt> is: <p> <tt>R = T * Q</tt> <p> So, this method uses post-multiplication like the matrix classes, resulting in a ve... |
private boolean isStaticAndFinal(VariableDeclaration variableDeclaration){
boolean isStatic=false;
boolean isFinal=false;
for ( KeywordModifier keywordModifier : variableDeclaration.astDefinition().astModifiers().astKeywords()) {
if (keywordModifier.astName().equals("static")) {
isStatic=true;
}
... | Return if the variable is static and final. |
public void test_getTrustManagers(){
try {
TrustManagerFactory trustMF=TrustManagerFactory.getInstance(getDefaultAlgorithm());
KeyStore ks=KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(null,null);
trustMF.init(ks);
TrustManager[] tm=trustMF.getTrustManagers();
assertNotNull("Result ... | Test for <code>geTrustManagers()</code> |
private JDiffField loadFieldInfo(String className,XmlPullParser parser){
String fieldName=parser.getAttributeValue(null,ATTRIBUTE_NAME);
String fieldType=parser.getAttributeValue(null,ATTRIBUTE_TYPE);
int modifier=jdiffModifierToReflectionFormat(className,parser);
return new JDiffField(fieldName,fieldType,modif... | Load field information from xml to memory. |
public Boolean isFirmwareUpgrade(){
return firmwareUpgrade;
}
| Ruft den Wert der firmwareUpgrade-Eigenschaft ab. |
public ChannelFuture connect(SocketAddress serverAddress) throws InterruptedException {
setSocketAddress(serverAddress);
return connect().sync();
}
| Connects synchronously to specified remote address. |
public int next(){
for (++_currentNode; _sp >= 0; ++_currentNode) {
if (_currentNode < _stack[_sp]) {
int type=_type2(_currentNode);
if (type != ATTRIBUTE_NODE && type != NAMESPACE_NODE) return returnNode(makeNodeHandle(_currentNode));
}
else --_sp;
}
return NULL;
}
| Get the next node in the iteration. |
public BulletParser(final ParsingFactory factory){
this.factory=factory;
}
| Creates a new bullet parser. |
public static Writable encodeBase64(Byte[] data){
return encodeBase64(DefaultTypeTransformation.convertToByteArray(data),false);
}
| Produce a Writable object which writes the Base64 encoding of the byte array. Calling toString() on the result returns the encoding as a String. For more information on Base64 encoding and chunking see <code>RFC 4648</code>. |
public static int EREMOTE(){
return Errno.EREMOTE.intValue();
}
| Object is remote |
@Override public int split(int leaf,TreeSplit split){
int indexOfNewNonLeaf=super.split(leaf,split);
DecisionTreeSplit dsplit=(DecisionTreeSplit)split;
for (int c=0; c < numClasses; c++) {
leafTargetDistributions[leaf][c]=dsplit.leftTargetDist[c];
leafTargetDistributions[numLeaves - 1][c]=dsplit.rightTarg... | turns a leaf of the tree into an internal node with two leaf-children |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public boolean indexOnly(){
return (loaders.isEmpty() && !((indexColumns == null) || indexColumns.isEmpty()));
}
| Does this loop consist solely of an index? |
protected void checkForDuplicateName(String name,Class<? extends DataObject> type){
checkForDuplicateName(name,type,null,null,_dbClient);
}
| Check if a resource with the same name exists at zone level |
public void testGuidEscapeSequence(){
check("CAST('12345678-9abc-def0-1234-123456789abc' AS UUID)","{guid '12345678-9abc-def0-1234-123456789abc'}");
check("select CAST('12345678-9abc-def0-1234-123456789abc' AS UUID) from SomeTable;","select {guid '12345678-9abc-def0-1234-123456789abc'} from SomeTable;");
check("s... | Test guid escape sequences |
public static double sinQuick(final double angle){
if (USE_JDK_MATH) {
return Math.sin(angle);
}
return MyTSinCos.cosTab[(int)(Math.abs(angle - Math.PI / 2) * SIN_COS_INDEXER + 0.5) & SIN_COS_TABS_SIZE - 2];
}
| Quick sin, with accuracy of about 1.6e-3 (PI/<look-up tabs size>) for |angle| < 6588395.0 (Integer.MAX_VALUE * (2*PI/<look-up tabs size>) - 2) (- 2 due to removing PI/2 before using cosine tab), and no accuracy at all for larger values. |
public void doOpen(){
try {
JFileChooser fileView=new JFileChooser();
fileView.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
fileView.addChoosableFileFilter(new JavaFilter());
fileView.setAcceptAllFileFilterUsed(false);
if (null == m_strategyDir) {
fileView.setCurrentDirectory(ne... | This is fired when the tool-bar File open button is pressed or the main menu Open File. |
public int compareTo(DiscoverInfo.Identity other){
String otherLang=other.lang == null ? "" : other.lang;
String thisLang=lang == null ? "" : lang;
String otherType=other.type == null ? "" : other.type;
String thisType=type == null ? "" : type;
if (category.equals(other.category)) {
if (thisType.equals(ot... | Compares this identity with another one. The comparison order is: Category, Type, Lang. If all three are identical the other Identity is considered equal. Name is not used for comparision, as defined by XEP-0115 |
private void testBug71396PrepStatementCheck(Connection testConn,String query,int expRowCount,int maxRows) throws SQLException {
PreparedStatement chkPStmt;
chkPStmt=testConn.prepareStatement(query);
if (maxRows > 0) {
chkPStmt.setMaxRows(maxRows);
}
testBug71396PrepStatementCheck(chkPStmt,query,expRowCoun... | Executes one query using a newly created PreparedStatement, setting its maxRows limit, and tests if the results count is the expected. |
@Override public boolean next() throws SQLException {
if (source != null) {
rowId++;
currentRow=source.readRow();
if (currentRow != null) {
return true;
}
}
else if (rows != null && rowId < rows.size()) {
rowId++;
if (rowId < rows.size()) {
currentRow=rows.get(rowId);
re... | Moves the cursor to the next row of the result set. |
private static byte[] discardNonBase64Bytes(byte[] data){
byte temp[]=new byte[data.length];
int bytesCopied=0;
for (int i=0; i < data.length; i++) {
if (isValidBase64Byte(data[i])) {
temp[bytesCopied++]=data[i];
}
}
byte newData[]=new byte[bytesCopied];
System.arraycopy(temp,0,newData,0,bytes... | Discards any characters outside of the base64 alphabet (see page 25 of RFC 2045) "Any characters outside of the base64 alphabet are to be ignored in base64 encoded data." |
private void parse(String line){
String message=null;
if (mTestRunInProgress || line.startsWith(Prefixes.TEST_RUN_MARKER)) {
if (line.startsWith(Prefixes.START_TEST_MARKER)) {
message=line.substring(Prefixes.START_TEST_MARKER.length()).trim();
processTestStartedTag(message);
}
else if (line... | Parse an individual output line. |
public String toString(){
return toString(root,height,"") + "\n";
}
| Returns a string representation of this B-tree (for debugging). |
private String[] listSeqnoFileNames(){
return fileIO.list(serviceDir,prefix);
}
| Return a list of seqno file names or an empty list if none eist. |
private void doCommonReturnToHive(){
AbstractMovingAgent entrance=hive.getEntrance();
doStepReturning(entrance);
if (entrance.isInSphere(this)) {
setState(State.unloadQueue);
}
}
| This method leads the bee to the entrance of the hive. After reaching the entrance the bee will head to the unload queue even if no nectar is loaded. |
public Object clone(){
mxCellState clone=new mxCellState(view,cell,style);
if (absolutePoints != null) {
clone.absolutePoints=new ArrayList<mxPoint>();
for (int i=0; i < absolutePoints.size(); i++) {
clone.absolutePoints.add((mxPoint)absolutePoints.get(i).clone());
}
}
if (origin != null) {
... | Returns a clone of this state where all members are deeply cloned except the view and cell references, which are copied with no cloning to the new instance. |
void initializeActiveLandmarks(final Node fromNode,final Node toNode,final int actLandmarkCount){
final PreProcessLandmarks.LandmarksData fromData=getPreProcessData(fromNode);
final PreProcessLandmarks.LandmarksData toData=getPreProcessData(toNode);
double[] estTravelTimes=new double[actLandmarkCount];
this.act... | Inspect all landmarks and determines the actLandmarkCount best ones that will be used for routing (so-called active landmarks). |
private static byte[] encode3to4(final byte[] b4,final byte[] threeBytes,final int numSigBytes,final int options){
Base64.encode3to4(threeBytes,0,numSigBytes,b4,0,options);
return b4;
}
| Encodes up to the first three bytes of array <var>threeBytes</var> and returns a four-byte array in Base64 notation. The actual number of significant bytes in your array is given by <var>numSigBytes</var>. The array <var>threeBytes</var> needs only be as big as <var>numSigBytes</var>. Code can reuse a byte array by pas... |
public static double[][] covarianceMatrix(double[][] data){
return covarianceMatrix(data,means(data));
}
| Compute the covariance matrix between all column pairs (variables) in the multivariate data set |
void loadTOS(Method m,Deque<Expr> stk,Deque<Expr> scp,Deque<Expr> out,Deque<Object> verbose,Set<Expr> live,Map<Integer,Integer> locals){
showstate(live,stk,scp,verbose);
Expr e=stk.removeLast();
if (e == stk.peekLast()) issue_dup(e,m,out,verbose);
else issue_load(e,m,out,verbose,live,locals);
}
| issue a load for whatever is on the stack top |
public void paint(Component c,Graphics g,int x,int y,int w,int h,Image source,Insets sInsets,Insets dInsets,PaintType type,int mask){
if (source == null) {
return;
}
super.paint(c,g,x,y,w,h,source,sInsets,dInsets,type,mask);
}
| Paints using the algorightm specified by <code>paintType</code>. NOTE that this just invokes super.paint(...) with the same argument ordering as this method. |
public static GroupMatcher<JobKey> jobGroupEquals(String compareTo){
return GroupMatcher.groupEquals(compareTo);
}
| Create a GroupMatcher that matches job groups equaling the given string. |
static RightThreadedBinaryTree<Integer> buildComplete(int n){
RightThreadedBinaryTree<Integer> bt=new RightThreadedBinaryTree<Integer>();
int b=(int)Math.pow(2,n - 1);
for (int i=0; i < n; i++) {
bt.insert(b);
for (int j=1; j <= Math.pow(2,i) - 1; j++) {
bt.insert(b + 2 * b * j);
}
b=b / 2;
... | Build a complete tree with 2^n - 1 nodes. |
public static HugLife readWorld(String worldName){
In in=new In("huglife/" + worldName + ".world");
HugLife h=new HugLife(WORLD_SIZE);
while (!in.isEmpty()) {
String creature=in.readString();
int x=in.readInt();
int y=in.readInt();
switch (creature) {
case "plip":
h.addCreature(x,y,new Plip());
... | Reads the world from file with worldName and intialized a HugLife with the contents of the file NOTE: DON'T USE THIS; KEPT FOR TESTING PURPOSES |
public NullType createNullType(){
NullTypeImpl nullType=new NullTypeImpl();
return nullType;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static void addProperty(AtlasVertex vertex,String propertyName,Object value){
String actualPropertyName=GraphHelper.encodePropertyKey(propertyName);
LOG.debug("Adding property {} = \"{}\" to vertex {}",actualPropertyName,value,string(vertex));
vertex.addProperty(actualPropertyName,value);
}
| Adds an additional value to a multi-property. |
private void processRestControllerClass(Class<?> clazz) throws MojoExecutionException {
JavaClassSource javaClassSource=sourceMap.get(clazz.getSimpleName());
if (javaClassSource == null) {
throw new MojoExecutionException("No source resource found for class \"" + clazz.getName() + "\".");
}
Api api=clazz.ge... | Processes a Spring MVC REST controller class that is annotated with RestController. Also collects any required model objects based on parameters and return types of each endpoint into the specified model classes set. |
public AbstractConnectorExecutor(String configFile){
InputStream configFileInputStream=Thread.currentThread().getContextClassLoader().getResourceAsStream(configFile);
if (configFileInputStream == null) {
String msg="Could not find resource " + configFile + " in the classpath";
LOG.error(msg);
throw new ... | Creates a new CloudWatchLogsSubscriptionsExecutor. |
public CollatedTermAttributeImpl(Collator collator){
this.collator=(Collator)collator.clone();
}
| Create a new CollatedTermAttributeImpl |
public static Bitmap decodeResourceWithBackouts(Resources res,BitmapFactory.Options options,int id){
boolean noBitmap=true;
int num_tries=0;
if (options.inSampleSize < 1) {
options.inSampleSize=1;
}
Bitmap bmap=null;
while (noBitmap) {
try {
bmap=BitmapFactory.decodeResource(res,id,options);
... | Loads bitmap from a resource that may be downsampled in low-memory situations. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.