code
stringlengths
10
174k
nl
stringlengths
3
129k
public static boolean isSameType(final Object array1,final Object array2){ if (array1 == null || array2 == null) { throw new IllegalArgumentException("The Array must not be null"); } return array1.getClass().getName().equals(array2.getClass().getName()); }
<p>Checks whether two arrays are the same type taking into account multi-dimensional arrays.</p>
static int hiBitPos(long num){ return 63 - Long.numberOfLeadingZeros(num); }
Zero based position of the highest one-bit of the given long. Returns minus one if num is zero.
public void testAddSecurityConstraint() throws Exception { String xml=WEBAPP_TEST_HEADER + "</web-app>"; WebXml webXml=WebXmlIo.parseWebXml(new ByteArrayInputStream(xml.getBytes("UTF-8")),getEntityResolver()); WebXmlUtils.addSecurityConstraint(webXml,"wrn","/url",Collections.EMPTY_LIST); assertTrue(WebXmlUtils....
Tests whether a security-constraint with no roles is successfully added to an empty descriptor.
public MultiplexManager(DataStore... dataStores){ this.dataStores=Arrays.asList(dataStores); }
Create a single DataStore to handle provided managers within a single transaction.
public DocumentValueSourceDictionary(IndexReader reader,String field,ValueSource weightsValueSource,String payload){ super(reader,field,null,payload); this.weightsValueSource=weightsValueSource; }
Creates a new dictionary with the contents of the fields named <code>field</code> for the terms, <code>payloadField</code> for the corresponding payloads and uses the <code>weightsValueSource</code> supplied to determine the score.
private SaveAction(){ super("Save"); }
Creates a new action object.
public static Asset createAssetFromBitmap(Bitmap bitmap){ if (bitmap != null) { final ByteArrayOutputStream byteStream=new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG,100,byteStream); return Asset.createFromBytes(byteStream.toByteArray()); } return null; }
Create a wearable asset from a bitmap.
public void removeListener(INotifyChangedListener notifyChangedListener){ changeNotifier.removeListener(notifyChangedListener); }
This removes a listener. <!-- begin-user-doc --> <!-- end-user-doc -->
public boolean forceNewTranslog(){ return forceNewTranslog; }
if true the engine will start even if the translog id in the commit point can not be found
public static void dropAllTables(SQLiteDatabase db,boolean ifExists){ IpInfoDao.dropTable(db,ifExists); PlaceDao.dropTable(db,ifExists); }
Drops underlying database table using DAOs.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:57.975 -0400",hash_original_method="DEF389DDBAFE974EA51118829F85145D",hash_generated_method="AEA5D6CD76934A39A91E97F49B3ACAD2") public FileAlterationObserver(File directory){ this(directory,(FileFilter)null); }
Construct an observer for the specified directory.
public EchoRequestMessage(EchoRequestMessage other){ if (other.isSetHeader()) { this.header=new AsyncMessageHeader(other.header); } }
Performs a deep copy on <i>other</i>.
public boolean validUtf8B(int[] data){ int i=0; while (i < data.length) { int b=getBytes(data[i]); if (b == 0) { return false; } for (int j=i + 1; j < i + b; j++) { if (j >= data.length || 128 > data[j] || 192 < data[j]) { return false; } } i+=b; } return true; ...
Math. Check how many bytes with number range. 1) 1 byte, [0, 127] 2) 2 bytes, [192, 223] 3) 3, [224, 239] 4) 4, [240, 247] 5) If out of these ranges, return false. Check following numbers, with range [128, 191].
public static String toString(JSONArray ja) throws JSONException { JSONObject jo=ja.optJSONObject(0); if (jo != null) { JSONArray names=jo.names(); if (names != null) { return rowToString(names) + toString(names,ja); } } return null; }
Produce a comma delimited text from a JSONArray of JSONObjects. The first row will be a list of names obtained by inspecting the first JSONObject.
@SuppressWarnings("WeakerAccess") public SwingTerminal(TerminalScrollController scrollController){ this(TerminalEmulatorDeviceConfiguration.getDefault(),SwingTerminalFontConfiguration.getDefault(),TerminalEmulatorColorConfiguration.getDefault(),scrollController); }
Creates a new SwingTerminal with a particular scrolling controller that will be notified when the terminals history size grows and will be called when this class needs to figure out the current scrolling position.
public static String buildSelectorFromClass(String classValue){ StringBuilder strb=new StringBuilder(); strb.append(CLASS_SELECTOR_PREFIX); strb.append(classValue); return strb.toString(); }
Create a selector of the form .$classValue
public static <A>float[] toPrimitiveFloatArray(A array,NumberArrayAdapter<?,? super A> adapter){ if (adapter == FLOATARRAYADAPTER) { return ((float[])array).clone(); } float[] ret=new float[adapter.size(array)]; for (int i=0; i < ret.length; i++) { ret[i]=adapter.getFloat(array,i); } return ret; }
Convert a numeric array-like to a <code>float[]</code>.
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.
public void addDstore(int n){ if (n < 4) addOpcode(71 + n); else if (n < 0x100) { addOpcode(DSTORE); add(n); } else { addOpcode(WIDE); addOpcode(DSTORE); addIndex(n); } }
Appends DSTORE or (WIDE) DSTORE_&lt;n&gt;
@SuppressWarnings("unchecked") public static AbstractMetric<IString,String> newMetric(String evalMetric,List<List<Sequence<IString>>> references){ AbstractMetric<IString,String> emetric=null; if (evalMetric.equals("smoothbleu")) { emetric=new BLEUMetric<>(references,true); } else if (evalMetric.equals("ble...
Return an instance of a corpus-level evaluation metric.
public static double[] pairwiseCoupling(double[][] n,double[][] r){ double[] p=new double[r.length]; for (int i=0; i < p.length; i++) { p[i]=1.0 / (double)p.length; } double[][] u=new double[r.length][r.length]; for (int i=0; i < r.length; i++) { for (int j=i + 1; j < r.length; j++) { u[i][j]=0....
Implements pairwise coupling.
public XBoolean(boolean b){ super(); m_val=b; }
Construct a XBoolean object.
public void close() throws IOException { TCPTransport.tcpLog.log(Log.BRIEF,"close connection"); if (socket != null) socket.close(); else { in.close(); out.close(); } }
Close the connection.
public static boolean isHeader(Header hdr){ boolean found=hdr.getBooleanValue(SIMPLE); if (!found) { String xtension=hdr.getStringValue(XTENSION); xtension=xtension == null ? "" : xtension.trim(); if (XTENSION_IMAGE.equals(xtension) || "IUEIMAGE".equals(xtension)) { found=true; } } if (!fo...
Check that this HDU has a valid header for this type.
public void close(){ sendMessage(new CloseWebsocketMessage()); }
Asynchronously closes the Websocket session. This will wait until all remaining messages have been sent to the Client and then close the Websocket session.
protected void paint(SeaGlassContext context,Graphics g){ JSeparator separator=(JSeparator)context.getComponent(); context.getPainter().paintSeparatorForeground(context,g,0,0,separator.getWidth(),separator.getHeight(),separator.getOrientation()); }
DOCUMENT ME!
public static boolean isValidIfd(int ifdId){ return ifdId == IfdId.TYPE_IFD_0 || ifdId == IfdId.TYPE_IFD_1 || ifdId == IfdId.TYPE_IFD_EXIF || ifdId == IfdId.TYPE_IFD_INTEROPERABILITY || ifdId == IfdId.TYPE_IFD_GPS; }
Returns true if the given IFD is a valid IFD.
public static <T>LazySetX<T> fromIterable(Collector<T,?,Set<T>> collector,Iterable<T> it){ if (it instanceof LazySetX) return (LazySetX<T>)it; if (it instanceof Set) return new LazySetX<T>((Set<T>)it,collector); return new LazySetX<T>(Flux.fromIterable(it),collector); }
Construct a LazySetX from an Iterable, using the specified Collector.
public void onMouseReleased(MapMouseEvent ev){ }
Respond to a mouse button release event received from the map pane
public void follow(int followerId,int followeeId){ if (followMap.get(followerId) == null) { Map<Integer,Integer> map=new HashMap<Integer,Integer>(); map.put(followerId,1); followMap.put(followerId,map); } followMap.get(followerId).put(followeeId,1); }
Follower follows a followee. If the operation is invalid, it should be a no-op.
public final void mulTransposeLeft(Matrix3d m1,Matrix3d m2){ if (this != m1 && this != m2) { this.m00=m1.m00 * m2.m00 + m1.m10 * m2.m10 + m1.m20 * m2.m20; this.m01=m1.m00 * m2.m01 + m1.m10 * m2.m11 + m1.m20 * m2.m21; this.m02=m1.m00 * m2.m02 + m1.m10 * m2.m12 + m1.m20 * m2.m22; this.m10=m1.m01 * m2.m0...
Multiplies the transpose of matrix m1 times matrix m2, and places the result into this.
private void restoreFloatingPointState(Instruction inst){ if (SSE2_FULL) { GenericPhysicalRegisterSet phys=ir.regpool.getPhysicalRegisterSet(); for (int i=0; i < 8; i++) { inst.insertBefore(MIR_Move.create(IA32_MOVQ,new RegisterOperand(phys.getFPR(i),TypeReference.Double),new StackLocationOperand(true,-...
Insert code into the epilogue to restore the floating point state.
public static EncodingException createEncodingException(final ErrorKeys errorId,final String message){ return new EncodingException(errorId.toString() + ":\r\n" + message); }
Creates an EncodingException object.
public void clear(){ objectVectors.clear(); }
Clear the vector cache.
@Override public boolean supportsIncrementalUpdate(){ return !m_IncrementalDisabled; }
Returns whether the handler supports incremental write.
public String globalInfo(){ return "This is ARAM."; }
Returns a string describing this classifier
public Integer loadVolumesByRepValues(DbOutputStatement statement,Integer idx) throws Exception { int index=idx.intValue(); if (_logger.isDebugEnabled()) _logger.debug("loadVolumesByRepValues"); _id=statement.getLongInteger(index++); _name=statement.getShortText(index++); _info=FssMdoUtil.decodeVolInfo(stat...
Recupera el identificador del volumen.
public void endElement(String uri,String localName,String qName) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endElement: " + qName); if (m_contentHandler != null) { m_contentHandler.endElement(uri,localName,qName); } }
Filter an end element event.
public void showAndDismiss(Duration dismissDelay){ if (!isTrayShowing()) { stage.show(); onShown(); animation.playSequential(dismissDelay); } else dismiss(); onDismissed(); }
Shows and dismisses the tray notification
public static void createTable(SQLiteDatabase db,boolean ifNotExists){ String constraint=ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "'BabyModel' ("+ "'_id' INTEGER PRIMARY KEY ,"+ "'PACKAGE_NAME' TEXT);"); }
Creates the underlying database table.
protected String stripHtmlTags(String input){ if (input == null) return null; StringBuilder output=new StringBuilder(); boolean inTag=false; boolean inWhitespace=false; for (int i=0; i < input.length(); i++) { char c=input.charAt(i); if (Character.isWhitespace(c)) { inWhitespace=true; co...
Remove HTML tags and extra whitespace from a string. Runs of whitespace will be collapsed to a single space.
@Override public void run(){ amIActive=true; String inputHeader=null; String outputHeader=null; int row, col, x, y; double z; float progress=0; int a; int filterSizeX=3; int filterSizeY=3; double n; double sum; double sumOfTheSquares; double average; double stdDev; int dX[]; int dY[]; ...
Used to execute this plugin tool.
@Override public void update(){ StendhalRPZone zone; zone=getZone(); if (zone != null) { zone.removeMovementListener(this); } super.update(); if (zone != null) { zone.addMovementListener(this); } }
Handle object attribute change(s).
private FileCopyUtils(){ }
Prevent instantiation.
public AccountHeaderBuilder withCurrentProfileHiddenInList(boolean currentProfileHiddenInList){ mCurrentHiddenInList=currentProfileHiddenInList; return this; }
hide the current selected profile from the list
public static double area2(Point2D a,Point2D b,Point2D c){ return (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x); }
Returns twice the signed area of the triangle a-b-c.
public void recoverRepoInANewNode() throws BucketNotFoundException, IOException { LuceneServiceImpl service=(LuceneServiceImpl)LuceneServiceProvider.get(cache); service.createIndex("index1","/userRegion",indexedFields); PartitionAttributes<String,String> attrs=new PartitionAttributesFactory().setTotalNumBuckets(1...
On rebalance, new repository manager will be created. It will try to read fileRegion and construct index. This test simulates the same.
public Level nextLevel(){ return this.parent.level(this.levelNumber + 1); }
Returns the level whose ordinal occurs immediately after this level's ordinal in the parent level set, or null if this is the last level.
protected Label readLabel(int offset,Label[] labels){ if (labels[offset] == null) { labels[offset]=new Label(); } return labels[offset]; }
Returns the label corresponding to the given offset. The default implementation of this method creates a label for the given offset if it has not been already created.
public RDN(ASN1ObjectIdentifier oid,ASN1Encodable value){ ASN1EncodableVector v=new ASN1EncodableVector(); v.add(oid); v.add(value); this.values=new DERSet(new DERSequence(v)); }
Create a single valued RDN.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:48.711 -0400",hash_original_method="9372A1D570FF0E071E2A73F0471280C8",hash_generated_method="73E7D5E07B73B540EF5D01C579CF6548") public int difference(String s1,String s2) throws EncoderException { return SoundexUtils.difference(th...
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.
public static void serializeMeterReply(List<OFMeterStatsReply> meterReplies,JsonGenerator jGen) throws IOException, JsonProcessingException { OFMeterStatsReply meterReply=meterReplies.get(0); jGen.writeStringField("version",meterReply.getVersion().toString()); jGen.writeFieldName("meter"); jGen.writeStartArray(...
Serializes the Meter Statistics Reply
public void BareMainViewsExists() throws NoMatchingViewException { dumpUi(R.id.btnEffect,R.id.tabBrightness,R.id.tabGrid,R.id.tabSetting,R.id.tabSuffle,R.id.tabTime,R.id.btn1,R.id.btn2,R.id.btn3,R.id.btn4,R.id.btn5,R.id.seekBar,R.id.seekBar2,R.id.seekBar3); TestHelper.checkUiDoNotExist(listUi); }
Checking main UI buttons without dismissing alert dialog box
public boolean isSameLine(){ return m_vo.IsSameLine; }
Is SameLine
private JarClassLoader deployWithoutRegistering(final String jarName,final byte[] jarBytes) throws IOException { JarClassLoader oldJarClassLoader=findJarClassLoader(jarName); final boolean isDebugEnabled=logger.isDebugEnabled(); if (isDebugEnabled) { logger.debug("Deploying {}: {}",jarName,(oldJarClassLoader ...
Deploy the given JAR file without registering functions.
public int remainingCapacity(){ return maxSize - size(); }
Returns the number of additional elements that this queue can accept without evicting; zero if the queue is currently full.
public HostInfo addHost(HostInfo hostInfo){ return addHost(hostInfo.getName(),hostInfo.getAddress(),hostInfo.getProtocol(),hostInfo.getHttpPort(),hostInfo.getTcpPort(),hostInfo.getUsername(),hostInfo.getPassword(),hostInfo.getMacAddress(),hostInfo.getWolPort(),hostInfo.getUseEventServer(),hostInfo.getEventServerPort(...
Adds a new XBMC host to the database
public Writer write(Writer writer) throws JSONException { return this.write(writer,0,0); }
Write the contents of the JSONArray as JSON text to a writer. For compactness, no whitespace is added. <p> Warning: This method assumes that the data structure is acyclical.
@Override public void addMessageWithSound(final String message,final String from,final boolean thirdperson,final String sound){ final Thread t=new Thread(null); t.start(); }
thread safe
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:27.803 -0500",hash_original_method="F5CABA8208B35CC620F77C4ED2D48018",hash_generated_method="7366ED5FE46D69DF533B9A2E6EA78195") @Override public String toString(){ String...
Returns the current String representation.
public StdoutLog(){ }
Creates the StdoutLog
protected void fillSideTexCoordBuffer(Vec4[] topVerts,Vec4[] bottomVerts,FloatBuffer tBuf){ int faceCount=topVerts.length - 1; double lengths[]=new double[faceCount + 1]; for (int i=0; i < faceCount; i++) { lengths[i]=bottomVerts[i].distanceTo3(topVerts[i]); } lengths[faceCount]=lengths[0]; int b=0; f...
Computes the texture coordinates for a boundary of this shape.
public IOUtils(){ super(); }
Instances should NOT be constructed in standard programming.
public static boolean isNumber(Type type){ if (type == null) { return false; } switch (type.getKind()) { case BYTE: case SHORT: case INT: case LONG: case DOUBLE: case FLOAT: return true; default : return false; } }
Returns true is the type is a number.
public void toXML(final StringBuilder builder,final ConfigVerification errors){ map.get(PanelKeys.PANEL_VALUES).toXML(builder,errors); map.get(PanelKeys.PANEL_EXTERNALS).toXML(builder,errors); map.get(PanelKeys.PANEL_INPUT).toXML(builder,errors); map.get(PanelKeys.PANEL_OUTPUT).toXML(builder,errors); map.get(...
Adds the xml description of the panels content to the StringBuilder. Errors which occur during the xml transformation will be added to the ConfigVerification.
public boolean isRowVector(){ return rows == 1; }
Checks whether the matrix is a row vector.
public SoftwarePattern_ createSoftwarePattern_(){ SoftwarePattern_Impl softwarePattern_=new SoftwarePattern_Impl(); return softwarePattern_; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void testBug44451() throws Exception { String methodName; List<String> expectedFields; String[] testStepDescription=new String[]{"MySQL MetaData","I__S MetaData"}; Connection connUseIS=getConnectionWithProps("useInformationSchema=true"); Connection[] testConnections=new Connection[]{conn,connUseIS}; ...
Tests fix for BUG#44451 - getTables does not return resultset with expected columns.
public static UUIDPersistentHandle makeHandle(final byte[] value,final int offset){ return new UUIDPersistentHandle(value,offset); }
<p>Construct from an existing UUID.</p>
protected FixedWithNextNode finishInstruction(FixedWithNextNode instr,FrameStateBuilder state){ return instr; }
Hook for subclasses to modify the last instruction or add other instructions.
private void connectionEvent(Intent intent) throws PayloadException, CertificateException, NetworkException, ContactManagerException { try { if (mDisconnectedByBattery) { return; } if (!ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) { return; } boolean connectivity...
Connection event
public SubscriptionStateExceptionBean(ApplicationExceptionBean sup,Reason reason,String member){ super(sup); setReason(reason); setMember(member); }
Instantiates a <code>SubscriptionStateExceptionBean</code> based on the specified <code>ApplicationExceptionBean</code> and sets the given reason and member field name.
public void init(ServletConfig config) throws ServletException { super.init(config); if (!WebEnv.initWeb(config)) throw new ServletException("RequestServlet.init"); }
Initialize global variables
public ConfigurePortsScriptCommand(Configuration configuration,String resourcePath){ super(configuration,resourcePath); }
Sets configuration containing all needed information for building configuration scripts.
public AnimatableNumberOrPercentageValue(AnimationTarget target,float n){ super(target,n); }
Creates a new AnimatableNumberOrPercentageValue with a number.
public static boolean isSelfShortcutStatement(PsiPerlStatement statement){ if (statement == null) { return false; } PsiElement derefExpr=statement.getFirstChild(); if (derefExpr == null) { return false; } if (derefExpr instanceof PsiPerlReturnExprImpl) { derefExpr=derefExpr.getLastChild(); } ...
Checks if statement is shift/$_[0] deref shortcut
private void printScreen(){ PrintScreenPainter.printScreen(this); }
Print Screen
public void flushDiskCacheAsync(){ if (DEBUG) { Log.d(TAG,"flushDishCacheAsync"); } new FileCacheTask(FileCacheTaskType.flush_cache).execute(); }
flush the data to disk cache
public static Account readFrom(final Deserializer deserializer,final String label){ return readFrom(deserializer,label,AddressEncoding.COMPRESSED); }
Reads an account object.
public void clearLog(){ if (getLogSelectionModel().getCurrentLogModel() == null) { return; } getLogSelectionModel().getCurrentLogModel().clearLog(); if (getLogSelectionModel().getCurrentLogModel().getLogMode() == LogMode.PULL) { clearLogArea(); } }
Clears the currently selected log model and thus the displayed log.
public void addExtractor(ExtractorItem extractorItem,Cluster[] codebook){ if ((!(codebook.length > 0)) || (codebook == null)) throw new UnsupportedOperationException("Codebook cannot be empty or null!!"); LinkedList<Cluster[]> listOfCodebooks=new LinkedList<Cluster[]>(); listOfCodebooks.add(codebook); addExtr...
Can be used to add local extractors.
public final boolean isForwarded(){ return flags[FORWARDED_TICKET_FLAG]; }
Determines if this ticket had been forwarded or was issued based on authentication involving a forwarded ticket-granting ticket.
private NSDictionary parseDictionary() throws ParseException { skip(); skipWhitespacesAndComments(); NSDictionary dict=new NSDictionary(); while (!accept(DICTIONARY_END_TOKEN)) { String keyString; if (accept(QUOTEDSTRING_BEGIN_TOKEN)) { keyString=parseQuotedString(); } else { keyString=...
Parses a dictionary from the current parsing position. The prerequisite for calling this method is, that a dictionary begin token has been read.
public void addImagePath(String path){ this.mImageList.add(path); }
Add new image path
public double distanceSq(final double x,final double y,final double z){ final double dx=(double)this.x - x; final double dy=(double)this.y - y; final double dz=(double)this.z - z; return (dx * dx + dy * dy + dz * dz); }
Returns the squared distance FROM this Int3D TO the specified point
private CommandLine parseLine(CommandLineParser parser,Options options,String[] args) throws AdeUsageException { CommandLine line; try { line=parser.parse(options,args); } catch ( ParseException exp) { System.err.println("Parsing failed. Reason: " + exp.getMessage()); throw new AdeUsageException("Ar...
Used for parsing and validating the options.
public void sort(int a[],int lo0,int hi0) throws Exception { int lo=lo0; int hi=hi0; if (lo >= hi) { return; } else if (lo == hi - 1) { if (a[lo] > a[hi]) { int T=a[lo]; a[lo]=a[hi]; a[hi]=T; } return; } int pivot=a[(lo + hi) / 2]; a[(lo + hi) / 2]=a[hi]; a[hi]=pivot...
Sort an array using a quicksort algorithm.
public ASN1Primitive toASN1Primitive(){ ASN1EncodableVector v=new ASN1EncodableVector(); v.add(version); if (keyDerivationAlgorithm != null) { v.add(new DERTaggedObject(false,0,keyDerivationAlgorithm)); } v.add(keyEncryptionAlgorithm); v.add(encryptedKey); return new DERSequence(v); }
Produce an object suitable for an ASN1OutputStream.
@Ignore public void testNastyPattern() throws Exception { Pattern p=Pattern.compile("(c.+)*xy"); String input="[;<!--aecbbaa-->< febcfdc fbb = \"fbeeebff\" fc = dd >\\';<eefceceaa e= babae\" eacbaff =\"fcfaccacd\" = bcced>>>< bccaafe edb = ecfccdff\" <?</script>< edbd ebbcd=\"faacfcc\" aeca= bedbc ceeaac...
A demonstration of how backtracking regular expressions can lead to relatively easy DoS attacks.
public static void main(String[] args){ String queueName=null; Context jndiContext=null; QueueConnectionFactory queueConnectionFactory=null; QueueConnection queueConnection=null; QueueSession queueSession=null; Queue queue=null; QueueReceiver queueReceiver=null; TextMessage message=null; if (args.leng...
Main method.
static public void main(String[] args){ BayesNetGenerator b=new BayesNetGenerator(); try { if ((args.length == 0) || (Utils.getFlag('h',args))) { printOptions(b); return; } b.setOptions(args); b.generateRandomNetwork(); if (!b.m_bGenerateNet) { b.generateInstances(); } ...
Main method
private void reMap() throws IOException { int oldPos=0; if (mapped != null) { oldPos=pos; unMap(); } fileLength=file.length(); checkFileSizeLimit(fileLength); mapped=file.getChannel().map(mode,0,fileLength); int limit=mapped.limit(); int capacity=mapped.capacity(); if (limit < fileLength || ca...
Re-map byte buffer into memory, called when file size has changed or file was created.
void doConstrainedOutsideScores(Grammar grammar,boolean viterbi,boolean logScores){ short[] numSubStatesArray=grammar.numSubStates; double initVal=(logScores) ? Double.NEGATIVE_INFINITY : 0.0; for (int diff=length; diff >= 1; diff--) { for (int start=0; start + diff <= length; start++) { int end=start +...
Fills in the oScore array of each category over each span of length 2 or more. This version computes the posterior outside scores, not the Viterbi outside scores.
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.
@Override public boolean eIsSet(int featureID){ switch (featureID) { case DomPackage.COMPOSITE__CONTENTS: return contents != null && !contents.isEmpty(); } return super.eIsSet(featureID); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public GoogleLoginCopyAndPasteDialog(JComponent parent,GoogleAuthorizationCodeRequestUrl requestUrl,String message){ super(parent,true); urlString=requestUrl.build(); if (message != null) { setTitle(message); } else { setTitle(TITLE); } init(); }
Initialize the verification code dialog.
private void establishFinalConfirmationState(){ mFinalButton=(Button)mContentView.findViewById(R.id.execute_master_clear); mFinalButton.setOnClickListener(mFinalClickListener); }
Configure the UI for the final confirmation interaction
public void toEPL(StringWriter writer){ writer.write(columnName); if (type != CreateIndexColumnType.HASH) { writer.write(' '); writer.write(type.toString().toLowerCase()); } }
Renders the clause in textual representation.
static void convert(IR ir,OptOptions options){ boolean didArrayStoreCheck=false; for (Instruction s=ir.firstInstructionInCodeOrder(); s != null; s=s.nextInstructionInCodeOrder()) { switch (s.getOpcode()) { case GETSTATIC_opcode: { LocationOperand loc=GetStatic.getClearLocation(s); RegisterOperand re...
Converts the given HIR to LIR.
private void onBluetoothRemoteDeviceClassChange(Context context,Intent intent){ log.debug("Remote device's class changed."); }
Called to handle events raised when the device class of another Bluetooth device we're interacting with changes.