code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
@Override public void onPause(){
super.onPause();
getActivity().unregisterReceiver(advertisingFailureReceiver);
}
| When app goes off screen, unregister the Advertising failure Receiver to stop memory leaks. (and because the app doesn't care if Advertising fails while the UI isn't active) |
public UserSearchManager(Connection con){
this.con=con;
userSearch=new UserSearch();
}
| Creates a new UserSearchManager. |
public int crc16(Byte[] bytes){
int crc=0xFFFF;
int polynomial=0x1021;
for ( byte b : bytes) {
for (int i=0; i < 8; i++) {
boolean bit=((b >> (7 - i) & 1) == 1);
boolean c15=((crc >> 15 & 1) == 1);
crc<<=1;
if (c15 ^ bit) crc^=polynomial;
}
}
crc&=0xffff;
return crc;
}... | calculates crc16 |
private void logSlowRequests(long requestLifetime,Request<?> request,byte[] responseContents,StatusLine statusLine){
if (DEBUG || requestLifetime > SLOW_REQUEST_THRESHOLD_MS) {
VolleyLog.d("HTTP response for request=<%s> [lifetime=%d], [size=%s], " + "[rc=%d], [retryCount=%s]",request,requestLifetime,responseCont... | Logs requests that took over SLOW_REQUEST_THRESHOLD_MS to complete. |
public void runTest() throws Throwable {
Document doc;
DOMImplementation domImpl;
DocumentType newDocType;
Document ownerDocument;
String qualifiedName="test:root";
String publicId;
String systemId;
java.util.List publicIds=new java.util.ArrayList();
publicIds.add("1234");
publicIds.add("test");
j... | Runs the test case. |
public void reconfigureRepositoryClients(){
for ( TaskRepository repository : myRepositories) {
if (repository instanceof BaseRepositoryImpl) {
((BaseRepositoryImpl)repository).reconfigureClient();
}
}
}
| Reconfigure repository's HTTP clients probably to apply new connection settings. |
void notifyArriving(Integer id){
firePropertyChange("Arriving",null,id);
}
| Notify parameter listeners that a device has entered the region covered by this sensor |
public Builder historyBufferSize(int historyBufferSize){
this.historyBufferSize=historyBufferSize;
return this;
}
| Sets the size of the history buffer for the subscription. |
public final int yylength(){
return zzMarkedPos - zzStartRead;
}
| Returns the length of the matched text region. |
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 RowHandleMap(final int keylength,final ByteOrder objectOrder,final int idxbytes,final int expectedspace,final String name){
this.rowdef=new Row(new Column[]{new Column("key",Column.celltype_binary,Column.encoder_bytes,keylength,"key"),new Column("long c-" + idxbytes + " {b256}")},objectOrder);
this.index=new... | initialize a HandleMap This may store a key and a long value for each key. The class is used as index for database files |
@Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case DatatypePackage.PRESENCE__MANDATORY:
setMandatory((Boolean)newValue);
return;
}
super.eSet(featureID,newValue);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private void init(){
eatTheRest=false;
tokens.clear();
}
| Resets the members to their original state i.e. remove all of <code>tokens</code> entries and set <code>eatTheRest</code> to false. |
public void update(String input){
try {
digestInstance.update(input.getBytes("ISO-8859-1"));
}
catch ( UnsupportedEncodingException e) {
throw new TorException(e);
}
}
| Convert the String <code>input</code> into an array of bytes using the ISO-8859-1 encoding and add these bytes to the current digest calculation. |
public CoapResponse post(String payload,int format,int accept){
return synchronous(accept(format(newPost().setURI(uri).setPayload(payload),format),accept));
}
| Sends a POST request with the specified payload, the specified content format and the specified Accept option and blocks until the response is available. |
public AuthenticationException(){
super();
}
| Creates a new AuthenticationException with a <tt>null</tt> detail message. |
private static String buildMessage(String format,Object... args){
String msg=(args == null) ? format : String.format(Locale.US,format,args);
StackTraceElement[] trace=new Throwable().fillInStackTrace().getStackTrace();
String caller="<unknown>";
for (int i=2; i < trace.length; i++) {
Class<?> clazz=trace[i]... | Formats the caller's provided message and prepends useful info like calling thread ID and method name. |
public void addEpisode(TvShowEpisode episode){
int oldValue=episodes.size();
episodes.add(episode);
episode.addPropertyChangeListener(propertyChangeListener);
addToSeason(episode);
Utils.sortList(episodes);
firePropertyChange(ADDED_EPISODE,null,episode);
firePropertyChange(EPISODE_COUNT,oldValue,episodes.... | Adds the episode. |
protected String doIt() throws Exception {
log.info("doIt - C_Project_ID=" + m_C_Project_ID + " - C_ProjectLine_ID="+ m_C_ProjectLine_ID+ " - Consolidate="+ m_ConsolidateDocument);
if (m_C_ProjectLine_ID != 0) {
MProjectLine projectLine=new MProjectLine(getCtx(),m_C_ProjectLine_ID,get_TrxName());
MProject p... | Perform process. |
protected TokenFilterFactory tokenFilterFactory(String name,Version matchVersion,ResourceLoader loader,String... keysAndValues) throws Exception {
return (TokenFilterFactory)analysisFactory(TokenFilterFactory.lookupClass(name),matchVersion,loader,keysAndValues);
}
| Returns a fully initialized TokenFilterFactory with the specified name, version, resource loader, and key-value arguments. |
public static Geometry bufferOp(Geometry g,double distance,int quadrantSegments,int endCapStyle){
BufferOp bufOp=new BufferOp(g);
bufOp.setQuadrantSegments(quadrantSegments);
bufOp.setEndCapStyle(endCapStyle);
Geometry geomBuf=bufOp.getResultGeometry(distance);
return geomBuf;
}
| Comutes the buffer for a geometry for a given buffer distance and accuracy of approximation. |
public static String now(){
return fromCalendar(GregorianCalendar.getInstance());
}
| Gets current date and time formatted as ISO 8601 string. |
public Point2D other(){
return best2;
}
| Returns the other point in the farthest pair of points. |
public AboutBox createAboutBox(Frame owner){
ClassLoader simpleClassLoader=makeInitialClassloader();
String about="";
try {
URL url=simpleClassLoader.getResource("META-INF/ABOUT.NFO");
if (url != null) {
about=Tools.readTextFile(new InputStreamReader(url.openStream()));
}
}
catch ( Exception... | Creates the about box for this plugin. |
public static boolean hasTokenFile(File tokenFile,String content) throws IOException {
return hasToken(tokenFile.getParentFile(),tokenFile.getName(),content);
}
| Returns true iff the given directory has a file with the given name containing the given content. |
private void ekskey(byte data[],byte key[]){
int i;
int koffp[]={0}, doffp[]={0};
int lr[]={0,0};
int plen=P.length, slen=S.length;
for (i=0; i < plen; i++) P[i]=P[i] ^ streamtoword(key,koffp);
for (i=0; i < plen; i+=2) {
lr[0]^=streamtoword(data,doffp);
lr[1]^=streamtoword(data,doffp);
enciph... | Perform the "enhanced key schedule" step described by Provos and Mazieres in "A Future-Adaptable Password Scheme" http://www.openbsd.org/papers/bcrypt-paper.ps |
public String sqlADAction_deleteUnusedElementTranslations(String vendorName,String catalogName,String schemaName){
String subQuery2a=sql_select(vendorName,catalogName,schemaName,"AD_Column","c",new ArrayList<String>(Arrays.asList("1")),null,new ArrayList<String>(Arrays.asList("UPPER(e.ColumnName) = UPPER(c.ColumnName... | gets the database-specific SQL command to delete unused element translations |
private static Set<CallSite> findObviouslyLockedCallSites(ClassContext classContext,SelfCalls selfCalls) throws CFGBuilderException, DataflowAnalysisException {
ConstantPoolGen cpg=classContext.getConstantPoolGen();
Set<CallSite> obviouslyLockedSites=new HashSet<CallSite>();
for (Iterator<CallSite> i=selfCalls.ca... | Find all self-call sites that are obviously locked. |
ITypeBinding resolveWellKnownType(String name){
return null;
}
| Resolves the given well known type by name and returns the type binding for it. <p> The implementation of <code>AST.resolveWellKnownType</code> forwards to this method. </p> <p> The default implementation of this method returns <code>null</code>. Subclasses may reimplement. </p> |
public BitFlip(double probability){
super();
this.probability=probability;
}
| Constructs a bit flip operator. |
public FailureResponse sendAndWaitFailure(Operation op){
FailureResponse response=new FailureResponse();
String msg=String.format("Expected operation failure but was successful. uri=%s ",op.getUri());
Exception callerStack=new RuntimeException(msg);
TestContext waitContext=new TestContext(1,this.timeout);
op.... | Synchronously perform operation. Expecting provided operation to be failed. |
@Override protected EClass eStaticClass(){
return ModelPackage.Literals.MODEL_REFERENCE;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
protected void error(Token tok,String msg) throws LexerException {
error(tok.getLine(),tok.getColumn(),msg);
}
| Handles an error. If a PreprocessorListener is installed, it receives the error. Otherwise, an exception is thrown. |
public void registerProvider(Class<?> dtoInterface,DtoProvider<?> provider){
dtoInterface2Providers.put(dtoInterface,provider);
}
| Registers DtoProvider for DTO interface. |
@Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case N4JSPackage.PAREN_EXPRESSION__EXPRESSION:
setExpression((Expression)newValue);
return;
}
super.eSet(featureID,newValue);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public String checkDependencies(URI uri,Class<? extends DataObject> type,boolean onlyActive,List<Class<? extends DataObject>> excludeTypes){
String depMsg=localDependencyChecker.checkDependencies(uri,type,true,excludeTypes);
if (depMsg != null || KeyspaceUtil.isLocal(type)) {
return depMsg;
}
if (hasDisconn... | checks to see if any references exist for this uri uses dependency list created from relational indices |
public void writeFile() throws IOException {
int maxLength=0;
if (octaveFilename == null) {
throw new IOException("No filename has been set");
}
String originalLSValue=null;
if (writeLFOnly) {
originalLSValue=System.getProperty(LINE_SEPARATOR_PROPERTY);
System.setProperty(LINE_SEPARATOR_PROPERTY,L... | Writes the contained variables to a file formatted for octave to read |
protected String paramString(){
String orientationString=(orientation == HORIZONTAL ? "HORIZONTAL" : "VERTICAL");
return super.paramString() + ",blockIncrement=" + blockIncrement+ ",orientation="+ orientationString+ ",unitIncrement="+ unitIncrement;
}
| Returns a string representation of this JScrollBar. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be <code>null</code>. |
public FrameworkException(Throwable cause){
super(cause);
}
| Constructs a new framework exception with the specified cause. |
public boolean hasMinorCode(){
return fieldSetFlags()[1];
}
| Checks whether the 'minorCode' field has been set |
public static String infoKey(){
String s="";
if (systemOS == System.Unknown) s+="o";
else if (systemOS == System.MacOSC) s+="c";
else if (systemOS == System.MacOSX) s+="x";
else if (systemOS == System.Unix) s+="u";
else if (systemOS == System.Windows) s+="w";
else s+="o";
if (isMacArchite... | generates a 2-character string containing information about the OS-type |
public static <T>T string2Obj(String str,Class<T> clazz){
if (str == null || clazz == null) {
return null;
}
try {
return clazz.equals(String.class) ? (T)str : objectMapper.readValue(str,clazz);
}
catch ( Exception e) {
log.info("parse String to Object error, String:{}, Class<T>:{}, error:{}",str,... | String => Object |
public void update(Graphics a,JComponent b){
for (int i=0; i < uis.size(); i++) {
((ComponentUI)(uis.elementAt(i))).update(a,b);
}
}
| Invokes the <code>update</code> method on each UI handled by this object. |
public void addAll(Collection<? extends E> c){
for ( E element : c) add(element);
}
| Adds all elements from a Collection to the Bloom filter. |
static URI withoutFragment(final String fullUri){
int hashmarkIdx=fullUri.indexOf('#');
String rval;
if (hashmarkIdx == -1) {
rval=fullUri;
}
else {
rval=fullUri.substring(0,hashmarkIdx);
}
try {
return new URI(rval);
}
catch ( URISyntaxException e) {
throw new RuntimeException(e);
}
... | Returns the absolute URI without its fragment part. |
public static Occurred compare(VectorClock v1,VectorClock v2){
if (v1 == null || v2 == null) throw new IllegalArgumentException("Can't compare null vector clocks!");
boolean v1Bigger=false;
boolean v2Bigger=false;
int p1=0;
int p2=0;
while (p1 < v1.versions.size() && p2 < v2.versions.size()) {
ClockEn... | Is this Reflexive, AntiSymetic, and Transitive? Compare two VectorClocks, the outcomes will be one of the following: -- Clock 1 is BEFORE clock 2 if there exists an i such that c1(i) <= c(2) and there does not exist a j such that c1(j) > c2(j). -- Clock 1 is CONCURRENT to clock 2 if there exists an i, j such that c1(i)... |
public String chompBalanced(char open,char close){
int start=-1;
int end=-1;
int depth=0;
char last=0;
do {
if (isEmpty()) break;
Character c=consume();
if (last == 0 || last != ESC) {
if (c.equals(open)) {
depth++;
if (start == -1) start=pos;
}
else ... | Pulls a balanced string off the queue. E.g. if queue is "(one (two) three) four", (,) will return "one (two) three", and leave " four" on the queue. Unbalanced openers and closers can be escaped (with \). Those escapes will be left in the returned string, which is suitable for regexes (where we need to preserve the esc... |
public static CrontabRangeExpression crontabScheduleRange(int lowerBounds,int upperBounds){
return new CrontabRangeExpression(constant(lowerBounds),constant(upperBounds));
}
| Creates a range cron parameter. |
public static double regularizedGammaP(double a,double x,double epsilon,int maxIterations){
double ret;
if (Double.isNaN(a) || Double.isNaN(x) || (a <= 0.0)|| (x < 0.0)) {
ret=Double.NaN;
}
else if (x == 0.0) {
ret=0.0;
}
else if (x >= a + 1) {
ret=1.0 - regularizedGammaQ(a,x,epsilon,maxIterat... | Returns the regularized gamma function P(a, x). The implementation of this method is based on: <ul> <li> <a href="http://mathworld.wolfram.com/RegularizedGammaFunction.html"> Regularized Gamma Function</a>, equation (1) </li> <li> <a href="http://mathworld.wolfram.com/IncompleteGammaFunction.html"> Incomplete Gamma Fun... |
public void removeNode(TreeNode node){
if (children != null) children.remove(node);
}
| Remove a child node from this node, if it is one. |
void parseGlyph(Range r,Path gp,FlPoint pt){
pos=r.getStart();
int i;
float x1, y1, x2, y2, x3, y3, ybase;
int hold;
int stemhints=0;
while (pos < r.getEnd()) {
int cmd=readCommand(true);
hold=0;
switch (cmd) {
case 1:
case 3:
stackptr=0;
break;
case 4:
if (stackptr > 1) {
stack[0]=s... | parse a glyph defined in a particular range |
public static long length2(int x1,int y1,int x2,int y2){
return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}
| Gets the square distance between two points. |
private boolean conditionCH0(String value,int index){
if (index != 0) {
return false;
}
else if (!contains(value,index + 1,5,"HARAC","HARIS") && !contains(value,index + 1,3,"HOR","HYM","HIA","HEM")) {
return false;
}
else if (contains(value,0,5,"CHORE")) {
return false;
}
else {
return tr... | Complex condition 0 for 'CH' |
public static boolean isSelfCall(JCTree tree){
return calledMethodNameisSelfOrSuper(tree,true,true);
}
| Is this a call to this or super? |
public Object remove(int index){
Entry e=entry(index);
remove(e);
return e.element;
}
| Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list. |
public static MBeanServer createMBeanServer(){
return createMBeanServer(null);
}
| <p>Return a new object implementing the MBeanServer interface with a standard default domain name. The default domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null.</p> <p>The standard default domain name is <code>DefaultDomain</code>.</p> <p>The MBeanServ... |
public void start(){
}
| Start main-thread monitoring. |
protected ICommitRecord loadCommitRecord(IRawStore store,long addr){
return CommitRecordSerializer.INSTANCE.deserialize(store.read(addr));
}
| Re-load a commit record from the store. |
public void sortKeysReverse(){
sortImpl(true,true);
}
| Sort the keys alphabetically in reverse (ignoring case). Uses the value as a tie-breaker (only really possible with a key that has a case change). |
public TimestampToken generateTimestampToken(final TimestampType timestampType,final XAdESSignatureParameters signatureParameters,final byte[] references){
if (timestampType == null) {
throw new NullPointerException();
}
if (signatureParameters == null) {
throw new NullPointerException();
}
final Time... | Method that generates a TimestampToken given a TimestampType, a set of signature parameters and a byte array containing the concatenated references |
public void remove(SyncOperation operation){
SyncOperation operationToRemove=mOperationsMap.remove(operation.key);
if (operationToRemove == null) {
return;
}
if (!mSyncStorageEngine.deleteFromPending(operationToRemove.pendingOperation)) {
final String errorMessage="unable to find pending row for " + ope... | Remove the specified operation if it is in the queue. |
public Hash(final byte[] data){
this.data=data;
}
| Creates new Hash object. |
@DSModeled(DSC.SAFE) public void drawOval(RectF oval,Paint paint){
addTaint(oval.getTaint());
addTaint(paint.getTaint());
}
| Draw the specified oval using the specified paint. The oval will be filled or framed based on the Style in the paint. |
public static boolean isABurst(String toTest){
return toTest.length() == 114 && toTest.matches("[01]*");
}
| Check if the String is a burst or not |
@Override public String buildTextFromElement(Element element){
StringBuilder strb=new StringBuilder();
if (StringUtils.isNotBlank(element.ownText())) {
strb.append(SPACER);
strb.append(element.ownText().trim());
}
strb.append(getTextualContentOfAttribute(element,AttributeStore.ALT_ATTR));
strb.append(... | The textual content of an element can be composed with : <ul> <li> The text of the element</li> <li> The text of the alt attribute of the element</li> <li> The text of the title attribute of the element</li> <li> The text of the summary attribute of the element</li> <li> The text of the value attribute of the element</... |
public HeidelpayResponse(String response) throws ParserConfigurationException, SAXException, IOException, XPathExpressionException {
Document responseDoc=XMLConverter.convertToDocument(response,true);
this.processingResult=XMLConverter.getNodeTextContentByXPath(responseDoc,"/Response/Transaction/Processing/Result")... | Reads the result document and identifies the result related information. The object will be initialized with them. |
public void postDeSerialize(){
territoryListeners=new ListenerList<>();
dataChangeListeners=new ListenerList<>();
gameMapListeners=new ListenerList<>();
}
| Not to be called by mere mortals. |
public static void dropTable(Database db,boolean ifExists){
String sql="DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"SIMPLE_ENTITY_NOT_NULL\"";
db.execSQL(sql);
}
| Drops the underlying database table. |
public boolean hasRemoved(){
return hasExtension(Removed.class);
}
| Returns whether it has the removed. |
public void paint(Graphics2D g){
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
origAlpha=1.0f;
Composite origComposite=g.getComposite();
if (origComposite instanceof AlphaComposite) {
AlphaComposite origAlphaComposite=(AlphaComposite)origComposite;
if (origAlphaC... | Paints the transcoded SVG image on the specified graphics context. You can install a custom transformation on the graphics context to scale the image. |
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:27:51.659 -0500",hash_original_method="84C5DF0BB814E2B994CF01B1B056D342",hash_generated_method="376E7DFE8900D748A8960D497FE30420") private static String processPlusCodeWithinNan... | This function handles the plus code conversion within NANP CDMA network If the number format is 1)+1NANP,remove +, 2)other than +1NANP, any + numbers,replace + with the current IDP |
public NewTarget createNewTarget(){
NewTargetImpl newTarget=new NewTargetImpl();
return newTarget;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public BaleenConsoleLoggerBuilder(String name,String pattern,List<Filter<ILoggingEvent>> filters){
super(name,pattern,filters);
}
| Create a new instance with a specified name |
private void fireRemoved(final RPObject object,final String slotName,final RPObject sobject){
listener.onSlotRemoved(object,slotName,sobject);
userListener.onSlotRemoved(object,slotName,sobject);
fireRemoved(sobject);
}
| Notify listeners that a slot object was removed. |
public static boolean matchCurrentHadoopVersion(int majorVersion){
return majorVersion == 2 && isHadoop2Env();
}
| Check if a Hadoop version matches the current Hadoop environment |
@Override public boolean supportsIntegrityEnhancementFacility(){
debugCodeCall("supportsIntegrityEnhancementFacility");
return true;
}
| Returns whether referential integrity is supported. |
public Vector3f sub(float x,float y,float z){
this.x-=x;
this.y-=y;
this.z-=z;
return this;
}
| Decrement the components of this vector by the given 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:30.249 -0500",hash_original_method="5451D461541A6217AC0EFFC2EF4C9329",hash_generated_method="4017904D62B0FEC0C72BF95924032E36") public static String toString(long n){
Str... | Converts the specified long value into its decimal string representation. The returned string is a concatenation of a minus sign if the number is negative and characters from '0' to '9'. |
@Override public void processEvent(SystemEvent event) throws AbortProcessingException {
final UIViewRoot source=(UIViewRoot)event.getSource();
final FacesContext context=FacesContext.getCurrentInstance();
final WebXmlParameters webXmlParameters=new WebXmlParameters(context.getExternalContext());
final boolean p... | Process event. Just the first time. |
public boolean isLocalThumbnailPreviewsEnabled(){
return mLocalThumbnailPreviewsEnabled;
}
| Returns whether the use of local thumbnails for previews is enabled. |
public boolean isPowerOfFour(int num){
return num > 0 && (num & (num - 1)) == 0 && (num & 0x55555555) != 0;
}
| Power of 4 has only a single bit 1 on the highest bit. Plus, this single bit should be on odd digit. So create a number that has 1 on each and every digit, which is 0x55555555. num & 0x55555555 should not be 0. |
private void cmd_import(){
JFileChooser jc=new JFileChooser();
jc.setDialogTitle(Msg.getMsg(Env.getCtx(),"Import"));
jc.setDialogType(JFileChooser.OPEN_DIALOG);
jc.setFileSelectionMode(JFileChooser.FILES_ONLY);
if (jc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) return;
StringBuffer sb=new StringB... | Import Text from File |
public void add(final long addr){
addrs.add(addr);
}
| Add an address to this bucket. |
public TopHitsBuilder addHighlightedField(HighlightBuilder.Field field){
highlightBuilder().field(field);
return this;
}
| Adds a highlighted field. |
@Override protected int sizeOf(String key,BitmapDrawable value){
final int bitmapSize=getBitmapSize(value) / 1024;
return bitmapSize == 0 ? 1 : bitmapSize;
}
| Measure item size in kilobytes rather than units which is more practical for a bitmap cache |
public static ASN1Primitive convertValueToObject(X509Extension ext) throws IllegalArgumentException {
try {
return ASN1Primitive.fromByteArray(ext.getValue().getOctets());
}
catch ( IOException e) {
throw new IllegalArgumentException("can't convert extension: " + e);
}
}
| Convert the value of the passed in extension to an object |
public static double[][] randn(int rows,int cols,Random r){
double X[][]=new double[rows][cols];
for (int i=0; i < rows; i++) {
for (int j=0; j < cols; j++) {
X[i][j]=r.nextGaussian();
}
}
return X;
}
| A 2D array of Gaussian random numbers |
private void loadMenuSettings(){
for ( String setting : menuBooleanSettings) {
loadMenuSetting(setting);
}
}
| Initiates the Main Menu with settings |
public void testLongMissing() throws IOException {
Directory dir=newDirectory();
RandomIndexWriter writer=new RandomIndexWriter(random(),dir);
Document doc=new Document();
writer.addDocument(doc);
doc=new Document();
doc.add(new LongPoint("value",-1));
doc.add(new StoredField("value",-1));
writer.addDoc... | Tests sorting on type long with a missing value |
public static boolean isIndependentPooledMudholkerGeorge(List<IndependenceTest> independenceTests,Node x,Node y,List<Node> condSet){
double alpha=independenceTests.get(0).getAlpha();
double c=Math.sqrt(3 * (5 * independenceTests.size() + 4) / (double)(independenceTests.size() * Math.pow(Math.PI,2) * (5 * independen... | Checks independence from pooled samples using Mudholker and George's method <p> See G. S. Mudholkar and E. O. George. The logit method for combining probabilities. In J. Rustagi, editor, Symposium on Optimizing Method in Statistics, pages 345-366. Academic Press, 1979. |
public static void falseValue(final boolean value,final String name){
if (value) {
final String message=String.format("%s must be false",name);
throw new IllegalArgumentException(message);
}
}
| Throws an exception if the specified value is not false. |
protected int rearrangePoints(int[] indices,final int startidx,final int endidx,final int splitDim,final double splitVal){
int tmp, left=startidx - 1;
for (int i=startidx; i <= endidx; i++) {
if (m_EuclideanDistance.valueIsSmallerEqual(m_Instances.instance(indices[i]),splitDim,splitVal)) {
left++;
t... | Re-arranges the indices array such that the points <= to the splitVal are on the left of the array and those > the splitVal are on the right. |
private synchronized void removeLock(FileLock lock){
locks.remove(lock);
}
| Removes an acquired lock from the lock manager. If the lock did not exist in the lock manager the operation is a no-op. |
public static void main(String[] args){
TabbedPaneDemo demo=new TabbedPaneDemo(null);
demo.mainImpl();
}
| main method allows us to run as a standalone demo. |
private SourceContext generateRichText(TextNode textNode){
SourceContext srcContext=new SourceContext(1024,0);
StringBuilder buf=srcContext.functionBuffer;
Variables varContext=new Variables();
varContext.setVar(richTextType,NodeType.RICHTEXT);
String elementVar=varContext.elementVar;
generateTextVariable(t... | Generates ActionScript code to initialize a new instance of RichText for a given FXG TextGraphic node, its attributes, and any child nodes. |
public C upperEndpoint(){
return upperBound.endpoint();
}
| Returns the upper endpoint of this range. |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
@Override public String toString(){
return "org.jpedal.fonts.tt.hinting.TTGraphicsState[" + "zp0=" + (zp0 == TTVM.GLYPH_ZONE ? "GLYPH" : "TWILIGHT") + ",zp1="+ (zp1 == TTVM.GLYPH_ZONE ? "GLYPH" : "TWILIGHT")+ ",zp2="+ (zp2 == TTVM.GLYPH_ZONE ? "GLYPH" : "TWILIGHT")+ ",rp0="+ rp0+ ",rp1="+ rp1+ ",rp2="+ rp2+ ",freedom... | Returns a string containing details of the graphics state. |
public static TestSSLContext create(TestKeyStore client,TestKeyStore server){
String provider=StandardNames.JSSE_PROVIDER_NAME;
return create(client,server,provider,provider);
}
| TestSSLContext creation method that allows separate creation of server key store |
private String createString(String f){
return "srcXInBytes=" + srcXInBytes + f+ "srcY="+ srcY+ f+ "srcZ="+ srcZ+ f+ "srcLOD="+ srcLOD+ f+ "srcMemoryType="+ CUmemorytype.stringFor(srcMemoryType)+ f+ "srcHost="+ srcHost+ f+ "srcDevice="+ srcDevice+ f+ "srcArray="+ srcArray+ f+ "srcContext="+ srcContext+ f+ "srcPitch="+... | Creates and returns a string representation of this object, using the given separator for the fields |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.