code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
Expression compileFunction(int opPos) throws TransformerException {
int endFunc=opPos + getOp(opPos + 1) - 1;
opPos=getFirstChildPos(opPos);
int funcID=getOp(opPos);
opPos++;
if (-1 != funcID) {
Function func=m_functionTable.getFunction(funcID);
if (func instanceof FuncExtFunctionAvailable) ((Func... | Compile a built-in XPath function. |
public byte[] serialise(final Object object) throws SerialisationException {
return serialise(object,false);
}
| Serialises an object. |
public DeleteResponseMessage(DeleteResponseMessage other){
__isset_bitfield=other.__isset_bitfield;
if (other.isSetHeader()) {
this.header=new AsyncMessageHeader(other.header);
}
this.deleted=other.deleted;
}
| Performs a deep copy on <i>other</i>. |
public void createPackageContents(){
if (isCreated) return;
isCreated=true;
docletEClass=createEClass(DOCLET);
createEReference(docletEClass,DOCLET__LINE_TAGS);
createEOperation(docletEClass,DOCLET___HAS_LINE_TAG__STRING);
createEOperation(docletEClass,DOCLET___LINE_TAGS__STRING);
docletElementEClass=cr... | Creates the meta-model objects for the package. This method is guarded to have no affect on any invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc --> |
private void generateIntersectionSchema() throws DataFlowException {
List<Attribute> innerAttributes=innerOperator.getOutputSchema().getAttributes();
List<Attribute> outerAttributes=outerOperator.getOutputSchema().getAttributes();
List<Attribute> intersectionAttributes=innerAttributes.stream().filter(null).collec... | Create outputSchema, which is the intersection of innerOperator's schema and outerOperator's schema. The attributes have to be exactly the same (name and type) to be intersected. InnerOperator's attributes and outerOperator's attributes must: both contain the attributes to be joined. both contain "ID" attribute. (ID at... |
public void update(Graphics a,JComponent b){
for (int i=0; i < uis.size(); i++) {
((ComponentUI)(uis.elementAt(i))).update(a,b);
}
}
| Invokes the <code>update</code> method on each UI handled by this object. |
private void parseAllow(Attributes attributes){
if (md.actions != null) {
md.modeUsage=getModeUsage(attributes);
md.actions.addNoResultAction(new AllowAction(md.modeUsage));
}
else md.modeUsage=null;
}
| Parse an allow action. |
public SparseDoubleMatrix3D(int slices,int rows,int columns){
this(slices,rows,columns,slices * rows * (columns / 1000),0.2,0.5);
}
| Constructs a matrix with a given number of slices, rows and columns and default memory usage. All entries are initially <tt>0</tt>. |
public static void checkArgument(boolean expression){
if (!expression) {
throw new IllegalArgumentException();
}
}
| Ensures the truth of an expression involving one or more parameters to the calling method. |
public TriggerProcessStatusException(String message,ApplicationExceptionBean bean){
super(message,bean);
}
| Constructs a new exception with the specified detail message and bean for JAX-WS exception serialization. |
public void onWifiConnectivityChanged(boolean connected,final String networkSsid){
LOGD(TAG,"WIFI connectivity changed to " + (connected ? "enabled" : "disabled"));
if (connected && !mWifiConnectivity) {
mWifiConnectivity=true;
if (mCastManager.isFeatureEnabled(BaseCastManager.FEATURE_WIFI_RECONNECT)) {
... | Since framework calls this method twice when a change happens, we are guarding against that by caching the state the first time and avoiding the second call if it is the same status. |
public static boolean isGraphQLScratchFile(Project project,VirtualFile file){
if (file.getFileType() instanceof ScratchFileType) {
final PsiManager psiManager=PsiManager.getInstance(project);
final PsiFile psiFile=psiManager.findFile(file);
if (psiFile != null && psiFile.getFileType() == JSGraphQLSchemaFi... | Scratch virtual files don't return their actual file type, so we need to find the PsiFile to determine whether it's a GraphQL schema scratch file |
public DoubleMatrix2D multOuter(DoubleMatrix1D x,DoubleMatrix1D y,DoubleMatrix2D A){
int rows=x.size();
int columns=y.size();
if (A == null) A=x.like2D(rows,columns);
if (A.rows() != rows || A.columns() != columns) throw new IllegalArgumentException();
for (int row=rows; --row >= 0; ) A.viewRow(row).ass... | Outer product of two vectors; Sets <tt>A[i,j] = x[i] * y[j]</tt>. |
@Override protected void initData(){
this.presenter=new MainPresenter();
this.presenter.attachView(this);
this.gankType=GankType.daily;
this.mainAdapter=new MainAdapter(this,this.gankType);
this.mainAdapter.setListener(this);
this.mainRv.setAdapter(this.mainAdapter);
this.refreshData(this.gankType);
}
| Initialize the Activity data |
public final AlertDialog initiateScan(){
return initiateScan(ALL_CODE_TYPES,-1);
}
| Initiates a scan for all known barcode types with the default camera. |
public Builder withLockedInVersionId(long versionId){
if ((lockMap == null) || (this.versionId != null)) {
throw new IllegalStateException();
}
this.versionId=versionId;
return this;
}
| Associates the given locked-in version ID with this request. You may not call this method multiple times. |
public void didNotThrottle(int tenantClass){
super.startedAndFinished(Operation.READ,tenantClass,0,0);
}
| If no throttling was required for the tenant to pass through the throttling point |
public MultisigSignatureTransaction createSignature(){
return this.createSignature(Utils.generateRandomAccount());
}
| Creates a default (compatible) signature transaction. |
public synchronized void clearAnnotations(){
mAnnotations.clear();
mStringXY.clear();
}
| Removes all the existing annotations from the series. |
public boolean isSet(_Fields field){
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case STRING_THING:
return isSetString_thing();
case CHANGED:
return isSetChanged();
case I32_THING:
return isSetI32_thing();
case I64_THING:
return isSetI64_thing();
}
throw new IllegalStateE... | Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise |
protected boolean hasHistory(){
return false;
}
| Has History |
public static NodesInfoRequest nodesInfoRequest(String... nodesIds){
return new NodesInfoRequest(nodesIds);
}
| Creates a nodes info request against one or more nodes. Pass <tt>null</tt> or an empty array for all nodes. |
private void handleEnvSelectButtonSelected(){
Map<String,EnvironmentVariable> envVariables=getNativeEnvironment();
for ( String varName : getFieldValue().envVars.keySet()) {
envVariables.remove(varName);
}
NativeEnvironmentSelectionDialog dialog=new NativeEnvironmentSelectionDialog(getShell(),envVariables)... | Displays a dialog that allows user to select native environment variables to add to the table. |
public static byte[] parseMemoryString(final String memoryString){
final byte[] memoryData=new byte[memoryString.length() / 2];
for (int i=0, j=0; i < memoryString.length(); i+=2, j++) {
memoryData[j]=(byte)(lookup1[memoryString.charAt(i)] + lookup2[memoryString.charAt(i + 1)]);
}
return memoryData;
}
| Parses a memory string into a byte array. |
private ZKLogMetadataForReader(URI uri,String logName,String logIdentifier){
super(uri,logName,logIdentifier);
}
| metadata representation of a log |
static public NodeModel parse(InputSource is) throws SAXException, IOException, ParserConfigurationException {
return parse(is,true,true);
}
| Create a NodeModel from an XML input source. By default, all comments and processing instruction nodes are stripped from the tree. |
public final void lazySet(int index,short value){
this.set(index,value);
}
| Sets an element to the given value, but the update may not happen immediately |
public synchronized void flush(){
super.flush();
}
| Writes test information from the started reporters to their output view <ul> <li>ExtentHtmlReporter - creates or appends to an HTML file</li> <li>ExtentXReporter - updates database</li> <li>ExtentEmailReporter - creates or appends to an HTML file</li> <li>ExtentLogger - no action taken</li> </ul> |
public TypeCheckerBuilder usageWarnings(boolean usageWarnings){
this.assertionVisitor.includeUsageWarnings(usageWarnings);
return this;
}
| Enables or disables output of the warning messages about unused declarations. |
public boolean isUsernameIndex(String[] args,int index){
return index == 0;
}
| Return whether the specified command parameter index is a username parameter. |
public static Object max(Collection coll){
Iterator i=coll.iterator();
Comparable candidate=(Comparable)(i.next());
while (i.hasNext()) {
Comparable next=(Comparable)(i.next());
if (next.compareTo(candidate) > 0) candidate=next;
}
return candidate;
}
| Returns the maximum element of the given collection, according to the <i>natural ordering</i> of its elements. All elements in the collection must implement the <tt>Comparable</tt> interface. Furthermore, all elements in the collection must be <i>mutually comparable</i> (that is, <tt>e1.compareTo(e2)</tt> must not thr... |
private boolean isSizeConsistent(){
return isSizeConsistent(root);
}
| Checks if size is consistent. |
@Deprecated public void fullscreen() throws IllegalStateException {
setFullscreen(!fullscreen);
}
| Toggles view to fullscreen mode It saves currentState and calls pause() method. When fullscreen is finished, it calls the saved currentState before pause() In practice, it only affects STARTED state. If currenteState was STARTED when fullscreen() is called, it calls start() method after fullscreen() has ended. |
@Override public Object invoke(final Object proxy,final Method method,final Object[] parameters) throws Throwable {
if (eventTypes.isEmpty() || eventTypes.contains(method.getName())) {
if (hasMatchingParametersMethod(method)) {
return MethodUtils.invokeMethod(target,methodName,parameters);
}
return ... | Handles a method invocation on the proxy object. |
@Override public boolean budgetaryCheckForBill(final Map<String,Object> paramMap){
String cashbasedbudgetType=EMPTY_STRING, txnType=EMPTY_STRING;
BigDecimal debitAmt=null;
BigDecimal creditAmt=null;
BigDecimal txnAmt=null;
String glCode="";
Date asondate=null;
Date fromdate=null;
try {
String budget... | This API is handling the budget checking |
protected boolean isTestOffHeap(){
return false;
}
| Override as needed in subclass. |
public void drawVerticalItem(Graphics2D g2,Rectangle2D dataArea,PlotRenderingInfo info,XYPlot plot,ValueAxis domainAxis,ValueAxis rangeAxis,XYDataset dataset,int series,int item,CrosshairState crosshairState,int pass){
EntityCollection entities=null;
if (info != null) {
entities=info.getOwner().getEntityCollect... | Draws the visual representation of a single data item. |
public void expandToInclude(Envelope other){
if (other.isNull()) {
return;
}
if (isNull()) {
minx=other.getMinX();
maxx=other.getMaxX();
miny=other.getMinY();
maxy=other.getMaxY();
}
else {
if (other.minx < minx) {
minx=other.minx;
}
if (other.maxx > maxx) {
maxx=oth... | Enlarges this <code>Envelope</code> so that it contains the <code>other</code> Envelope. Has no effect if <code>other</code> is wholly on or within the envelope. |
public Boolean isDvPortOperationSupported(){
return dvPortOperationSupported;
}
| Gets the value of the dvPortOperationSupported property. |
public void removeAttribute(String name){
attributes.remove(name);
}
| Remove any configuration attribute associated with the specified name. If there is no such attribute, no action is taken. |
@DSSource({DSSourceKind.LOCATION}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:31:09.191 -0500",hash_original_method="62C2C1B6F0249A81DF96D887CDE57892",hash_generated_method="807BC3E63A8EC7B7CD4EFA3978F6E0B1") static public Allocation createCubemapFromCubeFaces(RenderScript rs,B... | Creates a non-mipmapped cubemap allocation for use as a graphics texture from 6 bitmaps containing the cube faces. All the faces must be the same size and power of 2 |
@Override public NotificationChain eInverseAdd(InternalEObject otherEnd,int featureID,NotificationChain msgs){
switch (featureID) {
case N4JSPackage.N4_MEMBER_ANNOTATION_LIST__OWNER:
if (eInternalContainer() != null) msgs=eBasicRemoveFromContainer(msgs);
return basicSetOwner((N4ClassifierDefinition)otherEnd,m... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public void logEvent(StoredException storedException,Callback<Object> callback){
sendLogEvent(storedException.threadName,storedException.stackTrace,callback);
}
| Send stored exception (i.e., crashes) to UDP endpoint |
@Transactional(readOnly=true) public List<Cheque> attentionChequesByDelay(){
return chequeRepository.findWithDelay(OffsetDateTime.now().minusDays(7).toString());
}
| Method attentionChequesByDelay return list of cheque, that has delay in diagnostic Use for engineers |
public Constraint_ createConstraint_(){
Constraint_Impl constraint_=new Constraint_Impl();
return constraint_;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private static byte CallNonvirtualByteMethod(JNIEnvironment env,int objJREF,int classJREF,int methodID) throws Exception {
if (VM.VerifyAssertions) {
VM._assert(VM.BuildForPowerPC,ERROR_MSG_WRONG_IMPLEMENTATION);
}
if (traceJNI) VM.sysWrite("JNI called: CallNonvirtualByteMethod \n");
RuntimeEntrypoints.c... | CallNonvirtualByteMethod: invoke a virtual method that returns a byte value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame <p> <strong>NOTE: This implementation is NOT used for IA32. On IA32, it is over... |
@ParameterizedRobolectricTestRunner.Parameters(name="Missing parameter = {0}") public static Collection<Object[]> data(){
return Arrays.asList(new Object[][]{{RegistrationResponse.PARAM_CLIENT_SECRET_EXPIRES_AT},{RegistrationResponse.PARAM_REGISTRATION_ACCESS_TOKEN},{RegistrationResponse.PARAM_REGISTRATION_CLIENT_URI... | TODO . |
public boolean isMalformed(){
return this.type == TYPE_MALFORMED_INPUT;
}
| Returns true if this result represents a malformed-input error. |
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
int row, col;
int numCols;
int numRows;
double z;
double noData;
float progress;
int i;
int numReclassRanges;
int numReclassRangesMinusOne;
String[] reclassRangeStr=null;
double[][] reclassRange;
... | Used to execute this plugin tool. |
@Override public synchronized void invalidate(String key,boolean fullExpire){
Entry entry=get(key);
if (entry != null) {
entry.softTtl=0;
if (fullExpire) {
entry.ttl=0;
}
put(key,entry);
}
}
| Invalidates an entry in the cache. |
public boolean isGradleSdkHome(String gradleHomePath){
return isGradleSdkHome(new File(gradleHomePath));
}
| Allows to answer if given virtual file points to the gradle installation root. |
private static void deleteFilesByDirectory(File directory){
if (directory != null && directory.exists() && directory.isDirectory()) for ( File item : directory.listFiles()) item.delete();
}
| Delete all files in given directory |
public StrBuilder trim(){
if (size == 0) {
return this;
}
int len=size;
final char[] buf=buffer;
int pos=0;
while (pos < len && buf[pos] <= ' ') {
pos++;
}
while (pos < len && buf[len - 1] <= ' ') {
len--;
}
if (len < size) {
delete(len,size);
}
if (pos > 0) {
delete(0,pos);
... | Trims the builder by removing characters less than or equal to a space from the beginning and end. |
static void predictLeafIndex(Predictor predictor,List<SimpleEntry<Integer,FVec>> data){
int count=0;
for ( SimpleEntry<Integer,FVec> pair : data) {
int[] leafIndexes=predictor.predictLeaf(pair.getValue());
System.out.printf("leafIndexes[%d]: %s%s",count++,Arrays.toString(leafIndexes),System.lineSeparator()... | Predicts leaf index of each tree. |
public static Graph replaceNodes(Graph originalGraph,List<Node> newVariables){
Graph reference=new EdgeListGraph(newVariables);
Graph convertedGraph=new EdgeListGraph(newVariables);
for ( Edge edge : originalGraph.getEdges()) {
Node node1=reference.getNode(edge.getNode1().getName());
Node node2=reference... | Converts the given graph, <code>originalGraph</code>, to use the new variables (with the same names as the old). |
public FBCachedBlob(byte[] data){
blobData=data;
}
| Create an instance using the cached data. |
@Override public void emitTuples(){
final int TUPLE_SIZE_COPY=tupleSize;
final boolean EMIT_SAME_TUPLE_COPY=emitSameTuple;
if (firstTime) {
if (EMIT_SAME_TUPLE_COPY) {
for (int i=count--; i-- > 0; ) {
output.emit(sameTupleArray);
}
}
else {
for (int i=count--; i-- > 0; ) {
... | Emits byte array of specified size. Emits either the same byte array or creates new byte array every time depending on the value of emitSameTuple property. Local copies of tupleSize and emitSameTuple are made to improve the performance. |
public void updateBandwidth(){
try {
String sDown=GUIUtils.rate2speed(GUIMediator.instance().getBTDownloadMediator().getDownloadsBandwidth());
String sUp=GUIUtils.rate2speed(GUIMediator.instance().getBTDownloadMediator().getUploadsBandwidth());
int downloads=GUIMediator.instance().getCurrentDownloads();
... | Updates the bandwidth statistics. |
public int iterativeSize(){
IntList p=this;
int size=0;
while (p != null) {
size+=1;
p=p.tail;
}
return size;
}
| Returns the size of this IntList. |
private static void shutdown() throws Exception {
try (IDiagnosticsContextScope diagCtxt=DiagnosticsContextFactory.createContext("IDM Shutdown","")){
logger.info("Stopping IDM Server...");
if (registry != null) {
logger.debug("Unbinding the registry...");
registry.unbind(IDENTITY_MANAGER_BIND_NAME... | Shutdown the IDM service. |
public InstantiatedType instantiate(ReferenceType... typeArguments){
if (typeArguments.length != this.getTypeParameters().size()) {
throw new IllegalArgumentException("number of arguments and parameters must match");
}
Substitution<ReferenceType> substitution=Substitution.forArgs(this.getTypeParameters(),type... | Creates a type substitution using the given type arguments and applies it to this type. |
public MoreLikeThisQueryBuilder unlike(Item... unlikeItems){
this.unlikeItems=new ArrayList<>();
return addUnlikeItem(unlikeItems);
}
| Sets the documents from which the terms should not be selected from. |
public static void validateUTF8(byte[] utf8,int start,int len) throws MalformedInputException {
int count=start;
int leadByte=0;
int length=0;
int state=LEAD_BYTE;
while (count < start + len) {
int aByte=utf8[count] & 0xFF;
switch (state) {
case LEAD_BYTE:
leadByte=aByte;
length=bytesFromUTF8[aB... | Check to see if a byte array is valid utf-8 |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
public Header(ByteProvider byteProvider) throws IOException {
MXFPropertyPopulator.populateField(byteProvider,this,"numberOfElements");
MXFPropertyPopulator.populateField(byteProvider,this,"sizeOfElement");
}
| Instantiates a new collection Header. |
public void testConsumeQueue() throws Exception {
MessageProducer producer=createProducer(0);
consumerDestination=session.createQueue(getConsumerSubject());
producerDestination=session.createQueue(getProducerSubject());
MessageConsumer consumer=createConsumer();
connection.start();
for (int i=0; i < data.le... | Sends and consumes the messages to a queue destination. |
public ThisTypeRefNominal createThisTypeRefNominal(){
ThisTypeRefNominalImpl thisTypeRefNominal=new ThisTypeRefNominalImpl();
return thisTypeRefNominal;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static String stringArrayToIndentedString(String[] A,int indent){
if (A.length == 0) {
return A[0];
}
String result=A[0];
for (int i=1; i < A.length; i++) {
result=result + "\n" + StringHelper.copyString(" ",indent)+ A[i];
}
return result;
}
| Returns the array of strings as a single string, where the first line is inserted at column indent (Java numbering, columns starting at 0). |
public WebBasketLine add(int M_Product_ID,String Name,BigDecimal Qty,BigDecimal Price){
for (int i=0; i < m_lines.size(); i++) {
WebBasketLine wbl=(WebBasketLine)m_lines.get(i);
if (wbl.getM_Product_ID() == M_Product_ID) {
wbl.addQuantity(Qty);
getTotal(true);
return wbl;
}
}
WebBask... | Add Line. Adds qty to the line, if same product |
public Instances resampleWithWeights(Random random,double[] weights,boolean[] sampled,boolean representUsingWeights){
if (weights.length != numInstances()) {
throw new IllegalArgumentException("weights.length != numInstances.");
}
Instances newData=new Instances(this,numInstances());
if (numInstances() == 0... | Creates a new dataset of the same size using random sampling with replacement according to the given weight vector. The weights of the instances in the new dataset are set to one. The length of the weight vector has to be the same as the number of instances in the dataset, and all weights have to be positive. Uses Walk... |
public void writeBorders(){
write(this.linenum,0,this.linenum + 1,0);
write(this.linenum,this.chars_per_line + 1,this.linenum + 1,this.chars_per_line + 1);
}
| Print vertical borders on the current line at the left and right sides of the page at character positions 0 and chars_per_line + 1. Border lines are one text line in height <P> This was not in the original class, but was added afterwards by Dennis Miller. |
public synchronized boolean repeatRequest(boolean showRationale){
if (messageSent) {
return false;
}
try {
Message msg=Message.obtain();
msg.what=PermissiveHandler.REPEAT_REQUEST;
msg.arg1=showRationale ? 1 : 0;
messenger.send(msg);
messageSent=true;
return true;
}
catch ( RemoteEx... | Sends a message to repeat current request. <p>It's also possible to re-enable rationale display when user refuses request again.</p> |
public void disableCGCopy(FunctionalAPIImpl impl,ConsistencyGroupCopyUID cgCopy) throws RecoverPointException {
String cgName=null;
String cgCopyName=null;
try {
cgCopyName=impl.getGroupCopyName(cgCopy);
cgName=impl.getGroupName(cgCopy.getGroupUID());
boolean startTransfer=true;
logger.info(String... | Perform a disable image access on a CG copy |
private byte[] generateChallenge(List<String> realms,String qopStr,String cipherStr) throws UnsupportedEncodingException, IOException {
ByteArrayOutputStream out=new ByteArrayOutputStream();
for (int i=0; realms != null && i < realms.size(); i++) {
out.write("realm=\"".getBytes(encoding));
writeQuotedString... | Generates challenge to be sent to client. digest-challenge = 1#( realm | nonce | qop-options | stale | maxbuf | charset algorithm | cipher-opts | auth-param ) realm = "realm" "=" <"> realm-value <"> realm-value = qdstr-val nonce = "nonce" "=" <"> nonce-value <"> nonce-value = qdstr-... |
public final Vertex dest(){
return sym().orig();
}
| Gets the vertex for the edge's destination |
public FilePath append(FilePath subPath){
return append(subPath.elements());
}
| Appends another path to end of this one. |
private CharsToNameCanonicalizer(){
_canonicalize=true;
_intern=true;
_dirty=true;
_hashSeed=0;
_longestCollisionList=0;
initTables(DEFAULT_TABLE_SIZE);
}
| Main method for constructing a master symbol table instance. |
public Bitmap toBitmap(){
if (mSize == -1) {
this.actionBarSize();
}
final Bitmap bitmap=Bitmap.createBitmap(this.getIntrinsicWidth(),this.getIntrinsicHeight(),Bitmap.Config.ARGB_8888);
this.style(Paint.Style.FILL);
final Canvas canvas=new Canvas(bitmap);
this.setBounds(0,0,canvas.getWidth(),canvas.getH... | Creates a BitMap to use in Widgets or anywhere else |
public void addListener(ConnectableDeviceListener listener){
if (!listeners.contains(listener)) {
listeners.add(listener);
}
}
| Adds the ConnectableDeviceListener to the list of listeners for this ConnectableDevice to receive certain events. |
private void interpretJcc(final ReilInstruction instruction,final String programCounter){
final Pair<Boolean,BigInteger> firstValue=loadLongValue(instruction.getFirstOperand());
if (!firstValue.second().equals(BigInteger.ZERO) && (instruction.getThirdOperand().getType() == OperandType.SUB_ADDRESS)) {
final Stri... | Interprets a JCC instruction. |
@Override public String toString(){
if (eIsProxy()) return super.toString();
StringBuffer result=new StringBuffer(super.toString());
result.append(" (character: ");
result.append(character);
result.append(", sequence: ");
result.append(sequence);
result.append(')');
return result.toString();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private int checkInterruptWhileWaiting(Node node){
return Thread.interrupted() ? (transferAfterCancelledWait(node) ? THROW_IE : REINTERRUPT) : 0;
}
| Checks for interrupt, returning THROW_IE if interrupted before signalled, REINTERRUPT if after signalled, or 0 if not interrupted. |
private Name lambdaName(){
return names.lambda.append(names.fromString(enclosingMethodName() + "$" + lambdaCount++));
}
| For a non-serializable lambda, generate a simple method. |
public static byte[] generatePrivateID(AsymmetricCipherKeyPair id){
return encodeDHPrivateKey((DHPrivateKeyParameters)id.getPrivate());
}
| Generates a private ID for the purposes of long term storage. |
public static void writeStaticField(final Class<?> cls,final String fieldName,final Object value,final boolean forceAccess) throws IllegalAccessException {
Field field=FieldUtils.getField(cls,fieldName,forceAccess);
if (field == null) {
throw new IllegalArgumentException("Cannot locate field " + fieldName + " o... | Write a named static Field. Superclasses will be considered. |
public ShoppingCartItem findCartItem(int index){
if (cartLines.size() <= index) {
return null;
}
return cartLines.get(index);
}
| Get a ShoppingCartItem from the cart object. |
public SingletonTask(ScheduledExecutorService ses,Runnable task){
super();
this.task=task;
this.ses=ses;
}
| Construct a new SingletonTask for the given runnable. The context is used to manage the state of the task execution and can be shared by more than one instance of the runnable. |
public void append(byte[] src){
append(src,0,src.length);
}
| Appends the income data to be read by handshake protocol. The attempts to overflow the buffer by means of this methods seem to be futile because of: 1. The SSL protocol specifies the maximum size of the record and record protocol does not pass huge messages. (see TLS v1 specification http://www.ietf.org/rfc/rfc2246.txt... |
public String readPersistentString(String key){
try {
if (checkService()) {
byte[] bytes=sService.readPersistentBytes(key);
if (bytes != null) {
return new String(bytes,"UTF-8");
}
}
}
catch ( RemoteException e) {
}
catch ( UnsupportedEncodingException e) {
Log.e(TAG,e.get... | Read a string from persistent storage |
static int parse(String c){
try {
int skipInitial, skipBetween;
if (c.charAt(0) == '#') {
skipInitial=1;
skipBetween=0;
}
else if (c.startsWith("rgb:")) {
skipInitial=4;
skipBetween=1;
}
else {
return 0;
}
int charsForColors=c.length() - skipInitial - 2 * sk... | Parse color according to http://manpages.ubuntu.com/manpages/intrepid/man3/XQueryColor.3.html <p/> Highest bit is set if successful, so return value is 0xFF${R}${G}${B}. Return 0 if failed. |
public void onLineChange(Context cx,int lineno){
this.lineNumber=lineno;
if (!breakpoints[lineno] && !dim.breakFlag) {
boolean lineBreak=contextData.breakNextLine;
if (lineBreak && contextData.stopAtFrameDepth >= 0) {
lineBreak=(contextData.frameCount() <= contextData.stopAtFrameDepth);
}
if (... | Called when the current position has changed. |
public void testListFilesPathDoesNotExist() throws Exception {
Collection<IgfsFile> paths=null;
try {
paths=igfs.listFiles(SUBDIR);
}
catch ( IgniteException ignore) {
}
assert paths == null || paths.isEmpty();
}
| Test list files routine when the path doesn't exist remotely. |
public static double clamp(double value,double min,double max){
return value > max ? max : (value < min ? min : value);
}
| Restricts a value to the range [min, max] degrees, clamping values outside the range. Values less than min are returned as min, and values greater than max are returned as max. Values within the range are returned unmodified. <p/> The result of this method is undefined if min is greater than max. |
static final int hash(Object key){
int h;
return (key == null) ? 0 : (h=key.hashCode()) ^ (h >>> 16);
}
| Computes key.hashCode() and spreads (XORs) higher bits of hash to lower. Because the table uses power-of-two masking, sets of hashes that vary only in bits above the current mask will always collide. (Among known examples are sets of Float keys holding consecutive whole numbers in small tables.) So we apply a transfo... |
public static double deriv(double pred,double y,double c){
double x=pred - y;
if (Math.abs(x) <= c) return x;
else return c * Math.signum(x);
}
| Computes the first derivative of the HuberLoss loss |
public IsilonList<IsilonSmartQuota> listQuotas(String resumeToken) throws IsilonException {
return list(_baseUrl.resolve(URI_QUOTAS),"quotas",IsilonSmartQuota.class,resumeToken);
}
| List all smartquotas |
public void opc_checkcast(short classIndex){
emitByte(opc_checkcast);
emitShort(classIndex);
}
| Assumes the checkcast succeeds |
@HLEFunction(nid=0x2C8E6AB3,version=150,checkInsideInterrupt=true) public int __sceSasGetPauseFlag(int sasCore){
checkSasHandleGood(sasCore);
int pauseFlag=0;
for (int i=0; i < voices.length; i++) {
if (voices[i].isPaused()) {
pauseFlag|=(1 << i);
}
}
return pauseFlag;
}
| Get the pause flag for all the voices. |
public static void main(String[] args){
String jVersion=System.getProperty("java.version");
if (!(jVersion.startsWith("1.5"))) {
JOptionPane.showMessageDialog(null,"Require Java Version 1.5 or up - Not " + jVersion,"AdempierePLAF - Version Conflict",JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
Ini.load... | Start Class With Adempiere Look |
public static void writeElement(final XMLStreamWriter writer,final String elementName,final int value) throws XMLStreamException {
writer.writeStartElement(elementName);
writer.writeCharacters(XMLConvert.toString(value));
writer.writeEndElement();
}
| Writes an element. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.