code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public MethodCallExpr addArgument(Expression arg){
getArgs().add(arg);
arg.setParentNode(this);
return this;
}
| Adds the given argument to the method call. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:42.369 -0500",hash_original_method="67C1C5FB3D4E718484F296CD0580B923",hash_generated_method="E4FB769FEDC02FEA8A2364FC8AD6FAE5") public SIPHeader parse() throws ParseException {
if (debug) dbg_enter("MinExpiresParser.parse");
M... | parse the String message |
public boolean isOrthogonalTo(IntVector v){
return dotProduct(v) == 0;
}
| Checks if this vector is orthogonal to the vector v. |
public static char toCharacter(final String value){
return value.charAt(0);
}
| Converts the given XML string to a character value. |
final boolean acquireQueued(final Node node,long arg){
boolean failed=true;
try {
boolean interrupted=false;
for (; ; ) {
final Node p=node.predecessor();
if (p == head && tryAcquire(arg)) {
setHead(node);
p.next=null;
failed=false;
return interrupted;
}
... | Acquires in exclusive uninterruptible mode for thread already in queue. Used by condition wait methods as well as acquire. |
public Rule(String suffix,int min,String replacement){
this.suffix=suffix.toCharArray();
this.replacement=replacement.toCharArray();
this.min=min;
}
| Create a rule. |
private void validateCoreDataFile(ArchiveFile coreFile,boolean archiveHasExtensions) throws GeneratorException, InterruptedException, IOException {
addMessage(Level.INFO,"Validating the core file: " + coreFile.getTitle() + ". Depending on the number of records, this can take a while.");
Term id=TERM_FACTORY.findTer... | Validate the Archive's core data file has an ID for each row, and that each ID is unique. Perform this check only if the core record ID term (e.g. occurrenceID, taxonID, etc) has actually been mapped. </br> If the core has rowType occurrence, validate the core data file has a basisOfRecord for each row, and that each b... |
private void population(){
Network activityLinkNetwork=NetworkTools.filterNetworkByLinkMode(network,Collections.singleton("car"));
new NetworkCleaner().run(activityLinkNetwork);
log.info("adapting plans...");
Counter personCounter=new Counter(" person # ");
for ( Person person : population.getPersons().value... | modifiy population |
public boolean visit(MultiTextEdit edit){
return visitNode(edit);
}
| Visits a <code>MultiTextEdit</code> instance. |
public Iterator<IRemoteTxState0> listTx(){
final ConnectOptions opts=new ConnectOptions(mgr.getBaseServiceURL() + "/tx");
opts.method="GET";
JettyResponseListener response=null;
try {
RemoteRepository.checkResponseCode(response=mgr.doConnect(opts));
return multiTxResponse(response).iterator();
}
catc... | <code>LIST-TX</code>: Return the set of active transactions. |
public Builder nodeSettings(StaticNodeSettings staticNodeSettings){
this.staticNodeSettings=staticNodeSettings;
return this;
}
| Sets static node settings. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:03.289 -0500",hash_original_method="41E781585F5EF3A93F8FE051E438DFA6",hash_generated_method="71A4764486C7D6EA74D91BA9F31D39F0") public static void refresh(){
if (needRefresh) {
refreshNumber++;
updateServiceInfo();
}
}
| Refresh services info |
private void revertFieldsJavaNames(Collection<PojoField> selFields){
for ( PojoField field : selFields) field.resetJavaName();
}
| Revert fields java name for current POJO to initial value. |
public CompactConcurrentHashSet2(){
}
| Creates a new, empty map with the default initial table size (16). |
public boolean checkType(JCTree declaringElement,Name declaringElementName,JCExpression typeExpression){
if (!JSweetConfig.isJDKReplacementMode()) {
if (typeExpression instanceof JCArrayTypeTree) {
return checkType(declaringElement,declaringElementName,((JCArrayTypeTree)typeExpression).elemtype);
}
... | Checks that the given type is JSweet compatible. |
@Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
return application.sources(Application.class);
}
| An opinionated WebApplicationInitializer to run a SpringApplication from a traditional WAR deployment. Binds Servlet, Filter and ServletContextInitializer beans from the application context to the servlet container. |
public static void checkState(boolean expression){
if (!expression) {
throw new IllegalStateException();
}
}
| Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method. |
private void showOptions(){
if (client.getGame().getPhase() == IGame.Phase.PHASE_LOUNGE) {
getGameOptionsDialog().setEditable(true);
}
else {
getGameOptionsDialog().setEditable(false);
}
getGameOptionsDialog().update(client.getGame().getOptions());
getGameOptionsDialog().setVisible(true);
}
| Called when the user selects the "View->Game Options" menu item. |
public static void checkAndAppendIntegerlement(AVList params,String paramKey,Element context,String path){
if (params == null) {
String message=Logging.getMessage("nullValue.ParametersIsNull");
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
if (paramKey == null) {
... | Checks a parameter list for a specified key and if present attempts to append new elements represeting the parameter to a specified context. |
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:52.342 -0400",hash_original_method="610F60ED6DB50185F33A85945665EF11",hash_generated_method="57A04B03533AEBB95DA85C73B06358AD") @Override public String toString(){
return charSequence.toString();
}
| Return a String representation of the underlying character sequence. |
@Override public long position(java.sql.Clob searchstr,long start) throws SQLException {
return position(searchstr.getSubString(0,(int)searchstr.length()),(int)start);
}
| Retrieves the character position at which the specified <code>Clob</code> object <code>searchstr</code> begins within the <code>CLOB</code> value that this <code>Clob</code> object represents. The search for <code>searchstr</code> begins at position <code>start</code>. |
protected void checkCapacity(){
if (size >= threshold) {
final int newCapacity=data.length * 2;
if (newCapacity <= MAXIMUM_CAPACITY) {
ensureCapacity(newCapacity);
}
}
}
| Checks the capacity of the map and enlarges it if necessary. <p> This implementation uses the threshold to check if the map needs enlarging |
public JBBPOut Bits(final JBBPBitNumber numberOfBits,final int value) throws IOException {
assertNotEnded();
JBBPUtils.assertNotNull(numberOfBits,"Number of bits must not be null");
if (this.processCommands) {
_writeBits(numberOfBits,value);
}
return this;
}
| Write bits from a value into the output stream |
public void testCacheImpacts() throws Exception {
assertU(adoc("id","9","str","c","float","-3.2","int","42"));
assertU(adoc("id","7","str","c","float","-3.2","int","-1976"));
assertU(adoc("id","2","str","c","float","-3.2","int","666"));
assertU(adoc("id","0","str","b","float","64.5","int","-42"));
assertU(ado... | test that our assumptions about how caches are affected hold true |
@Override public void translate(final ITranslationEnvironment environment,final IInstruction instruction,final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment,instruction,instructions,"SMULW");
translateAll(environment,instruction,"S... | SMULW<y>{<cond>} <Rd>, <Rm>, <Rs> Operation: if ConditionPassed(cond) then if (y == 0) then operand2 = SignExtend(Rs[15:0]) else // y == 1 operand2 = SignExtend(Rs[31:16]) Rd = (Rm * operand2)[47:16] // Signed multiplication |
public int jumpToIndex(FormIndex index){
return mFormEntryController.jumpToIndex(index);
}
| Jumps to a given FormIndex. |
public static boolean startsWith(String s,String start){
return s == null || start == null ? false : s.startsWith(start);
}
| Check is a string starts with another string, ignoring the case. |
protected void sequence_ThisTypeRefNominal_TypeRefWithoutModifiers(ISerializationContext context,ThisTypeRefNominal semanticObject){
genericSequencer.createSequence(context,semanticObject);
}
| Contexts: TypeRefWithoutModifiers returns ThisTypeRefNominal Constraint: dynamic?='+'? |
public static String numberToString(Number number) throws JSONException {
if (number == null) {
throw new JSONException("Null pointer");
}
testValidity(number);
String string=number.toString();
if (string.indexOf('.') > 0 && string.indexOf('e') < 0 && string.indexOf('E') < 0) {
while (string.endsWith(... | Produce a string from a Number. |
private void refreshLiveNodes(Watcher watcher) throws KeeperException, InterruptedException {
synchronized (refreshLiveNodesLock) {
Set<String> newLiveNodes;
try {
List<String> nodeList=zkClient.getChildren(LIVE_NODES_ZKNODE,watcher,true);
newLiveNodes=new HashSet<>(nodeList);
}
catch ( Keep... | Refresh live_nodes. |
private void refreshView(){
if (!wasInvalidatedBefore) {
wasInvalidatedBefore=true;
invalidate();
}
}
| Tries to post a invalidate() event if another one was previously posted. |
private void applyKitKatTranslucency(){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
int topPadding=Common.getStatusBarHeight(mContext);
if (mDrawerParentLayout != null) {
mDrawerParentLayout.setPadding(0,(0 - topPadding),0,0);
mDrawerParentLayout.setClipToPadding(false);
int n... | Apply KitKat specific translucency. |
public PubsubFuture<Void> modifyAckDeadline(final String canonicalSubscriptionName,final int ackDeadlineSeconds,final List<String> ackIds){
final String path=canonicalSubscriptionName + ":modifyAckDeadline";
final ModifyAckDeadlineRequest req=ModifyAckDeadlineRequest.builder().ackDeadlineSeconds(ackDeadlineSeconds)... | Modify the ack deadline for a list of received messages. |
public void testGetPrototype() throws Exception {
TestService mockService=control.createMock(TestService.class);
assertSame(mockService.getRequestPrototype(fooDescriptor),FooRequest.getDefaultInstance());
assertSame(mockService.getResponsePrototype(fooDescriptor),FooResponse.getDefaultInstance());
assertSame(mo... | Tests Service.get{Request,Response}Prototype(). |
@Override public boolean isSingleton(){
return true;
}
| Always returns <code>true</code>. |
public static boolean isPrimitiveWrapper(Class<?> clazz){
Assert.notNull(clazz,"Class must not be null");
return primitiveWrapperTypeMap.containsKey(clazz);
}
| Check if the given class represents a primitive wrapper, i.e. Boolean, Byte, Character, Short, Integer, Long, Float, or Double. |
public int size(){
return this.parts.size();
}
| Returns the number of stored diff parts. |
public static int octant(Coordinate p0,Coordinate p1){
double dx=p1.x - p0.x;
double dy=p1.y - p0.y;
if (dx == 0.0 && dy == 0.0) throw new IllegalArgumentException("Cannot compute the octant for two identical points " + p0);
return octant(dx,dy);
}
| Returns the octant of a directed line segment from p0 to p1. |
@Override public Integer put(Long key,Integer value){
return wrapValue(_map.put(unwrapKey(key),unwrapValue(value)));
}
| Inserts a key/value pair into the map. |
@Override public void updateTextCycle(Cycle cycle){
textCycle=cycle;
textCycleStream.onNext(textCycle);
}
| Update current text cycle to reflect changes |
public static String decodeJavaMIMEType(String nat){
return (isJavaMIMEType(nat)) ? nat.substring(JavaMIME.length(),nat.length()).trim() : null;
}
| Decodes a <code>String</code> native for use as a Java MIME type. |
@Override protected void onAttach(){
super.onAttach();
setInteractivity(false);
mPulseAnimation=AnimationUtils.loadAnimation(SampleKeyguardProviderService.this,R.anim.pulsing_anim);
mImageView.startAnimation(mPulseAnimation);
}
| Called when the view has been attached to a window |
public AttributesDescriptor(String displayName,TextAttributesKey key){
myKey=key;
myDisplayName=displayName;
}
| Creates an attribute descriptor with the specified name and text attributes key. |
public byte[] encrypt(String clearString) throws IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, InvalidKeySpecException, BadPaddingException, IllegalBlockSizeException {
if ((clearString == null) || (clearString.isEmpty())) {
return null;
... | Encryption Method |
protected void prepare(){
p_Record_ID=getRecord_ID();
if (p_AD_Client_ID == 0) p_AD_Client_ID=Env.getAD_Client_ID(getCtx());
AD_Table_ID=getTable_ID();
StringBuffer sb=new StringBuffer("AD_Table_ID=").append(AD_Table_ID);
sb.append("; Record_ID=").append(getRecord_ID());
ProcessInfoParameter[] para=getPar... | Get Parameters |
private StringBuilder removeHiddenMarkers(final int c){
if (content[c].indexOf(MARKER) == -1) {
return content[c];
}
final StringTokenizer tokens=new StringTokenizer(content[c].toString(),MARKER,true);
String temp;
StringBuilder processedData=new StringBuilder();
while (tokens.hasMoreTokens()) {
tem... | strip the hidden numbers of position we encoded into the data (could be coded to be faster by not using Tokenizer) |
public static CoffeeEntry createIcedCoffeeEntry(SkuDetails icedCoffeeDetails){
return new CoffeeEntry(icedCoffeeDetails,ICED_COFFEE_CAFFEINE_RATE,ICED_COFFEE_ENERGY_RATE,ICED_COFFEE_CANDYNESS_RATE);
}
| create iced coffee entry |
public static void main(String[] argv) throws IOException {
if (argv.length == 1) {
OperatorDocGenerator opDocGen=null;
if (argv[0].equals("LATEX")) opDocGen=new LatexOperatorDocGenerator();
else opDocGen=new ProgramHTMLOperatorDocGenerator();
ParameterService.init();
File file=new File(Param... | If no arguments are given, the LaTeX documentation of the RapidMiner core is generated. Otherwise this documentation generator can be used to generated the documentation of arbitrary RapidMiner operators, e.g. for plugins. In this case the arguments are: <br/> <operators.xml> <sourcedir> <packages> &l... |
public NotificationChain basicSetDeclaredTypeRef(TypeRef newDeclaredTypeRef,NotificationChain msgs){
TypeRef oldDeclaredTypeRef=declaredTypeRef;
declaredTypeRef=newDeclaredTypeRef;
if (eNotificationRequired()) {
ENotificationImpl notification=new ENotificationImpl(this,Notification.SET,N4JSPackage.PROPERTY_NA... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public DailyTimeIntervalTriggerImpl(String name,Date startTime,Date endTime,TimeOfDay startTimeOfDay,TimeOfDay endTimeOfDay,IntervalUnit intervalUnit,int repeatInterval){
this(name,null,startTime,endTime,startTimeOfDay,endTimeOfDay,intervalUnit,repeatInterval);
}
| <p> Create a <code>DailyTimeIntervalTrigger</code> that will occur at the given time, and repeat at the the given interval until the given end time. </p> |
public Vector3f reflect(Vector3fc normal){
float dot=this.dot(normal);
x=x - (dot + dot) * normal.x();
y=y - (dot + dot) * normal.y();
z=z - (dot + dot) * normal.z();
return this;
}
| Reflect this vector about the given <code>normal</code> vector. |
public Name(String name) throws IOException {
rdn=new DNParser(name).parse();
}
| Creates new <code>Name</code> instance |
@Override public boolean request(int interruptNumber){
int imcSection=getRequestImcSection(interruptNumber);
int il=getRequestLevel(interruptNumber);
if (isImcDmSet(imcSection)) {
dreqflg=Format.clearBit(dreqflg,il);
((TxDmaController)platform.getDmaController()).getChannel(il).startTransferIfConditionsOk... | Request a hardware interrupt with the given number |
private int match(final int[] list,final int value){
for (int i=0; i < list.length; i++) {
if (value == list[i]) return i;
}
return -1;
}
| Returns the index of the first element equals to a specific value- |
private List<ItemDTO> mockBaseItemWith2Key1Comment1Blank(){
ItemDTO i1=new ItemDTO("","","#qqqq",1);
ItemDTO i2=new ItemDTO("a","b","",2);
ItemDTO i3=new ItemDTO("","","",3);
ItemDTO i4=new ItemDTO("b","c","",4);
i4.setLineNum(4);
return Arrays.asList(i1,i2,i3,i4);
}
| #qqqq a=b b=c |
public String checkAcceptanceChangeable(final DigestURL url,final CrawlProfile profile,final int depth){
final String urlProtocol=url.getProtocol();
final String urlstring=url.toNormalform(true);
if (!Switchboard.getSwitchboard().loader.isSupportedProtocol(urlProtocol)) {
CrawlStacker.log.severe("Unsupported ... | Test if an url shall be accepted using attributes that are defined by a crawl start but can be changed during a crawl. |
public WriterToUTF8Buffered(OutputStream out){
m_os=out;
m_outputBytes=new byte[BYTES_MAX + 3];
m_inputChars=new char[CHARS_MAX + 2];
count=0;
}
| Create an buffered UTF-8 writer. |
protected boolean matches(JavaModelStatus status,int mask){
int severityMask=mask & 0x7;
int categoryMask=mask & ~0x7;
int bits=status.getBits();
return ((severityMask == 0) || (bits & severityMask) != 0) && ((categoryMask == 0) || (bits & categoryMask) != 0);
}
| Helper for matches(int). |
public IndexMap(Map<Integer,E> map){
this.array=new Object[map.size()];
putAll(map);
}
| Creates a new IntArrayMap that contains the keys-values pairs of the given map. |
public void remove(Track track){
if (_tracks.contains(track)) {
int oldSize=_tracks.size();
_tracks.remove(track);
this.propertyChangeSupport.firePropertyChange(LISTCHANGE_CHANGED_PROPERTY,Integer.valueOf(oldSize),Integer.valueOf(_tracks.size()));
}
}
| Removes a track from this pool |
public static void main(String[] args) throws Exception {
try {
int exitCode=ToolRunner.run(new RedisExportJob(),args);
System.exit(exitCode);
}
catch ( Exception e) {
System.err.println(e.getMessage());
}
}
| The entry point when called from the command line. |
public static void showAlert(Context context,CharSequence title,CharSequence msg,CharSequence ok,DialogInterface.OnClickListener lOk){
AlertDialog dialog=buildAlert(context,title,msg,ok,null,lOk,null);
if (dialog != null) {
dialog.show();
}
}
| show an system default alert dialog with given title, msg, ok, cancal, listeners |
public void close(){
if (mBluetoothGatt == null) {
return;
}
mBluetoothGatt.close();
mBluetoothGatt=null;
}
| After using a given BLE device, the app must call this method to ensure resources are released properly. |
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:59:59.514 -0500",hash_original_method="DBB4EF5840B4656B4D7CD7498EF1A157",hash_generated_method="B5D6BEEE5C50711516C06A63C9884CAB") private static boolean matchIpAddress(X509Cert... | Checks the site certificate against the IP domain name of the site being visited |
public static void main(String[] args){
LeadingSpaces tester=new LeadingSpaces();
run(tester,ARGS,TEST,NEGATED_TEST);
tester.printSummary();
}
| The entry point of the test. |
protected DMLYarnClient(String dmlScriptStr,DMLConfig conf,String[] args){
_dmlScript=dmlScriptStr;
_dmlConfig=conf;
_args=args;
}
| Protected since only supposed to be accessed via proxy in same package. This is to ensure robustness in case of missing yarn libraries. |
public boolean isIndependent(Node xVar,Node yVar,List<Node> zList){
if (zList == null) {
throw new NullPointerException();
}
for ( Node node : zList) {
if (node == null) {
throw new NullPointerException();
}
}
List<Node> regressors=new ArrayList<>();
regressors.add(dataSet.getVariable(yVa... | Determines whether variable x is independent of variable y given a list of conditioning variables z. |
@Override public String addStepsVcenterClusterCleanup(Workflow workflow,String waitFor,URI clusterId) throws InternalException {
Cluster cluster=_dbClient.queryObject(Cluster.class,clusterId);
if (NullColumnValueGetter.isNullURI(cluster.getVcenterDataCenter())) {
log.info("cluster is not synced to vcenter");
... | A cluster could have only discovered hosts, only provisioned hosts, or mixed. If cluster has only provisioned hosts, then the hosts will be deleted from vCenter. If cluster has only discovered hosts, then the hosts will not be deleted from vCenter. If cluster is mixed, then the hosts will not be deleted from the vCente... |
private static int subAndCheck(final int x,final int y){
final long s=(long)x - (long)y;
if (s < Integer.MIN_VALUE || s > Integer.MAX_VALUE) {
throw new ArithmeticException("overflow: add");
}
return (int)s;
}
| Subtract two integers, checking for overflow. |
public boolean isRangeZeroBaselineVisible(){
return this.rangeZeroBaselineVisible;
}
| Returns a flag that controls whether or not a zero baseline is displayed for the range axis. |
@Override public boolean shouldDelayChildPressedState(){
return false;
}
| ViewPager inherits ViewGroup's default behavior of delayed clicks on its children, but in order to make the calc buttons more responsive we disable that here. |
private void dialogChanged(){
errorMsg=validateInputs();
updateStatus(errorMsg);
}
| Ensures that both text fields are set. |
public static void main(String[] argv){
try {
Evaluation.runExperiment((MultiLabelClassifier)new WvARAM(),argv);
}
catch ( Exception e) {
e.printStackTrace();
System.err.println(e.getMessage());
}
}
| Main method for testing this class. |
public void seekN(int n){
pos+=n;
}
| Skip n chars ahead. |
@Override public void updateBlob(String columnLabel,InputStream x,long length) throws SQLException {
try {
if (isDebugEnabled()) {
debugCode("updateBlob(" + quote(columnLabel) + ", x, "+ length+ "L);");
}
checkClosed();
Value v=conn.createBlob(x,-1);
update(columnLabel,v);
}
catch ( Exce... | Updates a column in the current or insert row. |
public static void previous(final IdocApplet ui){
FileVO ele=(FileVO)ui.getFileVO();
if (ele.getImageSelectIndex() - 1 < 0) {
ele.setImageSelectIndex(ele.getListImage().size() - 1);
}
else {
ele.setImageSelectIndex(ele.getImageSelectIndex() - 1);
}
}
| Muestra la imagen anterior en el applet |
public static void registerMetadata(MetadataRegistry registry){
if (registry.isRegistered(KEY)) {
return;
}
ElementCreator builder=registry.build(KEY);
builder.addAttribute(NAME).setRequired(true);
builder.addAttribute(TYPE);
builder.addAttribute(UNIT);
}
| Registers the metadata for this element. |
private static int testSwitchingTwoWays(){
int failures=0;
for ( MetaSynVar msv : MetaSynVar.values()) {
int enumResult=enumSwitch(msv);
int stringResult=stringSwitch(msv.name());
if (enumResult != stringResult) {
failures++;
System.err.printf("One value %s, computed 0x%x with the enum swit... | Verify that a switch on an enum and a switch with the same structure on the string name of an enum compute equivalent values. |
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:19.993 -0500",hash_original_method="D1AF4635F236F26EDAA4AC997AD8C09A",hash_generated_method="2288A665FEBE4EF35DE6B0C0BF9BCD7C") public static String valueOf(long value){
... | Converts the specified long to its string representation. |
private ExternalSaslClient(String authorizationId,String protocol,String serverName,Map props,CallbackHandler cbh){
m_authorizationId=authorizationId;
m_protocol=protocol;
m_serverName=serverName;
m_props=props;
m_cbh=cbh;
m_state=STATE_INITIAL;
}
| Creates an ExternalSaslClient object using the parameters supplied. Assumes that the QOP, STRENGTH, and SERVER_AUTH properties are contained in props |
public double scaleValue(double value){
if (logarithm) {
value=Math.log(value);
}
double min=getMinValue();
double max=getMaxValue();
return ((value - min) / (max - min));
}
| Scales the value to a range 0,1 based on the current settings |
public static double product(int size,double sumOfLogarithms){
return Math.pow(Math.exp(sumOfLogarithms / size),size);
}
| Returns the product, which is <tt>Prod( data[i] )</tt>. In other words: <tt>data[0]*data[1]*...*data[data.size()-1]</tt>. This method uses the equivalent definition: <tt>prod = pow( exp( Sum( Log(x[i]) ) / size(), size())</tt>. |
public void enableRotation(final boolean enable){
mRotationEnabled=enable;
if (!mRotationEnabled) {
mListRotation=0;
}
invalidate();
}
| Enables and disables individual rotation of the items. |
public void start(){
if (sLogger.isActivated()) {
sLogger.info("Start the IMS module");
}
mCnxManager.start();
mExtensionManager.start();
mServiceDispatcher.start();
mCallManager.start();
if (sLogger.isActivated()) {
sLogger.info("IMS module is started");
}
}
| Start the IMS module |
public static Text valueOf(char c,int length){
if (length < 0) throw new IndexOutOfBoundsException();
if (length <= BLOCK_SIZE) {
Text text=Text.newPrimitive(length);
for (int i=0; i < length; ) {
text._data[i++]=c;
}
return text;
}
else {
final int middle=(length >> 1);
return Te... | Returns the text that contains a specific length sequence of the character specified. |
public ByteList MethodInfo(ByteList bytes,int param_count,int return_type,IntList param_types,IntList param_values,ByteList param_kinds,IntList param_names,int debug_name_index,int flags,int method_info_index){
if (show_bytecode) {
defns_out.write("\n MethodInfo ");
defns_out.write(" param_count=" + para... | Make a MethodInfo |
public RSAAgentConfig(RSAAMInstanceInfo instInfo){
Validate.notNull(instInfo,"RSAAMInstanceInfo");
this.get_instMap().put(instInfo.get_siteID(),instInfo);
}
| Minimum ctor with required attributes only |
public boolean intersects(Vector3D other){
return other.getX() >= this.min.getX() && other.getX() < this.max.getX() ? (other.getY() >= this.min.getY() && other.getY() < this.max.getY() ? other.getZ() >= this.min.getZ() && other.getZ() < this.max.getZ() : false) : false;
}
| Checks if a vector is within this cuboid. |
public boolean hasValue(){
return getValue() != null;
}
| Returns whether it has the number of times calendar was cleaned. |
protected synchronized void expandBufferSizes(){
acceptLargeFragments=true;
}
| Expand the buffer size of both SSL/TLS network packet and application data. |
public Object runSafely(Catbert.FastStack stack) throws Exception {
Agent q=(Agent)stack.pop();
Agent a=(Agent)stack.pop();
if (Permissions.hasPermission(Permissions.PERMISSION_RECORDINGSCHEDULE,stack.getUIMgr())) Carny.getInstance().createPriority(a,q);
return null;
}
| Establishes a priority of one Favorite over another. This will take undo any previous prioritization that it directly conflicts with. Favorites with a higher priority will be recorded over ones with a lower priority if there's a case where both cannot be recorded at once. |
private void close(T stream){
try {
stream.close();
}
catch ( IOException e) {
logger.warn("Unable to close intercepted stream: {}",e.getMessage());
logger.debug("I/O error prevented closure of intercepted stream.",e);
}
synchronized (stream) {
stream.notify();
}
}
| Closes the given stream, logging any errors that occur during closure. The monitor of the stream is notified via a single call to notify() once the attempt to close has been made. |
protected int selectOperator(){
lastUpdate++;
if ((lastUpdate >= UPDATE_WINDOW) || (probabilities == null)) {
lastUpdate=0;
probabilities=getOperatorProbabilities();
}
double rand=PRNG.nextDouble();
double sum=0.0;
for (int i=0; i < operators.size(); i++) {
sum+=probabilities[i];
if (sum > r... | Returns the index of one of the available operators randomly selected using the probabilities. |
private void verifyPluginToAdd(final IPlugin<IPluginInterface> plugin){
Preconditions.checkNotNull(plugin,"IE00835: Plugin can't be null");
if ((plugin.getName() == null) || plugin.getName().equals("")) {
throw new IllegalArgumentException("IE00836: Invalid plugin name");
}
if (plugin.getGuid() == 0) {
... | Verifies the validity of the plugin object to add to the registry. If the plugin is not as expected, throw an exception. |
public void shutdown() throws Exception {
(new Thread(this,"NestedActivate")).start();
if (obj != null) obj.shutdown();
}
| Spawns a thread to deactivate the object. |
@Override public ExampleSet createExampleSet(){
return createExampleSet(Collections.<Attribute,String>emptyMap());
}
| Returns a new example set with all attributes switched on. All attributes given at creation time will be regular. |
public Enumeration<AclEntry> entries(){
return acl.entries();
}
| Returns an enumeration of the entries in this ACL. Each element in the enumeration is of type <CODE>java.security.acl.AclEntry</CODE>. |
public void fsync(Result<Boolean> result) throws IOException {
SegmentStream nodeStream=_nodeStream;
if (nodeStream != null) {
nodeStream.fsync(result);
}
else {
result.ok(true);
}
}
| sync the output stream with the filesystem when possible. |
public static BufferedImage loadCompatibleImage(URL resource) throws IOException {
BufferedImage image=ImageIO.read(resource);
return toCompatibleImage(image);
}
| <p>Returns a new compatible image from a URL. The image is loaded from the specified location and then turned, if necessary into a compatible image.</p> |
public synchronized void removeTextListener(TextListener cl){
m_textListeners.remove(cl);
}
| Remove a text listener |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.