code
stringlengths
10
174k
nl
stringlengths
3
129k
public static CacheHeader readHeader(InputStream is) throws IOException { CacheHeader entry=new CacheHeader(); int magic=readInt(is); if (magic != CACHE_MAGIC) { throw new IOException(); } entry.key=readString(is); entry.etag=readString(is); if (entry.etag.equals("")) { entry.etag=null; } entry.serverDate=readLong(is); entry.ttl=readLong(is); entry.softTtl=readLong(is); entry.responseHeaders=readStringStringMap(is); return entry; }
Reads the header off of an InputStream and returns a CacheHeader object.
private void generate(Region region,String elementName) throws SAXException { if (region == null) { return; } AttributesImpl atts=new AttributesImpl(); atts.addAttribute("","",NAME,"",region.getName()); if (region instanceof RegionCreation) { RegionCreation rc=(RegionCreation)region; String refId=rc.getRefid(); if (refId != null) { atts.addAttribute("","",REFID,"",refId); } } handler.startElement("",elementName,elementName,atts); if (region instanceof RegionCreation) { RegionCreation rc=(RegionCreation)region; if (rc.hasAttributes()) { generate(null,region.getAttributes()); } } else { generate(null,region.getAttributes()); } Collection indexesForRegion=this.cache.getQueryService().getIndexes(region); if (indexesForRegion != null) { for ( Object index : indexesForRegion) { generate((Index)index); } } if (region instanceof PartitionedRegion) { if (includeKeysValues) { if (!region.isEmpty()) { for (Iterator iter=region.entrySet(false).iterator(); iter.hasNext(); ) { Region.Entry entry=(Region.Entry)iter.next(); generate(entry); } } } } else { if (includeKeysValues) { for (Iterator iter=region.entrySet(false).iterator(); iter.hasNext(); ) { Region.Entry entry=(Region.Entry)iter.next(); generate(entry); } } } TreeSet rSet=new TreeSet(new RegionComparator()); rSet.addAll(region.subregions(false)); for (Iterator iter=rSet.iterator(); iter.hasNext(); ) { Region subregion=(Region)iter.next(); generate(subregion,REGION); } if (region instanceof Extensible) { @SuppressWarnings({"unchecked"}) Extensible<Region<?,?>> extensible=(Extensible<Region<?,?>>)region; generate(extensible); } handler.endElement("",elementName,elementName); }
Generates XML for a given region
public void writeNoScale(Image c,Component i){ if (page == null) { newpage(); } int x=x0 + width - (c.getWidth(null) + charwidth); int y=y0 + (linenum * lineheight) + lineascent; if (page != null && pagenum >= prFirst) { page.drawImage(c,x,y,c.getWidth(null),c.getHeight(null),null); } }
Write a graphic to the printout. <P> This was not in the original class, but was added afterwards by Kevin Dickerson. it is a copy of the write, but without the scaling. <P> The image is positioned on the right side of the paper, at the current height.
public EnumDeclaration addEnum(String name,Modifier... modifiers){ EnumDeclaration enumDeclaration=new EnumDeclaration(Arrays.stream(modifiers).collect(Collectors.toCollection(null)),name); getTypes().add(enumDeclaration); enumDeclaration.setParentNode(this); return enumDeclaration; }
Add an enum to the types of this compilation unit
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:22.743 -0500",hash_original_method="C3E161F555FEE180C4B024634334055B",hash_generated_method="63136E4B87B672F65F22860C3C9A36F0") private void checkRecycled(String errorMessage){ if (mRecycled) { throw new IllegalStateException(errorMessage); } }
This is called by methods that want to throw an exception if the bitmap has already been recycled.
public PutIndexedScriptRequest source(byte[] source,int offset,int length){ return source(new BytesArray(source,offset,length)); }
Sets the document to index in bytes form (assumed to be safe to be used from different threads).
private void checkGETStatusCodeWithAwait(final String request,final Integer statusCode){ await().atMost(Duration.FIVE_SECONDS).until(null,equalTo(String.valueOf(statusCode))); }
Checks if the GET request for the resource gets a response with the given status code.
public DeleteReferencesResponse DeleteReferences(RequestHeader RequestHeader,DeleteReferencesItem... ReferencesToDelete) throws ServiceFaultException, ServiceResultException { DeleteReferencesRequest req=new DeleteReferencesRequest(RequestHeader,ReferencesToDelete); return (DeleteReferencesResponse)channel.serviceRequest(req); }
Synchronous DeleteReferences service request.
public static List<VOPricedEvent> toVOPricedEvent(List<PricedEvent> consideredEvents,LocalizerFacade facade){ List<VOPricedEvent> result=new ArrayList<VOPricedEvent>(); for ( PricedEvent currentEvent : consideredEvents) { result.add(toVOPricedEvent(currentEvent,facade)); } return result; }
Converts the provided pricing related events to value objects, also using the description in the user's locale.
public PushParams withRegistry(String registry){ this.registry=registry; return this; }
Adds registry to this parameters.
public Manifold(){ points=new ManifoldPoint[Settings.maxManifoldPoints]; for (int i=0; i < Settings.maxManifoldPoints; i++) { points[i]=new ManifoldPoint(); } localNormal=new Vec2(); localPoint=new Vec2(); pointCount=0; }
creates a manifold with 0 points, with it's points array full of instantiated ManifoldPoints.
void forAllAction(NodeRepresentation nodeRep){ QuantifierDecomposition qdc=decomposeQuantifier(nodeRep,true); if (qdc != null) { Decomposition decomp=nodeRep.decomposition; state.hasChanged=true; if (decomp.definedOp != null) { state.assumpDefinitions.add(decomp.definedOp); } this.state.goalRep=qdc.body; int newIdx=newAssumeRepsIndex(-1,nodeRep.initialPosition); for (int i=0; i < qdc.news.size(); i++) { this.state.assumeReps.add(newIdx + i,qdc.news.elementAt(i)); } } raiseWindow(); }
Execute a \A split of the goal.
public void downloadExecuteLogic(ActionMapping mappings,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception { logger.info("Inicio de downloadExecuteLogic"); String id=request.getParameter(Constants.ID); if (logger.isInfoEnabled()) logger.info("Id Documento: " + id); String idObjeto=request.getParameter("idObjeto"); if (logger.isInfoEnabled()) logger.info("Id Objeto: " + idObjeto); int tipo=TypeConverter.toInt(request.getParameter("tipoObjeto"),TipoObjeto.DESCRIPTOR); if (logger.isInfoEnabled()) logger.info("Tipo Objeto: " + tipo); DocDocumentoExtVO fichero=null; try { if (StringUtils.isNotBlank(id)) fichero=getGestionDocumentosElectronicosBI(request).getDocumentoExt(tipo,idObjeto,id); if (fichero != null) download(response,fichero); else { obtenerErrores(request,true).add(ActionErrors.GLOBAL_MESSAGE,new ActionError(DocumentosConstants.ERROR_DOC_ELECTRONICOS_DOCUMENTO_NO_ENCONTRADO)); goLastClientExecuteLogic(mappings,form,request,response); } } catch ( Exception e) { obtenerErrores(request,true).add(ActionErrors.GLOBAL_MESSAGE,new ActionError(DocumentosConstants.ERROR_DOC_ELECTRONICOS_DOCUMENTO_NO_ENCONTRADO)); goLastClientExecuteLogic(mappings,form,request,response); } }
Descarga el fichero del documento.
public String toString(){ return getClass().getName() + "[font=" + getFont()+ ",color="+ getColor()+ "]"; }
Returns a <code>String</code> object representing this <code>Graphics</code> object's value.
public static void main(final String[] args){ DOMTestCase.doMain(notationgetpublicidnull.class,args); }
Runs this test from the command line.
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg=e.getMessage(); SAXSourceLocator locator=getLocator(); ErrorListener handler=m_stylesheetProcessor.getErrorListener(); try { handler.warning(new TransformerException(formattedMsg,locator)); } catch ( TransformerException te) { throw new org.xml.sax.SAXException(te); } }
Receive notification of a XSLT processing warning.
private void movePos(float deltaY){ if ((deltaY < 0 && mPtrIndicator.isInStartPosition())) { if (DEBUG) { PtrCLog.e(LOG_TAG,String.format("has reached the top")); } return; } int to=mPtrIndicator.getCurrentPosY() + (int)deltaY; if (mPtrIndicator.willOverTop(to)) { if (DEBUG) { PtrCLog.e(LOG_TAG,String.format("over top")); } to=PtrIndicator.POS_START; } mPtrIndicator.setCurrentPos(to); int change=to - mPtrIndicator.getLastPosY(); updatePos(change); }
Update ptr indicator's coordination, and invoke position change.
public boolean isAfterStarting(){ return _lifecycle.getState().isAfterStarting(); }
Returns true if the server is starting or active
public Set<Feed> updateFeeds(int categoryId,boolean overrideOffline){ Long time=feedsChanged.get(categoryId); if (time == null) time=0L; if (time > System.currentTimeMillis() - Utils.UPDATE_TIME) { return null; } else if (Utils.isConnected(cm) || (overrideOffline && Utils.checkConnected(cm))) { Set<Feed> ret=new LinkedHashSet<>(); Set<Feed> feeds=Controller.getInstance().getConnector().getFeeds(); if (!feeds.isEmpty()) { for ( Feed f : feeds) { if (categoryId == VCAT_ALL || f.categoryId == categoryId) ret.add(f); feedsChanged.put(f.categoryId,System.currentTimeMillis()); } DBHelper.getInstance().deleteFeeds(); DBHelper.getInstance().insertFeeds(feeds); feedsChanged.put(categoryId,System.currentTimeMillis()); notifyListeners(); } return ret; } return null; }
update DB (delete/insert) with actual feeds information from server
public Lucene70DocValuesConsumer(SegmentWriteState state,String dataCodec,String dataExtension,String metaCodec,String metaExtension) throws IOException { boolean success=false; try { String dataName=IndexFileNames.segmentFileName(state.segmentInfo.name,state.segmentSuffix,dataExtension); data=state.directory.createOutput(dataName,state.context); CodecUtil.writeIndexHeader(data,dataCodec,Lucene70DocValuesFormat.VERSION_CURRENT,state.segmentInfo.getId(),state.segmentSuffix); String metaName=IndexFileNames.segmentFileName(state.segmentInfo.name,state.segmentSuffix,metaExtension); meta=state.directory.createOutput(metaName,state.context); CodecUtil.writeIndexHeader(meta,metaCodec,Lucene70DocValuesFormat.VERSION_CURRENT,state.segmentInfo.getId(),state.segmentSuffix); maxDoc=state.segmentInfo.maxDoc(); success=true; } finally { if (!success) { IOUtils.closeWhileHandlingException(this); } } }
expert: Creates a new writer
private ExportMask populateExportMaskUserAddedInitiators(ExportMask exportMask){ if (exportMask.getInitiators() != null && !exportMask.getInitiators().isEmpty()) { StringMap userAddedInitiatorsMap=exportMask.getUserAddedInitiators(); List<Initiator> initiators=new ArrayList<Initiator>(); for ( String initiatorId : exportMask.getInitiators()) { Initiator initiator=dbClient.queryObject(Initiator.class,URI.create(initiatorId)); if (initiator != null) { initiators.add(initiator); } } if (userAddedInitiatorsMap == null && !initiators.isEmpty()) { exportMask.addToUserCreatedInitiators(initiators); log.info("Adding initiators to the userCreatedInitiators " + initiators + "to the export mask "+ exportMask.getMaskName()+ "export mask ID is :"+ exportMask.getId()); } else { for ( Initiator initiator : initiators) { if (userAddedInitiatorsMap.get(Initiator.normalizePort(initiator.getInitiatorPort())) == null) { log.info("Adding initiator to the userCreatedInitiators" + initiator + "to the export mask "+ exportMask.getMaskName()+ "exportmask ID is :"+ exportMask.getId()); exportMask.addToUserCreatedInitiators(initiator); } } } } return exportMask; }
This method adds initiators if any to the userAddedInitiators in the mentioned exportMask.
public static Shape createShape(Reader r,int wr) throws IOException, ParseException { PointsParser p=new PointsParser(); AWTPolylineProducer ph=new AWTPolylineProducer(); ph.setWindingRule(wr); p.setPointsHandler(ph); p.parse(r); return ph.getShape(); }
Utility method for creating an ExtendedGeneralPath.
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:57:14.281 -0500",hash_original_method="6145F82DE390788BB7B29DCBC031D263",hash_generated_method="E4E97F4C3F215E65E2C57219B30401EA") public boolean containsKey(Object key){ int hash=hash(key.hashCode()); return segmentFor(hash).containsKey(key,hash); }
Tests if the specified object is a key in this table.
public void testgetKeystoreAlias(){ SecurityHelperTest.resetSecuritySystemProperties(); AuthenticationInfo authInfo=null; try { authInfo=SecurityHelper.loadAuthenticationInformation("test.ssl.alias.security.properties",true,TUNGSTEN_APPLICATION_NAME.CONNECTOR); String alias=authInfo.getKeystoreAliasForConnectionType(SecurityConf.KEYSTORE_ALIAS_CONNECTOR_CLIENT_TO_CONNECTOR); assertNotNull(alias); assertEquals("tungsten_data_fabric",alias); alias=authInfo.getKeystoreAliasForConnectionType(SecurityConf.KEYSTORE_ALIAS_REPLICATOR_MASTER_TO_SLAVE); assertNull(alias); } catch ( ServerRuntimeException e) { assertTrue("There should not be any exception thrown",false); } catch ( ConfigurationException e) { assertFalse("That should not be this kind of Exception being thrown",true); } SecurityHelperTest.resetSecuritySystemProperties(); }
Confirm that the getKeystoreAliasForConnectionType returns an alias name, and null if it cannot be found.
public JsonPrimitive(String string){ setValue(string); }
Create a primitive containing a String value.
@Override public void publish(final Topic destination,final Message message,final int deliveryMode,final int priority,final long timeToLive) throws JMSException { session.lock(); try { if (ActiveMQRATopicPublisher.trace) { ActiveMQRALogger.LOGGER.trace("send " + this + " destination="+ destination+ " message="+ message+ " deliveryMode="+ deliveryMode+ " priority="+ priority+ " ttl="+ timeToLive); } checkState(); ((TopicPublisher)producer).publish(destination,message,deliveryMode,priority,timeToLive); if (ActiveMQRATopicPublisher.trace) { ActiveMQRALogger.LOGGER.trace("sent " + this + " result="+ message); } } finally { session.unlock(); } }
Publish message
public void doFind(){ if (findDialog == null) { findDialog=new FindReplaceDialog(textsParent.getShell()); } findDialog.setTarget(hexEditControl); findDialog.open(); }
Open find dialog
public MailAddress(String localPart,String domain) throws AddressException { this(new InternetAddress(localPart + "@" + domain)); }
Constructs a MailAddress with the provided local part and domain.
public X509CRLImpl(CertificateList crl){ this.crl=crl; this.tbsCertList=crl.getTbsCertList(); this.extensions=tbsCertList.getCrlExtensions(); }
Creates X.509 CRL by wrapping of the specified CertificateList object.
@Override public boolean appCrashed(String processName,int pid,String shortMsg,String longMsg,long timeMillis,String stackTrace) throws RemoteException { Log.i(TAG,String.format("Application %s (pid %s) crashed: %s\n\n%s",processName,pid,longMsg,stackTrace)); return false; }
An application process has crashed (in Java). Return true for the normal error recovery (app crash dialog) to occur, false to kill it immediately.
private void emit1(int od){ if (!alive) return; code=ArrayUtils.ensureCapacity(code,cp); code[cp++]=(byte)od; }
Emit a byte of code.
public void join() throws InterruptedException { _thread.join(); }
Wait for thread to complete
public Object jjtAccept(SyntaxTreeBuilderVisitor visitor,Object data) throws VisitorException { return visitor.visit(this,data); }
Accept the visitor.
static MethodHandle varargsArray(int nargs){ MethodHandle mh=Lazy.ARRAYS[nargs]; if (mh != null) return mh; mh=findCollector("array",nargs,Object[].class); if (mh != null) mh=makeIntrinsic(mh,Intrinsic.NEW_ARRAY); if (mh != null) return Lazy.ARRAYS[nargs]=mh; mh=buildVarargsArray(Lazy.MH_fillNewArray,Lazy.MH_arrayIdentity,nargs); assert (assertCorrectArity(mh,nargs)); mh=makeIntrinsic(mh,Intrinsic.NEW_ARRAY); return Lazy.ARRAYS[nargs]=mh; }
Return a method handle that takes the indicated number of Object arguments and returns an Object array of them, as if for varargs.
public void updateRow() throws SQLException { if (onInsertRow == true) { throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.updateins").toString()); } ((Row)getCurrentRow()).setUpdated(); notifyRowChanged(); }
Marks the current row of this <code>CachedRowSetImpl</code> object as updated and notifies listeners registered with this rowset that the row has changed. <P> This method cannot be called when the cursor is on the insert row, and it should be called before the cursor moves to another row. If it is called after the cursor moves to another row, this method has no effect, and the updates made before the cursor moved will be lost.
protected String composeFilenameEms(SymbolCode code){ String scheme=code.getScheme(); String category=code.getCategory(); String functionId=code.getFunctionId(); char status=SymbologyConstants.STATUS_PRESENT.equalsIgnoreCase(code.getStatus()) ? 'p' : 'a'; if (functionId == null) functionId="------"; StringBuilder sb=new StringBuilder(); sb.append(DIR_ICON_EMS).append("/").append(scheme.toLowerCase()).append('-').append(category.toLowerCase()).append(status).append(functionId.toLowerCase()).append("-----").append(PATH_SUFFIX); return sb.toString(); }
Indicates the filename of a graphic in the Emergency Management scheme (MIL-STD-2525C Appendix G).
protected S_SolveImpl(){ super(); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public static void enumerateResourcesPreserveMissing(VerificationHost host,boolean isMock,String resourcePoolLink,String computeHostLinkDescription,String computeHostLink,String testCase) throws Throwable { EnumSet<TaskOption> options=EnumSet.of(TaskOption.PRESERVE_MISSING_RESOUCES); if (isMock) { options.add(TaskOption.IS_MOCK); } enumerateResources(host,null,options,resourcePoolLink,computeHostLinkDescription,computeHostLink,testCase,null); }
Enumerates resources on the AWS endpoint.
public static void init(Context context,boolean nativeExopackage){ try { init(context,nativeExopackage ? SOLOADER_ENABLE_EXOPACKAGE : 0); } catch ( IOException ex) { throw new RuntimeException(ex); } }
Backward compatibility
public static UCrop of(@NonNull Uri source,@NonNull Uri destination){ return new UCrop(source,destination); }
This method creates new Intent builder and sets both source and destination image URIs.
public final void popContextNodeList(){ if (m_contextNodeLists.isEmpty()) System.err.println("Warning: popContextNodeList when stack is empty!"); else m_contextNodeLists.pop(); }
Pop the current context node list.
@Override public boolean isActive(){ return amIActive; }
Used by the Whitebox GUI to tell if this plugin is still running.
private static boolean doSelfValidation(){ char lastChar=UNIHANS[0]; String lastString=Character.toString(lastChar); for ( char c : UNIHANS) { if (lastChar == c) { continue; } final String curString=Character.toString(c); int cmp=COLLATOR.compare(lastString,curString); if (cmp >= 0) { Log.e(TAG,"Internal error in Unihan table. " + "The last string \"" + lastString + "\" is greater than current string \""+ curString+ "\"."); return false; } lastString=curString; } return true; }
Validate if our internal table has some wrong value.
public Value read(Type type,NodeMap node,Map map) throws Exception { ReadGraph graph=read.find(map); if (graph != null) { return graph.read(type,node); } return null; }
This method is used to read an object from the specified node. In order to get the root type the field and node map are specified. The field represents the annotated method or field within the deserialized object. The node map is used to get the attributes used to describe the objects identity, or in the case of an existing object it contains an object reference.
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { request.getSession().setAttribute("school","gdou"); response.sendRedirect("servlet/SchoolServlet"); return; }
The doGet method of the servlet. <br> This method is called when a form has its tag value method equals to get.
public JSONArray put(int index,boolean value) throws JSONException { this.put(index,value ? Boolean.TRUE : Boolean.FALSE); return this; }
Put or replace a boolean value in the JSONArray. If the index is greater than the length of the JSONArray, then null elements will be added as necessary to pad it out.
private void checkPerPortRate(OFPacketIn pin){ Short port=pin.getInPort(); if (portCache.update(port)) { if (portBlockedCache.update(port)) { return; } SwitchPort swPort=new SwitchPort(getId(),port); ForwardingBase.blockHost(floodlightProvider,swPort,-1L,(short)5,AppCookie.makeCookie(OFSWITCH_APP_ID,1)); floodlightProvider.addSwitchEvent(this.datapathId,"SWITCH_PORT_BLOCKED_TEMPORARILY " + "OFPort " + port,false); log.info("Excessive packet in from {}, block port for 5 sec",swPort); } }
Works in a similar way as checkPerSourceMacRate(). TODO Don't block ports with links?
protected void initSimulator(ForceSimulator fsim){ TupleSet ts=m_vis.getGroup(m_nodeGroup); if (ts == null) return; try { ts.addColumns(FORCEITEM_SCHEMA); } catch ( IllegalArgumentException iae) { } float startX=(referrer == null ? 0f : (float)referrer.getX()); float startY=(referrer == null ? 0f : (float)referrer.getY()); startX=Float.isNaN(startX) ? 0f : startX; startY=Float.isNaN(startY) ? 0f : startY; Iterator iter=m_vis.visibleItems(m_nodeGroup); while (iter.hasNext()) { VisualItem item=(VisualItem)iter.next(); ForceItem fitem=(ForceItem)item.get(FORCEITEM); fitem.mass=getMassValue(item); double x=item.getEndX(); double y=item.getEndY(); fitem.location[0]=(Double.isNaN(x) ? startX : (float)x); fitem.location[1]=(Double.isNaN(y) ? startY : (float)y); fsim.addItem(fitem); } if (m_edgeGroup != null) { iter=m_vis.visibleItems(m_edgeGroup); while (iter.hasNext()) { EdgeItem e=(EdgeItem)iter.next(); NodeItem n1=e.getSourceItem(); ForceItem f1=(ForceItem)n1.get(FORCEITEM); NodeItem n2=e.getTargetItem(); ForceItem f2=(ForceItem)n2.get(FORCEITEM); float coeff=getSpringCoefficient(e); float slen=getSpringLength(e); fsim.addSpring(f1,f2,(coeff >= 0 ? coeff : -1.f),(slen >= 0 ? slen : -1.f)); } } }
Loads the simulator with all relevant force items and springs.
public static PropertiesFormat forMIMEType(String mimeType,PropertiesFormat fallback){ return matchMIMEType(mimeType,formats,fallback); }
Tries to determine the appropriate file format based on the a MIME type that describes the content type. The supplied fallback format will be returned when the MIME type was not recognized.
@Override public void onReceiveAPIResult(Map<String,String> result,int requestCode){ String responseStatus; String response; if (requestCode == Constants.DEVICE_INFO_REQUEST_CODE) { if (result != null) { responseStatus=result.get(Constants.STATUS_KEY); if (Constants.Status.SUCCESSFUL.equals(responseStatus)) { response=result.get(Constants.RESPONSE); if (response != null && !response.isEmpty()) { if (Constants.DEBUG_MODE_ENABLED) { Log.d(TAG,"onReceiveAPIResult." + response); Log.d(TAG,"Device information sent"); } } } } } }
This method is being invoked when get info operation get executed.
public void send(String msg,String to){ send(new XmppMsg(msg),to); }
Wrapper for send(XmppMsg msg... method
static MemberName generateCustomizedCode(LambdaForm form,MethodType invokerType){ InvokerBytecodeGenerator g=new InvokerBytecodeGenerator("MH",form,invokerType); return g.loadMethod(g.generateCustomizedCodeBytes()); }
Generate customized bytecode for a given LambdaForm.
public static void d(String msg){ if (!allowD) return; StackTraceElement caller=getCallerStackTraceElement(); String tag=generateTag(caller); if (sLevel > LEVEL_DEBUG) { return; } Log.d(tag,msg); }
Send a DEBUG log message
public Iterator<E> reverseOrderIterator(){ return new BinarySearchTreeIterator<E>(this.root,false); }
Returns a new iterator for traversing the tree in reverse order.
public ExceptionQueuedEventContext(FacesContext context,Throwable thrown,UIComponent component,PhaseId phaseId){ this.context=context; this.thrown=thrown; this.component=component; this.phaseId=((phaseId == null) ? context.getCurrentPhaseId() : phaseId); }
<p class="changed_added_2_0">Instantiate a new <code>ExceptionQueuedEventContext</code> that indicates the argument <code>Throwable</code> just occurred, relevant to the argument <code>component</code>, during the lifecycle phase <code>phaseId</code>.</p>
public void assignAll(){ int i; for (i=0; i < blocks; i++) { value[i]=0xffffffff; } zeroUnusedBits(); }
Sets all Bits to 1.
public void expandOpenContainers(Tree tree){ if (tree == null) { String message=Logging.getMessage("nullValue.TreeIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); } if (this.mustExpandNode()) tree.expandPath(this.getPath()); for ( TreeNode child : this.getChildren()) { if (child instanceof KMLFeatureTreeNode) ((KMLFeatureTreeNode)child).expandOpenContainers(tree); } }
Expands paths in the specified <code>tree</code> corresponding to open KML container elements. This assumes that the <code>tree</code>'s model contains this node. <p/> This node's path is expanded if the feature's <code>open</code> property is <code>true</code>. <p/> This calls <code>expandOpenContainers</code> on all children which are instances of <code>KMLFeatureTreeNode</code>.
public static String checkTrackingCodeCookies(HttpServletRequest request,HttpServletResponse response){ Delegator delegator=(Delegator)request.getAttribute("delegator"); java.sql.Timestamp nowStamp=UtilDateTime.nowTimestamp(); GenericValue visit=VisitHandler.getVisit(request.getSession()); if (visit != null) { Cookie[] cookies=request.getCookies(); if (cookies != null && cookies.length > 0) { for (int i=0; i < cookies.length; i++) { if (cookies[i].getName().startsWith("TKCDT_")) { String trackingCodeId=cookies[i].getValue(); GenericValue trackingCode; try { trackingCode=EntityQuery.use(delegator).from("TrackingCode").where("trackingCodeId",trackingCodeId).cache().queryOne(); } catch ( GenericEntityException e) { Debug.logError(e,"Error looking up TrackingCode with trackingCodeId [" + trackingCodeId + "], ignoring this trackingCodeId",module); continue; } if (trackingCode == null) { Debug.logError("TrackingCode not found for trackingCodeId [" + trackingCodeId + "], ignoring this trackingCodeId.",module); continue; } if (trackingCode.get("fromDate") != null && nowStamp.before(trackingCode.getTimestamp("fromDate"))) { if (Debug.infoOn()) Debug.logInfo("The TrackingCode with ID [" + trackingCodeId + "] has not yet gone into effect, ignoring this trackingCodeId",module); continue; } if (trackingCode.get("thruDate") != null && nowStamp.after(trackingCode.getTimestamp("thruDate"))) { if (Debug.infoOn()) Debug.logInfo("The TrackingCode with ID [" + trackingCodeId + "] has expired, ignoring this trackingCodeId",module); continue; } GenericValue trackingCodeVisit=delegator.makeValue("TrackingCodeVisit",UtilMisc.toMap("trackingCodeId",trackingCodeId,"visitId",visit.get("visitId"),"fromDate",nowStamp,"sourceEnumId","TKCDSRC_COOKIE")); try { trackingCodeVisit.create(); } catch ( GenericEntityException e) { Debug.logError(e,"Error while saving TrackingCodeVisit",module); } } } } } return "success"; }
If attaching TrackingCode Cookies to the visit is desired this event should be added to the list of events that run on the first hit in a visit.
public option addElement(Element element){ addElementToRegistry(element); return (this); }
Adds an Element to the element.
private static void process(File f,TestResults expectedResults,Set<Report> toolreports){ try { System.out.println("\nAnalyzing results from " + f.getName()); TestResults actualResults=readActualResults(f); if (expectedResults != null && actualResults != null) { analyze(expectedResults,actualResults); String actualResultsFileName="notProduced"; if (!(showAveOnlyMode && actualResults.isCommercial)) { actualResultsFileName=produceResultsFile(expectedResults); } Map<String,Counter> scores=calculateScores(expectedResults); OverallResults results=calculateResults(scores); results.setTime(actualResults.getTime()); Report scoreCard=new Report(actualResults,scores,results,expectedResults.totalResults(),actualResultsFileName,actualResults.isCommercial(),actualResults.getToolType()); toolreports.add(scoreCard); } else { if (expectedResults == null) { System.out.println("Error!!: expected results were null."); } else System.out.println("Error!!: actual results were null for file: " + f); } } catch ( Exception e) { System.out.println("Error processing " + f + ". Continuing."); e.printStackTrace(); } }
The method takes in a tool scan results file and determined how well that tool did against the benchmark.
public static String stringFor(int result){ switch (result) { case CUDA_SUCCESS: return "CUDA_SUCCESS"; case CUDA_ERROR_INVALID_VALUE: return "CUDA_ERROR_INVALID_VALUE"; case CUDA_ERROR_OUT_OF_MEMORY: return "CUDA_ERROR_OUT_OF_MEMORY"; case CUDA_ERROR_NOT_INITIALIZED: return "CUDA_ERROR_NOT_INITIALIZED"; case CUDA_ERROR_DEINITIALIZED: return "CUDA_ERROR_DEINITIALIZED"; case CUDA_ERROR_PROFILER_DISABLED: return "CUDA_ERROR_PROFILER_DISABLED"; case CUDA_ERROR_PROFILER_NOT_INITIALIZED: return "CUDA_ERROR_PROFILER_NOT_INITIALIZED"; case CUDA_ERROR_PROFILER_ALREADY_STARTED: return "CUDA_ERROR_PROFILER_ALREADY_STARTED"; case CUDA_ERROR_PROFILER_ALREADY_STOPPED: return "CUDA_ERROR_PROFILER_ALREADY_STOPPED"; case CUDA_ERROR_NO_DEVICE: return "CUDA_ERROR_NO_DEVICE"; case CUDA_ERROR_INVALID_DEVICE: return "CUDA_ERROR_INVALID_DEVICE"; case CUDA_ERROR_INVALID_IMAGE: return "CUDA_ERROR_INVALID_IMAGE"; case CUDA_ERROR_INVALID_CONTEXT: return "CUDA_ERROR_INVALID_CONTEXT"; case CUDA_ERROR_CONTEXT_ALREADY_CURRENT: return "CUDA_ERROR_CONTEXT_ALREADY_CURRENT"; case CUDA_ERROR_MAP_FAILED: return "CUDA_ERROR_MAP_FAILED"; case CUDA_ERROR_UNMAP_FAILED: return "CUDA_ERROR_UNMAP_FAILED"; case CUDA_ERROR_ARRAY_IS_MAPPED: return "CUDA_ERROR_ARRAY_IS_MAPPED"; case CUDA_ERROR_ALREADY_MAPPED: return "CUDA_ERROR_ALREADY_MAPPED"; case CUDA_ERROR_NO_BINARY_FOR_GPU: return "CUDA_ERROR_NO_BINARY_FOR_GPU"; case CUDA_ERROR_ALREADY_ACQUIRED: return "CUDA_ERROR_ALREADY_ACQUIRED"; case CUDA_ERROR_NOT_MAPPED: return "CUDA_ERROR_NOT_MAPPED"; case CUDA_ERROR_NOT_MAPPED_AS_ARRAY: return "CUDA_ERROR_NOT_MAPPED_AS_ARRAY"; case CUDA_ERROR_NOT_MAPPED_AS_POINTER: return "CUDA_ERROR_NOT_MAPPED_AS_POINTER"; case CUDA_ERROR_ECC_UNCORRECTABLE: return "CUDA_ERROR_ECC_UNCORRECTABLE"; case CUDA_ERROR_UNSUPPORTED_LIMIT: return "CUDA_ERROR_UNSUPPORTED_LIMIT"; case CUDA_ERROR_CONTEXT_ALREADY_IN_USE: return "CUDA_ERROR_CONTEXT_ALREADY_IN_USE"; case CUDA_ERROR_PEER_ACCESS_UNSUPPORTED: return "CUDA_ERROR_PEER_ACCESS_UNSUPPORTED"; case CUDA_ERROR_INVALID_PTX: return "CUDA_ERROR_INVALID_PTX"; case CUDA_ERROR_INVALID_GRAPHICS_CONTEXT: return "CUDA_ERROR_INVALID_GRAPHICS_CONTEXT"; case CUDA_ERROR_INVALID_SOURCE: return "CUDA_ERROR_INVALID_SOURCE"; case CUDA_ERROR_FILE_NOT_FOUND: return "CUDA_ERROR_FILE_NOT_FOUND"; case CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND: return "CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND"; case CUDA_ERROR_SHARED_OBJECT_INIT_FAILED: return "CUDA_ERROR_SHARED_OBJECT_INIT_FAILED"; case CUDA_ERROR_OPERATING_SYSTEM: return "CUDA_ERROR_OPERATING_SYSTEM"; case CUDA_ERROR_INVALID_HANDLE: return "CUDA_ERROR_INVALID_HANDLE"; case CUDA_ERROR_NOT_FOUND: return "CUDA_ERROR_NOT_FOUND"; case CUDA_ERROR_NOT_READY: return "CUDA_ERROR_NOT_READY"; case CUDA_ERROR_ILLEGAL_ADDRESS: return "CUDA_ERROR_ILLEGAL_ADDRESS"; case CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES: return "CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES"; case CUDA_ERROR_LAUNCH_TIMEOUT: return "CUDA_ERROR_LAUNCH_TIMEOUT"; case CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING: return "CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING"; case CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED: return "CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED"; case CUDA_ERROR_PEER_ACCESS_NOT_ENABLED: return "CUDA_ERROR_PEER_ACCESS_NOT_ENABLED"; case CUDA_ERROR_PEER_MEMORY_ALREADY_REGISTERED: return "CUDA_ERROR_PEER_MEMORY_ALREADY_REGISTERED"; case CUDA_ERROR_PEER_MEMORY_NOT_REGISTERED: return "CUDA_ERROR_PEER_MEMORY_NOT_REGISTERED"; case CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE: return "CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE"; case CUDA_ERROR_CONTEXT_IS_DESTROYED: return "CUDA_ERROR_CONTEXT_IS_DESTROYED"; case CUDA_ERROR_ASSERT: return "CUDA_ERROR_ASSERT"; case CUDA_ERROR_TOO_MANY_PEERS: return "CUDA_ERROR_TOO_MANY_PEERS"; case CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED: return "CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED"; case CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED: return "CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED"; case CUDA_ERROR_HARDWARE_STACK_ERROR: return "CUDA_ERROR_HARDWARE_STACK_ERROR"; case CUDA_ERROR_ILLEGAL_INSTRUCTION: return "CUDA_ERROR_ILLEGAL_INSTRUCTION"; case CUDA_ERROR_MISALIGNED_ADDRESS: return "CUDA_ERROR_MISALIGNED_ADDRESS"; case CUDA_ERROR_INVALID_ADDRESS_SPACE: return "CUDA_ERROR_INVALID_ADDRESS_SPACE"; case CUDA_ERROR_INVALID_PC: return "CUDA_ERROR_INVALID_PC"; case CUDA_ERROR_LAUNCH_FAILED: return "CUDA_ERROR_LAUNCH_FAILED"; case CUDA_ERROR_NOT_PERMITTED: return "CUDA_ERROR_NOT_PERMITTED"; case CUDA_ERROR_NOT_SUPPORTED: return "CUDA_ERROR_NOT_SUPPORTED"; case CUDA_ERROR_UNKNOWN: return "CUDA_ERROR_UNKNOWN"; } return "INVALID CUresult: " + result; }
Returns the String identifying the given CUresult
public boolean isSubscribed(){ return isActive() && getOptOutDate() == null; }
Is Subscribed. Active is set internally, the opt out date is set by the user via the web UI.
private final long fetchIntegerValueAsLong() throws BerException { long result=0; final int backup=next; try { final int length=fetchLength(); if (length <= 0) throw new BerException(); if (length > (bytes.length - next)) throw new IndexOutOfBoundsException("Decoded length exceeds buffer"); final int end=next + length; result=bytes[next++]; while (next < end) { final byte b=bytes[next++]; if (b < 0) { result=(result << 8) | (256 + b); } else { result=(result << 8) | b; } } } catch ( BerException e) { next=backup; throw e; } catch ( IndexOutOfBoundsException e) { next=backup; throw new BerException(); } catch ( ArithmeticException e) { next=backup; throw new BerException(); } return result; }
Fetch an integer value and return a long value. FIX ME: someday we could have only on fetchIntegerValue() which always returns a long value.
@SuppressWarnings("unchecked") public static <I extends DeployInstance2>DeployStrategy2<I> strategy(){ return (DeployStrategy2<I>)STRATEGY; }
Returns the start="lazy" redeploy="automatic" strategy
public boolean isValid(String value){ if (value == null) { return false; } for (int i=0; i < patterns.length; i++) { if (patterns[i].matcher(value).matches()) { return true; } } return false; }
Validate a value against the set of regular expressions.
private static boolean isUnreservedCharacter(char p_char){ return (isAlphanum(p_char) || MARK_CHARACTERS.indexOf(p_char) != -1); }
Determine whether a char is an unreserved character.
protected String createAzimuthLabelString(Angle azimuth){ NumberFormat df=this.getAzimuthFormat(); return df.format(azimuth.degrees); }
Create text for an azimuth label.
public JCExpression makeAnnotationType(ExpressionTransformer exprGen){ Type type=getAnnotationClassType(); if (isInterop()) { return exprGen.makeJavaType(type.getSatisfiedTypes().get(0)); } else { return exprGen.makeJavaType(type,ExpressionTransformer.JT_ANNOTATION); } }
Make a type expression for the underlying annotation class
private void showFeedback(String message){ if (myHost != null) { myHost.showFeedback(message); } else { System.out.println(message); } }
Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface.
@Override public GeoTimeSerie decode(){ throw new RuntimeException("Not Implemented."); }
Decode any remaining values into a GTS instance.
@Override public void run(){ amIActive=true; String demHeader=null; String outputHeader=null; float d=0; int maxRadius=0; String outputType=null; boolean useLowest=false; WhiteboxRaster dem; WhiteboxRaster output; int numCols, numRows; double gridRes=1; int x=0, y=0, row, col, i, j; double elevationAB, elevationXY; int radius; double distance; double heightDiff; double tmpDistance; double tmpHeightDiff; boolean downslope; double noData; float progress=0; double rad2deg=180 / Math.PI; int minX=0, minY=0; double minElev=0; if (args.length <= 0) { showFeedback("Plugin parameters have not been set."); return; } for (i=0; i < args.length; i++) { if (i == 0) { demHeader=args[i]; } else if (i == 1) { outputHeader=args[i]; } else if (i == 2) { d=Float.parseFloat(args[i]); } else if (i == 3) { maxRadius=Integer.parseInt(args[i]); } else if (i == 4) { outputType=args[i].toLowerCase(); } else if (i == 5) { useLowest=Boolean.parseBoolean(args[i]); } } if ((demHeader == null) || (outputHeader == null)) { showFeedback("One or more of the input parameters have not been set properly."); return; } try { dem=new WhiteboxRaster(demHeader,"r"); numRows=dem.getNumberRows(); numCols=dem.getNumberColumns(); noData=dem.getNoDataValue(); gridRes=dem.getCellSizeX(); output=new WhiteboxRaster(outputHeader,"rw",demHeader,WhiteboxRaster.DataType.FLOAT,noData); output.setPreferredPalette("blueyellow.pal"); output.setDataScale(WhiteboxRasterBase.DataScale.CONTINUOUS); output.setZUnits("dimensionless"); updateProgress("Loop 1 of 2:",0); if (useLowest) { for (row=0; row < numRows; row++) { for (col=0; col < numCols; col++) { if (dem.getValue(row,col) == dem.getMinimumValue()) { minX=col; minY=row; minElev=dem.getValue(row,col); } } if (cancelOp) { cancelOperation(); return; } progress=(float)(100f * row / (numRows - 1)); updateProgress("Loop 1 of 2:",(int)progress); } } updateProgress("Loop 2 of 2:",0); for (row=0; row < numRows; row++) { for (col=0; col < numCols; col++) { radius=0; downslope=false; heightDiff=0; distance=Float.MAX_VALUE; elevationAB=dem.getValue(row,col); if ((elevationAB != noData) && (elevationAB > dem.getMinimumValue() + d)) { do { radius=radius + 1; for (i=-radius; i <= radius; i++) { for (j=-radius; j <= radius; j++) { if (Math.abs(i) > radius - 1 || Math.abs(j) > radius - 1) { x=col + i; y=row + j; elevationXY=dem.getValue(y,x); if (elevationXY != noData) { if (elevationAB - elevationXY > d) { tmpDistance=Math.sqrt(i * i + j * j) * gridRes; tmpHeightDiff=elevationAB - elevationXY; if (tmpDistance < distance) { downslope=true; distance=tmpDistance; heightDiff=tmpHeightDiff; } } } } } } } while ((radius < maxRadius) & (downslope == false)); if (downslope == true) { switch (outputType) { case "tangent": output.setValue(row,col,heightDiff / distance); break; case "degrees": output.setValue(row,col,Math.atan(heightDiff / distance) * rad2deg); break; case "radians": output.setValue(row,col,Math.atan(heightDiff / distance)); break; case "distance": output.setValue(row,col,distance); break; } } else if (useLowest == true) { distance=Math.sqrt(Math.pow((col - minX),2) + Math.pow((row - minY),2)) * gridRes; heightDiff=elevationAB - minElev; switch (outputType) { case "tangent": output.setValue(row,col,heightDiff / distance); break; case "degrees": output.setValue(row,col,Math.atan(heightDiff / distance) * rad2deg); break; case "radians": output.setValue(row,col,Math.atan(heightDiff / distance)); break; case "distance": output.setValue(row,col,distance); break; } } } } if (cancelOp) { cancelOperation(); return; } progress=(float)(100f * row / (numRows - 1)); updateProgress("Loop 2 of 2:",(int)progress); } output.addMetadataEntry("Created by the " + getDescriptiveName() + " tool."); output.addMetadataEntry("Created on " + new Date()); dem.close(); output.close(); returnData(outputHeader); } catch (Exception e) { showFeedback(e.getMessage()); } finally { updateProgress("Progress: ",0); amIActive=false; myHost.pluginComplete(); } }
Used to execute this plugin tool.
public static <T>List<List<T>> chunkUp(List<T> list,int maxLength){ if (maxLength <= 0) { throw new IllegalArgumentException("maxLength must be > 0 but was " + maxLength); } int fullChunks=list.size() / maxLength; List<List<T>> result=new ArrayList<>(fullChunks + 1); for (int i=0; i < fullChunks; i++) { List<T> subList=list.subList(i * maxLength,(i + 1) * maxLength); if (subList.size() != maxLength) { throw new IllegalStateException("bogus length:" + subList.size() + " not "+ maxLength); } result.add(subList); } List<T> lastChunk=list.subList(fullChunks * maxLength,list.size()); if (!lastChunk.isEmpty()) result.add(lastChunk); return Collections.unmodifiableList(result); }
Divides the argument into chunks of at most the given length. All chunks except at most one will have length exactly maxLength. No chunks are empty. The result list is unmodifiable. It does <em>not</em> copy the list and simply shares it.
public VisorIgfsMetrics aggregate(int n){ if (n > 0) { foldersCnt/=n; filesCnt/=n; } return this; }
Aggregate metrics.
public boolean isIndexed(){ return isIndexed; }
Returns true if the fragment type is an array. <p> If a property value is an array and thereby a fragment array, this flag is set to true.
@Transactional private Token createToken(final long ttlSecs,final String tokenIdentity,final String service){ final String uUID=UUID.randomUUID().toString(); final Token token=new Token(); token.setTokenNumber(uUID); token.setTtlSecs(ttlSecs); token.setCreatedDate(new Date()); token.setService(service); token.setTokenIdentity(tokenIdentity); return tokenRepository.save(token); }
Create Token in database with given TTL in secs.
public void doKeyPressed(KeyInputEvent kie){ if (checkCommandeKey(kie)) { } else if (isActive()) { currentShortcut.keyPressed(kie); } }
This should be called to trigger the currentShortcut.keyPressed() method. This also check for command key used to provide isCtrlDown(), isShiftDown() and isAltDown().
@Override public double cloudletSubmit(Cloudlet cl){ return cloudletSubmit(cl,0); }
Receives an cloudlet to be executed in the VM managed by this scheduler.
public void notationDecl(String name,String publicId,String systemId){ }
Receive notification of a notation declaration. <p>By default, do nothing. Application writers may override this method in a subclass if they wish to keep track of the notations declared in a document.</p>
private Hashtable<VertexLabelType,EdgeLabelType> checkForNewVertex(VertexLabelType v){ Hashtable<VertexLabelType,EdgeLabelType> result=globalEdgeLookup.get(v); if (result == null) { result=new Hashtable<VertexLabelType,EdgeLabelType>(); globalEdgeLookup.put(v,result); vertexLabels.add(v); } return result; }
Handles new vertices.
@Override public void doIfHasInternetOrNotifyUser(NetworkAction networkAction){ notifyIfNoInternet(); if (networkAction == null) { return; } if (hasInternetConnection()) { networkAction.execute(networkMode); } else { networkAction.onNoNetwork(); } }
We want to notify the user if there is a server connection error OR no internet connection, but we want to try and perform the action if there is internet but no server connection.
public BinaryBlockMatrix(DataFrame dataFrame,MatrixMetadata matrixMetadata){ this.matrixMetadata=matrixMetadata; binaryBlocks=MLContextConversionUtil.dataFrameToMatrixBinaryBlocks(dataFrame,matrixMetadata); }
Convert a Spark DataFrame to a SystemML binary-block representation.
private List addDisplayable(Node parent){ List children=(List)this.displayableNodes.get(parent); if (children == null) { children=new ArrayList(); this.displayableNodes.put(parent,children); NodeList nl=parent.getChildNodes(); for (int i=0, len=nl.getLength(); i < len; i++) { Node child=nl.item(i); if (child.getNodeType() == Node.ELEMENT_NODE || child.getNodeType() == Node.COMMENT_NODE || (child.getNodeType() == Node.TEXT_NODE && (child.getNodeValue().trim().length() > 0))) { children.add(child); } } return children; } else { return new ArrayList(); } }
Adds a feature to the Displayable attribute of the DOMTreeModel object
protected final void SYSCALL(Instruction s,Operand address){ burs.ir.setHasSysCall(true); if (VM.BuildFor32Addr) { int numParams=Call.getNumberOfParams(s); int longParams=0; for (int pNum=0; pNum < numParams; pNum++) { if (Call.getParam(s,pNum).getType().isLongType()) { longParams++; } } RegisterOperand result=Call.getResult(s); RegisterOperand result2=null; if (result != null && result.getType().isLongType()) { result.setType(TypeReference.Int); result2=result; result=new RegisterOperand(regpool.getSecondReg(result.getRegister()),TypeReference.Int); } Operand[] params=new Operand[numParams]; for (int i=0; i < numParams; i++) { params[i]=Call.getParam(s,i); } MIR_Call.mutate(s,IA32_SYSCALL,result,result2,address,Call.getMethod(s),numParams + longParams); for (int paramIdx=0, mirCallIdx=0; paramIdx < numParams; ) { Operand param=params[paramIdx++]; if (param instanceof RegisterOperand) { RegisterOperand rparam=(RegisterOperand)param; if (rparam.getType().isLongType()) { rparam.setType(TypeReference.Int); MIR_Call.setParam(s,mirCallIdx++,new RegisterOperand(regpool.getSecondReg(rparam.getRegister()),TypeReference.Int)); } MIR_Call.setParam(s,mirCallIdx++,param); } else if (param instanceof LongConstantOperand) { long value=((LongConstantOperand)param).value; int valueHigh=(int)(value >> 32); int valueLow=(int)(value & 0xffffffff); MIR_Call.setParam(s,mirCallIdx++,IC(valueLow)); MIR_Call.setParam(s,mirCallIdx++,IC(valueHigh)); } else { MIR_Call.setParam(s,mirCallIdx++,param); } } } else { MIR_Call.mutate(s,IA32_SYSCALL,Call.getResult(s),null,address,Call.getMethod(s),Call.getNumberOfParams(s)); } EMIT(s); }
Expansion of SYSCALL. Expand longs registers into pairs of int registers.
public void addIStore(int local){ xop(ByteCode.ISTORE_0,ByteCode.ISTORE,local); }
Store integer from stack top into the given local.
private void extractParameters(ResultPoint[] bullsEyeCorners) throws NotFoundException { if (!isValid(bullsEyeCorners[0]) || !isValid(bullsEyeCorners[1]) || !isValid(bullsEyeCorners[2])|| !isValid(bullsEyeCorners[3])) { throw NotFoundException.getNotFoundInstance(); } int length=2 * nbCenterLayers; int[] sides={sampleLine(bullsEyeCorners[0],bullsEyeCorners[1],length),sampleLine(bullsEyeCorners[1],bullsEyeCorners[2],length),sampleLine(bullsEyeCorners[2],bullsEyeCorners[3],length),sampleLine(bullsEyeCorners[3],bullsEyeCorners[0],length)}; shift=getRotation(sides,length); long parameterData=0; for (int i=0; i < 4; i++) { int side=sides[(shift + i) % 4]; if (compact) { parameterData<<=7; parameterData+=(side >> 1) & 0x7F; } else { parameterData<<=10; parameterData+=((side >> 2) & (0x1f << 5)) + ((side >> 1) & 0x1F); } } int correctedData=getCorrectedParameterData(parameterData,compact); if (compact) { nbLayers=(correctedData >> 6) + 1; nbDataBlocks=(correctedData & 0x3F) + 1; } else { nbLayers=(correctedData >> 11) + 1; nbDataBlocks=(correctedData & 0x7FF) + 1; } }
Extracts the number of data layers and data blocks from the layer around the bull's eye.
boolean diagnoseMismatch(Environment env,Expression args[],Type argTypes[]) throws ClassNotFound { Type margType[]=new Type[1]; boolean saidSomething=false; int start=0; while (start < argTypes.length) { int code=clazz.diagnoseMismatch(env,id,argTypes,start,margType); String opName=(id.equals(idInit)) ? "constructor" : opNames[op]; if (code == -2) { env.error(where,"wrong.number.args",opName); saidSomething=true; } if (code < 0) break; int i=code >> 2; boolean castOK=(code & 2) != 0; boolean ambig=(code & 1) != 0; Type targetType=margType[0]; String ttype="" + targetType; if (castOK) env.error(args[i].where,"explicit.cast.needed",opName,argTypes[i],ttype); else env.error(args[i].where,"incompatible.type",opName,argTypes[i],ttype); saidSomething=true; start=i + 1; } return saidSomething; }
We're about to report a "unmatched method" error. Try to issue a better diagnostic by comparing the actual argument types with the method (or methods) available. In particular, if there is an argument which fails to match <em>any</em> method, we report a type mismatch error against that particular argument. The diagnostic will report a target type taken from one of the methods. <p> Return false if we couldn't think of anything smart to say.
public int defineTemporaryVariable(String name,ClassNode node,boolean store){ BytecodeVariable answer=defineVar(name,node,false,false); temporaryVariables.addFirst(answer); usedVariables.removeLast(); if (store) controller.getOperandStack().storeVar(answer); return answer.getIndex(); }
creates a temporary variable.
public MarkerMoveResult onMarkerMoved(Marker marker){ if (marker.equals(centerMarker)) { onCenterUpdated(marker.getPosition()); return MarkerMoveResult.moved; } return MarkerMoveResult.none; }
This modifies circle according to marker's type and position if the marker is position marker (from this circle), the circle will be moved according to marker's position if the marker is resizing marker (from this circle), the circle will be resized according to marker's position If the marker is not in this circle (it's not the position or resizing marker) no action will be done
void sendControllerEvents(MidiMessage message){ int size=controllerEventListeners.size(); if (size == 0) return; if (!(message instanceof ShortMessage)) { if (Printer.debug) Printer.debug("sendControllerEvents: message is NOT instanceof ShortMessage!"); return; } ShortMessage msg=(ShortMessage)message; int controller=msg.getData1(); List sendToListeners=new ArrayList(); for (int i=0; i < size; i++) { ControllerListElement cve=(ControllerListElement)controllerEventListeners.get(i); for (int j=0; j < cve.controllers.length; j++) { if (cve.controllers[j] == controller) { sendToListeners.add(cve.listener); break; } } } getEventDispatcher().sendAudioEvents(message,sendToListeners); }
Send midi player events.
public boolean removeEntity(Entity entity){ boolean wasRemoved=this.entities.remove(entity); if (wasRemoved) { this.isModified=true; } return wasRemoved; }
Remove an entity from this cube
public boolean isConnected(){ return status == ConnectionStatus.CONNECTED; }
Determines if the client is connected
XmlElements(XmlElement[] elems){ m_elems=elems; }
Construye un objeto de la clase.
public static SingleByteCharsetConverter initCharset(String javaEncodingName) throws UnsupportedEncodingException, SQLException { try { if (CharsetMapping.isMultibyteCharset(javaEncodingName)) { return null; } } catch ( RuntimeException ex) { SQLException sqlEx=SQLError.createSQLException(ex.toString(),SQLError.SQL_STATE_ILLEGAL_ARGUMENT,null); sqlEx.initCause(ex); throw sqlEx; } SingleByteCharsetConverter converter=new SingleByteCharsetConverter(javaEncodingName); CONVERTER_MAP.put(javaEncodingName,converter); return converter; }
Initialize the shared instance of a converter for the given character encoding.
public void forgetLoadedWallpaper(){ sGlobals.forgetLoadedWallpaper(); }
Remove all internal references to the last loaded wallpaper. Useful for apps that want to reduce memory usage when they only temporarily need to have the wallpaper. After calling, the next request for the wallpaper will require reloading it again from disk.
@Override public void transform(final Coordinate c,final Point2D p){ p.setLocation(xFromModelUnitsToPixels(c.x),yFromModelUnitsToPixels(c.y)); }
Implements PointTransformation.transform
public CProject(final int projectId,final String name,final String description,final Date creationDate,final Date modificationDate,final int addressSpaceCount,final List<DebuggerTemplate> assignedDebuggers,final SQLProvider provider){ Preconditions.checkArgument(projectId > 0,String.format("IE00226: Project ID %d is invalid. Project IDs must be strictly positive",projectId)); Preconditions.checkNotNull(name,"IE00227: Project names can't be null"); Preconditions.checkNotNull(description,"IE00228: Project descriptions can't be null"); Preconditions.checkNotNull(creationDate,"IE00229: Project creation dates can't be null"); Preconditions.checkNotNull(modificationDate,"IE00230: Project modification dates can't be null"); Preconditions.checkNotNull(provider,"IE00231: The SQL provider of the project can't be null"); m_configuration=new CProjectConfiguration(this,m_listeners,provider,projectId,name,description,creationDate,modificationDate,assignedDebuggers); m_addressSpaceCount=addressSpaceCount; m_provider=provider; }
Creates a new project object that represents a BinNavi project as stored in the database.
public void testGetCheckSum(){ SeeedStudioRfidProtocol instance=new SeeedStudioRfidProtocol(); assertEquals("F8",instance.getCheckSum(msgStandalone)); }
Test of getCheckSum method, of class SeeedStudioRfidProtocol.
@Override public NotificationChain eInverseRemove(InternalEObject otherEnd,int featureID,NotificationChain msgs){ switch (featureID) { case UmplePackage.ANONYMOUS_DERIVED_ATTRIBUTE_2__CODE_LANG_1: return ((InternalEList<?>)getCodeLang_1()).basicRemove(otherEnd,msgs); case UmplePackage.ANONYMOUS_DERIVED_ATTRIBUTE_2__CODE_LANGS_1: return ((InternalEList<?>)getCodeLangs_1()).basicRemove(otherEnd,msgs); } return super.eInverseRemove(otherEnd,featureID,msgs); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public boolean isStatic(){ return false; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public boolean equals(Object o1){ try { GMatrix m2=(GMatrix)o1; int i, j; if (nRow != m2.nRow || nCol != m2.nCol) { return false; } for (i=0; i < nRow; i++) { for (j=0; j < nCol; j++) { if (values[i][j] != m2.values[i][j]) { return false; } } } return true; } catch ( ClassCastException e1) { return false; } catch ( NullPointerException e2) { return false; } }
Returns true if the Object o1 is of type GMatrix and all of the data members of o1 are equal to the corresponding data members in this GMatrix.