code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
private void createRasterFrameBufferObject(){
this.fbo=glGenFramebuffers();
this.depthRenderBuffer=glGenRenderbuffers();
glBindFramebuffer(GL_FRAMEBUFFER,fbo);
IntBuffer renderBuffers=BufferUtils.createIntBuffer(2).put(GL_COLOR_ATTACHMENT0).put(GL_COLOR_ATTACHMENT1);
renderBuffers.flip();
glDrawBuffers(rend... | Create the frame buffer object that our rasterizer uses to render the world-space position and normal into the textures. |
public boolean equals(java.lang.Object obj){
return false;
}
| Returns true if and only if the argument is not null and is a Boolean object that represents the same boolean value as this object. |
public static void hideKeyboard(Context context){
try {
InputMethodManager inputManager=(InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(((Activity)context).getCurrentFocus().getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
}
catch ( Exc... | Hides the already popped up keyboard from the screen. |
public void importPrivateKey(BurpCertificate certificate,String filename){
setStatus("Importing private key...");
BufferedReader br;
try {
br=new BufferedReader(new FileReader(filename));
PEMParser pp=new PEMParser(br);
PEMKeyPair pemKeyPair=(PEMKeyPair)pp.readObject();
KeyPair kp=new JcaPEMKeyCon... | Import a private RSA key in PEM format from a file and add it to the selected certificate. |
public static Collection<? extends CharSequence> neighbors(String geohash){
return addNeighbors(geohash,geohash.length(),new ArrayList<CharSequence>(8));
}
| Calculate all neighbors of a given geohash cell. |
public TLongHashSet(int initialCapacity,TLongHashingStrategy strategy){
super(initialCapacity,strategy);
}
| Creates a new <code>TLongHash</code> instance whose capacity is the next highest prime above <tt>initialCapacity + 1</tt> unless that value is already prime. |
private NetworkAddress(){
}
| No instantiation |
public TileFactoryInfo(String name,int minimumZoomLevel,int maximumZoomLevel,int totalMapZoom,int tileSize,boolean xr2l,boolean yt2b,String baseURL,String xparam,String yparam,String zparam){
this.name=name;
this.minimumZoomLevel=minimumZoomLevel;
this.maximumZoomLevel=maximumZoomLevel;
this.totalMapZoom=totalM... | Creates a new instance of TileFactoryInfo. Note that TileFactoryInfo should be considered invariate, meaning that subclasses should ensure all of the properties stay the same after the class is constructed. Returning different values of getTileSize() for example is considered an error and may result in unexpected behav... |
public static boolean isJavaIdentifier(final String str){
if (str == null || str.length() < 1) {
return false;
}
if (!Character.isJavaIdentifierStart(str.charAt(0))) {
return false;
}
for (int i=1; i < str.length(); i++) {
if (!Character.isJavaIdentifierPart(str.charAt(i))) {
return false;
... | Check if a string is a valid java identifier. Spaces are not allowed fore or aft. |
public APIError(Type type,String message,Collection<Field> expected){
this.type=type;
this.message=message;
this.statusCode=null;
this.expected=expected;
}
| Create a new APIError with the specified error message and parameter information. |
public boolean isCompleted(){
if (m_order == null) return false;
return MOrder.STATUS_Completed.equals(m_order.getDocStatus()) || MOrder.STATUS_Closed.equals(m_order.getDocStatus());
}
| Is order completed |
public void addFormField(String fieldName,int x,int y,int width){
int start=pointToInt(x,y);
int end=pointToInt(x + width,y);
addFormRange(fieldName,start,end);
}
| Move the cursor to a prescribed position on the screen and add a form field. |
public TermQueryBuilder(String name,long value){
this(name,(Object)value);
}
| Constructs a new term query. |
public void java_lang_SecurityManager_currentClassLoader0(SootMethod method,ReferenceVariable thisVar,ReferenceVariable returnVar,ReferenceVariable params[]){
helper.assignObjectTo(returnVar,Environment.v().getClassLoaderObject());
}
| Returns the class loader of the most recently executing method from a class defined using a non-system class loader. A non-system class loader is defined as being a class loader that is not equal to the system class loader (as returned by ClassLoader.getSystemClassLoader()) or one of its ancestors. NOTE: returns a vari... |
public List<Integer> emit(List<Object> tuple,Object messageId){
return emit(Utils.DEFAULT_STREAM_ID,tuple,messageId);
}
| Emits a new tuple to the default output stream with the given message ID. When Heron detects that this tuple has been fully processed, or has failed to be fully processed, the spout will receive an ack or fail callback respectively with the messageId as long as the messageId was not null. If the messageId was null, Her... |
protected void installKeyboardActions(JLabel l){
int dka=l.getDisplayedMnemonic();
if (dka != 0) {
Component lf=l.getLabelFor();
if (lf != null) {
ActionMap actionMap=l.getActionMap();
actionMap.put(PRESS,ACTION_PRESS);
InputMap inputMap=SwingUtilities.getUIInputMap(l,JComponent.WHEN_IN_FO... | Install Keyboard Actions |
public boolean isControl(){
return this.control;
}
| Whether the control key is hold during the key binding. |
public JSONArray(String source) throws JSONException {
this(new JSONTokener(source));
}
| Construct a JSONArray from a source JSON text. |
public Builder weeks(Integer weeks){
this.weeks=weeks;
return this;
}
| Sets the number of weeks. |
private final Class<? extends Annotation> loadAnnotationClass(final String fullyQualifiedClassName){
Class<?> cls=null;
try {
cls=Class.forName(fullyQualifiedClassName,true,getAppClassLoader());
}
catch ( ClassNotFoundException e) {
}
if (cls != null && cls.isAnnotation() && cls.getAnnotation(Target.cla... | Loads the class indicated by the fullyQualifiedClassName, and checks to see if it is an annotation that is supported by a checker. |
public static ClientBundleResource createFromFile(IJavaProject javaProject,IFile file){
if (!isProbableClientBundleResource(file)) {
return null;
}
String methodName=ClientBundleUtilities.suggestMethodName(file);
String resourceTypeName=ClientBundleUtilities.suggestResourceTypeName(javaProject,file);
retu... | Creates a new ClientBundle resource from the given file, inferring its accessor method name and resource type from the filename. NOTE: If the file is probably not intended to be bundled (e.g. a .java source file), this method returns null. |
public final boolean isQueued(Thread thread){
if (thread == null) throw new NullPointerException();
for (Node p=tail; p != null; p=p.prev) if (p.thread == thread) return true;
return false;
}
| Returns true if the given thread is currently queued. <p>This implementation traverses the queue to determine presence of the given thread. |
public boolean accept(File f){
if (f.isDirectory()) {
return true;
}
String extension=getExtension(f);
if (extension != null) {
return extension.equals(java);
}
return false;
}
| Method accept. |
public boolean readRemoteRssi(BleRssiCallback bleCallback){
handleRSSIReadCallback(bleCallback);
return handleAfterInitialed(getBluetoothGatt().readRemoteRssi(),bleCallback);
}
| read rssi of device |
public static void main(String... a) throws Exception {
TestBase.createCaller().init().test();
}
| Run just this test. |
public static String addBlacklistEntry(final String blacklistToUse,final String entry,final RequestHeader header){
String newEntry=entry;
if (blacklistToUse == null || blacklistToUse.isEmpty()) {
return "";
}
if (newEntry == null || newEntry.isEmpty()) {
return header.get(HeaderFramework.CONNECTION_PROP... | Adds a new entry to the chosen blacklist. |
private CellInfoCdma(Parcel in){
super(in);
mCellIdentityCdma=CellIdentityCdma.CREATOR.createFromParcel(in);
mCellSignalStrengthCdma=CellSignalStrengthCdma.CREATOR.createFromParcel(in);
if (DBG) log("CellInfoCdma(Parcel): " + toString());
}
| Construct a CellInfoCdma object from the given parcel where the token is already been processed. |
public static void hideKeyboard(Context context,View target){
if (context == null || target == null) {
return;
}
InputMethodManager imm=getInputMethodManager(context);
imm.hideSoftInputFromWindow(target.getWindowToken(),0);
}
| hide keyboard |
protected void rotateOrthogonal(){
off.setRotation(on.getRotation() + 1,this);
on.setRotation(off.getRotation() + 1,this);
unknown.setRotation(unknown.getRotation() + 1,this);
inconsistent.setRotation(inconsistent.getRotation() + 1,this);
displayState(lightState());
repaint();
}
| ****** popup AbstractAction.actionPerformed method overrides |
public boolean handleRequest(InputStream input,OutputStream output,ImapSession session){
final boolean result;
if (isSelectedMailboxDeleted(session)) {
writeSignoff(output,session);
result=false;
}
else {
ImapRequestLineReader request=new ImapRequestStreamLineReader(input,output);
final Logger lo... | This method parses IMAP commands read off the wire in handleConnection. Actual processing of the command (possibly including additional back and forth communication with the client) is delegated to one of a number of command specific handler methods. The primary purpose of this method is to parse the raw command string... |
public ActivationException(String s){
super(s);
initCause(null);
}
| Constructs an <code>ActivationException</code> with the specified detail message. |
public boolean containsValue(Object value){
return indexOfValue(value) >= 0;
}
| Returns <tt>true</tt> if the receiver contains the specified value. |
private Collection<Operation> createNotifyServicesToAbort(TransactionServiceState state){
Collection<Operation> operations=new HashSet<>();
for ( String service : state.createdLinks) {
operations.add(createDeleteOp(service));
state.readLinks.remove(service);
state.modifiedLinks.remove(service);
}
f... | Prepare a tiny metadata request to all services to abort |
@Override public NotificationChain eInverseRemove(InternalEObject otherEnd,int featureID,NotificationChain msgs){
switch (featureID) {
case UmplePackage.EVENT_DEFINITION___AFTER_EVERY_EVENT_1:
return ((InternalEList<?>)getAfterEveryEvent_1()).basicRemove(otherEnd,msgs);
case UmplePackage.EVENT_DEFINITION___AFTER_EV... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public static boolean isTypeVisible(java.lang.invoke.MethodType type,Class<?> refc){
for (int n=-1, max=type.parameterCount(); n < max; n++) {
Class<?> ptype=(n < 0 ? type.returnType() : type.parameterType(n));
if (!isTypeVisible(ptype,refc)) return false;
}
return true;
}
| Decide if the given method type, attributed to a member or symbolic reference of a given reference class, is really visible to that class. |
protected void prepare(){
ProcessInfoParameter[] para=getParameter();
for (int i=0; i < para.length; i++) {
String name=para[i].getParameterName();
if (para[i].getParameter() == null) ;
else log.log(Level.SEVERE,"Unknown Parameter: " + name);
}
p_C_RfQResponse_ID=getRecord_ID();
}
| Prepare - e.g., get Parameters. |
public void test_putLjava_lang_ObjectLjava_lang_Object(){
hm.put("KEY","VALUE");
assertEquals("Failed to install key/value pair","VALUE",hm.get("KEY"));
LinkedHashMap m=new LinkedHashMap();
m.put(new Short((short)0),"short");
m.put(null,"test");
m.put(new Integer(0),"int");
assertEquals("Failed adding to ... | java.util.LinkedHashMap#put(java.lang.Object, java.lang.Object) |
static boolean paramNameMatchesRegex(String paramName,String paramRegex){
assert paramRegex.charAt(0) == '/';
assert paramRegex.charAt(paramRegex.length() - 1) == '/';
assert paramRegex.length() > 2;
String regex=paramRegex.substring(1,paramRegex.length() - 1);
return Pattern.compile(regex).matcher(paramName)... | Returns whether a given parameterization matches a given regex. The regex should be in "/regex/" format. |
@Override synchronized public long commit(){
final long begin=System.currentTimeMillis();
super.commit();
final IIndexManager indexManager=getIndexManager();
if (indexManager.isGroupCommit()) {
return 0L;
}
final long commitTime=getIndexManager().commit();
final long elapsed=System.currentTimeMillis()... | Delegates the operation to the backing store. |
public void finalizeCloudlet(){
double wallClockTime=CloudSim.clock() - arrivalTime;
cloudlet.setExecParam(wallClockTime,totalCompletionTime);
long finished=0;
if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS) {
finished=cloudlet.getCloudletLength();
}
else {
finished=cloudletFinishedSoFar / Cons... | Finalizes all relevant information before <tt>exiting</tt> the CloudResource entity. This method sets the final data of: <ul> <li>wall clock time, i.e. the time of this Cloudlet resides in a CloudResource (from arrival time until departure time). <li>actual CPU time, i.e. the total execution time of this Cloudlet in a ... |
public boolean isReadWrite(){
return m_readWrite;
}
| Is Read Write |
public void processWasHalted(){
removeNewHooks();
}
| If the JVM is halted, then no shutdown hook should be executed. This usually happen when Runtime.getRuntime().halt() is called. |
void stopForegroundCompat(int id){
if (mStopForeground != null) {
mStopForegroundArgs[0]=Boolean.TRUE;
invokeMethod(mStopForeground,mStopForegroundArgs);
return;
}
mNM.cancel(id);
mSetForegroundArgs[0]=Boolean.FALSE;
invokeMethod(mSetForeground,mSetForegroundArgs);
}
| This is a wrapper around the new stopForeground method, using the older APIs if it is not available. |
public JSONTokener(Reader reader){
this.reader=reader.markSupported() ? reader : new BufferedReader(reader);
this.eof=false;
this.usePrevious=false;
this.previous=0;
this.index=0;
this.character=1;
this.line=1;
}
| Construct a JSONTokener from a Reader. |
public boolean removeMouseListener(final MapMouseListener listener){
if (listener == null) {
throw new IllegalArgumentException("The argument must not be null");
}
return listeners.remove(listener);
}
| Remove a MapMouseListener from the active listeners |
private boolean downField(MathContainer component){
if (component instanceof MathSequence) {
if (component.getParent() instanceof MathFunction) {
MathFunction function=(MathFunction)component.getParent();
int downIndex=function.getDownIndex(component.getParentIndex());
if (downIndex >= 0) {
... | Down field. |
public void aliasType(final String name,final Class<?> type){
if (classAliasingMapper == null) {
throw new InitializationException("No " + ClassAliasingMapper.class.getName() + " available");
}
classAliasingMapper.addTypeAlias(name,type);
}
| Alias a type to a shorter name to be used in XML elements. Any class that is assignable to this type will be aliased to the same name. |
@SuppressWarnings("unused") public boolean typeEquals(final FieldDescriptor other){
return this == other || other != null && this.type == other.type && this.subType == other.subType && this.scale == other.scale && this.length == other.length;
}
| Limited equals that only checks if the data type in the provided field descriptor is the same as this descriptor. <p> The fields checked are: <ul> <li>type</li> <li>subType</li> <li>scale</li> <li>length</li> </ul> </p> |
private int validateResponseCode(int code){
if ((code >= ResponseCodes.OBEX_HTTP_OK) && (code <= ResponseCodes.OBEX_HTTP_PARTIAL)) {
return code;
}
if ((code >= ResponseCodes.OBEX_HTTP_MULT_CHOICE) && (code <= ResponseCodes.OBEX_HTTP_USE_PROXY)) {
return code;
}
if ((code >= ResponseCodes.OBEX_HTTP_BA... | Verifies that the response code is valid. If it is not valid, it will return the <code>OBEX_HTTP_INTERNAL_ERROR</code> response code. |
public String reference(Object obj){
return null;
}
| Hook for subclassers to implement a custom method for retrieving IDs from objects. This implementation always returns null. |
public static void drawStringUnderlineCharAt(JComponent c,Graphics g,String text,int underlinedIndex,int x,int y){
g.drawString(text,x,y);
if (underlinedIndex >= 0 && underlinedIndex < text.length()) {
FontMetrics fm=g.getFontMetrics();
int underlineRectX=x + fm.stringWidth(text.substring(0,underlinedIndex)... | Draw a string with the graphics <code>g</code> at location (<code>x</code>, <code>y</code>) just like <code>g.drawString</code> would. The character at index <code>underlinedIndex</code> in text will be underlined. If <code>index</code> is beyond the bounds of <code>text</code> (including < 0), nothing will be underlin... |
public String toString(String sep){
if (isEmpty()) {
return "";
}
else {
StringBuilder buf=new StringBuilder();
buf.append(head);
for (List<A> l=tail; l.nonEmpty(); l=l.tail) {
buf.append(sep);
buf.append(l.head);
}
return buf.toString();
}
}
| Form a string listing all elements with given separator character. |
public JEditTextArea(){
this(TextAreaDefaults.getDefaults());
}
| Creates a new JEditTextArea with the default settings. |
private int measureHeight(int measureSpec){
int result=0;
int specMode=MeasureSpec.getMode(measureSpec);
int specSize=MeasureSpec.getSize(measureSpec);
if (specMode == MeasureSpec.EXACTLY) {
result=specSize;
}
else {
result=(int)(2 * mRadius + getPaddingTop() + getPaddingBottom() + 1);
if (specMo... | Determines the height of this view |
public int size(){
return entries.size();
}
| The number of entries in the counter (not the total count -- use totalCount() instead). |
@DSComment("Package priviledge") @DSBan(DSCat.DEFAULT_MODIFIER) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:32:43.600 -0500",hash_original_method="AD90F95A26E2D9ECD94EF58E091F4A84",hash_generated_method="AD90F95A26E2D9ECD94EF58E091F4A84") void clearExpiredCookies(long now){
if... | Clear expired cookies |
public Graphics create(){
PeekGraphics newGraphics=null;
try {
newGraphics=(PeekGraphics)clone();
newGraphics.mGraphics=(Graphics2D)mGraphics.create();
}
catch ( CloneNotSupportedException e) {
}
return newGraphics;
}
| Creates a new <code>Graphics</code> object that is a copy of this <code>Graphics</code> object. |
public void addAllMethods(JarFile jarFile){
List<String> classes=Utils.getClassesFromJar(jarFile);
for ( String clz : classes) {
for ( SootMethod meth : Scene.v().getSootClass(clz).getMethods()) {
this.addMethod(meth);
}
}
}
| Add all methods from the jar file. Note this does not add them to soot's scene |
public int[] enabledEvents(){
boolean[] userRecordableEvts0=userRecordableEvts;
int[] enabledEvts=new int[len];
int enabledEvtsLen=0;
for (int type=0; type < len; type++) {
if (userRecordableEvts0[type]) enabledEvts[enabledEvtsLen++]=type;
}
return U.unique(enabledEvts,enabledEvtsLen,inclEvtTypes,in... | Gets types of enabled user-recordable events. |
@Override protected EClass eStaticClass(){
return N4JSPackage.Literals.N4_GETTER_DECLARATION;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public HostInfo addHost(String name,String address,int protocol,int httpPort,int tcpPort,String username,String password,String macAddress,int wolPort,boolean useEventServer,int eventServerPort){
ContentValues values=new ContentValues();
values.put(MediaContract.HostsColumns.NAME,name);
values.put(MediaContract.H... | Adds a new XBMC host to the database |
public boolean readOne(){
MessageHistory.get().reset();
try (DocumentContext context=in.readingDocument()){
if (!context.isData()) return false;
wireParser.accept(context.wire(),null);
}
return true;
}
| reads one message |
private void sendRegistrationToServer(String token){
}
| Persist token to third-party servers. Modify this method to associate the user's FCM InstanceID token with any server-side account maintained by your application. |
private static void process(PsiClass clazz,PsiSubstitutor superClassSubstitutor,boolean shouldProcessDeprecated,Set<PsiClass> processedWithoutDeprecated,Set<PsiClass> processedAll,List<PsiMethod> collector,GrTypeDefinition classToDelegateTo,boolean keepParameterAnnotations){
final List<PsiMethod> result=new ArrayList... | The key method of contributor. It collects all delegating methods of clazz |
public static void writeLines(File file,Collection<?> lines,String lineEnding) throws IOException {
writeLines(file,null,lines,lineEnding,false);
}
| Writes the <code>toString()</code> value of each item in a collection to the specified <code>File</code> line by line. The default VM encoding and the specified line ending will be used. |
public static String collapseNewlines(String argStr){
char last=argStr.charAt(0);
StringBuffer argBuf=new StringBuffer();
for (int cIdx=0; cIdx < argStr.length(); cIdx++) {
char ch=argStr.charAt(cIdx);
if (ch != '\n' || last != '\n') {
argBuf.append(ch);
last=ch;
}
}
return argBuf.toSt... | Remove/collapse multiple newline characters. |
protected QName createQName(String name,Namespace namespace,String qualifiedName){
return new QName(name,namespace,qualifiedName);
}
| Factory method to create a new QName object which can be overloaded to create derived QName instances |
JCERSAPrivateCrtKey(RSAPrivateCrtKey key){
this.modulus=key.getModulus();
this.publicExponent=key.getPublicExponent();
this.privateExponent=key.getPrivateExponent();
this.primeP=key.getPrimeP();
this.primeQ=key.getPrimeQ();
this.primeExponentP=key.getPrimeExponentP();
this.primeExponentQ=key.getPrimeExpon... | construct a private key from another RSAPrivateCrtKey. |
boolean checkSource(PathImpl sourceDir,String javaName){
try {
while (javaName != null && !javaName.equals("")) {
int p=javaName.indexOf('/');
String head;
if (p >= 0) {
head=javaName.substring(0,p);
javaName=javaName.substring(p + 1);
}
else {
head=javaName;
... | Checks that the case is okay for the source. |
public Collection<Value> values(){
this.buildIfNeededMap();
return map.values();
}
| Return a collection of values. |
private void buildDeprecatedSection(PathOperation operation,MarkupDocBuilder docBuilder){
Boolean deprecated=operation.getOperation().isDeprecated();
if (deprecated != null && deprecated) {
docBuilder.block(DEPRECATED_OPERATION,MarkupBlockStyle.EXAMPLE,null,MarkupAdmonition.CAUTION);
}
}
| Builds a warning if method is deprecated. |
private void updateProgress(String progressLabel,int progress){
if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) {
myHost.updateProgress(progressLabel,progress);
}
previousProgress=progress;
previousProgressLabel=progressLabel;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
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 DOMStorableInputOutputFormat(DOMFactory factory){
this(factory,"Drawing","xml","image/x-jhotdraw");
}
| Creates a new instance with format name "Drawing", file extension "xml" and mime type "image/x-jhotdraw". |
private Operation createNotifyOp(String service,String header){
return Operation.createPatch(this,service).addRequestHeader(Operation.TRANSACTION_HEADER,header).setBody(new TransactionServiceState()).setReferer(getUri()).setCompletion(null);
}
| Prepare a simple metadata request to a service |
public void test_digest$BII() throws Exception {
for ( Entry<Provider,List<String>> e : digestAlgs.entrySet()) {
for ( String algorithm : e.getValue()) {
MessageDigest digest=MessageDigest.getInstance(algorithm,e.getKey().getName());
assertNotNull(digest);
int len=digest.getDigestLength();
... | java.security.MessageDigest#digest(byte[], int, int) |
public final void moveVariation(int delta){
int nBack=0;
boolean found=false;
while (tree.currentNode != tree.rootNode) {
tree.goBack();
nBack++;
if (((delta < 0) && tree.currentNode.defaultChild > 0) || ((delta > 0) && tree.currentNode.defaultChild < tree.variations().size() - 1)) {
found=true;... | Move current variation up/down in the game tree. |
public int fib2(int n){
if (n == 0) return 0;
if (n == 1) return 1;
int prev=0;
int res=1;
for (int i=2; i <= n; i++) {
int temp=res;
res+=prev;
prev=temp;
}
return res;
}
| DP, bottom-up approach |
public IsComposingParser parse() throws ParserConfigurationException, SAXException, ParseFailureException {
try {
SAXParserFactory factory=SAXParserFactory.newInstance();
SAXParser parser=factory.newSAXParser();
parser.parse(mInputSource,this);
return this;
}
catch ( IOException e) {
throw new... | Parse the is composing input |
public ZipEntry(String name){
if (name == null) {
throw new NullPointerException();
}
if (name.length() > 0xFFFF) {
throw new IllegalArgumentException("entry name too long");
}
this.name=name;
}
| Creates a new zip entry with the specified name. |
public boolean contains(int s){
runTo(-1);
return super.contains(s);
}
| Tell if the table contains the given node. |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
public XYSeries toXYSeries(){
XYSeries xySeries=new XYSeries(mTitle);
return xySeries;
}
| Transforms the category series to an XY series. |
public int write(Protein protein) throws IOException {
List<String> proteinIdsForGFF=getProteinAccessions(protein);
int sequenceLength=protein.getSequenceLength();
String md5=protein.getMd5();
String date=dmyFormat.format(new Date());
Set<Match> matches=protein.getMatches();
for ( String proteinIdForGFF : ... | Writes out all protein matches for the specified protein (GFF formatted). |
@Override public DoublesSketch downSample(int smallerK){
HeapDoublesSketch oldSketch=this;
HeapDoublesSketch newSketch=HeapDoublesSketch.newInstance(smallerK);
DoublesMergeImpl.downSamplingMergeInto(oldSketch,newSketch);
return newSketch;
}
| From an existing sketch, this creates a new heap sketch that can have a smaller value of K. The original sketch is not modified. |
public static RectF trapToRect(float[] array){
RectF r=new RectF(Float.POSITIVE_INFINITY,Float.POSITIVE_INFINITY,Float.NEGATIVE_INFINITY,Float.NEGATIVE_INFINITY);
for (int i=1; i < array.length; i+=2) {
float x=array[i - 1];
float y=array[i];
r.left=(x < r.left) ? x : r.left;
r.top=(y < r.top) ? y :... | Takes an array of 2D coordinates representing corners and returns the smallest rectangle containing those coordinates. |
final DialogOption showYesNoMessage(String message,String title,int msgType,DialogOption defaultOption){
final String[] options={DialogOption.YES.getText(),DialogOption.NO.getText()};
int option;
try {
option=JOptionPane.showOptionDialog(getParentComponent(),getLabel(message),title,JOptionPane.YES_NO_OPTION,m... | Displays a message to the user and returns MessageService.YES_OPTION if the user selects yes and MessageService.NO_OPTION if the user selects no. |
@SuppressWarnings("unchecked") @Override public Object clone(){
HashMap<K,V> result;
try {
result=(HashMap<K,V>)super.clone();
}
catch ( CloneNotSupportedException e) {
throw new AssertionError(e);
}
result.makeTable(table.length);
result.entryForNullKey=null;
result.size=0;
result.keySet=null... | Returns a shallow copy of this map. |
public static AuthToken custom(String principal,String credentials,String realm,String scheme,Map<String,Object> parameters){
return new InternalAuthToken(parameters("scheme",scheme,"principal",principal,"credentials",credentials,"realm",realm,"parameters",parameters).asMap(Values.ofValue()));
}
| A custom authentication token used for doing custom authentication on the server side. |
protected ResultSet doQuery(String sql,List<String> params) throws SQLException {
FBPreparedStatement s=getStatement(sql);
for (int i=0; i < params.size(); i++) s.setStringForced(i + 1,params.get(i));
return s.executeMetaDataQuery();
}
| Execute an sql query with a given set of parameters. |
@Override public Object clone(){
try {
return (DecimalFormatSymbols)super.clone();
}
catch ( CloneNotSupportedException e) {
throw new InternalError(e);
}
}
| Standard override. |
public static String createProperty(String name,Object val){
return "-D" + name + "="+ val;
}
| Create property. |
private void doDownload(){
String downloadDir=getDownloadDir();
if (!getFileHandler().exists(downloadDir)) {
getFileHandler().mkdirs(downloadDir);
}
File targetFile=new File(downloadDir,getSourceFileName());
getLogger().info("Downloading container from [" + this.remoteLocation + "] to ["+ targetFile+ "]",... | Perform the actual HTTP download. |
static void checkOpcode(final int opcode,final int type){
if (opcode < 0 || opcode > 199 || TYPE[opcode] != type) {
throw new IllegalArgumentException("Invalid opcode: " + opcode);
}
}
| Checks that the type of the given opcode is equal to the given type. |
public void updateReadStats(OFMessage ofm){
switch (ofm.getType()) {
case BARRIER_REPLY:
ctrReadBarrierReply.increment();
break;
case BARRIER_REQUEST:
ctrReadBarrierRequest.increment();
break;
case ECHO_REPLY:
ctrReadEchoReply.increment();
break;
case ECHO_REQUEST:
ctrReadEchoRequest.increment();
break;
case ERRO... | Update Read openflow counters for this connection |
public TranslucentPopup(Component owner,Component contents,int x,int y){
this();
if (contents == null) {
throw new IllegalArgumentException("Contents must be non-null");
}
reset(owner,contents,x,y);
}
| Creates a <code>Popup</code> for the Component <code>owner</code> containing the Component <code>contents</code>. <code>owner</code> is used to determine which <code>Window</code> the new <code>Popup</code> will parent the <code>Component</code> the <code>Popup</code> creates to. A null <code>owner</code> implies there... |
private static byte[] streamToBytes(InputStream in,int length) throws IOException {
byte[] bytes=new byte[length];
int count;
int pos=0;
while (pos < length && ((count=in.read(bytes,pos,length - pos)) != -1)) {
pos+=count;
}
if (pos != length) {
throw new IOException("Expected " + length + " bytes, ... | Reads the contents of an InputStream into a byte[]. |
@DSSafe(DSCat.SAFE_OTHERS) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:58.380 -0500",hash_original_method="4F6254C867328A153FDD5BD23453E816",hash_generated_method="DA7F1F18A359C63EC62E782C4227E19E") public Extensions(){
}
| Constructs an object representing the value of Extensions. |
@Override public void run(){
amIActive=true;
String NIRHeader=null;
String RedHeader=null;
String outputHeader=null;
int row, col, x, y;
double[] NIRVal;
double[] redVal;
float progress=0;
int a;
if (args.length <= 0) {
showFeedback("Plugin parameters have not been set.");
return;
}
for ... | Used to execute this plugin tool. |
public AmqpReceiver createReceiver(String address) throws Exception {
return createReceiver(address,null,false);
}
| Create a receiver instance using the given address |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.