code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public void bindAnswer(String answer){
mAnswerText.setText(answer);
if (mGivenAnswer != null && mGivenAnswer.equals(answer)) {
mAnswerText.setTextColor(colorRight);
}
}
| Set the answer text in the View Holder and highlight the given answer |
public String toString(){
StringBuffer text=new StringBuffer();
text.append("ML ARAM classifier");
return text.toString();
}
| Returns a description of the classifier. |
protected void handleStartedStage(final State current){
switch (current.taskInfo.subStage) {
case RETRIEVE_HOST:
retrieveHost(current);
break;
case COPY_IMAGE:
copyImage(current);
break;
default :
throw new IllegalStateException("Un-supported substage" + current.taskInfo.subStage.toString());
}
}
| Processes a patch request to update the execution stage. |
private AnnotatedTypeMirror fromExpression(ExpressionTree tree){
if (shouldCache && fromTreeCache.containsKey(tree)) {
return fromTreeCache.get(tree).deepCopy();
}
AnnotatedTypeMirror result=TypeFromTree.fromExpression(this,tree);
annotateInheritedFromClass(result);
if (shouldCache) {
fromTreeCache.pu... | Creates an AnnotatedTypeMirror for an ExpressionTree. The AnnotatedTypeMirror contains explicit annotations written with on the expression, annotations inherited from class declarations, and for some expressions, annotations from sub-expressions that could have been explicitly written, implicited, defaulted, refined, o... |
public void test(String expectedContextProto,String[] expectedDefaultProtos) throws NoSuchAlgorithmException {
SSLContext context=null;
try {
if (expectedContextProto != null) {
context=SSLContext.getInstance(expectedContextProto);
context.init(null,null,null);
}
else {
context=SSLContext... | The parameter passed is the user enforced protocol. Does not catch NoSuchAlgorithmException, WrongProperty test will use it. |
private Object buildObject(Row row,PersistenceSettings settings){
if (row == null) return null;
PersistenceStrategy stg=settings.getStrategy();
Class clazz=settings.getJavaClass();
String col=settings.getColumn();
if (PersistenceStrategy.PRIMITIVE == stg) return PropertyMappingHelper.getCassandraColumnVal... | Builds object from Cassandra table row. |
public byte[] unpad(byte[] padded,int ofs,int len) throws BadPaddingException {
return unpad(RSACore.convert(padded,ofs,len));
}
| Unpad the padded block and return the data. |
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
int row, col, x, y;
float progress=0;
double z, z2;
int i;
int[] dX=new int[]{1,1,1,0,-1,-1,-1,0};
int[] dY=new int[]{-1,0,1,1,1,0,-1,-1};
double hasLowerNeighbour=0;
if (args.length <= 0) {
showFee... | Used to execute this plugin tool. |
private void layoutComponents(){
JPanel contentPane=(JPanel)getContentPane();
contentPane.setLayout(new BorderLayout());
contentPane.setBorder(new EmptyBorder(10,10,10,10));
contentPane.add("Center",createMainPanel());
contentPane.add("South",createButtonPanel());
}
| Layout components. |
public ReferenceEntry(AbstractReferenceMap parent,HashEntry next,int hashCode,Object key,Object value){
super(next,hashCode,null,null);
this.parent=parent;
this.key=toReference(parent.keyType,key,hashCode);
this.value=toReference(parent.valueType,value,hashCode);
}
| Creates a new entry object for the ReferenceMap. |
public static String toString(double[][] matrix){
String retVal="";
int m=matrix.length;
int n=matrix[0].length;
for (int i=0; i < m; ++i) {
for (int j=0; j < n; ++j) {
retVal+=fillString(Double.toString(matrix[i][j]),24);
}
retVal+="\n";
}
return (retVal);
}
| Converts a matrix object into a <code>String</code> object representing its content. |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
@Override public void write(byte[] buffer,int offset,int length,boolean isEnd) throws IOException {
int position=_position;
if (length < 0) {
throw new IllegalArgumentException();
}
if (_indexAddress < position + length) {
throw new IllegalArgumentException(L.l("Segment write overflow pos=0x{0} len=0x{1... | Writes to the file from the WriteStream flush. After the write, a read from the mmap will succeed, but the headers cannot be written until after the fsync. |
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 boolean nextLine() throws IOException {
while (reader.readLine(buf.delete(0,buf.length()))) {
++lineNumber;
if (lengthWithoutLinefeed(buf) > 0) {
return true;
}
}
return false;
}
| Read the next line. |
public void onDestroy(){
ServiceWatchDog.getInstance().notifyServiceDestroy();
if (errorHandler != null) {
try {
unregisterReceiver(errorHandler);
}
catch ( Exception e) {
}
}
log.debug("MurmurService onDestroy");
mBackgroundExecution.cancel(true);
SharedPreferences pref=getSharedPrefe... | Called when the service is destroyed. |
public void splash(Object splash){
this.splash=Objects.requireNonNull(splash);
}
| Sets the splash screen image - any size and format is okay. |
public StringBuffer append(double d){
RealToString.getInstance().appendDouble(this,d);
return this;
}
| Adds the string representation of the specified double to the end of this StringBuffer. |
public KeyImpl(KerberosPrincipal principal,char[] password,String algorithm){
try {
PrincipalName princ=new PrincipalName(principal.getName());
EncryptionKey key=new EncryptionKey(password,princ.getSalt(),algorithm);
this.keyBytes=key.getBytes();
this.keyType=key.getEType();
}
catch ( KrbException... | Constructs a KeyImpl from a password. |
@Override public void addChild(FXGNode child){
if (child instanceof MatrixNode) matrix=(MatrixNode)child;
else super.addChild(child);
}
| Add a child node to this BitmapFillNode. Supported child nodes: MatrixNode. |
protected SVGOMTRefElement(){
}
| Creates a new SVGOMTRefElement object. |
private boolean canPaste(){
if (items == null || items.isEmpty()) {
return false;
}
Selection<?> selection=projectExplorer.getSelection();
if (selection == null || !selection.isSingleSelection()) {
return false;
}
Object headElement=selection.getHeadElement();
if (!(headElement instanceof HasStora... | Determines whether pasting can be performed. |
public static BigInteger[] extgcd(BigInteger a,BigInteger b){
BigInteger u=ONE;
BigInteger v=ZERO;
BigInteger d=a;
if (b.signum() != 0) {
BigInteger v1=ZERO;
BigInteger v3=b;
while (v3.signum() != 0) {
BigInteger[] tmp=d.divideAndRemainder(v3);
BigInteger q=tmp[0];
BigInteger t3=tm... | Extended euclidian algorithm (computes gcd and representation). |
protected MoreGuards_Impl(){
super();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static JournalStore createMmap(Path path) throws IOException {
return create(path,true);
}
| Creates an independent store. |
protected static double eq24(final double beta_i,final double gN,final double gP,final double U){
double vi=0;
if (beta_i == 0) {
if (gN >= 0) vi=gN;
else if (gP <= 0) vi=-gP;
}
else {
if (beta_i < 0) {
if (beta_i > -U || (beta_i == -U && gN <= 0)) vi=Math.abs(gN);
}
else {
... | returns the result of evaluation equation 24 of an individual index |
@Override public void bezierDetail(int detail){
}
| Ignored (not needed) in Java 2D. |
public JSONWriter endArray() throws JSONException {
return this.end('a',']');
}
| End an array. This method most be called to balance calls to <code>array</code>. |
private boolean isOutsideDocElem(){
return (null == m_docFrag) && m_elemStack.size() == 0 && (null == m_currentNode || m_currentNode.getNodeType() == Node.DOCUMENT_NODE);
}
| Tell if the current node is outside the document element. |
private static void genSVR4ParameterPassingCode(Assembler asm,TypeReference[] types,int nextVMArgReg,int nextVMArgFloatReg,int spillOffsetVM,int nextOSArgReg,int nextOSArgFloatReg,int spillOffsetOS){
if (VM.BuildForSVR4ABI) {
int numArguments=types.length;
Assembler[] asmForArgs=new Assembler[numArguments];
... | Generates instructions to copy parameters from RVM convention to OS convention. |
public static long pow(long a,int e){
long result=1;
while (e > 0) {
if ((e & 1) == 1) {
result*=a;
}
a*=a;
e>>>=1;
}
return result;
}
| Compute <tt>a<sup>e</sup></tt>. |
private static void increment(byte[] b){
int n=b.length - 1;
while ((n >= 0) && (++b[n] == 0)) {
n--;
}
}
| Increment the counter value. |
public SkipMeException(int code,Object... args){
this(Warning.parse(code,args));
}
| Creates a new "skip me" exception. |
public static GraphModel buildFromEdges(Collection<GraphEdge> sourceEdges){
GraphModel result=new GraphModel();
for ( GraphEdge e : sourceEdges) {
GraphNode head=(GraphNode)result.mapNode(e.getHead());
GraphNode tail=(GraphNode)result.mapNode(e.getTail());
result.addEdge(e.getRelation(),head,tail);
}... | Build a graph given a collection of edges. Nodes are those involved in at least one relation. |
public FileResolver(){
}
| Instantiates a new file resolver. |
public static File configDir(){
lock.readLock().lock();
try {
return config_dir;
}
finally {
lock.readLock().unlock();
}
}
| Return the configured configuration file directory. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:46.972 -0500",hash_original_method="AFB6FAED7CE2C798D2C88DCB60C1E3BA",hash_generated_method="5052780A51C172A7104F8230B21D9B2E") public void processInput(){
mythread.start();
}
| Start reading and processing input. |
private void enableActions(){
restoreAction.setEnabled(isParentMaximum() || isParentIcon());
maximizeAction.setEnabled((isParentMaximizable() && !isParentMaximum() && !isParentIcon()) || (isParentMaximizable() && isParentIcon()));
iconifyAction.setEnabled(isParentIconifiable() && !isParentIcon());
closeAction.s... | Enable/disable the button actions as needed. |
public void triggerFinishCallback(int cbid,int listId,int listPc,int callbackNotifyArg1){
triggerAsyncCallback(cbid,listId,listPc,PSP_GE_SIGNAL_HANDLER_SUSPEND,callbackNotifyArg1,finishCallbacks);
}
| safe to call from the Async display thread |
public T caseParameterizedAccess(ParameterizedAccess object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>Parameterized Access</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
public SubscriptionMigrationException(String message,Reason reason,Object[] params){
super(message,params);
bean.setReason(reason);
setMessageKey(getMessageKey() + "." + reason.toString());
}
| Constructs a new exception with the given detail message and message parameters, and appends the specified reason to the message key. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public void addInvokestatic(String classname,String name,String desc){
addInvokestatic(constPool.addClassInfo(classname),name,desc);
}
| Appends INVOKESTATIC. |
public void writeRawBytes(final byte[] value) throws IOException {
writeRawBytes(value,0,value.length);
}
| Write an array of bytes. |
public void initOptions(){
CHECK_BOX.setSelected(StatusBarSettings.FIREWALL_DISPLAY_ENABLED.getValue());
}
| Defines the abstract method in <tt>AbstractPaneItem</tt>.<p> Sets the options for the fields in this <tt>PaneItem</tt> when the window is shown. |
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 static boolean isDocumentAnnotation(FeatureStructure aFS){
return (aFS instanceof AnnotationFS) && aFS.equals(((AnnotationFS)aFS).getView().getDocumentAnnotation());
}
| Determines whether the given FS is the DocumentAnnotation for its view. This is more than just a type check; we actually check if it is the one "special" DocumentAnnotation that CAS.getDocumentAnnotation() would return. |
public WikipediaInfo(Iterable<Page> pPages) throws WikiApiException {
if (pPages == null) {
throw new WikiApiException("The page set has to be initialized.");
}
pages=pPages;
averageFanOut=-1.0;
degreeDistribution=new HashMap<Integer,Integer>();
categorizedArticleSet=new HashSet<Integer>();
numberOfPa... | Get infos only for a subset of articles. |
public void onAnimationCancel(Animator animation){
}
| Ignore cancel events for now. We may want to handle this eventually, to prevent follow-on animations from running when some dependency animation is canceled. |
public Object run(GroovyCodeSource source,List args) throws CompilationFailedException {
return run(source,((String[])args.toArray(new String[args.size()])));
}
| Runs the given script source with command line arguments |
public Optional<T> ifPresent(Action1<? super T> action){
if (value != null) action.call(value);
return this;
}
| Calls the method if the value is present. |
private void convertInstance(Instance inst){
if (getInputFormat().classAttribute().isNominal()) {
convertInstanceNominal(inst);
}
else {
convertInstanceNumeric(inst);
}
}
| Convert a single instance over. The converted instance is added to the end of the output queue. |
public V put(long key,V value){
boolean wasFree=false;
V previous=null;
int index=insertionIndex(key);
boolean isNewMapping=true;
if (index < 0) {
index=-index - 1;
previous=unwrapNull(_values[index]);
isNewMapping=false;
}
else {
wasFree=isFree(_values,index);
}
_set[index]=key;
_val... | Inserts a key/value pair into the map. |
public static String createCounterName(String switchID,int portID,String counterName){
if (portID < 0) {
return switchID + TitleDelimitor + counterName;
}
else {
return switchID + TitleDelimitor + portID+ TitleDelimitor+ counterName;
}
}
| Create a title based on switch ID, portID, vlanID, and counterName If portID is -1, the title represents the given switch only If portID is a non-negative number, the title represents the port on the given switch |
protected void addNodesPropertyDescriptor(Object object){
itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),getResourceLocator(),getString("_UI_ExecutionRegion_nodes_feature"),getString("_UI_PropertyDescriptor_description","_UI_ExecutionRegion... | This adds a property descriptor for the Nodes feature. <!-- begin-user-doc --> <!-- end-user-doc --> |
public IDevice learnEntity(long macAddress,Short vlan,Integer ipv4Address,Long switchDPID,Integer switchPort,boolean processUpdates){
List<IDeviceListener> listeners=deviceListeners.getOrderedListeners();
if (!processUpdates) {
deviceListeners.clearListeners();
}
VlanVid v;
IPv4Address i;
DatapathId d;
... | Learn a device using the given characteristics. |
public SystemPermissionModel(){
}
| Creates a new, empty System permission. |
@Override protected void mergeMeasures(DataMatrix merge,RawRow leftrow,RawRow rightrow,RawRow merged){
int pos=merge.getAxesSize();
int size=left != null ? left.getDataSize() : (right != null ? right.getDataSize() : 0);
for (int i=0; i < size; i++) {
Object leftValue=left != null && leftrow != null ? left.get... | override to interleave present/past values |
public synchronized boolean hasAnyRelationshipToTargetOfType(Vertex classification){
Iterator<Relationship> relationships=allRelationships();
while (relationships.hasNext()) {
Relationship relationship=relationships.next();
if (!relationship.isInverse() && relationship.getTarget().hasRelationship(Primitive.... | Return if the vertex has any relationship to any target that is an instantiation of the classification. |
public boolean isBurning(Coords coords){
return burning.get(coords);
}
| Determine if this building is on fire. |
public static OutputLimitClause create(String frequencyVariable){
return new OutputLimitClause(OutputLimitSelector.DEFAULT,frequencyVariable);
}
| Creates an output limit clause. |
@DSComment("Syncing file with storage") @DSSafe(DSCat.IO) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:47.711 -0500",hash_original_method="84EEC9A137856593BBF0A90E4A96E319",hash_generated_method="C8E75F8E8502693FBE5612B9F636D819") public void sync() throws SyncFailedException ... | Ensures that data which is buffered within the underlying implementation is written out to the appropriate device before returning. |
public ExportDisplayAction(Display display){
this.display=display;
}
| Create a new ExportDisplayAction for the given Display. |
public void flushPendingWrites(){
synchronized (mPendingWritesLock) {
if (mPendingWrites.isEmpty()) return;
new UpdateDbTask(getContext(),sOpenHelper,mPendingWrites,mLocale).execute();
mPendingWrites=new HashSet<Bigram>();
}
}
| Schedules a background thread to write any pending words to the database. |
public static BinaryVariable newBinary(int length){
return new BinaryVariable(length);
}
| Returns a new binary decision variable with the specified number of bits. |
@Override public Iterator<E> iterator(){
return map.keySet().iterator();
}
| Returns an iterator over the elements in this set. The elements are returned in no particular order. |
int[] updateLayoutArray(int[] oldArray,int offset,int nInserted){
int n=getViewCount();
int[] newArray=new int[n];
System.arraycopy(oldArray,0,newArray,0,offset);
System.arraycopy(oldArray,offset,newArray,offset + nInserted,n - nInserted - offset);
return newArray;
}
| Resizes the given layout array to match the new number of child views. The current number of child views are used to produce the new array. The contents of the old array are inserted into the new array at the appropriate places so that the old layout information is transferred to the new array. |
public LocationOperand(RVMField loc){
type=FIELD_ACCESS;
fieldRef=loc.getMemberRef().asFieldReference();
}
| Constructs a new location operand with the given field |
public static List<String> partitionNameToValues(HiveMetastoreClient ms,String partitionName) throws HiveMetastoreException {
Map<String,String> kv=ms.partitionNameToMap(partitionName);
List<String> values=new ArrayList<>();
for ( String equalsExpression : partitionName.split("/")) {
String[] equalsExpressio... | Convert a partition name into a list of partition values. e.g. 'ds=1/hr=2' -> ['1', '2'] |
protected void crop(){
if (children.length != childCount) {
children=(PShape[])PApplet.subset(children,0,childCount);
}
}
| Resize the children[] array to be in line with childCount |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
@Override public String generateCreateTableDdl(BusinessObjectFormatDdlRequest request,BusinessObjectFormatEntity businessObjectFormatEntity,CustomDdlEntity customDdlEntity){
Boolean isPartitioned=!businessObjectFormatEntity.getPartitionKey().equalsIgnoreCase(NO_PARTITIONING_PARTITION_KEY);
GenerateDdlRequest genera... | Generates the create table Hive 13 DDL as per specified business object format DDL request. |
private void addPropertyEditorIfNecessary(Class<?> targetClass){
if (!registerPropertyEditors) {
return;
}
PropertyEditor editor=PropertyEditorManager.findEditor(targetClass);
if (null != editor) {
return;
}
String className=targetClass.getName();
if (targetClass.isPrimitive()) {
return;
}
... | <p>To enable EL Coercion to use JSF Custom converters, this method will call <code>PropertyEditorManager.registerEditor()</code>, passing the <code>ConverterPropertyEditor</code> class for the <code>targetClass</code> if the target class is not one of the standard by-type converter target classes. |
public void uninstallUI(JComponent a){
for (int i=0; i < uis.size(); i++) {
((ComponentUI)(uis.elementAt(i))).uninstallUI(a);
}
}
| Invokes the <code>uninstallUI</code> method on each UI handled by this object. |
private FilePart rollOver() throws IOException {
if (currentLastBytePos > -1) {
throw new IllegalStateException("Current currentLastCharPos unexpectedly positive... " + "last readLine() should have returned something! currentLastCharPos=" + currentLastBytePos);
}
if (no > 1) {
return new FilePart(no - 1,b... | Handles block rollover |
private void scrollDialogToValue(String value,AlertDialog dialog,int containerId){
Log.d(DEBUG_TAG,"scrollDialogToValue scrolling to " + value);
final View sv=(View)dialog.findViewById(R.id.myScrollView);
if (sv != null) {
ViewGroup container=(ViewGroup)dialog.findViewById(containerId);
if (container != n... | Scroll the view in the dialog to show the value, assumes the ScrollView has id R.is.scrollView |
public Relationship bestResponse(float percentage,Vertex input,Vertex sentence,Vertex question,Vertex previousResponse,Network network){
return bestResponse(percentage,input,sentence,question,previousResponse,true,true,null,null,null,network);
}
| Return the best response to the question, taking into account the input history. |
private void openTestAction(String file,String name) throws ParserConfigurationException, SAXException, IOException {
this.currentFileName=name + ".xml";
int option=JOptionPane.showConfirmDialog(this,Messages.getString("dialog.test.open.warning.text"),MessageFormat.format(Messages.getString("dialog.test.open.warnin... | Attempts to open and load the simulation state from the user selected test. |
private void processEmail(EmailData emailData){
if (logger.isTraceEnabled()) {
logger.trace("Entered MailManager:processEmail");
}
if (mailHost == null || mailHost.length() == 0 || emailData == null || mailToAddresses.length == 0) {
logger.error(LocalizedMessage.create(LocalizedStrings.MailManager_REQUIRE... | Send Emails to all the registered email id |
public ArraySet(int initialCapacity){
items=new ArrayList<E>(initialCapacity);
}
| Create an empty set with the specified initial capacity. |
@Override public boolean equals(Object obj){
if (obj == this) {
return true;
}
if (!(obj instanceof XYItemKey)) {
return false;
}
XYItemKey that=(XYItemKey)obj;
if (!this.seriesKey.equals(that.seriesKey)) {
return false;
}
if (this.itemIndex != that.itemIndex) {
return false;
}
retur... | Tests this instance for equality with an arbitrary object. |
public MultiImageSVGEditor(EditableResources res,String name){
initComponents();
this.res=res;
this.name=name;
imageName.setText(name);
zoom.setModel(new SpinnerNumberModel(1,0.5,20,0.5));
Vector users=new Vector();
ImageRGBEditor.findImageUse(name,users,res);
DefaultListModel d=new DefaultListModel();
... | Creates new form MultiImageSVGEditor |
@Override public boolean handleDeparture(double now,MobsimAgent agent,Id linkId){
if (this.modes.contains(agent.getMode())) {
handleAgentPTDeparture(agent,linkId);
return true;
}
return false;
}
| check not only TransportMode.pt |
public final boolean isReservedApplicationCode(int colorIndex){
return colorIndex >= this.numOfLookupTableEntries;
}
| Returns if the specified color code is reserved for overlays generated by application software. |
public XmlProperty(File file) throws IOException {
this.file=file;
if (!file.exists()) {
File tempFile;
tempFile=new File(file.getParentFile(),file.getName() + ".tmp");
if (tempFile.exists()) {
Log.error("WARNING: " + file.getName() + " was not found, but temp file from "+ "previous write operatio... | Creates a new XMLPropertiesTest object. |
private void updateInternal(boolean markDirty){
tableViewer.refresh();
updateCheckedItems();
updateButtonsState();
if (markDirty) {
markDirty();
}
}
| Performs the internal update by executing following tasks. <ul> <li>refreshing the table view <li>re-checking the checked items in the table <li>updating buttons state <li>marking as dirty if specified </ul> |
@SuppressWarnings({"unchecked","boxing"}) public void testSerializationCompatibility() throws Exception {
EnumMap enumColorMap=new EnumMap<Color,Double>(Color.class);
enumColorMap.put(Color.Red,1);
enumColorMap.put(Color.Blue,3);
SerializationTest.verifyGolden(this,enumColorMap);
}
| serialization/deserialization compatibility with RI. |
public static void recordBourneVolumeEvent(DbClient dbClient,URI id,String evtType,Operation.Status status,String desc) throws Exception {
RecordableEventManager eventManager=new RecordableEventManager();
eventManager.setDbClient(dbClient);
Volume volumeObj=dbClient.queryObject(Volume.class,id);
RecordableBourn... | Generate and Record a Bourne volume specific event |
private Response<Bitmap> doParse(NetworkResponse response){
byte[] data=response.data;
BitmapFactory.Options decodeOptions=new BitmapFactory.Options();
Bitmap bitmap=null;
if (mMaxWidth == 0 && mMaxHeight == 0) {
decodeOptions.inPreferredConfig=mDecodeConfig;
bitmap=BitmapFactory.decodeByteArray(data,0,... | The real guts of parseNetworkResponse. Broken out for readability. |
private void initCommon(RSAKey rsaKey,SecureRandom random) throws InvalidKeyException {
resetDigest();
int keySize=RSACore.getByteLength(rsaKey);
try {
padding=RSAPadding.getInstance(RSAPadding.PAD_BLOCKTYPE_1,keySize,random);
}
catch ( InvalidAlgorithmParameterException iape) {
throw new InvalidKeyEx... | Init code common to sign and verify. |
protected void release(BaseEvent event){
Info info=events.get(event);
if (info != null) {
if (info.refcount.decrementAndGet() == 0) {
events.remove(event);
}
}
else {
log.warn("Release called on already released event.");
}
}
| Release event if there's no more references to it |
public void cancel(){
cancel=true;
}
| false == don't show native context menu, true == show native context menu |
@Override public boolean onBackPressed(){
return getActiveLayout() != null && getActiveLayout().onBackPressed();
}
| Should be called when the user presses the back button on the phone. |
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException {
XMLString s1=getArg0AsString(xctxt);
return (XString)s1.fixWhiteSpace(true,true,false);
}
| Execute the function. The function must return a valid object. |
public RequestCreator skipMemoryCache(){
skipMemoryCache=true;
return this;
}
| Indicate that this action should not use the memory cache for attempting to load or save the image. This can be useful when you know an image will only ever be used once (e.g., loading an image from the filesystem and uploading to a remote server). |
@LargeTest public void testErrorHttpDataError_invalidRedirect() throws Exception {
Uri uri=getServerUri(DEFAULT_FILENAME);
final MockResponse resp=buildResponse(HTTP_REDIRECT);
resp.setHeader("Location","://blah.blah.blah.com");
enqueueResponse(resp);
doErrorTest(uri,DownloadManager.ERROR_HTTP_DATA_ERROR);
}
| Tests the download failure error from an unhandled HTTP status code |
public void processItemBuffer(){
for ( String number : allItemMap.keySet()) {
IItem item=allItemMap.get(number);
if (getLog().isDebugEnabled()) {
getLog().debug("processing: " + item.getName());
}
StringTokenizer numberTokens=new StringTokenizer(number,".");
((Item)getRoot()).processItem((I... | Iterates over all items in the buffer an creates the tree structure |
public void outputTypes(PrintWriter writer){
writer.println("==BEAST types==");
writer.println("");
writer.println("The following is a list of generic types that elements represent in a beast file.");
writer.println("");
for ( Class requiredType : requiredTypes) {
if (requiredType != Object.class) {
... | Outputs all types that appear as required attributes or elements in an HTML table to the given writer. |
public static void doubleBenchmarkPrimitiveOptimized(int runs,int rows,int columns,boolean print){
cern.colt.Timer timer1=new cern.colt.Timer();
cern.colt.Timer timer2=new cern.colt.Timer();
cern.colt.Timer timer3=new cern.colt.Timer();
cern.colt.Timer emptyLoop=new cern.colt.Timer();
cern.colt.Timer emptyLoo... | Runs a bench on matrices holding double elements. |
static public boolean isTwoPartTLD(String domain){
return twoPartTLDs.contains(domain);
}
| Determines if a two-part domain string (xxx.xxx) is contained in the cache of known two-part TLDs. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.