code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public String top(){
int x=param.lastIndexOf(delimiter);
if (x == -1) return param;
else return param.substring(x + 1);
}
| Returns the path item at the far end of the parameter. |
public static <T extends Object & java.lang.Comparable<? super T>>T min(Collection<? extends T> collection){
Iterator<? extends T> it=collection.iterator();
T min=it.next();
if (NumberComparator.isNumber(min)) {
return (T)max(collection,NumberComparator.createComparator(min.getClass()));
}
while (it.hasNe... | Searches the specified collection for the minimum element. |
public ColumnFormat(String file){
super(file);
}
| Creates the parser. |
public Image rotate(int degrees){
throw new RuntimeException("The rotate method is not supported by RGB images at the moment");
}
| Unsupported in the current version, this method will be implemented in a future release |
public static TextArea create(int columns){
return create("",columns);
}
| Construct text field/area depending on whether native in place editing is supported |
public XMLSignatureInput performTransforms(XMLSignatureInput xmlSignatureInput,OutputStream os) throws TransformationException {
try {
int last=this.getLength() - 1;
for (int i=0; i < last; i++) {
Transform t=this.item(i);
String uri=t.getURI();
if (log.isLoggable(java.util.logging.Level.FIN... | Applies all included <code>Transform</code>s to xmlSignatureInput and returns the result of these transformations. |
@Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case ValidationPackage.VALIDATION_MARKER__DELEGATE_RESOURCE:
setDelegateResource((Resource)newValue);
return;
}
super.eSet(featureID,newValue);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
@Override public boolean hasTransmitter(InfraRedDetector.DetectorParams detectorParams){
try {
boolean hasPackage=hasPackage("com.htc.cirmodule",detectorParams.context);
detectorParams.logger.log("Check HTC IR interface: " + hasPackage);
return hasPackage;
}
catch ( Exception e) {
detectorParams.l... | Code from samples in HTC IR SDK |
@Override public int hashCode(){
return getValue().hashCode();
}
| Returns hash code which is based on the boolean string representation. |
public void flush() throws IOException {
if (writePending) flushForced();
else if (readLength > 0) clearReadBuffer();
sageFileSource.flush();
}
| Flush the write buffer if it contains anything to disk and clears the read buffer if it is populated. <p/> This will not sync. So if there is buffer below this one, the data may still be volatile. |
public InvocationEvent(Object source,Runnable runnable,Runnable listener,boolean catchThrowables){
this(source,INVOCATION_DEFAULT,runnable,null,listener,catchThrowables);
}
| Constructs an <code>InvocationEvent</code> with the specified source which will execute the runnable's <code>run</code> method when dispatched. If listener is non-<code>null</code>, <code>listener.run()</code> will be called immediately after <code>run</code> has returned, thrown an exception or the event was disposed... |
private void step1(){
int size=cfg.numberOfNodes() + 1;
vertex=new BasicBlock[size];
DFSCounter=0;
if (DEBUG) {
System.out.println("Initializing blocks:");
}
int noRehashCapacity=(int)(size * 1.4f);
ltDominators=new HashMap<BasicBlock,LTDominatorInfo>(noRehashCapacity);
for (Enumeration<BasicBlock> ... | The goal of this step is to perform a DFS numbering on the CFG, starting at the root. The exit node is not included. |
public SmsPortAddressedTextMessage(SmsPort destPort,SmsPort origPort,String msg,SmsDcs dcs){
super(destPort,origPort);
smsTextMessage_=new SmsTextMessage(msg,dcs);
}
| Creates a SmsPortAddressedTextMessage with the given dcs. |
static CallerInfo doSecondaryLookupIfNecessary(Context context,String number,CallerInfo previousResult){
if (!previousResult.contactExists && PhoneNumberUtils.isUriNumber(number)) {
String username=PhoneNumberUtils.getUsernameFromUriNumber(number);
if (PhoneNumberUtils.isGlobalPhoneNumber(username)) {
p... | Performs another lookup if previous lookup fails and it's a SIP call and the peer's username is all numeric. Look up the username as it could be a PSTN number in the contact database. |
public void testWrongNotStatic() throws Exception {
Map<String,Method> functions=new HashMap<>();
functions.put("foo",getClass().getMethod("nonStaticMethod"));
IllegalArgumentException expected=expectThrows(IllegalArgumentException.class,null);
assertTrue(expected.getMessage().contains("is not static"));
}
| wrong modifiers: must be static |
public Rastrigin(int numberOfVariables){
super(numberOfVariables);
}
| Constructs a new instance of the Rastrigin function. |
@Override public void stop(){
if (m_listenee != null) {
if (m_listenee instanceof BeanCommon) {
((BeanCommon)m_listenee).stop();
}
}
if (m_log != null) {
m_log.statusMessage(statusMessagePrefix() + "Stopped");
}
m_busy=false;
}
| Stop any processing that the bean might be doing. |
public static java.util.Date parseDateTime(String date,String format,String locale,String timeZone){
SimpleDateFormat dateFormat=getDateFormat(format,locale,timeZone);
try {
synchronized (dateFormat) {
return dateFormat.parse(date);
}
}
catch ( Exception e) {
throw DbException.get(ErrorCode.PARSE_... | Parses a date using a format string. |
public MutableTriple(final L left,final M middle,final R right){
super();
this.left=left;
this.middle=middle;
this.right=right;
}
| Create a new triple instance. |
private Hop processBinaryExpression(BinaryExpression source,DataIdentifier target,HashMap<String,Hop> hops) throws ParseException {
Hop left=processExpression(source.getLeft(),null,hops);
Hop right=processExpression(source.getRight(),null,hops);
if (left == null || right == null) {
left=processExpression(sour... | Construct Hops from parse tree : Process Binary Expression in an assignment statement |
public void reset() throws IOException {
throw new IOException("mark/reset not supported");
}
| <i>This operation is not supported</i>. |
public boolean retainEntries(TIntLongProcedure procedure){
boolean modified=false;
byte[] states=_states;
int[] keys=_set;
long[] values=_values;
for (int i=keys.length; i-- > 0; ) {
if (states[i] == FULL && !procedure.execute(keys[i],values[i])) {
removeAt(i);
modified=true;
}
}
retur... | Retains only those entries in the map for which the procedure returns a true value. |
public boolean hasMyomerBooster(){
for ( Mounted mEquip : getMisc()) {
MiscType mtype=(MiscType)mEquip.getType();
if (mtype.hasFlag(MiscType.F_MASC) && !mEquip.isInoperable()) {
return true;
}
}
return false;
}
| does this ba mount a myomer booster? |
public CreateWindowClause insertWhereClause(Expression insertWhereClause){
this.insertWhereClause=insertWhereClause;
return this;
}
| Sets the filter expression for inserting from another named window |
@Override public String graph() throws Exception {
StringBuffer text=new StringBuffer();
assignIDs(-1);
text.append("digraph J48Tree {\n");
if (m_isLeaf) {
text.append("N" + m_id + " [label=\""+ Utils.backQuoteChars(m_localModel.dumpLabel(0,m_train))+ "\" "+ "shape=box style=filled ");
if (m_train != nu... | Returns graph describing the tree. |
public static String createMinGWPath(String path){
String mingwPath=path.replace('\\','/');
int driveLetterIndex=1;
if (mingwPath.matches("^[a-zA-Z]:\\/.*")) {
driveLetterIndex=0;
}
mingwPath="//" + Character.toLowerCase(mingwPath.charAt(driveLetterIndex)) + mingwPath.substring(driveLetterIndex + 1);
mi... | Create a MinGW compatible path based on usual Windows path |
@Override public Fragment provideMapFragment(){
return new MapsFragment();
}
| This guy should not really cache anything |
public boolean hasQuest(final String name){
return (player.getKeyedSlot("!quests",evaluateSlotName(name)) != null);
}
| Checks whether the player has made any progress in the given quest or not. For many quests, this is true right after the quest has been started. |
public DefaultMetaDataFactory(final Map<String,Object> metadata){
notNull(metadata);
this.metadata=metadata;
}
| Creates a factory which holds the provided map as metadata storage. |
@Deprecated public NetworkRestRep updateEndpoints(URI id,NetworkEndpointParam input){
return client.put(NetworkRestRep.class,input,getIdUrl() + "/endpoints",id);
}
| Updates an endpoint for the given network. <p> API Call: <tt>PUT /vdc/networks/{id}/endpoints</tt> |
public static Transaction createFakeTxWithoutChange(final NetworkParameters params,final TransactionOutput output){
Transaction prevTx=FakeTxBuilder.createFakeTx(params,Coin.COIN,new ECKey().toAddress(params));
Transaction tx=new Transaction(params);
tx.addOutput(output);
tx.addInput(prevTx.getOutput(0));
ret... | Create a fake transaction, without change. |
public float distanceTo1(AnimatableValue other){
AnimatableTransformListValue o=(AnimatableTransformListValue)other;
if (transforms.isEmpty() || o.transforms.isEmpty()) {
return 0f;
}
AbstractSVGTransform t1=(AbstractSVGTransform)transforms.lastElement();
AbstractSVGTransform t2=(AbstractSVGTransform)o.tr... | Returns the distance between this value's first component and the specified other value's first component. |
public boolean hasWorksheet(){
return hasExtension(Worksheet.class);
}
| Returns whether it has the worksheet where the table lives. |
protected DnDListener(DragSource ds){
this(ds,null);
}
| Constructs a new DnDListener given the DragSource for the Component. |
public static TrueTypeFont parseFont(byte[] orig){
ByteBuffer inBuf=ByteBuffer.wrap(orig);
return parseFont(inBuf);
}
| Parses a TrueType font from a byte array |
private UnicodeBlock(String idName){
super(idName);
map.put(idName,this);
}
| Creates a UnicodeBlock with the given identifier name. This name must be the same as the block identifier. |
private void postPlugin(final boolean isPing) throws IOException {
String pluginName=modName;
boolean onlineMode=MinecraftServer.getServer().isServerInOnlineMode();
String pluginVersion=modVersion;
String serverVersion;
if (MinecraftServer.getServer().isDedicatedServer()) {
serverVersion="MinecraftForge (... | Generic method that posts a plugin to the metrics website |
public PMX(double probability){
super();
this.probability=probability;
}
| Constructs a PMX operator with the specified probability. |
private void hideInfo(){
hideInfo(0);
}
| hide the info view |
public <T>byte[] toByteArray(Class<T> clazz,T obj) throws DatabaseException {
PropertiesMap propertiesMap=getProperties(clazz);
ByteArrayOutputStream out=new ByteArrayOutputStream();
try {
for ( int index : propertiesMap.getIndices()) {
PropertyDescriptor pd=propertiesMap.get(index);
if (pd == ... | Get byte[] representation of this object each field is encoded as 3 values, { index [byte], len [2 bytes], value [len bytes] } |
private String printXFormat(String sx){
int nLeadingZeros=0;
int nBlanks=0;
if (sx.equals("0") && precisionSet && precision == 0) sx="";
if (precisionSet) nLeadingZeros=precision - sx.length();
if (nLeadingZeros < 0) nLeadingZeros=0;
if (fieldWidthSet) {
nBlanks=fieldWidth - nLeadingZeros - sx.len... | Utility method for formatting using the x conversion character. |
private void writeQNameAttribute(java.lang.String namespace,java.lang.String attName,javax.xml.namespace.QName qname,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
java.lang.String attributeNamespace=qname.getNamespaceURI();
java.lang.String attributePrefix=xmlWriter.getPre... | Util method to write an attribute without the ns prefix |
void initFromCameraParameters(Camera camera){
Camera.Parameters parameters=camera.getParameters();
WindowManager manager=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
Display display=manager.getDefaultDisplay();
DisplayMetrics metrics=new DisplayMetrics();
display.getMetrics(metrics);
scr... | Reads, one time, values from the camera that are needed by the app. |
public void toDotFile(SootMethod method,File destDir,String suffix,Block branchBlock,Set<DominatorNode> taintedBlocks) throws IOException {
if (!destDir.exists()) {
if (!destDir.mkdirs()) throw new IOException("could not create directory " + destDir);
}
else if (!destDir.isDirectory()) {
throw new IO... | Write out the .dot file of a particular method to destDir and prefixed by prefix. The branchBlock will be colored red, and all taintedBlocks will be colored blue. |
private void writeQNameAttribute(java.lang.String namespace,java.lang.String attName,javax.xml.namespace.QName qname,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
java.lang.String attributeNamespace=qname.getNamespaceURI();
java.lang.String attributePrefix=xmlWriter.getPre... | Util method to write an attribute without the ns prefix |
private PostgreSQLAddressSpaceLoader(){
}
| Do not instantiate this class. |
public ActivityTransporter addExtra(String key,String value){
if (extras == null) extras=new ArrayList<>();
extras.add(new ActivityExtra(key,value));
return this;
}
| It is only possible to send strings as extra. |
public TilesetAnimationMap(){
animations=new HashMap<Integer,Mapping>();
}
| Create a tileset animation map. |
public void putIcon(String extension,Icon icon){
icons.put(extension,icon);
}
| Adds an icon based on the file type "dot" extension string, e.g: ".gif". Case is ignored. |
public static final Long extractIplIdentityHostSerialNumber(LocoNetMessage m){
Long sn;
Integer di_f1;
di_f1=m.getElement(9);
sn=(long)(m.getElement(11) + ((di_f1 & 0x2) << 6));
sn+=(((long)m.getElement(12)) << 8) + (((long)di_f1 & 0x4) << 13);
sn+=(((long)m.getElement(13)) << 16) + (((long)di_f1 & 0x8) << ... | Returns the host serial number from an IPL Identity report message. <p> The invoking method should ensure that message m is is an IPL Identity message before invoking this method.. <p> NOTE: Not all IPL-capable devices implement a host serial number. <p> |
public static BigDecimal convert(int C_UOM_From_ID,int C_UOM_To_ID,BigDecimal qty,boolean StdPrecision){
if (qty == null || qty.compareTo(Env.ZERO) == 0 || C_UOM_From_ID == C_UOM_To_ID) return qty;
BigDecimal retValue=null;
int precision=2;
String sql="SELECT c.MultiplyRate, uomTo.StdPrecision, uomTo.CostingP... | Get Converted Qty from Server (no cache) |
private void removeLocalHolder(String owner) throws Exception {
String holderPath=ZKPaths.makePath(_localvdcHolderRoot,owner);
_log.info("removing global lock holder {}",holderPath);
try {
_zkClient.delete().guaranteed().forPath(holderPath);
}
catch ( KeeperException.NoNodeException e) {
_log.warn("Th... | Remove local owner from local VDC zk Only validated in VdcShared Mode |
protected void loadAndRun(final MqttSpyDaemonConfiguration configuration) throws SpyException {
final DaemonMqttConnectionDetails connectionSettings=configuration.getConnection();
configureMqtt(connectionSettings);
runScripts(connectionSettings.getBackgroundScript(),connectionSettings.getTestCases(),connectionSet... | This is an internal method - requires "initialise" to be called first. |
public static boolean isOrSubOf(Object obj,Class<?> parentClass){
Class<?> objectClass=obj.getClass();
return isOrSubOf(objectClass,parentClass);
}
| Tests if an object is an instance of or a sub-class of the parent. |
protected void checkResult(Instances result){
assertEquals(((RandomProjection)m_Filter).getNumberOfAttributes() + 1,result.numAttributes());
assertEquals(m_Instances.numInstances(),result.numInstances());
}
| performs some checks on the given result |
public synchronized boolean resetIndex(IPath containerPath){
String containerPathString=containerPath.getDevice() == null ? containerPath.toString() : containerPath.toOSString();
try {
IndexLocation indexLocation=computeIndexLocation(containerPath);
Index index=getIndex(indexLocation);
if (VERBOSE) {
... | Resets the index for a given path. Returns true if the index was reset, false otherwise. |
public static byte POSTFIX_INCREMENT(Byte a){
return a;
}
| NOTE ON POSTFIX OPERATORS: Because the postfix increment/decrement would take place after the value is returned, the method does not actually perform a postfix increment/decrement; this is correctly handled by the org.checkerframework.dataflow analysis elsewhere. |
public Object resolveReference(String link,boolean cacheRemoteFile){
if (link == null) {
String message=Logging.getMessage("nullValue.DocumentSourceIsNull");
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
try {
String[] linkParts=link.split("#");
String linkBa... | Resolves a reference to a remote or local element of the form address#identifier, where "address" identifies a local or remote document, including the current document, and and "identifier" is the id of the desired element. <p/> If the address part identifies the current document, the document is searched for the speci... |
public static Object invoke(Object obj,String methodName,int newValue) throws NoSuchMethodException {
try {
Method method=obj.getClass().getMethod(methodName,new Class[]{Integer.TYPE});
return method.invoke(obj,new Object[]{newValue});
}
catch ( IllegalAccessException e) {
throw new NoSuchMethodExcept... | Invokes the specified method if it exists. |
public CSVWriter(String path){
log.info("Initializing ...");
try {
writer=IOUtils.getBufferedWriter(path);
}
catch ( Exception ee) {
ee.printStackTrace();
throw new RuntimeException("writer could not be instantiated");
}
if (writer == null) {
throw new RuntimeException("writer is null");
... | writes the header of accessibility data csv file |
private void mergeAt(int i){
assert stackSize >= 2;
assert i >= 0;
assert i == stackSize - 2 || i == stackSize - 3;
int base1=runBase[i];
int len1=runLen[i];
int base2=runBase[i + 1];
int len2=runLen[i + 1];
assert len1 > 0 && len2 > 0;
assert base1 + len1 == base2;
runLen[i]=len1 + len2;
{
if (... | Merges the two runs at stack indices i and i+1. Run i must be the penultimate or antepenultimate run on the stack. In other words, i must be equal to stackSize-2 or stackSize-3. |
public boolean contains(final MediaTypes types){
boolean contains=false;
for ( final MediaType type : types.list) {
if (this.contains(type)) {
contains=true;
break;
}
}
return contains;
}
| Contains any of these types? |
public void replaceFromWith(int from,java.util.Collection other){
checkRange(from,size);
java.util.Iterator e=other.iterator();
int index=from;
int limit=Math.min(size - from,other.size());
for (int i=0; i < limit; i++) elements[index++]=e.next();
}
| Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection. Does not alter the size of the receiver. Replaces exactly <tt>Math.max(0,Math.min(size()-from, other.size()))</tt> elements. |
public Seconds plus(Seconds seconds){
if (seconds == null) {
return this;
}
return plus(seconds.getValue());
}
| Returns a new instance with the specified number of seconds added. <p> This instance is immutable and unaffected by this method call. |
public long cmajflt(){
return Long.parseLong(fields[12]);
}
| The number of major faults that the process's waited-for children have made. |
public void addVendorDescriptor(VendorWebAppDescriptor descr){
this.vendorDescriptors.add(descr);
}
| Associates a vendor specific descriptor with this web.xml. |
public T caseExportedVariableDeclaration(ExportedVariableDeclaration object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>Exported Variable Declaration</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
public void init(Compiler compiler,int opPos,int stepType) throws javax.xml.transform.TransformerException {
super.init(compiler,opPos,stepType);
switch (stepType) {
case OpCodes.OP_FUNCTION:
case OpCodes.OP_EXTFUNCTION:
m_mustHardReset=true;
case OpCodes.OP_GROUP:
case OpCodes.OP_VARIABLE:
m_expr=compiler.comp... | Init a FilterExprWalker. |
private void returnData(Object ret){
if (myHost != null) {
myHost.returnData(ret);
}
}
| Used to communicate a return object from a plugin tool to the main Whitebox user-interface. |
public void addProperties(String propFile) throws MalformedURLException {
addProperties(fetchProperties(PropUtils.getResourceOrFileOrURL(propFile)));
}
| Add in the properties from the given source, which can be a resource, file or URL. Any existing properties will be overwritten except for openmap.components, openmap.layers and openmap.startUpLayers which will be appended. |
public void printTo(StringBuffer buf,ReadableInstant instant){
long millis=DateTimeUtils.getInstantMillis(instant);
Chronology chrono=DateTimeUtils.getInstantChronology(instant);
printTo(buf,millis,chrono);
}
| Prints a ReadableInstant, using the chronology supplied by the instant. |
@Override public void translate(final ITranslationEnvironment environment,final IInstruction instruction,final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment,instruction,instructions,"mov");
if (instruction.getOperands().size() != 2... | Translates a MOV instruction to REIL code. |
public Builder clear(){
reinitialize();
return this;
}
| Reset the builder to an empty set. |
public void spaceHorizontal(ArrayList<Integer> nodes){
if (m_bNeedsUndoAction) {
addUndoAction(new spaceHorizontalAction(nodes));
}
int nMinX=-1;
int nMaxX=-1;
for (int iNode=0; iNode < nodes.size(); iNode++) {
int nX=getPositionX(nodes.get(iNode));
if (nX < nMinX || iNode == 0) {
nMinX=nX;
... | space out set of nodes evenly between left and right most node in the list |
public static PrivateKey loadPrivateKeyFromBinaryFile(final String keyFile) throws IOException, InvalidKeySpecException, NoSuchAlgorithmException {
final PKCS8EncodedKeySpec privateKeySpec=new PKCS8EncodedKeySpec(loadBinaryFileAsBytes(keyFile));
final PrivateKey privateKey=KeyFactory.getInstance(ALGORITHM).generate... | Loads a private key from the specified location. |
public Pool find(String name){
return this.pools.get(name);
}
| Find by name an existing connection pool returning the existing pool or <code>null</code> if it does not exist. |
public final java_cup.runtime.symbol CUP$do_action(int CUP$act_num,java_cup.runtime.lr_parser CUP$parser,java.util.Stack CUP$stack,int CUP$top) throws java.lang.Exception {
java_cup.runtime.symbol CUP$result;
switch (CUP$act_num) {
case 222:
{
CUP$result=new symbol(46);
classFile.endTableswitch(((int_toke... | Method with the actual generated action code. |
public BrowsePathResult clone(){
BrowsePathResult result=new BrowsePathResult();
result.StatusCode=StatusCode;
if (Targets != null) {
result.Targets=new BrowsePathTarget[Targets.length];
for (int i=0; i < Targets.length; i++) result.Targets[i]=Targets[i].clone();
}
return result;
}
| Deep clone |
public N random(){
return node(RAND.nextLong());
}
| Picks a random node from consistent hash. |
public static boolean sourceAndTargetNeuronGroupsSelected(NetworkPanel networkPanel){
if ((networkPanel.getSourceModelGroups().size() > 0) && (networkPanel.getSelectedModelNeuronGroups().size() > 0)) {
return true;
}
return false;
}
| True if at least one source and one target neuron group are selected. |
public Face bindTexture(Texture texture){
this.texture=Optional.of(texture);
return this;
}
| Binds a specific texture to this artist. |
private void flattenComments(T1Listing listing){
if (listing != null) {
if (this.fetchMoreComments) {
for ( More mor : listing.getData().getMoreChildren()) {
Integer MAX_ITEMS_PER_QUERY=20;
List<List<String>> listOfIdLists=new ArrayList<>();
for (int i=0; i <= mor.getData().getC... | Flatten the nested reply tree with recursion also fetch the MoreComments |
public void unregisterMediaButtonIntent(PendingIntent mediaIntent){
Log.i(TAG," Remote Control unregisterMediaButtonIntent() for " + mediaIntent);
synchronized (mAudioFocusLock) {
synchronized (mRCStack) {
boolean topOfStackWillChange=isCurrentRcController(mediaIntent);
removeMediaButtonReceiver_syncAf... | see AudioManager.unregisterMediaButtonIntent(PendingIntent mediaIntent) precondition: mediaIntent != null, eventReceiver != null |
public synchronized void add(String name,long threadId){
if (mFinished) {
throw new IllegalStateException("Marker added to finished log");
}
mMarkers.add(new Marker(name,threadId,SystemClock.elapsedRealtime()));
}
| Adds a marker to this log with the specified name. |
public MultiDataPathUpgrader(NodeEnvironment nodeEnvironment){
this.nodeEnvironment=nodeEnvironment;
}
| Creates a new upgrader instance |
public static double cuCabs(cuDoubleComplex x){
double p=cuCreal(x);
double q=cuCimag(x);
double r;
if (p == 0) return q;
if (q == 0) return p;
p=Math.sqrt(p);
q=Math.sqrt(q);
if (p < q) {
r=p;
p=q;
q=r;
}
r=q / p;
return p * Math.sqrt(1.0f + r * r);
}
| Returns the absolute value of the given complex number.<br /> <br /> Original comment:<br /> <br /> This implementation guards against intermediate underflow and overflow by scaling. Otherwise the we'd lose half the exponent range. There are various ways of doing guarded computation. For now chose the simplest and fast... |
public PageBlobInputStream(RowCursor cursor,ColumnBlob column,PageBlob blobPage){
_pageReader=new BlobReaderPageImpl(cursor,column,blobPage);
_length=_pageReader.getLength();
}
| Creates a blob output stream. |
private Cache createCache() throws CacheException {
return new CacheFactory().set(MCAST_PORT,"0").create();
}
| Creates the cache instance for the test |
public void addAdditionalFacilityData(ActivityFacilities facilities){
log.warn("changed this data flow (by adding the _cnt_ column) but did not test. If it works, please remove this warning. kai, mar'14");
if (this.lockedForAdditionalFacilityData) {
throw new RuntimeException("too late for adding additional fa... | I wanted to plot something like (max(acc)-acc)*population. For that, I needed "population" at the x/y coordinates. This is the mechanics via which I inserted that. (The computation is then done in postprocessing.) <p></p> You can add arbitrary ActivityFacilities containers here. They will be aggregated to the grid po... |
public static String encodePrivateKey(byte[] keyBytes){
byte[] b64Key=Base64Util.encodeWithNewLine(keyBytes);
ByteArrayOutputStream out=new ByteArrayOutputStream();
out.write(PRIVSTE_KEY_HEADER.getBytes(),0,PRIVSTE_KEY_HEADER.length());
out.write(b64Key,0,b64Key.length);
String footer=(b64Key[b64Key.length - ... | encode private key into PKCS8 PEM String |
ReachingDefinitionAnalyser(Function<Vertex,Set<Definition>> gen,Function<Vertex,Set<Definition>> kill){
this.gen=gen;
this.kill=kill;
}
| Creates a new reaching definition analyser. |
public void addLandingPad(int x,int z){
BlockPosition pos=new BlockPosition(x,0,z);
if (!spawnLocations.contains(pos)) {
spawnLocations.add(pos);
occupiedLandingPads.put(pos,false);
}
}
| Adds a landing pad to the station |
public void decorateAtTimeCaptureRequest(final int mode,final String filename,final boolean frontFacing,final boolean isHDR,final float zoom,final String flashSetting,final boolean gridLinesOn,final float timerSeconds,final TouchCoordinate touchCoordinate,final Boolean volumeButtonShutter,final Rect activeSensorSize){
... | Accumulate the information that should be available at the time of the Capture Request. If you are unable to deliver one of these parameters, you may want to think again. |
int size(){
OneRowChange oneRowChange=changeSet.getOneRowChange();
if (isDelete()) return oneRowChange.getKeyValues().size();
else return oneRowChange.getColumnValues().size();
}
| Return number of columns. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:58:10.254 -0500",hash_original_method="10AA1BA0464BE4692583736E1FB9D6CA",hash_generated_method="A3387316C83FBF149BB8EE16153566EB") public static void clearDnsCache(){
addressCache.clear();
}
| Removes all entries from the VM's DNS cache. This does not affect the C library's DNS cache, nor any caching DNS servers between you and the canonical server. |
public int compareTo(Relationship another){
if (this == another) {
return 0;
}
int index=((Relationship)another).getIndex();
if (getIndex() > index) {
return 1;
}
else if (index == getIndex()) {
return 0;
}
else {
return -1;
}
}
| Compare the relationships by index, to allow sorting. |
private Map<String,String> readSSLConfiguration(boolean useSsl,String keystoreToUse,String keystorePasswordToUse,String truststoreToUse,String truststorePasswordToUse,String sslCiphersToUse,String sslProtocolsToUse,String gfSecurityPropertiesPath) throws IOException {
Gfsh gfshInstance=getGfsh();
final Map<String,S... | Common code to read SSL information. Used by JMX, Locator & HTTP mode connect |
public static <E>Set<E> constrainedSet(Set<E> set,Constraint<? super E> constraint){
return new ConstrainedSet<E>(set,constraint);
}
| Returns a constrained view of the specified set, using the specified constraint. Any operations that add new elements to the set will call the provided constraint. However, this method does not verify that existing elements satisfy the constraint. <p>The returned set is not serializable. |
public TargetInformationReplyParser(final ClientReader clientReader){
super(clientReader,DebugCommandType.RESP_INFO);
}
| Creates a new Target Information reply parser. |
public static String replaceSubstring(String inString,String subString,String replaceString){
StringBuffer result=new StringBuffer();
int oldLoc=0, loc=0;
while ((loc=inString.indexOf(subString,oldLoc)) != -1) {
result.append(inString.substring(oldLoc,loc));
result.append(replaceString);
oldLoc=loc + ... | Replaces with a new string, all occurrences of a string from another string. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.