code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public void refreshData(){
if (this.node == null || getDetails() == null) {
return;
}
this.updateText();
this.updateList();
this.updateFields();
this.updateImage();
}
| Refreshes the entire window from the original object with current data. |
public void invalidate(){
invalidate(true);
}
| call when dropping or renaming a CF. Performs mbean housekeeping and invalidates CFS to other operations |
public AuthenticationNotSupportedException(String explanation){
super(explanation);
}
| Constructs a new instance of AuthenticationNotSupportedException using an explanation. All other fields default to null. |
public static boolean pathExists(String path){
return ((new File(path)).exists());
}
| Checks if a given path exists |
protected boolean isDisplayShowTitleEnabled(){
return true;
}
| <p> Should the title be displayed in the toolbar. </p> |
public WrappedSyntaxView(Element elem){
super(elem,Y_AXIS);
s=new Segment();
drawSeg=new Segment();
tempRect=new Rectangle();
}
| Creates a new WrappedSyntaxView. Lines will be wrapped on character boundaries. |
@Override public Tab createFrozenTab(TabState state,int id,int index){
return ChromeTab.createFrozenTabFromState(id,null,state.isIncognito(),null,Tab.INVALID_TAB_ID,state);
}
| Creates a frozen Tab. This Tab is not meant to be used or unfrozen -- it is only used as a placeholder until the real Tab can be created. The index is ignored in DocumentMode because Android handles the ordering of Tabs. |
public SerializerWriteBasicComposed(Datas[]... classes){
m_classes=classes;
}
| Creates a new instance of SerializerWriteComposed |
public void fireTextAdded(final NetworkTextObject added){
for ( TextListener listener : textListeners) {
listener.textAdded(added);
}
}
| Fire a text added event to all registered model listeners. |
void fireValueChanged(){
for ( final PWRowGroup rowGroup : this.rowGroups) {
rowGroup.enableOrDisable();
}
for ( final PWWidget widget : this.widgets) {
widget.enableOrDisable();
}
}
| Fire events when the value has changed |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-02-24 15:47:29.009 -0500",hash_original_method="4C3E3E79257D1C7DB00CE411F8327D07",hash_generated_method="3054D1C06BD5E4739C41763303021BC5") @DSSafe(DSCat.SAFE_OTHERS) public static byte[] sha384(byte[] data){
return getSha384Digest().digest(d... | Calculates the SHA-384 digest and returns the value as a <code>byte[]</code>. <p> Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. </p> |
public final Instances resampleWithWeights(Random random){
double[] weights=new double[numInstances()];
boolean foundOne=false;
for (int i=0; i < weights.length; i++) {
weights[i]=instance(i).weight();
if (!Utils.eq(weights[i],weights[0])) {
foundOne=true;
}
}
if (foundOne) {
return resa... | Creates a new dataset of the same size using random sampling with replacement according to the current instance weights. The weights of the instances in the new dataset are set to one. |
private PieData generateDataPie(int cnt){
ArrayList<Entry> entries=new ArrayList<Entry>();
for (int i=0; i < 4; i++) {
entries.add(new Entry((int)(Math.random() * 70) + 30,i));
}
PieDataSet d=new PieDataSet(entries,"");
d.setSliceSpace(2f);
d.setColors(ColorTemplate.VORDIPLOM_COLORS);
PieData cd=new P... | generates a random ChartData object with just one DataSet |
public boolean encrypt(){
return encrypt;
}
| Encrypt exported private key? |
public void terminate(){
currentShortcut=null;
}
| This MUST be called by the shortcut tool once the modifications are done. |
public void storeOriginals(){
mStartingStartTrim=mStartTrim;
mStartingEndTrim=mEndTrim;
mStartingRotation=mRotation;
}
| If the start / end trim are offset to begin with, store them so that animation starts from that offset. |
public void removeVetoableChangeListener(String propertyName,VetoableChangeListener in_vcl){
beanContextChildSupport.removeVetoableChangeListener(propertyName,in_vcl);
}
| Method for BeanContextChild interface. |
public AttributeWeights doWork(Model model,ExampleSet exampleSet) throws OperatorException {
modelInput.receive(model);
getExampleSetInputPort().receive(exampleSet);
doWork();
return getWeightsOutputPort().getData(AttributeWeights.class);
}
| Helper method for anonymous instantiations of this class. |
public Property dayOfWeek(){
return new Property(this,getChronology().dayOfWeek());
}
| Get the day of week property which provides access to advanced functionality. |
public ToolTipControl(String field){
this(new String[]{field});
}
| Create a new ToolTipControl. |
@Override public int read(){
return -1;
}
| Returns -1 to indicate that the stream is closed. |
protected boolean isAddRemoveModifiable(){
return true;
}
| Override if your map does not allow add/remove modifications. The default implementation returns <code>true</code>. |
public int compare(Tuple<Integer,Integer> fromEdge,Tuple<Integer,Integer> toEdge){
Integer fromSource=fromEdge.getFirst();
Integer fromDestination=fromEdge.getSecond();
Integer toSource=toEdge.getFirst();
Integer toDestination=toEdge.getSecond();
if ((fromSource.intValue() < toSource.intValue()) | ((fromSourc... | Method of comparison. Ranks the QuadEdge in descending order. |
private String createJson(User user){
return "{\"username\": \"" + user.getLogin() + "\","+ " \"password1\": \""+ user.getPassword()+ "\","+ " \"password2\": \""+ user.getPassword()+ "\","+ " \"fullname\": \""+ user.getFirstName()+ " "+ user.getLastName()+ "\","+ " \"email\": \""+ user.getEmail()+ "\"}";
}
| Create a json for create a user with user's informations |
public Response updateSystemProperty(SystemProperty property){
return restClient.put("system/properties/" + property.getKey(),property,new HashMap<String,String>());
}
| Update system property. |
public static String marshalSchemas(DbSchemas schemas,String dbSchemaVersion){
try {
JAXBContext jc=JAXBContext.newInstance(DbSchemas.class);
Marshaller m=jc.createMarshaller();
if (dbSchemaVersion != null) {
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
m.setProperty("com.sun.xml.inte... | marshal DbSchemas instance into a String |
public void sample(int column,String value){
rangeCheck(column,true);
((ParserFactory)m_factories.get(column)).sample(value);
}
| Sample the given text string for the given data column index. |
@Override public boolean supportsFullOuterJoins(){
debugCodeCall("supportsFullOuterJoins");
return false;
}
| Returns whether full outer joins are supported. |
public static ConditionOperand LOWER_EQUAL(){
return new ConditionOperand(LOWER_EQUAL);
}
| Create the condition code operand for LOWER_EQUAL |
public static int daysInChineseMonth(int y,int m){
int index=y - baseChineseYear + baseIndex;
int v=0;
int l=0;
int d=30;
if (1 <= m && m <= 8) {
v=chineseMonths[2 * index];
l=m - 1;
if (((v >> l) & 0x01) == 1) {
d=29;
}
}
else if (9 <= m && m <= 12) {
v=chineseMonths[2 * index ... | calculate the lunar month(m)'s days in lunar year(y) |
@SuppressWarnings("unused") public boolean removeFooterItem(View v){
return mFooterItems.remove(v) && mAdapter != null && mAdapter.removeFooterItem(v);
}
| Removes a previously-added footer view. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:35:07.183 -0500",hash_original_method="122ACDBA22A4D3B6B9E93FB00E1FAEC7",hash_generated_method="2CCCACA7DE24F82A4B382CB9AEC20A70") public void translateLayoutParamsInAppWindowToScreen(LayoutParams params){
params.scale(applicationSca... | Translate the location of the sub window. |
public static <T>WrappingFunctor<T> asFunctor(final Object o){
return new FunctorWrapper<>(o);
}
| Create a Duck typed functor. Wrapped class should have a method map(F f) Where F is a Functional Interface of any type that takes a single parameter and returns a result. |
@Override public RegexpQueryBuilder boost(float boost){
this.boost=boost;
return this;
}
| Sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided. |
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. |
public HashInterner(){
this(100);
}
| Creates an Interner with 100 expected elements as sizing hint for the underlying Map. |
static RegisterOperand InsertLoadOffset(Instruction s,IR ir,Operator operator,TypeReference type,Operand reg2,Offset offset,Operand guard){
return InsertLoadOffset(s,ir,operator,type,reg2,offset,null,guard);
}
| Insert a load off before s in the instruction stream. |
public String locator(Properties ctx,int WindowNo,GridTab mTab,GridField mField,Object value){
if (value == null) return "";
int M_Product_ID=Env.getContextAsInt(ctx,WindowNo,"M_Product_ID");
checkQtyAvailable(ctx,mTab,WindowNo,M_Product_ID,null);
return "";
}
| Movement Line - Locator modified |
public void onScreenChange(int currentScreen,int lastScreen){
ImageView[] points=platformGridView.points;
for (int i=0; i < points.length; i++) {
points[i].setImageBitmap(platformGridView.grayPoint);
}
points[currentScreen].setImageBitmap(platformGridView.bluePoint);
}
| This method will be called after sliding the gridview |
public void init(ServletConfig config) throws ServletException {
super.init(config);
if (!WebEnv.initWeb(config)) throw new ServletException("WLocation.init");
}
| Initialize global variables |
protected SVGOMFEDistantLightElement(){
}
| Creates a new SVGOMFEDistantLightElement object. |
private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
if (xmlWriter.getPrefix(namespace) == null) {
xmlWriter.writeNamespace(prefix,namespace);
x... | Util method to write an attribute with the ns prefix |
public static void main(String[] args){
if (args.length != 2) {
System.out.println("TaggingClient [inputfile] [outputfile]");
return;
}
try {
TaggingClient client=new TaggingClient("localhost",2929);
BufferedReader reader=new BufferedReader(new InputStreamReader(new FileInputStream(args[0]),"UTF-8... | The main method. |
public void init(Swagger2MarkupConverter.Context globalContext){
}
| Overridable init event listener. |
public boolean checkChallanValidity(final Challan challan){
final Calendar current=Calendar.getInstance();
current.clear(Calendar.HOUR_OF_DAY);
current.clear(Calendar.MINUTE);
current.clear(Calendar.SECOND);
current.clear(Calendar.MILLISECOND);
final Calendar validityStart=Calendar.getInstance();
validity... | This method checks if the given challan is valid. |
private void writeQNameAttribute(java.lang.String namespace,java.lang.String attName,javax.xml.namespace.QName qname,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
java.lang.String attributeNamespace=qname.getNamespaceURI();
java.lang.String attributePrefix=xmlWriter.getPre... | Util method to write an attribute without the ns prefix |
public String nodeId(){
return nodeId;
}
| Returns node id of the node where shared is getting restored |
public boolean shouldSelectCell(EventObject anEvent){
return true;
}
| Returns true. |
private static boolean isBufferTooLarge(int size){
return size > MAX_CACHED_BUFFER_SIZE;
}
| Returns true if a buffer of this size is too large to be added to the buffer cache, false otherwise. |
public static MapBean createMapBean(Projection proj,Border border){
MapBean mapBeano=new BufferedLayerMapBean();
mapBeano.setBorder(border);
if (proj != null) {
mapBeano.setProjection(proj);
mapBeano.setPreferredSize(new Dimension(proj.getWidth(),proj.getHeight()));
}
return mapBeano;
}
| A static method that creates a MapBean and sets its projection and border to the values given. |
public void removeFocusFromEditText(View view){
wifiFilterET.clearFocus();
uploadUrlET.clearFocus();
}
| Clears focus from EditText (the SSID filter). This is needed because EditText grabs focus and opens the keyboard, which is annoying. See GridLayout's focussing attributes, which prevents ET focus grab at startup. https://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup/ |
public static <E extends Comparable<E>>void toChildrenSum(BinaryNode<E> node){
if (node == null || node.left == null && node.right == null) return;
toChildrenSum(node.left);
toChildrenSum(node.right);
Integer nodeValue=(Integer)(node == null ? 0 : node.value);
Integer leftChildValue=(Integer)(node.left == n... | Converts a tree to hold the children sum invariant. <p/> It only increments data values in any node (Does not change structure of tree and cannot decrement value of any node). |
private static boolean discardStream(HttpEngine httpEngine,InputStream responseBodyIn){
Connection connection=httpEngine.connection;
if (connection == null) return false;
Socket socket=connection.getSocket();
if (socket == null) return false;
try {
int socketTimeout=socket.getSoTimeout();
socket.s... | Discards the response body so that the connection can be reused. This needs to be done judiciously, since it delays the current request in order to speed up a potential future request that may never occur. |
public colgroup removeElement(String hashcode){
removeElementFromRegistry(hashcode);
return (this);
}
| Removes an Element from the element. |
@Override protected void process(DistributionManager dm){
final GemFireCacheImpl cache;
cache=GemFireCacheImpl.getInstance();
if (cache != null) {
Iterator iterator=this.messagesList.iterator();
int oldLevel=LocalRegion.setThreadInitLevelRequirement(LocalRegion.BEFORE_INITIAL_IMAGE);
try {
while... | Extracts the region from the message list and hands over the message removal task to the executor |
private Operation buildSelfPatchOperation(State s){
return Operation.createPatch(UriUtils.buildUri(getHost(),getSelfLink())).setBody(s);
}
| Build an operation object that sends a patch to the service. |
private boolean lambdaNewClassFilter(TranslationContext<?> context,JCNewClass tree){
if (context != null && tree.encl == null && tree.def == null && !tree.type.getEnclosingType().hasTag(NONE)) {
Type encl=tree.type.getEnclosingType();
Type current=context.owner.enclClass().type;
while (!current.hasTag(NON... | This is used to filter out those new class expressions that need to be qualified with an enclosing tree |
public boolean wipe(){
return mProviderHelper.wipe();
}
| clears <b>all</b> saved preferences. Module independent. <b>Erases everything</b>. |
public ResourceBundleELResolverITCase(String name){
super(name);
}
| Construct a new instance of this test case. |
void testFail(InputStream is,String cmd) throws Exception {
boolean ok;
try {
test(is,cmd);
ok=true;
}
catch ( Exception e) {
ok=false;
}
if (ok) {
afterFail("",cmd,"FAIL");
throw new RuntimeException();
}
}
| Call this method if you expect test(input, cmd) should fail and throw an exception |
int[] findNearestVacantArea(int pixelX,int pixelY,int spanX,int spanY,int[] result){
return findNearestVacantArea(pixelX,pixelY,spanX,spanY,spanX,spanY,result,null);
}
| Find a vacant area that will fit the given bounds nearest the requested cell location. Uses Euclidean distance to score multiple vacant areas. |
public FileShareQuotaDirectory(QuotaDirectory qtree){
_id=qtree.getId();
_name=qtree.getName();
_securityStyle=qtree.getSecurityStyle();
_oplock=qtree.getOpLock();
_size=qtree.getSize();
this.softLimit=qtree.getSoftLimit();
this.softGrace=qtree.getSoftGrace();
this.notificationLimit=qtree.getNotificatio... | Construction of FileShareQtree |
public TextSimilarityScore_Type(JCas jcas,Type casType){
super(jcas,casType);
casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType,getFSGenerator());
casFeat_Score=jcas.getRequiredFeatureDE(casType,"Score","uima.cas.Double",featOkTst);
casFeatCode_Score=(null == casFeat_Score) ? JCas.INVALID_... | initialize variables to correspond with Cas Type and Features |
@Override public void translate(final ITranslationEnvironment environment,final IInstruction instruction,final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment,instruction,instructions,"SXTB");
translateAll(environment,instruction,"SX... | SXTB{<cond>} <Rd>, <Rm>{, <rotation>} Operation: if ConditionPassed(cond) then operand2 = Rm Rotate_Right(8 * rotate) Rd[31:0] = SignExtend(operand2[7:0]) |
private static byte[] copyOfRange(byte[] from,int start,int end){
int length=end - start;
byte[] result=new byte[length];
System.arraycopy(from,start,result,0,length);
return result;
}
| Copy the elements from the start to the end |
public Rational subtract(Rational secondRational){
long n=r[0] * secondRational.getDenominator() - r[1] * secondRational.getNumerator();
long d=r[1] * secondRational.getDenominator();
return new Rational(n,d);
}
| Subtract a rational number from this rational |
public void onCreate(Bundle savedInstanceState){
mSlidingMenu=(SlidingMenu)LayoutInflater.from(mActivity).inflate(R.layout.view_slidingmenu_main,null);
}
| Sets mSlidingMenu as a newly inflated SlidingMenu. Should be called within the activitiy's onCreate() |
public void stop(){
this.server.stop();
}
| Stops the SMTP Server |
private static OFActionSetDlSrc decode_set_src_mac(String actionToDecode,OFVersion version,Logger log){
Matcher n=Pattern.compile("(?:(\\p{XDigit}+)\\:(\\p{XDigit}+)\\:(\\p{XDigit}+)\\:(\\p{XDigit}+)\\:(\\p{XDigit}+)\\:(\\p{XDigit}+))").matcher(actionToDecode);
if (n.matches()) {
MacAddress macaddr=MacAddress.o... | Parse set_dl_src actions. The key and delimiter for the action should be omitted, and only the data should be presented to this decoder. TODO should consider using MacAddress's built-in parser.... |
protected Map<String,List<String>> addKeys(){
Map<String,List<String>> keys=new HashMap<>();
for (int i=0; i < gridCount(); ++i) keys.put(grid(i).name(),new ArrayList<String>());
for (int i=0; i < 500; ++i) {
String key="key" + i;
Ignite g=primaryIgnite(key);
g.cache(cacheName()).put(key,"value" + i... | Add 500 keys to cache only on primaries nodes. |
private void processImage(long productKey,VOImageResource voImageResource) throws ValidationException {
if (voImageResource == null) {
return;
}
if (voImageResource.getImageType() == null || voImageResource.getImageType().getOwnerType() != ImageOwnerType.SERVICE) {
SaaSSystemException se=new SaaSSystemExc... | Save or delete the images resource in/from the database |
protected static void printComponentProperties(Vector components,PropertyHandler ph,PrintStream ps,Properties createdProperties){
boolean buildConfiguredApplication=true;
boolean componentListBuilt=false;
Object someObj;
int numComponents=0;
String markerName;
String componentProperty=PropertyHandler.compon... | A helper function to createOpenMapProperties that gets the current properties of the given components and prints them out to the PrintStream and the provided Properties object. |
public void clearSounds(){
mSoundMap.clear();
}
| Clears all of the previously set sounds and events. |
public Request createGetRequest(String string,final Request oldRequest) throws IOException {
string=this.getURL(string);
boolean sendref=true;
if (this.currentURL == null) {
sendref=false;
this.currentURL=string;
}
final GetRequest request=new GetRequest(string);
request.setCustomCharset(this.custom... | Creates a new GET request. |
private void initPanel(){
final JPanel mainPanel=new JPanel(new BorderLayout());
mainPanel.setBorder(new TitledBorder("Edit Outdegree Condition"));
final JPanel operatorPanel=new JPanel(new BorderLayout());
operatorPanel.setBorder(new EmptyBorder(5,5,5,5));
final JPanel inputPanel=new JPanel(new BorderLayout(... | Creates the GUI of the panel. |
public Drawable createIconThumbnail(Drawable icon){
int width=mIconWidth;
int height=mIconHeight;
final int iconWidth=icon.getIntrinsicWidth();
final int iconHeight=icon.getIntrinsicHeight();
if (icon instanceof PaintDrawable) {
PaintDrawable painter=(PaintDrawable)icon;
painter.setIntrinsicWidth(widt... | Returns a Drawable representing the thumbnail of the specified Drawable. The size of the thumbnail is defined by the dimension android.R.dimen.launcher_application_icon_size. This method is not thread-safe and should be invoked on the UI thread only. |
public Entry copy(){
Entry e=new Entry(mVal,mXIndex,mData);
return e;
}
| returns an exact copy of the entry |
private static boolean isController(ResourceMethod method){
return method.getInvocable().getDefinitionMethod().isAnnotationPresent(Controller.class);
}
| Determines if a resource method is a controller. |
public boolean isGrowable(){
return growable;
}
| Gets the value of the growable property. |
public void removeToken(String tokenName){
tokenValues.remove(tokenName);
}
| Removes a given token. |
public static org.oscm.vo.VOOrganization convertToApi(org.oscm.internal.vo.VOOrganization oldVO){
if (oldVO == null) {
return null;
}
org.oscm.vo.VOOrganization newVO=new org.oscm.vo.VOOrganization();
newVO.setKey(oldVO.getKey());
newVO.setVersion(oldVO.getVersion());
newVO.setOrganizationId(oldVO.getOr... | Convert source version VO to target version VO. |
public static Name shortName(Name classname){
return classname.subName(classname.lastIndexOf((byte)'.') + 1,classname.getByteLength());
}
| Return the last part of a class name. |
public boolean isFindGroups(){
return findGroups;
}
| Gets the value of the findGroups property. |
public AssignmentOperator createAssignmentOperatorFromString(EDataType eDataType,String initialValue){
AssignmentOperator result=AssignmentOperator.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '"+ eDataType.getName()+ "'")... | <!-- begin-user-doc --> <!-- end-user-doc --> |
@RequestMapping(value="/{tableNames}/cardinality",method={RequestMethod.PUT}) @ResponseBody public CardinalityRequest generateCardinality(@PathVariable String tableNames,@RequestBody CardinalityRequest request){
String submitter=SecurityContextHolder.getContext().getAuthentication().getName();
String[] tables=table... | Regenerate table cardinality |
public HostAddresses(InetAddress[] inetAddresses){
if (inetAddresses == null) {
addresses=null;
return;
}
addresses=new HostAddress[inetAddresses.length];
for (int i=0; i < inetAddresses.length; i++) addresses[i]=new HostAddress(inetAddresses[i]);
}
| Creates a new HostAddresses instance from the supplied list of InetAddresses. |
private boolean isCsrfEnabled(){
final Object value=config.getProperty(Csrf.CSRF_PROTECTION);
return value != null ? ((Csrf.CsrfOptions)value) != Csrf.CsrfOptions.OFF : false;
}
| Determines if CSRF is enabled in the application. |
protected void stopWithErrorMessage(String error,Exception ex){
stop();
if (m_log != null) {
m_log.statusMessage(statusMessagePrefix() + error + " - see log for details");
m_log.logMessage(statusMessagePrefix() + error + (ex != null ? " " + ex.getMessage() : ""));
}
}
| Stops the step (and upstream ones) and then prints an error message and optional exception message |
private void drawX(Canvas canvas,Paint paint,float x,float y){
canvas.drawLine(x - size,y - size,x + size,y + size,paint);
canvas.drawLine(x + size,y - size,x - size,y + size,paint);
}
| The graphical representation of an X point shape. |
public boolean isSetHeader(){
return this.header != null;
}
| Returns true if field header is set (has been assigned a value) and false otherwise |
public static MutableSet<Integer> toSet(int from,int to){
MutableSet<Integer> targetCollection=UnifiedSet.newSet();
Interval.fromTo(from,to).forEach(CollectionAddProcedure.on(targetCollection));
return targetCollection;
}
| Returns an Set representing the Integer values from the value from to the value to. |
public void clear(){
size=0;
}
| Removes all entries from the PriorityQueue. |
public static long[] generate(int messageSize,int crcSize,long polynomial,long initialFill,boolean includeCRCBitErrors,Parity parity){
long[] table=generate(messageSize,crcSize,polynomial,initialFill,includeCRCBitErrors);
if (parity == Parity.NONE) {
return table;
}
else {
for (int x=0; x < table.length;... | Generates the checksum table and treats the final bit of each check value as a parity bit that complies with the request parity argument. |
public ImageData maskAlphaAsRoundedrectangle(ImageData imageData,Dimension corner,int alphaValue){
byte[] alphaData=imageData.alphaData;
int width=imageData.width;
int height=imageData.height;
int r=corner.width / 2;
double r_square=r * r;
byte[] alphaPixel=new byte[r];
Arrays.fill(alphaPixel,(byte)alphaV... | Masks the corners of a rounded rectangle with a specified alpha value. |
private int generateNonce(){
return RANDOM.nextInt();
}
| Generates a nonce (number used once). |
private static final int compareNaN(double a,double b){
if (a != a) {
if (b != b) return 0;
else return 1;
}
return -1;
}
| Compare two values, one of which is assumed to be Double.NaN |
protected boolean isEmptyTag(String tagName){
int i=0;
boolean found=false;
while ((i < EMPTY_TAGS.length) && (!found)) {
if (tagName.equals(EMPTY_TAGS[i])) {
found=true;
}
i++;
}
return found;
}
| Checks whether the specified tag is an empty tag as defined in EMPTY_TAGS |
public List<ValueBox> addArgumentHotspots(String signature,int arg,List<ValueBox> sigSpots){
logger.debug("For signature " + signature + " and arg "+ arg+ " got "+ sigSpots.size()+ " hotspots.");
if (!sigSpots.isEmpty()) {
addSignatureToHotspotMap(signature,new Hotspot(signature,arg,sigSpots));
hotspots.add... | Add a hotspot for matching calls. |
private void updateProgress(int progress){
if (myHost != null) {
myHost.updateProgress(progress);
}
else {
System.out.println("Progress: " + progress + "%");
}
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
private void printRunningTotal(PrintData pd,int levelNo,int rowNo){
if (m_runningTotalLines < 1) return;
log.fine("(" + m_runningTotalLines + ") - Row="+ rowNo+ ", mod="+ rowNo % m_runningTotalLines);
if (rowNo % m_runningTotalLines != 0) return;
log.fine("Row=" + rowNo);
PrintDataColumn pdc=null;
int s... | Print Running Total |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.