code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public static double nextLambda(double l3,double l4,MersenneTwisterFast randomGenerator){
double l_sign;
if ((l3 < 0) || (l4 < 0)) l_sign=-1.0;
else l_sign=1.0;
double u=randomGenerator.nextDouble();
double x=l_sign * (Math.exp(Math.log(u) * l3) - Math.exp(Math.log(1.0 - u) * l4));
return x;
}
| Returns a lambda distributed random number with parameters l3 and l4. <p> <b>Implementation:</b> Inversion method. This is a port of <tt>lamin.c</tt> from the <A HREF="http://www.cis.tu-graz.ac.at/stat/stadl/random.html">C-RAND / WIN-RAND</A> library. C-RAND's implementation, in turn, is based upon <p> J.S. Ramberg, B:... |
public ItemGuardCreature(final Creature copy,final String itemType,final String questSlot,final String questState,final int questIndex){
super(copy);
this.itemType=itemType;
this.questSlot=questSlot;
this.questState=questState;
this.questIndex=questIndex;
noises=new LinkedHashMap<String,LinkedList<String>>(... | Creates an ItemGuardCreature. |
public void doMouseClicked(java.awt.event.MouseEvent e){
if (!_editor.getFlag(Editor.OPTION_CONTROLS,isControlling())) {
return;
}
if (e.isMetaDown() || e.isAltDown()) {
return;
}
if ((namedTurnoutWest == null) || (namedTurnoutEast == null)) {
log.error("No turnout connection, can't process click"... | Throw the turnout when the icon is clicked |
public Source<LocalDate> withDays(long daysFromEpoch){
lowerBoundGEQLongLocalDateMin(daysFromEpoch);
return Compositions.weightWithValues(LocalDates.withDays(daysFromEpoch),LocalDate.ofEpochDay(daysFromEpoch));
}
| Generates LocalDates inclusively bounded between 1970-01-01 and LocalDate.of(daysFromEpoch) (which can be a negative long, in accordance with the LocalDate API). The Source is weighted so it is likely to produce LocalDate.of(daysFromEpoch) one or more times. |
protected double computeFactor(double omega,double sigma){
double root=Math.sqrt(Math.pow(2.0,1.0 / omega) - 1);
return 2.0 * root / sigma;
}
| computes the factor for curve-fitting (see equation (13) in paper) |
void sendByte5Baud(int address) throws IOException {
long start=System.currentTimeMillis();
sendBit5Baud(false);
for (int i=0; i < 8; i++) {
sendBit5Baud((address & (1 << i)) != 0);
}
sendBit5Baud(true);
log.debug(String.format("TX-5Baud:%02X finished after %dms",address,System.currentTimeMillis() - sta... | send a byte with 5 baud line speed this version sends out timed line break bits w/o changing the nominal baud rate |
public HarvestInfo(final Deserializer deserializer){
this.blockId=deserializer.readLong("id");
this.height=BlockHeight.readFrom(deserializer,"height");
this.timeStamp=TimeInstant.readFrom(deserializer,"timeStamp");
this.totalFee=Amount.readFrom(deserializer,"totalFee");
this.difficulty=deserializer.readLong("... | Deserializes a harvest info. |
@Override public <R>CouchbaseManifestComparator<R> withKey(String key){
return new CouchbaseManifestComparator<>(key,connection);
}
| Create a new ManifestComparator with the same distributed map connection that targets a different key |
public CF2(int numberOfVariables){
super(numberOfVariables,2,1);
}
| Constructs a CF2 test problem with the specified number of decision variables. |
public synchronized void close() throws IOException {
if (in != null) {
in.close();
slack=null;
in=null;
}
}
| Closes the Reader. |
protected void processPrepareResponse(final GenericResponse genericResponse) throws SQLException {
parseStatementInfo(genericResponse.getData());
switchState(StatementState.PREPARED);
}
| Processes the prepare response from the server. |
public int compareTo(TokenizerSymbol symbol){
return symbol.startText.compareTo(startText);
}
| Compare to. |
private boolean advanceRepeatGroups() throws IOException {
for ( PhrasePositions[] rg : rptGroups) {
if (hasMultiTermRpts) {
int incr;
for (int i=0; i < rg.length; i+=incr) {
incr=1;
PhrasePositions pp=rg[i];
int k;
while ((k=collide(pp)) >= 0) {
PhrasePositi... | At initialization (each doc), each repetition group is sorted by (query) offset. This provides the start condition: no collisions. <p>Case 1: no multi-term repeats<br> It is sufficient to advance each pp in the group by one less than its group index. So lesser pp is not advanced, 2nd one advance once, 3rd one advanced ... |
private DisiWrapper popTail(){
assert tailSize > 0;
final DisiWrapper result=tail[0];
tail[0]=tail[--tailSize];
downHeapCost(tail,tailSize);
return result;
}
| Pop the least-costly scorer from 'tail'. |
public boolean checkInRange(String flagName,double lowValue,boolean lowInclusive,double highValue,boolean highInclusive){
if (isSet(flagName)) {
final double value=(Double)getValue(flagName);
if ((value < lowValue) || (value <= lowValue && !lowInclusive) || (value > highValue)|| (value >= highValue && !highIn... | Checks a double flag has a value between two values |
private void updateProgress(int progress){
if (myHost != null && progress != previousProgress) {
myHost.updateProgress(progress);
}
previousProgress=progress;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
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 Uri iconUri(){
return mIconUri;
}
| Returns the content:// URI of a bitmap representing this data. Default null. |
public void testValueChangeListenerWithBinding() throws Exception {
HtmlForm form;
HtmlSubmitInput submit;
HtmlAnchor link;
HtmlTextInput input;
HtmlPage page;
page=getPage("/faces/binding01.jsp");
form=getFormById(page,"form");
submit=(HtmlSubmitInput)form.getInputByName("form" + NamingContainer.SEPARA... | Test case for bug 5030555 |
public static JCalValue structured(List<List<?>> values){
List<JsonValue> array=new ArrayList<JsonValue>(values.size());
for ( List<?> list : values) {
if (list.isEmpty()) {
array.add(new JsonValue(""));
continue;
}
if (list.size() == 1) {
Object value=list.get(0);
if (value == ... | Creates a structured value. |
public Env<AttrContext> attribute(Env<AttrContext> env){
if (compileStates.isDone(env,CompileState.ATTR)) return env;
if (verboseCompilePolicy) printNote("[attribute " + env.enclClass.sym + "]");
if (verbose) log.printVerbose("checking.attribution",env.enclClass.sym);
if (!taskListener.isEmpty()) {
Ta... | Attribute a parse tree. |
public static void resignToken(String fileName) throws IOException, SAXException, ParserConfigurationException, SsoKeyStoreOperationException, ParserException {
FileInputStream fileStream=new FileInputStream(fileName);
String samlXml;
try {
samlXml=TestTokenUtil.loadStreamContent(fileStream);
}
finally {
... | This method loads a file containing SAML token, parses the token and applies a new signature over the token. This is needed when something in the token needs to be changed (this will break the signature). |
public static <T>Iterator<T> arrayAsIterator(T[] array){
return new ArrayIterator<T>(array);
}
| Helper method for exposing contents of arrays using a read-only iterator |
public static boolean isBlank(String str){
return (null == str || 0 == str.trim().length());
}
| is null or is made by spaces |
int encryptFinal(byte[] plain,int plainOffset,int plainLen,byte[] cipher,int cipherOffset) throws IllegalBlockSizeException {
if (plainLen < blockSize) {
throw new IllegalBlockSizeException("input is too short!");
}
else if (plainLen == blockSize) {
encrypt(plain,plainOffset,plainLen,cipher,cipherOffset)... | Performs the last encryption operation. <p>The input plain text <code>plain</code>, starting at <code>plainOffset</code> and ending at <code>(plainOffset + len - 1)</code>, is encrypted. The result is stored in <code>cipher</code>, starting at <code>cipherOffset</code>. <p>It is the application's responsibility to make... |
protected void handleException(Throwable e){
if (endTime == 0) endTime=System.currentTimeMillis();
Log.logger.log(Level.SEVERE,"Uncaught exception.",e);
status|=sERROR;
ControlThread.signalShutdown();
done=true;
}
| Log an exception. |
public static final Object loadObject(String filename) throws Exception {
FileInputStream streamIn=new FileInputStream(filename);
ObjectInputStream objectinputstream=new ObjectInputStream(streamIn);
Object object=objectinputstream.readObject();
objectinputstream.close();
return object;
}
| Load Object - load the Object stored in 'filename'. |
public static Column fromString(String s){
StringTokenizer st=new StringTokenizer(s," ");
Column col=new Column();
while (st.hasMoreTokens()) {
col.add(FreeCellNode.fromCard(st.nextToken()));
}
return col;
}
| for debugging. |
@Override public void onReceivedError(WebView view,int errorCode,String description,String failingUrl){
String message=String.format("Error '%s' (%d) loading url: %s",description,errorCode,failingUrl);
Log.w(TAG,message);
}
| Bypasses and logs errors. |
public boolean isValid(TicTacToeBoard board){
return (neighbors(board) >= 1);
}
| A NeighborMove is valid if it is placed into an Empty cell but also is adjacent (horizontally, vertically, diagonally) to an existing cell with our mark in it. |
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:33:36.516 -0500",hash_original_method="D442CACA5F4C37E249E32A5FC3EA1B00",hash_generated_method="DDBB425D41D43B34CE4517F62847711C") public void putCharSequenceArray(String key,CharSequence[] value){
unparcel()... | Inserts a CharSequence array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. |
public BerkeleyDbEnvironment(){
}
| Used by UIMA |
@Override public boolean isWrapperFor(Class<?> iface) throws SQLException {
return iface != null && iface.isAssignableFrom(getClass());
}
| Checks if unwrap can return an object of this class. |
public static boolean hasTradeOrders(Tradingday tradingday){
for ( Tradestrategy tradestrategy : tradingday.getTradestrategies()) {
if (!tradestrategy.getTradeOrders().isEmpty()) {
return true;
}
}
return false;
}
| Method hasTradeOrders. |
public Boolean isVimAccountNameRequired(){
return vimAccountNameRequired;
}
| Gets the value of the vimAccountNameRequired property. |
public CheckBox(){
this("");
}
| Constructs a checkbox with no text |
@EventHandler(ignoreCancelled=true) public void onPlayerDropItem(PlayerDropItemEvent event){
if (!canInteract(event.getPlayer())) {
event.setCancelled(true);
}
}
| Prevents a player that can't interact from dropping items. |
@Override public String toString(){
return toString(6);
}
| Converts this geo URI to its string representation. |
public int rsq(int a,int b){
assert b >= a && a > 0 && b > 0;
return rsq(b) - rsq(a - 1);
}
| Range Sum Query from a to b. Search for the sum from array index from a to b a and b are 1-indexed <p> Time-Complexity: O(log(n)) |
final SolrInputField field(String name,float boost,Object... values){
SolrInputField f=new SolrInputField(name);
for ( Object v : values) {
f.addValue(v,1.0F);
}
f.setBoost(boost);
return f;
}
| Convenience method for building up SolrInputFields |
public void restartWithSearchQuery(String searchQuery){
mFilter=searchQuery;
if (mAdapter != null) {
mAdapter.clear();
}
if (mListView != null && mListView.getFooterViewsCount() != 0) {
mListView.removeFooterView(mFooterView);
}
if (mProgressBar != null) {
mProgressBar.setVisibility(View.VISIBLE... | Causes the MovieLoader to restart, passing in the searchQuery Also clears the adapter of it's current movies, removes the footer progressbar, displays the centered progressbar, and sets the loader's 'starting page' back to 1 |
@NotNull public QueryBuilder addArguments(@NotNull Collection<?> args){
arguments.addAll(args);
return this;
}
| Adds given arguments to this query. |
public static int findNextWordEnd(String s,int startIndex){
int i=startIndex;
for (; i < s.length(); i++) {
char currChar=s.charAt(i);
if (!Character.isLetterOrDigit(currChar)) {
return i;
}
}
return i;
}
| Given a String and a start index, returns the next index where there is a non-alpha non-numeric character indicating the end of a word |
public static boolean deleteFile(String filePathAndName){
if ((filePathAndName == null) || filePathAndName.isEmpty()) {
return false;
}
boolean isSuccessfulDelete=false;
try {
File fileToDelete=new File(filePathAndName);
isSuccessfulDelete=fileToDelete.delete();
}
catch ( Exception e) {
logg... | This is a quiet method. |
public boolean hasValue(){
return getValue() != null;
}
| Returns whether it has the displayed value of the cell. |
public boolean isShortCircuit(){
ensureEnabled();
return shortCircuit;
}
| Determines whether a CORS request should be rejected if it's invalid before being further processing. <p>CORS headers are set after a request is processed. This may not always be desired and this setting will check that the Origin is valid and if it is not valid no further processing will take place, and a error will b... |
public Matrix4f add(Matrix4fc other){
return add(other,this);
}
| Component-wise add <code>this</code> and <code>other</code>. |
public void register(OpModeManager manager){
manager.register("NullOp",NullOp.class);
manager.register("Basic Vision Sample",BasicVisionSample.class);
manager.register("Linear Vision Sample",LinearVisionSample.class);
manager.register("Manual Vision Sample",ManualVisionSample.class);
}
| The Op Mode Manager will call this method when it wants a list of all available op modes. Add your op mode to the list to enable it. |
final void cleanUpActivityServicesLocked(ActivityRecord r){
if (r.connections != null) {
Iterator<ConnectionRecord> it=r.connections.iterator();
while (it.hasNext()) {
ConnectionRecord c=it.next();
mService.mServices.removeConnectionLocked(c,null,r);
}
r.connections=null;
}
}
| Perform clean-up of service connections in an activity record. |
protected boolean isKeyEvent(){
return ((descriptor & KEY_RELEASED_MASK) != 0) || ((descriptor & KEY_PRESSED_MASK) != 0);
}
| Returns true if the query is representing a key event. |
protected final void addWorkers(Collection<WorkerThread> workers){
for (final Iterator<WorkerThread> iter=workers.iterator(); iter.hasNext(); ) {
final WorkerThread worker=iter.next();
addWorker(worker);
}
}
| Adds all of the given workers to the worker list but does not start them. |
public IntPair insertNFA(RegExp regExp){
IntPair nfa1, nfa2;
int start, end;
RegExp2 r;
if (Options.DEBUG) Out.debug("Inserting RegExp : " + regExp);
if (regExp.isCharClass(macros)) {
start=numStates;
end=numStates + 1;
ensureCapacity(end + 1);
if (end + 1 > numStates) numStates=end + 1;... | Constructs an NFA for regExp such that the NFA has exactly one start state, exactly one end state, no transitions leading out of the end state no transitions leading into the start state |
public void testIdWithoutDotsOrSlashes(){
String jndiName="DataSource";
String propertyString=DatasourcePropertySet.JNDI_LOCATION + "=" + jndiName;
DataSource ds=dataSourceConverter.fromPropertyString(propertyString);
assertEquals(jndiName,ds.getId());
}
| Test an id without dots nor slashes. |
public final int countDataSchemes(){
return mDataSchemes != null ? mDataSchemes.size() : 0;
}
| Return the number of data schemes in the filter. |
@Override public RequestMethodsRequestCondition combine(RequestMethodsRequestCondition other){
Set<RequestMethod> set=new LinkedHashSet<>(this.methods);
set.addAll(other.methods);
return new RequestMethodsRequestCondition(set);
}
| Returns a new instance with a union of the HTTP request methods from "this" and the "other" instance. |
public synchronized void onDialogsLoaded(){
if (!isDialogsLoaded) {
isDialogsLoaded=true;
context.getPreferences().putBool("app.dialogs.loaded",true);
updateLoaded();
}
}
| Notify from Modules about dialog load completed |
public boolean covers(Envelope other){
if (isNull() || other.isNull()) {
return false;
}
return other.getMinX() >= minx && other.getMaxX() <= maxx && other.getMinY() >= miny && other.getMaxY() <= maxy;
}
| Tests if the <code>Envelope other</code> lies wholely inside this <code>Envelope</code> (inclusive of the boundary). |
private static void displayTree(Account parentAccount,int level){
for (int i=0; i < level; i++) {
System.out.print(" ");
}
System.out.printf("Account with ID \"%s\" and name \"%s\" was found.\n",parentAccount.getId(),parentAccount.getName());
List<Account> subAccounts=parentAccount.getSubAccounts();
if (... | Auxiliary method to recurse through the account tree, displaying it. |
public void notifyThrottleFound(DccThrottle t){
if (log.isDebugEnabled()) {
log.debug("Throttle found");
}
_throttle=t;
for (int i=0; i < FunctionPanel.NUM_FUNCTION_BUTTONS; i++) {
try {
int functionNumber=functionButton[i].getIdentity();
java.lang.reflect.Method getter=_throttle.getClass().... | Get notification that a throttle has been found as we requested. Use reflection to find the proper getF? method for each button. |
public IllegalConnectorArgumentsException(String s,String name){
super(s);
names=new ArrayList<String>(1);
names.add(name);
}
| Construct an <code>IllegalConnectorArgumentsException</code> with the specified detail message and the name of the argument which is invalid or inconsistent. |
public void endElement(String namespaceURI,String localName,String qName) throws SAXException {
if (m_firstTagNotEmitted) {
flush();
if (namespaceURI == null && m_firstElementURI != null) namespaceURI=m_firstElementURI;
if (localName == null && m_firstElementLocalName != null) localName=m_firstEle... | Pass the call on to the underlying handler |
public void drawNamedImage(Image image,String name){
if (image != null) {
LosslessImage losslessImage=new LosslessImage(image);
int width=losslessImage.getWidth();
int height=losslessImage.getHeight();
DefineBitsLossless defineBits=DefineBitsLosslessBuilder.build(losslessImage.getPixels(),width,height... | Converts an AWT image into a SWF <code>DefineBitsLossless</code> tag and adds it to the Sprite <code>TagList</code> context. |
private ModifiableHyperBoundingBox mbr(final DoubleIntPair[] sorting,final int from,final int to){
ModifiableHyperBoundingBox mbr=new ModifiableHyperBoundingBox(get(sorting[from]));
for (int i=from + 1; i < to; i++) {
mbr.extend(get(sorting[i]));
}
return mbr;
}
| Computes and returns the mbr of the specified nodes, only the nodes between from and to index are considered. |
public static void sort(Object[] a){
Object[] aux=(Object[])a.clone();
mergeSort(aux,a,0,a.length,0);
}
| Sorts the specified array of objects into ascending order, according to the <i>natural ordering</i> of its elements. All elements in the array must implement the <tt>Comparable</tt> interface. Furthermore, all elements in the array must be <i>mutually comparable</i> (that is, <tt>e1.compareTo(e2)</tt> must not throw ... |
public void putSerializable(String key,Serializable value){
map.put(key,value);
}
| Inserts a Serializable value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. |
public int rt_priority(){
return Integer.parseInt(fields[39]);
}
| (since Linux 2.5.19) Real-time scheduling priority, a number in the range 1 to 99 for processes scheduled under a real-time policy, or 0, for non-real-time processes (see sched_setscheduler(2)). |
public IndexToLocFormat formatVersion(){
return this.formatVersion;
}
| Get the format version that will be used when the loca table is generated. |
public int frequency(int key){
return frequencies.frequency(key);
}
| Returns the frequency of the provided key in the ring buffer. |
public DimStore(int id,String name,String zip,String addr){
this.id=id;
this.name=name;
this.zip=zip;
this.addr=addr;
}
| Constructs a store instance. |
public DocumentInputIterator(boolean hasPayloads,boolean hasContexts) throws IOException {
this.hasPayloads=hasPayloads;
this.hasContexts=hasContexts;
docCount=reader.maxDoc() - 1;
weightValues=(weightField != null) ? MultiDocValues.getNumericValues(reader,weightField) : null;
liveDocs=(reader.leaves().size()... | Creates an iterator over term, weight and payload fields from the lucene index. setting <code>withPayload</code> to false, implies an iterator over only term and weight. |
public AcceptedOptionSet(final Class[] optionalOptions,final String freeArgumentsSyntax,final Class[] requiredOptions){
Check.notNull(optionalOptions,"optionalOptions");
Check.notNull(requiredOptions,"requiredOptions");
this.freeArgumentsSyntax=freeArgumentsSyntax;
this.optionalOptions.addAll(Arrays.asList(opti... | Construct and option set with the given syntax requirements. |
int next(){
int next=rbbi.next();
while (next == BreakIterator.DONE && scriptIterator.next()) {
rbbi=getBreakIterator(scriptIterator.getScriptCode());
rbbi.setText(text,scriptIterator.getScriptStart(),scriptIterator.getScriptLimit() - scriptIterator.getScriptStart());
next=rbbi.next();
}
return (nex... | Retrieve the next break position. If the RBBI range is exhausted within the script boundary, examine the next script boundary. |
@Override public Object execute(CompiledScript template,Map<String,Object> vars){
BytesStreamOutput result=new BytesStreamOutput();
try (UTF8StreamWriter writer=utf8StreamWriter().setOutput(result)){
((Mustache)template.compiled()).execute(writer,vars);
}
catch ( Exception e) {
logger.error("Error execu... | Execute a compiled template object (as retrieved from the compile method) and fill potential place holders with the variables given. |
public void insertChildAfter(HtmlNode node,HtmlNode nodeToInsert){
int index=getChildIndex(node);
if (index >= 0) {
insertChild(index + 1,nodeToInsert);
}
}
| Inserts specified node in the list of children after specified child |
public void reset(){
super.reset();
H1=0x6a09e667f3bcc908L;
H2=0xbb67ae8584caa73bL;
H3=0x3c6ef372fe94f82bL;
H4=0xa54ff53a5f1d36f1L;
H5=0x510e527fade682d1L;
H6=0x9b05688c2b3e6c1fL;
H7=0x1f83d9abfb41bd6bL;
H8=0x5be0cd19137e2179L;
}
| reset the chaining variables |
public void calculateDependentVariableStats(int depVarIndex){
if (values[depVarIndex] == null) return;
double sumOfDV=0.0;
for (int i=0; i < values[depVarIndex].length; i++) sumOfDV+=values[depVarIndex][i];
dependentVariableMean[depVarIndex]=sumOfDV / values[depVarIndex].length;
dependentVariableSumOfAbso... | Calculate a set of useful statistical values for the dependent variable values. |
private String arrangeRemoteCommand(InternalManagedEntity entity,String cmd){
String host=entity.getEntityConfig().getHost();
if (InetAddressUtil.isLocalHost(host)) {
return cmd;
}
String prefix=entity.getEntityConfig().getRemoteCommand();
if (prefix == null || prefix.length() <= 0) {
prefix=entity.ge... | If the managed entity resides on a remote host, then <code>command</code> is munged to take the remote command into account. |
private void insertOrder(String orderId,String productId,PurchaseState state,long purchaseTime,String developerPayload){
ContentValues values=new ContentValues();
values.put(HISTORY_ORDER_ID_COL,orderId);
values.put(HISTORY_PRODUCT_ID_COL,productId);
values.put(HISTORY_STATE_COL,state.ordinal());
values.put(H... | Inserts a purchased product into the database. There may be multiple rows in the table for the same product if it was purchased multiple times or if it was refunded. |
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 static void round(Calendar c,String unit){
Integer uu=CALENDAR_UNITS.get(unit);
if (null == uu) {
throw new IllegalArgumentException("Rounding Unit not recognized: " + unit);
}
int u=uu.intValue();
switch (u) {
case Calendar.YEAR:
c.clear(Calendar.MONTH);
case Calendar.MONTH:
c.clear(Calendar.D... | Modifies the specified Calendar by "rounding" down to the specified unit |
Location(double[][] a){
maxValue=a[0][0];
row=0;
column=0;
for (int i=0; i < a.length; i++) {
for (int j=0; j < a[i].length; j++) {
if (a[i][j] > maxValue) {
maxValue=a[i][j];
row=i;
column=j;
}
}
}
}
| Constructs a default Loction object |
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
s.defaultReadObject();
init(getName(),getMask(actions));
}
| readObject is called to restore the state of the ServicePermission from a stream. |
public double train(double[][] X_,double[][] Y_,int I) throws Exception {
if (getDebug()) {
System.out.println("BPNN train; For " + I + " epochs ...");
}
int N=X_.length;
boolean breakEarly=(I < 0) ? true : false;
I=Math.abs(I);
double E_=Double.MAX_VALUE;
double E=0.0;
for (int e=0; e < I; e++) {
... | Train - Train for I iterations. I is not necessarily m_E (yet)! |
public void removeIndicationListener(TransportAddress localAddr,MessageEventHandler indicationListener){
}
| Removes an existing <tt>MessageEventHandler</tt> to no longer be notified about STUN indications received at a specific local <tt>TransportAddress</tt>. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:07.365 -0500",hash_original_method="2361364E4BB205FAC2A8F8549D9431F6",hash_generated_method="AF914157A79A59D795CD06072A593918") public SecurityClientHeader createSecurityClientHeader(){
SecurityClient secClient=new SecurityClient(... | Security-Client header |
public static SecretKeys generateKeyFromPassword(String password,String salt) throws GeneralSecurityException {
return generateKeyFromPassword(password,Base64.decode(salt,BASE64_FLAGS));
}
| A function that generates password-based AES & HMAC keys. See generateKeyFromPassword. |
@SmallTest public void testSessionList(){
AudioTrack track=createTestTrack();
int session=track.getAudioSessionId();
AudioSessionInfo info=findAudioSessionInfo(session);
assertNotNull(info);
assertEquals(session,info.getSessionId());
assertEquals(3,info.getChannelMask());
track.release();
info=findAudio... | EXPECT: listAudioSessions should be populated when a new stream is created, and it's session ID should match what AudioTrack says it is. We simply create an audio track, and query the policy for sessions. |
public void release(){
if (downloadRequestQueue != null) {
downloadRequestQueue.release();
downloadRequestQueue=null;
}
}
| Release all the resource. |
public XmlTextBuilder(int initialCapacity){
m_textBuf=new StringBuffer(initialCapacity);
m_auxBuf=new StringBuffer(AUX_CAPACITY);
}
| Construye un objeto de la clase. |
@Override public int eDerivedOperationID(int baseOperationID,Class<?> baseClass){
if (baseClass == TClassifier.class) {
switch (baseOperationID) {
case TypesPackage.TCLASSIFIER___IS_ABSTRACT:
return TypesPackage.TINTERFACE___IS_ABSTRACT;
case TypesPackage.TCLASSIFIER___GET_SUPER_CLASSIFIER_REFS:
return Type... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public void simulate(){
double[] lambda=new double[stateCount * stateCount];
if (!branchSpecificLambda) {
siteModel.getSubstitutionModel().getInfinitesimalMatrix(lambda);
}
NodeRef root=tree.getRoot();
double[] categoryProbs=siteModel.getCategoryProportions();
int[] category=new int[nReplications];
fo... | perform the actual sequence generation |
private int makeAvailable() throws IOException {
if (pos != -1) {
return 0;
}
total+=tail - head - pad;
System.arraycopy(buffer,tail - pad,buffer,0,pad);
head=0;
tail=pad;
for (; ; ) {
int bytesRead=input.read(buffer,tail,bufSize - tail);
if (bytesRead == -1) {
final String msg="Stream e... | Attempts to read more data. |
public ImportFailedException(final String msg){
super(msg);
}
| Creates a new exception object. |
@Nullable public Object firstFieldValue(Object o) throws IgniteCheckedException {
assert o != null;
Field f=firstField(o.getClass());
if (f != null) {
try {
return f.get(o);
}
catch ( IllegalAccessException e) {
throw new IgniteCheckedException("Failed to access field for object [field=" +... | Gets field value for object. |
public static SipResponse create200OkInviteResponse(SipDialogPath dialog,String[] featureTags,String[] acceptContactTags,String sdp) throws PayloadException {
try {
Response response=SipUtils.MSG_FACTORY.createResponse(200,dialog.getInvite().getStackMessage());
ToHeader to=(ToHeader)response.getHeader(ToHeade... | Create a 200 OK response for INVITE request |
public static String encodeWebSafe(byte[] source,boolean doPadding){
return encode(source,0,source.length,WEBSAFE_ALPHABET,doPadding);
}
| Encodes a byte array into web safe Base64 notation. |
@Override public boolean supportsANSI92IntermediateSQL(){
debugCodeCall("supportsANSI92IntermediateSQL");
return false;
}
| Returns whether SQL-92 intermediate level grammar is supported. |
public boolean refreshCredentials(final URI targetUri,final boolean requireCompactToken){
BaseSecureStore.validateTargetUri(targetUri);
Trace.writeLine("BaseVsoAuthentication::refreshCredentials");
try {
TokenPair tokens=null;
AtomicReference<Token> refreshToken=new AtomicReference<Token>();
if (this.... | Attempts to generate a new personal access token (credentials) via use of a stored Azure refresh token, identified by the target resource. |
private void adjustWindowSize(ContainerWrapper parent){
BoundSize wBounds=lc.getPackWidth();
BoundSize hBounds=lc.getPackHeight();
if (wBounds == BoundSize.NULL_SIZE && hBounds == BoundSize.NULL_SIZE) return;
Container packable=getPackable((Component)parent.getComponent());
if (packable != null) {
Compo... | Checks the parent window/popup if its size is within parameters as set by the LC. |
@Deprecated public void put(final String name,final String[] values){
map.put(name,Lists.newArrayList(values));
}
| Set values for name |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.