code
stringlengths
10
174k
nl
stringlengths
3
129k
public CharSequence loadDescription(PackageManager pm){ if (descriptionRes != 0) { CharSequence label=pm.getText(packageName,descriptionRes,this); if (label != null) { return label; } } return null; }
Retrieve the textual description of the application. This will call back on the given PackageManager to load the description from the application.
public int difference(String s1,String s2) throws EncoderException { return difference(this,s1,s2); }
Encodes the Strings and returns the number of characters in the two encoded Strings that are the same. This return value ranges from 0 through 4: 0 indicates little or no similarity, and 4 indicates strong similarity or identical values.
protected boolean hasAttemptRemaining(){ return mCurrentRetryCount <= mMaxNumRetries; }
Returns true if this policy has attempts remaining, false otherwise.
public static String prepareInsertTemplateWithoutColumn(String tableName,int columnNum){ return "INSERT INTO " + tableName + " VALUES "+ generatePlaceholder(columnNum); }
prepare SQL insert template with placeholders, 'INSERT INTO table VALUES (?,?,?)'
public Task<FileShareRestRep> export(URI id,FileSystemExportParam input){ return postTask(input,getExportsUrl(),id); }
Exports the given file system by ID. <p> API Call: <tt>POST /file/filesystems/{id}/exports</tt>
public void addEntry(LocalVarEntry e){ vars.addElement(e); }
Add a LocalVar Entry to the attribute
protected Shape createInnerFocus(final SegmentType segmentType,final int x,final int y,final int w,final int h){ switch (segmentType) { case FIRST: return shapeGenerator.createRoundRectangle(x - 1,y - 1,w + 2,h + 1,CornerSize.INNER_FOCUS,CornerStyle.ROUNDED,CornerStyle.ROUNDED,CornerStyle.SQUARE,CornerStyle.SQUARE)...
Create the shape for the inner focus ring. Designed to be drawn rather than filled.
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.
@After public void tearDown(){ file=null; }
Removes references to any shared objects for garbage collection.
@Override public int findSegment(Point2D.Double find,double tolerance){ if (get(TRANSFORM) != null) { try { find=(Point2D.Double)get(TRANSFORM).inverseTransform(find,new Point2D.Double()); } catch ( NoninvertibleTransformException ex) { System.err.println("Warning: SVGBezierFigure.findSegment....
Gets the segment of the polyline that is hit by the given Point2D.Double.
public Money exchange(final Money amount){ switch (type_) { case Direct: if (amount.currency().eq(source_)) { return new Money(amount.value() * rate_,target_); } else if (amount.currency().eq(target_)) { return new Money(amount.value() / rate_,source_); } else { throw new LibraryExce...
Apply this ExchangeRate an amount of cash. A new money instance will be returned. The input remains unchanged.
public boolean isMax(){ return value.isMax(); }
Test for zero. Equivalent to .EQ(Word.max())
public static void cursorFillWindow(final ICursor cursor,int position,final CursorWindow window){ if (position < 0 || position >= cursor.getCount()) { return; } final int oldPos=cursor.getPosition(); final int numColumns=cursor.getColumnCount(); window.clear(); window.setStartPosition(position); windo...
Fills the specified cursor window by iterating over the contents of the cursor. The window is filled until the cursor is exhausted or the window runs out of space. The original position of the cursor is left unchanged by this operation.
public GF2Polynomial(GF2Polynomial b){ len=b.len; blocks=b.blocks; value=IntUtils.clone(b.value); }
Creates a new GF2Polynomial by cloneing the given GF2Polynomial <i>b</i>.
@Override public boolean equals(Object o){ if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; AbstractIconRetriever that=(AbstractIconRetriever)o; return this.retrieverPath != null ? this.retrieverPath.equals(that.retrieverPath) : that.retrieverPath == null; }
Indicates whether or not this retriever is equal to another.
public static BigDecimal allocatedAmt(int C_Invoice_ID,int C_Currency_ID,int C_ConversionType_ID,BigDecimal MultiplierAP) throws SQLException { BigDecimal paidAmt=Adempiere.ZERO; String sql="SELECT a.AD_Client_ID, a.AD_Org_ID," + " al.Amount, al.DiscountAmt, al.WriteOffAmt," + " a.C_Currency_ID, a.DateTrx "+ "FROM ...
Get Allocated Amt (not directly used)
public boolean isWrapOnTyping(@Nullable Language language){ if (language != null) { CommonCodeStyleSettings langSettings=getCommonSettings(language); if (langSettings != null) { if (langSettings.WRAP_ON_TYPING != WrapOnTyping.DEFAULT.intValue) { return langSettings.WRAP_ON_TYPING == WrapOnTyping...
Defines whether or not wrapping should occur when typing reaches right margin.
public void usingAnd(){ BiPredicate<Employee,Manager> isPersonalAssistant=empManagerPredicate.and(managerHasAssistantPredicate); }
Using AND function
public TransactionOutput addOutput(Coin value,Address address){ return addOutput(new TransactionOutput(params,this,value,address)); }
Creates an output based on the given address and value, adds it to this transaction, and returns the new output.
static void test4(File blah) throws Exception { try (FileChannel fc=new FileOutputStream(blah,true).getChannel()){ fc.tryLock().release(); fc.tryLock(0L,1L,false).release(); fc.lock().release(); fc.lock(0L,1L,false).release(); } try (FileChannel fc=FileChannel.open(blah.toPath(),APPEND)){ fc....
Test file locking when file is opened for append
public int numCps(){ if (cpStr2Int == null) { return 0; } else { return cpStr2Int.size(); } }
Num cps.
public static boolean startWithSpace(String s){ return s.length() > 0 && Character.isWhitespace(s.charAt(0)); }
Check whether the statement starts with a whitespace.
private void onOpenConversation(){ new LoadConversationTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,null); }
To be called when the user opens a conversation. Initializes the Conversation objects, sets up the draft, and marks the conversation as read. <p> Note: This will have no effect if the context has not been initialized yet.
public void circle(Object[] vertices,double r,double left,double top){ int vertexCount=vertices.length; double phi=2 * Math.PI / vertexCount; for (int i=0; i < vertexCount; i++) { if (isVertexMovable(vertices[i])) { setVertexLocation(vertices[i],left + r + r * Math.sin(i * phi),top + r + r * Math.cos(i ...
Executes the circular layout for the specified array of vertices and the given radius.
public BRqTest(String name){ super(name); }
Initializes the test.
public Compiler(){ m_errorHandler=null; m_locator=null; }
Construct a Compiler instance that has a null error listener and a null source locator.
public void init(){ Debug.message("eomg","EditableOMGraphicList.init()"); getEditables(); setStateMachine(new ListStateMachine(this)); }
Create and initialize the state machine that interprets the modifying gestures/commands, as well as initialize the grab points. Also allocates the grab point array needed by the EditableOMGraphicList.
void verify(){ byte[] d=digest.digest(); if (!MessageDigest.isEqual(d,Base64.decode(hash))) { throw invalidDigest(JarFile.MANIFEST_NAME,name,jarName); } verifiedEntries.put(name,certificates); }
Verifies that the digests stored in the manifest match the decrypted digests from the .SF file. This indicates the validity of the signing, not the integrity of the file, as it's digest must be calculated and verified when its contents are read.
long totalLength(){ return mTotalLength; }
Get the total length. Should only be used for testing.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:42.960 -0500",hash_original_method="025E1AD213DC2532673CB1D1FC75B1CC",hash_generated_method="AF9BD842838DEB26BE1BF73447B9C978") public ContentEncodingParser(String contentEncoding){ super(contentEncoding); }
Creates a new instance of ContentEncodingParser
public Bitmap decodeBestRegion(int requiredWidth,int requiredHeight,int gravity){ boolean upscaling=false; int realWidth=getWidth(); int realHeight=getHeight(); BitmapFactory.Options options=new BitmapFactory.Options(); if (!(requiredWidth <= realWidth && requiredHeight <= realHeight)) { float widthRatio=...
Extracts the "best" rectangle region based on the specified dimensions. The "best" region means the biggest region of the original (downsampled) image, given the required gravity and output sizes/ratio. You should use this method when you have a big source image that have to be fit/be partially displayed.
public static void quote(Appendable buffer,String input){ try { buffer.append('"'); for (int i=0; i < input.length(); ++i) { char c=input.charAt(i); if (c >= 32) { if (c == '"' || c == '\\') buffer.append('\\'); buffer.append(c); } else { char escape=escapes[...
Quote a string into an Appendable. The characters ", \, \n, \r, \t, \f and \b are escaped
public String deleteThickLogicalUnits(String systemObjectId,Set<String> logicalUnitIdList,String model) throws Exception { return hdsApiVolumeManager.deleteThickLogicalUnits(systemObjectId,logicalUnitIdList,model); }
Client call to delete logicalunits.
void submit(String submitKey,String submitVal){ if (action == null) { return; } boolean error=false; String url=action; String params=null; if (comps.size() > 0) { params=""; for (Enumeration e=comps.keys(); e.hasMoreElements(); ) { String key=(String)e.nextElement(); Object input=co...
Called when the a form submit is needed. This querys all form fields, creates a URL accordingly and sets it to the HTMLComponent
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){ switch (featureID) { case N4JSPackage.ABSTRACT_CASE_CLAUSE__STATEMENTS: return getStatements(); } return super.eGet(featureID,resolve,coreType); }
<!-- begin-user-doc --> <!-- end-user-doc -->
@Override public MethodVisitor visitMethod(int access,String base,String desc,String signature,String[] exceptions){ MethodVisitor mv=cv.visitMethod(access,base,desc,signature,exceptions); if (mv != null) { JSRInlinerAdapter jsria=new JSRInlinerAdapter(mv,access,base,desc,signature,exceptions); AllocationMe...
For each method in the class being instrumented, <code>visitMethod</code> is called and the returned MethodVisitor is used to visit the method. Note that a new MethodVisitor is constructed for each method.
public void mdctCalc(float[] output,int outputOffset,float[] input,int inputOffset){ int n=1 << mdctBits; int n2=n >> 1; int n4=n >> 2; int n8=n >> 3; int n3=3 * n4; for (int i=0; i < n8; i++) { float re=-input[inputOffset + 2 * i + n3] - input[inputOffset + n3 - 1 - 2 * i]; float im=-input[inputOff...
Compute MDCT of size N = 2^nbits
public static double largeEstimatorCutoff(final int log2m,final int registerSizeInBits){ return (TWO_TO_L[(REG_WIDTH_INDEX_MULTIPLIER * registerSizeInBits) + log2m]) / 30.0; }
The cutoff for using the "large range correction" formula, from the HyperLogLog algorithm, adapted for 64 bit hashes.
public FormUploadException(final String msg){ this(msg,null); }
Constructs a new <code>FileUploadException</code> with specified detail message.
public final int offsetToX(int line,int offset){ painter.currentLineTokens=null; return _offsetToX(line,offset); }
Converts an offset in a line into an x co-ordinate. This is a slow version that can be used any time.
public static Class toClass(ClassFile cf,ClassLoader loader) throws CannotCompileException { return toClass(cf,loader,null); }
Loads a class file by a given class loader. This method uses a default protection domain for the class but it may not work with a security manager or a sigend jar file.
@RequestMapping(value="/jobs/ids/{id}",method=RequestMethod.DELETE) @Secured(SecurityFunctions.FN_JOBS_DELETE) public Job deleteJob(@PathVariable("id") String id,@RequestBody JobDeleteRequest jobDeleteRequest) throws Exception { return jobService.deleteJob(id,jobDeleteRequest); }
Deletes a currently running job and preserves the job state in history. <p>Requires EXECUTE permission on namespace</p>
public static int repoZipArchiveSize(){ int size=-1; try { PACKAGE_MANAGER.setPackageRepositoryURL(REP_URL); String numPackagesS=PACKAGE_MANAGER.getPackageRepositoryURL().toString() + "/repoSize.txt"; URLConnection conn=null; URL connURL=new URL(numPackagesS); if (PACKAGE_MANAGER.setProxyAuthent...
Retrieves the size (in KB) of the repository zip archive stored on the server.
public int readIntFromXML(Element node) throws Exception { if (DEBUG) { trace(new Throwable(),node.getAttribute(ATT_NAME)); } m_CurrentNode=node; return ((Integer)getPrimitive(node)).intValue(); }
builds the primitive from the given DOM node.
public Token peekToken(){ while (needMoreTokens()) { fetchMoreTokens(); } return this.tokens.get(0); }
Return the next token, but do not delete it from the queue.
private JobDefinition createJobDefinitionFromEntity(JobDefinitionEntity jobDefinitionEntity) throws IOException { JobDefinition jobDefinition=new JobDefinition(); jobDefinition.setId(jobDefinitionEntity.getId()); jobDefinition.setNamespace(jobDefinitionEntity.getNamespace().getCode()); jobDefinition.setJobName(...
Creates the job definition from the persisted entity.
public ColumnMetadata(Table table,String column,Comparator cmp,boolean dynamic){ m_table=table; m_field=column; m_cmp=cmp; m_dynamic=dynamic; }
Creates a new ColumnMetadata instance.
@DSSink({DSSinkKind.SENSITIVE_UNCATEGORIZED}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:05.005 -0500",hash_original_method="227FECEA7131D056EF18EE2E9369B9A1",hash_generated_method="459DC1330B09FE06A09C222972E31D1D") @Override protected byte[] decrypt(byte type,byte[] fragme...
Retrieves the fragment of the Plaintext structure of the specified type from the provided data.
public Node removeNamedItemNS(String namespaceURI,String localName) throws DOMException { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
Removes a node specified by local name and namespace URI. A removed attribute may be known to have a default value when this map contains the attributes attached to an element, as returned by the attributes attribute of the <code>Node</code> interface. If so, an attribute immediately appears containing the default valu...
public void refreshCompletely(){ initialize(); }
Makes the log perform complete refresh for all roots. It fairly retrieves the data from the VCS and rebuilds the whole log.
@Override public void createUser(User user) throws SQLException { String skeleton; if (user.isPrivileged()) { skeleton="grant all on *.* to %s@'%%' identified by '%s' with grant option"; String sql=String.format(skeleton,user.getLogin(),user.getPassword()); execute(sql); } else { skeleton="grant ...
Creates a user that can connect from any location. If the user is a superuser, grant all on *.*, otherwise just grant select.
public Boolean isEagerZero(){ return eagerZero; }
Gets the value of the eagerZero property.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:51.188 -0400",hash_original_method="C1AF40BAF4362B77A9C74A69039A6769",hash_generated_method="8A0434476D39CA378011B884C5880AAF") public static void write(File file,CharSequence data,String encoding,boolean append) throws IOException ...
Writes a CharSequence to a file creating the file if it does not exist.
private static void createBillingResultDataMock(){ Long subscriptionKey=1L; billingResultDataMock.put(subscriptionKey,new BillingResultDataMock(CURRENCY_EUR,BigDecimal.valueOf(120),getProductHistory(subscriptionKey))); subscriptionKey=2L; billingResultDataMock.put(subscriptionKey,new BillingResultDataMock(CURRE...
Subscription;ProductId;ProductKey;Currency;NetAmount;Supplier <br/> 1; productId_1; 1; EUR; 120; 1 <br/> 2; productId_1; 1; EUR; 210.15; 1 <br/> 3; productId_2; 2; EUR; 187.99; 1 <br/> 4; productId_3; 3; EUR; 26; 2 <br/> 5; productId_3; 3; USD; 523.56; 2 <br/> 6; productId_1; 1; EUR; 176.44; 1 <br/>
public ScientificFormat(int sigDigit,int maxWidth,boolean SciNote){ setSigDigits(sigDigit); setMaxWidth(maxWidth); setScientificNotationStyle(SciNote); }
Sets the significant digits, maximum allowable width and number formatting style (SciNote == true for Pure formatting).
public Boolean isNestedHVEnabled(){ return nestedHVEnabled; }
Gets the value of the nestedHVEnabled property.
public Document createDefaultDocument(Font defaultFont,Color foreground){ StyleSheet styles=getStyleSheet(); StyleSheet ss=new StyleSheet(); ss.addStyleSheet(styles); BasicDocument doc=new BasicDocument(ss,defaultFont,foreground); doc.setAsynchronousLoadPriority(Integer.MAX_VALUE); doc.setPreservesUnknownTa...
Sets the async policy to flush everything in one chunk, and to not display unknown tags.
public void add(Handler handler){ _logHandlerConfig.add(handler); }
Adds a handler
@Override public boolean provides(Class<?> type){ if (getDisabled()) { return false; } if (type.equals(jmri.ProgrammerManager.class)) { return true; } if (type.equals(jmri.GlobalProgrammerManager.class)) { return getProgrammerManager().isGlobalProgrammerAvailable(); } if (type.equals(jmri.Addr...
Tells which managers this provides by class
public void startUpdate(String targetId) throws IOException { startChangesIfNecessary(); inUpdate=true; ResponseWriter writer=getWrapped(); writer.startElement("update",null); writer.writeAttribute("id",targetId,null); writer.startCDATA(); }
<p class="changed_added_2_0">Write the start of an update operation.</p>
public final void add(Matrix4f m1,Matrix4f m2){ this.m00=m1.m00 + m2.m00; this.m01=m1.m01 + m2.m01; this.m02=m1.m02 + m2.m02; this.m03=m1.m03 + m2.m03; this.m10=m1.m10 + m2.m10; this.m11=m1.m11 + m2.m11; this.m12=m1.m12 + m2.m12; this.m13=m1.m13 + m2.m13; this.m20=m1.m20 + m2.m20; this.m21=m1.m21 + ...
Sets the value of this matrix to the matrix sum of matrices m1 and m2.
private XSDatatype deriveSimpleType(XSDatatype baseType,Element xsdRestriction){ TypeIncubator incubator=new TypeIncubator(baseType); ValidationContext context=null; try { for (Iterator<Element> iter=xsdRestriction.elementIterator(); iter.hasNext(); ) { Element element=iter.next(); String name=ele...
Derives a new type from a base type and a set of restrictions
private ReplaceTokens createWarDirToken(){ ReplaceTokens.Token tokenWarDir=new ReplaceTokens.Token(); tokenWarDir.setKey(TOKEN_KEY_WAR_DIR); tokenWarDir.setValue(new File(getHome(),"webapp/host").toString()); ReplaceTokens replaceWarDir=new ReplaceTokens(); replaceWarDir.addConfiguredToken(tokenWarDir); ret...
Creates tokens for the hotdeployment war dir.
public static Paint newGuidelinePaint(){ final Paint paint=new Paint(); paint.setColor(Color.parseColor(SEMI_TRANSPARENT)); paint.setStrokeWidth(DEFAULT_GUIDELINE_THICKNESS_PX); return paint; }
Creates the Paint object for drawing the crop window guidelines.
public boolean visit(ThrowStatement node){ return true; }
Visits the given type-specific AST node. <p> The default implementation does nothing and return true. Subclasses may reimplement. </p>
protected void loadValue(String sValue){ sValue=sValue.trim(); try { int r=Integer.parseInt(sValue.substring(1,3),16); int g=Integer.parseInt(sValue.substring(3,5),16); int b=Integer.parseInt(sValue.substring(5,7),16); value=new Color(r,g,b); } catch ( NumberFormatException nfe) { revertToDe...
Returns the value of this setting.
private Set<KnowledgeEdge> generateForbiddenEdgeList(){ Set<KnowledgeEdge> forbiddenEdges=new HashSet<>(); List<String> vars=new ArrayList<>(tierMap.keySet()); for (int i=0; i < vars.size(); i++) { for (int j=0; j < vars.size(); j++) { if (i == j) { continue; } String var1=vars.get(i...
Method generateForbiddenEdgeList
private void generateAlwaysBlock(Fingerprint.Payload payload,ConditionalBlock block,Fingerprint.Payload.Always always){ LinearBlock linearBlock=null; for ( Return return_ : always.getReturn()) { DetailBlockTemplate template=new DetailBlockTemplate().setFingerprintName(payload.getFor()).setReturn(return_); ...
Generate the "Always" blocks which have slightly different conditional needs then typical Fingerprint Operations.
private String numberToMd5(String number,MD5 md5){ String hash=""; if (!TextUtils.isEmpty(number)) { try { md5.Init(); md5.Update(number,HTTP.ISO_8859_1); hash=md5.asHex(); } catch ( UnsupportedEncodingException e) { hash=""; } } return hash; }
Method that converts a phone number to an MD5 Hash
private boolean isSubscribed(){ final SharedPreferences settings=getSharedPreferencesForCurrentUser(); return settings.getBoolean(HAS_SUBSCRIPTION,false); }
Helper method to check if the customer is subscribed.
@SafeVarargs public static <T>OutputMatcher<T> allOf(OutputMatcher<T>... matchers){ return OutputMatcherFactory.create(AllOf.allOf(matchers)); }
Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
public CategoricalDistribution fixedLagSmoothing(List<AssignmentProposition> et){ Matrix O_tmd, O_t; e_tmd_to_t.add(hmm.getEvidence(et)); O_t=e_tmd_to_t.get(e_tmd_to_t.size() - 1); if (t > d) { e_tmd_to_t.remove(0); O_tmd=e_tmd_to_t.get(0); f=forward(f,O_tmd); B=O_tmd.inverse().times(hmm.getTran...
Algorithm for smoothing with a fixed time lag of d steps, implemented as an online algorithm that outputs the new smoothed estimate given the observation for a new time step.
public void actionPerformed(ActionEvent e){ int pos=viewToModel(new Point(popup.x,popup.y)); popup.setVisible(false); String cmd=e.getActionCommand(); int line=-1; try { line=getLineOfOffset(pos); } catch ( Exception exc) { } if (cmd.equals("Set Breakpoint")) { w.setBreakPoint(line + 1); } ...
Performs an action.
public GetSnapshotsRequest(String repository){ this.repository=repository; }
Constructs a new get snapshots request with given repository name
public ConcurrentWeakValueCache(final int queueCapacity,final float loadFactor,final int concurrencyLevel){ this(queueCapacity,loadFactor,concurrencyLevel,true); }
Uses the specified values.
public static int decode(String data,OutputStream out) throws IOException { return encoder.decode(data,out); }
decode the Hex encoded String data writing it to the given output stream, whitespace characters will be ignored.
public void yypushback(int number){ if (number > yylength()) zzScanError(ZZ_PUSHBACK_2BIG); zzMarkedPos-=number; }
Pushes the specified amount of characters back into the input stream. They will be read again by then next call of the scanning method
public T caseVoidType(VoidType object){ return null; }
Returns the result of interpreting the object as an instance of '<em>Void Type</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
@Override public String toString(){ if (eIsProxy()) return super.toString(); StringBuffer result=new StringBuffer(super.toString()); result.append(" (autounique_1: "); result.append(autounique_1); result.append(", name_1: "); result.append(name_1); result.append(')'); return result.toString(); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public static void println(int priority,String tag,String msg){ println(priority,tag,msg,null); }
Instructs the LogNode to print the log data provided. Other LogNodes can be chained to the end of the LogNode as desired.
public Timer plus(Timer other){ Timer copy=new Timer(); copy.elapsedTime=millis() + other.millis(); return copy; }
<tt>T = this + other</tt>; Constructs and returns a new timer which is the sum of the receiver and the other timer. The new timer is not started.
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){ switch (featureID) { case UmplePackage.ASSOCIATION_CLASS_DEFINITION___NAME_1: return getName_1(); case UmplePackage.ASSOCIATION_CLASS_DEFINITION___ASSOCIATION_CLASS_CONTENT_1: return getAssociationClassContent_1(); } return super.eGet(f...
<!-- begin-user-doc --> <!-- end-user-doc -->
public static Text createSingleText(Composite parent,int hspan){ Text t=new Text(parent,SWT.SINGLE | SWT.BORDER); t.setFont(parent.getFont()); GridData gd=new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan=hspan; t.setLayoutData(gd); return t; }
Creates a new text widget
public void testNextIntBounded(){ for (int bound=2; bound < MAX_INT_BOUND; bound+=524959) { int f=ThreadLocalRandom.current().nextInt(bound); assertTrue(0 <= f && f < bound); int i=0; int j; while (i < NCALLS && (j=ThreadLocalRandom.current().nextInt(bound)) == f) { assertTrue(0 <= j && j < ...
nextInt(bound) returns 0 <= value < bound; repeated calls produce at least two distinct results
public double mutualInformation(int child,int[] parents,int lag){ double M=0.0; int[] c=new int[ntimes - lag]; for (int i=lag; i < ntimes; i++) { c[i - lag]=cases[i][child]; } double hchild=entropy(c); int[] p1=new int[ntimes - lag]; int[][] pm=new int[parents.length][ntimes - lag]; double hparents=...
This method computes the mutual information between a gene and a set of presumptive causes (other genes). There must be at least one cause but there may be only one. The third argument is the time lag between the cause(s) and the effect. See Fig. 5 in the Liang et al. paper.
public void testMixupMultiValued() throws Exception { Directory dir=newDirectory(); RandomIndexWriter writer=new RandomIndexWriter(random(),dir); Document doc=new Document(); Field field=new TextField("field","",Field.Store.NO); TokenStream ts=new MockTokenizer(MockTokenizer.WHITESPACE,true); ((Tokenizer)ts...
some field instances have payload att, some not
public Instantiation findOwner(final int i){ if (!subroutine.get(i)) { return null; } if (!dualCitizens.get(i)) { return this; } Instantiation own=this; for (Instantiation p=previous; p != null; p=p.previous) { if (p.subroutine.get(i)) { own=p; } } return own; }
Returns the "owner" of a particular instruction relative to this instantiation: the owner referes to the Instantiation which will emit the version of this instruction that we will execute. Typically, the return value is either <code>this</code> or <code>null</code>. <code>this</code> indicates that this instantiation w...
public static void shareEpisode(Context context,Episode episode){ if (TextUtils.isEmpty(episode.getArtworkUrl())) { shareEpisode(context,episode,null); } else { ImageLoadHelper.saveImage(context,episode.getArtworkUrl(),null); } }
Shares an episode to the Android app of choice
@Override public synchronized void connect(Object device,boolean secure){ log.debug("connect to: " + device); if (mState == STATE.CONNECTING) { if (mBtConnectThread != null) { mBtConnectThread.cancel(); mBtConnectThread=null; } } if (mBtWorkerThread != null) { mBtWorkerThread.cancel(); ...
start connection to specified device
public void checkCallbacks(){ if (log.isTraceEnabled()) { log.trace("checkCallbacks current thread is '" + currentThread.name + "' doCallbacks:"+ currentThread.doCallbacks+ " caller:"+ getCallingFunction()); } boolean handled; SceKernelThreadInfo checkCurrentThread=currentThread; do { handled=false; ...
Iterates waiting threads, making sure doCallbacks is set before checking for pending callbacks. Handles sceKernelCheckCallback when doCallbacks is set on currentThread. Handles redirects to yieldCB (from fake waitCB) on the thread that called waitCB. We currently call checkCallbacks() at the end of each waitCB function...
public ExternalDataSystem(ExternalDataSystem other){ }
Performs a deep copy on <i>other</i>.
public synchronized boolean isKnownPeer(Peer peer){ for ( Peer peerInList : mCurrentPeers) { if (peer.equals(peerInList)) { return true; } } return false; }
Check whether a peer is already in the peer list. Peer equality is based on whether their PeerNetworks refer to the same destinations, so two peers might be .equals() even if not ==.
public void drawPalette(int[] colors,int selectedColor,String[] colorContentDescriptions){ if (colors == null) { return; } this.removeAllViews(); int tableElements=0; int rowElements=0; int rowNumber=0; TableRow row=createTableRow(); for ( int color : colors) { View colorSwatch=createColorSwatc...
Adds swatches to table in a serpentine format.
public static void addField(WebSessionCtx wsc,tr line,GridField field,Object oData,boolean hasDependents,int recordID,int tableID,boolean tabRO,int fieldNumber,GridTab mTab,MRole role){ String columnName=field.getColumnName(); boolean error=field.isErrorValue(); if (error) oData=field.getErrorValue(); int dt=...
Add Field to Line
private void writeChallenge(Challenge challenge,List<Answer> answerList){ long oldChallengeId=challenge.getId(); challenge.setId(null); long challengeId=mChallengeDataSource.create(challenge); for ( Answer answer : answerList) { if (answer.getChallengeId() == oldChallengeId) { answer.setChallengeId(c...
Writes a challenge with their answers to the database
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:02:39.294 -0500",hash_original_method="911AB9C595BBE3DEF39975B1C146C2FC",hash_generated_method="070660DD5CE59C01FA4AEB53FF32B37A") @Deprecated public static int forkAndSpecialize(int uid,int gid,int[] gids,boolean enableDebugger,int[][...
Forks a new VM instance.
public void print(int inum){ print(String.valueOf(inum)); }
Prints the string representation of the specified integer to the target.
public SignatureVisitor visitReturnType(){ return this; }
Visits the return type of the method.
protected double decisionFunction(int v){ double sum=0; for (int i=0; i < vecs.size(); i++) if (alphas[i] > 0) sum+=alphas[i] * label[i] * kEval(v,i); return sum; }
Returns the local decision function for classification training purposes without the bias term
public CInsertOrOperatorAction(final CCriteriumTree tree,final CCriteriumTreeNode parent){ super("Insert OR"); m_tree=tree; m_parent=parent; }
Creates a new action object.