code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public NTLMException(int errorCode,String msg){
super(msg);
this.errorCode=errorCode;
}
| Constructs an NTLMException object. |
public static Trellis orderTrellis(Trellis trel,double I[][],Random rand){
int L=I.length;
int Y[]=new int[L];
ArrayList<Integer> list=new ArrayList<Integer>();
for ( int i : trel.indices) {
list.add(new Integer(i));
}
Y[0]=list.remove(rand.nextInt(L));
for (int j=1; j < L; j++) {
double max_w=-1... | OrderTrellis - order the trellis according to marginal label dependencies. |
@Override public boolean hasName(){
log.log(Level.FINE,"hasName(): {0}",event == START_ELEMENT || event == END_ELEMENT);
return event == START_ELEMENT || event == END_ELEMENT;
}
| returns true if the current event has a name (is a START_ELEMENT or END_ELEMENT) returns false otherwise |
public boolean isListenInBackground(){
return listenInBackground;
}
| Returns whether this state is configured to allow background listening. |
private void readObject(){
}
| <!-- begin-user-doc --> Write your own initialization here <!-- end-user-doc --> |
public static boolean isLongCategory(ClassNode type){
return type == long_TYPE || isIntCategory(type);
}
| It is of a long category, if the provided type is a long, its wrapper or if it is a long category. |
public static byte[] decode(String s,int options) throws java.io.IOException {
if (s == null) {
throw new NullPointerException("Input string was null.");
}
byte[] bytes;
try {
bytes=s.getBytes(PREFERRED_ENCODING);
}
catch ( java.io.UnsupportedEncodingException uee) {
bytes=s.getBytes();
}
by... | Decodes data from Base64 notation, automatically detecting gzip-compressed data and decompressing it. |
public CViewsTableRenderer(final IViewsTable table,final IViewContainer container){
this.container=Preconditions.checkNotNull(container,"IE02032: Container argument can't be null");
this.table=Preconditions.checkNotNull(table,"IE02351: table argument can not be null");
if (starImage == null) {
try {
sta... | Creates a new renderer object. |
public void output(OutputStream out){
m_html.output(out);
}
| Output Document |
protected void sequence_ParameterizedTypeRefNominal_TypeRefWithModifiers_TypeRefWithoutModifiers(ISerializationContext context,ParameterizedTypeRef semanticObject){
genericSequencer.createSequence(context,semanticObject);
}
| Contexts: BogusTypeRef returns ParameterizedTypeRef TypeRefWithModifiers returns ParameterizedTypeRef Constraint: ( undefModifier=UndefModifierToken | (declaredType=[Type|TypeReferenceName] (typeArgs+=TypeArgument typeArgs+=TypeArgument*)? dynamic?='+'? undefModifier=UndefModifierToken?) ) |
public static ArchiveAccess createArchiveAccess(){
return new ArchiveAccessImpl();
}
| Crea la instancia para obtener el acceso al sistema de archivadores. |
public synchronized final int evictionCount(){
return evictionCount;
}
| Returns the number of values that have been evicted. |
public void testAnalyse(){
System.out.println("analyse");
AuditCommandImpl instance=null;
}
| Test of analyse method, of class AuditCommandImpl. |
public void put(final String key,final int value){
pageLookup.put(key,value);
}
| The pageLookup to set. |
public static long estimateMemory(long nrows,long ncols,double sparsity){
double cnnz=Math.max(SparseRow.initialCapacity,Math.ceil(sparsity * ncols));
double rlen=Math.min(nrows,Math.ceil(sparsity * nrows * ncols));
double size=16;
size+=rlen * (116 + cnnz * 12);
size+=32 + nrows * 8d;
return (long)Math.min... | Get the estimated in-memory size of the sparse block in MCSR with the given dimensions w/o accounting for overallocation. |
static boolean isWhiteSpace(char ch){
return ((ch == ' ') || (ch == '\n') || (ch == '\t')|| (ch == 10)|| (ch == 13));
}
| Checks if the specified character is a white space or not. Exposed to packaage since used by HTMLComponent as well |
protected double measureHermitianOverlap(ComplexVector other){
other.toCartesian();
double result=0;
double norm1=0;
double norm2=0;
for (int i=0; i < dimension * 2; ++i) {
result+=coordinates[i] * other.coordinates[i];
norm1+=coordinates[i] * coordinates[i];
norm2+=other.coordinates[i] * other.co... | Measure overlap, again using the Hermitian / Euclidean scalar product. |
protected void baselineLayout(int targetSpan,int axis,int[] offsets,int[] spans){
int totalAscent=(int)(targetSpan * getAlignment(axis));
int totalDescent=targetSpan - totalAscent;
int n=getViewCount();
for (int i=0; i < n; i++) {
View v=getView(i);
float align=v.getAlignment(axis);
float viewSpan;
... | Computes the location and extent of each child view in this <code>BoxView</code> given the <code>targetSpan</code>, which is the width (or height) of the region we have to work with. |
public void validateBusinessObjectDataStatusInformation(BusinessObjectDataKey expectedBusinessObjectDataKey,String expectedBusinessObjectDataStatus,BusinessObjectDataStatusInformation businessObjectDataStatusInformation){
assertNotNull(businessObjectDataStatusInformation);
assertEquals(expectedBusinessObjectDataKey... | Validates the contents of a business object data status information against the specified parameters. |
@Override public boolean add(E value){
final int hash;
int index;
if (value == null) {
hash=0;
index=indexOfNull();
}
else {
hash=value.hashCode();
index=indexOf(value,hash);
}
if (index >= 0) {
return false;
}
index=~index;
if (mSize >= mHashes.length) {
final int n=mSize >= ... | Adds the specified object to this set. The set is not modified if it already contains the object. |
public ArrowNeedle(boolean isArrowAtTop){
this.isArrowAtTop=isArrowAtTop;
}
| Constructs a new arrow needle. |
public void deHalfOp(UserHostmask user){
if (user == null) throw new IllegalArgumentException("Can't remove halfop on null user");
setMode("-h " + user.getNick());
}
| Removes owner privileges to a user on a channel. Successful use of this method may require the bot to have operator or halfOp status itself. <p> <b>Warning:</b> Not all IRC servers support this. Some servers may even use it to mean something else! |
@Override public String address(Class<?> api,String address){
Objects.requireNonNull(address);
if (address.isEmpty()) {
address=addressDefault(api);
}
int slash=address.indexOf("/");
if (address.endsWith(":") && slash < 0) {
address+="//";
}
int p=address.indexOf("://");
int q=-1;
if (p > 0) {... | Calculate address from an API with an address default |
private void checkOrMarkPrivateAccess(Expression source,MethodNode mn){
if (mn == null) {
return;
}
ClassNode declaringClass=mn.getDeclaringClass();
ClassNode enclosingClassNode=typeCheckingContext.getEnclosingClassNode();
if (declaringClass != enclosingClassNode || typeCheckingContext.getEnclosingClosure... | Given a method node, checks if we are calling a private method from an inner class. |
public static void zipAndEncryptAll(File inZipFile,File outFile,String password,AESEncrypter encrypter) throws IOException {
AesZipFileEncrypter enc=new AesZipFileEncrypter(outFile,encrypter);
try {
enc.addAll(inZipFile,password);
}
finally {
enc.close();
}
}
| Encrypt all files from an existing zip to one new "zipOutFile" using "password". |
void resetCache(Panel boundaryPanel,DragContext context){
ArrayList<Candidate> list=new ArrayList<Candidate>();
if (context.draggable != null) {
WidgetArea boundaryArea=new WidgetArea(boundaryPanel,null);
for ( DropController dropController : dropControllerList) {
Candidate candidate=new Candidate(... | Cache a list of eligible drop controllers, sorted by relative DOM positions of their respective drop targets. Called at the beginning of each drag operation, or whenever drop target eligibility has changed while dragging. |
public static void main(String[] args){
ArrayList<String> tmpArgs=new ArrayList<String>(Arrays.asList(args));
int numThreads=1;
for (int i=0; i < tmpArgs.size() - 1; i++) {
if (tmpArgs.get(i).equals("-t")) {
try {
numThreads=Integer.parseInt(tmpArgs.get(i + 1));
tmpArgs.remove(i + 1);
... | The main method. |
public void testKeyPairGenerator11() throws NoSuchAlgorithmException, NoSuchProviderException {
if (!DSASupported) {
fail(NotSupportMsg);
return;
}
int[] keys={-10000,-1024,-1,0,10000};
KeyPairGenerator[] kpg=createKPGen();
assertNotNull("KeyPairGenerator objects were not created",kpg);
SecureRandom... | Test for methods: <code>initialize(int keysize)</code> <code>initialize(int keysize, SecureRandom random)</code> <code>initialize(AlgorithmParameterSpec param)</code> <code>initialize(AlgorithmParameterSpec param, SecureRandom random)</code> Assertion: throws InvalidParameterException or InvalidAlgorithmParameterExcept... |
public static IMultiPoint[] randomPoints(int n,int d){
IMultiPoint points[]=new IMultiPoint[n];
for (int i=0; i < n; i++) {
StringBuilder sb=new StringBuilder();
for (int j=0; j < d; j++) {
sb.append(rGen.nextDouble());
if (j < d - 1) {
sb.append(",");
}
}
points[i]=new Hyp... | generate array of n d-dimensional points whose coordinates are values in the range 0 .. 1 |
public ObjectMatrix2D like2D(int rows,int columns){
return new SparseObjectMatrix2D(rows,columns);
}
| Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver. For example, if the receiver is an instance of type <tt>DenseObjectMatrix1D</tt> the new matrix must be of type <tt>DenseObjectMatrix2D</tt>, if the receiver is an instance of type <tt>SparseObjectMat... |
public int connectSrcHandlerToPackageSync(Context srcContext,Handler srcHandler,String dstPackageName,String dstClassName){
if (DBG) log("connect srcHandler to dst Package & class E");
mConnection=new AsyncChannelConnection();
mSrcContext=srcContext;
mSrcHandler=srcHandler;
mSrcMessenger=new Messenger(srcHa... | Connect handler to named package/class synchronously. |
@Override public int read() throws IOException {
synchronized (lock) {
checkNotClosed();
if (pos != count) {
return str.charAt(pos++);
}
return -1;
}
}
| Reads a single character from the source string and returns it as an integer with the two higher-order bytes set to 0. Returns -1 if the end of the source string has been reached. |
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 boolean canBuildFormatter(){
return isFormatter(getFormatter());
}
| Returns true if toFormatter can be called without throwing an UnsupportedOperationException. |
public void unsetMatchColumn(int[] columnIdxes) throws SQLException {
throw new UnsupportedOperationException();
}
| Unsets the designated parameter to the given int array. This was set using <code>setMatchColumn</code> as the column which will form the basis of the join. <P> The parameter value unset by this method should be same as was set. |
public static boolean areColinear(Vec4 a,Vec4 b,Vec4 c){
if (a == null || b == null || c == null) {
String msg=Logging.getMessage("nullValue.Vec4IsNull");
Logging.logger().severe(msg);
throw new IllegalArgumentException(msg);
}
Vec4 ab=b.subtract3(a).normalize3();
Vec4 bc=c.subtract3(b).normalize3()... | Indicates whether three vectors are colinear. |
protected void reset(Point treePoint){
this.drawPoint.x=this.bounds.x + treePoint.x;
this.drawPoint.y=this.bounds.y + treePoint.y;
this.screenBounds=new Rectangle(this.drawPoint.x,this.drawPoint.y,this.bounds.width,this.bounds.height);
int pickX=this.pickBounds.x + treePoint.x;
int pickY=this.pickBounds.y + t... | Reset the draw point to the lower left corner of the node bounds. |
public SimpleName newSimpleName(String identifier){
if (identifier == null) {
throw new IllegalArgumentException();
}
SimpleName result=new SimpleName(this);
result.setIdentifier(identifier);
return result;
}
| Creates and returns a new unparented simple name node for the given identifier. The identifier should be a legal Java identifier, but not a keyword, boolean literal ("true", "false") or null literal ("null"). |
public double unweightedMacroFmeasure(){
return m_delegate.unweightedMacroFmeasure();
}
| Unweighted macro-averaged F-measure. If some classes not present in the test set, they're just skipped (since recall is undefined there anyway) . |
public HadoopJobHistoryNodeExtractor(Properties prop) throws Exception {
this.serverURL=prop.getProperty(Constant.AZ_HADOOP_JOBHISTORY_KEY);
String CURRENT_DIR=System.getProperty("user.dir");
String WH_HOME=System.getenv("WH_HOME");
String USER_HOME=System.getenv("HOME") + "/.kerberos";
String ETC="/etc";
S... | Use HTTPClient to connect to Hadoop job history server. Need to set the environment for kerberos, keytab... |
public Interval withDurationBeforeEnd(ReadableDuration duration){
long durationMillis=DateTimeUtils.getDurationMillis(duration);
if (durationMillis == toDurationMillis()) {
return this;
}
Chronology chrono=getChronology();
long endMillis=getEndMillis();
long startMillis=chrono.add(endMillis,durationMill... | Creates a new interval with the specified duration before the end instant. |
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 Projection create(Properties props) throws ProjectionException {
try {
LatLonPoint llp=convertToLLP((Point2D)props.get(ProjectionFactory.CENTER));
float scale=PropUtils.floatFromProperties(props,ProjectionFactory.SCALE,10000000);
int height=PropUtils.intFromProperties(props,ProjectionFactory.HEIGHT... | Create the projection with the given parameters. |
@Override public void zoomRangeAxes(double lowerPercent,double upperPercent,PlotRenderingInfo info,Point2D source){
XYPlot subplot=findSubplot(info,source);
if (subplot != null) {
subplot.zoomRangeAxes(lowerPercent,upperPercent,info,source);
}
else {
for ( XYPlot p : this.subplots) {
p.zoomRange... | Zooms in on the range axes. |
private void startReconcilingPositions(){
presenter.addAllPositions(removedPositions);
removedPositionCount=removedPositions.size();
}
| Start reconciling positions. |
public void actionPerformed(ActionEvent e){
log.info("Cmd=" + e.getActionCommand());
if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) {
dispose();
return;
}
saveSelection();
if (selection != null && selection.size() > 0 && m_selectionActive && m_DD_Order_ID != null && m_MovementDate != null) ... | Action Listener |
UniformModel(final int numOutcomes){
mNumOutcomes=numOutcomes;
}
| Construct a uniform model. |
public int lengthOfLastWord(String s){
if (s == null || s.length() == 0) return 0;
int len=s.length();
int count=0;
for (int i=len - 1; i >= 0; i--) {
if (s.charAt(i) != ' ') count++;
if (s.charAt(i) == ' ' && count != 0) return count;
}
return count;
}
| Traverse backwards Use count to remember length of word Start counting from non-space char Return when next space is met and length is not zero |
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 void trace(String msg,Throwable t){
}
| Do nothing |
@Override protected void doGet(HttpServletRequest request,HttpServletResponse response){
processGetRequest(request,response);
}
| Handles the HTTP <code>GET</code> method. |
public ListIterator<VariableMapElement> iterator(){
return list.listIterator(0);
}
| Creates and returns an enumerator for this object |
public GPUImage3x3ConvolutionFilter(final float[] convolutionKernel){
super(THREE_X_THREE_TEXTURE_SAMPLING_FRAGMENT_SHADER);
mConvolutionKernel=convolutionKernel;
}
| Instantiates a new GPUimage3x3ConvolutionFilter with given convolution kernel. |
@RequestMapping(value=BUSINESS_OBJECT_DATA_NOTIFICATIONS_URI_PREFIX + "/namespaces/{namespace}/notificationNames/{notificationName}",method=RequestMethod.PUT) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_NOTIFICATION_REGISTRATIONS_PUT) public BusinessObjectDataNotificationRegistration updateBusinessObjectDataNoti... | Updates an existing business object data notification by key. <p>Requires WRITE permission on namespace</p> <p>Requires READ permission on filter namespace</p> <p>Requires EXECUTE permission on ALL job action namespaces</p> |
boolean isDimming(){
return mTargetAlpha != 0;
}
| Return true if dim layer is showing |
public static StringSet declaredSymbolsInScopeSet(ModuleNode module,Location loc){
StringSet result=new StringSet();
addDeclaredSymbolsInScopeSet(result,module,loc);
return result;
}
| Returns a HashSet containing all user-definable names that are globally defined or declared at Location loc of the module. The returned value may or may not contain strings that are not user-definable names--in particular strings like "I!bar". If the statement at loc defines or declares a symbol, that symbol does n... |
private final void increaseConcentration(double by){
setConcentration(getConcentration() + by);
}
| Increase the current concentration by a certain amount. According to increase the concentration the amount of nectar has to be recomputed. |
public PostProcessor(int fboWidth,int fboHeight,boolean useDepth,boolean useAlphaChannel,boolean use32Bits){
this(fboWidth,fboHeight,useDepth,useAlphaChannel,use32Bits,TextureWrap.ClampToEdge,TextureWrap.ClampToEdge);
}
| Construct a new PostProcessor with the given parameters, defaulting to <em>TextureWrap.ClampToEdge</em> as texture wrap mode |
public static void main(String[] args){
ComparableCircle comparableCircle1=new ComparableCircle(12.5);
ComparableCircle comparableCircle2=new ComparableCircle(18.3);
System.out.println("\nComparableCircle1:");
System.out.println(comparableCircle1);
System.out.println("\nComparableCircle2:");
System.out.prin... | Main method |
public FilterQuery track(final String[] track){
this.track=track;
return this;
}
| Sets track |
public static PolygonRDD SpatialRangeQueryUsingIndex(PolygonRDD polygonRDD,Envelope envelope,Integer condition){
if (polygonRDD.indexedRDDNoId == null) {
throw new NullPointerException("Need to invoke buildIndex() first, indexedRDDNoId is null");
}
JavaRDD<Polygon> result=polygonRDD.indexedRDDNoId.mapPartitio... | Spatial range query on top of PolygonRDD |
public byte[] analyzeWavData(InputStream i){
try {
int headSize=44, metaDataSize=48;
byte[] data=IOUtils.toByteArray(i);
if (data.length < headSize) {
throw new IOException("Wrong Wav header");
}
if (this.sampleRate == 0 && data.length > 28) {
this.sampleRate=readInt(data,24);
}
... | Analyze sample rate and return the PCM data |
public Quaterniond scale(double factor){
return scale(factor,this);
}
| Scale the rotation represented by this quaternion by the given <code>factor</code> using spherical linear interpolation. <p> This method is equivalent to performing a spherical linear interpolation between the unit quaternion and <code>this</code>, and thus equivalent to calling: <tt>new Quaterniond().slerp(this, facto... |
private void handleDispose(){
if (infoFont != null && !infoFont.isDisposed()) {
infoFont.dispose();
}
infoFont=null;
if (titleFont != null && !titleFont.isDisposed()) {
titleFont.dispose();
}
titleFont=null;
}
| The dialog is being disposed. Dispose of any resources allocated. |
public String prepareTable(ColumnInfo[] layout,String from,String where,boolean multiSelection,String tableName,boolean addAccessSQL){
int columnIndex=0;
StringBuffer sql=new StringBuffer("SELECT ");
setLayout(layout);
clearColumns();
setColorColumn(-1);
setMultiSelection(multiSelection);
for (columnIndex... | Prepare Table and return SQL required to get resultset to populate table |
public ReadInputRegistersRequest(int ref,int count){
super();
setFunctionCode(Modbus.READ_INPUT_REGISTERS);
setDataLength(4);
setReference(ref);
setWordCount(count);
}
| Constructs a new <tt>ReadInputRegistersRequest</tt> instance with a given reference and count of words to be read. <p> |
protected void correlatedPointAddedCallback(int correlatedTimeStep){
boolean sourceMatches=false;
if (Math.abs(sourceObs - source[correlatedTimeStep]) <= kernelWidthSourceInUse) {
countPastSource++;
sourceMatches=true;
}
if (Math.abs(destNextObs - destNext[correlatedTimeStep]) <= kernelWidthsInUse[0]) {... | A callback for where a correlated point is found at correlatedTimeStep in the destination's past. Now check whether we need to increment the joint counts. |
public void showFab(float translationX,float translationY){
setFabAnchor(translationX,translationY);
if (!isSheetVisible()) {
fab.show(translationX,translationY);
}
}
| Shows the FAB and sets the FAB's translation. |
@Override public void add(Permission permission){
if (!(permission instanceof PackagePermission)) throw new IllegalArgumentException("invalid permission: " + permission);
if (isReadOnly()) throw new SecurityException("attempt to add a Permission to a " + "readonly PermissionCollection");
PackagePermission pp=... | Adds a permission to the <tt>PackagePermission</tt> objects. The key for the hash is the name. |
protected boolean convertToUppercase(){
return false;
}
| Method convertToUppercase. |
public void queryGreaterThan(String type,int index,String value,int page,int limit,int visibilityScope,CloudResponse<CloudObject[]> response){
try {
queryImpl(type,value,index,page,limit,visibilityScope,2,0,false,false,false,response);
}
catch ( CloudException e) {
response.onError(e);
}
}
| Performs a query to the server finding the objects where the key value is greater than the given value. This operation executes immeditely without waiting for commit. |
public static byte[] parseSchemeSpecificData(byte[] atom,UUID uuid){
Pair<UUID,byte[]> parsedAtom=parsePsshAtom(atom);
if (parsedAtom == null) {
return null;
}
if (uuid != null && !uuid.equals(parsedAtom.first)) {
Log.w(TAG,"UUID mismatch. Expected: " + uuid + ", got: "+ parsedAtom.first+ ".");
retu... | Parses the scheme specific data from a PSSH atom. Version 0 and 1 PSSH atoms are supported. <p> The scheme specific data is only parsed if the data is a valid PSSH atom matching the given UUID, or if the data is a valid PSSH atom of any type in the case that the passed UUID is null. |
private boolean termFilter(Term term,String[] desiredFields,int minFreq,int maxFreq,int maxNonAlphabet,boolean filterNumbers,int minTermLength){
if (filterNumbers) {
try {
Double.parseDouble(term.text());
return false;
}
catch ( Exception e) {
}
}
return termFilter(term,desiredFields,m... | Applies termFilter and additionally (if requested) filters out digit-only words. |
protected String int2singlealphaCount(long val,CharArrayWrapper table){
int radix=table.getLength();
if (val > radix) {
return getZeroString();
}
else return (new Character(table.getChar((int)val - 1))).toString();
}
| Convert a long integer into alphabetic counting, in other words count using the sequence A B C ... Z. |
public void componentHidden(final ComponentEvent e){
setVisible(false);
}
| Invoked when the component has been made invisible. MenuComponent.setVisible does nothing, so we remove the ScreenMenuItem from the ScreenMenu but leave it in fItems |
protected Position computeMainLabelPosition(DrawContext dc,TacticalGraphicLabel label,Position midpoint,Position posB){
Globe globe=dc.getGlobe();
Vec4 pMid=globe.computePointFromPosition(midpoint);
Vec4 pB=globe.computePointFromPosition(posB);
Vec4 normal=globe.computeSurfaceNormalAtPoint(pMid);
Vec4 vMB=pB.... | Compute the position of the graphic's main label. This label is positioned to the side of the first segment along the route. |
protected void validateState(State currentState){
ValidationUtils.validateState(currentState);
}
| Validate the service state for coherence. |
public void updateTableEntity(TableEntity tableEntity,boolean commit){
SolrInputDocument doc=new SolrInputDocument();
doc.setField(ID,tableEntity.getFqdn());
doc.setField(TYPE,TYPE_TABLE);
doc.setField(DATABASE_NAME,tableEntity.getDatabaseName());
doc.setField(TABLE_NAME,tableEntity.getTableName());
doc.set... | Updates the Solr document for the given table entity |
private ArrayDBIDs initialSet(DBIDs sampleSet,int k,Random random){
return DBIDUtil.ensureArray(DBIDUtil.randomSample(sampleSet,k,random));
}
| Returns a set of k elements from the specified sample set. |
private byte[] blockFragmentizerSafe(long blockIdx) throws IOException {
try {
try {
return block(blockIdx);
}
catch ( IgfsCorruptedFileException e) {
if (log.isDebugEnabled()) log.debug("Failed to fetch file block [path=" + path + ", fileInfo="+ fileInfo+ ", blockIdx="+ blockIdx+ ", err... | Method to safely retrieve file block. In case if file block is missing this method will check file map and update file info. This may be needed when file that we are reading is concurrently fragmented. |
public ReplacableProperties loadProperties(){
ReplacableProperties propertiesBeingLoaded=new ReplacableProperties();
try (InputStream propertiesToLoad=PlayOnLinuxContext.class.getClassLoader().getResourceAsStream(this.getPropertyFileName())){
propertiesBeingLoaded.load(propertiesToLoad);
}
catch ( PlayOnLin... | Get the properties for the current OS |
public ThumbnailParameterBuilder fitWithinDimensions(boolean fit){
this.fitWithinDimensions=fit;
return this;
}
| Sets whether or not the thumbnail should fit within the specified dimensions. |
private boolean isBoundsEnforced(){
return boundsEnforced;
}
| True iff bounds checking is performed on variable values indices. |
@SuppressWarnings("unchecked") public JdbcData(Connection connection,String table,boolean buffered){
this.connection=connection;
this.table=table;
setBuffered(buffered);
try {
setColumnTypes(getJdbcColumnTypes());
}
catch ( SQLException e) {
e.printStackTrace();
}
}
| Initializes a new instance to query the data from a specified table using a specified JDBC connection. It is assumed the table columns are constant during the connection. |
public void dispatch(){
try {
if (catchExceptions) {
try {
runnable.run();
}
catch ( Throwable t) {
if (t instanceof Exception) {
exception=(Exception)t;
}
throwable=t;
}
}
else {
runnable.run();
}
}
finally {
finishedDispatc... | Executes the Runnable's <code>run()</code> method and notifies the notifier (if any) when <code>run()</code> has returned or thrown an exception. |
public void lock(){
lockPositions(true);
this.locked=true;
}
| Lock this Order. |
private int measureLong(int measureSpec){
int result;
int specMode=MeasureSpec.getMode(measureSpec);
int specSize=MeasureSpec.getSize(measureSpec);
if ((specMode == MeasureSpec.EXACTLY) || (mViewPager == null)) {
result=specSize;
}
else {
final int count=mViewPager.getAdapter().getCount();
result... | Determines the width of this view |
public void trace(String format,Object arg1,Object arg2){
}
| Do nothing |
public static String makeKey(String host,int port,String transport){
return new StringBuffer(host).append(":").append(port).append("/").append(transport).toString().toLowerCase();
}
| Construct a key to refer to this structure from the SIP stack |
protected void buildSettings(){
SETTINGS=SEARCH_SETTINGS;
}
| Sets SETTINGS to be the static SEARCH_SETTINGS, instead of constructing a new one for each ResultPanel. |
public void testNoElementThrowsException(){
try {
util.selectElementMatchingXPath("app-deployment",testElement);
fail("should have thrown an exception");
}
catch ( ElementNotFoundException e) {
assertEquals(testElement,e.getSearched());
}
}
| Test that search for a non-existing element throws an exception. |
public String replace(final StringBuffer source,final int offset,final int length){
if (source == null) {
return null;
}
final StrBuilder buf=new StrBuilder(length).append(source,offset,length);
substitute(buf,0,length);
return buf.toString();
}
| Replaces all the occurrences of variables with their matching values from the resolver using the given source buffer as a template. The buffer is not altered by this method. <p> Only the specified portion of the buffer will be processed. The rest of the buffer is not processed, and is not returned. |
public Builder addKernel(Script.KernelID k){
if (mLines.size() != 0) {
throw new RSInvalidStateException("Kernels may not be added once connections exist.");
}
if (findNode(k) != null) {
return this;
}
mKernelCount++;
Node n=findNode(k.mScript);
if (n == null) {
n=new Node(k.mScript);
mNod... | Adds a Kernel to the group. |
@Override public void unregisterVASACertificate(String existingCertificate) throws InvalidCertificate, InvalidSession, StorageFault {
final String methodName="unregisterVASACertificate(): ";
log.debug(methodName + "Entry with input existingCertificate[" + (existingCertificate != null ? "***" : null)+ "]");
try {
... | vasaService interface |
K key(){
return key;
}
| Getter of key. |
private void clearListSelection(){
_pathList.clearSelection();
int state=_block.getState() & ~OBlock.ALLOCATED;
_block.pseudoPropertyChange("state",Integer.valueOf(0),Integer.valueOf(state));
_length.setText("");
}
| *********************** end setup |
public static String[] stringArrayFromString(String string,char delimiter){
List<String> result=new ArrayList<String>(10);
if (StringUtils.isNotBlank(string)) {
RaptorStringTokenizer tok=new RaptorStringTokenizer(string,String.valueOf(delimiter),false);
while (tok.hasMoreTokens()) {
String token=tok.n... | Returns a String[] of strings from a string that is formatted in what toString(String[]) returns. |
public boolean startsWith(XMLString prefix){
return startsWith(prefix,0);
}
| Tests if this string starts with the specified prefix. |
public boolean isEnableMove(){
return this.enableMove;
}
| Specifies whether the user can move the frame by dragging the title bar. |
public String toString(){
return "[Certificate Exception: " + getMessage() + "]";
}
| Returns a string describing the certificate exception. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.