code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
|---|---|
public boolean skipLoadingRender(){
return skipRender;
}
|
Whether to skip the render loading of this crop
|
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-03-24 16:07:26.104 -0400",hash_original_method="379F3C8BA75588317558AB7BE5AA34A0",hash_generated_method="F163D1608D0123B45D0A1C14E95DFFF9") public synchronized boolean enable(boolean saveSetting){
mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,"Need BLUETOOTH_ADMIN permission");
if (mIsAirplaneSensitive && isAirplaneModeOn() && !mIsAirplaneToggleable) {
return false;
}
mBluetoothState.sendMessage(BluetoothAdapterStateMachine.USER_TURN_ON,saveSetting);
return true;
}
|
Enable this Bluetooth device, asynchronously. This turns on/off the underlying hardware.
|
public Set<K> keySet(){
if (keySet == null) {
keySet=new ReferenceKeySet<K,V>(this);
}
return keySet;
}
|
Returns a set view of this map's keys.
|
public ArbitraryBlock(ToplevelPane pane){
super("ArbitraryBlock",pane,pane.getEnvInstance().buildType("Arbitrary a => a"));
this.rngTrigger.setOnAction(null);
this.lastGenType=Optional.empty();
this.output.refreshType(new TypeScope());
this.getNextValue(this.hashCode(),false);
}
|
Constructs a new ArbitraryBlock
|
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:48.329 -0500",hash_original_method="F57C7EC559BF09EB03BA0EA2BC063E8F",hash_generated_method="37ED6A429AC93FABB5ECD6432523CB64") private void copyFieldAttributes(){
if ((loadFields == null) || fields == null) {
return;
}
for (int i=0; i < loadFields.length; i++) {
ObjectStreamField loadField=loadFields[i];
String name=loadField.getName();
for (int j=0; j < fields.length; j++) {
ObjectStreamField field=fields[j];
if (name.equals(field.getName())) {
loadField.setUnshared(field.isUnshared());
loadField.setOffset(field.getOffset());
break;
}
}
}
}
|
If a Class uses "serialPersistentFields" to define the serialized fields, this.loadFields cannot get the "unshared" information when deserializing fields using current implementation of ObjectInputStream. This method provides a way to copy the "unshared" attribute from this.fields.
|
public void installAppBundle(String code,String data){
try {
resultBuilder.build(code);
if (code.equals(Constants.OPERATION_INSTALL_APPLICATION)) {
JSONObject appData=new JSONObject(data);
installApplication(appData,code);
}
else if (code.equals(Constants.OPERATION_INSTALL_APPLICATION_BUNDLE)) {
JSONArray jArray=null;
jArray=new JSONArray(data);
for (int i=0; i < jArray.length(); i++) {
JSONObject appObj=(JSONObject)jArray.getJSONObject(i);
installApplication(appObj,code);
}
}
}
catch ( JSONException e) {
Log.e(TAG,"Invalid JSON format." + e);
}
}
|
Install application/bundle.
|
private boolean putInternal(String variable,Object value){
Object oldValue=values.get(variable);
values.put(variable,value);
if (oldValue == null) {
return value != null;
}
else {
return !oldValue.equals(value);
}
}
|
sets the name of a property internally without triggering the notification mechanism. This method is useful for batch processing with a combined notifications at the end.
|
public void advanceProcessingTime(Instant newProcessingTime) throws Exception {
timerInternals.advanceProcessingTime(TimerCallback.NO_OP,newProcessingTime);
}
|
Advance the processing time to the specified time.
|
@Override public void removePropertyChangeListener(PropertyChangeListener listener){
m_propSupport.removePropertyChangeListener(listener);
}
|
Removes an object from the list of those that wish to be informed when the cost matrix changes.
|
protected void firstInit(Context context){
entityName=context.getEntityAttribute("name");
String s=context.getEntityAttribute(ON_ERROR);
if (s != null) onError=s;
initCache(context);
isFirstInit=false;
}
|
first time init call. do one-time operations here
|
public ConnectivityCheckServer(Agent parentAgent){
this.parentAgent=parentAgent;
logger=new Logger(classLogger,parentAgent.getLogger());
stunStack=this.parentAgent.getStunStack();
stunStack.getCredentialsManager().registerAuthority(this);
start();
}
|
Creates a new <tt>ConnectivityCheckServer</tt> setting <tt>parentAgent</tt> as the agent that will be used for retrieving information such as user fragments for example.
|
public static final Field MASK_COLUMN(int length){
if (length <= 0) throw new IllegalArgumentException("The mask length must be positive");
return Field.create("column.mask.with." + length + ".chars").withValidation(null).withDescription("A comma-separated list of regular expressions matching fully-qualified names of columns that should " + "be masked with " + length + " asterisk ('*') characters.");
}
|
Method that generates a Field for specifying that string columns whose names match a set of regular expressions should have their values masked by the specified number of asterisk ('*') characters.
|
private boolean isDelimiter() throws JasperException {
if (!isSpace()) {
int ch=peekChar();
if (ch == '=' || ch == '>' || ch == '"' || ch == '\'' || ch == '/') {
return true;
}
if (ch == '-') {
Mark mark=mark();
if (((ch=nextChar()) == '>') || ((ch == '-') && (nextChar() == '>'))) {
reset(mark);
return true;
}
else {
reset(mark);
return false;
}
}
return false;
}
else {
return true;
}
}
|
Parse utils - Is current character a token delimiter ? Delimiters are currently defined to be =, >, <, ", and ' or any any space character as defined by <code>isSpace</code>.
|
public static int determineSampleSize(ImageRequest imageRequest,EncodedImage encodedImage){
if (!EncodedImage.isMetaDataAvailable(encodedImage)) {
return DEFAULT_SAMPLE_SIZE;
}
float ratio=determineDownsampleRatio(imageRequest,encodedImage);
int sampleSize;
if (encodedImage.getImageFormat() == ImageFormat.JPEG) {
sampleSize=ratioToSampleSizeJPEG(ratio);
}
else {
sampleSize=ratioToSampleSize(ratio);
}
int maxDimension=Math.max(encodedImage.getHeight(),encodedImage.getWidth());
while (maxDimension / sampleSize > MAX_BITMAP_SIZE) {
if (encodedImage.getImageFormat() == ImageFormat.JPEG) {
sampleSize*=2;
}
else {
sampleSize++;
}
}
return sampleSize;
}
|
Get the factor between the dimensions of the encodedImage (actual image) and the ones of the imageRequest (requested size).
|
public static void build(PKIXBuilderParameters params) throws Exception {
CertPathBuilder builder=CertPathBuilder.getInstance("PKIX");
CertPathBuilderResult cpbr=builder.build(params);
}
|
Perform a PKIX build.
|
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
|
Load Meta Data
|
public void assertNotSame(Object expected,Object actual,String errorMessage){
TestUtils.assertNotSame(expected,actual,errorMessage);
}
|
This method just invokes the test utils method, it is here for convenience
|
public Builder(int resourceId){
setResourceId(resourceId);
}
|
Start building a request using the specified resource ID.
|
AttributeListAdapter(){
}
|
Construct a new adapter.
|
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 NumericalAddSubtractExpression createNumericalAddSubtractExpression(){
NumericalAddSubtractExpressionImpl numericalAddSubtractExpression=new NumericalAddSubtractExpressionImpl();
return numericalAddSubtractExpression;
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
protected String loadDocumentDetails(){
MOrder order=(MOrder)getPO();
setDateDoc(order.getDateOrdered());
setIsTaxIncluded(order.isTaxIncluded());
setAmount(AMTTYPE_Gross,order.getGrandTotal());
setAmount(AMTTYPE_Net,order.getTotalLines());
setAmount(AMTTYPE_Charge,order.getChargeAmt());
m_taxes=loadTaxes();
p_lines=loadLines(order);
return null;
}
|
Load Specific Document Details
|
public static void fastScrollToTop(RecyclerView recyclerView){
new FastScrollToTop(recyclerView);
}
|
Fast scroll-to-top with default parameters. Same as calling fastScrollToTop(recyclerView, 15, 5, 222);
|
public List<Element> append(String name,Collection<String> values){
List<Element> elements=new ArrayList<Element>(values.size());
for ( String value : values) {
elements.add(append(name,value));
}
return elements;
}
|
Adds multiple child elements, each with the same name.
|
public JBZipFile(File f,String encoding) throws IOException {
this.encoding=encoding;
archive=new RandomAccessFile(f,"rw");
try {
if (archive.length() > 0) {
populateFromCentralDirectory();
}
else {
getOutputStream();
}
}
catch ( IOException e) {
try {
archive.close();
}
catch ( IOException e2) {
}
throw e;
}
}
|
Opens the given file for reading, assuming the specified encoding for file names.
|
public boolean isClipped(){
return clipped;
}
|
Gets the clipped attribute of the ImageFill object
|
public void removeSeries(MatrixSeries series){
ParamChecks.nullNotPermitted(series,"series");
if (this.seriesList.contains(series)) {
series.removeChangeListener(this);
this.seriesList.remove(series);
fireDatasetChanged();
}
}
|
Removes a series from the collection. <P> Notifies all registered listeners that the dataset has changed. </p>
|
@Beta public static String toString(byte x){
return toString(x,10);
}
|
Returns a string representation of x, where x is treated as unsigned.
|
public Object runSafely(Catbert.FastStack stack) throws Exception {
Widget w=getWidget(stack);
return (w != null) ? w.getUntranslatedName() : null;
}
|
Returns the name of the specified Widget
|
protected void readLSD(){
width=readShort();
height=readShort();
final int packed=read();
gctFlag=(packed & 0x80) != 0;
gctSize=2 << (packed & 7);
bgIndex=read();
pixelAspect=read();
try {
mainPixels=new byte[width * height];
mainScratch=new int[width * height];
copyScratch=new int[width * height];
previousImage=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_4444);
currentImage=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_4444);
}
catch ( final OutOfMemoryError e) {
final int dimension=(width * height) / 2;
mainPixels=new byte[dimension];
mainScratch=new int[dimension];
copyScratch=new int[dimension];
previousImage=Bitmap.createBitmap(width / 2,height / 2,Bitmap.Config.ARGB_4444);
currentImage=Bitmap.createBitmap(width / 2,height / 2,Bitmap.Config.ARGB_4444);
}
}
|
Reads Logical Screen Descriptor
|
public NotificationChain basicSetExecModule(BootstrapModule newExecModule,NotificationChain msgs){
BootstrapModule oldExecModule=execModule;
execModule=newExecModule;
if (eNotificationRequired()) {
ENotificationImpl notification=new ENotificationImpl(this,Notification.SET,N4mfPackage.EXEC_MODULE__EXEC_MODULE,oldExecModule,newExecModule);
if (msgs == null) msgs=notification;
else msgs.add(notification);
}
return msgs;
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
public String removeClassColumnTipText(){
return "Remove the class column (if set) from the data.";
}
|
Returns the tip text for this property
|
public void removeCardOffer(Offer offer){
((AcceptedOfferBinder)getDataBinder(TYPE_CARDS)).remove(offer);
}
|
Remove a card offer from the accepted offer binder.
|
public DetectorResult detect() throws NotFoundException {
ResultPoint[] cornerPoints=rectangleDetector.detect();
ResultPoint pointA=cornerPoints[0];
ResultPoint pointB=cornerPoints[1];
ResultPoint pointC=cornerPoints[2];
ResultPoint pointD=cornerPoints[3];
List<ResultPointsAndTransitions> transitions=new ArrayList<ResultPointsAndTransitions>(4);
transitions.add(transitionsBetween(pointA,pointB));
transitions.add(transitionsBetween(pointA,pointC));
transitions.add(transitionsBetween(pointB,pointD));
transitions.add(transitionsBetween(pointC,pointD));
Collections.sort(transitions,new ResultPointsAndTransitionsComparator());
ResultPointsAndTransitions lSideOne=transitions.get(0);
ResultPointsAndTransitions lSideTwo=transitions.get(1);
Map<ResultPoint,Integer> pointCount=new HashMap<ResultPoint,Integer>();
increment(pointCount,lSideOne.getFrom());
increment(pointCount,lSideOne.getTo());
increment(pointCount,lSideTwo.getFrom());
increment(pointCount,lSideTwo.getTo());
ResultPoint maybeTopLeft=null;
ResultPoint bottomLeft=null;
ResultPoint maybeBottomRight=null;
for ( Map.Entry<ResultPoint,Integer> entry : pointCount.entrySet()) {
ResultPoint point=entry.getKey();
Integer value=entry.getValue();
if (value == 2) {
bottomLeft=point;
}
else {
if (maybeTopLeft == null) {
maybeTopLeft=point;
}
else {
maybeBottomRight=point;
}
}
}
if (maybeTopLeft == null || bottomLeft == null || maybeBottomRight == null) {
throw NotFoundException.getNotFoundInstance();
}
ResultPoint[] corners={maybeTopLeft,bottomLeft,maybeBottomRight};
ResultPoint.orderBestPatterns(corners);
ResultPoint bottomRight=corners[0];
bottomLeft=corners[1];
ResultPoint topLeft=corners[2];
ResultPoint topRight;
if (!pointCount.containsKey(pointA)) {
topRight=pointA;
}
else if (!pointCount.containsKey(pointB)) {
topRight=pointB;
}
else if (!pointCount.containsKey(pointC)) {
topRight=pointC;
}
else {
topRight=pointD;
}
int dimensionTop=transitionsBetween(topLeft,topRight).getTransitions();
int dimensionRight=transitionsBetween(bottomRight,topRight).getTransitions();
if ((dimensionTop & 0x01) == 1) {
dimensionTop++;
}
dimensionTop+=2;
if ((dimensionRight & 0x01) == 1) {
dimensionRight++;
}
dimensionRight+=2;
BitMatrix bits;
ResultPoint correctedTopRight;
if (4 * dimensionTop >= 7 * dimensionRight || 4 * dimensionRight >= 7 * dimensionTop) {
correctedTopRight=correctTopRightRectangular(bottomLeft,bottomRight,topLeft,topRight,dimensionTop,dimensionRight);
if (correctedTopRight == null) {
correctedTopRight=topRight;
}
dimensionTop=transitionsBetween(topLeft,correctedTopRight).getTransitions();
dimensionRight=transitionsBetween(bottomRight,correctedTopRight).getTransitions();
if ((dimensionTop & 0x01) == 1) {
dimensionTop++;
}
if ((dimensionRight & 0x01) == 1) {
dimensionRight++;
}
bits=sampleGrid(image,topLeft,bottomLeft,bottomRight,correctedTopRight,dimensionTop,dimensionRight);
}
else {
int dimension=Math.min(dimensionRight,dimensionTop);
correctedTopRight=correctTopRight(bottomLeft,bottomRight,topLeft,topRight,dimension);
if (correctedTopRight == null) {
correctedTopRight=topRight;
}
int dimensionCorrected=Math.max(transitionsBetween(topLeft,correctedTopRight).getTransitions(),transitionsBetween(bottomRight,correctedTopRight).getTransitions());
dimensionCorrected++;
if ((dimensionCorrected & 0x01) == 1) {
dimensionCorrected++;
}
bits=sampleGrid(image,topLeft,bottomLeft,bottomRight,correctedTopRight,dimensionCorrected,dimensionCorrected);
}
return new DetectorResult(bits,new ResultPoint[]{topLeft,bottomLeft,bottomRight,correctedTopRight});
}
|
<p>Detects a Data Matrix Code in an image.</p>
|
public final void op(String channel,String nick){
this.setMode(channel,"+o " + nick);
}
|
Grants operator privilidges to a user on a channel. Successful use of this method may require the bot to have operator status itself.
|
public static void cleanup(Class<? extends Driver> driverClass){
ClassLoader pluginClassLoader=driverClass.getClassLoader();
if (pluginClassLoader == null) {
LOG.warn("PluginClassLoader is null. Cleanup not necessary.");
return;
}
shutDownMySQLAbandonedConnectionCleanupThread(pluginClassLoader);
unregisterOracleMBean(pluginClassLoader);
}
|
Performs any Database related cleanup
|
public static String readAll(final File file) throws IOException {
try (InputStream input=new FileInputStream(file)){
return readAll(input);
}
}
|
Read all of a File into a String.
|
protected void showTableView(){
(new SelectionTableWindow(context)).setVisible(true);
}
|
Show a tabular view
|
@HLEFunction(nid=0x20FFF560,version=150,checkInsideInterrupt=true) public int sceKernelCreateVTimer(String name,@CanBeNull TPointer optAddr){
SceKernelVTimerInfo sceKernelVTimerInfo=new SceKernelVTimerInfo(name);
vtimers.put(sceKernelVTimerInfo.uid,sceKernelVTimerInfo);
return sceKernelVTimerInfo.uid;
}
|
Create a virtual timer
|
public static double distance(double lat1,double lat2,double lon1,double lon2,double el1,double el2){
final int R=6371;
Double latDistance=deg2rad(lat2 - lat1);
Double lonDistance=deg2rad(lon2 - lon1);
Double a=Math.sin(latDistance / 2) * Math.sin(latDistance / 2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(lonDistance / 2)* Math.sin(lonDistance / 2);
Double c=2 * Math.atan2(Math.sqrt(a),Math.sqrt(1 - a));
double distance=R * c * 1000;
double height=el1 - el2;
distance=Math.pow(distance,2) + Math.pow(height,2);
return Math.sqrt(distance);
}
|
Calculate distance between two points in latitude and longitude taking into account height difference. If you are not interested in height difference pass 0.0. Uses Haversine method as its base. <p/> lat1, lon1 Start point lat2, lon2 End point el1 Start altitude in meters el2 End altitude in meters
|
public Task delete(String clusterId) throws IOException {
String path=String.format("%s/%s",getBasePath(),clusterId);
HttpResponse response=this.restClient.perform(RestClient.Method.DELETE,path,null);
this.restClient.checkResponse(response,HttpStatus.SC_CREATED);
return parseTaskFromHttpResponse(response);
}
|
Delete the specified cluster.
|
protected int execJava(StringList args){
return exec(javaExecutable,args);
}
|
Execute java in a separate process, but using the java executable of the current JRE.
|
public void tabShown(Tab tab){
for (int i=0; i < mRecentTabs.size(); i++) {
Tab t=mRecentTabs.get(i).get();
if (t == tab) {
mRecentTabs.remove(i);
}
}
}
|
Call this whenever a tab is shown.
|
public int scanLiteral(int quote,XMLString content) throws IOException {
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0,true);
}
else if (fCurrentEntity.position == fCurrentEntity.count - 1) {
fCurrentEntity.ch[0]=fCurrentEntity.ch[fCurrentEntity.count - 1];
load(1,false);
fCurrentEntity.position=0;
}
int offset=fCurrentEntity.position;
int c=fCurrentEntity.ch[offset];
int newlines=0;
boolean external=fCurrentEntity.isExternal();
if (c == '\n' || (c == '\r' && external)) {
do {
c=fCurrentEntity.ch[fCurrentEntity.position++];
if (c == '\r' && external) {
newlines++;
fCurrentEntity.lineNumber++;
fCurrentEntity.columnNumber=1;
if (fCurrentEntity.position == fCurrentEntity.count) {
offset=0;
fCurrentEntity.position=newlines;
if (load(newlines,false)) {
break;
}
}
if (fCurrentEntity.ch[fCurrentEntity.position] == '\n') {
fCurrentEntity.position++;
offset++;
}
else {
newlines++;
}
}
else if (c == '\n') {
newlines++;
fCurrentEntity.lineNumber++;
fCurrentEntity.columnNumber=1;
if (fCurrentEntity.position == fCurrentEntity.count) {
offset=0;
fCurrentEntity.position=newlines;
if (load(newlines,false)) {
break;
}
}
}
else {
fCurrentEntity.position--;
break;
}
}
while (fCurrentEntity.position < fCurrentEntity.count - 1);
for (int i=offset; i < fCurrentEntity.position; i++) {
fCurrentEntity.ch[i]='\n';
}
int length=fCurrentEntity.position - offset;
if (fCurrentEntity.position == fCurrentEntity.count - 1) {
content.setValues(fCurrentEntity.ch,offset,length);
return -1;
}
}
while (fCurrentEntity.position < fCurrentEntity.count) {
c=fCurrentEntity.ch[fCurrentEntity.position++];
if ((c == quote && (!fCurrentEntity.literal || external)) || c == '%' || !XMLChar.isContent(c)) {
fCurrentEntity.position--;
break;
}
}
int length=fCurrentEntity.position - offset;
fCurrentEntity.columnNumber+=length - newlines;
content.setValues(fCurrentEntity.ch,offset,length);
if (fCurrentEntity.position != fCurrentEntity.count) {
c=fCurrentEntity.ch[fCurrentEntity.position];
if (c == quote && fCurrentEntity.literal) {
c=-1;
}
}
else {
c=-1;
}
return c;
}
|
Scans a range of attribute value data, setting the fields of the XMLString structure, appropriately. <p> <strong>Note:</strong> The characters are consumed. <p> <strong>Note:</strong> This method does not guarantee to return the longest run of attribute value data. This method may return before the quote character due to reaching the end of the input buffer or any other reason. <p> <strong>Note:</strong> The fields contained in the XMLString structure are not guaranteed to remain valid upon subsequent calls to the entity scanner. Therefore, the caller is responsible for immediately using the returned character data or making a copy of the character data.
|
public CharacterEscapeSequence createCharacterEscapeSequence(){
CharacterEscapeSequenceImpl characterEscapeSequence=new CharacterEscapeSequenceImpl();
return characterEscapeSequence;
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
public final boolean isErrorEnabled(){
return isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR);
}
|
<p> Are error messages currently enabled? </p> <p> This allows expensive operations such as <code>String</code> concatenation to be avoided when the message will be ignored by the logger. </p>
|
public static String toString(JSONArray ja) throws JSONException {
JSONObject jo=ja.optJSONObject(0);
if (jo != null) {
JSONArray names=jo.names();
if (names != null) {
return rowToString(names) + toString(names,ja);
}
}
return null;
}
|
Produce a comma delimited text from a JSONArray of JSONObjects. The first row will be a list of names obtained by inspecting the first JSONObject.
|
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
doGet(request,response);
}
|
The doPost method of the servlet. <br> This method is called when a form has its tag value method equals to post.
|
static public double log10(double inValue){
return Math.log(inValue) / Math.log(10.0);
}
|
A static method that uses the natural log to obtain log to base10. This is required for the linear autoCalibrate but will also be used by a derived class giving a log transformed axis.
|
public void put(int key,double value){
int i=binarySearch(mKeys,0,mSize,key);
if (i >= 0) {
mValues[i]=value;
}
else {
i=~i;
if (mSize >= mKeys.length) {
int n=ArrayUtils.idealIntArraySize(mSize + 1);
int[] nkeys=new int[n];
double[] nvalues=new double[n];
System.arraycopy(mKeys,0,nkeys,0,mKeys.length);
System.arraycopy(mValues,0,nvalues,0,mValues.length);
mKeys=nkeys;
mValues=nvalues;
}
if (mSize - i != 0) {
System.arraycopy(mKeys,i,mKeys,i + 1,mSize - i);
System.arraycopy(mValues,i,mValues,i + 1,mSize - i);
}
mKeys[i]=key;
mValues[i]=value;
mSize++;
}
}
|
Adds a mapping from the specified key to the specified value, replacing the previous mapping from the specified key if there was one.
|
public EventBTreeTupleSerializer(final IKeyBuilderFactory keyBuilderFactory){
super(keyBuilderFactory);
}
|
Ctor when creating a new instance.
|
public ParallelCompositeReader(boolean closeSubReaders,CompositeReader[] readers,CompositeReader[] storedFieldReaders) throws IOException {
super(prepareLeafReaders(readers,storedFieldReaders));
this.closeSubReaders=closeSubReaders;
Collections.addAll(completeReaderSet,readers);
Collections.addAll(completeReaderSet,storedFieldReaders);
if (!closeSubReaders) {
for ( final IndexReader reader : completeReaderSet) {
reader.incRef();
}
}
completeReaderSet.addAll(getSequentialSubReaders());
}
|
Expert: create a ParallelCompositeReader based on the provided readers and storedFieldReaders; when a document is loaded, only storedFieldsReaders will be used.
|
public static void sort(float[] array){
DualPivotQuicksort.sort(array);
}
|
Sorts the specified array in ascending numerical order.
|
public String maxSubsequenceLengthTipText(){
return "The maximum subsequence length (theta in the paper)";
}
|
Returns the tip text for this property
|
@Deprecated public static String testServiceEndpointUrl(final String serviceEndpoint){
return normalizeEndpoint(serviceEndpoint);
}
|
Convenience method to allow the testing of the URL normalization functionality.
|
public Object runSafely(Catbert.FastStack stack) throws Exception {
return getCapDevInput(stack).getCrossName();
}
|
Returns the name of this CaptureDeviceInput connection without the CaptureDevice name prefixing it. This is not the same as the 'name' of the CaptureDeviceInput used as the parameter. The String that uniquely identifies a CaptureDeviceInput must always have the CaptureDevice's name included in it. Only use this return value for display purposes; do not use it for anything else.
|
public synchronized void leave(){
if (!joined) {
return;
}
Presence leavePresence=new Presence(Presence.Type.unavailable);
leavePresence.setTo(room + "/" + nickname);
for ( PacketInterceptor packetInterceptor : presenceInterceptors) {
packetInterceptor.interceptPacket(leavePresence);
}
connection.sendPacket(leavePresence);
occupantsMap.clear();
nickname=null;
joined=false;
userHasLeft();
}
|
Leave the chat room.
|
public synchronized void requestPreviewFrame(Handler handler,int message){
OpenCamera theCamera=camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler,message);
theCamera.getCamera().setOneShotPreviewCallback(previewCallback);
}
}
|
A single preview frame will be returned to the handler supplied. The data will arrive as byte[] in the message.obj field, with width and height encoded as message.arg1 and message.arg2, respectively.
|
public Builder discCacheExtraOptions(int maxImageWidthForDiscCache,int maxImageHeightForDiscCache,CompressFormat compressFormat,int compressQuality,BitmapProcessor processorForDiscCache){
this.maxImageWidthForDiscCache=maxImageWidthForDiscCache;
this.maxImageHeightForDiscCache=maxImageHeightForDiscCache;
this.imageCompressFormatForDiscCache=compressFormat;
this.imageQualityForDiscCache=compressQuality;
this.processorForDiscCache=processorForDiscCache;
return this;
}
|
Sets options for resizing/compressing of downloaded images before saving to disc cache.<br /> <b>NOTE: Use this option only when you have appropriate needs. It can make ImageLoader slower.</b>
|
public void checkRange(double[] range,int scale){
if (mChart instanceof XYChart) {
double[] calcRange=((XYChart)mChart).getCalcRange(scale);
if (calcRange != null) {
if (!mRenderer.isMinXSet(scale)) {
range[0]=calcRange[0];
mRenderer.setXAxisMin(range[0],scale);
}
if (!mRenderer.isMaxXSet(scale)) {
range[1]=calcRange[1];
mRenderer.setXAxisMax(range[1],scale);
}
if (!mRenderer.isMinYSet(scale)) {
range[2]=calcRange[2];
mRenderer.setYAxisMin(range[2],scale);
}
if (!mRenderer.isMaxYSet(scale)) {
range[3]=calcRange[3];
mRenderer.setYAxisMax(range[3],scale);
}
}
}
}
|
Sets the range to the calculated one, if not already set.
|
public static CommandResult execCommand(String command,boolean isRoot,boolean isNeedResultMsg){
return execCommand(new String[]{command},isRoot,isNeedResultMsg);
}
|
execute shell command
|
public void init(Allocator allocator){
this.allocator=allocator;
extractor.init(this);
}
|
Initializes the wrapper for use.
|
private ChangeFactory(){
}
|
Creates new ChangeFactory. No need
|
@Override public void run(){
amIActive=true;
String streamsHeader=null;
String pointerHeader=null;
String outputHeader=null;
int row, col, x, y;
float progress=0;
int i, c;
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[] inflowingVals=new double[]{16,32,64,128,1,2,4,8};
boolean flag=false;
double flowDir=0;
if (args.length <= 0) {
showFeedback("Plugin parameters have not been set.");
return;
}
for (i=0; i < args.length; i++) {
if (i == 0) {
streamsHeader=args[i];
}
else if (i == 1) {
pointerHeader=args[i];
}
else if (i == 2) {
outputHeader=args[i];
}
}
if ((streamsHeader == null) || (pointerHeader == null) || (outputHeader == null)) {
showFeedback("One or more of the input parameters have not been set properly.");
return;
}
try {
WhiteboxRaster streams=new WhiteboxRaster(streamsHeader,"r");
int rows=streams.getNumberRows();
int cols=streams.getNumberColumns();
double noData=streams.getNoDataValue();
WhiteboxRaster pntr=new WhiteboxRaster(pointerHeader,"r");
if (pntr.getNumberRows() != rows || pntr.getNumberColumns() != cols) {
showFeedback("The input images must be of the same dimensions.");
return;
}
WhiteboxRaster output=new WhiteboxRaster(outputHeader,"rw",streamsHeader,WhiteboxRaster.DataType.INTEGER,0);
output.setPreferredPalette("qual.pal");
output.setDataScale(WhiteboxRaster.DataScale.CATEGORICAL);
byte numNeighbouringStreamCells=0;
double currentID=0;
double currentValue=0;
for (row=0; row < rows; row++) {
for (col=0; col < cols; col++) {
if (streams.getValue(row,col) > 0) {
numNeighbouringStreamCells=0;
for (c=0; c < 8; c++) {
x=col + dX[c];
y=row + dY[c];
if (streams.getValue(y,x) > 0 && pntr.getValue(y,x) == inflowingVals[c]) {
numNeighbouringStreamCells++;
}
}
if (numNeighbouringStreamCells == 0) {
x=col;
y=row;
currentID++;
output.setValue(y,x,currentID);
flag=true;
do {
flowDir=pntr.getValue(y,x);
if (flowDir > 0) {
c=(int)(Math.log(flowDir) / LnOf2);
if (c > 7) {
showFeedback("An unexpected value has " + "been identified in the pointer " + "image. This tool requires a "+ "pointer grid that has been "+ "created using either the D8 "+ "or Rho8 tools.");
return;
}
x+=dX[c];
y+=dY[c];
if (streams.getValue(y,x) <= 0) {
flag=false;
}
else {
currentValue=output.getValue(y,x);
if (currentValue > 0) {
flag=false;
break;
}
numNeighbouringStreamCells=0;
int x2, y2;
for (int d=0; d < 8; d++) {
x2=x + dX[d];
y2=y + dY[d];
if (streams.getValue(y2,x2) > 0 && pntr.getValue(y2,x2) == inflowingVals[d]) {
numNeighbouringStreamCells++;
}
}
if (numNeighbouringStreamCells >= 2) {
currentID++;
}
output.setValue(y,x,currentID);
}
}
else {
if (streams.getValue(y,x) > 0) {
output.setValue(y,x,currentID);
}
flag=false;
}
}
while (flag);
}
}
else {
output.setValue(row,col,noData);
}
}
if (cancelOp) {
cancelOperation();
return;
}
progress=(float)(100f * row / (rows - 1));
updateProgress((int)progress);
}
output.addMetadataEntry("Created by the " + getDescriptiveName() + " tool.");
output.addMetadataEntry("Created on " + new Date());
pntr.close();
streams.close();
output.close();
returnData(outputHeader);
}
catch ( OutOfMemoryError oe) {
myHost.showFeedback("An out-of-memory error has occurred during operation.");
}
catch ( Exception e) {
myHost.showFeedback("An error has occurred during operation. See log file for details.");
myHost.logException("Error in " + getDescriptiveName(),e);
}
finally {
updateProgress("Progress: ",0);
amIActive=false;
myHost.pluginComplete();
}
}
|
Used to execute this plugin tool.
|
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
log.fine("");
HttpSession sess=request.getSession();
WWindowStatus ws=WWindowStatus.get(request);
if (ws == null) {
WebUtil.createTimeoutPage(request,response,this,null);
return;
}
String columnName=WebUtil.getParameter(request,"ColumnName");
log.info("ColumnName=" + columnName + " - "+ ws.toString());
GridField mField=ws.curTab.getField(columnName);
log.config("ColumnName=" + columnName + ", MField="+ mField);
if (mField == null || columnName == null || columnName.equals("")) {
WebUtil.createErrorPage(request,response,this,Msg.getMsg(ws.ctx,"ParameterMissing"));
return;
}
MLocation location=null;
Object value=mField.getValue();
if (value != null && value instanceof Integer) location=new MLocation(ws.ctx,((Integer)value).intValue(),null);
else location=new MLocation(ws.ctx,0,null);
String targetBase="opener.WWindow." + WWindow.FORM_NAME + "."+ columnName;
String action=request.getRequestURI();
WebDoc doc=WebDoc.createPopup(mField.getHeader());
doc.addPopupClose(ws.ctx);
boolean hasDependents=ws.curTab.hasDependants(columnName);
boolean hasCallout=mField.getCallout().length() > 0;
button reset=new button();
reset.addElement("Reset");
String script=targetBase + "D.value='';" + targetBase+ "F.value='';closePopup();";
if (hasDependents || hasCallout) script+="startUpdate(" + targetBase + "F);";
reset.setOnClick(script);
doc.getTable().addElement(new tr().addElement(fillForm(ws,action,location,targetBase,hasDependents || hasCallout)).addElement(reset));
doc.addPopupClose(ws.ctx);
WebUtil.createResponse(request,response,this,null,doc,true);
}
|
Process the HTTP Get request - initial Start Needs to have parameters FormName and ColumnName
|
private static int transpositions(final CharSequence first,final CharSequence second){
int transpositions=0;
for (int i=0; i < first.length(); i++) {
if (first.charAt(i) != second.charAt(i)) {
transpositions++;
}
}
return transpositions / 2;
}
|
Calculates the number of transposition between two strings.
|
public void asDate(MutableDateTime d){
if (length != 8) throw new FIXValueFormatException("Not a date");
int year=getDigits(4,offset + 0);
int monthOfYear=getDigits(2,offset + 4);
int dayOfMonth=getDigits(2,offset + 6);
d.setDateTime(year,monthOfYear,dayOfMonth,0,0,0,0);
}
|
Get the value as a date.
|
public int writeBytes(int index,byte[] b,int offset,int length){
return this.array.put(this.boundOffset(index),b,offset,this.boundLength(index,length));
}
|
Writes the bytes from the array.
|
public static URL[] findResourceBases(String baseResource,ClassLoader loader){
ArrayList<URL> list=new ArrayList<URL>();
try {
Enumeration<URL> urls=loader.getResources(baseResource);
while (urls.hasMoreElements()) {
URL url=urls.nextElement();
list.add(findResourceBase(url,baseResource));
}
}
catch ( IOException e) {
throw new RuntimeException(e);
}
return list.toArray(new URL[list.size()]);
}
|
Find the classpath URLs for a specific classpath resource. The classpath URL is extracted from loader.getResources() using the baseResource.
|
public static boolean isLowSurrogate(int c){
return (0xDC00 <= c && c <= 0xDFFF);
}
|
Returns whether the given character is a low surrogate
|
private void addFileUpload(String sessionId,FileUploadImpl filUpload){
if (sLogger.isActivated()) {
sLogger.debug("Add a file upload in the list (size=" + mFileUploadCache.size() + ")");
}
mFileUploadCache.put(sessionId,filUpload);
}
|
Add a file upload in the list
|
public void focusLocalField(){
}
|
Focused the editing field of the local comment. TODO(thomasdullien): Focusing still needs to be sorted & made visible somehow.
|
public void writeToFile(String walletInfoFilename,MultiBitWalletVersion walletVersion) throws WalletSaveException {
BufferedWriter out=null;
try {
HashMap<String,WalletAddressBookData> allReceivingAddresses=new HashMap<String,WalletAddressBookData>();
if (receivingAddresses != null) {
for ( WalletAddressBookData addressBookData : receivingAddresses) {
allReceivingAddresses.put(addressBookData.address,addressBookData);
}
}
out=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(walletInfoFilename),"UTF8"));
out.write(INFO_MAGIC_TEXT + SEPARATOR + INFO_VERSION_TEXT+ "\n");
out.write(WALLET_VERSION_MARKER + SEPARATOR + walletVersion.getWalletVersionString()+ "\n");
Collection<WalletAddressBookData> receiveAddressValues=allReceivingAddresses.values();
for ( WalletAddressBookData addressBookData : receiveAddressValues) {
String columnOne=RECEIVE_ADDRESS_MARKER;
String columnTwo=addressBookData.getAddress();
String columnThree=addressBookData.getLabel();
if (columnTwo == null) {
columnTwo="";
}
out.write(columnOne + SEPARATOR + columnTwo+ SEPARATOR+ encodeURLString(columnThree)+ "\n");
}
for ( WalletAddressBookData addressBookData : sendingAddresses) {
String columnOne=SEND_ADDRESS_MARKER;
String columnTwo=addressBookData.getAddress();
String columnThree=addressBookData.getLabel();
if (columnTwo == null) {
columnTwo="";
}
out.write(columnOne + SEPARATOR + columnTwo+ SEPARATOR+ encodeURLString(columnThree)+ "\n");
}
Properties walletPreferencesClone=new Properties();
walletPreferencesClone.putAll(walletPreferences);
walletPreferencesClone.remove(BitcoinModel.WALLET_FILE_SIZE);
walletPreferencesClone.remove(BitcoinModel.WALLET_FILE_LAST_MODIFIED);
walletPreferencesClone.remove(BitcoinModel.WALLET_INFO_FILE_SIZE);
walletPreferencesClone.remove(BitcoinModel.WALLET_INFO_FILE_LAST_MODIFIED);
walletPreferencesClone.remove(BitcoinModel.VALIDATION_ADDRESS_IS_INVALID);
walletPreferencesClone.remove(BitcoinModel.VALIDATION_ADDRESS_VALUE);
walletPreferencesClone.remove(BitcoinModel.VALIDATION_AMOUNT_IS_INVALID);
walletPreferencesClone.remove(BitcoinModel.VALIDATION_AMOUNT_IS_MISSING);
walletPreferencesClone.remove(BitcoinModel.VALIDATION_AMOUNT_IS_NEGATIVE_OR_ZERO);
walletPreferencesClone.remove(BitcoinModel.VALIDATION_AMOUNT_VALUE);
walletPreferencesClone.remove(BitcoinModel.VALIDATION_NOT_ENOUGH_FUNDS);
walletPreferencesClone.remove(BitcoinModel.SEND_PERFORM_PASTE_NOW);
walletPreferencesClone.remove("sendErrorMessage");
walletPreferencesClone.remove("sendWasSuccessful");
walletPreferencesClone.remove("earliestTransactionDate");
for ( Map.Entry entry : walletPreferencesClone.entrySet()) {
String columnOne=PROPERTY_MARKER;
String columnTwo=(String)entry.getKey();
String encodedColumnThree=encodeURLString((String)entry.getValue());
if (columnTwo == null) {
columnTwo="";
}
out.write(columnOne + SEPARATOR + columnTwo+ SEPARATOR+ encodedColumnThree+ "\n");
}
}
catch ( IOException ioe) {
throw new WalletSaveException("Could not write walletinfo file for wallet '" + walletInfoFilename + "'",ioe);
}
finally {
if (out != null) {
try {
out.close();
}
catch ( IOException e) {
throw new WalletSaveException("Could not close walletinfo file for wallet '" + walletInfoFilename + "'",e);
}
}
}
}
|
Write out the wallet info to the file specified as a parameter - a comma separated file format is used.
|
public static long parse(String s,boolean clamp){
if (s == null || s.length() == 0 || !Character.isDigit(s.charAt(0))) throw new NumberFormatException();
long value=0;
long ttl=0;
for (int i=0; i < s.length(); i++) {
char c=s.charAt(i);
long oldvalue=value;
if (Character.isDigit(c)) {
value=(value * 10) + Character.getNumericValue(c);
if (value < oldvalue) throw new NumberFormatException();
}
else {
switch (Character.toUpperCase(c)) {
case 'W':
value*=7;
case 'D':
value*=24;
case 'H':
value*=60;
case 'M':
value*=60;
case 'S':
break;
default :
throw new NumberFormatException();
}
ttl+=value;
value=0;
if (ttl > 0xFFFFFFFFL) throw new NumberFormatException();
}
}
if (ttl == 0) ttl=value;
if (ttl > 0xFFFFFFFFL) throw new NumberFormatException();
else if (ttl > MAX_VALUE && clamp) ttl=MAX_VALUE;
return ttl;
}
|
Parses a TTL-like value, which can either be expressed as a number or a BIND-style string with numbers and units.
|
public ZkClusterData fetchClusterHealth(Collection<String> collections) throws Exception {
Map<String,Map<String,String>> sourceCollectionToNodeMap=getZkClusterData().getCollectionToNodeMapping();
Set<SolrCore> cluterCoresStatus=new HashSet<SolrCore>();
try {
zookeeperHandle=ZKConnectionManager.connectToZookeeper(this.zkHost);
setZookeeperHandle(zookeeperHandle);
for ( String sourceCollection : collections) {
fetchCoreHealthStatus(sourceCollectionToNodeMap,cluterCoresStatus,sourceCollection);
}
}
finally {
getZookeeperHandle().close();
}
getZkClusterData().setCluterCoresStatus(cluterCoresStatus);
return getZkClusterData();
}
|
Given a list of collections, retrieve its corresponding health status
|
public final CC maxWidth(String size){
hor.setSize(LayoutUtil.derive(hor.getSize(),null,null,ConstraintParser.parseUnitValue(size,true)));
return this;
}
|
The maximum size for the component. The value will override any value that is set on the component itself. <p> For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.
|
private static void logThreadInfo(LEVEL level,String curTag){
String msg="Thread: " + Thread.currentThread().getName();
if (isLog2ConsoleEnabled) {
log2Console(level,curTag,msg,null);
}
if (isLog2FileEnabled) {
log2File(level,curTag,msg,null);
}
}
|
log Thread Info 2 Console
|
public void deferFree(final long encodeAddr){
m_deferredFrees.add(encodeAddr);
}
|
For frees made against a shadowed FixedAlocator that is NOT owned by the context, the physical free must be deferred until the context is deshadowed or aborted.
|
public static boolean isRelationshipParsable(JsonNode dataNode){
return dataNode != null && dataNode.hasNonNull(JSONAPISpecConstants.ID) && dataNode.hasNonNull(JSONAPISpecConstants.TYPE) && !dataNode.get(JSONAPISpecConstants.ID).isContainerNode() && !dataNode.get(JSONAPISpecConstants.TYPE).isContainerNode();
}
|
Returns <code>true</code> in case 'DATA' note has 'ID' and 'TYPE' attributes.
|
@SuppressWarnings("unchecked") @Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case N4JSPackage.ABSTRACT_CASE_CLAUSE__STATEMENTS:
getStatements().clear();
getStatements().addAll((Collection<? extends Statement>)newValue);
return;
}
super.eSet(featureID,newValue);
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
public static TransitLine mergeTransitLine(TransitLine oldLine){
return mergeTransitLine(new TransitScheduleFactoryImpl(),oldLine);
}
|
Merges all routes of a transit line that have the same sequence of stops. Does not respect the time profile of the routes.
|
public void deleteStorageView(String viewName,String clusterName,Boolean[] viewFound) throws VPlexApiException {
s_logger.info("Request for storage view deletion on VPlex at {}",_baseURI);
_exportMgr.deleteStorageView(viewName,clusterName,viewFound);
s_logger.info("Storage view was found for deletion: {}",viewFound[0]);
}
|
Delete the storage view with the passed name and existence tracking parameter.
|
public final Node popAndTop(){
m_firstFree--;
m_map[m_firstFree]=null;
return (m_firstFree == 0) ? null : m_map[m_firstFree - 1];
}
|
Pop a node from the tail of the vector and return the top of the stack after the pop.
|
@Override public void startMonitoring(MonitoringJob monitoringJob,DistributedQueueItemProcessedCallback callback){
_logger.debug("Entering {}",Thread.currentThread().getStackTrace()[1].getMethodName());
synchronized (cacheLock) {
String storageSystemURI=monitoringJob.getId().toString();
_logger.info("storageSystemURI :{}",storageSystemURI);
try {
addIsilonDeviceIntoCache(storageSystemURI,callback);
}
catch ( Exception e) {
_logger.error(e.getMessage(),e);
}
}
_logger.debug("Exiting {}",Thread.currentThread().getStackTrace()[1].getMethodName());
}
|
Takes care monitoring for the given Isilon device after acquring lock from zooKeeper queue.
|
public DcwRecordFile(String name,boolean deferInit) throws FormatException {
this.filename=name;
if (!deferInit) {
finishInitialization();
}
}
|
Open a DcwRecordFile
|
private void returnData(Object ret){
if (myHost != null) {
myHost.returnData(ret);
}
}
|
Used to communicate a return object from a plugin tool to the main Whitebox user-interface.
|
public static boolean putBoolean(Context context,String key,boolean value){
SharedPreferences settings=context.getSharedPreferences(PREFERENCE_NAME,Context.MODE_PRIVATE);
SharedPreferences.Editor editor=settings.edit();
editor.putBoolean(key,value);
return editor.commit();
}
|
put boolean preferences
|
public DepthButton(String text){
super(text);
setContentAreaFilled(false);
}
|
Creates a new instance of DepthButton
|
public static Vector<?> create(Vector<String> markerNames,Properties properties){
return getInstance()._create(markerNames,null,properties,null,false);
}
|
Given a Vector of marker name Strings, and a Properties object, look in the Properties object for the markerName.class property to get a class name to create each object. Then, if the new objects are PropertyConsumers, use the marker name as a property prefix to get properties for that object out of the Properties.
|
public void refreshSpeakerButton(){
AudioManager audioManager=(AudioManager)VectorCallViewActivity.this.getSystemService(Context.AUDIO_SERVICE);
boolean isOn=audioManager.isSpeakerphoneOn();
Log.d(LOG_TAG,"## refreshSpeakerButton(): isOn=" + isOn);
int iconId=isOn ? R.drawable.ic_material_speaker_phone_pink_red : R.drawable.ic_material_speaker_phone_grey;
mSpeakerSelectionView.setImageResource(iconId);
VectorCallViewActivity.this.setVolumeControlStream(audioManager.getMode());
}
|
Update the mute speaker icon according to speaker status.
|
public static void gluLookAt(GL10 gl,float eyeX,float eyeY,float eyeZ,float centerX,float centerY,float centerZ,float upX,float upY,float upZ){
float[] scratch=sScratch;
synchronized (scratch) {
Matrix.setLookAtM(scratch,0,eyeX,eyeY,eyeZ,centerX,centerY,centerZ,upX,upY,upZ);
gl.glMultMatrixf(scratch,0);
}
}
|
Define a viewing transformation in terms of an eye point, a center of view, and an up vector.
|
public static void checkArgument(boolean expression,Object errorMessage){
if (!expression) {
throw new IllegalArgumentException(String.valueOf(errorMessage));
}
}
|
Ensures the truth of an expression involving one or more parameters to the calling method.
|
public Tanh(){
super(Number.class,Number.class);
}
|
Constructs a new node for calculating the hyperbolic tangent of a number.
|
public boolean isDisjoint(){
return matrix[Location.INTERIOR][Location.INTERIOR] == Dimension.FALSE && matrix[Location.INTERIOR][Location.BOUNDARY] == Dimension.FALSE && matrix[Location.BOUNDARY][Location.INTERIOR] == Dimension.FALSE && matrix[Location.BOUNDARY][Location.BOUNDARY] == Dimension.FALSE;
}
|
Returns <code>true</code> if this <code>IntersectionMatrix</code> is FF*FF****.
|
@Override public boolean isActive(){
return amIActive;
}
|
Used by the Whitebox GUI to tell if this plugin is still running.
|
public UpdateConstraintException(String message,DomainObjectExceptionBean bean){
super(message,bean);
}
|
Constructs a new exception with the specified detail message and bean for JAX-WS exception serialization.
|
public static boolean nullEquals(String s1,String s2){
return (s1 == null ? s2 == null : s1.equals(s2));
}
|
equals() with two strings where either could be null
|
void close(){
try {
stop=true;
JdbcUtils.closeSilently(conn);
if (socket != null) {
socket.close();
}
server.trace("Close");
}
catch ( Exception e) {
server.traceError(e);
}
conn=null;
socket=null;
server.remove(this);
}
|
Close this connection.
|
@SuppressWarnings("unchecked") public CFunctionFilterCreator(final IViewContainer module){
super(Lists.newArrayList(new CInstructionGenerator(module),new CBlockGenerator(),new CEdgeGenerator(),new CNameDescriptionGenerator<CViewWrapper>(module)));
m_component=new CFunctionFilterComponent(module);
}
|
Creates a new filter creator object.
|
public BufferedImage generateQRcode(String address,String amount,String label,int scaleFactor){
String bitcoinURI="";
try {
Address decodeAddress=null;
if (address != null && !"".equals(address) && this.bitcoinController.getMultiBitService() != null && this.bitcoinController.getModel().getNetworkParameters() != null) {
decodeAddress=new Address(this.bitcoinController.getModel().getNetworkParameters(),address);
}
if (decodeAddress != null && !"".equals(decodeAddress)) {
if (amount != null && !"".equals(amount)) {
CurrencyConverterResult converterResult=CurrencyConverter.INSTANCE.parseToBTCNotLocalised(amount);
if (converterResult.isBtcMoneyValid()) {
bitcoinURI=BitcoinURI.convertToBitcoinURI(decodeAddress,converterResult.getBtcMoney().getAmount().toBigInteger(),label,null);
}
else {
}
}
else {
bitcoinURI=BitcoinURI.convertToBitcoinURI(decodeAddress,null,label,null);
}
}
this.bitcoinController.getModel().setActiveWalletPreference(BitcoinModel.SEND_PERFORM_PASTE_NOW,"false");
}
catch ( IllegalArgumentException e) {
return null;
}
catch ( AddressFormatException e) {
return null;
}
ByteMatrix matrix;
try {
matrix=encode(bitcoinURI);
}
catch ( com.google.zxing.WriterException e) {
return null;
}
catch ( IllegalArgumentException e) {
return null;
}
int matrixWidth=matrix.getWidth();
int matrixHeight=matrix.getHeight();
int swatchWidth=matrixWidth * scaleFactor;
int swatchHeight=matrixHeight * scaleFactor;
BufferedImage image=new BufferedImage(swatchWidth,swatchHeight,BufferedImage.TYPE_INT_RGB);
for (int y=0; y < matrixHeight; y++) {
for (int x=0; x < matrixWidth; x++) {
byte imageValue=matrix.get(x,y);
for (int scaleX=0; scaleX < scaleFactor; scaleX++) {
for (int scaleY=0; scaleY < scaleFactor; scaleY++) {
image.setRGB(x * scaleFactor + scaleX,y * scaleFactor + scaleY,imageValue);
}
}
}
}
return image;
}
|
generate a QR code
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.