code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public LogSimpleItemEventCommand(final RPObject item,final RPEntity player,final String event,final String param1,final String param2,final String param3,final String param4){
this.item=item;
this.player=player;
this.event=event;
this.param1=param1;
this.param2=param2;
this.param3=param3;
this.param4=para... | creates a simple item log command |
public static List propertyDescriptors(int apiLevel){
return PROPERTY_DESCRIPTORS;
}
| Returns a list of structural property descriptors for this node type. Clients must not modify the result. |
public static void registerMetadata(MetadataRegistry registry){
if (registry.isRegistered(KEY)) {
return;
}
ElementCreator builder=registry.build(KEY);
builder.addAttribute(LABEL);
builder.addAttribute(REL);
builder.addAttribute(VALUE_STRING);
builder.addElement(EntryLink.KEY);
}
| Registers the metadata for this element. |
@Override public Object clone(){
ByteArrayList clone=null;
try {
clone=(ByteArrayList)super.clone();
clone._data=(byte[])_data.clone();
}
catch ( CloneNotSupportedException e) {
}
return clone;
}
| Returns a clone of this list. Since this is a primitive collection, this will be a deep clone. |
@Post public String handlePost(String fmJson){
IFirewallService firewall=(IFirewallService)getContext().getAttributes().get(IFirewallService.class.getCanonicalName());
String newMask;
try {
newMask=jsonExtractSubnetMask(fmJson);
}
catch ( IOException e) {
log.error("Error parsing new subnet mask: " + ... | Allows setting of subnet mask |
void invalidConversion(Converter converter,Object value){
String valueType=(value == null ? "null" : value.getClass().getName());
String msg="Converting '" + valueType + "' value '"+ value+ "'";
try {
Object result=converter.convert(getExpectedType(),value);
fail(msg + ", expected ConversionException, but... | Test Conversion Error |
private void checkRanges(){
for (int i=0; i < problem.getNumberOfObjectives(); i++) {
if (Math.abs(minimum[i] - maximum[i]) < Settings.EPS) {
throw new IllegalArgumentException("objective with empty range");
}
}
}
| Checks if any objective has a range that is smaller than machine precision. |
private static void checkCRL(DistributionPoint dp,ExtendedPKIXParameters paramsPKIX,X509Certificate cert,Date validDate,X509Certificate defaultCRLSignCert,PublicKey defaultCRLSignKey,CertStatus certStatus,ReasonsMask reasonMask,List certPathCerts) throws AnnotatedException {
Date currentDate=new Date(System.currentTi... | Checks a distribution point for revocation information for the certificate <code>cert</code>. |
@Override public String remove(final Object key){
return null;
}
| Method remove() |
@Override public boolean equals(Object obj){
if (obj == this) {
return true;
}
if (!(obj instanceof KeyToGroupMap)) {
return false;
}
KeyToGroupMap that=(KeyToGroupMap)obj;
if (!ObjectUtilities.equal(this.defaultGroup,that.defaultGroup)) {
return false;
}
if (!this.keyToGroupMap.equals(that.... | Tests the map for equality against an arbitrary object. |
public static boolean isWildcardFileName(String name){
if (name.contains("*") || name.contains("?")) {
final String unescaped;
if (isWindows()) {
unescaped=name.replace("%%","%_").replace("%*","%_").replace("%?","%_");
}
else {
unescaped=name.replace("\\\\","\\_").replace("\\*","\\_").replace... | Returns true if the given name or path contains unescaped wildcard characters. The characters "*" and "?" are considered wildcard chars if they are not escaped with a preceding backslash character \ (Unix and MAC) or % character (Windows). |
public TeXParser(boolean isPartial,String parseString,TeXFormula formula,boolean firstpass){
this.formula=formula;
this.isPartial=isPartial;
if (parseString != null) {
this.parseString=new StringBuffer(parseString);
this.len=parseString.length();
this.pos=0;
if (firstpass) {
firstpass();
... | Create a new TeXParser with or without a first pass |
private static void doSort(char[] a,int left,int right,char[] work,int workBase,int workLen){
if (right - left < QUICKSORT_THRESHOLD) {
sort(a,left,right,true);
return;
}
int[] run=new int[MAX_RUN_COUNT + 1];
int count=0;
run[0]=left;
for (int k=left; k < right; run[count]=k) {
if (a[k] < a[k + ... | Sorts the specified range of the array. |
public void resumeWork(){
mExitTasksEarly=false;
setPause(false);
if (DEBUG) {
CLog.d(LOG_TAG,"work_status: resumeWork %s",this);
}
}
| Resume the work |
protected void sequence_AnnotatedExportableElement_N4EnumDeclaration(ISerializationContext context,N4EnumDeclaration semanticObject){
genericSequencer.createSequence(context,semanticObject);
}
| Contexts: ExportableElement returns N4EnumDeclaration Constraint: ( ( annotationList=AnnotatedExportableElement_N4EnumDeclaration_1_3_0 declaredModifiers+=N4Modifier* name=BindingIdentifier literals+=N4EnumLiteral literals+=N4EnumLiteral ) | (declaredModifiers+=N4Modifier* name=BindingIdentifier? (literals+=N4Enum... |
private void updateProgress(String progressLabel,int progress){
if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) {
myHost.updateProgress(progressLabel,progress);
}
previousProgress=progress;
previousProgressLabel=progressLabel;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
public static <A>FutureWTSeq<A> of(final AnyMSeq<FutureW<A>> monads){
return new FutureWTSeq<>(monads);
}
| Construct an FutureWT from an AnyM that wraps a monad containing FutureWs |
public static InputStream read(File f) throws IOException {
InputStream is=new BufferedInputStream(new FileInputStream(f));
if (f.toString().endsWith(".bz2")) is=new BZip2CompressorInputStream(is);
if (f.toString().endsWith(".gz")) is=new GZIPInputStream(is);
return is;
}
| open text files for reading. If the files are compressed, choose the appropriate decompression method automatically |
public static void writeXmlDocument(Node node,OutputStream os,String encoding,boolean omitXmlDeclaration,boolean indent,int indentAmount) throws TransformerException {
Transformer transformer=createOutputTransformer(encoding,omitXmlDeclaration,indent,indentAmount);
transformDomDocument(transformer,node,os);
}
| Serializes a DOM <code>Node</code> to an <code>OutputStream</code> using JAXP TrAX. |
public static String unicodeEscape(String s){
if (allAscii(s)) {
return s;
}
StringBuilder sb=new StringBuilder(s.length());
int len=s.length();
for (int i=0; i < len; ++i) {
char ch=s.charAt(i);
if (ch <= 127) {
sb.append(ch);
}
else {
sb.append("\\u");
String hexString=Int... | Replaces each non-ascii character in s with its Unicode escape sequence \\uxxxx where xxxx is a hex number. Existing escape sequences won't be affected. |
protected void processIdent(DetailAST aAST){
final int parentType=aAST.getParent().getType();
if (((parentType != TokenTypes.DOT) && (parentType != TokenTypes.METHOD_DEF)) || ((parentType == TokenTypes.DOT) && (aAST.getNextSibling() != null))) {
referenced.add(aAST.getText());
}
}
| Collects references made by IDENT. |
UnixDirectoryStream(UnixPath dir,long dp,DirectoryStream.Filter<? super Path> filter){
this.dir=dir;
this.dp=dp;
this.filter=filter;
}
| Initializes a new instance |
@Listener @IsCancelled(Tristate.UNDEFINED) public void onPlayerJoin(ClientConnectionEvent.Login event){
if (!(Sponge.getServer().getOnlinePlayers().size() >= Sponge.getServer().getMaxPlayers())) {
return;
}
if (event.getTargetUser().hasPermission(joinFullServer)) {
if (cca.getNodeOrDefault().getReservedSl... | At the time the player joins if the server is full, check if they are permitted to join a full server. |
public void testIdempotency() throws Exception {
File lockFile=new File("testIdempotency.lock");
WriteLock wl=new WriteLock(lockFile);
for (int i=0; i < 100; i++) {
boolean locked=wl.acquire();
assertTrue("Acquire must succeed",locked);
assertTrue("File must be locked",wl.isLocked());
}
for (int i... | Confirm that acquire and release operations are idempotent. |
public SimpleDictionary(String... aWords){
words=new HashSet<String>();
for ( String word : aWords) {
words.add(word.toLowerCase());
}
}
| Create a simple dictionary from a list of string. This can be used for testing |
private static void usage(){
for ( String s : USAGE_MESSAGE) {
System.out.println(s);
}
for ( String s : WELCOME_MESSAGE) {
System.out.println(s);
}
}
| Prints out the usage. |
public void runTest() throws Throwable {
Document doc;
Element element;
String nullNS=null;
doc=(Document)load("staffNS",true);
element=doc.createElementNS("http://www.w3.org/DOM/Test/L2","dom:elem");
{
boolean success=false;
try {
element.setAttributeNS(nullNS,"dom:root","test");
}
catch (... | Runs the test case. |
private void assignTasksToContainers(int[] taskCountPerContainer,List<String> taskNamesToAssign,List<TaskGroup> containers){
for ( TaskGroup taskGroup : containers) {
for (int j=taskGroup.size(); j < taskCountPerContainer[taskGroup.getContainerId()]; j++) {
String taskName=taskNamesToAssign.remove(0);
... | Assigns tasks from the specified list to containers that have fewer containers than indicated in taskCountPerContainer. |
public Problem(String problem,String[] causes,Throwable error){
this.problem=problem;
this.causes=causes;
this.error=error;
}
| Construct ProblemAndCauses. |
public static String convertToBitcoinURI(NetworkParameters params,String address,@Nullable Coin amount,@Nullable String label,@Nullable String message){
checkNotNull(params);
checkNotNull(address);
if (amount != null && amount.signum() < 0) {
throw new IllegalArgumentException("Coin must be positive");
}
... | Simple Bitcoin URI builder using known good fields. |
private static OFActionSetNwSrc decode_set_src_ip(String actionToDecode,OFVersion version,Logger log){
Matcher n=Pattern.compile("(?:(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+))").matcher(actionToDecode);
if (n.matches()) {
IPv4Address ipaddr=IPv4Address.of(get_ip_addr(n,actionToDecode,log));
OFActionSetNwSrc.Builder... | Parse set_nw_src actions. The key and delimiter for the action should be omitted, and only the data should be presented to this decoder. TODO should consider using IPv4AddressWithMask's built-in parser.... |
public TimingLogger(String tag,String label){
reset(tag,label);
}
| Create and initialize a TimingLogger object that will log using the specific tag. If the Log.isLoggable is not enabled to at least the Log.VERBOSE level for that tag at creation time then the addSplit and dumpToLog call will do nothing. |
public boolean visitFunction(ExpressionOwner owner,Function func){
if ((func instanceof FuncCurrent) || (func instanceof FuncExtFunction)) m_isAbs=false;
return true;
}
| Visit a function. |
public SeekableByteChannel open(GcsPath path) throws IOException {
return new GoogleCloudStorageReadChannel(storageClient,path.getBucket(),path.getObject(),errorExtractor,new ClientRequestHelper<StorageObject>());
}
| Opens an object in GCS. <p>Returns a SeekableByteChannel that provides access to data in the bucket. |
protected void calculatePartialsPartialsPruning(double[] partials1,double[] matrices1,double[] partials2,double[] matrices2,double[] partials3,int[] matrixMap){
throw new RuntimeException("calculateStatesStatesPruning not implemented using matrixMap");
}
| Calculates partial likelihoods at a node when both children have partials. |
@Override public String initialize(){
m_Current=0;
for ( File dataset : m_Datasets) {
if (!dataset.exists()) return "Dataset does not exist: " + dataset;
if (dataset.isDirectory()) return "Dataset points to a directory: " + dataset;
}
return null;
}
| Initializes the provider to start providing datasets from scratch. |
public FacesException(String message){
super(message);
}
| <p>Construct a new exception with the specified detail message and no root cause.</p> |
public static String convertResourcePathToClassName(String resourcePath){
Assert.notNull(resourcePath,"Resource path must not be null");
return resourcePath.replace('/','.');
}
| Convert a "/"-based resource path to a "."-based fully qualified class name. |
private void gen_poly(){
int i, j;
gg[0]=2;
gg[1]=1;
for (i=2; i <= NN - KK; i++) {
gg[i]=1;
for (j=i - 1; j > 0; j--) {
if (gg[j] != 0) {
gg[j]=gg[j - 1] ^ alpha_to[(index_of[gg[j]] + i) % NN];
}
else {
gg[j]=gg[j - 1];
}
}
gg[0]=alpha_to[(index_of[gg[0]] + i)... | Generates the polynomial for a TT-error correction code. Length NN = ( 2 ** MM -1 ) Reed Solomon code from the product of (X+alpha**i), i=1..2*tt |
@DSSafe(DSCat.IPC_CALLBACK) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:59:17.497 -0500",hash_original_method="4ADFD820FBAEE3B9207F7288ABB2B3FA",hash_generated_method="DBD9934380248D13C69A49A59A76507F") @Override public void handleMessage(Message msg){
AsyncResult ar;
switch (... | Handles events coming from the phone stack. Overridden from handler. |
public static QueryTask.QuerySpecification buildChildServiceTaskStatusQuerySpec(final String selfLink,final Class childClass,final TaskState.TaskStage... stages){
checkArgument(stages != null && stages.length >= 1,"stages.length must be >= 1");
QueryTask.Query parentLinkClause=new QueryTask.Query().setTermPropertyN... | Builds a query specification which will query for service instances of type childClass which have the parentLink field set to the param value and the stage execution field one of the values passed using stages param. |
public IgfsLocalMetrics metrics(){
return metrics;
}
| Get local metrics. |
Shape adjustPaintRegion(Shape a){
return adjustAllocation(a);
}
| Adjusts <code>a</code> based on the visible region and returns it. |
public boolean isRemoved(){
return this.removed;
}
| Always checked when the monitor is held on this object |
public void run(){
while (true) {
try {
handleIncomingData();
}
catch ( java.io.IOException e) {
log.warn("run: Exception: " + e.toString());
}
}
}
| Handle incoming characters. This is a permanent loop, looking for input messages in character form on the stream connected to the PortController via <code>connectPort</code>. Terminates with the input stream breaking out of the try block. |
private Object toDate(final Class type,final long value){
if (type.equals(Date.class)) {
return new Date(value);
}
if (type.equals(java.sql.Date.class)) {
return new java.sql.Date(value);
}
if (type.equals(java.sql.Time.class)) {
return new java.sql.Time(value);
}
if (type.equals(java.sql.Time... | Convert a long value to the specified Date type for this <i>Converter</i>. <p> This method handles conversion to the following types: <ul> <li><code>java.util.Date</code></li> <li><code>java.util.Calendar</code></li> <li><code>java.sql.Date</code></li> <li><code>java.sql.Time</code></li> <li><code>java.sql.Timestamp</c... |
@Override public void displayCursor(Cursor cursor){
mAdapter.changeCursor(cursor);
}
| Display the contents of the cursor as a ListView. |
public boolean isSet(_Fields field){
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case BONK:
return isSetBonk();
}
throw new IllegalStateException();
}
| Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise |
public static String[] detectCleanMovienameAndYear(String filename){
String[] ret={"",""};
LOGGER.trace("Parse filename for movie title: \"" + filename + "\"");
if (filename == null || filename.isEmpty()) {
LOGGER.warn("Filename empty?!");
return ret;
}
String fname=filename.replaceFirst("\\.\\w{2,4}$... | Tries to get movie name and year from filename<br> 1. splits string using common delimiters ".- ()"<br> 2. searches for first occurrence of common stopwords<br> 3. if last token is 4 digits, assume year and set [1]<br> 4. everything before the first stopword must be the movie name :p |
public static boolean isWildcard(String format){
String routerUrl=cleanUrl(format);
String[] routerParts=routerUrl.split("/");
for ( String routerPart : routerParts) {
if (routerPart.length() > 2 && routerPart.charAt(0) == ':' && routerPart.charAt(routerPart.length() - 1) == ':') {
return true;
}
... | Check if given router url format is a :wildcard: format |
public String transformFieldDescriptor(String owner,String name,String desc){
return DescriptorMapping.getInstance().getFieldDesc(owner,name,desc);
}
| Determine if the signature of the given field needs to be transformed, and transform if necessary |
@Transient public boolean isDirty(){
for ( IndicatorSeries item : this.getIndicatorSeries()) {
if (item.isDirty()) return true;
}
return super.isDirty();
}
| Method isDirty. |
public AWTTerminalFrame(String title,TerminalSize terminalSize,TerminalEmulatorDeviceConfiguration deviceConfiguration,AWTTerminalFontConfiguration fontConfiguration,TerminalEmulatorColorConfiguration colorConfiguration,TerminalEmulatorAutoCloseTrigger... autoCloseTriggers){
this(title,new AWTTerminal(terminalSize,de... | Creates a new AWTTerminalFrame using a specified title and a series of AWT terminal configuration objects |
@Override public void onUpgrade(SQLiteDatabase db,ConnectionSource connectionSource,int oldVersion,int newVersion){
try {
Log.i(DatabaseHelper.class.getName(),"onUpgrade");
TableUtils.dropTable(connectionSource,AddressBook.class,true);
TableUtils.dropTable(connectionSource,AddressItem.class,true);
Tab... | This is called when your application is upgraded and it has a higher version number. This allows you to adjust the various data to match the new version number. |
public CorrelationMatrix(ICovarianceMatrix matrix){
this(matrix.getVariables(),matrix.getMatrix().copy(),matrix.getSampleSize());
}
| Constructs a new correlation matrix using the covariances in the given covariance matrix. |
private static boolean isNodeAfterSibling(Node parent,Node child1,Node child2){
boolean isNodeAfterSibling=false;
short child1type=child1.getNodeType();
short child2type=child2.getNodeType();
if ((Node.ATTRIBUTE_NODE != child1type) && (Node.ATTRIBUTE_NODE == child2type)) {
isNodeAfterSibling=false;
}
els... | Figure out if child2 is after child1 in document order. <p> Warning: Some aspects of "document order" are not well defined. For example, the order of attributes is considered meaningless in XML, and the order reported by our model will be consistant for a given invocation but may not match that of either the source fi... |
public RegistryKey fetchSystemRegistry() throws WineException {
return parseRegistryFile(SYSTEM_REGISTRY_FILENAME,SYSTEM_REGISTRY_NODENAME);
}
| Return the system registry |
@Override public void onPause(){
if (Camera != null) Camera.shutdown();
Camera=null;
if (SnapHandler != null) SnapHandler.shutdown();
SnapHandler=null;
super.onPause();
}
| Callback handler when fragment has been removed from view. |
private static void shiftLocalSlots(InsnList instructions,int offset){
for ( AbstractInsnNode insn : selectAll(instructions)) {
if (insn instanceof VarInsnNode) {
VarInsnNode varInsn=(VarInsnNode)insn;
varInsn.var+=offset;
}
else if (insn instanceof IincInsnNode) {
IincInsnNode iincIns... | Shifts all local variable slot references by a specified amount. |
public String toString(){
StringBuffer sb=new StringBuffer("MLandedCost[");
sb.append(get_ID()).append(",CostDistribution=").append(getLandedCostDistribution()).append(",M_CostElement_ID=").append(getM_CostElement_ID());
if (getM_InOut_ID() != 0) sb.append(",M_InOut_ID=").append(getM_InOut_ID());
if (getM_InO... | String Representation |
public boolean isPreDestroyCalled(){
return this.preDestroyCalled;
}
| Getter for property preDestroyCalled. |
public Map<String,Object> addToCart(String catalogId,String shoppingListId,String shoppingListItemSeqId,String productId,String productCategoryId,String itemType,String itemDescription,BigDecimal price,BigDecimal amount,BigDecimal quantity,java.sql.Timestamp reservStart,BigDecimal reservLength,BigDecimal reservPersons,... | Event to add an item to the shopping cart. |
private void hideFootView(){
if (loadmoreView != null) {
loadmoreView.setVisibility(View.GONE);
}
}
| hide footView |
public Variable decode(Variable variable,String string){
if (variable instanceof RealVariable) {
RealVariable rv=(RealVariable)variable;
rv.setValue(Double.parseDouble(string));
return rv;
}
else if (variable instanceof BinaryVariable) {
BinaryVariable bv=(BinaryVariable)variable;
if (bv.getN... | Decodes string representations of decision variables, returning the variable with the decoded value. Depending on the implementation and variable type, the same variable as provided in the arguments or a new variable will be returned. |
public boolean checkDuration(@Nonnull final Notification notification){
if (!rule.getMaxDuration().isPresent()) {
return true;
}
if (maxDuration > 0 && firstMillis > 0) {
final long delta=firstMillis - notification.getCreatedAt().getMillis();
if (delta >= 0 && delta <= maxDuration) {
return true... | Check whether the given notification is within the "max-duration" for this matcher or not. |
private int indexOfNextDelimiter(int start){
char c;
int next;
for (next=start; (c=text.charAt(next)) > maxDelimChar || ((nontokenDelims == null || nontokenDelims.indexOf(c) == -1) && (tokenDelims == null || tokenDelims.indexOf(c) == -1)); next++) {
if (next == strLength - 1) {
return (-1);
}
}
... | Similar to String.indexOf(int, String) but will look for any character from string rather than the entire string. |
@Override protected void removeAt(int index){
_values[index]=0;
super.removeAt(index);
}
| removes the mapping at <tt>index</tt> from the map. |
private void saveTableVersion(int t_version){
Context ctx=mDb.getContext();
SharedPreferences tableVersions=ctx.getSharedPreferences(PREFS_TABLE_VERSION,Context.MODE_PRIVATE);
SharedPreferences.Editor editor=tableVersions.edit();
editor.putInt(mTableName,t_version);
editor.commit();
}
| save table version |
private String processIntegerToken(String token){
String result=token.replaceAll("" + groupSeparator,"");
boolean isNegative=false;
int preLen=negativePrefix.length();
if ((preLen > 0) && result.startsWith(negativePrefix)) {
isNegative=true;
result=result.substring(preLen);
}
int sufLen=negativeSuff... | The integer token must be stripped of prefixes, group separators, and suffixes, non ascii digits must be converted into ascii digits before parse will accept it. |
@Override public void init(){
if (!_initialized) {
if (!jmri.util.ThreadingUtil.isGUIThread()) log.error("Not on GUI thread",new Exception("traceback"));
Thread.yield();
_update=false;
_supressDragging=false;
makeBottomPanel(null);
super.init();
}
}
| Init for creation |
public boolean isPolarized(){
return polarity != null && polarity != Polarity.BOTH;
}
| If the neuron is polarized, it will be excitatory or inhibitory. |
public double eval(double params[]){
return (Math.min(Math.min(params[0],params[1]),Math.min(params[2],params[3])));
}
| Evaluate the minimum of 4 parameters. |
public String toString(){
StringBuffer buffer=new StringBuffer();
buffer.append("UasDaoUserRecUa[");
buffer.append("m_stat = ").append(m_stat);
buffer.append(", m_numBadCnts = ").append(m_numBadCnts);
buffer.append("]");
return buffer.toString();
}
| toString methode: creates a String representation of the object |
public String encode(String value){
return doubleMetaphone(value);
}
| Encode the value using DoubleMetaphone. |
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
ObjectInputStream.GetField fields=s.readFields();
object=fields.get("object",null);
baseTypeName=(String)fields.get("baseTypeName",null);
reference=(Ref)fields.get("reference",null);
}
| readObject is called to restore the state of the SerialRef from a stream. |
public boolean isUsePercentValuesEnabled(){
return mUsePercentValues;
}
| Returns true if using percentage values is enabled for the chart. |
private final boolean handleBlockedWrite(ByteBuffer buffer,DistributionMessage msg) throws ConnectionException {
if (!addToQueue(buffer,msg,true)) {
return false;
}
else {
startNioPusher();
return true;
}
}
| Return true if it was able to handle a block write of the given buffer. Return false if it is still the caller is still responsible for writing it. |
public static Test suite(){
return new TestSuite(InterquartileRangeTest.class);
}
| Returns a test suite. |
public static Map<String,String> convertListToMap(List<LabelValue> list){
Map<String,String> map=new LinkedHashMap<String,String>();
for ( LabelValue option : list) {
map.put(option.getLabel(),option.getValue());
}
return map;
}
| Convert a java.util.List of LabelValue objects to a LinkedHashMap. |
@Override public ManagedConnection createManagedConnection(final Subject subject,final ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if (ActiveMQRAManagedConnectionFactory.trace) {
ActiveMQRALogger.LOGGER.trace("createManagedConnection(" + subject + ", "+ cxRequestInfo+ ")");
}
ActiveMQRACon... | Creates a new physical connection to the underlying EIS resource manager. |
RandomAccessFile openInputFile(String fileName) throws IOException {
RandomAccessFile raf;
raf=openInputFileAsZip(fileName);
if (raf == null) {
File inputFile=new File(fileName);
raf=new RandomAccessFile(inputFile,"r");
}
return raf;
}
| Opens an input file, which could be a .dex or a .jar/.apk with a classes.dex inside. If the latter, we extract the contents to a temporary file. |
public VmPipeAddress(int port){
this.port=port;
}
| Creates a new instance with the specifid port number. |
public void addFilter(PacketFilter filter){
if (filter == null) {
throw new IllegalArgumentException("Parameter cannot be null.");
}
filters.add(filter);
}
| Adds a filter to the filter list for the AND operation. A packet will pass the filter if all of the filters in the list accept it. |
public ByteQueue(int chunkSize){
this.chunkSize=chunkSize;
}
| Construct new byte queue. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:58:24.402 -0500",hash_original_method="CD47D8147DAAE254C6F8BD59780442CD",hash_generated_method="94EC0761D9B928E7003FF2BDA1042097") @Override protected void onCleanUpAllConnections(String cause){
cleanUpAllConnections(true,cause);
}
| Cleanup all connections. TODO: Cleanup only a specified connection passed as a parameter. Also, make sure when you clean up a conn, if it is last apply logic as though it is cleanupAllConnections |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:50.858 -0500",hash_original_method="FF10597CCF521EBE62B89D95947AA842",hash_generated_method="C08A570AB37737F096BEEA638CE020CD") public void readOctetString() throws IOException {
if (tag == ASN1Constants.TAG_OCTETSTRING) {
rea... | Decodes ASN.1 Octetstring type |
public Vector4i div(Vector4i v,Vector4i dest){
dest.x=x / v.x;
dest.y=y / v.y;
dest.z=z / v.z;
dest.w=w / v.w;
return dest;
}
| Divide this Vector4i component-wise by another Vector4i and store the result in <code>dest</code>. |
public void testExportDelete() throws Exception {
String parentDirectory="/ifs/";
int dirCount=_client.listDir(parentDirectory,null).size();
System.out.println("Directories count in " + parentDirectory + " is: "+ dirCount);
}
| Small function to clean exports form cluster. Do not run as a test. |
private void put112(final int b1,final int b2,final int s){
pool.put11(b1,b2).putShort(s);
}
| Puts two bytes and one short into the constant pool. |
@GET @Path("/postConversation") @Produces(MediaType.APPLICATION_JSON) public Response postConversation(@QueryParam("conversationId") String conversationId,@QueryParam("clientId") String clientId,@QueryParam("input") String input){
long lStartTime=System.nanoTime();
long lEndTime, difference;
String errorMessage=n... | Makes chat conversation with WDS <p> This makes chat conversation with WDS for the provided client id and conversation id, against the user input provided. </p> <p> When WDS has collected all the required movie preferences, it sends a bunch of movie parameters embedded in the text response and signals to discover movie... |
public void addSource(Fact predecessor){
sources.add(predecessor);
if (predecessor.isInference()) {
sourceNodes.addAll(predecessor.getDerivation().sourceNodes);
}
}
| Record that a particular fact was used to derive this. |
private void handleIncrementalEvent(){
if (m_executorPool != null && (m_executorPool.getQueue().size() > 0 || m_executorPool.getActiveCount() > 0)) {
String messg="[Classifier] " + statusMessagePrefix() + " is currently batch training!";
if (m_log != null) {
m_log.logMessage(messg);
m_log.statusMe... | Handles initializing and updating an incremental classifier |
public void addPanListener(PanListener listener){
if (mPan != null) {
mPan.addPanListener(listener);
}
}
| Adds a new pan listener. |
protected void buildShape(BridgeContext ctx,Element e,ShapeNode shapeNode){
try {
SVGOMEllipseElement ee=(SVGOMEllipseElement)e;
AbstractSVGAnimatedLength _cx=(AbstractSVGAnimatedLength)ee.getCx();
float cx=_cx.getCheckedValue();
AbstractSVGAnimatedLength _cy=(AbstractSVGAnimatedLength)ee.getCy();
... | Constructs an ellipse according to the specified parameters. |
protected boolean isLog4JAvailable(){
return isLogLibraryAvailable("Log4J",LOGGING_IMPL_LOG4J_LOGGER);
}
| Is a <em>Log4J</em> implementation available? |
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. |
public void runTest() throws Throwable {
Document doc;
NodeList elementList;
Node nameNode;
Text textNode;
Text splitNode;
Node secondPart;
String value;
doc=(Document)load("staff",true);
elementList=doc.getElementsByTagName("name");
nameNode=elementList.item(2);
textNode=(Text)nameNode.getFirstCh... | Runs the test case. |
@POST @Produces(MediaType.APPLICATION_JSON) @Path("/{alertId}/notifications/{notificationId}/triggers/{triggerId}") @Description("Associates the trigger having the given ID to the given notification ID. Both the trigger and notification must be owned by the alert.") public TriggerDto addTriggerToNotification(@Context ... | Adds trigger to the notification. |
public float[][] calc(float[] xpoints,float[] ypoints){
float[][] res=new float[2][0];
if (xpoints.length > 2) {
Cubic[] X=calcNaturalCubic(xpoints.length - 1,xpoints);
Cubic[] Y=calcNaturalCubic(ypoints.length - 1,ypoints);
Polygon p=new Polygon();
p.addPoint((int)Math.round(X[0].eval(0)),(int)Math... | Calculates a cubic spline polyline |
public static <T>Iterator<T> each(Iterator<T> self,@ClosureParams(FirstParam.FirstGenericType.class) Closure closure){
while (self.hasNext()) {
Object arg=self.next();
closure.call(arg);
}
return self;
}
| Iterates through an Iterator, passing each item to the given closure. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.