code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
|---|---|
public boolean isValid(DrawContext dc){
return this.verticalExaggeration == dc.getVerticalExaggeration() && (this.globeStateKey != null && globeStateKey.equals(dc.getGlobe().getGlobeStateKey(dc)));
}
|
Indicates whether this shape data's globe state and vertical exaggeration are the same as that in the current draw context.
|
public AuthenticationException(String message,Throwable cause){
super(message,cause);
}
|
Creates a new AuthenticationException with the specified detail message and cause.
|
public void clear(){
if (size() == 0) return;
buffer=new byte[buffer.length];
root.next=null;
pos=0;
length=0;
curr=root;
}
|
clear the content of the buffer
|
public ReilFunction(final com.google.security.zynamics.reil.ReilFunction function){
m_function=function;
m_graph=ReilGraphConverter.createReilGraph(function.getGraph());
}
|
Creates a new API REIL function object.
|
public void removeHostFromVcenterCluster(URI hostId,String stepId){
log.info("removeHostFromVcenterCluster {}",hostId);
Host host=null;
try {
WorkflowStepCompleter.stepExecuting(stepId);
host=_dbClient.queryObject(Host.class,hostId);
if (NullColumnValueGetter.isNullURI(host.getVcenterDataCenter())) {
log.info("datacenter is null, nothing to do");
WorkflowStepCompleter.stepSucceded(stepId);
return;
}
if (NullColumnValueGetter.isNullURI(host.getCluster())) {
log.warn("cluster is null, nothing to do");
WorkflowStepCompleter.stepSucceded(stepId);
return;
}
String taskId=UUID.randomUUID().toString();
Operation op=new Operation();
op.setResourceType(ResourceOperationTypeEnum.UPDATE_VCENTER_CLUSTER);
_dbClient.createTaskOpStatus(VcenterDataCenter.class,host.getVcenterDataCenter(),taskId,op);
AsyncTask task=new AsyncTask(VcenterDataCenter.class,host.getVcenterDataCenter(),taskId);
vcenterController.updateVcenterCluster(task,host.getCluster(),null,new URI[]{host.getId()},null);
log.info("Monitor remove host " + host.getHostName() + " update vCenter task...");
while (true) {
Thread.sleep(TASK_STATUS_POLL_FREQUENCY);
VcenterDataCenter vcenterDataCenter=_dbClient.queryObject(VcenterDataCenter.class,host.getVcenterDataCenter());
switch (Status.toStatus(vcenterDataCenter.getOpStatus().get(taskId).getStatus())) {
case ready:
log.info("vCenter update request succeeded");
WorkflowStepCompleter.stepSucceded(stepId);
return;
case error:
log.info("vCenter update request failed - Best effort only so consider success");
WorkflowStepCompleter.stepSucceded(stepId);
return;
case pending:
break;
}
}
}
catch (VcenterControllerException e) {
log.warn("VcenterControllerException when trying to removeHostFromVcenterCluster: " + e.getMessage(),e);
if (e.getCause() instanceof VcenterObjectNotFoundException) {
log.info("did not find the host, considering success");
WorkflowStepCompleter.stepSucceded(stepId);
}
else if (e.getCause() instanceof VcenterObjectConnectionException) {
log.info("host is not connected, considering success");
WorkflowStepCompleter.stepSucceded(stepId);
}
else {
log.error("failure " + e);
WorkflowStepCompleter.stepFailed(stepId,e);
}
}
catch (InternalException e) {
log.error("InternalException when trying to removeHostFromVcenterCluster: " + e.getMessage(),e);
WorkflowStepCompleter.stepFailed(stepId,e);
}
catch (Exception e) {
log.error("unexpected exception: " + e.getMessage(),e);
ServiceCoded serviceCoded=ComputeSystemControllerException.exceptions.unableToRemoveHostVcenterCluster(host != null ? host.getHostName() : hostId.toString(),e);
WorkflowStepCompleter.stepFailed(stepId,serviceCoded);
}
}
|
This will attempt to remove host from vCenter cluster.
|
private void broadcastNewFile(LocalFilesystemURL inputURL){
File file=new File(this.filesystemPathForURL(inputURL));
if (file.exists()) {
Activity activity=this.cordova.getActivity();
Context context=activity.getApplicationContext();
Uri uri=Uri.fromFile(file);
Intent intent=new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,uri);
context.sendBroadcast(intent);
}
}
|
Send broadcast of new file so files appear over MTP
|
public boolean contains(JsonElement element){
return elements.contains(element);
}
|
Returns true if this array contains the specified element.
|
public final int compareTo(EntryFile o){
if (timestampMillis < o.timestampMillis) return -1;
if (timestampMillis > o.timestampMillis) return 1;
if (file != null && o.file != null) return file.compareTo(o.file);
if (o.file != null) return -1;
if (file != null) return 1;
if (this == o) return 0;
if (hashCode() < o.hashCode()) return -1;
if (hashCode() > o.hashCode()) return 1;
return 0;
}
|
Sorts earlier EntryFile instances before later ones.
|
public boolean isEmpty(){
return size == 0;
}
|
Returns <tt>true</tt> if this list contains no elements.
|
private void zInternalSetLastValidTimeAndNotifyListeners(LocalTime newTime){
LocalTime oldTime=lastValidTime;
lastValidTime=newTime;
if (!PickerUtilities.isSameLocalTime(oldTime,newTime)) {
for ( TimeChangeListener timeChangeListener : timeChangeListeners) {
TimeChangeEvent timeChangeEvent=new TimeChangeEvent(this,oldTime,newTime);
timeChangeListener.timeChanged(timeChangeEvent);
}
firePropertyChange("time",oldTime,newTime);
}
}
|
zInternalSetLastValidTimeAndNotifyListeners, This should be called whenever we need to change the last valid time variable. This will store the supplied last valid time. If needed, this will notify all time change listeners that the time has been changed. This does not perform any other tasks besides those described here.
|
private void retreat(final Creature creature,final Entity enemy){
creature.clearPath();
creature.faceToward(enemy);
creature.setDirection(creature.getDirection().oppositeDirection());
if (creature.getZone().collides(creature,creature.getX() + creature.getDirection().getdx(),creature.getY() + creature.getDirection().getdy(),true)) {
if (Rand.rand(2) == 0) {
creature.setDirection(creature.getDirection().nextDirection());
}
else {
creature.setDirection(creature.getDirection().nextDirection().oppositeDirection());
}
}
creature.setSpeed(creature.getBaseSpeed());
creature.applyMovement();
}
|
Run away from an enemy.
|
static public List<String> readFile(File aFile){
List<String> contents=new ArrayList<String>();
BufferedReader input=null;
try {
input=new BufferedReader(new FileReader(aFile));
String line=null;
while ((line=input.readLine()) != null) {
if (!line.startsWith("@") && !line.startsWith("%") && !"".equals(line)) {
contents.add(line);
}
}
}
catch ( FileNotFoundException ex) {
ex.printStackTrace();
}
catch ( IOException ex) {
ex.printStackTrace();
}
finally {
try {
if (input != null) {
input.close();
}
}
catch ( IOException ex) {
ex.printStackTrace();
}
}
return contents;
}
|
Read lines from the given file.
|
public ListenableFuture<PaymentIncrementAck> incrementPayment(Coin size) throws ValueOutOfRangeException, IllegalStateException {
return incrementPayment(size,null,null);
}
|
Increments the total value which we pay the server. Note that the amount of money sent may not be the same as the amount of money actually requested. It can be larger if the amount left over in the channel would be too small to be accepted by the Bitcoin network. ValueOutOfRangeException will be thrown, however, if there's not enough money left in the channel to make the payment at all. Only one payment can be in-flight at once. You have to ensure you wait for the previous increase payment future to complete before incrementing the payment again.
|
public void distribute(int start,int remainder,int blockSize,int value){
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(remainder <= blockSize);
if (value <= remainder) {
data[start]+=value;
}
else {
data[start]+=remainder;
value-=remainder;
start++;
while (value >= blockSize) {
data[start]+=blockSize;
value-=blockSize;
start++;
}
data[start]+=value;
}
}
|
Distribute a value across a sequence of tiles. This handles the case when when an object spans two or more tiles and its value is to be attributed to each tile proportionally.
|
public EnumDeclaration addEnum(String name){
return addEnum(name,Modifier.PUBLIC);
}
|
Add a public enum to the types of this compilation unit
|
public List<String> copy(){
return new ArrayList<String>(warnings);
}
|
Creates a copy of this warnings list.
|
public FreeTextSuggester(Analyzer indexAnalyzer,Analyzer queryAnalyzer,int grams){
this(indexAnalyzer,queryAnalyzer,grams,DEFAULT_SEPARATOR);
}
|
Instantiate, using the provided indexing and lookup analyzers, with the specified model (2 = bigram, 3 = trigram, etc.).
|
public static void escapeRegex(CharSequence s,boolean asciiOnly,boolean embeddable,Appendable out) throws IOException {
new Escaper(s,embeddable ? REGEX_LITERAL_EMBEDDABLE_ESCAPES : REGEX_LITERAL_ESCAPES,asciiOnly ? NO_NON_ASCII : ALLOW_NON_ASCII,JS_ENCODER,out).escape();
}
|
Given a plain text string, write to out unquoted regular expression text that would match that substring and only that substring.
|
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.
|
public Criteria or(){
Criteria criteria=createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
|
This method was generated by MyBatis Generator. This method corresponds to the database table project_todo_status
|
@Override protected EClass eStaticClass(){
return N4JSPackage.Literals.IMPORT_DECLARATION;
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
private Support_TestWebData(String path,String type){
File file=new File(path);
testLength=file.length();
testLastModified=file.lastModified();
testName=file.getName();
testType=type;
testDir=file.isDirectory();
ByteArrayOutputStream out=new ByteArrayOutputStream();
FileInputStream in=null;
try {
in=new FileInputStream(file);
while (in.available() > 0) {
out.write(in.read());
}
in.close();
out.flush();
test0Data=out.toByteArray();
out.close();
test0DataAvailable=true;
return;
}
catch ( Exception e) {
e.printStackTrace();
}
finally {
try {
if (in != null) {
in.close();
}
if (out != null) {
out.close();
}
}
catch ( IOException e) {
}
}
}
|
Creates a data package with information used by the server when responding to requests
|
public void clear(){
count=0;
indices=new HashMap<String,Integer>();
}
|
Remove all entries.
|
protected void updatePage(){
setValid(isValid());
updateMessage();
updateValidationMessages();
}
|
Updates the page valid status, message and error table if needed.
|
private void updateProgress(String progressLabel,int progress){
if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) {
myHost.updateProgress(progressLabel,progress);
}
previousProgress=progress;
previousProgressLabel=progressLabel;
}
|
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
|
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
s.defaultWriteObject();
for (Node<K,V> n=findFirst(); n != null; n=n.next) {
V v=n.getValidValue();
if (v != null) {
s.writeObject(n.key);
s.writeObject(v);
}
}
s.writeObject(null);
}
|
Saves this map to a stream (that is, serializes it).
|
public void highlightLastRow(int row){
int lastrow=m_tableModel.getRowCount();
if (row == lastrow - 1) {
m_table.setRowSelectionInterval(lastrow - 1,lastrow - 1);
}
else {
m_table.setRowSelectionInterval(row + 1,row + 1);
}
m_table.setColumnSelectionInterval(0,0);
}
|
Highlight the last row in the table
|
private void print(String amt){
try {
System.out.println(amt + " = " + getAmtInWords(amt));
}
catch ( Exception e) {
e.printStackTrace();
}
}
|
Test Print
|
public Floor(){
super(Number.class,Number.class);
}
|
Constructs a new node for calculating the largest integer value that is less than or equal to a number.
|
public StochasticOscillatorSeries(Strategy strategy,String name,String type,String description,Boolean displayOnChart,Integer chartRGBColor,Boolean subChart){
super(strategy,name,type,description,displayOnChart,chartRGBColor,subChart);
}
|
Creates a new empty series. By default, items added to the series will be sorted into ascending order by period, and duplicate periods will not be allowed.
|
public final int size(){
return m_firstFree;
}
|
Get the length of the list.
|
public boolean fillIfLive(long timeout) throws IOException {
StreamImpl source=_source;
byte[] readBuffer=_readBuffer;
if (readBuffer == null || source == null) {
_readOffset=0;
_readLength=0;
return false;
}
if (_readOffset > 0) {
System.arraycopy(readBuffer,_readOffset,readBuffer,0,_readLength - _readOffset);
_readLength-=_readOffset;
_readOffset=0;
}
if (_readLength == readBuffer.length) return true;
int readLength=source.readTimeout(_readBuffer,_readLength,_readBuffer.length - _readLength,timeout);
if (readLength >= 0) {
_readLength+=readLength;
_position+=readLength;
if (_isEnableReadTime) _readTime=CurrentTime.currentTime();
return true;
}
else if (readLength == READ_TIMEOUT) {
return true;
}
else {
return false;
}
}
|
Fills the buffer with a timed read, testing for the end of file. Used for cases like comet to test if the read stream has closed.
|
public boolean isRange(){
Object oo=get_Value(COLUMNNAME_IsRange);
if (oo != null) {
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
|
Get Range.
|
protected void doCreatePointSymbols(FeatureMap featureMap,Collection<VPFSymbol> outCollection){
for ( Map.Entry<VPFSymbolKey,CombinedFeature> entry : featureMap.entrySet()) {
CombinedFeature feature=entry.getValue();
for ( VPFSymbolAttributes attr : this.getSymbolAttributes(feature,entry.getKey())) {
switch (attr.getFeatureType()) {
case POINT:
this.addPointSymbol(feature,attr,outCollection);
break;
case LABEL:
this.addTextLabel(feature,attr,outCollection);
break;
}
}
}
}
|
From MIL-DTL-89045A, section 3.5.3.1.1: A point feature may be symbolized as either a point symbol or as a text label or both. <p/> From MIL-HDBK-857A, section 6.5.3.1: For point features (e.g., buoys, beacons, lights) that are composed of several symbol components, displaying the components according to the row ids in the *sym.txt file will result in the properly constructed composite symbol.
|
public void init(SecureRandom random) throws IllegalArgumentException {
if (random != null) {
this.random=random;
}
else {
this.random=new SecureRandom();
}
}
|
Initialise the padder.
|
@Override public String toString(){
return " at " + this.index + " [character "+ this.character+ " line "+ this.line+ "]";
}
|
Make a printable string of this JSONTokener.
|
public LimitTokenPositionFilter(TokenStream in,int maxTokenPosition,boolean consumeAllTokens){
super(in);
if (maxTokenPosition < 1) {
throw new IllegalArgumentException("maxTokenPosition must be greater than zero");
}
this.maxTokenPosition=maxTokenPosition;
this.consumeAllTokens=consumeAllTokens;
}
|
Build a filter that limits the maximum position of tokens to emit.
|
public static String format(String format,Object... args){
return new Substituter(String.format(format,args)).toString();
}
|
Apply String.format first, and then pass through Substituter.
|
public void enableBasicProgress(long totalJobs){
mTotalJobs=totalJobs;
mBasicProgress=true;
Diagnostic.progress(mThreadPoolName + ": Starting " + mTotalJobs+ " Jobs");
}
|
Enable the basic progress output with the total number of jobs that this thread pool will process.
|
public static NetworkInfo fromVersion(final byte version){
for ( final NetworkInfo info : KNOWN_NETWORKS) {
if (version == info.getVersion()) {
return info;
}
}
throw new IllegalArgumentException(String.format("Invalid version '%d' is not a known network version",version));
}
|
Gets the network info from the version.
|
private void leaveBusy(){
}
|
Leave busy state.
|
public CoreDescriptor(String coreName,CoreDescriptor other){
this.coreContainer=other.coreContainer;
this.cloudDesc=other.cloudDesc;
this.instanceDir=other.instanceDir;
this.originalExtraProperties.putAll(other.originalExtraProperties);
this.originalCoreProperties.putAll(other.originalCoreProperties);
this.coreProperties.putAll(other.coreProperties);
this.substitutableProperties.putAll(other.substitutableProperties);
this.coreProperties.setProperty(CORE_NAME,coreName);
this.originalCoreProperties.setProperty(CORE_NAME,coreName);
this.substitutableProperties.setProperty(SOLR_CORE_PROP_PREFIX + CORE_NAME,coreName);
}
|
Create a new CoreDescriptor using the properties of an existing one
|
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
int row, col, x, y;
int progress=0;
double slope;
double z, z2;
int i, n;
int[] dX={1,1,1,0,-1,-1,-1,0};
int[] dY={-1,0,1,1,1,0,-1,-1};
int[] dX2={2,2,2,2,2,1,0,-1,-2,-2,-2,-2,-2,-1,0,1};
int[] dY2={-2,-1,0,1,2,2,2,2,2,1,0,-1,-2,-2,-2,-2};
int[] breachcell={0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,0};
double dist;
double gridRes;
if (args.length <= 0) {
showFeedback("Plugin parameters have not been set.");
return;
}
inputHeader=args[0];
outputHeader=args[1];
if ((inputHeader == null) || (outputHeader == null)) {
showFeedback("One or more of the input parameters have not been set properly.");
return;
}
try {
WhiteboxRaster DEM=new WhiteboxRaster(inputHeader,"r");
int rows=DEM.getNumberRows();
int cols=DEM.getNumberColumns();
double noData=DEM.getNoDataValue();
WhiteboxRaster output=new WhiteboxRaster(outputHeader,"rw",inputHeader,WhiteboxRaster.DataType.FLOAT,noData);
double[] data=null;
for (row=0; row < rows; row++) {
data=DEM.getRowValues(row);
for (col=0; col < cols; col++) {
output.setValue(row,col,data[col]);
}
if (cancelOp) {
cancelOperation();
return;
}
progress=(int)(100f * row / (rows - 1));
updateProgress("Loop 1 of 2:",progress);
}
for (row=0; row < rows; row++) {
for (col=0; col < cols; col++) {
z=DEM.getValue(row,col);
if (z != noData) {
n=0;
for (i=0; i < 8; i++) {
z2=DEM.getValue(row + dY[i],col + dX[i]);
if (z2 < z) {
n++;
}
}
if (n == 0) {
for (i=0; i < 16; i++) {
z2=DEM.getValue(row + dY2[i],col + dX2[i]);
if (z2 < z && z2 != noData) {
output.setValue(row + dY[breachcell[i]],col + dX[breachcell[i]],(z + z2) / 2);
}
}
}
}
}
if (cancelOp) {
cancelOperation();
return;
}
progress=(int)(100f * row / (rows - 1));
updateProgress("Loop 2 of 2:",progress);
}
output.addMetadataEntry("Created by the " + getDescriptiveName() + " tool.");
output.addMetadataEntry("Created on " + new Date());
DEM.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 AddMobileDevice(String DeviceId,String SenderId,MobileDeviceReceiver receiver){
MobileDeviceParser parser=new MobileDeviceParser(receiver);
String url=mDomoticzUrls.constructGetUrl(DomoticzValues.Json.Url.Request.ADD_MOBILE_DEVICE);
url+="&uuid=" + DeviceId;
url+="&senderid=" + SenderId;
RequestUtil.makeJsonGetRequest(parser,getUserCredentials(Authentication.USERNAME),getUserCredentials(Authentication.PASSWORD),url,mSessionUtil,false,1,queue);
}
|
Register you device on Domoticz
|
public SchemeMap(){
_schemeMap.set(new ConcurrentHashMap<String,SchemeRoot>(),null);
}
|
Create an empty SchemeMap.
|
protected void emit_FunctionDeclaration_SemiParserRuleCall_1_q(EObject semanticObject,ISynNavigable transition,List<INode> nodes){
acceptNodes(transition,nodes);
}
|
Ambiguous syntax: Semi? This ambiguous syntax occurs at: (rule start) 'function' '(' ')' (ambiguity) (rule start) body=Block (ambiguity) (rule end) declaredAsync?='async' NO_LINE_TERMINATOR? 'function' '(' ')' (ambiguity) (rule end) declaredModifiers+=N4Modifier 'function' '(' ')' (ambiguity) (rule end) fpars+=FormalParameter ')' (ambiguity) (rule end) generator?='*' '(' ')' (ambiguity) (rule end) name=BindingIdentifier '(' ')' (ambiguity) (rule end) returnTypeRef=TypeRef (ambiguity) (rule end) typeVars+=TypeVariable '>' '(' ')' (ambiguity) (rule end)
|
public Pair NE(){
int r2=row - 1;
if (r2 < 0) return null;
return new Pair(diagonal,r2);
}
|
Return NE location or null if invalid.
|
public InlineQueryResultDocument build(){
return new InlineQueryResultDocument(id,title,caption,document_url,mime_type,description,reply_markup,input_message_content,thumb_url,thumb_width,thumb_height);
}
|
Builds the InlineQueryResultDocument object
|
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 void clear(){
parameters=null;
}
|
Removes all parameters from this collection.
|
public void freeMemory(){
getInnerSources().freeMemory();
getInnerSinks().freeMemory();
}
|
Frees memory used by inner sinks.
|
private static void drawHandle(final Graphics g,final int x,int y){
g.setColor(ourColor1);
g.drawRect(x,y,HANDLE_ATOM_WIDTH - 1,HANDLE_ATOM_HEIGHT - 1);
UIUtil.drawLine(g,x + HANDLE_ATOM_WIDTH / 2,y + HANDLE_ATOM_HEIGHT,x + HANDLE_ATOM_WIDTH / 2,y + HANDLE_ATOM_HEIGHT + HANDLE_ATOM_SPACE - 1);
y+=HANDLE_ATOM_HEIGHT + HANDLE_ATOM_SPACE;
g.drawRect(x,y,HANDLE_ATOM_WIDTH - 1,HANDLE_ATOM_HEIGHT - 1);
UIUtil.drawLine(g,x + HANDLE_ATOM_WIDTH / 2,y + HANDLE_ATOM_HEIGHT,x + HANDLE_ATOM_WIDTH / 2,y + HANDLE_ATOM_HEIGHT + HANDLE_ATOM_SPACE - 1);
y+=HANDLE_ATOM_HEIGHT + HANDLE_ATOM_SPACE;
g.drawRect(x,y,HANDLE_ATOM_WIDTH - 1,HANDLE_ATOM_HEIGHT - 1);
}
|
Paints small spacer's haldle. <code>(x,y)</code> is a top left point of a handle.
|
public boolean isAddressedModePossible(){
return true;
}
|
Debug programmer does provide Ops Mode
|
public static byte[] serializeToBlob(Object obj) throws IOException {
return serializeToBlob(obj,null);
}
|
A blob is a serialized Object. This method serializes the object into a blob and returns the byte array that contains the blob.
|
public File parallelCorpus(){
return parallelCorpus;
}
|
Gets the parallel corpus.
|
public Object clone(){
return (html.clone());
}
|
Allows the XhtmlFrameSetDocument to be cloned. Doesn't return an instanceof XhtmlFrameSetDocument returns instance of html.
|
private void handleHtmlDoUserRestore(RequestAndResponse requestAndResponse) throws IOException, ServletException {
final Errors errors=new Errors();
final Part part=requestAndResponse.request.getPart("file");
final boolean reuseIds=getCheckBoxValue(requestAndResponse,"reuseIds");
final boolean msWordListFormat=getCheckBoxValue(requestAndResponse,"msWordListFormat");
final String csrft=requestAndResponse.getParameter("csrft");
addIFrameHeader(requestAndResponse);
if (isTheCsrftWrong(requestAndResponse,csrft)) {
requestAndResponse.print(servletText.errorRequiresSignIn(false));
}
else if (!isUserSignedIn(requestAndResponse)) {
requestAndResponse.print(servletText.errorRequiresSignIn(false));
}
else if (isUsersAccountClosed(requestAndResponse)) {
requestAndResponse.print(servletText.errorAccountIsClosed());
}
else if (part == null) {
requestAndResponse.print(servletText.errorNoFileUploaded());
}
else {
final InputStream stream=part.getInputStream();
final InputStreamReader streamReader=new InputStreamReader(stream,Charset.forName("UTF-8"));
boolean result=false;
if (msWordListFormat) {
result=dbLogic.restoreMsWordListFormatForUser(getEffectiveUserId(requestAndResponse),streamReader,isUserAnAdmin(requestAndResponse),errors);
}
else {
result=dbLogic.restoreJsonForUser(getEffectiveUserId(requestAndResponse),streamReader,reuseIds,isUserAnAdmin(requestAndResponse),errors);
}
if (!result) {
requestAndResponse.print(servletText.errorRestoreFailed() + "<br>");
for ( final String text : errors.getTexts()) {
requestAndResponse.print(text);
requestAndResponse.print("<br>");
}
}
else {
requestAndResponse.print(servletText.sentenceRestored());
}
requestAndResponse.print("<script type=\"text/javascript\">\n" + "history.replaceState(null, null, '/restoreFrame/');\n" + "</script>");
}
addIFrameFooter(requestAndResponse);
}
|
Part of the HTML API. Handle a restore.
|
private boolean adjustInstruction() throws IOException {
pos=c.localPosition();
newPos=map[pos];
int opcode=c.readU1();
if (Inject.verbose) {
traceln();
traceFixedWidthInt(pos,4);
traceFixedWidthInt(newPos,4);
trace(" ");
}
if (opcode == opc_wide) {
int wopcode=c.readU1();
int lvIndex=c.readU2();
if (Inject.verbose) {
trace(opcNames[wopcode] + "_w ");
}
switch (wopcode) {
case opc_aload:
case opc_astore:
case opc_fload:
case opc_fstore:
case opc_iload:
case opc_istore:
case opc_lload:
case opc_lstore:
case opc_dload:
case opc_dstore:
case opc_ret:
trace(lvIndex);
break;
case opc_iinc:
int constVal=c.readS2();
if (Inject.verbose) {
trace(lvIndex + " " + constVal);
}
break;
default :
throw new Error("Invalid wide opcode: " + wopcode);
}
}
else {
if (Inject.verbose) {
trace(opcNames[opcode]);
}
switch (opcode) {
case opc_tableswitch:
{
int widened=widening[pos];
int header=(pos + 1 + 3) & (~3);
int newHeader=(newPos + 1 + 3) & (~3);
c.skip(header - (pos + 1));
Span defaultSkip=new Span(c.readU4());
int low=c.readU4();
int high=c.readU4();
if (Inject.verbose) {
trace(" " + low + " to "+ high);
trace(": default= [was] " + defaultSkip.target);
trace(" [now] " + defaultSkip.newTarget);
for (int i=low; i <= high; ++i) {
Span jump=new Span(c.readU4());
traceln("");
trace('\t');
traceFixedWidthInt(i,5);
trace(": " + jump.newTarget);
}
}
else {
c.skip((high + 1 - low) * 4);
}
int newPadding=newHeader - newPos;
int oldPadding=header - pos;
int deltaPadding=newPadding - oldPadding;
if (widened != deltaPadding) {
widen(pos,deltaPadding);
return false;
}
break;
}
case opc_lookupswitch:
{
int widened=widening[pos];
int header=(pos + 1 + 3) & (~3);
int newHeader=(newPos + 1 + 3) & (~3);
c.skip(header - (pos + 1));
Span defaultSkip=new Span(c.readU4());
int npairs=c.readU4();
if (Inject.verbose) {
trace(" npairs: " + npairs);
trace(": default= [was] " + defaultSkip.target);
trace(" [now] " + defaultSkip.newTarget);
for (int i=0; i < npairs; ++i) {
int match=c.readU4();
Span jump=new Span(c.readU4());
traceln("");
trace('\t');
traceFixedWidthInt(match,5);
trace(": " + jump.newTarget);
}
}
else {
c.skip(npairs * 8);
}
int newPadding=newHeader - newPos;
int oldPadding=header - pos;
int deltaPadding=newPadding - oldPadding;
if (widened != deltaPadding) {
widen(pos,deltaPadding);
return false;
}
break;
}
case opc_jsr:
case opc_goto:
case opc_ifeq:
case opc_ifge:
case opc_ifgt:
case opc_ifle:
case opc_iflt:
case opc_ifne:
case opc_if_icmpeq:
case opc_if_icmpne:
case opc_if_icmpge:
case opc_if_icmpgt:
case opc_if_icmple:
case opc_if_icmplt:
case opc_if_acmpeq:
case opc_if_acmpne:
case opc_ifnull:
case opc_ifnonnull:
{
int widened=widening[pos];
Span jump=new Span(c.readS2());
if (widened == 0) {
int newDelta=jump.newDelta;
if ((newDelta < -32768) || (newDelta > 32767)) {
switch (opcode) {
case opc_jsr:
case opc_goto:
widen(pos,2);
break;
default :
widen(pos,5);
break;
}
return false;
}
}
if (Inject.verbose) {
trace(" [was] " + jump.target + " ==> "+ " [now] "+ jump.newTarget);
}
break;
}
case opc_jsr_w:
case opc_goto_w:
{
Span jump=new Span(c.readU4());
if (Inject.verbose) {
trace(" [was] " + jump.target + " [now] "+ jump.newTarget);
}
break;
}
default :
{
int instrLen=opcLengths[opcode];
c.skip(instrLen - 1);
break;
}
}
}
return true;
}
|
Walk one instruction adjusting for insertions
|
public void createDir(String fspath) throws IsilonException {
createDir(fspath,false);
}
|
Create a directory with the path specified, will fail if parent does not exist
|
protected void appendHTML(final StringBuilder sbuf,final String text){
final StringCharacterIterator ci=new StringCharacterIterator(text);
char ch=ci.current();
while (ch != CharacterIterator.DONE) {
appendHTML(sbuf,ch);
ch=ci.next();
}
}
|
Escape text as HTML, escaping meta-characters.
|
public void registerTableNodes(SnmpMib mib,MBeanServer server){
}
|
Register the group's SnmpMibTable objects with the meta-data.
|
public static List<? extends Element> childElementList(Element element){
if (element == null) return null;
List<Element> elements=new LinkedList<Element>();
Node node=element.getFirstChild();
if (node != null) {
do {
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element childElement=(Element)node;
elements.add(childElement);
}
}
while ((node=node.getNextSibling()) != null);
}
return elements;
}
|
Return a List of Element objects that are children of the given element
|
public JPAStreamingMailboxMessage(JPAMailbox mailbox,MessageUid uid,long modSeq,MailboxMessage message) throws MailboxException {
super(mailbox,uid,modSeq,message);
try {
this.content=new SharedByteArrayInputStream(IOUtils.toByteArray(message.getFullContent()));
this.header=getHeaderContent();
this.body=getBodyContent();
}
catch ( IOException e) {
throw new MailboxException("Unable to parse message",e);
}
}
|
Create a copy of the given message
|
@Override public void agg(double newVal){
valueSet.add(newVal);
firstTime=false;
}
|
just need to add the unique values to agg set
|
private CodePattern buildCodePattern_RANDOM_CODE(Attribute classLabel) throws OperatorException {
double multiplicator=getParameterAsDouble(PARAMETER_RANDOM_CODE_MULTIPLICATOR);
int numberOfClasses=classLabel.getMapping().size();
CodePattern codePattern=new CodePattern(numberOfClasses,(int)(numberOfClasses * multiplicator));
RandomGenerator randomGenerator=RandomGenerator.getRandomGenerator(this);
for (int i=0; i < codePattern.data.length; i++) {
for (int j=0; j < codePattern.data[0].length; j++) {
codePattern.data[i][j]="" + randomGenerator.nextBoolean();
}
}
for (int i=0; i < codePattern.data[0].length; i++) {
boolean containsNoOne=true, containsNoZero=true;
for (int j=0; j < codePattern.data.length; j++) {
if ("true".equals(codePattern.data[j][i])) {
containsNoOne=false;
}
else {
containsNoZero=false;
}
}
if (containsNoOne) {
codePattern.data[(int)(randomGenerator.nextDouble() * (codePattern.data.length - 1))][i]="true";
}
if (containsNoZero) {
codePattern.data[(int)(randomGenerator.nextDouble() * (codePattern.data.length - 1))][i]="false";
}
}
return codePattern;
}
|
Builds a code pattern according to the "random code" classification scheme.
|
protected void prepare(){
ProcessInfoParameter[] para=getParameter();
for (int i=0; i < para.length; i++) {
String name=para[i].getParameterName();
if (para[i].getParameter() == null) ;
else log.log(Level.SEVERE,"Unknown Parameter: " + name);
}
p_Record_ID=getRecord_ID();
}
|
Prepare - e.g., get Parameters.
|
@Override public V put(K key,V value){
if (key == null) return putForNullKey(value);
int hash=hash(key);
int i=indexFor(hash,table.length);
for (Entry<K,V> e=table[i]; e != null; e=e.next) {
Object k;
if (e.hash == hash && ((k=e.key) == key || key.equals(k))) {
V oldValue=e.value;
e.value=value;
e.recordAccess(this);
return oldValue;
}
}
modCount++;
addEntry(hash,key,value,i);
return null;
}
|
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.
|
protected InnerBuilder addHeaders(Map<String,String> headers){
String url=NULL_KEY_FOR_URL;
addHeadersWithUrl(url,headers);
return this;
}
|
add the custom headers for download
|
public static String escapeJS(String str,char quotesUsed,CharsetEncoder enc){
char[] arr=str.toCharArray();
StringBuilder rtn=new StringBuilder(arr.length);
rtn.append(quotesUsed);
for (int i=0; i < arr.length; i++) {
if (arr[i] < 128) {
switch (arr[i]) {
case '\\':
rtn.append("\\\\");
break;
case '\n':
rtn.append("\\n");
break;
case '\r':
rtn.append("\\r");
break;
case '\f':
rtn.append("\\f");
break;
case '\b':
rtn.append("\\b");
break;
case '\t':
rtn.append("\\t");
break;
case '"':
if (quotesUsed == '"') rtn.append("\\\"");
else rtn.append('"');
break;
case '\'':
if (quotesUsed == '\'') rtn.append("\\\'");
else rtn.append('\'');
break;
case '/':
if (i > 0 && arr[i - 1] == '<' && i + 1 < arr.length && arr[i + 1] == 's' && i + 2 < arr.length && arr[i + 2] == 'c' && i + 3 < arr.length && arr[i + 3] == 'r' && i + 4 < arr.length && arr[i + 4] == 'i' && i + 5 < arr.length && arr[i + 5] == 'p' && i + 6 < arr.length && arr[i + 6] == 't' && i + 7 < arr.length && (isWhiteSpace(arr[i + 7]) || arr[i + 7] == '>')) {
rtn.append("\\/");
break;
}
default :
rtn.append(arr[i]);
break;
}
}
else if (enc == null || !enc.canEncode(arr[i])) {
if (arr[i] < 0x10) rtn.append("\\u000");
else if (arr[i] < 0x100) rtn.append("\\u00");
else if (arr[i] < 0x1000) rtn.append("\\u0");
else rtn.append("\\u");
rtn.append(Integer.toHexString(arr[i]));
}
else {
rtn.append(arr[i]);
}
}
return rtn.append(quotesUsed).toString();
}
|
escapes JS sensitive characters
|
private void checkOffsetOrImageTag(ExifTag tag){
if (tag.getComponentCount() == 0) {
return;
}
short tid=tag.getTagId();
int ifd=tag.getIfd();
if (tid == TAG_EXIF_IFD && checkAllowed(ifd,ExifInterface.TAG_EXIF_IFD)) {
if (isIfdRequested(IfdId.TYPE_IFD_EXIF) || isIfdRequested(IfdId.TYPE_IFD_INTEROPERABILITY)) {
registerIfd(IfdId.TYPE_IFD_EXIF,tag.getValueAt(0));
}
}
else if (tid == TAG_GPS_IFD && checkAllowed(ifd,ExifInterface.TAG_GPS_IFD)) {
if (isIfdRequested(IfdId.TYPE_IFD_GPS)) {
registerIfd(IfdId.TYPE_IFD_GPS,tag.getValueAt(0));
}
}
else if (tid == TAG_INTEROPERABILITY_IFD && checkAllowed(ifd,ExifInterface.TAG_INTEROPERABILITY_IFD)) {
if (isIfdRequested(IfdId.TYPE_IFD_INTEROPERABILITY)) {
registerIfd(IfdId.TYPE_IFD_INTEROPERABILITY,tag.getValueAt(0));
}
}
else if (tid == TAG_JPEG_INTERCHANGE_FORMAT && checkAllowed(ifd,ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT)) {
if (isThumbnailRequested()) {
registerCompressedImage(tag.getValueAt(0));
}
}
else if (tid == TAG_JPEG_INTERCHANGE_FORMAT_LENGTH && checkAllowed(ifd,ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH)) {
if (isThumbnailRequested()) {
mJpegSizeTag=tag;
}
}
else if (tid == TAG_STRIP_OFFSETS && checkAllowed(ifd,ExifInterface.TAG_STRIP_OFFSETS)) {
if (isThumbnailRequested()) {
if (tag.hasValue()) {
for (int i=0; i < tag.getComponentCount(); i++) {
if (tag.getDataType() == ExifTag.TYPE_UNSIGNED_SHORT) {
registerUncompressedStrip(i,tag.getValueAt(i));
}
else {
registerUncompressedStrip(i,tag.getValueAt(i));
}
}
}
else {
mCorrespondingEvent.put(tag.getOffset(),new ExifTagEvent(tag,false));
}
}
}
else if (tid == TAG_STRIP_BYTE_COUNTS && checkAllowed(ifd,ExifInterface.TAG_STRIP_BYTE_COUNTS) && isThumbnailRequested() && tag.hasValue()) {
mStripSizeTag=tag;
}
}
|
Check the tag, if the tag is one of the offset tag that points to the IFD or image the caller is interested in, register the IFD or image.
|
public static boolean hasGetAndSetMethods(JField field,JClassType clazz){
return hasGetMethod(field,clazz) && hasSetMethod(field,clazz);
}
|
Returns <code>true</code> is the given field has both a "get" and a "set" methods.
|
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 IndicesOptions indicesOptions(){
return indicesOptions;
}
|
Returns indices option flags
|
private static boolean isSorted(Comparable[] a){
for (int i=1; i < a.length; i++) if (less(a[i],a[i - 1])) return false;
return true;
}
|
Check if array is sorted - useful for debugging.
|
public RevisionMetadata processMetadata(RevisionHistory revisionHistory,List<Revision> revs,@Nullable MetadataScrubberConfig sc,@Nullable Revision fromRevision){
ImmutableList.Builder<RevisionMetadata> rmBuilder=ImmutableList.builder();
for ( Revision rev : revs) {
RevisionMetadata rm=revisionHistory.getMetadata(rev);
for ( MetadataScrubber scrubber : metadataScrubbers.values()) {
try {
rm=scrubber.scrub(rm,sc);
}
catch ( RuntimeException e) {
throw new MoeProblem(e,"Error processing %s: %s",scrubber.getClass().getSimpleName(),e.getMessage());
}
}
rmBuilder.add(rm);
}
return RevisionMetadata.concatenate(rmBuilder.build(),fromRevision);
}
|
Get and scrub RevisionMetadata based on the given MetadataScrubberConfig.
|
public <T>void write(T obj,String localName,String uri,Class<T> cls) throws XMLStreamException {
_xml.add(obj,localName,uri,cls);
}
|
Writes the specified object as a fully qualified nested element of actual type known (<code>null</code> objects are ignored).
|
public void debug(String msg,Object arg0,Object arg1,Object arg2){
innerLog(Level.DEBUG,null,msg,arg0,arg1,arg2,null);
}
|
Log a debug message.
|
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:33:46.477 -0500",hash_original_method="7F43853CDED9232ACA3765709B5C5CC7",hash_generated_method="5C9DEEA3F7D329A789B5C65180A72B7C") private Im(){
}
|
This utility class cannot be instantiated
|
public IgniteTxOptimisticCheckedException(String msg,Throwable cause){
super(msg,cause);
}
|
Creates new optimistic exception with given error message and optional nested exception.
|
@Override public void initializeAfterLoading(){
super.initializeAfterLoading();
Utils.removeEmptyStringsFromList(tags);
Utils.removeEmptyStringsFromList(genres);
for ( String genre : new ArrayList<>(genres)) {
addGenre(MediaGenres.getGenre(genre));
}
if (movieSetId != null) {
movieSet=MovieList.getInstance().lookupMovieSet(movieSetId);
}
}
|
Initialize after loading.
|
@Override public void writeMetadata(XDROutputBuffer xdr,IGangliaMetadataMessage decl){
}
|
NOP. The metadata was sent with each metric message in this version of the protocol.
|
public DOMXMLSignature(Element sigElem,XMLCryptoContext context,Provider provider) throws MarshalException {
localSigElem=sigElem;
ownerDoc=localSigElem.getOwnerDocument();
id=DOMUtils.getAttributeValue(localSigElem,"Id");
Element siElem=DOMUtils.getFirstChildElement(localSigElem,"SignedInfo");
si=new DOMSignedInfo(siElem,context,provider);
Element sigValElem=DOMUtils.getNextSiblingElement(siElem,"SignatureValue");
sv=new DOMSignatureValue(sigValElem,context);
Element nextSibling=DOMUtils.getNextSiblingElement(sigValElem);
if (nextSibling != null && nextSibling.getLocalName().equals("KeyInfo")) {
ki=new DOMKeyInfo(nextSibling,context,provider);
nextSibling=DOMUtils.getNextSiblingElement(nextSibling);
}
if (nextSibling == null) {
objects=Collections.emptyList();
}
else {
List<XMLObject> tempObjects=new ArrayList<XMLObject>();
while (nextSibling != null) {
String name=nextSibling.getLocalName();
if (!name.equals("Object")) {
throw new MarshalException("Invalid element name: " + name + ", expected KeyInfo or Object");
}
tempObjects.add(new DOMXMLObject(nextSibling,context,provider));
nextSibling=DOMUtils.getNextSiblingElement(nextSibling);
}
objects=Collections.unmodifiableList(tempObjects);
}
}
|
Creates a <code>DOMXMLSignature</code> from XML.
|
public static void load(){
Context gcon=Context.getGlobalContext();
Context.ContextSymbolEnumeration Enum=gcon.getContextSymbolEnumeration();
while (Enum.hasMoreElements()) {
SymbolNode sn=Enum.nextElement();
Data d=(Data)LevelData.get(sn.getName().toString());
if (d != null) {
OpDefNode opDef=(OpDefNode)gcon.getSymbol(sn.getName());
if (opDef.getArity() != d.arity) {
throw new WrongInvocationException("Level data for " + sn.getName() + " has the wrong arity");
}
opDef.setBuiltinLevel(d);
}
}
}
|
Set up level data for built-in operators using LevelData.
|
public double predict_char_prob(String pre,int n){
if (n < 0 || n > predicted_chars) {
return 0;
}
if (pre.equals(" ")) {
pre="<w>";
}
String key=pre + n;
Double prob=context_prob.get(key);
if (prob != null) {
prob=Math.pow(10,prob);
}
return prob;
}
|
Method which returns the probability of the nth most likely character, given a preceeding character (pre). Use in combination with the predict_char methods.
|
public static boolean removeBeanOrFolder(String path){
return removePath(path.split(PATH_SEPARATOR),s_directory,0) > 0;
}
|
Removes a bean or tree from the directory.
|
private int nextChunk() throws IOException {
int available=super.available();
if (available <= 0) {
available=1;
}
if (available > inBuf.length) {
available=super.read(inBuf,0,inBuf.length);
}
else {
available=super.read(inBuf,0,available);
}
if (available < 0) {
if (finalized) {
return -1;
}
try {
if (bufferedBlockCipher != null) {
maxBuf=bufferedBlockCipher.doFinal(buf,0);
}
else {
maxBuf=0;
}
}
catch ( Exception e) {
throw new IOException("error processing stream: " + e.toString());
}
bufOff=0;
finalized=true;
if (bufOff == maxBuf) {
return -1;
}
}
else {
bufOff=0;
try {
if (bufferedBlockCipher != null) {
maxBuf=bufferedBlockCipher.processBytes(inBuf,0,available,buf,0);
}
else {
streamCipher.processBytes(inBuf,0,available,buf,0);
maxBuf=available;
}
}
catch ( Exception e) {
throw new IOException("error processing stream: " + e.toString());
}
if (maxBuf == 0) {
return nextChunk();
}
}
return maxBuf;
}
|
grab the next chunk of input from the underlying input stream
|
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:28:12.987 -0500",hash_original_method="F5040E07E9B927EF44F79345AA20F61D",hash_generated_method="8D33E80FC3E9A75B712A1E7DBCB79447") public DynamicLayout(CharSequence base,CharSequence display,TextPaint paint,int width,Alignment align,float spacingmult,float spacingadd,boolean includepad,TextUtils.TruncateAt ellipsize,int ellipsizedWidth){
this(base,display,paint,width,align,TextDirectionHeuristics.FIRSTSTRONG_LTR,spacingmult,spacingadd,includepad,ellipsize,ellipsizedWidth);
}
|
Make a layout for the transformed text (password transformation being the primary example of a transformation) that will be updated as the base text is changed. If ellipsize is non-null, the Layout will ellipsize the text down to ellipsizedWidth.
|
public boolean equals(Object objectToCompare){
if (super.equals(objectToCompare)) return true;
if (objectToCompare instanceof Decimal) {
if (CoreUtils.nullSafeComparator(((Decimal)objectToCompare).getBigDecimalValue(),this.getBigDecimalValue()) == 0) return true;
}
return false;
}
|
Method equals.
|
public Boolean isAllowCreate(){
return allowCreate;
}
|
Gets the value of the allowCreate property.
|
protected String[] diff_halfMatch(String text1,String text2){
if (Diff_Timeout <= 0) {
return null;
}
String longtext=text1.length() > text2.length() ? text1 : text2;
String shorttext=text1.length() > text2.length() ? text2 : text1;
if (longtext.length() < 4 || shorttext.length() * 2 < longtext.length()) {
return null;
}
String[] hm1=diff_halfMatchI(longtext,shorttext,(longtext.length() + 3) / 4);
String[] hm2=diff_halfMatchI(longtext,shorttext,(longtext.length() + 1) / 2);
String[] hm;
if (hm1 == null && hm2 == null) {
return null;
}
else if (hm2 == null) {
hm=hm1;
}
else if (hm1 == null) {
hm=hm2;
}
else {
hm=hm1[4].length() > hm2[4].length() ? hm1 : hm2;
}
if (text1.length() > text2.length()) {
return hm;
}
else {
return new String[]{hm[2],hm[3],hm[0],hm[1],hm[4]};
}
}
|
Do the two texts share a substring which is at least half the length of the longer text? This speedup can produce non-minimal diffs.
|
public static void normal(Vector3fc v0,Vector3fc v1,Vector3fc v2,Vector3f dest){
normal(v0.x(),v0.y(),v0.z(),v1.x(),v1.y(),v1.z(),v2.x(),v2.y(),v2.z(),dest);
}
|
Calculate the normal of a surface defined by points <code>v1</code>, <code>v2</code> and <code>v3</code> and store it in <code>dest</code>.
|
public void onExit(Context cx,boolean byThrow,Object resultOrException){
if (dim.breakOnReturn && !byThrow) {
dim.handleBreakpointHit(this,cx);
}
contextData.popFrame();
}
|
Called when the stack frame has been left.
|
private static int uariminGe(double value,double[] bv,int[] bvi,BinaryOperator bOp) throws DMLRuntimeException {
int ixMin=1;
if (value <= bv[0] || value > bv[bv.length - 1]) return ixMin;
int ix=Arrays.binarySearch(bv,value);
if (ix < 0) ix=Math.abs(ix) - 1;
ixMin=bvi[ix - 1] + 1;
return ixMin;
}
|
Find out rowIndexMin for GreaterThanEqual operator.
|
private void createACSComponent(Composite container){
Group acsGrp=new Group(container,SWT.SHADOW_ETCHED_IN);
GridLayout groupGridLayout=new GridLayout();
GridData groupGridData=new GridData();
groupGridData.grabExcessHorizontalSpace=true;
groupGridData.horizontalIndent=10;
groupGridData.verticalIndent=10;
groupGridData.horizontalAlignment=SWT.FILL;
groupGridLayout.numColumns=2;
groupGridLayout.verticalSpacing=10;
acsGrp.setText(Messages.acsGrpTxt);
acsGrp.setLayout(groupGridLayout);
acsGrp.setLayoutData(groupGridData);
acsLbl=new Label(acsGrp,SWT.LEFT);
groupGridData=new GridData();
groupGridData.grabExcessHorizontalSpace=true;
groupGridData.horizontalAlignment=SWT.FILL;
groupGridLayout.numColumns=2;
acsLbl.setText(Messages.acsLbl);
acsLbl.setLayoutData(groupGridData);
acsTxt=new Text(acsGrp,SWT.LEFT | SWT.BORDER);
groupGridData=new GridData();
groupGridData.horizontalSpan=2;
groupGridData.widthHint=470;
acsTxt.setText(Messages.acsTxt);
acsTxt.setLayoutData(groupGridData);
}
|
Method creates ACS Authentication Endpoint component.
|
public void push(final float value){
int bits=Float.floatToIntBits(value);
if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) {
mv.visitInsn(Opcodes.FCONST_0 + (int)value);
}
else {
mv.visitLdcInsn(new Float(value));
}
}
|
Generates the instruction to push the given value on the stack.
|
void __deleteDataList(List<GenericDataDB> dataDBList){
genericDataDao.deleteInTx(dataDBList);
log.debug(Thread.currentThread().toString() + "##__deleteDataList(dataDBList.size()=[" + dataDBList.size()+ "])");
}
|
delete the data list
|
private boolean hasSimiliarMapping(final String fontName){
final Set<String> keySet=fontMappings.keySet();
final Set<String> candidates=new HashSet<String>();
for ( final String key : keySet) {
final String lcKey=key.toLowerCase();
final String lcFont=fontName.toLowerCase();
if (lcKey.equals(lcFont)) {
fontID=key;
return true;
}
if (lcKey.contains(lcFont) || lcFont.contains(lcKey)) {
candidates.add(key);
}
}
if (!candidates.isEmpty()) {
String result[]=new String[candidates.size()];
result=candidates.toArray(result);
fontID=result[0];
if (candidates.size() > 1) {
for (int i=1; i < result.length; i++) {
if (result[i].length() < fontID.length()) {
fontID=result[i];
}
}
}
return true;
}
return false;
}
|
Search mappings for a one that sounds close.
|
public void combine(AnalysisResult<A,S> other){
for ( Entry<Node,A> e : other.nodeValues.entrySet()) {
nodeValues.put(e.getKey(),e.getValue());
}
for ( Entry<Tree,Node> e : other.treeLookup.entrySet()) {
treeLookup.put(e.getKey(),e.getValue());
}
for ( Entry<Block,TransferInput<A,S>> e : other.stores.entrySet()) {
stores.put(e.getKey(),e.getValue());
}
for ( Entry<Element,A> e : other.finalLocalValues.entrySet()) {
finalLocalValues.put(e.getKey(),e.getValue());
}
}
|
Combine with another analysis result.
|
public static void addDirToClasspath(File directory) throws IOException {
if (directory.exists()) {
File[] files=directory.listFiles();
for (int i=0; i < files.length; i++) {
File file=files[i];
addURL(file.toURI().toURL());
}
}
else {
System.err.println("The directory \"" + directory + "\" does not exist!");
}
}
|
Adds the jars in the given directory to classpath
|
public void centerOn(@NonNull View source){
centerOn=source;
}
|
Center the reveal or conceal on this view.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.