code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
final void refillStats() throws IOException {
final int offset=statsBlockOrd * numSkipInfo;
final int statsFP=(int)skipInfo[offset];
statsReader.setPosition(statsFP);
for (int i=0; i < INTERVAL && !statsReader.eof(); i++) {
int code=statsReader.readVInt();
if (hasFreqs()) {
docFreq[i]=(code >>> 1)... | Load current stats shard |
@Override public IAgent firstValue(final IScope scope) throws GamaRuntimeException {
if (populationSets.size() == 0) {
return null;
}
return populationSets.get(0).firstValue(scope);
}
| Method first() |
public static String separatorsToUnix(String path){
if (path == null || path.indexOf(WINDOWS_SEPARATOR) == -1) {
return path;
}
return path.replace(WINDOWS_SEPARATOR,UNIX_SEPARATOR);
}
| Converts all separators to the Unix separator of forward slash. |
public void tearDown(){
super.tearDown();
}
| Tear down instance variables required by this test case. |
private void addToken(int start,int end,int tokenType){
int so=start + offsetShift;
addToken(zzBuffer,start,end,tokenType,so);
}
| Adds the token specified to the current linked list of tokens. |
public void testWithAlt() throws Exception {
Benchmark bm=execBenchmark(altAlg(true));
assertNotNull(bm);
assertNotNull(bm.getRunData().getPoints());
}
| Benchmark should be able to load the algorithm when alt is specified |
private void enlargeOffset(){
if (offset == 0) {
offCount=offCount == 0 ? 1 : offCount * 2;
offset=offCount;
Object[] narr=new Object[arr.length + offset];
for (int i=0; i < size; i++) {
narr[offset + i]=arr[i];
}
arr=narr;
}
}
| !!! all methods that use this method must be sync enlarge the offset if 0 |
protected byte[] newBuffer(int size){
return new byte[size];
}
| Expert: allocate a new buffer. Subclasses can allocate differently. |
public Object load(String yaml){
return loadFromReader(new StreamReader(yaml),Object.class);
}
| Parse the only YAML document in a String and produce the corresponding Java object. (Because the encoding in known BOM is not respected.) |
public String runComplete(final EvolutionState state){
for (int x=0; x < state.population.subpops.length; x++) for (int y=0; y < state.population.subpops[x].individuals.length; y++) if (state.population.subpops[x].individuals[y].fitness.isIdealFitness()) return "Individual " + y + " of subpopulation "+ x+ " has... | The SimpleEvaluator determines that a run is complete by asking each individual in each population if he's optimal; if he finds an individual somewhere that's optimal, he signals that the run is complete. |
public int loadUnsigned16(int addr){
return (loadUnsigned8(addr) << 8) | loadUnsigned8(addr + 1);
}
| Perform a 16bit load where the zero extended result fills the return value |
private void augmentEdge(RVMMethod caller,int bcIndex,RVMMethod callee,double weight){
CallSite callSite=new CallSite(caller,bcIndex);
WeightedCallTargets targets=callGraph.get(callSite);
if (targets == null) {
targets=WeightedCallTargets.create(callee,weight);
callGraph.put(callSite,targets);
}
else {... | Increment the edge represented by the input parameters, creating it if it is not already in the call graph. |
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:55.079 -0500",hash_original_method="63614CD0FCED93BBCAC192EC682E4A51",hash_generated_method="A76D80282249E7E9D8EEBB57A30E4E4A") private String makeEscaped(String name){
int... | Escapes: 1) chars ",", "+", """, "\", "<", ">", ";" (RFC 2253) 2) chars "#", "=" (required by RFC 1779) 3) a space char at the beginning or end 4) according to the requirement to be RFC 1779 compatible: '#' char is escaped in any position |
public DirectColorModel(ColorSpace space,int bits,int rmask,int gmask,int bmask,int amask,boolean isAlphaPremultiplied,int transferType){
super(space,bits,rmask,gmask,bmask,amask,isAlphaPremultiplied,amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,transferType);
if (ColorModel.isLinearRGBspace(colorSpac... | Constructs a <code>DirectColorModel</code> from the specified parameters. Color components are in the specified <code>ColorSpace</code>, which must be of type ColorSpace.TYPE_RGB and have minimum normalized component values which are all 0.0 and maximum values which are all 1.0. The masks specify which bits in an <cod... |
public GCMParameterSpec(int tLen,byte[] src){
if (src == null) {
throw new IllegalArgumentException("src array is null");
}
init(tLen,src,0,src.length);
}
| Constructs a GCMParameterSpec using the specified authentication tag bit-length and IV buffer. |
@Override public boolean equals(Object obj){
if (obj == this) {
return true;
}
if (!(obj instanceof BorderArrangement)) {
return false;
}
BorderArrangement that=(BorderArrangement)obj;
if (!ObjectUtilities.equal(this.topBlock,that.topBlock)) {
return false;
}
if (!ObjectUtilities.equal(this.... | Tests this arrangement for equality with an arbitrary object. |
public static void trimIndentation(String[] lines,IJavaProject project,boolean considerFirstLine){
trimIndentation(lines,CodeFormatterUtil.getTabWidth(project),CodeFormatterUtil.getIndentWidth(project),considerFirstLine);
}
| Removes the common number of indents from all lines. If a line only consists out of white space it is ignored. If <code> considerFirstLine</code> is false the first line will be ignored. |
private Map<URI,StorageSystem> buildArrayMap(List<VolumeDescriptor> descriptors,VolumeDescriptor.Type type){
Map<URI,StorageSystem> arrayMap=new HashMap<URI,StorageSystem>();
if (type != null) {
descriptors=VolumeDescriptor.filterByType(descriptors,new VolumeDescriptor.Type[]{type},new VolumeDescriptor.Type[]{}... | Build a map of URI to cached StorageSystem for the underlying arrays. |
@Override public boolean encodingSet(){
return true;
}
| Returns true if CharacterEncodingScheme was set in the encoding declaration of the document |
public void writeXmlText(PrintWriter writer,String prefix){
int indent=4;
StringBuilder indentStrBuf=new StringBuilder();
for (int i=0; i < indent; i++) indentStrBuf.append(' ');
String indentString=indentStrBuf.toString();
if (prefix == null) prefix="";
writer.print(indentString);
writer.print('<');
... | Writes XML text with an attribute or CDATA element for each field of the entity |
public void testRobLebowitz() throws Exception {
String text="<ul>" + " <ul>" + " <li/>"+ " <ul>"+ " <li/>"+ " </ul>"+ " <li/>"+ " </ul>"+ "</ul>";
Document document=DocumentHelper.parseText(text);
List lists=document.selectNodes("//ul | //ol");
int count... | A bug found by Rob Lebowitz |
private LiteralOp evalScalarOperation(Hop bop) throws LopsException, DMLRuntimeException, IOException, HopsException {
DataOp tmpWrite=new DataOp(TMP_VARNAME,bop.getDataType(),bop.getValueType(),bop,DataOpTypes.TRANSIENTWRITE,TMP_VARNAME);
Dag<Lop> dag=new Dag<Lop>();
Recompiler.rClearLops(tmpWrite);
Lop lops=t... | In order to (1) prevent unexpected side effects from constant folding and (2) for simplicity with regard to arbitrary value type combinations, we use the same compilation and runtime for constant folding as we would use for actual instruction execution. |
public boolean isSpecified(String qName){
int idx=getIndex(qName);
if (idx < 0) {
throw new IllegalArgumentException("");
}
String str=mItems[(idx << 3) + 5];
return ((str != null) ? (str.charAt(0) == 'd') : true);
}
| Returns true unless the attribute value was provided by DTD defaulting. |
@Override public Cursor queryCharacter(Uri uri,String[] projection,String selection,String[] selectionArgs,String sortOrder){
return mOpenHelper.getReadableDatabase().query(CharacterContract.CharacterEntry.TABLE_NAME,projection,addKeyIdCheckToWhereStatement(selection,ContentUris.parseId(uri)),selectionArgs,null,null,... | Method called to handle query requests from client applications. This plays the role of the "concrete hook method" in the Template Method pattern. |
public boolean isStateActive(State state){
switch (state) {
case r1_A:
return stateVector[0] == State.r1_A;
case r1_B:
return stateVector[0] == State.r1_B;
case r2_B:
return stateVector[1] == State.r2_B;
default :
return false;
}
}
| Returns true if the given state is currently active otherwise false. |
public CRootNode(final Window dialog,final IViewContainer container,final DefaultTreeModel model){
Preconditions.checkNotNull(container,"IE01822: Container argument can not be null");
final List<INaviAddressSpace> addressSpaces=container.getAddressSpaces();
if (addressSpaces == null) {
final INaviModule modul... | Creates a new view selection root node. |
public Matrix3d(Matrix3d m1){
this.m00=m1.m00;
this.m01=m1.m01;
this.m02=m1.m02;
this.m10=m1.m10;
this.m11=m1.m11;
this.m12=m1.m12;
this.m20=m1.m20;
this.m21=m1.m21;
this.m22=m1.m22;
}
| Constructs a new matrix with the same values as the Matrix3d parameter. |
private void grow(){
int newCap=(entries.length << 1) + 1;
Object[] newEntries=new Object[newCap];
System.arraycopy(entries,0,newEntries,0,size);
entries=newEntries;
}
| Expands capacity of internal arrays. |
@Override public void visitClass(PsiClass aClass){
if (read || written) {
return;
}
super.visitClass(aClass);
final VariableUsedVisitor visitor=new VariableUsedVisitor(variable);
aClass.accept(visitor);
read=visitor.isUsed();
}
| check if variable is used in nested/inner class. |
public boolean verify(String provider) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException, SignatureException {
return verify(this.getPublicKey(provider),provider);
}
| verify the request using the passed in provider. |
public boolean restoreVolumeFromSnapshot(String volumeName,String snapshotName){
if (log.isDebugEnabled()) {
log.debug("Restoring volume from snapshot with params[volName,snapshotName]: " + volumeName + ","+ snapshotName);
}
FlexVolume vol=new FlexVolume(server.getNaServer(),volumeName);
boolean result=vol.... | Restores a volume to a snapshot. |
public static PropertyEvaluator makeEvaluator(PropertyEvalSpec spec,EventType sourceEventType,String optionalSourceStreamName,EventAdapterService eventAdapterService,EngineImportService engineImportService,final TimeProvider timeProvider,VariableService variableService,TableService tableService,String engineURI,int sta... | Makes the property evaluator. |
protected void unbind(Element e){
if (e instanceof BindableElement) {
setActiveDefinition((BindableElement)e,null);
}
else {
NodeList nl=getXblScopedChildNodes(e);
for (int i=0; i < nl.getLength(); i++) {
Node n=nl.item(i);
if (n.getNodeType() == Node.ELEMENT_NODE) {
unbind((Element... | Unbinds each bindable element in the given element's subtree. |
public StreamCorruptedException(String reason){
super(reason);
}
| Create a StreamCorruptedException and list a reason why thrown. |
@Override protected void removeAt(int index){
_set[index]=(double)0;
super.removeAt(index);
}
| Releases the element currently stored at <tt>index</tt>. |
public DanmakuItem(Context context,CharSequence content,int startX){
this(context,new SpannableString(content),startX,0,0,0,1f);
}
| construct a DanmakuItem |
protected void crossValidate(){
try {
if (m_NNSearch instanceof weka.core.neighboursearch.CoverTree) throw new Exception("CoverTree doesn't support hold-one-out " + "cross-validation. Use some other NN " + "method.");
double[] performanceStats=new double[m_kNNUpper];
double[] performanceStatsSq=new do... | Select the best value for k by hold-one-out cross-validation. If the class attribute is nominal, classification error is minimised. If the class attribute is numeric, mean absolute error is minimised |
@VisibleForTesting protected void handleContainerAllocation(RMNode rmNode){
String host=rmNode.getNodeID().getHost();
ConsumedOffer consumedOffer=offerLifecycleMgr.drainConsumedOffer(host);
if (consumedOffer == null) {
LOGGER.debug("No offer consumed for {}",host);
return;
}
Node node=nodeStore.getNod... | Checks if any containers were allocated in the current scheduler run and launches the corresponding Mesos tasks. It also updates the node capacity depending on what portion of the consumed offers were actually used. |
public static double normalizeZeroTwoPiFast(double angle){
if (angle >= 0.0 && angle <= 2 * Math.PI) {
return angle;
}
angle=remainderTwoPiFast(angle);
if (angle < 0.0) {
return angle + TWOPI_LO + TWOPI_HI;
}
else {
return angle;
}
}
| Not accurate for large values. |
public static Method lookup(final String method){
for ( final Method m : values()) {
if (m.toString().equalsIgnoreCase(method)) {
return m;
}
}
throw new IllegalArgumentException("Invalid http method: " + method + ". Valid methods are: "+ values());
}
| Return the corresponding method enum from string |
public static double[] readDoubles(){
return new In().readAllDoubles();
}
| Reads all doubles from stdin |
public static int offsetByCodePoints(net.sourceforge.retroweaver.harmony.runtime.java.lang.CharSequence seq,int index,int codePointOffset){
if (seq == null) {
throw new NullPointerException();
}
int len=seq.length();
if (index < 0 || index > len) {
throw new IndexOutOfBoundsException();
}
if (codePo... | <p> Determines the index into the <code>CharSequence</code> that is offset (measured in code points and specified by <code>codePointOffset</code>), from the <code>index</code> argument. </p> |
public ConstraintViolation(Resource root,Collection<SimplePropertyPath> paths,Collection<TemplateCall> fixes,String message,Resource source){
this.fixes=fixes;
this.message=message;
this.root=root;
this.paths=paths;
this.source=source;
}
| Constructs a new ConstraintViolation. |
public static DValue forPrimitive(Object primitiveValue,int isolateId){
if (primitiveValue == null) return new DValue(VariableType.NULL,"null","",0,primitiveValue,isolateId);
else if (primitiveValue == Value.UNDEFINED) return new DValue(VariableType.UNDEFINED,"undefined","",0,primitiveValue,isolateId);
else ... | Constructs a DValue for a primitive value (null, undefined, Boolean, Number, String). There is nothing special about these objects -- it would be just as legitimate for anyone who wants a Value for a primitive to make their own subclass of Value. |
public FractionAtom(Atom num,Atom den,float defFactor,int numAlign,int denomAlign){
this(num,den,true,numAlign,denomAlign);
this.defFactor=defFactor;
defFactorSet=true;
}
| The thickness of the fraction line will be "defFactor" times the default thickness. |
public String code_string(){
return _code_string;
}
| String containing code for the action in question. |
protected final void closeSession(){
if (sessionTracker != null) {
Session currentSession=sessionTracker.getOpenSession();
if (currentSession != null) {
currentSession.close();
}
}
}
| Closes the current session. |
protected void initialize(char[] input){
this.input=input;
this.ndx=-1;
this.total=input.length;
}
| Initializes scanner. |
protected void addIcon(Container top){
Icon sideIcon=getIcon();
if (sideIcon != null) {
JLabel iconLabel=new JLabel(sideIcon);
iconLabel.setName("OptionPane.iconLabel");
iconLabel.setVerticalAlignment(SwingConstants.TOP);
top.add(iconLabel,BorderLayout.BEFORE_LINE_BEGINS);
}
}
| Creates and adds a JLabel representing the icon returned from <code>getIcon</code> to <code>top</code>. This is messaged from <code>createMessageArea</code> |
public void runTest() throws Throwable {
Document doc;
Element newNode;
String newValue;
doc=(Document)load("hc_staff",true);
newNode=doc.createElement("acronym");
newValue=newNode.getNodeValue();
assertNull("initiallyNull",newValue);
newNode.setNodeValue("This should have no effect");
newValue=newNod... | Runs the test case. |
public void onUpdate(){
this.prevPosX=this.posX;
this.prevPosY=this.posY;
this.prevPosZ=this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setExpired();
}
float percent=(float)this.particleAge / (float)this.particleMaxAge;
Vector3f dir=Vector3f.sub(to,from,null);
Vector3f spiralDir=Vec... | Called to update the entity's position/logic. |
public Bag removeObjectsAtLocation(final int x,final int y){
Bag b=field[x][y];
field[x][y]=null;
return b;
}
| Removes all the objects stored at the given location and returns them as a Bag (which you are free to modify). The location is set to null (the bag is removed) regardless of the setting of removeEmptyBags. |
public static Header buildUserAgentHeader() throws ParseException {
return HEADER_FACTORY.createHeader(UserAgentHeader.NAME,userAgentString());
}
| Build User-Agent header |
public static void main(String[] args){
TestRunner.run(CompositeProcessorTest.class);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public CharEscaperBuilder(){
this.map=new HashMap<Character,String>();
}
| Construct a new sparse array builder. |
private void writeException(DataOutputStream dos,byte type,Exception ex,Version clientVersion) throws IOException {
writeMessage(dos,type,ex.toString(),clientVersion);
}
| Writes an exception message to the socket |
public static boolean isLocalFormSuperseded(String formId,String latestVersion){
if (formId == null) {
Log.e(t,"isLocalFormSuperseded: server is not OpenRosa-compliant. <formID> is null!");
return true;
}
String[] selectionArgs={formId};
String selection=FormsColumns.JR_FORM_ID + "=?";
String[] fields... | Determines if a local form on the device is superseded by a given version (of the same form presumably available on the server). |
public String globalInfo(){
return "Cluster data using the FarthestFirst algorithm.\n\n" + "For more information see:\n\n" + getTechnicalInformation().toString() + "\n\n"+ "Notes:\n"+ "- works as a fast simple approximate clusterer\n"+ "- modelled after SimpleKMeans, might be a useful initializer for it";
}
| Returns a string describing this clusterer |
private void sendBroadcast(){
LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent(ACTION_UPLOAD_SERVICE_RESPONSE).addCategory(Intent.CATEGORY_DEFAULT));
}
| Send the Broadcast to Activity that the Video Upload is completed. |
protected static void checkRectangularShape(DoubleMatrix2D[][] array){
int columns=-1;
for (int row=array.length; --row >= 0; ) {
if (array[row] != null) {
if (columns == -1) columns=array[row].length;
if (array[row].length != columns) throw new IllegalArgumentException("All rows of arra... | Checks whether the given array is rectangular, that is, whether all rows have the same number of columns. |
static int indexOf(final CharSequence cs,final CharSequence searchChar,final int start){
return cs.toString().indexOf(searchChar.toString(),start);
}
| Used by the indexOf(CharSequence methods) as a green implementation of indexOf. |
private void updateProgress(int progress){
if (myHost != null && progress != previousProgress) {
myHost.updateProgress(progress);
}
previousProgress=progress;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
public static <T1,T2,R>BiFunction<T1,T2,R> memoizeBiFunction(final BiFunction<T1,T2,R> fn){
val memoise2=memoizeFunction(null);
return null;
}
| Convert a BiFunction into one that caches it's result |
public boolean isEnableDepthOffset(){
return false;
}
| Returns false. |
@Override public String toString(){
return String.format("Callgraph [%d function nodes, %d edges]",nodeCount(),edgeCount());
}
| Returns a string representation of the Call graph. |
public static void runJavadoc(String[] javadocArgs){
if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) {
throw new Error("Javadoc failed to execute");
}
}
| Run javadoc |
public void showAdvanced(boolean advanced){
advancedVisible=advanced;
if (null != advancedText) {
advancedText.setVisible(advanced);
}
if (CollectionUtils.isNotEmpty(propertyControls)) {
for ( AbstractPropertyControl<?,?> propertyControl : propertyControls) {
propertyControl.showIfAdvanced(adva... | Shows/hides advanced properties and it's controls. |
protected int readShort(){
return rawData.getShort();
}
| Reads next 16-bit value, LSB first |
private void createOrUpdateAutoTierPolicies(com.emc.storageos.db.client.model.StorageSystem system,Map<String,List<com.emc.storageos.db.client.model.StoragePool>> autoTieringPolicyPoolMap,Map<String,Map<String,List<String>>> autoTieringPolicyPropertiesMap){
List<DataObject> objectsToCreate=new ArrayList<>();
List<D... | Creates and/or updates the auto tiering policies in the controller database after processing the discovered storage pools and the auto tiering policies that they support. |
private void sendStageProgressPatch(com.vmware.xenon.common.TaskState.TaskStage stage){
ServiceUtils.logInfo(this,"sendStageProgressPatch %s",stage);
TaskUtils.sendSelfPatch(this,buildPatch(stage,null));
}
| This method sends a patch operation to the current service instance to move to a new state. |
public void endReadFromPngRaw(){
}
| Does nothing in this implementation |
public static double nextLaplace(RandomEngine randomGenerator){
double u=randomGenerator.raw();
u=u + u - 1.0;
if (u > 0) return -Math.log(1.0 - u);
else return Math.log(1.0 + u);
}
| Returns a Laplace (Double Exponential) distributed random number from the standard Laplace distribution L(0,1). <p> <b>Implementation:</b> Inversion method. This is a port of <tt>lapin.c</tt> from the <A HREF="http://www.cis.tu-graz.ac.at/stat/stadl/random.html">C-RAND / WIN-RAND</A> library. <p> |
@Override public String toString(){
return String.valueOf(value);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
synchronized void receive(char[] chars,int offset,int count) throws IOException {
Arrays.checkOffsetAndCount(chars.length,offset,count);
if (buffer == null) {
throw new IOException("Pipe is closed");
}
if (lastReader != null && !lastReader.isAlive()) {
throw new IOException("Pipe broken");
}
lastWri... | Receives a char array and stores it into the PipedReader. This called by PipedWriter.write() when writes occur. <P> If the buffer is full and the thread sending #receive is interrupted, the InterruptedIOException will be thrown. |
public ParseException(String message,int line,int column){
super(message);
exception=null;
lineNumber=line;
columnNumber=column;
}
| Creates a new ParseException. |
public Element store(Object o){
return storeDirectly(o);
}
| Store the |
public static boolean isLmpOrAbove(){
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
}
| Indicates if the device is running LMP or higher. |
public void writeChar(byte c) throws IOException {
this.write(c);
}
| Write a Char value. |
protected int lexWhiteSpacesAndComments(int currentOffset,List<CustomToken> targetList){
CharSequence buffer=getBuffer();
int bufferEnd=getBufferEnd();
while (currentOffset < bufferEnd) {
char currentChar=buffer.charAt(currentOffset);
if (currentChar == '\n') {
targetList.add(getCustomToken(currentO... | Lexing empty spaces and comments between regex/tr blocks and adding tokens to the target list |
private PreparedStatement prepareStatement(String table,String statement,KeyValuePersistenceSettings settings,boolean tblExistenceRequired){
int attempt=0;
Throwable error=null;
String errorMsg="Failed to prepare Cassandra CQL statement: " + statement;
RandomSleeper sleeper=newSleeper();
incrementSessionRefs(... | Prepares CQL statement using current Cassandra driver session. |
public String currID(){
return (String)order.peek();
}
| Get the ID of the current sub-map being written into. |
protected void sequence_ExportSpecifier(ISerializationContext context,ExportSpecifier semanticObject){
genericSequencer.createSequence(context,semanticObject);
}
| Contexts: ExportSpecifier returns ExportSpecifier Constraint: (element=IdentifierRef alias=IdentifierName?) |
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){
switch (featureID) {
case N4JSPackage.RETURN_STATEMENT__EXPRESSION:
return getExpression();
}
return super.eGet(featureID,resolve,coreType);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public ContentAssistHistory(int maxLHS,int maxRHS){
Assert.isLegal(maxLHS > 0);
Assert.isLegal(maxRHS > 0);
fMaxLHS=maxLHS;
fMaxRHS=maxRHS;
fLHSCache=new MRUMap<String,MRUSet<String>>(fMaxLHS);
}
| Creates a new history. |
public TodoObject(TodoObject parent){
this.id=parent.getId();
this.projectId=parent.getProjectId();
this.todolistId=parent.getTodolistId();
this.content=parent.getContent();
this.position=parent.getPosition();
this.completed=parent.getCompleted();
this.dueDate=parent.getDueDate();
this.creatorName=paren... | This method was generated by MyBatis Generator. This method corresponds to the database table todo |
public static <K,V>ImmutableSetMultimap<K,V> of(K k1,V v1){
ImmutableSetMultimap.Builder<K,V> builder=ImmutableSetMultimap.builder();
builder.put(k1,v1);
return builder.build();
}
| Returns an immutable multimap containing a single entry. |
protected int legalIndex(int index){
while (index >= points.size()) index-=points.size();
while (index < 0) {
index+=points.size();
}
return index;
}
| Compute a legal point index from a possibly illegal one, that may have wrapped. |
public URI(String p_scheme,String p_schemeSpecificPart) throws MalformedURIException {
if (p_scheme == null || p_scheme.trim().length() == 0) {
throw new MalformedURIException("Cannot construct URI with null/empty scheme!");
}
if (p_schemeSpecificPart == null || p_schemeSpecificPart.trim().length() == 0) {
... | Construct a new URI that does not follow the generic URI syntax. Only the scheme and scheme-specific part (stored as the path) are initialized. |
void restrictTo8Bits(Register r){
PhysicalRegisterSet phys=(PhysicalRegisterSet)this.phys;
Register ESP=phys.getESP();
Register EBP=phys.getEBP();
Register ESI=phys.getESI();
Register EDI=phys.getEDI();
addRestriction(r,ESP);
addRestriction(r,EBP);
addRestriction(r,ESI);
addRestriction(r,EDI);
}
| Ensures that a particular register is only assigned to AL, BL, CL, or DL, since these are the only 8-bit registers we normally address. |
private static BitMatrix bitMatrixFrombitArray(byte[][] input){
int whiteSpace=30;
BitMatrix output=new BitMatrix(input[0].length + 2 * whiteSpace,input.length + 2 * whiteSpace);
output.clear();
for (int y=0, yOutput=output.getHeight() - whiteSpace; y < input.length; y++, yOutput--) {
for (int x=0; x < inpu... | This takes an array holding the values of the PDF 417 |
public static JPanel createVerticalPanel(String title){
JPanel panel=new JPanel();
panel.setLayout(new GridLayout(0,1));
if (title != null) {
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),title));
}
else {
panel.setBorder(BorderFactory.createEtchedBorder());
}
... | Create a panel that does vertical layout |
public String createThickVolumes(String systemId,String arrayGroupId,Long luCapacityInBytes,int noOfLus,String volumeName,String formatType,String model,Integer devNum) throws Exception {
Long luCapacityInKB=luCapacityInBytes / 1024;
InputStream responseStream=null;
String asyncTaskMessageId=null;
try {
Map... | Creates the Thick volume with the passed information. |
public SaaSApplicationException(String message,Object[] params){
super(message);
init(params);
}
| Constructs a new exception with the specified detail message and message parameters. |
@Override protected void visitLaunching(ModuleBuild build) throws Exception {
LOG.info("About to launch Singularity task for build {}",build);
singularityBuildLauncher.launchBuild(build);
}
| "Launch" builds when the build is in a launching state. This is because in PROD we pre-launch things into singularity and they wait for state changes. In tests this doesn't happen so we have to call #launchBuild() ourselves. |
public int exit_signal(){
return Integer.parseInt(fields[37]);
}
| (since Linux 2.1.22) Signal to be sent to parent when we die. |
public CharSequenceReader(CharSequence seq){
this.seq=checkNotNull(seq);
}
| Creates a new reader wrapping the given character sequence. |
private void validateJMSResources(){
if (queue == null || qFactory == null) {
SaaSSystemException sse=new SaaSSystemException("JMS resources are not initialized!");
logger.logError(Log4jLogger.SYSTEM_LOG,sse,LogMessageIdentifier.ERROR_JMS_RESOURCE_NOT_INITIALIZED);
throw sse;
}
}
| Checks if the injected JMS resources are not <code>null</code>. If they are, a system exception will be thrown. |
public void CheckForDefaultInitValue() throws PcalSymTabException {
String errors="";
for (int i=0; i < symtab.size(); i++) {
SymTabEntry se=(SymTabEntry)symtab.elementAt(i);
if (se.id.equals("defaultInitValue")) {
if (errors.equals("")) {
errors="Cannot use `defaultInitValue' as ";
}
e... | Reports an error if "defaultInitValue" appears in the symbol table. Added by LL on 31 Aug 2007. |
@Override public void displayCycle(Cycle cycle){
this.cycle=cycle;
if (alreadyInitializedRecyclerList) {
populateDataRecyclerList();
}
else {
initRecyclerView();
alreadyInitializedRecyclerList=true;
populateDataRecyclerList();
}
}
| DataView override for displaying the cycle as it emits changes. Only initialize the recycler view if it has not been initialized before. |
@Override public boolean isEncodingAlpha(){
return false;
}
| Get whether the encoder should encode alpha transparency (always false). |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.